@rubytech/create-realagent 1.0.847 → 1.0.850

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 (121) hide show
  1. package/dist/__tests__/port-canonicalisation.test.js +1 -0
  2. package/dist/__tests__/snap-chromium.test.js +115 -0
  3. package/dist/index.js +201 -1
  4. package/dist/port-resolution.js +1 -1
  5. package/dist/snap-chromium.js +89 -0
  6. package/package.json +1 -1
  7. package/payload/platform/plugins/admin/skills/onboarding/SKILL.md +1 -1
  8. package/payload/platform/plugins/admin/skills/public-agent-manager/SKILL.md +2 -2
  9. package/payload/platform/plugins/cloudflare/PLUGIN.md +1 -1
  10. package/payload/platform/plugins/cloudflare/scripts/setup-tunnel.sh +25 -7
  11. package/payload/platform/plugins/cloudflare/skills/setup-tunnel/SKILL.md +1 -1
  12. package/payload/platform/plugins/docs/references/adherence.md +1 -1
  13. package/payload/platform/plugins/docs/references/deployment.md +8 -0
  14. package/payload/platform/plugins/docs/references/plugins-guide.md +4 -2
  15. package/payload/platform/plugins/docs/references/troubleshooting.md +33 -0
  16. package/payload/platform/plugins/linkedin-import/PLUGIN.md +2 -2
  17. package/payload/platform/plugins/linkedin-import/skills/linkedin-import/references/connections.md +2 -2
  18. package/payload/platform/plugins/memory/PLUGIN.md +1 -1
  19. package/payload/platform/plugins/memory/references/schema-base.md +1 -1
  20. package/payload/platform/scripts/test-laptop-vnc-boot.sh +81 -0
  21. package/payload/platform/scripts/vnc.sh +42 -2
  22. package/payload/platform/templates/agents/admin/AGENTS.md +6 -4
  23. package/payload/platform/templates/agents/admin/IDENTITY.md +6 -2
  24. package/payload/platform/templates/specialists/agents/content-producer.md +2 -2
  25. package/payload/premium-plugins/real-agency/BUNDLE.md +3 -3
  26. package/payload/premium-plugins/real-agency/agents/valuer.md +10 -0
  27. package/payload/premium-plugins/real-agency/plugins/buyers/skills/buyer-management/SKILL.md +42 -0
  28. package/payload/premium-plugins/real-agency/plugins/buyers/skills/buyer-management/references/buyer-qualification-questions.md +16 -0
  29. package/payload/premium-plugins/real-agency/plugins/buyers/skills/buyer-management/references/buyer-qualification.md +59 -0
  30. package/payload/premium-plugins/real-agency/plugins/buyers/skills/buyer-management/references/buyer-scripts.md +63 -0
  31. package/payload/premium-plugins/real-agency/plugins/buyers/skills/buyer-management/references/buyer-working-scripts.md +54 -0
  32. package/payload/premium-plugins/real-agency/plugins/buyers/skills/buyer-management/references/feedback-collection.md +42 -0
  33. package/payload/premium-plugins/real-agency/plugins/buyers/skills/buyer-management/references/offer-capture.md +38 -0
  34. package/payload/premium-plugins/real-agency/plugins/buyers/skills/buyer-management/references/viewing-booking.md +32 -0
  35. package/payload/premium-plugins/real-agency/plugins/buyers/skills/buyer-management/references/viewing-management.md +52 -0
  36. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/negotiation/SKILL.md +35 -0
  37. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/negotiation/references/deal-saving.md +47 -0
  38. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/negotiation/references/negotiation-deep-guide.md +64 -0
  39. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/negotiation/references/negotiation-prep-principles.md +29 -0
  40. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/negotiation/references/negotiation-techniques.md +42 -0
  41. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/negotiation/references/offer-presentation.md +43 -0
  42. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/sales-negotiation/SKILL.md +29 -0
  43. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/sales-negotiation/references/chris-voss-negotiation.md +70 -0
  44. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/sales-negotiation/references/phil-jones-price-words.md +40 -0
  45. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/sales-negotiation/references/serhant-negotiation-plus.md +55 -0
  46. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/sales-negotiation/references/tom-panos-commission-pricing.md +57 -0
  47. package/payload/premium-plugins/real-agency/plugins/estate-sales/skills/sales-negotiation/references/tony-morris-questioning.md +54 -0
  48. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts +6 -4
  49. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -1
  50. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js +82 -10
  51. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -1
  52. package/payload/premium-plugins/real-agency/plugins/loop/mcp/src/lib/loop-api.ts +111 -15
  53. package/payload/server/chunk-DIRNBH7F.js +1603 -0
  54. package/payload/server/chunk-GOO2J3X7.js +10561 -0
  55. package/payload/server/chunk-LCAFHNZR.js +10420 -0
  56. package/payload/server/chunk-X3LVMXI5.js +10578 -0
  57. package/payload/server/client-pool-7Z6YRUQT.js +34 -0
  58. package/payload/server/maxy-edge.js +2 -2
  59. package/payload/server/public/assets/{admin-DFUet1XM.js → admin-Dyl8uNxX.js} +1 -1
  60. package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-Bs5MjIKf.js → architectureDiagram-Q4EWVU46-BePoi8XC.js} +1 -1
  61. package/payload/server/public/assets/{blockDiagram-DXYQGD6D-BVSXiX4T.js → blockDiagram-DXYQGD6D-BkiwLTtq.js} +1 -1
  62. package/payload/server/public/assets/{c4Diagram-AHTNJAMY-DBqsWCjl.js → c4Diagram-AHTNJAMY-bpjPj2Ln.js} +1 -1
  63. package/payload/server/public/assets/channel-D3U0_a1j.js +1 -0
  64. package/payload/server/public/assets/{chunk-336JU56O-COUTB2TN.js → chunk-336JU56O-BpATJiGl.js} +2 -2
  65. package/payload/server/public/assets/{chunk-426QAEUC-zKsTsXw6.js → chunk-426QAEUC-Wz6Bpsil.js} +1 -1
  66. package/payload/server/public/assets/{chunk-4TB4RGXK-CI9i2J5g.js → chunk-4TB4RGXK-CLXL19Wd.js} +1 -1
  67. package/payload/server/public/assets/{chunk-5FUZZQ4R-DfchzZ2Y.js → chunk-5FUZZQ4R-BoTfWHuW.js} +1 -1
  68. package/payload/server/public/assets/{chunk-5PVQY5BW-_iMyxz0C.js → chunk-5PVQY5BW-RhIfPCRB.js} +1 -1
  69. package/payload/server/public/assets/{chunk-EDXVE4YY-Ddtw_ZHk.js → chunk-EDXVE4YY-utELKGQK.js} +1 -1
  70. package/payload/server/public/assets/{chunk-ENJZ2VHE-BrGMkslM.js → chunk-ENJZ2VHE-CNHjq5xK.js} +1 -1
  71. package/payload/server/public/assets/{chunk-ICPOFSXX-DHInTpuR.js → chunk-ICPOFSXX-Di63NBur.js} +1 -1
  72. package/payload/server/public/assets/{chunk-OYMX7WX6-mOQ4KZ9j.js → chunk-OYMX7WX6-BSPzqyxs.js} +1 -1
  73. package/payload/server/public/assets/{chunk-U2HBQHQK-D5vGkUe9.js → chunk-U2HBQHQK-BZnA7c4T.js} +1 -1
  74. package/payload/server/public/assets/{chunk-X2U36JSP-CnNxZbqc.js → chunk-X2U36JSP-DpQ2OA_c.js} +1 -1
  75. package/payload/server/public/assets/{chunk-YZCP3GAM-Cb7OSc_r.js → chunk-YZCP3GAM-BAkNXu0G.js} +1 -1
  76. package/payload/server/public/assets/{chunk-ZZ45TVLE-BipxpzL8.js → chunk-ZZ45TVLE-DBSm41oP.js} +1 -1
  77. package/payload/server/public/assets/classDiagram-6PBFFD2Q-6EGGLDD_.js +1 -0
  78. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DfAV4tgE.js +1 -0
  79. package/payload/server/public/assets/clone-BoV8noAi.js +1 -0
  80. package/payload/server/public/assets/{dagre-KV5264BT-B91sXKT2.js → dagre-KV5264BT-BkvWofSp.js} +1 -1
  81. package/payload/server/public/assets/{dagre-lObrgXUJ.js → dagre-nvPNAunb.js} +1 -1
  82. package/payload/server/public/assets/{diagram-5BDNPKRD-DB2Kcx9r.js → diagram-5BDNPKRD-CMEgyt4E.js} +1 -1
  83. package/payload/server/public/assets/{diagram-G4DWMVQ6-Cq1J05SW.js → diagram-G4DWMVQ6-ChorrAF0.js} +1 -1
  84. package/payload/server/public/assets/{diagram-MMDJMWI5-CwqXxUXd.js → diagram-MMDJMWI5-D_iD27po.js} +1 -1
  85. package/payload/server/public/assets/{diagram-TYMM5635-Nmk38u6a.js → diagram-TYMM5635-8qXI1ioG.js} +1 -1
  86. package/payload/server/public/assets/{erDiagram-SMLLAGMA-D2EfAdSD.js → erDiagram-SMLLAGMA-BFjtKDSB.js} +1 -1
  87. package/payload/server/public/assets/{flowDiagram-DWJPFMVM-CS98o6Jz.js → flowDiagram-DWJPFMVM-Bpd7IL9l.js} +1 -1
  88. package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-rWm6xQ8t.js → ganttDiagram-T4ZO3ILL-CwOozU85.js} +1 -1
  89. package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-BuwECvwx.js → gitGraphDiagram-UUTBAWPF-CcPILiC9.js} +1 -1
  90. package/payload/server/public/assets/{graphlib-BXEED8qM.js → graphlib-B_mcXEVr.js} +1 -1
  91. package/payload/server/public/assets/{infoDiagram-42DDH7IO-CEmJMuVh.js → infoDiagram-42DDH7IO-T2sn--WJ.js} +1 -1
  92. package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-CAQMMx-Y.js → ishikawaDiagram-UXIWVN3A-DOP9-Q8H.js} +1 -1
  93. package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-toHrBGCq.js → journeyDiagram-VCZTEJTY-DGATg0WC.js} +1 -1
  94. package/payload/server/public/assets/{kanban-definition-6JOO6SKY-DwXLkenV.js → kanban-definition-6JOO6SKY-C5PigmKg.js} +1 -1
  95. package/payload/server/public/assets/{line-BkM2KuUb.js → line-DlKKhwkO.js} +1 -1
  96. package/payload/server/public/assets/{mermaid-parser.core-CsaDWYZC.js → mermaid-parser.core-C8xGCa9p.js} +1 -1
  97. package/payload/server/public/assets/{mermaid.core-CvICILSR.js → mermaid.core-CCUSwZB_.js} +3 -3
  98. package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-DQyCWpKS.js → mindmap-definition-QFDTVHPH-75k-IVhC.js} +1 -1
  99. package/payload/server/public/assets/{pieDiagram-DEJITSTG-CVRIcK6b.js → pieDiagram-DEJITSTG-DN5RsDwZ.js} +1 -1
  100. package/payload/server/public/assets/preload-helper-qlgyTAkD.js +1 -0
  101. package/payload/server/public/assets/{public-CR_CX3K5.js → public-B_PNZUph.js} +1 -1
  102. package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-CnfXm2xw.js → quadrantDiagram-34T5L4WZ-Sd9x6pNe.js} +1 -1
  103. package/payload/server/public/assets/{requirementDiagram-MS252O5E-BntW6fnu.js → requirementDiagram-MS252O5E-BDgifYzj.js} +1 -1
  104. package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-Bt6AfgXn.js → sankeyDiagram-XADWPNL6-BX9VULNJ.js} +1 -1
  105. package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-D6s0kP6H.js → sequenceDiagram-FGHM5R23-z3vMxhgE.js} +1 -1
  106. package/payload/server/public/assets/{stateDiagram-FHFEXIEX-B9y9cOff.js → stateDiagram-FHFEXIEX-DlP0hBxF.js} +1 -1
  107. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-DSddQStC.js +1 -0
  108. package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-DIFjQGfl.js → timeline-definition-GMOUNBTQ-DwQbhKCo.js} +1 -1
  109. package/payload/server/public/assets/{useVoiceRecorder-DWRtIHOw.js → useVoiceRecorder-fD0IWzJj.js} +3 -3
  110. package/payload/server/public/assets/{vennDiagram-DHZGUBPP-YRVHIBU9.js → vennDiagram-DHZGUBPP-WTqmZWWa.js} +1 -1
  111. package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-B20PPeAr.js → wardleyDiagram-NUSXRM2D-BUY50x5T.js} +1 -1
  112. package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-BztKw58Q.js → xychartDiagram-5P7HB3ND-Btdq-fDj.js} +1 -1
  113. package/payload/server/public/index.html +3 -3
  114. package/payload/server/public/public.html +3 -3
  115. package/payload/server/server.js +6 -3
  116. package/payload/server/public/assets/channel-lEc18pSi.js +0 -1
  117. package/payload/server/public/assets/classDiagram-6PBFFD2Q-rkW6IED-.js +0 -1
  118. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-CRQJXpMG.js +0 -1
  119. package/payload/server/public/assets/clone-icRAjexu.js +0 -1
  120. package/payload/server/public/assets/preload-helper-bPV_ZjF3.js +0 -1
  121. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-DH4gbGCS.js +0 -1
@@ -1,4 +1,4 @@
1
- import{g as e,h as t,p as n}from"./src-Bo15iQ7w.js";import{B as r,C as i,D as a,L as o,P as s,U as c,V as l,W as u,_ as d,a as f,b as p,c as m,i as h,k as g,r as _,s as v,v as y,y as b}from"./chunk-ICPOFSXX-DHInTpuR.js";import{t as x}from"./dist-CrzV1W3-.js";import{f as S,h as C}from"./chunk-5PVQY5BW-_iMyxz0C.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./chunk-YZCP3GAM-Cb7OSc_r.js";import{t as A}from"./chunk-QZHKN3VN-BAQp1OEl.js";import{n as j,t as M}from"./chunk-XPW4576I-BccP1mlQ.js";var N=x(),P=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],L=[1,74],ee=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:L},{23:75,55:76,73:L},{23:77,73:F},{69:78,72:[1,79],78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),e(I,[2,6]),e(I,[2,16]),e(ve,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(ye,a,{7:120}),e(ye,a,{7:121}),e(ye,a,{7:122}),e(be,a,{41:123,7:124}),e(xe,a,{43:125,7:126}),e(xe,a,{7:126,43:127}),e(Se,a,{46:128,7:129}),e(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(Ce,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ve,[2,11]),{13:186,51:D,53:O,54:k},e(ve,[2,13]),e(ve,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ve,[2,12]),e(be,a,{7:124,41:201}),e(xe,a,{7:126,43:202}),e(Se,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(Ce,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,h as t,p as n}from"./src-Bo15iQ7w.js";import{B as r,C as i,D as a,L as o,P as s,U as c,V as l,W as u,_ as d,a as f,b as p,c as m,i as h,k as g,r as _,s as v,v as y,y as b}from"./chunk-ICPOFSXX-Di63NBur.js";import{t as x}from"./dist-CrzV1W3-.js";import{f as S,h as C}from"./chunk-5PVQY5BW-RhIfPCRB.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./chunk-YZCP3GAM-BAkNXu0G.js";import{t as A}from"./chunk-QZHKN3VN-BAQp1OEl.js";import{n as j,t as M}from"./chunk-XPW4576I-BccP1mlQ.js";var N=x(),P=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],L=[1,74],ee=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:L},{23:75,55:76,73:L},{23:77,73:F},{69:78,72:[1,79],78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),e(I,[2,6]),e(I,[2,16]),e(ve,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(ye,a,{7:120}),e(ye,a,{7:121}),e(ye,a,{7:122}),e(be,a,{41:123,7:124}),e(xe,a,{43:125,7:126}),e(xe,a,{7:126,43:127}),e(Se,a,{46:128,7:129}),e(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(Ce,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ve,[2,11]),{13:186,51:D,53:O,54:k},e(ve,[2,13]),e(ve,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ve,[2,12]),e(be,a,{7:124,41:201}),e(xe,a,{7:126,43:202}),e(Se,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(Ce,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};we.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{g as e,h as t,p as n}from"./src-Bo15iQ7w.js";import{D as r,b as i,c as a,s as o}from"./chunk-ICPOFSXX-DHInTpuR.js";import"./dist-CrzV1W3-.js";import{H as s,h as c}from"./chunk-5PVQY5BW-_iMyxz0C.js";import{t as l}from"./line-BkM2KuUb.js";import"./chunk-U2HBQHQK-D5vGkUe9.js";import"./chunk-BSJP7CBP-CTsYuARh.js";import"./chunk-ZZ45TVLE-BipxpzL8.js";import{t as u}from"./graphlib-BXEED8qM.js";import{t as d}from"./dagre-lObrgXUJ.js";import"./chunk-55IACEB6-CzqB8aoU.js";import"./chunk-EDXVE4YY-Ddtw_ZHk.js";import"./chunk-X2U36JSP-CnNxZbqc.js";import"./chunk-5FUZZQ4R-DfchzZ2Y.js";import"./chunk-ENJZ2VHE-BrGMkslM.js";import"./chunk-336JU56O-COUTB2TN.js";import{i as f,n as p,t as m}from"./chunk-OYMX7WX6-mOQ4KZ9j.js";var h=t(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,i().state.sizeUnit).attr(`cx`,i().state.padding+i().state.sizeUnit).attr(`cy`,i().state.padding+i().state.sizeUnit),`drawStartState`),g=t(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,i().state.textHeight).attr(`class`,`divider`).attr(`x2`,i().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=t((e,t)=>{let n=e.append(`text`).attr(`x`,2*i().state.padding).attr(`y`,i().state.textHeight+2*i().state.padding).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,i().state.padding).attr(`y`,i().state.padding).attr(`width`,r.width+2*i().state.padding).attr(`height`,r.height+2*i().state.padding).attr(`rx`,i().state.radius),n},`drawSimpleState`),v=t((e,n)=>{let r=t(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*i().state.padding).text(t);n||r.attr(`dy`,i().state.textHeight)},`addTspan`),a=e.append(`text`).attr(`x`,2*i().state.padding).attr(`y`,i().state.textHeight+1.3*i().state.padding).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),o=a.height,s=e.append(`text`).attr(`x`,i().state.padding).attr(`y`,o+i().state.padding*.4+i().state.dividerMargin+i().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=e.append(`line`).attr(`x1`,i().state.padding).attr(`y1`,i().state.padding+o+i().state.dividerMargin/2).attr(`y2`,i().state.padding+o+i().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,a.width);return u.attr(`x2`,f+3*i().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,i().state.padding).attr(`y`,i().state.padding).attr(`width`,f+2*i().state.padding).attr(`height`,d.height+o+2*i().state.padding).attr(`rx`,i().state.radius),e},`drawDescrState`),y=t((e,t,n)=>{let r=i().state.padding,a=2*i().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,i().state.titleShift).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+a,d=Math.max(u,s);d===s&&(d+=a);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-i().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+i().state.textHeight+i().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-a)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,i().state.titleShift-i().state.textHeight-i().state.padding).attr(`width`,d).attr(`height`,i().state.textHeight*3).attr(`rx`,i().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,i().state.titleShift-i().state.textHeight-i().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*i().state.textHeight).attr(`rx`,i().state.radius),e},`addTitleAndBox`),b=t(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,i().state.sizeUnit+i().state.miniPadding).attr(`cx`,i().state.padding+i().state.sizeUnit+i().state.miniPadding).attr(`cy`,i().state.padding+i().state.sizeUnit+i().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,i().state.sizeUnit).attr(`cx`,i().state.padding+i().state.sizeUnit+2).attr(`cy`,i().state.padding+i().state.sizeUnit+2)),`drawEndState`),x=t((e,t)=>{let n=i().state.forkWidth,r=i().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,i().state.padding).attr(`y`,i().state.padding)},`drawForkJoinState`),S=t((e,t,n,r)=>{let a=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(o.lineBreakRegex),u=1.25*i().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}a+=u,e.attr(`x`,t+i().state.noteMargin),e.attr(`y`,n+a+1.25*i().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:a}},`_drawLongText`),C=t((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,i().state.padding),{textWidth:r,textHeight:a}=S(e,0,0,t.append(`g`));return n.attr(`height`,a+2*i().state.noteMargin),n.attr(`width`,r+i().state.noteMargin*2),n},`drawNote`),w=t(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},a=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(a),t.type===`end`&&b(a),(t.type===`fork`||t.type===`join`)&&x(a,t),t.type===`note`&&C(t.note.text,a),t.type===`divider`&&g(a),t.type===`default`&&t.descriptions.length===0&&_(a,t),t.type===`default`&&t.descriptions.length>0&&v(a,t);let o=a.node().getBBox();return r.width=o.width+2*i().state.padding,r.height=o.height+2*i().state.padding,r},`drawState`),T=0,E=t(function(n,a,u){let d=t(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);a.points=a.points.filter(e=>!Number.isNaN(e.y));let f=a.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=n.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(i().state.arrowMarkerAbsolute&&(g=r(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let t=n.append(`g`).attr(`class`,`stateLabel`),{x:r,y:s}=c.calcLabelPosition(a.points),l=o.getRows(u.title),d=0,f=[],p=0,m=0;for(let n=0;n<=l.length;n++){let i=t.append(`text`).attr(`text-anchor`,`middle`).text(l[n]).attr(`x`,r).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),e.info(a.x,r,s+d),d===0&&(d=i.node().getBBox().height,e.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=t.node().getBBox();t.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-i().state.padding/2).attr(`y`,s-h/2-i().state.padding/2-3.5).attr(`width`,p+i().state.padding).attr(`height`,h+i().state.padding),e.info(g)}T++},`drawEdge`),D,O={},k=t(function(){},`setConf`),A=t(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=t(function(t,r,o,s){D=i().state;let c=i().securityLevel,l;c===`sandbox`&&(l=n(`#i`+r));let u=n(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;e.debug(`Rendering diagram `+t);let f=u.select(`[id='${r}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,r+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;a(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=t(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=t((t,n,r,i,a,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<t.length;f++)if(t[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let o;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);o=N(t.doc,e,t.id,!i,a,s,c);{e=y(e,t,i);let n=e.node().getBBox();o.width=n.width,o.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else o=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(o.id+`-note`,e),l.setNode(o.id,o)):(l.setNode(o.id,o),l.setNode(o.id+`-note`,e)),l.setParent(o.id,o.id+`-group`),l.setParent(o.id+`-note`,o.id+`-group`)}else l.setNode(o.id,o)}e.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(t){_++,e.debug(`Setting edge`,t),l.setEdge(t.id1,t.id2,{relation:t,width:M(t.title),height:D.labelHeight*o.getRows(t.title).length,labelpos:`c`},`id`+_)}),d(l),e.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(t){t!==void 0&&l.node(t)!==void 0?(e.warn(`Node `+t+`: `+JSON.stringify(l.node(t))),a.select(`#`+v.id+` #`+t).attr(`transform`,`translate(`+(l.node(t).x-l.node(t).width/2)+`,`+(l.node(t).y+(O[t]?O[t].y:0)-l.node(t).height/2)+` )`),a.select(`#`+v.id+` #`+t).attr(`data-x-shift`,l.node(t).x-l.node(t).width/2),s.querySelectorAll(`#`+v.id+` #`+t+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):e.debug(`No Node `+t+`: `+JSON.stringify(l.node(t)))});let b=v.getBBox();l.edges().forEach(function(t){t!==void 0&&l.edge(t)!==void 0&&(e.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(l.edge(t))),E(n,l.edge(t),l.edge(t).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,e.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:t(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
1
+ import{g as e,h as t,p as n}from"./src-Bo15iQ7w.js";import{D as r,b as i,c as a,s as o}from"./chunk-ICPOFSXX-Di63NBur.js";import"./dist-CrzV1W3-.js";import{H as s,h as c}from"./chunk-5PVQY5BW-RhIfPCRB.js";import{t as l}from"./line-DlKKhwkO.js";import"./chunk-U2HBQHQK-BZnA7c4T.js";import"./chunk-BSJP7CBP-CTsYuARh.js";import"./chunk-ZZ45TVLE-DBSm41oP.js";import{t as u}from"./graphlib-B_mcXEVr.js";import{t as d}from"./dagre-nvPNAunb.js";import"./chunk-55IACEB6-CzqB8aoU.js";import"./chunk-EDXVE4YY-utELKGQK.js";import"./chunk-X2U36JSP-DpQ2OA_c.js";import"./chunk-5FUZZQ4R-BoTfWHuW.js";import"./chunk-ENJZ2VHE-CNHjq5xK.js";import"./chunk-336JU56O-BpATJiGl.js";import{i as f,n as p,t as m}from"./chunk-OYMX7WX6-BSPzqyxs.js";var h=t(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,i().state.sizeUnit).attr(`cx`,i().state.padding+i().state.sizeUnit).attr(`cy`,i().state.padding+i().state.sizeUnit),`drawStartState`),g=t(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,i().state.textHeight).attr(`class`,`divider`).attr(`x2`,i().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=t((e,t)=>{let n=e.append(`text`).attr(`x`,2*i().state.padding).attr(`y`,i().state.textHeight+2*i().state.padding).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,i().state.padding).attr(`y`,i().state.padding).attr(`width`,r.width+2*i().state.padding).attr(`height`,r.height+2*i().state.padding).attr(`rx`,i().state.radius),n},`drawSimpleState`),v=t((e,n)=>{let r=t(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*i().state.padding).text(t);n||r.attr(`dy`,i().state.textHeight)},`addTspan`),a=e.append(`text`).attr(`x`,2*i().state.padding).attr(`y`,i().state.textHeight+1.3*i().state.padding).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),o=a.height,s=e.append(`text`).attr(`x`,i().state.padding).attr(`y`,o+i().state.padding*.4+i().state.dividerMargin+i().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=e.append(`line`).attr(`x1`,i().state.padding).attr(`y1`,i().state.padding+o+i().state.dividerMargin/2).attr(`y2`,i().state.padding+o+i().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,a.width);return u.attr(`x2`,f+3*i().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,i().state.padding).attr(`y`,i().state.padding).attr(`width`,f+2*i().state.padding).attr(`height`,d.height+o+2*i().state.padding).attr(`rx`,i().state.radius),e},`drawDescrState`),y=t((e,t,n)=>{let r=i().state.padding,a=2*i().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,i().state.titleShift).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+a,d=Math.max(u,s);d===s&&(d+=a);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-i().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+i().state.textHeight+i().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-a)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,i().state.titleShift-i().state.textHeight-i().state.padding).attr(`width`,d).attr(`height`,i().state.textHeight*3).attr(`rx`,i().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,i().state.titleShift-i().state.textHeight-i().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*i().state.textHeight).attr(`rx`,i().state.radius),e},`addTitleAndBox`),b=t(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,i().state.sizeUnit+i().state.miniPadding).attr(`cx`,i().state.padding+i().state.sizeUnit+i().state.miniPadding).attr(`cy`,i().state.padding+i().state.sizeUnit+i().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,i().state.sizeUnit).attr(`cx`,i().state.padding+i().state.sizeUnit+2).attr(`cy`,i().state.padding+i().state.sizeUnit+2)),`drawEndState`),x=t((e,t)=>{let n=i().state.forkWidth,r=i().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,i().state.padding).attr(`y`,i().state.padding)},`drawForkJoinState`),S=t((e,t,n,r)=>{let a=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(o.lineBreakRegex),u=1.25*i().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}a+=u,e.attr(`x`,t+i().state.noteMargin),e.attr(`y`,n+a+1.25*i().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:a}},`_drawLongText`),C=t((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,i().state.padding),{textWidth:r,textHeight:a}=S(e,0,0,t.append(`g`));return n.attr(`height`,a+2*i().state.noteMargin),n.attr(`width`,r+i().state.noteMargin*2),n},`drawNote`),w=t(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},a=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(a),t.type===`end`&&b(a),(t.type===`fork`||t.type===`join`)&&x(a,t),t.type===`note`&&C(t.note.text,a),t.type===`divider`&&g(a),t.type===`default`&&t.descriptions.length===0&&_(a,t),t.type===`default`&&t.descriptions.length>0&&v(a,t);let o=a.node().getBBox();return r.width=o.width+2*i().state.padding,r.height=o.height+2*i().state.padding,r},`drawState`),T=0,E=t(function(n,a,u){let d=t(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);a.points=a.points.filter(e=>!Number.isNaN(e.y));let f=a.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=n.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(i().state.arrowMarkerAbsolute&&(g=r(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let t=n.append(`g`).attr(`class`,`stateLabel`),{x:r,y:s}=c.calcLabelPosition(a.points),l=o.getRows(u.title),d=0,f=[],p=0,m=0;for(let n=0;n<=l.length;n++){let i=t.append(`text`).attr(`text-anchor`,`middle`).text(l[n]).attr(`x`,r).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),e.info(a.x,r,s+d),d===0&&(d=i.node().getBBox().height,e.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=t.node().getBBox();t.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-i().state.padding/2).attr(`y`,s-h/2-i().state.padding/2-3.5).attr(`width`,p+i().state.padding).attr(`height`,h+i().state.padding),e.info(g)}T++},`drawEdge`),D,O={},k=t(function(){},`setConf`),A=t(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=t(function(t,r,o,s){D=i().state;let c=i().securityLevel,l;c===`sandbox`&&(l=n(`#i`+r));let u=n(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;e.debug(`Rendering diagram `+t);let f=u.select(`[id='${r}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,r+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;a(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=t(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=t((t,n,r,i,a,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<t.length;f++)if(t[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let o;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);o=N(t.doc,e,t.id,!i,a,s,c);{e=y(e,t,i);let n=e.node().getBBox();o.width=n.width,o.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else o=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(o.id+`-note`,e),l.setNode(o.id,o)):(l.setNode(o.id,o),l.setNode(o.id+`-note`,e)),l.setParent(o.id,o.id+`-group`),l.setParent(o.id+`-note`,o.id+`-group`)}else l.setNode(o.id,o)}e.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(t){_++,e.debug(`Setting edge`,t),l.setEdge(t.id1,t.id2,{relation:t,width:M(t.title),height:D.labelHeight*o.getRows(t.title).length,labelpos:`c`},`id`+_)}),d(l),e.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(t){t!==void 0&&l.node(t)!==void 0?(e.warn(`Node `+t+`: `+JSON.stringify(l.node(t))),a.select(`#`+v.id+` #`+t).attr(`transform`,`translate(`+(l.node(t).x-l.node(t).width/2)+`,`+(l.node(t).y+(O[t]?O[t].y:0)-l.node(t).height/2)+` )`),a.select(`#`+v.id+` #`+t).attr(`data-x-shift`,l.node(t).x-l.node(t).width/2),s.querySelectorAll(`#`+v.id+` #`+t+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):e.debug(`No Node `+t+`: `+JSON.stringify(l.node(t)))});let b=v.getBBox();l.edges().forEach(function(t){t!==void 0&&l.edge(t)!==void 0&&(e.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(l.edge(t))),E(n,l.edge(t),l.edge(t).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,e.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:t(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
@@ -0,0 +1 @@
1
+ import{h as e}from"./src-Bo15iQ7w.js";import"./chunk-ICPOFSXX-Di63NBur.js";import"./dist-CrzV1W3-.js";import"./chunk-5PVQY5BW-RhIfPCRB.js";import"./chunk-U2HBQHQK-BZnA7c4T.js";import"./chunk-BSJP7CBP-CTsYuARh.js";import"./chunk-ZZ45TVLE-DBSm41oP.js";import"./chunk-55IACEB6-CzqB8aoU.js";import"./chunk-EDXVE4YY-utELKGQK.js";import"./chunk-X2U36JSP-DpQ2OA_c.js";import"./chunk-5FUZZQ4R-BoTfWHuW.js";import"./chunk-ENJZ2VHE-CNHjq5xK.js";import"./chunk-336JU56O-BpATJiGl.js";import{i as t,n,r,t as i}from"./chunk-OYMX7WX6-BSPzqyxs.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1,4 +1,4 @@
1
- import{g as e,h as t,m as n,p as r}from"./src-Bo15iQ7w.js";import{$ as i,K as a,Q as o,a as s,b as c,o as l,tt as u,y as d}from"./chunk-ICPOFSXX-DHInTpuR.js";import"./dist-CrzV1W3-.js";import{t as f}from"./arc-BMhgytDB.js";import{f as p}from"./chunk-5PVQY5BW-_iMyxz0C.js";import{t as m}from"./chunk-426QAEUC-zKsTsXw6.js";var h=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,11,13,14,15,17,19,20,23,24],r=[1,12],i=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,19],l=[1,20],u={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s];break}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(n,[2,5],{5:6}),e(n,[2,2]),e(n,[2,3]),e(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(n,[2,10],{1:[2,1]}),e(n,[2,6]),{12:21,14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(n,[2,8]),e(n,[2,9]),e(n,[2,11]),{16:[1,22]},{18:[1,23]},e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,7]),e(n,[2,12]),e(n,[2,13])],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,h as t,m as n,p as r}from"./src-Bo15iQ7w.js";import{$ as i,K as a,Q as o,a as s,b as c,o as l,tt as u,y as d}from"./chunk-ICPOFSXX-Di63NBur.js";import"./dist-CrzV1W3-.js";import{t as f}from"./arc-BMhgytDB.js";import{f as p}from"./chunk-5PVQY5BW-RhIfPCRB.js";import{t as m}from"./chunk-426QAEUC-Wz6Bpsil.js";var h=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,11,13,14,15,17,19,20,23,24],r=[1,12],i=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,19],l=[1,20],u={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s];break}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(n,[2,5],{5:6}),e(n,[2,2]),e(n,[2,3]),e(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(n,[2,10],{1:[2,1]}),e(n,[2,6]),{12:21,14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(n,[2,8]),e(n,[2,9]),e(n,[2,11]),{16:[1,22]},{18:[1,23]},e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,7]),e(n,[2,12]),e(n,[2,13])],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};u.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CvICILSR.js","assets/preload-helper-bPV_ZjF3.js","assets/dist-CrzV1W3-.js","assets/chunk-DD-I1_y5.js","assets/chunk-U2HBQHQK-D5vGkUe9.js","assets/src-Bo15iQ7w.js","assets/chunk-5PVQY5BW-_iMyxz0C.js","assets/chunk-ICPOFSXX-DHInTpuR.js","assets/_baseFor-Dn4GSmI6.js","assets/isEmpty-h-wRi_o9.js","assets/chunk-336JU56O-COUTB2TN.js","assets/chunk-5FUZZQ4R-DfchzZ2Y.js","assets/chunk-X2U36JSP-CnNxZbqc.js","assets/chunk-ZZ45TVLE-BipxpzL8.js","assets/rough.esm-NLRoWnq-.js","assets/chunk-ENJZ2VHE-BrGMkslM.js","assets/line-BkM2KuUb.js","assets/path-7vUsG-o2.js","assets/array-DJN9YAVf.js","assets/chunk-BSJP7CBP-CTsYuARh.js","assets/chunk-426QAEUC-zKsTsXw6.js","assets/chunk-XPW4576I-BccP1mlQ.js"])))=>i.map(i=>d[i]);
2
- import{o as e,r as t,t as n}from"./chunk-DD-I1_y5.js";import{n as r,o as i,r as a,t as o}from"./jsx-runtime-BjkIZEse.js";import{t as s}from"./Checkbox-U-H3_oQu.js";import{t as c}from"./preload-helper-bPV_ZjF3.js";var l=a(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),u=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),d=a(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),f=a(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),p=a(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),m=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),h=a(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),g=a(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),_=a(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),v=a(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),y=a(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),b=a(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),x=e(i(),1);async function S(e){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function C(){let[e,t]=(0,x.useState)(!1),[n,r]=(0,x.useState)(new Set),[i,a]=(0,x.useState)(!1),o=(0,x.useRef)(null);(0,x.useEffect)(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]);let s=(0,x.useCallback)(()=>{t(!0),r(new Set)},[]),c=(0,x.useCallback)(()=>{t(!1),r(new Set)},[]),l=(0,x.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=(0,x.useCallback)(e=>{e.length!==0&&r(t=>e.every(e=>t.has(e))?new Set:new Set(e))},[]),d=(0,x.useCallback)(()=>{o.current!==null&&(clearTimeout(o.current),o.current=null)},[]),f=(0,x.useCallback)(e=>({onPointerDown:()=>{o.current=setTimeout(()=>{t(!0),r(new Set([e])),o.current=null},500)},onPointerUp:d,onPointerLeave:d,onPointerCancel:d}),[d]),p=(0,x.useCallback)(e=>{a(e?`copied`:`failed`),setTimeout(()=>a(!1),1500)},[]);return{selectionMode:e,selectedItems:n,copyToast:i,longPressProps:f,enterSelection:s,exitSelection:c,toggleSelectItem:l,selectAll:u,copySelected:(0,x.useCallback)(async(e,t)=>{let r=[...n].sort(t).map(t=>e(t)).filter(Boolean);r.length>0&&p(await S(r.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CCUSwZB_.js","assets/preload-helper-qlgyTAkD.js","assets/dist-CrzV1W3-.js","assets/chunk-DD-I1_y5.js","assets/chunk-U2HBQHQK-BZnA7c4T.js","assets/src-Bo15iQ7w.js","assets/chunk-5PVQY5BW-RhIfPCRB.js","assets/chunk-ICPOFSXX-Di63NBur.js","assets/_baseFor-Dn4GSmI6.js","assets/isEmpty-h-wRi_o9.js","assets/chunk-336JU56O-BpATJiGl.js","assets/chunk-5FUZZQ4R-BoTfWHuW.js","assets/chunk-X2U36JSP-DpQ2OA_c.js","assets/chunk-ZZ45TVLE-DBSm41oP.js","assets/rough.esm-NLRoWnq-.js","assets/chunk-ENJZ2VHE-CNHjq5xK.js","assets/line-DlKKhwkO.js","assets/path-7vUsG-o2.js","assets/array-DJN9YAVf.js","assets/chunk-BSJP7CBP-CTsYuARh.js","assets/chunk-426QAEUC-Wz6Bpsil.js","assets/chunk-XPW4576I-BccP1mlQ.js"])))=>i.map(i=>d[i]);
2
+ import{o as e,r as t,t as n}from"./chunk-DD-I1_y5.js";import{n as r,o as i,r as a,t as o}from"./jsx-runtime-BjkIZEse.js";import{t as s}from"./Checkbox-U-H3_oQu.js";import{t as c}from"./preload-helper-qlgyTAkD.js";var l=a(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),u=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),d=a(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),f=a(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),p=a(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),m=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),h=a(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),g=a(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),_=a(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),v=a(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),y=a(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),b=a(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),x=e(i(),1);async function S(e){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function C(){let[e,t]=(0,x.useState)(!1),[n,r]=(0,x.useState)(new Set),[i,a]=(0,x.useState)(!1),o=(0,x.useRef)(null);(0,x.useEffect)(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]);let s=(0,x.useCallback)(()=>{t(!0),r(new Set)},[]),c=(0,x.useCallback)(()=>{t(!1),r(new Set)},[]),l=(0,x.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=(0,x.useCallback)(e=>{e.length!==0&&r(t=>e.every(e=>t.has(e))?new Set:new Set(e))},[]),d=(0,x.useCallback)(()=>{o.current!==null&&(clearTimeout(o.current),o.current=null)},[]),f=(0,x.useCallback)(e=>({onPointerDown:()=>{o.current=setTimeout(()=>{t(!0),r(new Set([e])),o.current=null},500)},onPointerUp:d,onPointerLeave:d,onPointerCancel:d}),[d]),p=(0,x.useCallback)(e=>{a(e?`copied`:`failed`),setTimeout(()=>a(!1),1500)},[]);return{selectionMode:e,selectedItems:n,copyToast:i,longPressProps:f,enterSelection:s,exitSelection:c,toggleSelectItem:l,selectAll:u,copySelected:(0,x.useCallback)(async(e,t)=>{let r=[...n].sort(t).map(t=>e(t)).filter(Boolean);r.length>0&&p(await S(r.join(`
3
3
 
4
4
  ---
5
5
 
@@ -33,4 +33,4 @@ import{o as e,r as t,t as n}from"./chunk-DD-I1_y5.js";import{n as r,o as i,r as
33
33
  `,...a.current()});return/^[\t ]/.test(l)&&(l=As(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Is.peek=Ls;function Is(e){return e.value||``}function Ls(){return`<`}Rs.peek=zs;function Rs(e,t,n,r){let i=Ds(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function zs(){return`!`}Bs.peek=Vs;function Bs(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Vs(){return`!`}Hs.peek=Us;function Hs(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Us(){return"`"}function Ws(e,t){let n=Et(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Gs.peek=Ks;function Gs(e,t,n,r){let i=Ds(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Ws(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Ks(e,t,n){return Ws(e,n)?`<`:`[`}qs.peek=Js;function qs(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Js(){return`[`}function Ys(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Xs(e){let t=Ys(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Zs(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Qs(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function $s(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Zs(n):Ys(n),s=e.ordered?o===`.`?`)`:`.`:Xs(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Qs(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function ec(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function tc(e,t,n,r){let i=ec(n),a=n.bulletCurrent||Ys(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function nc(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var rc=ua([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function ic(e,t,n,r){return(e.children.some(function(e){return rc(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ac(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}oc.peek=sc;function oc(e,t,n,r){let i=ac(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=js(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=As(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=js(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+As(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function sc(e,t,n){return n.options.strong||`*`}function cc(e,t,n,r){return n.safe(e.value,r)}function lc(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function uc(e,t,n){let r=(Qs(n)+(n.options.ruleSpaces?` `:``)).repeat(lc(n));return n.options.ruleSpaces?r.slice(0,-1):r}var dc={blockquote:_s,break:xs,code:Ts,definition:Os,emphasis:Ms,hardBreak:xs,heading:Fs,html:Is,image:Rs,imageReference:Bs,inlineCode:Hs,link:Gs,linkReference:qs,list:$s,listItem:tc,paragraph:nc,root:ic,strong:oc,text:cc,thematicBreak:uc};function fc(){return{enter:{table:pc,tableData:_c,tableHeader:_c,tableRow:hc},exit:{codeText:vc,table:mc,tableData:gc,tableHeader:gc,tableRow:gc}}}function pc(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function mc(e){this.exit(e),this.data.inTable=void 0}function hc(e){this.enter({type:`tableRow`,children:[]},e)}function gc(e){this.exit(e)}function _c(e){this.enter({type:`tableCell`,children:[]},e)}function vc(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yc));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function yc(e,t){return t===`|`?t:e}function bc(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
34
34
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
35
35
  `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return ms(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=dc.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function xc(){return{exit:{taskListCheckValueChecked:Cc,taskListCheckValueUnchecked:Cc,paragraph:wc}}}function Sc(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Tc}}}function Cc(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function wc(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Tc(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=dc.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Ec(){return[Mo(),ns(),ss(),fc(),xc()]}function Dc(e){return{extensions:[No(),rs(e),cs(),bc(e),Sc()]}}var Oc={tokenize:Bc,partial:!0},kc={tokenize:Vc,partial:!0},Ac={tokenize:Hc,partial:!0},jc={tokenize:Uc,partial:!0},Mc={tokenize:Wc,partial:!0},Nc={name:`wwwAutolink`,tokenize:Rc,previous:Gc},Pc={name:`protocolAutolink`,tokenize:zc,previous:Kc},Q={name:`emailAutolink`,tokenize:Lc,previous:qc},$={};function Fc(){return{text:$}}for(var Ic=48;Ic<123;)$[Ic]=Q,Ic++,Ic===58?Ic=65:Ic===91&&(Ic=97);$[43]=Q,$[45]=Q,$[46]=Q,$[95]=Q,$[72]=[Q,Pc],$[104]=[Q,Pc],$[87]=[Q,Nc],$[119]=[Q,Nc];function Lc(e,t,n){let r=this,i,a;return o;function o(t){return!Jc(t)||!qc.call(r,r.previous)||Yc(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Jc(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Mc,u,l)(t):t===45||t===95||G(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&W(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Rc(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Gc.call(r,r.previous)||Yc(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Oc,e.attempt(kc,e.attempt(Ac,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function zc(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Kc.call(r,r.previous)&&!Yc(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(W(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Rt(t)||q(t)||Ut(t)||Ht(t)?n(t):e.attempt(kc,e.attempt(Ac,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Bc(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Vc(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(jc,c,s)(t):t===null||q(t)||Ut(t)||t!==45&&Ht(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Hc(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(jc,t,a)(o):o===null||q(o)||Ut(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Uc(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||q(o)||Ut(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||q(e)||Ut(e)?t(e):r(e)}function a(e){return W(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):W(t)?(e.consume(t),o):n(t)}}function Wc(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return G(e)?n(e):t(e)}}function Gc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||q(e)}function Kc(e){return!W(e)}function qc(e){return!(e===47||Jc(e))}function Jc(e){return e===43||e===45||e===46||e===95||G(e)}function Yc(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Xc={tokenize:il,partial:!0};function Zc(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:tl,continuation:{tokenize:nl},exit:rl}},text:{91:{name:`gfmFootnoteCall`,tokenize:el},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Qc,resolveTo:$c}}}}function Qc(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function $c(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function el(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function tl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function nl(e,t,n){return e.check(sn,t,e.attempt(Xc,t,n))}function rl(e){e.exit(`gfmFootnoteDefinition`)}function il(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function al(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&V(o,o.length,0,$t(s,e.slice(r+1,n),t)),V(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),V(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Qt(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Qt(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ol=class{constructor(){this.map=[]}add(e,t,n){sl(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function sl(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function cl(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ll(){return{flow:{null:{name:`table`,tokenize:ul,resolveAll:dl}}}}function ul(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function dl(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new ol;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(pl(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=fl(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=fl(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=fl(f,t,o,i,n,d)):(o[0]=o[1],d=fl(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&pl(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=cl(t.events,n))}return e}function fl(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},ml(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=ml(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=ml(t.events,n[2]),a=ml(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},ml(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function pl(e,t,n,r,i){let a=[],o=ml(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function ml(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var hl={name:`tasklistCheck`,tokenize:_l};function gl(){return{text:{91:hl}}}function _l(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:vl},t,n)(r):n(r)}}function vl(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function yl(e){return Nt([Fc(),Zc(),al(e),ll(),gl()])}var bl={};function xl(e){let t=this,n=e||bl,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(yl(n)),a.push(Ec()),o.push(Dc(n))}var Sl=100;function Cl(e){let t;try{t=JSON.parse(e)}catch(e){return{ok:!1,reason:`invalid JSON: ${e instanceof Error?e.message:String(e)}`}}if(typeof t!=`object`||!t||Array.isArray(t))return{ok:!1,reason:`payload is not a JSON object`};let n=t;if(typeof n.url!=`string`||n.url.length===0)return{ok:!1,reason:`url is required`};let r;try{r=new URL(n.url)}catch{return{ok:!1,reason:`url is not a valid URL`}}if(r.protocol!==`http:`&&r.protocol!==`https:`)return{ok:!1,reason:`url scheme ${r.protocol} is not permitted (http/https only)`};if(typeof n.intent!=`string`||n.intent.length===0)return{ok:!1,reason:`intent is required`};if(n.intent.length>Sl)return{ok:!1,reason:`intent exceeds ${Sl} chars`};let i;if(n.hostname!==void 0){if(typeof n.hostname!=`string`)return{ok:!1,reason:`hostname must be a string when provided`};i=n.hostname}return{ok:!0,payload:i?{url:n.url,intent:n.intent,hostname:i}:{url:n.url,intent:n.intent}}}var wl=(0,x.createContext)(null);function Tl({value:e,children:t}){return(0,k.jsx)(wl.Provider,{value:e,children:t})}function El(){return(0,x.useContext)(wl)}var Dl={ok:`succeeded`,timeout:`navigation timed out`,"cdp-unreachable":`device browser is not responding`,error:`navigation error`};async function Ol(e,t){try{await fetch(`/api/admin/events`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({event:e,fields:t})})}catch(t){console.error(`[device-url:event] failed to post event`,e,t)}}function kl({raw:e,reason:t}){return(0,x.useEffect)(()=>{Ol(`device-url:malformed`,{reason:t.slice(0,200),length:e.length})},[e,t]),(0,k.jsx)(`pre`,{className:`md-pre md-device-url-malformed`,children:(0,k.jsxs)(`code`,{className:`md-code`,children:[(0,k.jsxs)(`span`,{className:`md-device-url-malformed-label`,children:[(0,k.jsx)(b,{size:12}),` device-URL block is malformed: `,t]}),`
36
- `,e]})})}function Al({payload:e,reason:t}){let[n,r]=(0,x.useState)(`idle`);(0,x.useEffect)(()=>{Ol(`device-url:fallback-shown`,{intent:e.intent,reason:t,hostname:e.hostname??``})},[e.intent,e.hostname,t]);let i=async()=>{try{await navigator.clipboard.writeText(e.url),r(`copied`),window.setTimeout(()=>r(`idle`),2e3)}catch(t){r(`failed`),Ol(`device-url:fallback-shown`,{intent:e.intent,reason:`clipboard-api-unavailable`,hostname:e.hostname??``,detail:t instanceof Error?t.message.slice(0,200):String(t).slice(0,200)})}},a=e.hostname?` on the device (${e.hostname})`:` on the device`;return(0,k.jsxs)(`div`,{className:`md-device-url md-device-url-fallback`,role:`group`,children:[(0,k.jsxs)(`div`,{className:`md-device-url-fallback-message`,children:[(0,k.jsx)(b,{size:14}),(0,k.jsxs)(`span`,{children:[`Could not open `,(0,k.jsx)(`strong`,{children:e.intent}),a,` automatically (`,t,`). Copy the URL and open it in a browser on the device:`]})]}),(0,k.jsxs)(`div`,{className:`md-device-url-fallback-url`,children:[(0,k.jsx)(`code`,{children:e.url}),(0,k.jsxs)(`button`,{type:`button`,className:`md-device-url-fallback-copy`,onClick:i,"aria-label":`Copy URL`,children:[n===`copied`?(0,k.jsx)(l,{size:14}):(0,k.jsx)(d,{size:14}),n===`copied`?`Copied`:n===`failed`?`Copy failed`:`Copy`]})]}),n===`failed`&&(0,k.jsx)(`div`,{className:`md-device-url-fallback-copy-failed`,children:`Your browser blocked the copy action. Select the URL text above manually to copy it.`})]})}function jl({payload:e}){let t=El(),[n,r]=(0,x.useState)({phase:`idle`});(0,x.useEffect)(()=>{Ol(`device-url:render`,{intent:e.intent,url:e.url,hostname:e.hostname??``,origin:`tool`})},[e.intent,e.url,e.hostname]);let i=async()=>{if(n.phase!==`navigating`){r({phase:`navigating`});try{let n=await fetch(`/api/admin/device-browser/navigate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),i=await n.json().catch(()=>({}));if(n.ok&&i.ok){r({phase:`succeeded`}),t&&(t.onShowVnc(),Ol(`device-url:vnc-surface-shown`,{intent:e.intent})),window.setTimeout(()=>r({phase:`idle`}),2500);return}r({phase:`fallback`,reason:i.navigateResult?Dl[i.navigateResult]:i.detail?i.detail.slice(0,80):`navigation failed`})}catch(e){r({phase:`fallback`,reason:(e instanceof Error?e.message:String(e)).slice(0,80)})}}},a=n.phase===`navigating`,o=n.phase===`succeeded`;return(0,k.jsxs)(`div`,{className:`md-device-url`,children:[(0,k.jsxs)(`button`,{type:`button`,className:`md-device-url-button`,onClick:i,disabled:a,"aria-label":`Open ${e.intent} on the device's browser`,title:e.hostname?`Opens on device: ${e.hostname}`:`Opens on the device running Maxy`,children:[(0,k.jsx)(m,{size:16,className:`md-device-url-icon`}),(0,k.jsx)(`span`,{className:`md-device-url-label`,children:a?`Opening…`:o?`Opened on device`:`Open ${e.intent} on device`})]}),n.phase===`fallback`&&(0,k.jsx)(Al,{payload:e,reason:n.reason})]})}function Ml({source:e}){let t=Cl(e.trim());return t.ok?(0,k.jsx)(jl,{payload:t.payload}):(0,k.jsx)(kl,{raw:e,reason:t.reason})}var Nl=null;function Pl(){return Nl||=c(async()=>{let{default:e}=await import(`./mermaid.core-CvICILSR.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`neutral`}),e)),Nl}function Fl({source:e}){let t=(0,x.useRef)(null),[n,r]=(0,x.useState)(null);return(0,x.useEffect)(()=>{let n=!1,i=`mermaid-${Math.random().toString(36).slice(2,9)}`;return Pl().then(t=>t.render(i,e)).then(({svg:e})=>{!n&&t.current&&(t.current.innerHTML=e)}).catch(t=>{n||(console.error(`[MermaidBlock] render failed:`,e,t),r(t instanceof Error?t.message:`Diagram render failed`))}),()=>{n=!0}},[e]),n?(0,k.jsxs)(`div`,{className:`md-mermaid md-mermaid-error`,children:[(0,k.jsx)(`div`,{className:`md-mermaid-error-label`,children:`Diagram render error`}),(0,k.jsx)(`pre`,{className:`md-pre`,children:(0,k.jsx)(`code`,{className:`md-code`,children:e})})]}):(0,k.jsx)(`div`,{className:`md-mermaid`,ref:t})}var Il=/\.(mp4|webm|mov)(\?.*)?$/i,Ll=/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/,Rl=/vimeo\.com\/(\d+)/;function zl(e){return!!e&&Il.test(e)}function Bl(e){if(!e)return null;let t=e.match(Ll);return t?t[1]:null}function Vl(e){if(!e)return null;let t=e.match(Rl);return t?t[1]:null}function Hl({src:e}){return(0,k.jsx)(`video`,{className:`md-video`,controls:!0,playsInline:!0,preload:`metadata`,children:(0,k.jsx)(`source`,{src:e})})}function Ul({videoId:e}){return(0,k.jsx)(`div`,{className:`md-video-iframe`,children:(0,k.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${e}`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,loading:`lazy`})})}function Wl({videoId:e}){return(0,k.jsx)(`div`,{className:`md-video-iframe`,children:(0,k.jsx)(`iframe`,{src:`https://player.vimeo.com/video/${e}`,allow:`autoplay; fullscreen; picture-in-picture`,allowFullScreen:!0,loading:`lazy`})})}function Gl(e){if(zl(e))return(0,k.jsx)(Hl,{src:e});let t=Bl(e);if(t)return(0,k.jsx)(Ul,{videoId:t});let n=Vl(e);return n?(0,k.jsx)(Wl,{videoId:n}):null}var Kl={p:({children:e})=>(0,k.jsx)(`p`,{className:`md-p`,children:e}),h1:({children:e})=>(0,k.jsx)(`h1`,{className:`md-heading`,children:e}),h2:({children:e})=>(0,k.jsx)(`h2`,{className:`md-heading`,children:e}),h3:({children:e})=>(0,k.jsx)(`h3`,{className:`md-heading`,children:e}),code:({children:e,className:t})=>t===`language-mermaid`?(0,k.jsx)(Fl,{source:String(e).replace(/\n$/,``)}):t===`language-maxy-device-url`?(0,k.jsx)(Ml,{source:String(e).replace(/\n$/,``)}):(0,k.jsx)(`code`,{className:`md-code ${t||``}`.trim(),children:e}),pre:({children:e,node:t})=>{let n=t?.children?.[0];if(n?.type===`element`&&n.tagName===`code`){let t=n.properties?.className??[];if(t.includes(`language-mermaid`)||t.includes(`language-maxy-device-url`))return(0,k.jsx)(k.Fragment,{children:e})}return(0,k.jsx)(`pre`,{className:`md-pre`,children:e})},ul:({children:e})=>(0,k.jsx)(`ul`,{className:`md-list`,children:e}),ol:({children:e})=>(0,k.jsx)(`ol`,{className:`md-list md-list-ordered`,children:e}),li:({children:e})=>(0,k.jsx)(`li`,{className:`md-list-item`,children:e}),hr:()=>(0,k.jsx)(`hr`,{className:`md-hr`}),strong:({children:e})=>(0,k.jsx)(`strong`,{className:`md-strong`,children:e}),img:({src:e,alt:t})=>Gl(e)||(0,k.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:(0,k.jsx)(`img`,{className:`md-img`,src:e,alt:t||``,loading:`lazy`})}),a:({href:e,children:t})=>Gl(e)||(0,k.jsx)(`a`,{href:e,className:`md-link`,target:`_blank`,rel:`noopener noreferrer`,children:t}),table:({children:e})=>(0,k.jsx)(`table`,{className:`md-table`,children:e}),thead:({children:e})=>(0,k.jsx)(`thead`,{className:`md-thead`,children:e}),tbody:({children:e})=>(0,k.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,k.jsx)(`tr`,{className:`md-tr`,children:e}),th:({children:e})=>(0,k.jsx)(`th`,{className:`md-th`,children:e}),td:({children:e})=>(0,k.jsx)(`td`,{className:`md-td`,children:e})};function ql({content:e,elapsedSeconds:t,timestamp:n}){return(0,k.jsxs)(`div`,{className:`markdown-message`,children:[(0,k.jsx)(yo,{remarkPlugins:[xl],components:Kl,children:e}),t!==void 0&&(0,k.jsxs)(`div`,{className:`message-meta`,children:[t,`s`]}),n&&(0,k.jsx)(`span`,{className:`message-timestamp`,children:n})]})}function Jl({submitted:e,submittedLabel:t=`Submitted`,actions:n,children:r}){return(0,k.jsxs)(`div`,{className:`component-card${e?` component-card--submitted`:``}`,children:[r,(0,k.jsx)(`div`,{className:`component-card__actions`,children:e?(0,k.jsx)(`span`,{className:`component-card__done-label`,children:t}):n.map((e,t)=>(0,k.jsx)(A,{variant:e.variant,size:`sm`,disabled:e.disabled,onClick:e.onClick,children:e.label},t))})]})}function Yl({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.options)?r.options:[],[a,o]=(0,x.useState)(null),[s,c]=(0,x.useState)(`Submitted`);if(i.length===0)return null;let l=e=>{n||o(e)},u=()=>{if(!a||n)return;let e=i.find(e=>e.value===a);c(e?.label??`Submitted`),t((r?.submitMessage??`Selected: {{value}}`).replace(`{{value}}`,a).replace(`{{label}}`,e?.label??a))},d=()=>{n||(c(r?.backLabel??`Back`),t(r?.backMessage??``))},f=(e,t)=>{if(!n)if(e.key===`ArrowDown`||e.key===`ArrowRight`){e.preventDefault();let n=(t+1)%i.length;l(i[n].value),(e.currentTarget.parentElement?.children[n])?.focus()}else if(e.key===`ArrowUp`||e.key===`ArrowLeft`){e.preventDefault();let n=(t-1+i.length)%i.length;l(i[n].value),(e.currentTarget.parentElement?.children[n])?.focus()}else (e.key===` `||e.key===`Enter`)&&(e.preventDefault(),l(i[t].value))};return(0,k.jsx)(Jl,{submitted:n,submittedLabel:s,actions:[...r?.backLabel&&r?.backMessage?[{label:r.backLabel,variant:`ghost`,onClick:d}]:[],{label:r?.submitLabel??`Confirm`,variant:`primary`,disabled:!a,onClick:u}],children:(0,k.jsxs)(`div`,{className:`single-select`,role:`radiogroup`,"aria-label":r?.title??`Select one`,children:[r?.title&&(0,k.jsx)(`div`,{className:`single-select__title`,children:r.title}),i.map((e,t)=>(0,k.jsxs)(`div`,{className:`single-select__row${a===e.value?` single-select__row--selected`:``}`,role:`radio`,"aria-checked":a===e.value,tabIndex:a===e.value||!a&&t===0?0:-1,onClick:()=>l(e.value),onKeyDown:e=>f(e,t),children:[(0,k.jsx)(`span`,{className:`single-select__radio${a===e.value?` single-select__radio--checked`:``}`}),(0,k.jsxs)(`div`,{className:`single-select__info`,children:[(0,k.jsxs)(`span`,{className:`single-select__label`,children:[e.icon&&(0,k.jsx)(`span`,{className:`single-select__icon`,children:e.icon}),e.label]}),e.description&&(0,k.jsx)(`span`,{className:`single-select__desc`,children:e.description})]})]},e.value))]})})}function Xl({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.options)?r.options:[],[a,o]=(0,x.useState)(i.map(e=>!!e.locked||!!e.defaultSelected)),[c,l]=(0,x.useState)(`Submitted`);if(i.length===0)return null;let u=i.some(e=>e.locked),d=i.every((e,t)=>e.locked||a[t]),f=e=>{n||i[e].locked||o(t=>t.map((t,n)=>n===e?!t:t))},p=()=>{n||o(i.map((e,t)=>e.locked?a[t]:!d))},m=i.filter((e,t)=>!e.locked&&a[t]).map(e=>e.value),h=m.length>0||u,g=()=>{if(!(!h||n)){if(l(`Submitted`),m.length===0){t(`No optional plugins selected`);return}t((r?.submitMessage??`Selected: {{values}}`).replace(`{{values}}`,m.join(`, `)))}},_=()=>{n||(l(`Skipped`),t(r?.skipMessage??`Skipped`))},v=()=>{n||(l(r?.backLabel??`Back`),t(r?.backMessage??``))},y=[];return r?.backLabel&&r?.backMessage&&y.push({label:r.backLabel,variant:`ghost`,onClick:v}),r?.skipLabel&&y.push({label:r.skipLabel,variant:`ghost`,onClick:_}),y.push({label:r?.submitLabel??`Confirm`,variant:`primary`,disabled:!h,onClick:g}),(0,k.jsx)(Jl,{submitted:n,submittedLabel:c,actions:y,children:(0,k.jsxs)(`div`,{className:`multi-select`,children:[r?.title&&(0,k.jsx)(`div`,{className:`multi-select__title`,children:r.title}),r?.selectAll&&(0,k.jsx)(`div`,{className:`multi-select__header`,children:(0,k.jsx)(s,{checked:d,onChange:p,label:`Select all`,disabled:n})}),(0,k.jsx)(`div`,{className:`multi-select__list`,role:`group`,"aria-label":r?.title??`Select options`,children:i.map((e,t)=>{let r=e.group&&(t===0||e.group!==i[t-1].group),o=!!e.locked;return(0,k.jsxs)(x.Fragment,{children:[r&&(0,k.jsx)(`div`,{className:`multi-select__group-header`,children:e.group}),(0,k.jsxs)(`div`,{className:`multi-select__row${o?` multi-select__row--locked`:``}`,role:`checkbox`,"aria-checked":a[t],"aria-disabled":o||void 0,tabIndex:o?-1:0,onClick:()=>f(t),onKeyDown:e=>{n||o||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),f(t))},children:[(0,k.jsx)(s,{checked:a[t],onChange:()=>f(t),disabled:n||o}),(0,k.jsxs)(`div`,{className:`multi-select__info`,children:[(0,k.jsxs)(`span`,{className:`multi-select__label`,children:[e.label,e.badge&&(0,k.jsx)(`span`,{className:`multi-select__badge`,children:e.badge})]}),e.description&&(0,k.jsx)(`span`,{className:`multi-select__desc`,children:e.description})]})]})]},e.value)})})]})})}function Zl({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.buttons)?r.buttons:[],[a,o]=(0,x.useState)(`Submitted`);if(i.length===0)return null;let s=e=>{n||(o(e.label),t(e.value))};return(0,k.jsx)(Jl,{submitted:n,submittedLabel:a,actions:i.map(e=>({label:e.label,variant:`primary`,onClick:()=>s(e)})),children:(0,k.jsx)(k.Fragment,{})})}function Ql(e){let t=new Date(e),n=new Date,r=String(t.getHours()).padStart(2,`0`),i=String(t.getMinutes()).padStart(2,`0`),a=String(t.getSeconds()).padStart(2,`0`);return t.toDateString()===n.toDateString()?`${r}:${i}:${a}`:`${String(t.getDate()).padStart(2,`0`)}-${String(t.getMonth()+1).padStart(2,`0`)}-${t.getFullYear()} ${r}:${i}:${a}`}var $l=44,eu=(0,x.forwardRef)(function({value:e,onChange:t,placeholder:n,disabled:r},i){let a=(0,x.useRef)(null),o=(0,x.useRef)(!1),s=(0,x.useCallback)((e,t)=>{let n=e.closest(`.chat-form`);n&&(n.dataset.expanded=t>$l?`true`:``)},[]),c=(0,x.useCallback)(e=>{if(o.current)return;let t=window.innerHeight*.75;e.style.height=`auto`;let n=Math.min(e.scrollHeight,t);e.style.height=`${n}px`,e.style.overflowY=e.scrollHeight>t?`auto`:`hidden`,s(e,n)},[s]);return(0,x.useImperativeHandle)(i,()=>({focus(){a.current?.focus()},resetHeight(){if(!a.current)return;o.current=!1,a.current.style.height=``,a.current.style.overflowY=``;let e=a.current.closest(`.chat-form`);e&&(e.dataset.expanded=``)},getOffsetHeight(){return a.current?.offsetHeight??36},setHeight(e){a.current&&(o.current=!0,a.current.style.height=`${e}px`,s(a.current,e))}})),(0,k.jsx)(`textarea`,{ref:a,className:`chat-input`,rows:1,value:e,onChange:e=>{t(e.target.value),c(e.target)},onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.closest(`form`)?.requestSubmit())},placeholder:n,disabled:r,"aria-label":n||`Type a message...`})});function tu({inputRef:e}){let t=(0,x.useRef)(null);function n(n){e.current&&(n.preventDefault(),n.target.setPointerCapture(n.pointerId),t.current={startY:n.clientY,startH:e.current.getOffsetHeight()})}function r(n){if(!t.current||!e.current)return;let r=t.current.startY-n.clientY,i=window.innerHeight*.75,a=Math.max(36,Math.min(i,t.current.startH+r));e.current.setHeight(a)}function i(){t.current=null}return(0,k.jsx)(`div`,{className:`chat-resize-handle`,onPointerDown:n,onPointerMove:r,onPointerUp:i,"aria-label":`Resize input`,children:(0,k.jsx)(`div`,{className:`chat-resize-handle-bar`})})}function nu(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function ru({data:e,active:t}){let n=[];if(e&&e.length>0&&t){let t=Math.floor(e.length/24);for(let r=0;r<24;r++){let i=e[r*t]??128,a=Math.abs(i-128)/128;n.push(Math.max(.15,a))}}else for(let e=0;e<24;e++)n.push(.15);return(0,k.jsx)(`div`,{className:`voice-waveform`,"aria-hidden":`true`,children:n.map((e,t)=>(0,k.jsx)(`div`,{className:`voice-waveform-bar`,style:{height:`${Math.round(e*100)}%`}},t))})}function iu({state:e,elapsedSeconds:t,waveform:n,onTogglePause:i,onDiscard:a,onSend:o}){if(e===`idle`||e===`error`)return null;let s=e===`recording`,c=e===`paused`,l=e===`sending`;return(0,k.jsxs)(`div`,{className:`voice-recorder`,role:`region`,"aria-label":`Voice recording`,"aria-live":`polite`,children:[(0,k.jsx)(`button`,{type:`button`,className:`voice-trash`,onClick:a,disabled:l,"aria-label":`Discard recording`,children:(0,k.jsx)(r,{size:16})}),(0,k.jsx)(`span`,{className:`voice-timer`,"aria-live":`polite`,"aria-atomic":`true`,children:nu(t)}),(0,k.jsx)(ru,{data:n,active:s}),(0,k.jsx)(`button`,{type:`button`,className:`voice-pause`,onClick:i,disabled:l,"aria-label":c?`Resume recording`:`Pause recording`,children:c?(0,k.jsx)(v,{size:14}):(0,k.jsx)(_,{size:14})}),(0,k.jsx)(A,{variant:`send`,type:`button`,onClick:o,disabled:l,loading:l,"aria-label":`Send voice note`,children:(0,k.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,k.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]})}var au=[`audio/ogg;codecs=opus`,`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`];function ou(){for(let e of au)if(MediaRecorder.isTypeSupported(e))return e;return``}function su(e){return e.split(`;`)[0]}function cu(){let[e,t]=(0,x.useState)(`idle`),[n,r]=(0,x.useState)(0),[i,a]=(0,x.useState)(null),[o,s]=(0,x.useState)(null),c=(0,x.useRef)(null),l=(0,x.useRef)(null),u=(0,x.useRef)([]),d=(0,x.useRef)(``),f=(0,x.useRef)(null),p=(0,x.useRef)(0),m=(0,x.useRef)(0),h=(0,x.useRef)(null),g=(0,x.useRef)(null),_=(0,x.useRef)(0),v=(0,x.useCallback)(()=>{if(f.current&&=(clearInterval(f.current),null),_.current&&=(cancelAnimationFrame(_.current),0),c.current&&c.current.state!==`inactive`)try{c.current.stop()}catch{}c.current=null,u.current=[],l.current&&=(l.current.getTracks().forEach(e=>e.stop()),null),h.current&&(h.current.close().catch(()=>{}),h.current=null,g.current=null),m.current=0,p.current=0},[]);(0,x.useEffect)(()=>v,[v]);let y=(0,x.useCallback)(()=>{p.current=Date.now(),f.current=setInterval(()=>{let e=Date.now()-p.current,t=m.current+e;r(Math.floor(t/1e3))},200)},[]),b=(0,x.useCallback)(()=>{f.current&&=(clearInterval(f.current),null);let e=Date.now()-p.current;m.current+=e},[]),S=(0,x.useCallback)(()=>{let e=g.current;if(!e)return;let t=new Uint8Array(e.frequencyBinCount),n=()=>{e.getByteTimeDomainData(t),a(new Uint8Array(t)),_.current=requestAnimationFrame(n)};n()},[]),C=(0,x.useCallback)(()=>{_.current&&=(cancelAnimationFrame(_.current),0)},[]),w=(0,x.useCallback)(async()=>{if(!(e!==`idle`&&e!==`error`)){if(s(null),typeof window<`u`&&!window.isSecureContext){t(`error`),s(`Voice recording requires a secure connection (HTTPS). Use your tunnel URL for voice notes.`);return}if(typeof navigator>`u`||!navigator.mediaDevices?.getUserMedia){t(`error`),s(`Voice recording is not supported in this browser.`);return}if(typeof MediaRecorder>`u`){t(`error`),s(`Voice recording is not supported in this browser.`);return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});l.current=e;let n=new AudioContext;h.current=n;let i=n.createMediaStreamSource(e),o=n.createAnalyser();o.fftSize=256,i.connect(o),g.current=o;let s=ou();d.current=s;let f=new MediaRecorder(e,s?{mimeType:s}:void 0);c.current=f,u.current=[],f.ondataavailable=e=>{e.data.size>0&&u.current.push(e.data)},e.getAudioTracks()[0]?.addEventListener(`ended`,()=>{v(),t(`idle`),r(0),a(null)}),f.start(1e3),t(`recording`),r(0),y(),S()}catch(e){v(),t(`error`),e instanceof DOMException?e.name===`NotAllowedError`?s(`Microphone access was denied. Check your browser permissions to enable voice recording.`):e.name===`NotFoundError`?s(`No microphone found. Connect a microphone to use voice recording.`):s(`Microphone error: ${e.message}`):s(`Could not start recording.`)}}},[e,v,y,S]),T=(0,x.useCallback)(()=>{let n=c.current;n&&(e===`recording`&&n.state===`recording`?(n.pause(),b(),C(),t(`paused`)):e===`paused`&&n.state===`paused`&&(n.resume(),y(),S(),t(`recording`)))},[e,b,y,S,C]),E=(0,x.useCallback)(()=>{e!==`recording`&&e!==`paused`||(v(),t(`idle`),r(0),a(null))},[e,v]),D=(0,x.useCallback)(async()=>{if(e!==`recording`&&e!==`paused`)return null;let n=c.current;if(!n)return null;let i=e===`recording`?Date.now()-p.current:0;return m.current+i<1e3?(E(),null):(t(`sending`),b(),C(),new Promise(e=>{n.onstop=()=>{let i=d.current||n.mimeType||`audio/webm`,o=new Blob(u.current,{type:su(i)});v(),t(`idle`),r(0),a(null),e(o.size>0?o:null)},n.stop()}))},[e,E,b,C,v]);return(0,x.useEffect)(()=>{if(e!==`error`)return;let n=setTimeout(()=>{t(`idle`),s(null)},8e3);return()=>clearTimeout(n)},[e]),{state:e,elapsedSeconds:n,waveform:i,errorMessage:o,start:w,togglePause:T,discard:E,send:D}}export{p as A,b as C,g as D,_ as E,d as M,u as N,h as O,l as P,C as S,v as T,O as _,Ql as a,w as b,Yl as c,Ml as d,Tl as f,T as g,A as h,tu as i,f as j,m as k,Jl as l,yo as m,iu as n,Zl as o,xl as p,eu as r,Xl as s,cu as t,ql as u,D as v,y as w,S as x,E as y};
36
+ `,e]})})}function Al({payload:e,reason:t}){let[n,r]=(0,x.useState)(`idle`);(0,x.useEffect)(()=>{Ol(`device-url:fallback-shown`,{intent:e.intent,reason:t,hostname:e.hostname??``})},[e.intent,e.hostname,t]);let i=async()=>{try{await navigator.clipboard.writeText(e.url),r(`copied`),window.setTimeout(()=>r(`idle`),2e3)}catch(t){r(`failed`),Ol(`device-url:fallback-shown`,{intent:e.intent,reason:`clipboard-api-unavailable`,hostname:e.hostname??``,detail:t instanceof Error?t.message.slice(0,200):String(t).slice(0,200)})}},a=e.hostname?` on the device (${e.hostname})`:` on the device`;return(0,k.jsxs)(`div`,{className:`md-device-url md-device-url-fallback`,role:`group`,children:[(0,k.jsxs)(`div`,{className:`md-device-url-fallback-message`,children:[(0,k.jsx)(b,{size:14}),(0,k.jsxs)(`span`,{children:[`Could not open `,(0,k.jsx)(`strong`,{children:e.intent}),a,` automatically (`,t,`). Copy the URL and open it in a browser on the device:`]})]}),(0,k.jsxs)(`div`,{className:`md-device-url-fallback-url`,children:[(0,k.jsx)(`code`,{children:e.url}),(0,k.jsxs)(`button`,{type:`button`,className:`md-device-url-fallback-copy`,onClick:i,"aria-label":`Copy URL`,children:[n===`copied`?(0,k.jsx)(l,{size:14}):(0,k.jsx)(d,{size:14}),n===`copied`?`Copied`:n===`failed`?`Copy failed`:`Copy`]})]}),n===`failed`&&(0,k.jsx)(`div`,{className:`md-device-url-fallback-copy-failed`,children:`Your browser blocked the copy action. Select the URL text above manually to copy it.`})]})}function jl({payload:e}){let t=El(),[n,r]=(0,x.useState)({phase:`idle`});(0,x.useEffect)(()=>{Ol(`device-url:render`,{intent:e.intent,url:e.url,hostname:e.hostname??``,origin:`tool`})},[e.intent,e.url,e.hostname]);let i=async()=>{if(n.phase!==`navigating`){r({phase:`navigating`});try{let n=await fetch(`/api/admin/device-browser/navigate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),i=await n.json().catch(()=>({}));if(n.ok&&i.ok){r({phase:`succeeded`}),t&&(t.onShowVnc(),Ol(`device-url:vnc-surface-shown`,{intent:e.intent})),window.setTimeout(()=>r({phase:`idle`}),2500);return}r({phase:`fallback`,reason:i.navigateResult?Dl[i.navigateResult]:i.detail?i.detail.slice(0,80):`navigation failed`})}catch(e){r({phase:`fallback`,reason:(e instanceof Error?e.message:String(e)).slice(0,80)})}}},a=n.phase===`navigating`,o=n.phase===`succeeded`;return(0,k.jsxs)(`div`,{className:`md-device-url`,children:[(0,k.jsxs)(`button`,{type:`button`,className:`md-device-url-button`,onClick:i,disabled:a,"aria-label":`Open ${e.intent} on the device's browser`,title:e.hostname?`Opens on device: ${e.hostname}`:`Opens on the device running Maxy`,children:[(0,k.jsx)(m,{size:16,className:`md-device-url-icon`}),(0,k.jsx)(`span`,{className:`md-device-url-label`,children:a?`Opening…`:o?`Opened on device`:`Open ${e.intent} on device`})]}),n.phase===`fallback`&&(0,k.jsx)(Al,{payload:e,reason:n.reason})]})}function Ml({source:e}){let t=Cl(e.trim());return t.ok?(0,k.jsx)(jl,{payload:t.payload}):(0,k.jsx)(kl,{raw:e,reason:t.reason})}var Nl=null;function Pl(){return Nl||=c(async()=>{let{default:e}=await import(`./mermaid.core-CCUSwZB_.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`neutral`}),e)),Nl}function Fl({source:e}){let t=(0,x.useRef)(null),[n,r]=(0,x.useState)(null);return(0,x.useEffect)(()=>{let n=!1,i=`mermaid-${Math.random().toString(36).slice(2,9)}`;return Pl().then(t=>t.render(i,e)).then(({svg:e})=>{!n&&t.current&&(t.current.innerHTML=e)}).catch(t=>{n||(console.error(`[MermaidBlock] render failed:`,e,t),r(t instanceof Error?t.message:`Diagram render failed`))}),()=>{n=!0}},[e]),n?(0,k.jsxs)(`div`,{className:`md-mermaid md-mermaid-error`,children:[(0,k.jsx)(`div`,{className:`md-mermaid-error-label`,children:`Diagram render error`}),(0,k.jsx)(`pre`,{className:`md-pre`,children:(0,k.jsx)(`code`,{className:`md-code`,children:e})})]}):(0,k.jsx)(`div`,{className:`md-mermaid`,ref:t})}var Il=/\.(mp4|webm|mov)(\?.*)?$/i,Ll=/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/,Rl=/vimeo\.com\/(\d+)/;function zl(e){return!!e&&Il.test(e)}function Bl(e){if(!e)return null;let t=e.match(Ll);return t?t[1]:null}function Vl(e){if(!e)return null;let t=e.match(Rl);return t?t[1]:null}function Hl({src:e}){return(0,k.jsx)(`video`,{className:`md-video`,controls:!0,playsInline:!0,preload:`metadata`,children:(0,k.jsx)(`source`,{src:e})})}function Ul({videoId:e}){return(0,k.jsx)(`div`,{className:`md-video-iframe`,children:(0,k.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${e}`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,loading:`lazy`})})}function Wl({videoId:e}){return(0,k.jsx)(`div`,{className:`md-video-iframe`,children:(0,k.jsx)(`iframe`,{src:`https://player.vimeo.com/video/${e}`,allow:`autoplay; fullscreen; picture-in-picture`,allowFullScreen:!0,loading:`lazy`})})}function Gl(e){if(zl(e))return(0,k.jsx)(Hl,{src:e});let t=Bl(e);if(t)return(0,k.jsx)(Ul,{videoId:t});let n=Vl(e);return n?(0,k.jsx)(Wl,{videoId:n}):null}var Kl={p:({children:e})=>(0,k.jsx)(`p`,{className:`md-p`,children:e}),h1:({children:e})=>(0,k.jsx)(`h1`,{className:`md-heading`,children:e}),h2:({children:e})=>(0,k.jsx)(`h2`,{className:`md-heading`,children:e}),h3:({children:e})=>(0,k.jsx)(`h3`,{className:`md-heading`,children:e}),code:({children:e,className:t})=>t===`language-mermaid`?(0,k.jsx)(Fl,{source:String(e).replace(/\n$/,``)}):t===`language-maxy-device-url`?(0,k.jsx)(Ml,{source:String(e).replace(/\n$/,``)}):(0,k.jsx)(`code`,{className:`md-code ${t||``}`.trim(),children:e}),pre:({children:e,node:t})=>{let n=t?.children?.[0];if(n?.type===`element`&&n.tagName===`code`){let t=n.properties?.className??[];if(t.includes(`language-mermaid`)||t.includes(`language-maxy-device-url`))return(0,k.jsx)(k.Fragment,{children:e})}return(0,k.jsx)(`pre`,{className:`md-pre`,children:e})},ul:({children:e})=>(0,k.jsx)(`ul`,{className:`md-list`,children:e}),ol:({children:e})=>(0,k.jsx)(`ol`,{className:`md-list md-list-ordered`,children:e}),li:({children:e})=>(0,k.jsx)(`li`,{className:`md-list-item`,children:e}),hr:()=>(0,k.jsx)(`hr`,{className:`md-hr`}),strong:({children:e})=>(0,k.jsx)(`strong`,{className:`md-strong`,children:e}),img:({src:e,alt:t})=>Gl(e)||(0,k.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:(0,k.jsx)(`img`,{className:`md-img`,src:e,alt:t||``,loading:`lazy`})}),a:({href:e,children:t})=>Gl(e)||(0,k.jsx)(`a`,{href:e,className:`md-link`,target:`_blank`,rel:`noopener noreferrer`,children:t}),table:({children:e})=>(0,k.jsx)(`table`,{className:`md-table`,children:e}),thead:({children:e})=>(0,k.jsx)(`thead`,{className:`md-thead`,children:e}),tbody:({children:e})=>(0,k.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,k.jsx)(`tr`,{className:`md-tr`,children:e}),th:({children:e})=>(0,k.jsx)(`th`,{className:`md-th`,children:e}),td:({children:e})=>(0,k.jsx)(`td`,{className:`md-td`,children:e})};function ql({content:e,elapsedSeconds:t,timestamp:n}){return(0,k.jsxs)(`div`,{className:`markdown-message`,children:[(0,k.jsx)(yo,{remarkPlugins:[xl],components:Kl,children:e}),t!==void 0&&(0,k.jsxs)(`div`,{className:`message-meta`,children:[t,`s`]}),n&&(0,k.jsx)(`span`,{className:`message-timestamp`,children:n})]})}function Jl({submitted:e,submittedLabel:t=`Submitted`,actions:n,children:r}){return(0,k.jsxs)(`div`,{className:`component-card${e?` component-card--submitted`:``}`,children:[r,(0,k.jsx)(`div`,{className:`component-card__actions`,children:e?(0,k.jsx)(`span`,{className:`component-card__done-label`,children:t}):n.map((e,t)=>(0,k.jsx)(A,{variant:e.variant,size:`sm`,disabled:e.disabled,onClick:e.onClick,children:e.label},t))})]})}function Yl({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.options)?r.options:[],[a,o]=(0,x.useState)(null),[s,c]=(0,x.useState)(`Submitted`);if(i.length===0)return null;let l=e=>{n||o(e)},u=()=>{if(!a||n)return;let e=i.find(e=>e.value===a);c(e?.label??`Submitted`),t((r?.submitMessage??`Selected: {{value}}`).replace(`{{value}}`,a).replace(`{{label}}`,e?.label??a))},d=()=>{n||(c(r?.backLabel??`Back`),t(r?.backMessage??``))},f=(e,t)=>{if(!n)if(e.key===`ArrowDown`||e.key===`ArrowRight`){e.preventDefault();let n=(t+1)%i.length;l(i[n].value),(e.currentTarget.parentElement?.children[n])?.focus()}else if(e.key===`ArrowUp`||e.key===`ArrowLeft`){e.preventDefault();let n=(t-1+i.length)%i.length;l(i[n].value),(e.currentTarget.parentElement?.children[n])?.focus()}else (e.key===` `||e.key===`Enter`)&&(e.preventDefault(),l(i[t].value))};return(0,k.jsx)(Jl,{submitted:n,submittedLabel:s,actions:[...r?.backLabel&&r?.backMessage?[{label:r.backLabel,variant:`ghost`,onClick:d}]:[],{label:r?.submitLabel??`Confirm`,variant:`primary`,disabled:!a,onClick:u}],children:(0,k.jsxs)(`div`,{className:`single-select`,role:`radiogroup`,"aria-label":r?.title??`Select one`,children:[r?.title&&(0,k.jsx)(`div`,{className:`single-select__title`,children:r.title}),i.map((e,t)=>(0,k.jsxs)(`div`,{className:`single-select__row${a===e.value?` single-select__row--selected`:``}`,role:`radio`,"aria-checked":a===e.value,tabIndex:a===e.value||!a&&t===0?0:-1,onClick:()=>l(e.value),onKeyDown:e=>f(e,t),children:[(0,k.jsx)(`span`,{className:`single-select__radio${a===e.value?` single-select__radio--checked`:``}`}),(0,k.jsxs)(`div`,{className:`single-select__info`,children:[(0,k.jsxs)(`span`,{className:`single-select__label`,children:[e.icon&&(0,k.jsx)(`span`,{className:`single-select__icon`,children:e.icon}),e.label]}),e.description&&(0,k.jsx)(`span`,{className:`single-select__desc`,children:e.description})]})]},e.value))]})})}function Xl({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.options)?r.options:[],[a,o]=(0,x.useState)(i.map(e=>!!e.locked||!!e.defaultSelected)),[c,l]=(0,x.useState)(`Submitted`);if(i.length===0)return null;let u=i.some(e=>e.locked),d=i.every((e,t)=>e.locked||a[t]),f=e=>{n||i[e].locked||o(t=>t.map((t,n)=>n===e?!t:t))},p=()=>{n||o(i.map((e,t)=>e.locked?a[t]:!d))},m=i.filter((e,t)=>!e.locked&&a[t]).map(e=>e.value),h=m.length>0||u,g=()=>{if(!(!h||n)){if(l(`Submitted`),m.length===0){t(`No optional plugins selected`);return}t((r?.submitMessage??`Selected: {{values}}`).replace(`{{values}}`,m.join(`, `)))}},_=()=>{n||(l(`Skipped`),t(r?.skipMessage??`Skipped`))},v=()=>{n||(l(r?.backLabel??`Back`),t(r?.backMessage??``))},y=[];return r?.backLabel&&r?.backMessage&&y.push({label:r.backLabel,variant:`ghost`,onClick:v}),r?.skipLabel&&y.push({label:r.skipLabel,variant:`ghost`,onClick:_}),y.push({label:r?.submitLabel??`Confirm`,variant:`primary`,disabled:!h,onClick:g}),(0,k.jsx)(Jl,{submitted:n,submittedLabel:c,actions:y,children:(0,k.jsxs)(`div`,{className:`multi-select`,children:[r?.title&&(0,k.jsx)(`div`,{className:`multi-select__title`,children:r.title}),r?.selectAll&&(0,k.jsx)(`div`,{className:`multi-select__header`,children:(0,k.jsx)(s,{checked:d,onChange:p,label:`Select all`,disabled:n})}),(0,k.jsx)(`div`,{className:`multi-select__list`,role:`group`,"aria-label":r?.title??`Select options`,children:i.map((e,t)=>{let r=e.group&&(t===0||e.group!==i[t-1].group),o=!!e.locked;return(0,k.jsxs)(x.Fragment,{children:[r&&(0,k.jsx)(`div`,{className:`multi-select__group-header`,children:e.group}),(0,k.jsxs)(`div`,{className:`multi-select__row${o?` multi-select__row--locked`:``}`,role:`checkbox`,"aria-checked":a[t],"aria-disabled":o||void 0,tabIndex:o?-1:0,onClick:()=>f(t),onKeyDown:e=>{n||o||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),f(t))},children:[(0,k.jsx)(s,{checked:a[t],onChange:()=>f(t),disabled:n||o}),(0,k.jsxs)(`div`,{className:`multi-select__info`,children:[(0,k.jsxs)(`span`,{className:`multi-select__label`,children:[e.label,e.badge&&(0,k.jsx)(`span`,{className:`multi-select__badge`,children:e.badge})]}),e.description&&(0,k.jsx)(`span`,{className:`multi-select__desc`,children:e.description})]})]})]},e.value)})})]})})}function Zl({data:e,onSubmit:t,submitted:n}){let r=e,i=Array.isArray(r?.buttons)?r.buttons:[],[a,o]=(0,x.useState)(`Submitted`);if(i.length===0)return null;let s=e=>{n||(o(e.label),t(e.value))};return(0,k.jsx)(Jl,{submitted:n,submittedLabel:a,actions:i.map(e=>({label:e.label,variant:`primary`,onClick:()=>s(e)})),children:(0,k.jsx)(k.Fragment,{})})}function Ql(e){let t=new Date(e),n=new Date,r=String(t.getHours()).padStart(2,`0`),i=String(t.getMinutes()).padStart(2,`0`),a=String(t.getSeconds()).padStart(2,`0`);return t.toDateString()===n.toDateString()?`${r}:${i}:${a}`:`${String(t.getDate()).padStart(2,`0`)}-${String(t.getMonth()+1).padStart(2,`0`)}-${t.getFullYear()} ${r}:${i}:${a}`}var $l=44,eu=(0,x.forwardRef)(function({value:e,onChange:t,placeholder:n,disabled:r},i){let a=(0,x.useRef)(null),o=(0,x.useRef)(!1),s=(0,x.useCallback)((e,t)=>{let n=e.closest(`.chat-form`);n&&(n.dataset.expanded=t>$l?`true`:``)},[]),c=(0,x.useCallback)(e=>{if(o.current)return;let t=window.innerHeight*.75;e.style.height=`auto`;let n=Math.min(e.scrollHeight,t);e.style.height=`${n}px`,e.style.overflowY=e.scrollHeight>t?`auto`:`hidden`,s(e,n)},[s]);return(0,x.useImperativeHandle)(i,()=>({focus(){a.current?.focus()},resetHeight(){if(!a.current)return;o.current=!1,a.current.style.height=``,a.current.style.overflowY=``;let e=a.current.closest(`.chat-form`);e&&(e.dataset.expanded=``)},getOffsetHeight(){return a.current?.offsetHeight??36},setHeight(e){a.current&&(o.current=!0,a.current.style.height=`${e}px`,s(a.current,e))}})),(0,k.jsx)(`textarea`,{ref:a,className:`chat-input`,rows:1,value:e,onChange:e=>{t(e.target.value),c(e.target)},onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.closest(`form`)?.requestSubmit())},placeholder:n,disabled:r,"aria-label":n||`Type a message...`})});function tu({inputRef:e}){let t=(0,x.useRef)(null);function n(n){e.current&&(n.preventDefault(),n.target.setPointerCapture(n.pointerId),t.current={startY:n.clientY,startH:e.current.getOffsetHeight()})}function r(n){if(!t.current||!e.current)return;let r=t.current.startY-n.clientY,i=window.innerHeight*.75,a=Math.max(36,Math.min(i,t.current.startH+r));e.current.setHeight(a)}function i(){t.current=null}return(0,k.jsx)(`div`,{className:`chat-resize-handle`,onPointerDown:n,onPointerMove:r,onPointerUp:i,"aria-label":`Resize input`,children:(0,k.jsx)(`div`,{className:`chat-resize-handle-bar`})})}function nu(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function ru({data:e,active:t}){let n=[];if(e&&e.length>0&&t){let t=Math.floor(e.length/24);for(let r=0;r<24;r++){let i=e[r*t]??128,a=Math.abs(i-128)/128;n.push(Math.max(.15,a))}}else for(let e=0;e<24;e++)n.push(.15);return(0,k.jsx)(`div`,{className:`voice-waveform`,"aria-hidden":`true`,children:n.map((e,t)=>(0,k.jsx)(`div`,{className:`voice-waveform-bar`,style:{height:`${Math.round(e*100)}%`}},t))})}function iu({state:e,elapsedSeconds:t,waveform:n,onTogglePause:i,onDiscard:a,onSend:o}){if(e===`idle`||e===`error`)return null;let s=e===`recording`,c=e===`paused`,l=e===`sending`;return(0,k.jsxs)(`div`,{className:`voice-recorder`,role:`region`,"aria-label":`Voice recording`,"aria-live":`polite`,children:[(0,k.jsx)(`button`,{type:`button`,className:`voice-trash`,onClick:a,disabled:l,"aria-label":`Discard recording`,children:(0,k.jsx)(r,{size:16})}),(0,k.jsx)(`span`,{className:`voice-timer`,"aria-live":`polite`,"aria-atomic":`true`,children:nu(t)}),(0,k.jsx)(ru,{data:n,active:s}),(0,k.jsx)(`button`,{type:`button`,className:`voice-pause`,onClick:i,disabled:l,"aria-label":c?`Resume recording`:`Pause recording`,children:c?(0,k.jsx)(v,{size:14}):(0,k.jsx)(_,{size:14})}),(0,k.jsx)(A,{variant:`send`,type:`button`,onClick:o,disabled:l,loading:l,"aria-label":`Send voice note`,children:(0,k.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,k.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]})}var au=[`audio/ogg;codecs=opus`,`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`];function ou(){for(let e of au)if(MediaRecorder.isTypeSupported(e))return e;return``}function su(e){return e.split(`;`)[0]}function cu(){let[e,t]=(0,x.useState)(`idle`),[n,r]=(0,x.useState)(0),[i,a]=(0,x.useState)(null),[o,s]=(0,x.useState)(null),c=(0,x.useRef)(null),l=(0,x.useRef)(null),u=(0,x.useRef)([]),d=(0,x.useRef)(``),f=(0,x.useRef)(null),p=(0,x.useRef)(0),m=(0,x.useRef)(0),h=(0,x.useRef)(null),g=(0,x.useRef)(null),_=(0,x.useRef)(0),v=(0,x.useCallback)(()=>{if(f.current&&=(clearInterval(f.current),null),_.current&&=(cancelAnimationFrame(_.current),0),c.current&&c.current.state!==`inactive`)try{c.current.stop()}catch{}c.current=null,u.current=[],l.current&&=(l.current.getTracks().forEach(e=>e.stop()),null),h.current&&(h.current.close().catch(()=>{}),h.current=null,g.current=null),m.current=0,p.current=0},[]);(0,x.useEffect)(()=>v,[v]);let y=(0,x.useCallback)(()=>{p.current=Date.now(),f.current=setInterval(()=>{let e=Date.now()-p.current,t=m.current+e;r(Math.floor(t/1e3))},200)},[]),b=(0,x.useCallback)(()=>{f.current&&=(clearInterval(f.current),null);let e=Date.now()-p.current;m.current+=e},[]),S=(0,x.useCallback)(()=>{let e=g.current;if(!e)return;let t=new Uint8Array(e.frequencyBinCount),n=()=>{e.getByteTimeDomainData(t),a(new Uint8Array(t)),_.current=requestAnimationFrame(n)};n()},[]),C=(0,x.useCallback)(()=>{_.current&&=(cancelAnimationFrame(_.current),0)},[]),w=(0,x.useCallback)(async()=>{if(!(e!==`idle`&&e!==`error`)){if(s(null),typeof window<`u`&&!window.isSecureContext){t(`error`),s(`Voice recording requires a secure connection (HTTPS). Use your tunnel URL for voice notes.`);return}if(typeof navigator>`u`||!navigator.mediaDevices?.getUserMedia){t(`error`),s(`Voice recording is not supported in this browser.`);return}if(typeof MediaRecorder>`u`){t(`error`),s(`Voice recording is not supported in this browser.`);return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});l.current=e;let n=new AudioContext;h.current=n;let i=n.createMediaStreamSource(e),o=n.createAnalyser();o.fftSize=256,i.connect(o),g.current=o;let s=ou();d.current=s;let f=new MediaRecorder(e,s?{mimeType:s}:void 0);c.current=f,u.current=[],f.ondataavailable=e=>{e.data.size>0&&u.current.push(e.data)},e.getAudioTracks()[0]?.addEventListener(`ended`,()=>{v(),t(`idle`),r(0),a(null)}),f.start(1e3),t(`recording`),r(0),y(),S()}catch(e){v(),t(`error`),e instanceof DOMException?e.name===`NotAllowedError`?s(`Microphone access was denied. Check your browser permissions to enable voice recording.`):e.name===`NotFoundError`?s(`No microphone found. Connect a microphone to use voice recording.`):s(`Microphone error: ${e.message}`):s(`Could not start recording.`)}}},[e,v,y,S]),T=(0,x.useCallback)(()=>{let n=c.current;n&&(e===`recording`&&n.state===`recording`?(n.pause(),b(),C(),t(`paused`)):e===`paused`&&n.state===`paused`&&(n.resume(),y(),S(),t(`recording`)))},[e,b,y,S,C]),E=(0,x.useCallback)(()=>{e!==`recording`&&e!==`paused`||(v(),t(`idle`),r(0),a(null))},[e,v]),D=(0,x.useCallback)(async()=>{if(e!==`recording`&&e!==`paused`)return null;let n=c.current;if(!n)return null;let i=e===`recording`?Date.now()-p.current:0;return m.current+i<1e3?(E(),null):(t(`sending`),b(),C(),new Promise(e=>{n.onstop=()=>{let i=d.current||n.mimeType||`audio/webm`,o=new Blob(u.current,{type:su(i)});v(),t(`idle`),r(0),a(null),e(o.size>0?o:null)},n.stop()}))},[e,E,b,C,v]);return(0,x.useEffect)(()=>{if(e!==`error`)return;let n=setTimeout(()=>{t(`idle`),s(null)},8e3);return()=>clearTimeout(n)},[e]),{state:e,elapsedSeconds:n,waveform:i,errorMessage:o,start:w,togglePause:T,discard:E,send:D}}export{p as A,b as C,g as D,_ as E,d as M,u as N,h as O,l as P,C as S,v as T,O as _,Ql as a,w as b,Yl as c,Ml as d,Tl as f,T as g,A as h,tu as i,f as j,m as k,Jl as l,yo as m,iu as n,Zl as o,xl as p,eu as r,Xl as s,cu as t,ql as u,D as v,y as w,S as x,E as y};
@@ -1,4 +1,4 @@
1
- import{h as e,p as t}from"./src-Bo15iQ7w.js";import{$ as n,B as r,C as i,Q as a,V as o,W as s,_ as c,a as l,c as u,d,et as f,tt as p,v as m,y as h}from"./chunk-ICPOFSXX-DHInTpuR.js";import"./dist-CrzV1W3-.js";import{r as g}from"./chunk-5PVQY5BW-_iMyxz0C.js";import{t as _}from"./chunk-426QAEUC-zKsTsXw6.js";import{t as v}from"./rough.esm-NLRoWnq-.js";var y=(e,t)=>f(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function ee(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function te(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||oe,r=t.lossFunction||z,i=re(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var ne=1e-10;function R(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+ne?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function re(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function ie(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=R(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ae(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function oe(e,t={}){let n=ce(e,t),r=t.lossFunction||z;if(e.length>=8){let i=se(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function se(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=ie(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ae(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=ee(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function ce(e,t){let n=t&&t.lossFunction?t.lossFunction:z,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+ne>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=R(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=R(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function z(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function le(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function ue(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function de(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function B(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function fe(e,t,n){t??=Math.PI/2;let r=he(e).map(e=>Object.assign({},e)),i=de(r);for(let e of i){ue(e,t,n);let r=B(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=B(r);return me(r)}function pe(e,t,n,r,i){let a=he(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=B(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return me(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function me(e){let t={};for(let n of e)t[n.setid]=n;return t}function he(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function ge(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=te,x=z;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=fe(e,o,f)),S=pe(e,n,r,i,c),C=ye(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=xe(t))});function k(e){return t=>we(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>we(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,V(S,T)):I.each(`end`,V(S,T)):I.each(V(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let ee=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),ee.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e===`default`?z:e===`logRatio`?le:e,S):x},S}function V(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function H(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function _e(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=H(r[0],e,t);for(let n=1;n<r.length;++n){let o=H(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*H({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?_e(e,[]):O(l.arcs.map(e=>e.p1))}function ve(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ye(e,t,n){let r={},i=ve(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=_e(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function be(e,t,n){let r=[];return r.push(`
1
+ import{h as e,p as t}from"./src-Bo15iQ7w.js";import{$ as n,B as r,C as i,Q as a,V as o,W as s,_ as c,a as l,c as u,d,et as f,tt as p,v as m,y as h}from"./chunk-ICPOFSXX-Di63NBur.js";import"./dist-CrzV1W3-.js";import{r as g}from"./chunk-5PVQY5BW-RhIfPCRB.js";import{t as _}from"./chunk-426QAEUC-Wz6Bpsil.js";import{t as v}from"./rough.esm-NLRoWnq-.js";var y=(e,t)=>f(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function ee(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function te(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||oe,r=t.lossFunction||z,i=re(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var ne=1e-10;function R(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+ne?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function re(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function ie(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=R(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ae(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function oe(e,t={}){let n=ce(e,t),r=t.lossFunction||z;if(e.length>=8){let i=se(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function se(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=ie(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ae(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=ee(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function ce(e,t){let n=t&&t.lossFunction?t.lossFunction:z,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+ne>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=R(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=R(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function z(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function le(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function ue(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function de(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function B(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function fe(e,t,n){t??=Math.PI/2;let r=he(e).map(e=>Object.assign({},e)),i=de(r);for(let e of i){ue(e,t,n);let r=B(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=B(r);return me(r)}function pe(e,t,n,r,i){let a=he(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=B(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return me(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function me(e){let t={};for(let n of e)t[n.setid]=n;return t}function he(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function ge(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=te,x=z;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=fe(e,o,f)),S=pe(e,n,r,i,c),C=ye(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=xe(t))});function k(e){return t=>we(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>we(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,V(S,T)):I.each(`end`,V(S,T)):I.each(V(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let ee=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),ee.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e===`default`?z:e===`logRatio`?le:e,S):x},S}function V(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function H(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function _e(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=H(r[0],e,t);for(let n=1;n<r.length;++n){let o=H(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*H({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?_e(e,[]):O(l.arcs.map(e=>e.p1))}function ve(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ye(e,t,n){let r={},i=ve(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=_e(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function be(e,t,n){let r=[];return r.push(`
2
2
  M`,e,t),r.push(`
3
3
  m`,-n,0),r.push(`
4
4
  a`,n,n,0,1,0,n*2,0),r.push(`
@@ -1,4 +1,4 @@
1
- import"./chunk-K5T4RW27-CTTOezMH.js";import"./chunk-7N4EOEYR-GUck0jv1.js";import"./chunk-67CJDMHE-mM1sFmlz.js";import"./chunk-KGLVRYIC-DCkohKP2.js";import"./chunk-FOC6F5B3-BaeLcJVt.js";import"./chunk-AA7GKIK3-BYhfUc1V.js";import"./chunk-2KRD3SAO-ZcHg_orY.js";import"./chunk-ORNJ4GCN-DoLajOOe.js";import"./chunk-LIHQZDEY-osQO30uB.js";import"./chunk-CIAEETIT-CGsGmUze.js";import{g as e,h as t}from"./src-Bo15iQ7w.js";import{B as n,C as r,L as i,V as a,W as o,_ as s,a as c,b as l,c as u,v as d}from"./chunk-ICPOFSXX-DHInTpuR.js";import{t as f}from"./chunk-426QAEUC-zKsTsXw6.js";import{t as p}from"./chunk-4BX2VUAB-zJekz2NU.js";import{t as m}from"./mermaid-parser.core-CsaDWYZC.js";var h=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),g=t((e,t,n)=>({x:h(t,`${n} evolution`),y:h(e,`${n} visibility`)}),`toCoordinates`),_=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),v=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),y=t((e,t)=>{if(p(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=g(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=g(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=g(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=h(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=_(e.fromPort)??_(e.toPort),{flow:i,label:a}=v(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(e.from,e.to,n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=h(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=g(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=g(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=g(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=g(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),b={parser:{yy:void 0},parse:t(async t=>{let n=await m(`wardley`,t);e.debug(n);let r=b.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);y(n,r)},`parse`)},x=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function S(e){let t=l();return i(e.trim(),t)}t(S,`textSanitizer`);function C(){return l()[`wardley-beta`]}t(C,`getConfig`);function w(e,t,n,r,i,a,o,s,c){x.addNode({id:e,label:S(t),x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(w,`addNode`);function T(e,t,n=!1,r,i){x.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(T,`addLink`);function E(e,t,n){x.addTrend({nodeId:e,targetX:t,targetY:n})}t(E,`addTrend`);function D(e,t,n){x.addAnnotation({number:e,coordinates:t,text:n?S(n):void 0})}t(D,`addAnnotation`);function O(e,t,n){x.addNote({text:S(e),x:t,y:n})}t(O,`addNote`);function k(e,t,n){x.addAccelerator({name:S(e),x:t,y:n})}t(k,`addAccelerator`);function A(e,t,n){x.addDeaccelerator({name:S(e),x:t,y:n})}t(A,`addDeaccelerator`);function j(e,t){x.setAnnotationsBox(e,t)}t(j,`setAnnotationsBox`);function M(e,t){x.setSize(e,t)}t(M,`setSize`);function N(e){x.startPipeline(e)}t(N,`startPipeline`);function P(e,t){x.addPipelineComponent(e,t)}t(P,`addPipelineComponent`);function F(e){let t={};e.xLabel&&(t.xLabel=S(e.xLabel)),e.yLabel&&(t.yLabel=S(e.yLabel)),e.stages&&(t.stages=e.stages.map(e=>S(e))),e.stageBoundaries&&(t.stageBoundaries=e.stageBoundaries),x.setAxes(t)}t(F,`updateAxes`);function I(e){return x.getNode(e)}t(I,`getNode`);function L(){return x.build()}t(L,`getWardleyData`);function R(){x.clear(),c()}t(R,`clear`);var z={getConfig:C,addNode:w,addLink:T,addTrend:E,addAnnotation:D,addNote:O,addAccelerator:k,addDeaccelerator:A,setAnnotationsBox:j,setSize:M,startPipeline:N,addPipelineComponent:P,updateAxes:F,getNode:I,getWardleyData:L,clear:R,setAccTitle:a,getAccTitle:d,setDiagramTitle:o,getDiagramTitle:r,getAccDescription:s,setAccDescription:n},B=[`Genesis`,`Custom Built`,`Product`,`Commodity`],V=t(()=>{let{themeVariables:e}=l();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),H=t(()=>{let e=l()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),U={parser:b,db:z,renderer:{draw:t((n,r,i,a)=>{e.debug(`Rendering Wardley map
1
+ import"./chunk-K5T4RW27-CTTOezMH.js";import"./chunk-7N4EOEYR-GUck0jv1.js";import"./chunk-67CJDMHE-mM1sFmlz.js";import"./chunk-KGLVRYIC-DCkohKP2.js";import"./chunk-FOC6F5B3-BaeLcJVt.js";import"./chunk-AA7GKIK3-BYhfUc1V.js";import"./chunk-2KRD3SAO-ZcHg_orY.js";import"./chunk-ORNJ4GCN-DoLajOOe.js";import"./chunk-LIHQZDEY-osQO30uB.js";import"./chunk-CIAEETIT-CGsGmUze.js";import{g as e,h as t}from"./src-Bo15iQ7w.js";import{B as n,C as r,L as i,V as a,W as o,_ as s,a as c,b as l,c as u,v as d}from"./chunk-ICPOFSXX-Di63NBur.js";import{t as f}from"./chunk-426QAEUC-Wz6Bpsil.js";import{t as p}from"./chunk-4BX2VUAB-zJekz2NU.js";import{t as m}from"./mermaid-parser.core-C8xGCa9p.js";var h=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),g=t((e,t,n)=>({x:h(t,`${n} evolution`),y:h(e,`${n} visibility`)}),`toCoordinates`),_=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),v=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),y=t((e,t)=>{if(p(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=g(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=g(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=g(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=h(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=_(e.fromPort)??_(e.toPort),{flow:i,label:a}=v(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(e.from,e.to,n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=h(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=g(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=g(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=g(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=g(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),b={parser:{yy:void 0},parse:t(async t=>{let n=await m(`wardley`,t);e.debug(n);let r=b.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);y(n,r)},`parse`)},x=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function S(e){let t=l();return i(e.trim(),t)}t(S,`textSanitizer`);function C(){return l()[`wardley-beta`]}t(C,`getConfig`);function w(e,t,n,r,i,a,o,s,c){x.addNode({id:e,label:S(t),x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(w,`addNode`);function T(e,t,n=!1,r,i){x.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(T,`addLink`);function E(e,t,n){x.addTrend({nodeId:e,targetX:t,targetY:n})}t(E,`addTrend`);function D(e,t,n){x.addAnnotation({number:e,coordinates:t,text:n?S(n):void 0})}t(D,`addAnnotation`);function O(e,t,n){x.addNote({text:S(e),x:t,y:n})}t(O,`addNote`);function k(e,t,n){x.addAccelerator({name:S(e),x:t,y:n})}t(k,`addAccelerator`);function A(e,t,n){x.addDeaccelerator({name:S(e),x:t,y:n})}t(A,`addDeaccelerator`);function j(e,t){x.setAnnotationsBox(e,t)}t(j,`setAnnotationsBox`);function M(e,t){x.setSize(e,t)}t(M,`setSize`);function N(e){x.startPipeline(e)}t(N,`startPipeline`);function P(e,t){x.addPipelineComponent(e,t)}t(P,`addPipelineComponent`);function F(e){let t={};e.xLabel&&(t.xLabel=S(e.xLabel)),e.yLabel&&(t.yLabel=S(e.yLabel)),e.stages&&(t.stages=e.stages.map(e=>S(e))),e.stageBoundaries&&(t.stageBoundaries=e.stageBoundaries),x.setAxes(t)}t(F,`updateAxes`);function I(e){return x.getNode(e)}t(I,`getNode`);function L(){return x.build()}t(L,`getWardleyData`);function R(){x.clear(),c()}t(R,`clear`);var z={getConfig:C,addNode:w,addLink:T,addTrend:E,addAnnotation:D,addNote:O,addAccelerator:k,addDeaccelerator:A,setAnnotationsBox:j,setSize:M,startPipeline:N,addPipelineComponent:P,updateAxes:F,getNode:I,getWardleyData:L,clear:R,setAccTitle:a,getAccTitle:d,setDiagramTitle:o,getDiagramTitle:r,getAccDescription:s,setAccDescription:n},B=[`Genesis`,`Custom Built`,`Product`,`Commodity`],V=t(()=>{let{themeVariables:e}=l();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),H=t(()=>{let e=l()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),U={parser:b,db:z,renderer:{draw:t((n,r,i,a)=>{e.debug(`Rendering Wardley map
2
2
  `+n);let o=H(),s=V(),c=o.nodeRadius*1.6,l=a.db,d=l.getWardleyData(),p=l.getDiagramTitle(),m=d.size?.width??o.width,h=d.size?.height??o.height,g=f(r);g.selectAll(`*`).remove(),u(g,h,m,o.useMaxWidth),g.attr(`viewBox`,`0 0 ${m} ${h}`);let _=g.append(`g`).attr(`class`,`wardley-map`),v=g.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,m).attr(`height`,h).attr(`fill`,s.backgroundColor);let y=m-o.padding*2,b=h-o.padding*2;p&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,m/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(p);let x=t(e=>o.padding+e/100*y,`projectX`),S=t(e=>h-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,m-o.padding).attr(`y1`,h-o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,h-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:B;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,h-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,m-o.padding).attr(`y1`,h-o.padding-b*n).attr(`y2`,h-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,l=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),l=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=l-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-c/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-c/2).attr(`y`,e=>D.get(e.id).y-c/2).attr(`width`,c).attr(`height`,c).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=m-o.padding-l,p=o.padding,g=h-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(p,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
3
3
  M ${n} ${r-30/2}
4
4
  L ${n+60-20} ${r-30/2}