agent-whiteboard 1.0.4 → 1.2.0

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 (202) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +61 -5
  3. package/dist/client/assets/abnfDiagram-VCTEODGH-Dj8sd_5g.js +1 -0
  4. package/dist/client/assets/{arc-4691b008.js → arc-Aq92EeUK.js} +1 -1
  5. package/dist/client/assets/architectureDiagram-5GKGNRK7-B1QyVL0F.js +36 -0
  6. package/dist/client/assets/blockDiagram-I7D4REHJ-CmU2SSFe.js +129 -0
  7. package/dist/client/assets/{bootstrap.min-21652813.js → bootstrap.min-UtnB-TxT.js} +1 -2
  8. package/dist/client/assets/c4Diagram-7LVT6UL2-DWmhp77c.js +38 -0
  9. package/dist/client/assets/channel-C9ni1Via.js +1 -0
  10. package/dist/client/assets/{chunk-QZHKN3VN-0f554985.js → chunk-2Q5K7J3B-CQLo8Sbv.js} +1 -1
  11. package/dist/client/assets/{chunk-FMBD7UC4-23d48b24.js → chunk-5VM5RSS4-fJTWmTTt.js} +1 -1
  12. package/dist/client/assets/{chunk-ND2GUHAM-1104c326.js → chunk-F27PBJKO-DqzEf5gi.js} +1 -1
  13. package/dist/client/assets/chunk-IMKFNOWR-CMamLTz3.js +231 -0
  14. package/dist/client/assets/{chunk-4BX2VUAB-3c93511d.js → chunk-JWPE2WC7-tyYPyD43.js} +1 -1
  15. package/dist/client/assets/chunk-POPQ4Y6H-XdY4rO_V.js +1 -0
  16. package/dist/client/assets/chunk-SVP7TREG-COvqzqaO.js +88 -0
  17. package/dist/client/assets/chunk-TICWLB2K-BsJSFuPC.js +206 -0
  18. package/dist/client/assets/{chunk-55IACEB6-0243aefd.js → chunk-XXDRQBXY-HfVrYBJb.js} +1 -1
  19. package/dist/client/assets/classDiagram-ZZMXUADV-DktNEiGC.js +1 -0
  20. package/dist/client/assets/classDiagram-v2-VYDZK3BY-DktNEiGC.js +1 -0
  21. package/dist/client/assets/cose-bilkent-JH36ORCC-UXGdwSjS.js +1 -0
  22. package/dist/client/assets/cynefin-OW5HDTMX-PWlPYnpn.js +178 -0
  23. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-CYE5H1wR.js +62 -0
  24. package/dist/client/assets/cytoscape.esm-C5JX3QLV.js +331 -0
  25. package/dist/client/assets/dagre-GXQ25YYZ-DaknBOKq.js +4 -0
  26. package/dist/client/assets/diagram-S7CK7UJ4-Dz7rZHxF.js +30 -0
  27. package/dist/client/assets/diagram-UQ7AKVKN-DzCi6tiS.js +41 -0
  28. package/dist/client/assets/{diagram-KO2AKTUF-81f42eeb.js → diagram-VSXAHHWV-TlUzhXgv.js} +3 -3
  29. package/dist/client/assets/diagram-VX7I27RA-Ds7jdzK7.js +24 -0
  30. package/dist/client/assets/diagram-Z3DM3KII-C--JD7cf.js +24 -0
  31. package/dist/client/assets/ebnfDiagram-PWID7BFC-Dw5OM-dL.js +1 -0
  32. package/dist/client/assets/embed-DcNeILcO.js +211 -0
  33. package/dist/client/assets/erDiagram-RLTQ6QDP-DXalBHjA.js +99 -0
  34. package/dist/client/assets/flowDiagram-HODETNUW-DcI3UqyE.js +168 -0
  35. package/dist/client/assets/ganttDiagram-EL5Y4UJY-DyrkIo6c.js +292 -0
  36. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-fJKfGRcg.js +106 -0
  37. package/dist/client/assets/index-CIhkXT_z.js +19 -0
  38. package/dist/client/assets/index-DEiH2AE7.css +1 -0
  39. package/dist/client/assets/infoDiagram-27XIBGKW-Cijiqswb.js +2 -0
  40. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-50b43d03.js → ishikawaDiagram-5VMMS53U-C1WqWU2l.js} +2 -2
  41. package/dist/client/assets/{journeyDiagram-JHISSGLW-dce41bdf.js → journeyDiagram-3NMN7TZE-7j05mbLR.js} +4 -4
  42. package/dist/client/assets/{kanban-definition-UN3LZRKU-92401a86.js → kanban-definition-UXKFOSKX-D5mGDfs_.js} +1 -1
  43. package/dist/client/assets/{katex-4c9ea27f.js → katex-BTI-AXqd.js} +3 -3
  44. package/dist/client/assets/{katex-0cba7652.js → katex-C5jXJg4s.js} +3 -3
  45. package/dist/client/assets/layout-KEin06-H.js +1 -0
  46. package/dist/client/assets/linear-D1EL1Azg.js +1 -0
  47. package/dist/client/assets/mermaid.core-CLvSDmrA.js +310 -0
  48. package/dist/client/assets/{mindmap-definition-RKZ34NQL-66fe4544.js → mindmap-definition-YA3MSWOX-BsCqKd_d.js} +12 -12
  49. package/dist/client/assets/{ordinal-db88ae6f.js → ordinal-BeghXfj9.js} +1 -1
  50. package/dist/client/assets/pegDiagram-XKGWAZYB-Du5lDU3W.js +1 -0
  51. package/dist/client/assets/pieDiagram-E7YTZNPT-hjv5Ao6B.js +39 -0
  52. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-f64a7ed7.js → quadrantDiagram-AXDQQJYC-DNon8LWK.js} +4 -4
  53. package/dist/client/assets/railroadDiagram-O6MQD6OU-yNZz2zxo.js +1 -0
  54. package/dist/client/assets/requirementDiagram-BXWQKSXE-CZiiEUHW.js +84 -0
  55. package/dist/client/assets/sankeyDiagram-P5KCCOFB-D-u8ZQUV.js +40 -0
  56. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-BxjTf3q9.js +162 -0
  57. package/dist/client/assets/sizeCapture-INFHLROL-Dt4Wg8C5.js +1 -0
  58. package/dist/client/assets/stateDiagram-D77RDMKH-B8BM6dln.js +1 -0
  59. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-MJauX84T.js +1 -0
  60. package/dist/client/assets/step-BEQzeS8V.js +1 -0
  61. package/dist/client/assets/swimlanes-42K2YHIH-eGWrsWAA.js +1 -0
  62. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BYFu8tyL.js +8 -0
  63. package/dist/client/assets/{time-043b3464.js → time-BaoZouO5.js} +1 -1
  64. package/dist/client/assets/{timeline-definition-PNZ67QCA-b0c81243.js → timeline-definition-24CTP7MA-CAM-3Qj9.js} +10 -10
  65. package/dist/client/assets/vennDiagram-4TSXK5OY-CuFEwwD0.js +34 -0
  66. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-8d4d7626.js → wardleyDiagram-VM6X3IG4-DI5yCVh0.js} +3 -3
  67. package/dist/client/assets/xychartDiagram-S5SC5T6Z-BI0Bn-OQ.js +7 -0
  68. package/dist/client/index.html +2 -3
  69. package/dist/server/app.js +28 -396
  70. package/dist/server/channel.js +5 -3
  71. package/dist/server/export-html.js +30 -60
  72. package/dist/server/export-zip.js +83 -0
  73. package/dist/server/import-zip.js +196 -0
  74. package/dist/server/index.js +2 -1
  75. package/dist/server/mcp.js +28 -13
  76. package/dist/server/port.js +18 -0
  77. package/dist/server/quiz-submission.js +116 -0
  78. package/dist/server/quiz.js +110 -0
  79. package/dist/server/render-core.js +8 -7
  80. package/dist/server/routes/export.js +95 -0
  81. package/dist/server/routes/import.js +24 -0
  82. package/dist/server/routes/quiz.js +12 -0
  83. package/dist/server/routes/render.js +184 -0
  84. package/dist/server/routes/slideshow.js +52 -0
  85. package/dist/server/routes/snapshots.js +119 -0
  86. package/dist/server/snapshot-reader.js +58 -20
  87. package/dist/server/snapshot-writer.js +18 -16
  88. package/dist/server/validate.js +14 -0
  89. package/dist/server/viewport-cache.js +97 -25
  90. package/package.json +13 -7
  91. package/dist/client/assets/architecture-7EHR7CIX-1221aa61.js +0 -1
  92. package/dist/client/assets/architectureDiagram-3BPJPVTR-1eef4d3c.js +0 -36
  93. package/dist/client/assets/blockDiagram-GPEHLZMM-313fb06c.js +0 -132
  94. package/dist/client/assets/c4Diagram-AAUBKEIU-92b023ad.js +0 -10
  95. package/dist/client/assets/channel-5ee4a8a7.js +0 -1
  96. package/dist/client/assets/chunk-2J33WTMH-fb021fdc.js +0 -1
  97. package/dist/client/assets/chunk-727SXJPM-8e0e0228.js +0 -206
  98. package/dist/client/assets/chunk-AQP2D5EJ-2ccc13c2.js +0 -231
  99. package/dist/client/assets/classDiagram-4FO5ZUOK-42ffecb6.js +0 -1
  100. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-42ffecb6.js +0 -1
  101. package/dist/client/assets/cose-bilkent-S5V4N54A-45ec2e52.js +0 -1
  102. package/dist/client/assets/cytoscape.esm-1491e259.js +0 -331
  103. package/dist/client/assets/dagre-BM42HDAG-ed748885.js +0 -4
  104. package/dist/client/assets/diagram-2AECGRRQ-ccc0ddec.js +0 -43
  105. package/dist/client/assets/diagram-5GNKFQAL-342efdea.js +0 -10
  106. package/dist/client/assets/diagram-LMA3HP47-39e66739.js +0 -24
  107. package/dist/client/assets/diagram-OG6HWLK6-b3e61903.js +0 -24
  108. package/dist/client/assets/embed-2b4adf34.js +0 -201
  109. package/dist/client/assets/erDiagram-TEJ5UH35-281f5cc7.js +0 -85
  110. package/dist/client/assets/eventmodeling-FCH6USID-6508120e.js +0 -1
  111. package/dist/client/assets/flowDiagram-I6XJVG4X-c3a4269e.js +0 -162
  112. package/dist/client/assets/ganttDiagram-6RSMTGT7-013b07ec.js +0 -292
  113. package/dist/client/assets/gitGraph-WXDBUCRP-02827359.js +0 -1
  114. package/dist/client/assets/gitGraphDiagram-PVQCEYII-de184acb.js +0 -106
  115. package/dist/client/assets/graph-f3dfaf53.js +0 -1
  116. package/dist/client/assets/index-d674a6a4.css +0 -1
  117. package/dist/client/assets/index-ffc5af4b.js +0 -5
  118. package/dist/client/assets/info-J43DQDTF-81e32294.js +0 -1
  119. package/dist/client/assets/infoDiagram-5YYISTIA-196101ee.js +0 -2
  120. package/dist/client/assets/layout-3a4eff80.js +0 -1
  121. package/dist/client/assets/linear-fed00341.js +0 -1
  122. package/dist/client/assets/mermaid-parser.core-52f9cd92.js +0 -173
  123. package/dist/client/assets/mermaid.core-7dfc221a.js +0 -306
  124. package/dist/client/assets/packet-YPE3B663-278a272a.js +0 -1
  125. package/dist/client/assets/pie-LRSECV5Y-2e55d9ae.js +0 -1
  126. package/dist/client/assets/pieDiagram-4H26LBE5-65b1bcbd.js +0 -30
  127. package/dist/client/assets/radar-GUYGQ44K-608e459f.js +0 -1
  128. package/dist/client/assets/requirementDiagram-4Y6WPE33-90ebf889.js +0 -84
  129. package/dist/client/assets/sankeyDiagram-5OEKKPKP-2d1a83b3.js +0 -40
  130. package/dist/client/assets/sequenceDiagram-3UESZ5HK-aece3633.js +0 -162
  131. package/dist/client/assets/stateDiagram-AJRCARHV-9bd5b5f4.js +0 -1
  132. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-7c16c251.js +0 -1
  133. package/dist/client/assets/step-171ad54a.js +0 -1
  134. package/dist/client/assets/treeView-BLDUP644-e54b9ddb.js +0 -1
  135. package/dist/client/assets/treemap-LRROVOQU-6a81775b.js +0 -1
  136. package/dist/client/assets/vennDiagram-CIIHVFJN-8eaf0464.js +0 -34
  137. package/dist/client/assets/wardley-L42UT6IY-7abd921f.js +0 -1
  138. package/dist/client/assets/xychartDiagram-2RQKCTM6-450f333c.js +0 -7
  139. /package/dist/client/assets/{KaTeX_AMS-Regular-0cdd387c.woff2 → KaTeX_AMS-Regular-BQhdFMY1.woff2} +0 -0
  140. /package/dist/client/assets/{KaTeX_AMS-Regular-30da91e8.woff → KaTeX_AMS-Regular-DMm9YOAa.woff} +0 -0
  141. /package/dist/client/assets/{KaTeX_AMS-Regular-68534840.ttf → KaTeX_AMS-Regular-DRggAlZN.ttf} +0 -0
  142. /package/dist/client/assets/{KaTeX_Caligraphic-Bold-07d8e303.ttf → KaTeX_Caligraphic-Bold-ATXxdsX0.ttf} +0 -0
  143. /package/dist/client/assets/{KaTeX_Caligraphic-Bold-1ae6bd74.woff → KaTeX_Caligraphic-Bold-BEiXGLvX.woff} +0 -0
  144. /package/dist/client/assets/{KaTeX_Caligraphic-Bold-de7701e4.woff2 → KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2} +0 -0
  145. /package/dist/client/assets/{KaTeX_Caligraphic-Regular-3398dd02.woff → KaTeX_Caligraphic-Regular-CTRA-rTL.woff} +0 -0
  146. /package/dist/client/assets/{KaTeX_Caligraphic-Regular-5d53e70a.woff2 → KaTeX_Caligraphic-Regular-Di6jR-x-.woff2} +0 -0
  147. /package/dist/client/assets/{KaTeX_Caligraphic-Regular-ed0b7437.ttf → KaTeX_Caligraphic-Regular-wX97UBjC.ttf} +0 -0
  148. /package/dist/client/assets/{KaTeX_Fraktur-Bold-9163df9c.ttf → KaTeX_Fraktur-Bold-BdnERNNW.ttf} +0 -0
  149. /package/dist/client/assets/{KaTeX_Fraktur-Bold-9be7ceb8.woff → KaTeX_Fraktur-Bold-BsDP51OF.woff} +0 -0
  150. /package/dist/client/assets/{KaTeX_Fraktur-Bold-74444efd.woff2 → KaTeX_Fraktur-Bold-CL6g_b3V.woff2} +0 -0
  151. /package/dist/client/assets/{KaTeX_Fraktur-Regular-1e6f9579.ttf → KaTeX_Fraktur-Regular-CB_wures.ttf} +0 -0
  152. /package/dist/client/assets/{KaTeX_Fraktur-Regular-51814d27.woff2 → KaTeX_Fraktur-Regular-CTYiF6lA.woff2} +0 -0
  153. /package/dist/client/assets/{KaTeX_Fraktur-Regular-5e28753b.woff → KaTeX_Fraktur-Regular-Dxdc4cR9.woff} +0 -0
  154. /package/dist/client/assets/{KaTeX_Main-Bold-0f60d1b8.woff2 → KaTeX_Main-Bold-Cx986IdX.woff2} +0 -0
  155. /package/dist/client/assets/{KaTeX_Main-Bold-c76c5d69.woff → KaTeX_Main-Bold-Jm3AIy58.woff} +0 -0
  156. /package/dist/client/assets/{KaTeX_Main-Bold-138ac28d.ttf → KaTeX_Main-Bold-waoOVXN0.ttf} +0 -0
  157. /package/dist/client/assets/{KaTeX_Main-BoldItalic-99cd42a3.woff2 → KaTeX_Main-BoldItalic-DxDJ3AOS.woff2} +0 -0
  158. /package/dist/client/assets/{KaTeX_Main-BoldItalic-70ee1f64.ttf → KaTeX_Main-BoldItalic-DzxPMmG6.ttf} +0 -0
  159. /package/dist/client/assets/{KaTeX_Main-BoldItalic-a6f7ec0d.woff → KaTeX_Main-BoldItalic-SpSLRI95.woff} +0 -0
  160. /package/dist/client/assets/{KaTeX_Main-Italic-0d85ae7c.ttf → KaTeX_Main-Italic-3WenGoN9.ttf} +0 -0
  161. /package/dist/client/assets/{KaTeX_Main-Italic-f1d6ef86.woff → KaTeX_Main-Italic-BMLOBm91.woff} +0 -0
  162. /package/dist/client/assets/{KaTeX_Main-Italic-97479ca6.woff2 → KaTeX_Main-Italic-NWA7e6Wa.woff2} +0 -0
  163. /package/dist/client/assets/{KaTeX_Main-Regular-c2342cd8.woff2 → KaTeX_Main-Regular-B22Nviop.woff2} +0 -0
  164. /package/dist/client/assets/{KaTeX_Main-Regular-c6368d87.woff → KaTeX_Main-Regular-Dr94JaBh.woff} +0 -0
  165. /package/dist/client/assets/{KaTeX_Main-Regular-d0332f52.ttf → KaTeX_Main-Regular-ypZvNtVU.ttf} +0 -0
  166. /package/dist/client/assets/{KaTeX_Math-BoldItalic-f9377ab0.ttf → KaTeX_Math-BoldItalic-B3XSjfu4.ttf} +0 -0
  167. /package/dist/client/assets/{KaTeX_Math-BoldItalic-dc47344d.woff2 → KaTeX_Math-BoldItalic-CZnvNsCZ.woff2} +0 -0
  168. /package/dist/client/assets/{KaTeX_Math-BoldItalic-850c0af5.woff → KaTeX_Math-BoldItalic-iY-2wyZ7.woff} +0 -0
  169. /package/dist/client/assets/{KaTeX_Math-Italic-8a8d2445.woff → KaTeX_Math-Italic-DA0__PXp.woff} +0 -0
  170. /package/dist/client/assets/{KaTeX_Math-Italic-08ce98e5.ttf → KaTeX_Math-Italic-flOr_0UB.ttf} +0 -0
  171. /package/dist/client/assets/{KaTeX_Math-Italic-7af58c5e.woff2 → KaTeX_Math-Italic-t53AETM-.woff2} +0 -0
  172. /package/dist/client/assets/{KaTeX_SansSerif-Bold-1ece03f7.ttf → KaTeX_SansSerif-Bold-CFMepnvq.ttf} +0 -0
  173. /package/dist/client/assets/{KaTeX_SansSerif-Bold-e99ae511.woff2 → KaTeX_SansSerif-Bold-D1sUS0GD.woff2} +0 -0
  174. /package/dist/client/assets/{KaTeX_SansSerif-Bold-ece03cfd.woff → KaTeX_SansSerif-Bold-DbIhKOiC.woff} +0 -0
  175. /package/dist/client/assets/{KaTeX_SansSerif-Italic-00b26ac8.woff2 → KaTeX_SansSerif-Italic-C3H0VqGB.woff2} +0 -0
  176. /package/dist/client/assets/{KaTeX_SansSerif-Italic-91ee6750.woff → KaTeX_SansSerif-Italic-DN2j7dab.woff} +0 -0
  177. /package/dist/client/assets/{KaTeX_SansSerif-Italic-3931dd81.ttf → KaTeX_SansSerif-Italic-YYjJ1zSn.ttf} +0 -0
  178. /package/dist/client/assets/{KaTeX_SansSerif-Regular-f36ea897.ttf → KaTeX_SansSerif-Regular-BNo7hRIc.ttf} +0 -0
  179. /package/dist/client/assets/{KaTeX_SansSerif-Regular-11e4dc8a.woff → KaTeX_SansSerif-Regular-CS6fqUqJ.woff} +0 -0
  180. /package/dist/client/assets/{KaTeX_SansSerif-Regular-68e8c73e.woff2 → KaTeX_SansSerif-Regular-DDBCnlJ7.woff2} +0 -0
  181. /package/dist/client/assets/{KaTeX_Script-Regular-1c67f068.ttf → KaTeX_Script-Regular-C5JkGWo-.ttf} +0 -0
  182. /package/dist/client/assets/{KaTeX_Script-Regular-036d4e95.woff2 → KaTeX_Script-Regular-D3wIWfF6.woff2} +0 -0
  183. /package/dist/client/assets/{KaTeX_Script-Regular-d96cdf2b.woff → KaTeX_Script-Regular-D5yQViql.woff} +0 -0
  184. /package/dist/client/assets/{KaTeX_Size1-Regular-c943cc98.woff → KaTeX_Size1-Regular-C195tn64.woff} +0 -0
  185. /package/dist/client/assets/{KaTeX_Size1-Regular-95b6d2f1.ttf → KaTeX_Size1-Regular-Dbsnue_I.ttf} +0 -0
  186. /package/dist/client/assets/{KaTeX_Size1-Regular-6b47c401.woff2 → KaTeX_Size1-Regular-mCD8mA8B.woff2} +0 -0
  187. /package/dist/client/assets/{KaTeX_Size2-Regular-a6b2099f.ttf → KaTeX_Size2-Regular-B7gKUWhC.ttf} +0 -0
  188. /package/dist/client/assets/{KaTeX_Size2-Regular-d04c5421.woff2 → KaTeX_Size2-Regular-Dy4dx90m.woff2} +0 -0
  189. /package/dist/client/assets/{KaTeX_Size2-Regular-2014c523.woff → KaTeX_Size2-Regular-oD1tc_U0.woff} +0 -0
  190. /package/dist/client/assets/{KaTeX_Size3-Regular-6ab6b62e.woff → KaTeX_Size3-Regular-CTq5MqoE.woff} +0 -0
  191. /package/dist/client/assets/{KaTeX_Size3-Regular-500e04d5.ttf → KaTeX_Size3-Regular-DgpXs0kz.ttf} +0 -0
  192. /package/dist/client/assets/{KaTeX_Size4-Regular-99f9c675.woff → KaTeX_Size4-Regular-BF-4gkZK.woff} +0 -0
  193. /package/dist/client/assets/{KaTeX_Size4-Regular-c647367d.ttf → KaTeX_Size4-Regular-DWFBv043.ttf} +0 -0
  194. /package/dist/client/assets/{KaTeX_Size4-Regular-a4af7d41.woff2 → KaTeX_Size4-Regular-Dl5lxZxV.woff2} +0 -0
  195. /package/dist/client/assets/{KaTeX_Typewriter-Regular-e14fed02.woff → KaTeX_Typewriter-Regular-C0xS9mPB.woff} +0 -0
  196. /package/dist/client/assets/{KaTeX_Typewriter-Regular-71d517d6.woff2 → KaTeX_Typewriter-Regular-CO6r4hn1.woff2} +0 -0
  197. /package/dist/client/assets/{KaTeX_Typewriter-Regular-f01f3e87.ttf → KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf} +0 -0
  198. /package/dist/client/assets/{colors-98f238a0.js → colors-Cc3OSVma.js} +0 -0
  199. /package/dist/client/assets/{defaultLocale-a8476f12.js → defaultLocale-CzDG__Ur.js} +0 -0
  200. /package/dist/client/assets/{index-a1656aec.js → index-Bi7T_FA4.js} +0 -0
  201. /package/dist/client/assets/{init-a5b10ee5.js → init-Dmth1JHB.js} +0 -0
  202. /package/dist/client/assets/{range-6bc2a9a0.js → range-OtVwhkKS.js} +0 -0
@@ -0,0 +1,211 @@
1
+ var Z6=Object.defineProperty;var aA=e=>{throw TypeError(e)};var e8=(e,t,n)=>t in e?Z6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var L=(e,t,n)=>e8(e,typeof t!="symbol"?t+"":t,n),uA=(e,t,n)=>t.has(e)||aA("Cannot "+n);var lA=(e,t,n)=>(uA(e,t,"read from private field"),n?n.call(e):t.get(e)),cA=(e,t,n)=>t.has(e)?aA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Bg=(e,t,n,i)=>(uA(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);import{d as Ul,n as t8,e as n8,i as mc,f as i8,g as r8,h as s8,o as o8,j as Ph,k as fA,m as du,p as Ty,a as Ny,q as dA,r as ss,s as Ta,b as Iy,t as Na,u as a8,v as u8,w as l8,l as c8,x as f8,y as hA}from"./linear-D1EL1Azg.js";import{m as Em,a as ao,q as d8,r as h8,u as Am,i as p8,v as g8,w as m8,x as y8,y as PF,s as Ly,z as BF,A as zF,B as uo,C as Py,D as wm,E as UF,F as b8,G as v8,p as jF,o as x8,n as E8,l as Sa,k as Bh,d as qF,c as pA,H as A8,I as zh,J as w8,b as S8,K as C8,L as $8,t as F8,M as k8}from"./time-BaoZouO5.js";import{a as Sm,f as WF,c as D8,b as _8}from"./defaultLocale-CzDG__Ur.js";import{r as On}from"./range-OtVwhkKS.js";import{R as GF,r as O8,o as R8,q as M8,D as gA,E as mA,C as T8,v as By,F as Cm,u as Gn,G as N8,H as I8,y as L8,A as P8,I as B8,J as z8,B as U8,K as j8,L as q8,T as W8,M as G8,N as H8,O as V8,w as HF,n as X8,g as Lt,P as VF,Q as Y8,S as K8,l as XF,t as J8,d as Q8,p as Z8,U as e9,V as t9,W as n9,X as i9,Y as r9,Z as s9,_ as o9,$ as a9,a0 as u9,a1 as l9,a2 as c9,a3 as f9,a4 as d9,a5 as h9,a6 as p9,a7 as g9,c as m9,a8 as zy,a9 as bd,aa as yA,ab as y9,ac as b9}from"./step-BEQzeS8V.js";import{i as zo,a as Os}from"./init-Dmth1JHB.js";import{I as vd,o as YF,i as v9}from"./ordinal-BeghXfj9.js";import{c as ir}from"./colors-Cc3OSVma.js";import{d as x9}from"./arc-Aq92EeUK.js";import{o as Hf,c as bA,a as E9,r as A9,b as Uh,N as KF,d as w9,e as Uy,s as S9,p as C9,h as $9,t as F9,f as k9}from"./index-Bi7T_FA4.js";function D9(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function _9(e,t){const n=D9(e,t);return n&&Math.sqrt(n)}class sn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const s=n[r],o=t+s,a=Math.abs(t)<Math.abs(s)?t-(o-s):s-(o-t);a&&(n[i++]=a),t=o}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,s,o=0;if(n>0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}function O9(e,t){return Array.from(t,n=>e[n])}function R9(e=Ul){if(e===Ul)return JF;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function JF(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function QF(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?JF:R9(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(i,Math.floor(t+(u-l)*f/u+d));QF(e,t,h,p,r)}const s=e[t];let o=n,a=i;for(Iu(e,n,t),r(e[i],s)>0&&Iu(e,n,i);o<a;){for(Iu(e,o,a),++o,--a;r(e[o],s)<0;)++o;for(;r(e[a],s)>0;)--a}r(e[n],s)===0?Iu(e,n,a):(++a,Iu(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Iu(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function $m(e,t,n){if(e=Float64Array.from(t8(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return Em(e);if(t>=1)return ao(e);var i,r=(i-1)*t,s=Math.floor(r),o=ao(QF(e,s).subarray(0,s+1)),a=Em(e.subarray(s+1));return o+(a-o)*(r-s)}}function ZF(e,t,n=n8){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function M9(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function ek(e,t){return $m(e,.5,t)}function*T9(e){for(const t of e)yield*t}function tk(e){return Array.from(T9(e))}function nk(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function N9(e,...t){e=new vd(e),t=t.map(I9);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function I9(e){return e instanceof vd?e:new vd(e)}function L9(...e){const t=new vd;for(const n of e)for(const i of n)t.add(i);return t}var ik=-.14861,jy=1.78277,qy=-.29227,jh=-.90649,jl=1.97294,vA=jl*jh,xA=jl*jy,EA=jy*qy-jh*ik;function P9(e){if(e instanceof lo)return new lo(e.h,e.s,e.l,e.opacity);e instanceof GF||(e=O8(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(EA*i+vA*t-xA*n)/(EA+vA-xA),s=i-r,o=(jl*(n-r)-qy*s)/jh,a=Math.sqrt(o*o+s*s)/(jl*r*(1-r)),u=a?Math.atan2(o,s)*d8-120:NaN;return new lo(u<0?u+360:u,a,r,e.opacity)}function Fm(e,t,n,i){return arguments.length===1?P9(e):new lo(e,t,n,i??1)}function lo(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}R8(lo,Fm,M8(T8,{brighter(e){return e=e==null?mA:Math.pow(mA,e),new lo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gA:Math.pow(gA,e),new lo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*h8,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new GF(255*(t+n*(ik*i+jy*r)),255*(t+n*(qy*i+jh*r)),255*(t+n*(jl*i)),this.opacity)}}));function B9(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function z9(e,t){var n=By(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}var U9=1e-12;function AA(e){return((e=Math.exp(e))+1/e)/2}function j9(e){return((e=Math.exp(e))-1/e)/2}function q9(e){return((e=Math.exp(2*e))-1)/(e+1)}const W9=function e(t,n,i){function r(s,o){var a=s[0],u=s[1],l=s[2],c=o[0],f=o[1],d=o[2],h=c-a,p=f-u,g=h*h+p*p,m,y;if(g<U9)y=Math.log(d/l)/t,m=function(A){return[a+A*h,u+A*p,l*Math.exp(t*A*y)]};else{var b=Math.sqrt(g),v=(d*d-l*l+i*g)/(2*l*n*b),x=(d*d-l*l-i*g)/(2*d*n*b),E=Math.log(Math.sqrt(v*v+1)-v),w=Math.log(Math.sqrt(x*x+1)-x);y=(w-E)/t,m=function(A){var C=A*y,S=AA(E),F=l/(n*b)*(S*q9(t*C+E)-j9(E));return[a+F*h,u+F*p,l*S/AA(t*C+E)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return r.rho=function(s){var o=Math.max(.001,+s),a=o*o,u=a*a;return e(o,a,u)},r}(Math.SQRT2,2,4);function rk(e){return function(t,n){var i=e((t=Cm(t)).h,(n=Cm(n)).h),r=Gn(t.s,n.s),s=Gn(t.l,n.l),o=Gn(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=s(a),t.opacity=o(a),t+""}}}const G9=rk(By);var H9=rk(Gn);function V9(e,t){var n=Gn((e=Am(e)).l,(t=Am(t)).l),i=Gn(e.a,t.a),r=Gn(e.b,t.b),s=Gn(e.opacity,t.opacity);return function(o){return e.l=n(o),e.a=i(o),e.b=r(o),e.opacity=s(o),e+""}}function sk(e){return function t(n){n=+n;function i(r,s){var o=e((r=Fm(r)).h,(s=Fm(s)).h),a=Gn(r.s,s.s),u=Gn(r.l,s.l),l=Gn(r.opacity,s.opacity);return function(c){return r.h=o(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i}(1)}const X9=sk(By);var Y9=sk(Gn);function Wy(e,t){t===void 0&&(t=e,e=mc);for(var n=0,i=t.length-1,r=t[0],s=new Array(i<0?0:i);n<i;)s[n]=e(r,r=t[++n]);return function(o){var a=Math.max(0,Math.min(i-1,Math.floor(o*=i)));return s[a](o-a)}}function K9(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const J9=Object.freeze(Object.defineProperty({__proto__:null,interpolate:mc,interpolateArray:i8,interpolateBasis:N8,interpolateBasisClosed:I8,interpolateCubehelix:X9,interpolateCubehelixLong:Y9,interpolateDate:r8,interpolateDiscrete:B9,interpolateHcl:p8,interpolateHclLong:g8,interpolateHsl:G9,interpolateHslLong:H9,interpolateHue:z9,interpolateLab:V9,interpolateNumber:L8,interpolateNumberArray:s8,interpolateObject:o8,interpolateRgb:P8,interpolateRgbBasis:B8,interpolateRgbBasisClosed:z8,interpolateRound:Ph,interpolateString:U8,interpolateTransformCss:j8,interpolateTransformSvg:q8,interpolateZoom:W9,piecewise:Wy,quantize:K9},Symbol.toStringTag,{value:"Module"}));function Q9(e,t,n){var i=new W8,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?G8():+a,i._restart(function u(l){l+=r,i._restart(u,r+=o,a),s(l)},o,a)},i.restart(e,t,n),i)}const Z9=e=>+e;function eI(e){return e*e}function tI(e){return e*(2-e)}function wA(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}var Gy=3,nI=function e(t){t=+t;function n(i){return Math.pow(i,t)}return n.exponent=e,n}(Gy),iI=function e(t){t=+t;function n(i){return 1-Math.pow(1-i,t)}return n.exponent=e,n}(Gy),SA=function e(t){t=+t;function n(i){return((i*=2)<=1?Math.pow(i,t):2-Math.pow(2-i,t))/2}return n.exponent=e,n}(Gy),ok=Math.PI,ak=ok/2;function rI(e){return+e==1?1:1-Math.cos(e*ak)}function sI(e){return Math.sin(e*ak)}function CA(e){return(1-Math.cos(ok*e))/2}function xs(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}function oI(e){return xs(1-+e)}function aI(e){return 1-xs(e)}function $A(e){return((e*=2)<=1?xs(1-e):2-xs(e-1))/2}function uI(e){return 1-Math.sqrt(1-e*e)}function lI(e){return Math.sqrt(1- --e*e)}function FA(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var km=4/11,cI=6/11,fI=8/11,dI=3/4,hI=9/11,pI=10/11,gI=15/16,mI=21/22,yI=63/64,cf=1/km/km;function bI(e){return 1-ql(1-e)}function ql(e){return(e=+e)<km?cf*e*e:e<fI?cf*(e-=cI)*e+dI:e<pI?cf*(e-=hI)*e+gI:cf*(e-=mI)*e+yI}function vI(e){return((e*=2)<=1?1-ql(1-e):ql(e-1)+1)/2}var Hy=1.70158,xI=function e(t){t=+t;function n(i){return(i=+i)*i*(t*(i-1)+i)}return n.overshoot=e,n}(Hy),EI=function e(t){t=+t;function n(i){return--i*i*((i+1)*t+i)+1}return n.overshoot=e,n}(Hy),kA=function e(t){t=+t;function n(i){return((i*=2)<1?i*i*((t+1)*i-t):(i-=2)*i*((t+1)*i+t)+2)/2}return n.overshoot=e,n}(Hy),Ia=2*Math.PI,Vy=1,Xy=.3,AI=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=Ia);function r(s){return t*xs(- --s)*Math.sin((i-s)/n)}return r.amplitude=function(s){return e(s,n*Ia)},r.period=function(s){return e(t,s)},r}(Vy,Xy),DA=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=Ia);function r(s){return 1-t*xs(s=+s)*Math.sin((s+i)/n)}return r.amplitude=function(s){return e(s,n*Ia)},r.period=function(s){return e(t,s)},r}(Vy,Xy),wI=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=Ia);function r(s){return((s=s*2-1)<0?t*xs(-s)*Math.sin((i-s)/n):2-t*xs(s)*Math.sin((i+s)/n))/2}return r.amplitude=function(s){return e(s,n*Ia)},r.period=function(s){return e(t,s)},r}(Vy,Xy);const Fr=11102230246251565e-32,Nt=134217729,SI=(3+8*Fr)*Fr;function zg(e,t,n,i,r){let s,o,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(s=l,l=t[++f]):(s=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(o=l+s,a=s-(o-l),l=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f<e;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f],s=o,a!==0&&(r[h++]=a);for(;d<n;)o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d],s=o,a!==0&&(r[h++]=a);return(s!==0||h===0)&&(r[h++]=s),h}function CI(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function yc(e){return new Float64Array(e)}const $I=(3+16*Fr)*Fr,FI=(2+12*Fr)*Fr,kI=(9+64*Fr)*Fr*Fr,ra=yc(4),_A=yc(8),OA=yc(12),RA=yc(16),Vt=yc(4);function DI(e,t,n,i,r,s,o){let a,u,l,c,f,d,h,p,g,m,y,b,v,x,E,w,A,C;const S=e-r,F=n-r,k=t-s,P=i-s;x=S*P,d=Nt*S,h=d-(d-S),p=S-h,d=Nt*P,g=d-(d-P),m=P-g,E=p*m-(x-h*g-p*g-h*m),w=k*F,d=Nt*k,h=d-(d-k),p=k-h,d=Nt*F,g=d-(d-F),m=F-g,A=p*m-(w-h*g-p*g-h*m),y=E-A,f=E-y,ra[0]=E-(y+f)+(f-A),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-w,f=v-y,ra[1]=v-(y+f)+(f-w),C=b+y,f=C-b,ra[2]=b-(C-f)+(y-f),ra[3]=C;let U=CI(4,ra),_=FI*o;if(U>=_||-U>=_||(f=e-S,a=e-(S+f)+(f-r),f=n-F,l=n-(F+f)+(f-r),f=t-k,u=t-(k+f)+(f-s),f=i-P,c=i-(P+f)+(f-s),a===0&&u===0&&l===0&&c===0)||(_=kI*o+SI*Math.abs(U),U+=S*c+P*a-(k*l+F*u),U>=_||-U>=_))return U;x=a*P,d=Nt*a,h=d-(d-a),p=a-h,d=Nt*P,g=d-(d-P),m=P-g,E=p*m-(x-h*g-p*g-h*m),w=u*F,d=Nt*u,h=d-(d-u),p=u-h,d=Nt*F,g=d-(d-F),m=F-g,A=p*m-(w-h*g-p*g-h*m),y=E-A,f=E-y,Vt[0]=E-(y+f)+(f-A),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-w,f=v-y,Vt[1]=v-(y+f)+(f-w),C=b+y,f=C-b,Vt[2]=b-(C-f)+(y-f),Vt[3]=C;const $=zg(4,ra,4,Vt,_A);x=S*c,d=Nt*S,h=d-(d-S),p=S-h,d=Nt*c,g=d-(d-c),m=c-g,E=p*m-(x-h*g-p*g-h*m),w=k*l,d=Nt*k,h=d-(d-k),p=k-h,d=Nt*l,g=d-(d-l),m=l-g,A=p*m-(w-h*g-p*g-h*m),y=E-A,f=E-y,Vt[0]=E-(y+f)+(f-A),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-w,f=v-y,Vt[1]=v-(y+f)+(f-w),C=b+y,f=C-b,Vt[2]=b-(C-f)+(y-f),Vt[3]=C;const D=zg($,_A,4,Vt,OA);x=a*c,d=Nt*a,h=d-(d-a),p=a-h,d=Nt*c,g=d-(d-c),m=c-g,E=p*m-(x-h*g-p*g-h*m),w=u*l,d=Nt*u,h=d-(d-u),p=u-h,d=Nt*l,g=d-(d-l),m=l-g,A=p*m-(w-h*g-p*g-h*m),y=E-A,f=E-y,Vt[0]=E-(y+f)+(f-A),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-w,f=v-y,Vt[1]=v-(y+f)+(f-w),C=b+y,f=C-b,Vt[2]=b-(C-f)+(y-f),Vt[3]=C;const I=zg(D,OA,4,Vt,RA);return RA[I-1]}function ff(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=$I*l?u:-DI(e,t,n,i,r,s,l)}const MA=Math.pow(2,-52),df=new Uint32Array(512);class xd{static from(t,n=TI,i=NI){const r=t.length,s=new Float64Array(r*2);for(let o=0;o<r;o++){const a=t[o];s[2*o]=n(a),s[2*o+1]=i(a)}return new xd(s)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.trianglesLen=0,this._cx=0,this._cy=0,this._hullStart=0,this.hull=this._triangles,this.triangles=this._triangles,this.halfedges=this._halfedges,this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let S=0;S<o;S++){const F=t[2*S],k=t[2*S+1];F<a&&(a=F),k<u&&(u=k),F>l&&(l=F),k>c&&(c=k),this._ids[S]=S}const f=(a+l)/2,d=(u+c)/2;let h=0,p=0,g=0;for(let S=0,F=1/0;S<o;S++){const k=Ug(f,d,t[2*S],t[2*S+1]);k<F&&(h=S,F=k)}const m=t[2*h],y=t[2*h+1];for(let S=0,F=1/0;S<o;S++){if(S===h)continue;const k=Ug(m,y,t[2*S],t[2*S+1]);k<F&&k>0&&(p=S,F=k)}let b=t[2*p],v=t[2*p+1],x=1/0;for(let S=0;S<o;S++){if(S===h||S===p)continue;const F=RI(m,y,b,v,t[2*S],t[2*S+1]);F<x&&(g=S,x=F)}let E=t[2*g],w=t[2*g+1];if(x===1/0){for(let k=0;k<o;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];ya(this._ids,this._dists,0,o-1);const S=new Uint32Array(o);let F=0;for(let k=0,P=-1/0;k<o;k++){const U=this._ids[k],_=this._dists[U];_>P&&(S[F++]=U,P=_)}this.hull=S.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Int32Array(0);return}if(ff(m,y,b,v,E,w)<0){const S=p,F=b,k=v;p=g,b=E,v=w,g=S,E=F,w=k}const A=MI(m,y,b,v,E,w);this._cx=A.x,this._cy=A.y;for(let S=0;S<o;S++)this._dists[S]=Ug(t[2*S],t[2*S+1],A.x,A.y);ya(this._ids,this._dists,0,o-1),this._hullStart=h;let C=3;i[h]=n[g]=p,i[p]=n[h]=g,i[g]=n[p]=h,r[h]=0,r[p]=1,r[g]=2,s.fill(-1),s[this._hashKey(m,y)]=h,s[this._hashKey(b,v)]=p,s[this._hashKey(E,w)]=g,this.trianglesLen=0,this._addTriangle(h,p,g,-1,-1,-1);for(let S=0,F=0,k=0;S<this._ids.length;S++){const P=this._ids[S],U=t[2*P],_=t[2*P+1];if(S>0&&Math.abs(U-F)<=MA&&Math.abs(_-k)<=MA||(F=U,k=_,P===h||P===p||P===g))continue;let $=0;for(let Z=0,fe=this._hashKey(U,_);Z<this._hashSize&&($=s[(fe+Z)%this._hashSize],!($!==-1&&$!==i[$]));Z++);$=n[$];let D=$,I;for(;I=i[D],ff(U,_,t[2*D],t[2*D+1],t[2*I],t[2*I+1])>=0;)if(D=I,D===$){D=-1;break}if(D===-1)continue;let G=this._addTriangle(D,P,i[D],-1,-1,r[D]);r[P]=this._legalize(G+2),r[D]=G,C++;let B=i[D];for(;I=i[B],ff(U,_,t[2*B],t[2*B+1],t[2*I],t[2*I+1])<0;)G=this._addTriangle(B,P,I,r[P],-1,r[B]),r[P]=this._legalize(G+2),i[B]=B,C--,B=I;if(D===$)for(;I=n[D],ff(U,_,t[2*I],t[2*I+1],t[2*D],t[2*D+1])<0;)G=this._addTriangle(I,P,D,-1,r[D],r[I]),this._legalize(G+2),r[I]=G,i[D]=D,C--,D=I;this._hullStart=n[P]=D,i[D]=n[B]=P,i[P]=B,s[this._hashKey(U,_)]=P,s[this._hashKey(t[2*D],t[2*D+1])]=D}this.hull=new Uint32Array(C);for(let S=0,F=this._hullStart;S<C;S++)this.hull[S]=F,F=i[F];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(_I(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let s=0,o=0;for(;;){const a=i[t],u=t-t%3;if(o=u+(t+2)%3,a===-1){if(s===0)break;t=df[--s];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[o],h=n[t],p=n[c],g=n[f];if(OI(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*g],r[2*g+1])){n[t]=g,n[a]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(a,i[o]),this._link(o,f);const b=l+(a+1)%3;s<df.length&&(df[s++]=b)}else{if(s===0)break;t=df[--s]}}return o}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,s,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,s),this._link(a+2,o),this.trianglesLen+=3,a}}function _I(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Ug(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function OI(e,t,n,i,r,s,o,a){const u=e-o,l=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function RI(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=(l*c-a*f)*d,p=(o*f-u*c)*d;return h*h+p*p}function MI(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=e+(l*c-a*f)*d,p=t+(o*f-u*c)*d;return{x:h,y:p}}function ya(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;Lu(e,r,s),t[e[n]]>t[e[i]]&&Lu(e,n,i),t[e[s]]>t[e[i]]&&Lu(e,s,i),t[e[n]]>t[e[s]]&&Lu(e,n,s);const a=e[s],u=t[a];for(;;){do s++;while(t[e[s]]<u);do o--;while(t[e[o]]>u);if(o<s)break;Lu(e,s,o)}e[n+1]=e[o],e[o]=a,i-s+1>=o-n?(ya(e,t,s,i),ya(e,t,n,o-1)):(ya(e,t,n,o-1),ya(e,t,s,i))}}function Lu(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function TI(e){return e[0]}function NI(e){return e[1]}const TA=1e-6;class so{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>TA||Math.abs(this._y1-s)>TA)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class Dm{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let II=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g<y;g+=3,m+=2){const x=i[g]*2,E=i[g+1]*2,w=i[g+2]*2,A=t[x],C=t[x+1],S=t[E],F=t[E+1],k=t[w],P=t[w+1],U=S-A,_=F-C,$=k-A,D=P-C,I=(U*D-_*$)*2;if(Math.abs(I)<1e-9){if(s===void 0){s=o=0;for(const B of n)s+=t[B*2],o+=t[B*2+1];s/=n.length,o/=n.length}const G=1e9*Math.sign((s-A)*D-(o-C)*$);b=(A+k)/2-G*D,v=(C+P)/2+G*$}else{const G=1/I,B=U*U+_*_,Z=$*$+D*D;b=A+(D*B-_*Z)*G,v=C+(U*Z-$*B)*G}a[m]=b,a[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,p=t[2*u+1];r.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=d,h=p,c=u*4,d=t[2*u],p=t[2*u+1],r[l+2]=r[c]=h-p,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new so:void 0,{delaunay:{halfedges:i,inedges:r,hull:s},circumcenters:o,vectors:a}=this;if(s.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,p=Math.floor(d/3)*2,g=o[h],m=o[h+1],y=o[p],b=o[p+1];this._renderSegment(g,m,y,b,t)}let u,l=s[s.length-1];for(let c=0;c<s.length;++c){u=l,l=s[c];const f=Math.floor(r[l]/3)*2,d=o[f],h=o[f+1],p=u*4,g=this._project(d,h,a[p+2],a[p+3]);g&&this._renderSegment(d,h,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new so:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new so:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let s=r.length;for(;r[0]===r[s-2]&&r[1]===r[s-1]&&s>1;)s-=2;for(let o=2;o<s;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&n.lineTo(r[o],r[o+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new Dm;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,s){let o;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(s.moveTo(t,n),s.lineTo(i,r)):(o=this._clipSegment(t,n,i,r,a,u))&&(s.moveTo(o[0],o[1]),s.lineTo(o[2],o[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let s=0,o=n.length;s<o;s+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[s]===r[a]&&n[s+1]===r[a+1]&&n[(s+2)%o]===r[(a+u-2)%u]&&n[(s+3)%o]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:s}}=this,o=i[t];if(o===-1)return null;const a=[];let u=o;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,s[u]!==t)break;u=r[u]}while(u!==o&&u!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,s,o,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(s=a,o=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let p,g,m,y,b;if(l===0){if((p=this._clipSegment(s,o,a,u,l,c))===null)continue;[g,m,y,b]=p}else{if((p=this._clipSegment(a,u,s,o,c,l))===null)continue;[y,b,g,m]=p,f=d,d=this._edgecode(g,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(g,m):r=[g,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,s,o){const a=s<o;for(a&&([t,n,i,r,s,o]=[i,r,t,n,o,s]);;){if(s===0&&o===0)return a?[i,r,t,n]:[t,n,i,r];if(s&o)return null;let u,l,c=s||o;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),s?(t=u,n=l,s=this._regioncode(t,n)):(i=u,r=l,o=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,s,o){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],s,o))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,i,r,s){for(;n!==i;){let o,a;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,a=this.ymin;break}(r[s]!==o||r[s+1]!==a)&&this.contains(t,o,a)&&(r.splice(s,0,o,a),s+=2)}return s}_project(t,n,i,r){let s=1/0,o,a,u;if(r<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/r)<s&&(u=this.ymin,a=t+(s=o)*i)}else if(r>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)<s&&(u=this.ymax,a=t+(s=o)*i)}if(i>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)<s&&(a=this.xmax,u=n+(s=o)*r)}else if(i<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/i)<s&&(a=this.xmin,u=n+(s=o)*r)}return[a,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const LI=2*Math.PI,sa=Math.pow;function PI(e){return e[0]}function BI(e){return e[1]}function zI(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],s=2*t[i+1],o=2*t[i+2];if((n[o]-n[r])*(n[s+1]-n[r+1])-(n[s]-n[r])*(n[o+1]-n[r+1])>1e-10)return!1}return!0}function UI(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Yy{static from(t,n=PI,i=BI,r){return new Yy("length"in t?jI(t,n,i,r):Float64Array.from(qI(t,n,i,r)))}constructor(t){this._delaunator=new xd(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&zI(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const p=UI(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new xd(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,s=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=s[u%3===2?u-2:u+1];(i[u]===-1||o[c]===-1)&&(o[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new II(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=s[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let s;for(;(s=this._step(i,t,n))>=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=sa(n-l[t*2],2)+sa(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=sa(n-l[p*2],2)+sa(i-l[p*2+1],2);if(g<f&&(f=g,c=p),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=s[(o[t]+1)%s.length],h!==p&&sa(n-l[h*2],2)+sa(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new so:void 0,{points:i,halfedges:r,triangles:s}=this;for(let o=0,a=r.length;o<a;++o){const u=r[o];if(u<o)continue;const l=s[o]*2,c=s[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new so:void 0,{points:r}=this;for(let s=0,o=r.length;s<o;s+=2){const a=r[s],u=r[s+1];t.moveTo(a+n,u),t.arc(a,u,n,0,LI)}return i&&i.value()}renderHull(t){const n=t==null?t=new so:void 0,{hull:i,points:r}=this,s=i[0]*2,o=i.length;t.moveTo(r[s],r[s+1]);for(let a=1;a<o;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Dm;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new so:void 0,{points:r,triangles:s}=this,o=s[t*=3]*2,a=s[t+1]*2,u=s[t+2]*2;return n.moveTo(r[o],r[o+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Dm;return this.renderTriangle(t,n),n.value()}}function jI(e,t,n,i){const r=e.length,s=new Float64Array(r*2);for(let o=0;o<r;++o){const a=e[o];s[o*2]=t.call(i,a,o,e),s[o*2+1]=n.call(i,a,o,e)}return s}function*qI(e,t,n,i){let r=0;for(const s of e)yield t.call(i,s,r,e),yield n.call(i,s,r,e),++r}var NA={},jg={},qg=34,Pu=10,Wg=13;function uk(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function WI(e,t){var n=uk(e);return function(i,r){return t(n(i),r,e)}}function IA(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function dn(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function GI(e){return e<0?"-"+dn(-e,6):e>9999?"+"+dn(e,6):dn(e,4)}function HI(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":GI(e.getUTCFullYear())+"-"+dn(e.getUTCMonth()+1,2)+"-"+dn(e.getUTCDate(),2)+(r?"T"+dn(t,2)+":"+dn(n,2)+":"+dn(i,2)+"."+dn(r,3)+"Z":i?"T"+dn(t,2)+":"+dn(n,2)+":"+dn(i,2)+"Z":n||t?"T"+dn(t,2)+":"+dn(n,2)+"Z":"")}function VI(e){var t=new RegExp('["'+e+`
2
+ \r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?WI(m,d):uk(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Pu&&--p,f.charCodeAt(p-1)===Wg&&--p;function x(){if(b)return jg;if(v)return v=!1,NA;var w,A=g,C;if(f.charCodeAt(A)===qg){for(;g++<p&&f.charCodeAt(g)!==qg||f.charCodeAt(++g)===qg;);return(w=g)>=p?b=!0:(C=f.charCodeAt(g++))===Pu?v=!0:C===Wg&&(v=!0,f.charCodeAt(g)===Pu&&++g),f.slice(A+1,w-1).replace(/""/g,'"')}for(;g<p;){if((C=f.charCodeAt(w=g++))===Pu)v=!0;else if(C===Wg)v=!0,f.charCodeAt(g)===Pu&&++g;else if(C!==n)continue;return f.slice(A,w)}return b=!0,f.slice(A,p)}for(;(y=x())!==jg;){for(var E=[];y!==NA&&y!==jg;)E.push(y),y=x();d&&(E=d(E,m++))==null||h.push(E)}return h}function s(f,d){return f.map(function(h){return d.map(function(p){return c(h[p])}).join(e)})}function o(f,d){return d==null&&(d=IA(f)),[d.map(c).join(e)].concat(s(f,d)).join(`
3
+ `)}function a(f,d){return d==null&&(d=IA(f)),s(f,d).join(`
4
+ `)}function u(f){return f.map(l).join(`
5
+ `)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?HI(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:o,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function XI(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,u=0,l=0;for(s=0;s<o;++s)a=n[s],u+=a.x,l+=a.y;for(u=(u/o-e)*i,l=(l/o-t)*i,s=0;s<o;++s)a=n[s],a.x-=u,a.y-=l}return r.initialize=function(s){n=s},r.x=function(s){return arguments.length?(e=+s,r):e},r.y=function(s){return arguments.length?(t=+s,r):t},r.strength=function(s){return arguments.length?(i=+s,r):i},r}function YI(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return lk(this.cover(t,n),t,n,e)}function lk(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,s=e._root,o={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,p,g,m,y,b;if(!s)return e._root=o,e;for(;s.length;)if((g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function KI(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(s=+this._y.call(null,t))||(o[n]=r,a[n]=s,r<u&&(u=r),r>c&&(c=r),s<l&&(l=s),s>f&&(f=s));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)lk(this,o[n],a[n],e[n]);return this}function JI(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,s=(i=Math.floor(t))+1;else{for(var o=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=s;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,o*=2,l){case 0:r=n+o,s=i+o;break;case 1:n=r-o,s=i+o;break;case 2:r=n+o,i=s-o;break;case 3:n=r-o,i=s-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this}function QI(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function ZI(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function en(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function e4(e,t,n){var i,r=this._x0,s=this._y0,o,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,p,g;for(h&&d.push(new en(h,r,s,c,f)),n==null?n=1/0:(r=e-n,s=t-n,c=e+n,f=t+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(o=p.x0)>c||(a=p.y0)>f||(u=p.x1)<r||(l=p.y1)<s))if(h.length){var m=(o+u)/2,y=(a+l)/2;d.push(new en(h[3],m,y,u,l),new en(h[2],o,y,m,l),new en(h[1],m,a,u,y),new en(h[0],o,a,m,y)),(g=(t>=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var E=Math.sqrt(n=x);r=e-E,s=t-E,c=e+E,f=t+E,i=h.data}}return i}function t4(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,s,o=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,p,g,m,y;if(!n)return this;if(n.length)for(;;){if((p=c>=(d=(o+u)/2))?o=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function n4(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function i4(){return this._root}function r4(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function s4(e){var t=[],n,i=this._root,r,s,o,a,u;for(i&&t.push(new en(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,s=n.x0,o=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(s+a)/2,c=(o+u)/2;(r=i[3])&&t.push(new en(r,l,c,a,u)),(r=i[2])&&t.push(new en(r,s,c,l,u)),(r=i[1])&&t.push(new en(r,l,o,a,c)),(r=i[0])&&t.push(new en(r,s,o,l,c))}return this}function o4(e){var t=[],n=[],i;for(this._root&&t.push(new en(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var s,o=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(o+u)/2,f=(a+l)/2;(s=r[0])&&t.push(new en(s,o,a,c,f)),(s=r[1])&&t.push(new en(s,c,a,u,f)),(s=r[2])&&t.push(new en(s,o,f,c,l)),(s=r[3])&&t.push(new en(s,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function a4(e){return e[0]}function u4(e){return arguments.length?(this._x=e,this):this._x}function l4(e){return e[1]}function c4(e){return arguments.length?(this._y=e,this):this._y}function Ky(e,t,n){var i=new Jy(t??a4,n??l4,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Jy(e,t,n,i,r,s){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function LA(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var cn=Ky.prototype=Jy.prototype;cn.copy=function(){var e=new Jy(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=LA(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=LA(i));return e};cn.add=YI;cn.addAll=KI;cn.cover=JI;cn.data=QI;cn.extent=ZI;cn.find=e4;cn.remove=t4;cn.removeAll=n4;cn.root=i4;cn.size=r4;cn.visit=s4;cn.visitAfter=o4;cn.x=u4;cn.y=c4;function tn(e){return function(){return e}}function os(e){return(e()-.5)*1e-6}function f4(e){return e.x+e.vx}function d4(e){return e.y+e.vy}function h4(e){var t,n,i,r=1,s=1;typeof e!="function"&&(e=tn(e==null?1:+e));function o(){for(var l,c=t.length,f,d,h,p,g,m,y=0;y<s;++y)for(f=Ky(t,f4,d4).visitAfter(a),l=0;l<c;++l)d=t[l],g=n[d.index],m=g*g,h=d.x+d.vx,p=d.y+d.vy,f.visit(b);function b(v,x,E,w,A){var C=v.data,S=v.r,F=g+S;if(C){if(C.index>d.index){var k=h-C.x-C.vx,P=p-C.y-C.vy,U=k*k+P*P;U<F*F&&(k===0&&(k=os(i),U+=k*k),P===0&&(P=os(i),U+=P*P),U=(F-(U=Math.sqrt(U)))/U*r,d.vx+=(k*=U)*(F=(S*=S)/(m+S)),d.vy+=(P*=U)*F,C.vx-=k*(F=1-F),C.vy-=P*F)}return}return x>h+F||w<h-F||E>p+F||A<p-F}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return o.initialize=function(l,c){t=l,i=c,u()},o.iterations=function(l){return arguments.length?(s=+l,o):s},o.strength=function(l){return arguments.length?(r=+l,o):r},o.radius=function(l){return arguments.length?(e=typeof l=="function"?l:tn(+l),u(),o):e},o}function p4(e){return e.index}function PA(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function g4(e){var t=p4,n=f,i,r=tn(30),s,o,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,E,w,A,C,S,F;v<b;++v)x=e[v],E=x.source,w=x.target,A=w.x+w.vx-E.x-E.vx||os(l),C=w.y+w.vy-E.y-E.vy||os(l),S=Math.sqrt(A*A+C*C),S=(S-s[v])/S*m*i[v],A*=S,C*=S,w.vx-=A*(F=u[v]),w.vy-=C*F,E.vx+=A*(F=1-F),E.vy+=C*F}function h(){if(o){var m,y=o.length,b=e.length,v=new Map(o.map((E,w)=>[t(E,w,o),E])),x;for(m=0,a=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=PA(v,x.source)),typeof x.target!="object"&&(x.target=PA(v,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);i=new Array(b),p(),s=new Array(b),g()}}function p(){if(o)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function g(){if(o)for(var m=0,y=e.length;m<y;++m)s[m]=+r(e[m],m,e)}return d.initialize=function(m,y){o=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:tn(+m),p(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:tn(+m),g(),d):r},d}const m4=1664525,y4=1013904223,BA=4294967296;function b4(){let e=1;return()=>(e=(m4*e+y4)%BA)/BA}function v4(e){return e.x}function x4(e){return e.y}var E4=10,A4=Math.PI*(3-Math.sqrt(5));function w4(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,u=H8(f),l=V8("tick","end"),c=b4();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(g){var m,y=e.length,b;g===void 0&&(g=1);for(var v=0;v<g;++v)for(n+=(s-n)*r,a.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=o:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=o:(b.y=b.fy,b.vy=0);return t}function h(){for(var g=0,m=e.length,y;g<m;++g){if(y=e[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=E4*Math.sqrt(.5+g),v=g*A4;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function p(g){return g.initialize&&g.initialize(e,c),g}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(g){return arguments.length?(e=g,h(),a.forEach(p),t):e},alpha:function(g){return arguments.length?(n=+g,t):n},alphaMin:function(g){return arguments.length?(i=+g,t):i},alphaDecay:function(g){return arguments.length?(r=+g,t):+r},alphaTarget:function(g){return arguments.length?(s=+g,t):s},velocityDecay:function(g){return arguments.length?(o=1-g,t):1-o},randomSource:function(g){return arguments.length?(c=g,a.forEach(p),t):c},force:function(g,m){return arguments.length>1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,E,w,A,C;for(y==null?y=1/0:y*=y,b=0;b<v;++b)A=e[b],x=g-A.x,E=m-A.y,w=x*x+E*E,w<y&&(C=A,y=w);return C},on:function(g,m){return arguments.length>1?(l.on(g,m),t):l.on(g)}}}function S4(){var e,t,n,i,r=tn(-30),s,o=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=Ky(e,v4,x4).visitAfter(f);for(i=h,p=0;p<g;++p)t=e[p],m.visit(d)}function c(){if(e){var h,p=e.length,g;for(s=new Array(p),h=0;h<p;++h)g=e[h],s[g.index]=+r(g,h,e)}}function f(h){var p=0,g,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(g=h[x])&&(m=Math.abs(g.value))&&(p+=g.value,y+=m,b+=m*g.x,v+=m*g.y);h.x=b/y,h.y=v/y}else{g=h,g.x=g.data.x,g.y=g.data.y;do p+=s[g.data.index];while(g=g.next)}h.value=p}function d(h,p,g,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-p,x=y*y+b*b;if(v*v/u<x)return x<a&&(y===0&&(y=os(n),x+=y*y),b===0&&(b=os(n),x+=b*b),x<o&&(x=Math.sqrt(o*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=a)return;(h.data!==t||h.next)&&(y===0&&(y=os(n),x+=y*y),b===0&&(b=os(n),x+=b*b),x<o&&(x=Math.sqrt(o*x)));do h.data!==t&&(v=s[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,p){e=h,n=p,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:tn(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(o=h*h,l):Math.sqrt(o)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function C4(e){var t=tn(.1),n,i,r;typeof e!="function"&&(e=tn(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:tn(+a),o(),s):t},s.x=function(a){return arguments.length?(e=typeof a=="function"?a:tn(+a),o(),s):e},s}function $4(e){var t=tn(.1),n,i,r;typeof e!="function"&&(e=tn(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:tn(+a),o(),s):t},s.y=function(a){return arguments.length?(e=typeof a=="function"?a:tn(+a),o(),s):e},s}var oe=1e-6,Ed=1e-12,me=Math.PI,nt=me/2,Ad=me/4,on=me*2,at=180/me,ge=me/180,Ee=Math.abs,hu=Math.atan,Jn=Math.atan2,ae=Math.cos,hf=Math.ceil,ck=Math.exp,_m=Math.hypot,wd=Math.log,Gg=Math.pow,se=Math.sin,Hn=Math.sign||function(e){return e>0?1:e<0?-1:0},an=Math.sqrt,Qy=Math.tan;function fk(e){return e>1?0:e<-1?me:Math.acos(e)}function vn(e){return e>1?nt:e<-1?-nt:Math.asin(e)}function Dt(){}function Sd(e,t){e&&UA.hasOwnProperty(e.type)&&UA[e.type](e,t)}var zA={Feature:function(e,t){Sd(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)Sd(n[i].geometry,t)}},UA={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){Om(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Om(n[i],t,0)},Polygon:function(e,t){jA(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)jA(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)Sd(n[i],t)}};function Om(e,t,n){var i=-1,r=e.length-n,s;for(t.lineStart();++i<r;)s=e[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function jA(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)Om(e[n],t,1);t.polygonEnd()}function wr(e,t){e&&zA.hasOwnProperty(e.type)?zA[e.type](e,t):Sd(e,t)}var Cd=new sn,$d=new sn,dk,hk,Rm,Mm,Tm,Ki={point:Dt,lineStart:Dt,lineEnd:Dt,polygonStart:function(){Cd=new sn,Ki.lineStart=F4,Ki.lineEnd=k4},polygonEnd:function(){var e=+Cd;$d.add(e<0?on+e:e),this.lineStart=this.lineEnd=this.point=Dt},sphere:function(){$d.add(on)}};function F4(){Ki.point=D4}function k4(){pk(dk,hk)}function D4(e,t){Ki.point=pk,dk=e,hk=t,e*=ge,t*=ge,Rm=e,Mm=ae(t=t/2+Ad),Tm=se(t)}function pk(e,t){e*=ge,t*=ge,t=t/2+Ad;var n=e-Rm,i=n>=0?1:-1,r=i*n,s=ae(t),o=se(t),a=Tm*o,u=Mm*s+a*ae(r),l=a*i*se(r);Cd.add(Jn(l,u)),Rm=e,Mm=s,Tm=o}function _4(e){return $d=new sn,wr(e,Ki),$d*2}function Fd(e){return[Jn(e[1],e[0]),vn(e[2])]}function bo(e){var t=e[0],n=e[1],i=ae(n);return[i*ae(t),i*se(t),se(n)]}function pf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function La(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Hg(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function gf(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function kd(e){var t=an(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var Ye,gn,Ze,Dn,Zs,gk,mk,Ca,$l,Zr,Mr,xr={point:Nm,lineStart:qA,lineEnd:WA,polygonStart:function(){xr.point=bk,xr.lineStart=O4,xr.lineEnd=R4,$l=new sn,Ki.polygonStart()},polygonEnd:function(){Ki.polygonEnd(),xr.point=Nm,xr.lineStart=qA,xr.lineEnd=WA,Cd<0?(Ye=-(Ze=180),gn=-(Dn=90)):$l>oe?Dn=90:$l<-oe&&(gn=-90),Mr[0]=Ye,Mr[1]=Ze},sphere:function(){Ye=-(Ze=180),gn=-(Dn=90)}};function Nm(e,t){Zr.push(Mr=[Ye=e,Ze=e]),t<gn&&(gn=t),t>Dn&&(Dn=t)}function yk(e,t){var n=bo([e*ge,t*ge]);if(Ca){var i=La(Ca,n),r=[i[1],-i[0],0],s=La(r,i);kd(s),s=Fd(s);var o=e-Zs,a=o>0?1:-1,u=s[0]*at*a,l,c=Ee(o)>180;c^(a*Zs<u&&u<a*e)?(l=s[1]*at,l>Dn&&(Dn=l)):(u=(u+360)%360-180,c^(a*Zs<u&&u<a*e)?(l=-s[1]*at,l<gn&&(gn=l)):(t<gn&&(gn=t),t>Dn&&(Dn=t))),c?e<Zs?kn(Ye,e)>kn(Ye,Ze)&&(Ze=e):kn(e,Ze)>kn(Ye,Ze)&&(Ye=e):Ze>=Ye?(e<Ye&&(Ye=e),e>Ze&&(Ze=e)):e>Zs?kn(Ye,e)>kn(Ye,Ze)&&(Ze=e):kn(e,Ze)>kn(Ye,Ze)&&(Ye=e)}else Zr.push(Mr=[Ye=e,Ze=e]);t<gn&&(gn=t),t>Dn&&(Dn=t),Ca=n,Zs=e}function qA(){xr.point=yk}function WA(){Mr[0]=Ye,Mr[1]=Ze,xr.point=Nm,Ca=null}function bk(e,t){if(Ca){var n=e-Zs;$l.add(Ee(n)>180?n+(n>0?360:-360):n)}else gk=e,mk=t;Ki.point(e,t),yk(e,t)}function O4(){Ki.lineStart()}function R4(){bk(gk,mk),Ki.lineEnd(),Ee($l)>oe&&(Ye=-(Ze=180)),Mr[0]=Ye,Mr[1]=Ze,Ca=null}function kn(e,t){return(t-=e)<0?t+360:t}function M4(e,t){return e[0]-t[0]}function GA(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function T4(e){var t,n,i,r,s,o,a;if(Dn=Ze=-(Ye=gn=1/0),Zr=[],wr(e,xr),n=Zr.length){for(Zr.sort(M4),t=1,i=Zr[0],s=[i];t<n;++t)r=Zr[t],GA(i,r[0])||GA(i,r[1])?(kn(i[0],r[1])>kn(i[0],i[1])&&(i[1]=r[1]),kn(r[0],i[1])>kn(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=kn(i[1],r[0]))>o&&(o=a,Ye=r[0],Ze=i[1])}return Zr=Mr=null,Ye===1/0||gn===1/0?[[NaN,NaN],[NaN,NaN]]:[[Ye,gn],[Ze,Dn]]}var rl,Dd,_d,Od,Rd,Md,Td,Nd,Im,Lm,Pm,vk,xk,Jt,Qt,Zt,hi={sphere:Dt,point:Zy,lineStart:HA,lineEnd:VA,polygonStart:function(){hi.lineStart=L4,hi.lineEnd=P4},polygonEnd:function(){hi.lineStart=HA,hi.lineEnd=VA}};function Zy(e,t){e*=ge,t*=ge;var n=ae(t);bc(n*ae(e),n*se(e),se(t))}function bc(e,t,n){++rl,_d+=(e-_d)/rl,Od+=(t-Od)/rl,Rd+=(n-Rd)/rl}function HA(){hi.point=N4}function N4(e,t){e*=ge,t*=ge;var n=ae(t);Jt=n*ae(e),Qt=n*se(e),Zt=se(t),hi.point=I4,bc(Jt,Qt,Zt)}function I4(e,t){e*=ge,t*=ge;var n=ae(t),i=n*ae(e),r=n*se(e),s=se(t),o=Jn(an((o=Qt*s-Zt*r)*o+(o=Zt*i-Jt*s)*o+(o=Jt*r-Qt*i)*o),Jt*i+Qt*r+Zt*s);Dd+=o,Md+=o*(Jt+(Jt=i)),Td+=o*(Qt+(Qt=r)),Nd+=o*(Zt+(Zt=s)),bc(Jt,Qt,Zt)}function VA(){hi.point=Zy}function L4(){hi.point=B4}function P4(){Ek(vk,xk),hi.point=Zy}function B4(e,t){vk=e,xk=t,e*=ge,t*=ge,hi.point=Ek;var n=ae(t);Jt=n*ae(e),Qt=n*se(e),Zt=se(t),bc(Jt,Qt,Zt)}function Ek(e,t){e*=ge,t*=ge;var n=ae(t),i=n*ae(e),r=n*se(e),s=se(t),o=Qt*s-Zt*r,a=Zt*i-Jt*s,u=Jt*r-Qt*i,l=_m(o,a,u),c=vn(l),f=l&&-c/l;Im.add(f*o),Lm.add(f*a),Pm.add(f*u),Dd+=c,Md+=c*(Jt+(Jt=i)),Td+=c*(Qt+(Qt=r)),Nd+=c*(Zt+(Zt=s)),bc(Jt,Qt,Zt)}function z4(e){rl=Dd=_d=Od=Rd=Md=Td=Nd=0,Im=new sn,Lm=new sn,Pm=new sn,wr(e,hi);var t=+Im,n=+Lm,i=+Pm,r=_m(t,n,i);return r<Ed&&(t=Md,n=Td,i=Nd,Dd<oe&&(t=_d,n=Od,i=Rd),r=_m(t,n,i),r<Ed)?[NaN,NaN]:[Jn(n,t)*at,vn(i/r)*at]}function Bm(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function zm(e,t){return Ee(e)>me&&(e-=Math.round(e/on)*on),[e,t]}zm.invert=zm;function Ak(e,t,n){return(e%=on)?t||n?Bm(YA(e),KA(t,n)):YA(e):t||n?KA(t,n):zm}function XA(e){return function(t,n){return t+=e,Ee(t)>me&&(t-=Math.round(t/on)*on),[t,n]}}function YA(e){var t=XA(e);return t.invert=XA(-e),t}function KA(e,t){var n=ae(e),i=se(e),r=ae(t),s=se(t);function o(a,u){var l=ae(u),c=ae(a)*l,f=se(a)*l,d=se(u),h=d*n+c*i;return[Jn(f*r-h*s,c*n-d*i),vn(h*r+f*s)]}return o.invert=function(a,u){var l=ae(u),c=ae(a)*l,f=se(a)*l,d=se(u),h=d*r-f*s;return[Jn(f*r+d*s,c*n+h*i),vn(h*n-c*i)]},o}function U4(e){e=Ak(e[0]*ge,e[1]*ge,e.length>2?e[2]*ge:0);function t(n){return n=e(n[0]*ge,n[1]*ge),n[0]*=at,n[1]*=at,n}return t.invert=function(n){return n=e.invert(n[0]*ge,n[1]*ge),n[0]*=at,n[1]*=at,n},t}function j4(e,t,n,i,r,s){if(n){var o=ae(t),a=se(t),u=i*n;r==null?(r=t+i*on,s=t-u/2):(r=JA(o,r),s=JA(o,s),(i>0?r<s:r>s)&&(r+=i*on));for(var l,c=r;i>0?c>s:c<s;c-=u)l=Fd([o,-a*ae(c),-a*se(c)]),e.point(l[0],l[1])}}function JA(e,t){t=bo(t),t[0]-=e,kd(t);var n=fk(-t[1]);return((-t[2]<0?-n:n)+on-oe)%on}function wk(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:Dt,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Vf(e,t){return Ee(e[0]-t[0])<oe&&Ee(e[1]-t[1])<oe}function mf(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Sk(e,t,n,i,r){var s=[],o=[],a,u;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],y=p[g],b;if(Vf(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<g;++a)r.point((m=p[a])[0],m[1]);r.lineEnd();return}y[0]+=2*oe}s.push(b=new mf(m,p,null,!0)),o.push(b.o=new mf(m,null,b,!1)),s.push(b=new mf(y,p,null,!1)),o.push(b.o=new mf(y,null,b,!0))}}),!!s.length){for(o.sort(t),QA(s),QA(o),a=0,u=o.length;a<u;++a)o[a].e=n=!n;for(var l=s[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function QA(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Vg(e){return Ee(e[0])<=me?e[0]:Hn(e[0])*((Ee(e[0])+me)%on-me)}function q4(e,t){var n=Vg(t),i=t[1],r=se(i),s=[se(n),-ae(n),0],o=0,a=0,u=new sn;r===1?i=nt+oe:r===-1&&(i=-nt-oe);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=Vg(h),g=h[1]/2+Ad,m=se(g),y=ae(g),b=0;b<d;++b,p=x,m=w,y=A,h=v){var v=f[b],x=Vg(v),E=v[1]/2+Ad,w=se(E),A=ae(E),C=x-p,S=C>=0?1:-1,F=S*C,k=F>me,P=m*w;if(u.add(Jn(P*S*se(F),y*A+P*ae(F))),o+=k?C+S*on:C,k^p>=n^x>=n){var U=La(bo(h),bo(v));kd(U);var _=La(s,U);kd(_);var $=(k^C>=0?-1:1)*vn(_[2]);(i>$||i===$&&(U[0]||U[1]))&&(a+=k^C>=0?1:-1)}}return(o<-oe||o<oe&&u<-Ed)^a&1}function Ck(e,t,n,i){return function(r){var s=t(r),o=wk(),a=t(o),u=!1,l,c,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,c=tk(c);var x=q4(l,i);c.length?(u||(r.polygonStart(),u=!0),Sk(c,G4,x,n,r)):x&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,E){e(x,E)&&r.point(x,E)}function p(x,E){s.point(x,E)}function g(){d.point=p,s.lineStart()}function m(){d.point=h,s.lineEnd()}function y(x,E){f.push([x,E]),a.point(x,E)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),E=o.result(),w,A=E.length,C,S,F;if(f.pop(),l.push(f),f=null,!!A){if(x&1){if(S=E[0],(C=S.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),w=0;w<C;++w)r.point((F=S[w])[0],F[1]);r.lineEnd()}return}A>1&&x&2&&E.push(E.pop().concat(E.shift())),c.push(E.filter(W4))}}return d}}function W4(e){return e.length>1}function G4(e,t){return((e=e.x)[0]<0?e[1]-nt-oe:nt-e[1])-((t=t.x)[0]<0?t[1]-nt-oe:nt-t[1])}const ZA=Ck(function(){return!0},H4,X4,[-me,-nt]);function H4(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?me:-me,u=Ee(s-t);Ee(u-me)<oe?(e.point(t,n=(n+o)/2>0?nt:-nt),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&u>=me&&(Ee(t-i)<oe&&(t-=i*oe),Ee(s-a)<oe&&(s-=a*oe),n=V4(t,n,s,o),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=s,n=o),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function V4(e,t,n,i){var r,s,o=se(e-n);return Ee(o)>oe?hu((se(t)*(s=ae(i))*se(n)-se(i)*(r=ae(t))*se(e))/(r*s*o)):(t+i)/2}function X4(e,t,n,i){var r;if(e==null)r=n*nt,i.point(-me,r),i.point(0,r),i.point(me,r),i.point(me,0),i.point(me,-r),i.point(0,-r),i.point(-me,-r),i.point(-me,0),i.point(-me,r);else if(Ee(e[0]-t[0])>oe){var s=e[0]<t[0]?me:-me;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function Y4(e){var t=ae(e),n=2*ge,i=t>0,r=Ee(t)>oe;function s(c,f,d,h){j4(h,e,n,d,c,f)}function o(c,f){return ae(c)*ae(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=o(m,y),E=i?x?0:l(m,y):x?l(m+(m<0?me:-me),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||Vf(f,v)||Vf(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var w;!(E&d)&&(w=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(w[0][0],w[0][1]),c.point(w[1][0],w[1][1]),c.lineEnd()):(c.point(w[1][0],w[1][1]),c.lineEnd(),c.lineStart(),c.point(w[0][0],w[0][1],3)))}x&&(!f||!Vf(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=E},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=bo(c),p=bo(f),g=[1,0,0],m=La(h,p),y=pf(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,E=-t*b/v,w=La(g,m),A=gf(g,x),C=gf(m,E);Hg(A,C);var S=w,F=pf(A,S),k=pf(S,S),P=F*F-k*(pf(A,A)-1);if(!(P<0)){var U=an(P),_=gf(S,(-F-U)/k);if(Hg(_,A),_=Fd(_),!d)return _;var $=c[0],D=f[0],I=c[1],G=f[1],B;D<$&&(B=$,$=D,D=B);var Z=D-$,fe=Ee(Z-me)<oe,ue=fe||Z<oe;if(!fe&&G<I&&(B=I,I=G,G=B),ue?fe?I+G>0^_[1]<(Ee(_[0]-$)<oe?I:G):I<=_[1]&&_[1]<=G:Z>me^($<=_[0]&&_[0]<=D)){var xe=gf(S,(-F+U)/k);return Hg(xe,A),[_,Fd(xe)]}}}function l(c,f){var d=i?e:me-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return Ck(o,a,s,i?[0,-e]:[-me,e-me])}function K4(e,t,n,i,r,s){var o=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-o,h=l-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<f&&(f=p)}if(p=i-a,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}return c>0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var sl=1e9,yf=-sl;function $k(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function s(l,c,f,d){var h=0,p=0;if(l==null||(h=o(l,f))!==(p=o(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(l,c){return Ee(l[0]-e)<oe?c>0?0:3:Ee(l[0]-n)<oe?c>0?2:1:Ee(l[1]-t)<oe?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=o(l,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=wk(),d,h,p,g,m,y,b,v,x,E,w,A={point:C,lineStart:P,lineEnd:U,polygonStart:F,polygonEnd:k};function C($,D){r($,D)&&c.point($,D)}function S(){for(var $=0,D=0,I=h.length;D<I;++D)for(var G=h[D],B=1,Z=G.length,fe=G[0],ue,xe,ot=fe[0],ke=fe[1];B<Z;++B)ue=ot,xe=ke,fe=G[B],ot=fe[0],ke=fe[1],xe<=i?ke>i&&(ot-ue)*(i-xe)>(ke-xe)*(e-ue)&&++$:ke<=i&&(ot-ue)*(i-xe)<(ke-xe)*(e-ue)&&--$;return $}function F(){c=f,d=[],h=[],w=!0}function k(){var $=S(),D=w&&$,I=(d=tk(d)).length;(D||I)&&(l.polygonStart(),D&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),I&&Sk(d,a,$,s,l),l.polygonEnd()),c=l,d=h=p=null}function P(){A.point=_,h&&h.push(p=[]),E=!0,x=!1,b=v=NaN}function U(){d&&(_(g,m),y&&x&&f.rejoin(),d.push(f.result())),A.point=C,x&&c.lineEnd()}function _($,D){var I=r($,D);if(h&&p.push([$,D]),E)g=$,m=D,y=I,E=!1,I&&(c.lineStart(),c.point($,D));else if(I&&x)c.point($,D);else{var G=[b=Math.max(yf,Math.min(sl,b)),v=Math.max(yf,Math.min(sl,v))],B=[$=Math.max(yf,Math.min(sl,$)),D=Math.max(yf,Math.min(sl,D))];K4(G,B,e,t,n,i)?(x||(c.lineStart(),c.point(G[0],G[1])),c.point(B[0],B[1]),I||c.lineEnd(),w=!1):I&&(c.lineStart(),c.point($,D),w=!1)}b=$,v=D,x=I}return A}}function ew(e,t,n){var i=On(e,t-oe,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function tw(e,t,n){var i=On(e,t-oe,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function J4(){var e,t,n,i,r,s,o,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return On(hf(i/c)*c,n,c).map(p).concat(On(hf(a/f)*f,o,f).map(g)).concat(On(hf(t/u)*u,e,u).filter(function(v){return Ee(v%c)>oe}).map(d)).concat(On(hf(s/l)*l,r,l).filter(function(v){return Ee(v%f)>oe}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=ew(s,r,90),h=tw(t,e,m),p=ew(a,o,90),g=tw(i,n,m),y):m},y.extentMajor([[-180,-90+oe],[180,90-oe]]).extentMinor([[-180,-80-oe],[180,80+oe]])}const Wl=e=>e;var Xg=new sn,Um=new sn,Fk,kk,jm,qm,Sr={point:Dt,lineStart:Dt,lineEnd:Dt,polygonStart:function(){Sr.lineStart=Q4,Sr.lineEnd=eL},polygonEnd:function(){Sr.lineStart=Sr.lineEnd=Sr.point=Dt,Xg.add(Ee(Um)),Um=new sn},result:function(){var e=Xg/2;return Xg=new sn,e}};function Q4(){Sr.point=Z4}function Z4(e,t){Sr.point=Dk,Fk=jm=e,kk=qm=t}function Dk(e,t){Um.add(qm*e-jm*t),jm=e,qm=t}function eL(){Dk(Fk,kk)}var Pa=1/0,Id=Pa,Gl=-Pa,Ld=Gl,Pd={point:tL,lineStart:Dt,lineEnd:Dt,polygonStart:Dt,polygonEnd:Dt,result:function(){var e=[[Pa,Id],[Gl,Ld]];return Gl=Ld=-(Id=Pa=1/0),e}};function tL(e,t){e<Pa&&(Pa=e),e>Gl&&(Gl=e),t<Id&&(Id=t),t>Ld&&(Ld=t)}var Wm=0,Gm=0,ol=0,Bd=0,zd=0,ba=0,Hm=0,Vm=0,al=0,_k,Ok,ji,qi,Wn={point:vo,lineStart:nw,lineEnd:iw,polygonStart:function(){Wn.lineStart=rL,Wn.lineEnd=sL},polygonEnd:function(){Wn.point=vo,Wn.lineStart=nw,Wn.lineEnd=iw},result:function(){var e=al?[Hm/al,Vm/al]:ba?[Bd/ba,zd/ba]:ol?[Wm/ol,Gm/ol]:[NaN,NaN];return Wm=Gm=ol=Bd=zd=ba=Hm=Vm=al=0,e}};function vo(e,t){Wm+=e,Gm+=t,++ol}function nw(){Wn.point=nL}function nL(e,t){Wn.point=iL,vo(ji=e,qi=t)}function iL(e,t){var n=e-ji,i=t-qi,r=an(n*n+i*i);Bd+=r*(ji+e)/2,zd+=r*(qi+t)/2,ba+=r,vo(ji=e,qi=t)}function iw(){Wn.point=vo}function rL(){Wn.point=oL}function sL(){Rk(_k,Ok)}function oL(e,t){Wn.point=Rk,vo(_k=ji=e,Ok=qi=t)}function Rk(e,t){var n=e-ji,i=t-qi,r=an(n*n+i*i);Bd+=r*(ji+e)/2,zd+=r*(qi+t)/2,ba+=r,r=qi*e-ji*t,Hm+=r*(ji+e),Vm+=r*(qi+t),al+=r*3,vo(ji=e,qi=t)}function Mk(e){this._context=e}Mk.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,on);break}}},result:Dt};var Xm=new sn,Yg,Tk,Nk,ul,ll,Hl={point:Dt,lineStart:function(){Hl.point=aL},lineEnd:function(){Yg&&Ik(Tk,Nk),Hl.point=Dt},polygonStart:function(){Yg=!0},polygonEnd:function(){Yg=null},result:function(){var e=+Xm;return Xm=new sn,e}};function aL(e,t){Hl.point=Ik,Tk=ul=e,Nk=ll=t}function Ik(e,t){ul-=e,ll-=t,Xm.add(an(ul*ul+ll*ll)),ul=e,ll=t}let rw,Ud,sw,ow;class aw{constructor(t){this._append=t==null?Lk:uL(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==sw||this._append!==Ud){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,sw=i,Ud=this._append,ow=this._,this._=r}this._+=ow;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Lk(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function uL(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Lk;if(t!==rw){const n=10**t;rw=t,Ud=function(r){let s=1;this._+=r[0];for(const o=r.length;s<o;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}return Ud}function Pk(e,t){let n=3,i=4.5,r,s;function o(a){return a&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),wr(a,r(s))),s.result()}return o.area=function(a){return wr(a,r(Sr)),Sr.result()},o.measure=function(a){return wr(a,r(Hl)),Hl.result()},o.bounds=function(a){return wr(a,r(Pd)),Pd.result()},o.centroid=function(a){return wr(a,r(Wn)),Wn.result()},o.projection=function(a){return arguments.length?(r=a==null?(e=null,Wl):(e=a).stream,o):e},o.context=function(a){return arguments.length?(s=a==null?(t=null,new aw(n)):new Mk(t=a),typeof i!="function"&&s.pointRadius(i),o):t},o.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(s.pointRadius(+a),+a),o):i},o.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(s=new aw(n)),o},o.projection(e).digits(n).context(t)}function qh(e){return function(t){var n=new Ym;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Ym(){}Ym.prototype={constructor:Ym,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function eb(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),wr(n,e.stream(Pd)),t(Pd.result()),i!=null&&e.clipExtent(i),e}function Wh(e,t,n){return eb(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,u])},n)}function tb(e,t,n){return Wh(e,[[0,0],t],n)}function nb(e,t,n){return eb(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function ib(e,t,n){return eb(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var uw=16,lL=ae(30*ge);function lw(e,t){return+t?fL(e,t):cL(e)}function cL(e){return qh({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function fL(e,t){function n(i,r,s,o,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=o+d,E=a+h,w=u+p,A=an(x*x+E*E+w*w),C=vn(w/=A),S=Ee(Ee(w)-1)<oe||Ee(s-f)<oe?(s+f)/2:Jn(E,x),F=e(S,C),k=F[0],P=F[1],U=k-i,_=P-r,$=b*U-y*_;($*$/v>t||Ee((y*U+b*_)/v-.5)>.3||o*d+a*h+u*p<lL)&&(n(i,r,s,o,a,u,k,P,S,x/=A,E/=A,w,g,m),m.point(k,P),n(k,P,S,x,E,w,l,c,f,d,h,p,g,m))}}return function(i){var r,s,o,a,u,l,c,f,d,h,p,g,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){i.polygonStart(),m.lineStart=E},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(C,S){C=e(C,S),i.point(C[0],C[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v(C,S){var F=bo([C,S]),k=e(C,S);n(f,d,c,h,p,g,f=k[0],d=k[1],c=C,h=F[0],p=F[1],g=F[2],uw,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function E(){b(),m.point=w,m.lineEnd=A}function w(C,S){v(r=C,S),s=f,o=d,a=h,u=p,l=g,m.point=v}function A(){n(f,d,c,h,p,g,s,o,r,a,u,l,uw,i),m.lineEnd=x,x()}return m}}var dL=qh({point:function(e,t){this.stream.point(e*ge,t*ge)}});function hL(e){return qh({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function pL(e,t,n,i,r){function s(o,a){return o*=i,a*=r,[t+e*o,n-e*a]}return s.invert=function(o,a){return[(o-t)/e*i,(n-a)/e*r]},s}function cw(e,t,n,i,r,s){if(!s)return pL(e,t,n,i,r);var o=ae(s),a=se(s),u=o*e,l=a*e,c=o/e,f=a/e,d=(a*n-o*t)/e,h=(a*t+o*n)/e;function p(g,m){return g*=i,m*=r,[u*g-l*m+t,n-l*g-u*m]}return p.invert=function(g,m){return[i*(c*g-f*m+d),r*(h-f*g-c*m)]},p}function rr(e){return Bk(function(){return e})()}function Bk(e){var t,n=150,i=480,r=250,s=0,o=0,a=0,u=0,l=0,c,f=0,d=1,h=1,p=null,g=ZA,m=null,y,b,v,x=Wl,E=.5,w,A,C,S,F;function k($){return C($[0]*ge,$[1]*ge)}function P($){return $=C.invert($[0],$[1]),$&&[$[0]*at,$[1]*at]}k.stream=function($){return S&&F===$?S:S=dL(hL(c)(g(w(x(F=$)))))},k.preclip=function($){return arguments.length?(g=$,p=void 0,_()):g},k.postclip=function($){return arguments.length?(x=$,m=y=b=v=null,_()):x},k.clipAngle=function($){return arguments.length?(g=+$?Y4(p=$*ge):(p=null,ZA),_()):p*at},k.clipExtent=function($){return arguments.length?(x=$==null?(m=y=b=v=null,Wl):$k(m=+$[0][0],y=+$[0][1],b=+$[1][0],v=+$[1][1]),_()):m==null?null:[[m,y],[b,v]]},k.scale=function($){return arguments.length?(n=+$,U()):n},k.translate=function($){return arguments.length?(i=+$[0],r=+$[1],U()):[i,r]},k.center=function($){return arguments.length?(s=$[0]%360*ge,o=$[1]%360*ge,U()):[s*at,o*at]},k.rotate=function($){return arguments.length?(a=$[0]%360*ge,u=$[1]%360*ge,l=$.length>2?$[2]%360*ge:0,U()):[a*at,u*at,l*at]},k.angle=function($){return arguments.length?(f=$%360*ge,U()):f*at},k.reflectX=function($){return arguments.length?(d=$?-1:1,U()):d<0},k.reflectY=function($){return arguments.length?(h=$?-1:1,U()):h<0},k.precision=function($){return arguments.length?(w=lw(A,E=$*$),_()):an(E)},k.fitExtent=function($,D){return Wh(k,$,D)},k.fitSize=function($,D){return tb(k,$,D)},k.fitWidth=function($,D){return nb(k,$,D)},k.fitHeight=function($,D){return ib(k,$,D)};function U(){var $=cw(n,0,0,d,h,f).apply(null,t(s,o)),D=cw(n,i-$[0],r-$[1],d,h,f);return c=Ak(a,u,l),A=Bm(t,D),C=Bm(c,A),w=lw(A,E),_()}function _(){return S=F=null,k}return function(){return t=e.apply(this,arguments),k.invert=t.invert&&P,U()}}function rb(e){var t=0,n=me/3,i=Bk(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*ge,n=s[1]*ge):[t*at,n*at]},r}function gL(e){var t=ae(e);function n(i,r){return[i*t,se(r)/t]}return n.invert=function(i,r){return[i/t,vn(r*t)]},n}function mL(e,t){var n=se(e),i=(n+se(t))/2;if(Ee(i)<oe)return gL(e);var r=1+n*(2*i-n),s=an(r)/i;function o(a,u){var l=an(r-2*i*se(u))/i;return[l*se(a*=i),s-l*ae(a)]}return o.invert=function(a,u){var l=s-u,c=Jn(a,Ee(l))*Hn(l);return l*i<0&&(c-=me*Hn(a)*Hn(l)),[c/i,vn((r-(a*a+l*l)*i*i)/(2*i))]},o}function jd(){return rb(mL).scale(155.424).center([0,33.6442])}function zk(){return jd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function yL(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function bL(){var e,t,n=zk(),i,r=jd().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s,o=jd().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],p=d[1];return u=null,i.point(h,p),u||(s.point(h,p),u)||(a.point(h,p),u)}c.invert=function(d){var h=n.scale(),p=n.translate(),g=(d[0]-p[0])/h,m=(d[1]-p[1])/h;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=yL([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+oe,g+.12*h+oe],[p-.214*h-oe,g+.234*h-oe]]).stream(l),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+oe,g+.166*h+oe],[p-.115*h-oe,g+.234*h-oe]]).stream(l),f()},c.fitExtent=function(d,h){return Wh(c,d,h)},c.fitSize=function(d,h){return tb(c,d,h)},c.fitWidth=function(d,h){return nb(c,d,h)},c.fitHeight=function(d,h){return ib(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function Uk(e){return function(t,n){var i=ae(t),r=ae(n),s=e(i*r);return s===1/0?[2,0]:[s*r*se(t),s*se(n)]}}function vc(e){return function(t,n){var i=an(t*t+n*n),r=e(i),s=se(r),o=ae(r);return[Jn(t*s,i*o),vn(i&&n*s/i)]}}var jk=Uk(function(e){return an(2/(1+e))});jk.invert=vc(function(e){return 2*vn(e/2)});function vL(){return rr(jk).scale(124.75).clipAngle(180-.001)}var qk=Uk(function(e){return(e=fk(e))&&e/se(e)});qk.invert=vc(function(e){return e});function xL(){return rr(qk).scale(79.4188).clipAngle(180-.001)}function Gh(e,t){return[e,wd(Qy((nt+t)/2))]}Gh.invert=function(e,t){return[e,2*hu(ck(t))-nt]};function EL(){return Wk(Gh).scale(961/on)}function Wk(e){var t=rr(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=u=l=null:(o=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):o==null?null:[[o,a],[u,l]]};function c(){var f=me*i(),d=t(U4(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===Gh?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,u),l]]:[[o,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function bf(e){return Qy((nt+e)/2)}function AL(e,t){var n=ae(e),i=e===t?se(e):wd(n/ae(t))/wd(bf(t)/bf(e)),r=n*Gg(bf(e),i)/i;if(!i)return Gh;function s(o,a){r>0?a<-nt+oe&&(a=-nt+oe):a>nt-oe&&(a=nt-oe);var u=r/Gg(bf(a),i);return[u*se(i*o),r-u*ae(i*o)]}return s.invert=function(o,a){var u=r-a,l=Hn(i)*an(o*o+u*u),c=Jn(o,Ee(u))*Hn(u);return u*i<0&&(c-=me*Hn(o)*Hn(u)),[c/i,2*hu(Gg(r/l,1/i))-nt]},s}function wL(){return rb(AL).scale(109.5).parallels([30,30])}function qd(e,t){return[e,t]}qd.invert=qd;function SL(){return rr(qd).scale(152.63)}function CL(e,t){var n=ae(e),i=e===t?se(e):(n-ae(t))/(t-e),r=n/i+e;if(Ee(i)<oe)return qd;function s(o,a){var u=r-a,l=i*o;return[u*se(l),r-u*ae(l)]}return s.invert=function(o,a){var u=r-a,l=Jn(o,Ee(u))*Hn(u);return u*i<0&&(l-=me*Hn(o)*Hn(u)),[l/i,r-Hn(i)*an(o*o+u*u)]},s}function $L(){return rb(CL).scale(131.154).center([0,13.9389])}var Fl=1.340264,kl=-.081106,Dl=893e-6,_l=.003796,Wd=an(3)/2,FL=12;function Gk(e,t){var n=vn(Wd*se(t)),i=n*n,r=i*i*i;return[e*ae(n)/(Wd*(Fl+3*kl*i+r*(7*Dl+9*_l*i))),n*(Fl+kl*i+r*(Dl+_l*i))]}Gk.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,o,a,u;s<FL&&(a=n*(Fl+kl*i+r*(Dl+_l*i))-t,u=Fl+3*kl*i+r*(7*Dl+9*_l*i),n-=o=a/u,i=n*n,r=i*i*i,!(Ee(o)<Ed));++s);return[Wd*e*(Fl+3*kl*i+r*(7*Dl+9*_l*i))/ae(n),vn(se(n)/Wd)]};function kL(){return rr(Gk).scale(177.158)}function Hk(e,t){var n=ae(t),i=ae(e)*n;return[n*se(e)/i,se(t)/i]}Hk.invert=vc(hu);function DL(){return rr(Hk).scale(144.049).clipAngle(60)}function _L(){var e=1,t=0,n=0,i=1,r=1,s=0,o,a,u=null,l,c,f,d=1,h=1,p=qh({point:function(x,E){var w=v([x,E]);this.stream.point(w[0],w[1])}}),g=Wl,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var E=x[0]*d,w=x[1]*h;if(s){var A=w*o-E*a;E=E*o+w*a,w=A}return[E+t,w+n]}return v.invert=function(x){var E=x[0]-t,w=x[1]-n;if(s){var A=w*o+E*a;E=E*o-w*a,w=A}return[E/d,w/h]},v.stream=function(x){return m&&y===x?m:m=p(g(y=x))},v.postclip=function(x){return arguments.length?(g=x,u=l=c=f=null,b()):g},v.clipExtent=function(x){return arguments.length?(g=x==null?(u=l=c=f=null,Wl):$k(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(s=x%360*ge,a=se(s),o=ae(s),b()):s*at},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,E){return Wh(v,x,E)},v.fitSize=function(x,E){return tb(v,x,E)},v.fitWidth=function(x,E){return nb(v,x,E)},v.fitHeight=function(x,E){return ib(v,x,E)},v}function Vk(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}Vk.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,o=s*s;n-=r=(n*(1.007226+s*(.015085+o*(-.044475+.028874*s-.005916*o)))-t)/(1.007226+s*(.015085*3+o*(-.044475*7+.028874*9*s-.005916*11*o)))}while(Ee(r)>oe&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function OL(){return rr(Vk).scale(175.295)}function Xk(e,t){return[ae(t)*se(e),se(t)]}Xk.invert=vc(vn);function RL(){return rr(Xk).scale(249.5).clipAngle(90+oe)}function Yk(e,t){var n=ae(t),i=1+ae(e)*n;return[n*se(e)/i,se(t)/i]}Yk.invert=vc(function(e){return 2*hu(e)});function ML(){return rr(Yk).scale(250).clipAngle(142)}function Kk(e,t){return[wd(Qy((nt+t)/2)),-e]}Kk.invert=function(e,t){return[-t,2*hu(ck(e))-nt]};function TL(){var e=Wk(Kk),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}function NL(e,t){return e.parent===t.parent?1:2}function IL(e){return e.reduce(LL,0)/e.length}function LL(e,t){return e+t.x}function PL(e){return 1+e.reduce(BL,0)}function BL(e,t){return Math.max(e,t.y)}function zL(e){for(var t;t=e.children;)e=t[0];return e}function UL(e){for(var t;t=e.children;)e=t[t.length-1];return e}function jL(){var e=NL,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=IL(h),d.y=PL(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var u=zL(s),l=UL(s),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}const qL=1664525,WL=1013904223,fw=4294967296;function GL(){let e=1;return()=>(e=(qL*e+WL)%fw)/fw}function HL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function VL(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function XL(e,t){for(var n=0,i=(e=VL(Array.from(e),t)).length,r=[],s,o;n<i;)s=e[n],o&&Jk(o,s)?++n:(o=KL(r=YL(r,s)),n=0);return o}function YL(e,t){var n,i;if(Kg(t,e))return[t];for(n=0;n<e.length;++n)if(vf(t,e[n])&&Kg(cl(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(vf(cl(e[n],e[i]),t)&&vf(cl(e[n],t),e[i])&&vf(cl(e[i],t),e[n])&&Kg(Qk(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function vf(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Jk(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Kg(e,t){for(var n=0;n<t.length;++n)if(!Jk(e,t[n]))return!1;return!0}function KL(e){switch(e.length){case 1:return JL(e[0]);case 2:return cl(e[0],e[1]);case 3:return Qk(e[0],e[1],e[2])}}function JL(e){return{x:e.x,y:e.y,r:e.r}}function cl(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,o=t.y,a=t.r,u=s-n,l=o-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+s+u/f*c)/2,y:(i+o+l/f*c)/2,r:(f+r+a)/2}}function Qk(e,t,n){var i=e.x,r=e.y,s=e.r,o=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-o,h=i-l,p=r-a,g=r-c,m=u-s,y=f-s,b=i*i+r*r-s*s,v=b-o*o-a*a+u*u,x=b-l*l-c*c+f*f,E=h*p-d*g,w=(p*x-g*v)/(E*2)-i,A=(g*m-p*y)/E,C=(h*v-d*x)/(E*2)-r,S=(d*y-h*m)/E,F=A*A+S*S-1,k=2*(s+w*A+C*S),P=w*w+C*C-s*s,U=-(Math.abs(F)>1e-6?(k+Math.sqrt(k*k-4*F*P))/(2*F):P/k);return{x:i+w+A*U,y:r+C+S*U,r:U}}function dw(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,u,l=i*i+o*o;l?(s=t.r+n.r,s*=s,u=e.r+n.r,u*=u,s>u?(r=(l+u-s)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(l+s-u)/(2*l),a=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function hw(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function pw(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function xf(e){this._=e,this.next=null,this.previous=null}function QL(e,t){if(!(s=(e=HL(e)).length))return 0;var n,i,r,s,o,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;dw(i,n,r=e[2]),n=new xf(n),i=new xf(i),r=new xf(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<s;++u){dw(n._,i._,r=e[u]),r=new xf(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(hw(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(hw(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,o=pw(n);(r=r.next)!==i;)(a=pw(r))<o&&(n=r,o=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=XL(n,t),u=0;u<s;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function ZL(e){return Math.sqrt(e.value)}function e7(){var e=null,t=1,n=1,i=bA;function r(s){const o=GL();return s.x=t/2,s.y=n/2,e?s.eachBefore(gw(e)).eachAfter(Jg(i,.5,o)).eachBefore(mw(1)):s.eachBefore(gw(ZL)).eachAfter(Jg(bA,1,o)).eachAfter(Jg(i,s.r/Math.min(t,n),o)).eachBefore(mw(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=Hf(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:E9(+s),r):i},r}function gw(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Jg(e,t,n){return function(i){if(r=i.children){var r,s,o=r.length,a=e(i)*t||0,u;if(a)for(s=0;s<o;++s)r[s].r+=a;if(u=QL(r,n),a)for(s=0;s<o;++s)r[s].r-=a;i.r=u+a}}}function mw(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function t7(){var e=1,t=1,n=0,i=!1;function r(o){var a=o.height+1;return o.x0=o.y0=n,o.x1=e,o.y1=t/a,o.eachBefore(s(t,a)),i&&o.eachBefore(A9),o}function s(o,a){return function(u){u.children&&Uh(u,u.x0,o*(u.depth+1)/a,u.x1,o*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(o){return arguments.length?(i=!!o,r):i},r.size=function(o){return arguments.length?(e=+o[0],t=+o[1],r):[e,t]},r.padding=function(o){return arguments.length?(n=+o,r):n},r}var n7={depth:-1},yw={},Qg={};function i7(e){return e.id}function r7(e){return e.parentId}function bw(){var e=i7,t=r7,n;function i(r){var s=Array.from(r),o=e,a=t,u,l,c,f,d,h,p,g,m=new Map;if(n!=null){const y=s.map((x,E)=>s7(n(x,E,r))),b=y.map(vw),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(vw(x)),s.push(Qg));o=(x,E)=>y[E],a=(x,E)=>b[E]}for(c=0,u=s.length;c<u;++c)l=s[c],h=s[c]=new KF(l),(p=o(l,c,r))!=null&&(p+="")&&(g=h.id=p,m.set(g,m.has(g)?yw:h)),(p=a(l,c,r))!=null&&(p+="")&&(h.parent=p);for(c=0;c<u;++c)if(h=s[c],p=h.parent){if(d=m.get(p),!d)throw new Error("missing: "+p);if(d===yw)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Qg&&f.children.length===1;)f=f.children[0],--u;for(let y=s.length-1;y>=0&&(h=s[y],h.data===Qg);--y)h.data=null}if(f.parent=n7,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(w9),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Hf(r),i):e},i.parentId=function(r){return arguments.length?(t=Hf(r),i):t},i.path=function(r){return arguments.length?(n=Hf(r),i):n},i}function s7(e){e=`${e}`;let t=e.length;return Km(e,t-1)&&!Km(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function vw(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Km(e,t););return e.slice(0,t)}function Km(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function o7(e,t){return e.parent===t.parent?1:2}function Zg(e){var t=e.children;return t?t[0]:e.t}function e0(e){var t=e.children;return t?t[t.length-1]:e.t}function a7(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function u7(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function l7(e,t,n){return e.a.parent===t.parent?e.a:n}function Xf(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Xf.prototype=Object.create(KF.prototype);function c7(e){for(var t=new Xf(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new Xf(s[o],o)),r.parent=n;return(t.parent=new Xf(null,0)).children=[t],t}function f7(){var e=o7,t=1,n=1,i=null;function r(l){var c=c7(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function s(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){u7(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=e0(p),d=Zg(d),p&&d;)g=Zg(g),h=e0(h),h.a=l,x=p.z+b-d.z-m+e(p._,d._),x>0&&(a7(l7(p,l,f),l,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!e0(h)&&(h.t=p,h.m+=b-y),d&&!Zg(g)&&(g.t=d,g.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function d7(e,t,n,i,r){var s=e.children,o,a=s.length,u,l=new Array(a+1);for(l[0]=u=o=0;o<a;++o)l[o+1]=u+=s[o].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,p,g,m,y){if(f>=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,E=f+1,w=d-1;E<w;){var A=E+w>>>1;l[A]<x?E=A+1:w=A}x-l[E-1]<l[E]-x&&f+1<E&&--E;var C=l[E]-v,S=h-C;if(m-p>y-g){var F=h?(p*S+m*C)/h:m;c(f,E,C,p,g,F,y),c(E,d,S,F,g,m,y)}else{var k=h?(g*S+y*C)/h:y;c(f,E,C,p,g,m,k),c(E,d,S,p,k,m,y)}}}function h7(e,t,n,i,r){(e.depth&1?Uy:Uh)(e,t,n,i,r)}const p7=function e(t){function n(i,r,s,o,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d<p;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?Uh(l,r,s,o,g?s+=(a-s)*l.value/g:a):Uy(l,r,s,g?r+=(o-r)*l.value/g:o,a),g-=l.value}else i._squarify=u=S9(t,i,r,s,o,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(C9);function Zk(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,fA),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return Zk(e).unknown(t)},e=arguments.length?Array.from(e,fA):[0,1],du(n)}function xw(e){return Math.log(e)}function Ew(e){return Math.exp(e)}function g7(e){return-Math.log(-e)}function m7(e){return-Math.exp(-e)}function y7(e){return isFinite(e)?+("1e"+e):e<0?0:e}function b7(e){return e===10?y7:e===Math.E?Math.exp:t=>Math.pow(e,t)}function v7(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Aw(e){return(t,n)=>-e(-t,n)}function sb(e){const t=e(xw,Ew),n=t.domain;let i=10,r,s;function o(){return r=v7(i),s=b7(i),n()[0]<0?(r=Aw(r),s=Aw(s),e(g7,m7)):e(xw,Ew),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),p,g;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<i;++p)if(g=d<0?p/s(-d):p*s(d),!(g<l)){if(g>c)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=dA(l,c,m))}else y=dA(d,h,Math.min(h-d,m)).map(s);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=Sm(u)).precision==null&&(u.trim=!0),u=WF(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(m8(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function eD(){const e=sb(Ty()).domain([1,10]);return e.copy=()=>Ny(e,eD()).base(e.base()),zo.apply(e,arguments),e}function ww(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Sw(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ob(e){var t=1,n=e(ww(t),Sw(t));return n.constant=function(i){return arguments.length?e(ww(t=+i),Sw(t)):t},du(n)}function tD(){var e=ob(Ty());return e.copy=function(){return Ny(e,tD()).constant(e.constant())},zo.apply(e,arguments)}function Cw(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function x7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function E7(e){return e<0?-e*e:e*e}function ab(e){var t=e(ss,ss),n=1;function i(){return n===1?e(ss,ss):n===.5?e(x7,E7):e(Cw(n),Cw(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},du(t)}function ub(){var e=ab(Ty());return e.copy=function(){return Ny(e,ub()).exponent(e.exponent())},zo.apply(e,arguments),e}function A7(){return ub.apply(null,arguments).exponent(.5)}function nD(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o<a;)n[o-1]=ZF(e,o/a);return s}function s(o){return o==null||isNaN(o=+o)?i:t[Ta(n,o)]}return s.invertExtent=function(o){var a=t.indexOf(o);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let a of o)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Ul),r()},s.range=function(o){return arguments.length?(t=Array.from(o),r()):t.slice()},s.unknown=function(o){return arguments.length?(i=o,s):i},s.quantiles=function(){return n.slice()},s.copy=function(){return nD().domain(e).range(t).unknown(i)},zo.apply(s,arguments)}function iD(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function o(u){return u!=null&&u<=u?r[Ta(i,u,0,n)]:s}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},o.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},o.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},o.unknown=function(u){return arguments.length&&(s=u),o},o.thresholds=function(){return i.slice()},o.copy=function(){return iD().domain([e,t]).range(r).unknown(s)},zo.apply(du(o),arguments)}function rD(){var e=[.5],t=[0,1],n,i=1;function r(s){return s!=null&&s<=s?t[Ta(e,s,0,i)]:n}return r.domain=function(s){return arguments.length?(e=Array.from(s),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(s){return arguments.length?(t=Array.from(s),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},r.unknown=function(s){return arguments.length?(n=s,r):n},r.copy=function(){return rD().domain(e).range(t).unknown(n)},zo.apply(r,arguments)}function w7(){return zo.apply(y8(v8,b8,UF,wm,Py,uo,zF,BF,Ly,PF).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Hh(){var e=0,t=1,n,i,r,s,o=ss,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:o(r===0?.5:(f=(s(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=s(e=+e),i=s(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(o=f,l):o};function c(f){return function(d){var h,p;return arguments.length?([h,p]=d,o=f(h,p),l):[o(0),o(1)]}}return l.range=c(mc),l.rangeRound=c(Ph),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return s=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function Rs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function lb(){var e=du(Hh()(ss));return e.copy=function(){return Rs(e,lb())},Os.apply(e,arguments)}function sD(){var e=sb(Hh()).domain([1,10]);return e.copy=function(){return Rs(e,sD()).base(e.base())},Os.apply(e,arguments)}function oD(){var e=ob(Hh());return e.copy=function(){return Rs(e,oD()).constant(e.constant())},Os.apply(e,arguments)}function cb(){var e=ab(Hh());return e.copy=function(){return Rs(e,cb()).exponent(e.exponent())},Os.apply(e,arguments)}function S7(){return cb.apply(null,arguments).exponent(.5)}function Vh(){var e=0,t=.5,n=1,i=1,r,s,o,a,u,l=ss,c,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+c(g))-s)*(i*g<i*s?a:u),l(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,r=c(e=+e),s=c(t=+t),o=c(n=+n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(m){var y,b,v;return arguments.length?([y,b,v]=m,l=Wy(g,[y,b,v]),h):[l(0),l(.5),l(1)]}}return h.range=p(mc),h.rangeRound=p(Ph),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return c=g,r=g(e),s=g(t),o=g(n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h}}function aD(){var e=du(Vh()(ss));return e.copy=function(){return Rs(e,aD())},Os.apply(e,arguments)}function uD(){var e=sb(Vh()).domain([.1,1,10]);return e.copy=function(){return Rs(e,uD()).base(e.base())},Os.apply(e,arguments)}function lD(){var e=ob(Vh());return e.copy=function(){return Rs(e,lD()).constant(e.constant())},Os.apply(e,arguments)}function fb(){var e=ab(Vh());return e.copy=function(){return Rs(e,fb()).exponent(e.exponent())},Os.apply(e,arguments)}function C7(){return fb.apply(null,arguments).exponent(.5)}const $7=ir("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),F7=ir("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),k7=ir("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),D7=ir("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),_7=ir("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),O7=ir("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),R7=ir("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),M7=ir("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),T7=ir("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),N7=ir("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function cD(e,t,n){var i=null,r=Lt(!0),s=null,o=VF,a=null,u=HF(l);e=typeof e=="function"?e:e===void 0?Y8:Lt(+e),t=typeof t=="function"?t:t===void 0?Lt(0):Lt(+t),n=typeof n=="function"?n:n===void 0?K8:Lt(+n);function l(f){var d,h,p,g=(f=X8(f)).length,m,y=!1,b,v=new Array(g),x=new Array(g);for(s==null&&(a=o(b=u())),d=0;d<=g;++d){if(!(d<g&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return XF().defined(r).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Lt(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Lt(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Lt(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Lt(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Lt(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Lt(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:Lt(!!f),l):r},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}const I7={draw(e,t){const n=Q8(t/Z8);e.moveTo(n,0),e.arc(0,0,n,0,J8)}};function L7(e,t){let n=null,i=HF(r);e=typeof e=="function"?e:Lt(e||I7),t=typeof t=="function"?t:Lt(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:Lt(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:Lt(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}const P7=/("(?:[^\\"]|\\.)*")|[:,]/g;function t0(e,t={}){const n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),i=n===""?1/0:t.maxLength===void 0?80:t.maxLength;let{replacer:r}=t;return function s(o,a,u){o&&typeof o.toJSON=="function"&&(o=o.toJSON());const l=JSON.stringify(o,r);if(l===void 0)return l;const c=i-a.length-u;if(l.length<=c){const f=l.replace(P7,(d,h)=>h||`${d} `);if(f.length<=c)return f}if(r!=null&&(o=JSON.parse(l),r=void 0),typeof o=="object"&&o!==null){const f=a+n,d=[];let h=0,p,g;if(Array.isArray(o)){p="[",g="]";const{length:m}=o;for(;h<m;h++)d.push(s(o[h],f,h===m-1?0:1)||"null")}else{p="{",g="}";const m=Object.keys(o),{length:y}=m;for(;h<y;h++){const b=m[h],v=`${JSON.stringify(b)}: `,x=s(o[b],f,v.length+(h===y-1?0:1));x!==void 0&&d.push(v+x)}}if(d.length>0)return[p,n+d.join(`,
6
+ ${f}`),g].join(`
7
+ ${a}`)}return l}(e,"",0)}function Cn(e,t,n){return Object.assign(e,{fields:t||[],fname:n})}function it(e){return e==null?null:e.fname}function zt(e){return e==null?null:e.fields}function fD(e){return e.length===1?B7(e[0]):z7(e)}const B7=e=>function(t){return t[e]},z7=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function R(e){throw Error(e)}function sr(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||R("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&R("Access path missing closing bracket: "+e),i&&R("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Qn(e,t,n){const i=sr(e),r=i.length===1?i[0]:e;return Cn((n&&n.get||fD)(i),[r],t||r)}const xc=Qn("id"),xn=Cn(e=>e,[],"identity"),rs=Cn(()=>0,[],"zero"),pu=Cn(()=>1,[],"one"),Zn=Cn(()=>!0,[],"true"),Kr=Cn(()=>!1,[],"false"),db=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]=="function"),"__proto__","then"]);function U7(e,t,n){const i=[t,...n];console[e](...i)}const dD=0,hb=1,pb=2,hD=3,pD=4;function Xh(e,t,n=U7){let i=e||dD;return{level(r){return arguments.length?(i=+r,this):i},error(...r){return i>=hb&&n(t||"error","ERROR",r),this},warn(...r){return i>=pb&&n(t||"warn","WARN",r),this},info(...r){return i>=hD&&n(t||"log","INFO",r),this},debug(...r){return i>=pD&&n(t||"log","DEBUG",r),this}}}const N=Array.isArray;function Y(e){return e===Object(e)}const $w=e=>e!=="__proto__"&&e!=="constructor"&&e!=="prototype";function gu(...e){return e.reduce((t,n)=>{for(const i in n)if(i==="signals")t.signals=j7(t.signals,n.signals);else{const r=i==="legend"?{layout:1}:i==="style"?!0:null;mu(t,i,n[i],r)}return t},{})}function mu(e,t,n,i){if(!$w(t))return;const r=e;let s,o;if(Y(n)&&!N(n)){const a=n;o=Y(r[t])?r[t]:r[t]={};for(s in a)i&&(i===!0||i[s])?mu(o,s,a[s]):$w(s)&&(o[s]=a[s])}else r[t]=n}function j7(e,t){if(e==null)return t;if(t==null)return e;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function ye(e){return e[e.length-1]}function nn(e){return e==null||e===""?null:+e}function gD(e){return e.length>0}const mD=e=>t=>e*Math.exp(t),yD=e=>t=>Math.log(e*t),bD=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),vD=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Gd=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e),xD=e=>nn(e)??0,ED=e=>e;function Yh(e,t,n,i){gD(e)||R("Domain array must not be empty");const r=n(e[0]),s=n(ye(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function AD(e,t){return Yh(e,t,xD,ED)}function wD(e,t){const n=Math.sign(e[0]);return Yh(e,t,yD(n),mD(n))}function SD(e,t,n){return Yh(e,t,Gd(n),Gd(1/n))}function CD(e,t,n){return Yh(e,t,bD(n),vD(n))}function Kh(e,t,n,i,r){gD(e)||R("Domain array must not be empty");const s=i(e[0]),o=i(ye(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function gb(e,t,n){return Kh(e,t,n,xD,ED)}function mb(e,t,n){const i=Math.sign(e[0]);return Kh(e,t,n,yD(i),mD(i))}function Hd(e,t,n,i){return Kh(e,t,n,Gd(i),Gd(1/i))}function yb(e,t,n,i){return Kh(e,t,n,bD(i),vD(i))}function $D(e){return 1+~~(new Date(e).getMonth()/3)}function FD(e){return 1+~~(new Date(e).getUTCMonth()/3)}function J(e){return e!=null?N(e)?e:[e]:[]}function kD(e,t,n){let i=e[0],r=e[1],s;return r<i&&(s=r,r=i,i=s),s=r-i,s>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function de(e){return typeof e=="function"}const q7="descending";function bb(e,t,n){const i=n||{},r=J(t)||[],s=[],o=[],a={},u=i.comparator||W7;return J(e).forEach((l,c)=>{if(l==null)return;s.push(r[c]===q7?-1:1);const f=de(l)?l:Qn(l,void 0,i);o.push(f),(zt(f)||[]).forEach(d=>a[d]=1)}),o.length===0?null:Cn(u(o,s),Object.keys(a))}const yu=(e,t)=>{let n=e,i=t;return(n<i||n==null)&&i!=null?-1:(n>i||i==null)&&n!=null?1:(i=i instanceof Date?+i:i,(n=n instanceof Date?+n:n)!==n&&i===i?-1:i!==i&&n===n?1:0)},W7=(e,t)=>e.length===1?G7(e[0],t[0]):H7(e,t,e.length),G7=(e,t)=>function(n,i){return yu(e(n),e(i))*t},H7=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++a<n;)s=e[a],o=yu(s(i),s(r));return o*t[a]});function Ht(e){return de(e)?e:()=>e}function vb(e,t){let n=null;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function he(e,...t){for(const n of t)for(const i in n)e[i]=n[i];return e}function Ji(e,t){let n=0,i,r,s,o;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=o=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>o&&(o=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=o=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>o&&(o=r))}return[s,o]}function DD(e,t){const n=e.length;let i=-1,r,s,o,a,u;if(t==null){for(;++i<n;)if(a=e[i],a!=null&&a>=a){o=u=a;break}if(i===n)return[-1,-1];for(r=s=i;++i<n;)a=e[i],a!=null&&(o>a&&(o=a,r=i),u<a&&(u=a,s=i))}else{for(;++i<n;)if(a=t(e[i],i,e),a!=null&&a>=a){o=u=a;break}if(i===n)return[-1,-1];for(r=s=i;++i<n;)a=t(e[i],i,e),a!=null&&(o>a&&(o=a,r=i),u<a&&(u=a,s=i))}return[r,s]}function Q(e,t){return Object.hasOwn(e,t)}const Ef={};function bu(e){let t={},n;function i(s){return Q(t,s)&&t[s]!==Ef}const r={size:0,empty:0,object:t,has:i,get(s){return i(s)?t[s]:void 0},set(s,o){return i(s)||(++r.size,t[s]===Ef&&--r.empty),t[s]=o,this},delete(s){return i(s)&&(--r.size,++r.empty,t[s]=Ef),this},clear(){r.size=r.empty=0,r.object=t={}},test(s){return arguments.length?(n=s,r):n},clean(){const s={};let o=0;for(const a in t){const u=t[a];u!==Ef&&(!n||!n(u))&&(s[a]=u,++o)}r.size=o,r.empty=0,r.object=t=s}};return e&&Object.keys(e).forEach(s=>{r.set(s,e[s])}),r}function _D(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],u=ye(e),l;if(u===void 0)return s;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=o?i:c<=o?r:s}function V(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),he(i,n)}function va(e,t,n,i){let r=t[0],s=t[t.length-1],o;return r>s&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=s:e<s)}function Uo(e){return typeof e=="boolean"}function gs(e){return Object.prototype.toString.call(e)==="[object Date]"}function OD(e){return e!=null&&de(e[Symbol.iterator])}function Ce(e){return typeof e=="number"}function xb(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function K(e){return typeof e=="string"}function Eb(e,t,n){const i=e?t?J(e).map(u=>u.replace(/\\(.)/g,"$1")):J(e):void 0,r=i==null?void 0:i.length,s=n&&n.get||fD,o=u=>s(t?[u]:sr(u));let a;if(!r||!i)a=function(){return""};else if(r===1){const u=o(i[0]);a=function(l){return""+u(l)}}else{const u=i.map(o);a=function(l){let c=""+u[0](l),f=0;for(;++f<r;)c+="|"+u[f](l);return c}}return Cn(a,i,"key")}function RD(e,t){const n=e[0],i=ye(e),r=+t;return i===void 0?n:r?r===1?i:n+r*(i-n):n}const V7=1e4;function MD(e){e=+e||V7;let t,n,i;const r=()=>{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>Q(t,o)||Q(n,o),get:o=>Q(t,o)?t[o]:Q(n,o)?s(o,n[o]):void 0,set:(o,a)=>Q(t,o)?t[o]=a:s(o,a)}}function X7(e){return e===Array||typeof e=="function"&&e.prototype&&ArrayBuffer.isView(e.prototype)}function TD(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=t.constructor,a=i||(X7(o)?new o(r+s):new Array(r+s));let u=0,l=0,c=0;for(;u<r&&l<s;++c)a[c]=e(t[u],n[l])>0?n[l++]:t[u++];for(;u<r;++u,++c)a[c]=t[u];for(;l<s;++l,++c)a[c]=n[l];return a}function fl(e,t){let n="";for(;--t>=0;)n+=e;return n}function ND(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?fl(r,o)+s:i==="center"?fl(r,~~(o/2))+s+fl(r,Math.ceil(o/2)):s+fl(r,o)}function Jh(e){return e&&ye(e)-e[0]||0}function H(e){return N(e)?`[${e.map(t=>t===null?"null":H(t))}]`:Y(e)||K(e)?JSON.stringify(e).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029"):e}function Ab(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const Y7=e=>Ce(e)||gs(e)?e:Date.parse(e);function wb(e,t){return t=t||Y7,e==null||e===""?null:t(e)}function Sb(e){return e==null||e===""?null:e+""}function vi(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]+""]=!0;return t}function ID(e,t,n,i){const r=i??"…",s=e+"",o=s.length,a=Math.max(0,t-r.length);return o<=t?s:n==="left"?r+s.slice(o-a):n==="center"?s.slice(0,Math.ceil(a/2))+r+s.slice(o-~~(a/2)):s.slice(0,a)+r}function es(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const s=t(e[r]);s&&n(s,r,e)}}else e.forEach(n)}function K7(e){return e}function J7(e){if(e==null)return K7;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],o=e.translate[1];return function(a,u){u||(t=n=0);var l=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*i+s,f[1]=(n+=a[1])*r+o;l<c;)f[l]=a[l],++l;return f}}function Q7(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function Z7(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Fw(e,n)})}:Fw(e,t)}function Fw(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,s=LD(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:s}:i==null?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function LD(e,t){var n=J7(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,p=d.length;h<p;++h)f.push(n(d[h],h));c<0&&Q7(f,p)}function s(c){return n(c)}function o(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);return f.length<2&&f.push(f[0]),f}function a(c){for(var f=o(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(a)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=s(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(s);break;case"LineString":d=o(c.arcs);break;case"MultiLineString":d=c.arcs.map(o);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function eP(e,t){var n={},i={},r={},s=[],o=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++o],t[o]=l,t[c]=d)}),t.forEach(function(l){var c=a(l),f=c[0],d=c[1],h,p;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,p=i[d]){delete i[p.start];var g=p===h?h:h.concat(p);i[g.start=h.start]=r[g.end=p.end]=g}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,p=r[f]){delete r[p.end];var m=p===h?h:p.concat(h);i[m.start=p.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function a(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),s.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||s.push([l])}),s}function tP(e){return LD(e,nP.apply(this,arguments))}function nP(e,t,n){var i,r,s;if(arguments.length>1)i=iP(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);r<s;++r)i[r]=r;return{type:"MultiLineString",arcs:eP(e,i)}}function iP(e,t,n){var i=[],r=[],s;function o(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:s})}function a(f){f.forEach(o)}function u(f){f.forEach(a)}function l(f){f.forEach(u)}function c(f){switch(s=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}const ve="year",En="quarter",Oe="month",ut="week",Je="isoweek",Ge="date",He="day",Qi="dayofyear",tt="hours",Ke="minutes",Rt="seconds",un="milliseconds",Cb=[ve,En,Oe,ut,Je,Ge,He,Qi,tt,Ke,Rt,un],n0=Cb.reduce((e,t,n)=>(e[t]=1+n,e),{});function $b(e){const t=J(e).slice(),n={};return t.length||R("Missing time unit."),t.forEach(r=>{Q(n0,r)?n[r]=1:R(`Invalid time unit: ${r}.`)}),((n[ut]||n[Je]||n[He]?1:0)+(n[En]||n[Oe]||n[Ge]?1:0)+(n[Qi]?1:0)>1||n[ut]&&n[Je])&&R(`Incompatible time units: ${e}`),t.sort((r,s)=>n0[r]-n0[s]),t}const rP={[ve]:"%Y ",[En]:"Q%q ",[Oe]:"%b ",[Ge]:"%d ",[ut]:"W%U ",[Je]:"W%V ",[He]:"%a ",[Qi]:"%j ",[tt]:"%H:00",[Ke]:"00:%M",[Rt]:":%S",[un]:".%L",[`${ve}-${Je}`]:"%G W%V ",[`${ve}-${Oe}`]:"%Y-%m ",[`${ve}-${Oe}-${Ge}`]:"%Y-%m-%d ",[`${tt}-${Ke}`]:"%H:%M"};function PD(e,t){const n=he({},rP,t),i=$b(e),r=i.length;let s="",o=0,a,u;for(o=0;o<r;)for(a=i.length;a>o;--a)if(u=i.slice(o,a).join("-"),n[u]!=null){s+=n[u],o=a;break}return s.trim()}const to=new Date;function Qh(e){return to.setFullYear(e),to.setMonth(0),to.setDate(1),to.setHours(0,0,0,0),to}function BD(e){return jD(new Date(e))}function zD(e){return Jm(new Date(e))}function UD(e){return Qm(new Date(e))}function jD(e){return Sa.count(Qh(e.getFullYear())-1,e)}function Jm(e){return qF.count(Qh(e.getFullYear())-1,e)}function qD(e){return Sa.offset(Bh.floor(e),3).getFullYear()}function Qm(e){return 1+Bh.count(WD(qD(e)),e)}function WD(e){return Bh.floor(Sa.offset(Qh(e),3))}function GD(e){const t=WD(e);return t.getMonth()?t.getDate()-31:t.getDate()}function Zm(e){return Qh(e).getDay()}function sP(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function HD(e){return YD(new Date(e))}function VD(e){return e1(new Date(e))}function XD(e){return t1(new Date(e))}function YD(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return uo.count(t-1,e)}function e1(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Py.count(t-1,e)}function KD(e){return uo.offset(zh.floor(e),3).getUTCFullYear()}function t1(e){return 1+zh.count(JD(KD(e)),e)}function JD(e){return zh.floor(uo.offset(Date.UTC(e,0,1),3))}function QD(e){const t=JD(e);return t.getUTCMonth()?t.getUTCDate()-31:t.getUTCDate()}function n1(e){return to.setTime(Date.UTC(e,0,1)),to.getUTCDay()}function oP(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}const aP=2012,uP=2015;function ZD(e,t,n,i,r){const s=t||1,o=ye(e),a=(y,b,v)=>(v=v||y,lP(n[v],i[v],y===o&&s,b)),u=new Date,l=vi(e),c=l[ve]?a(ve,null,l[Je]?ve+Je:ve):Ht(l[Je]?uP:aP),f=l[Oe]?a(Oe):l[En]?a(En):rs,d=l[ut]&&l[He]?a(He,1,ut+He):l[Je]&&l[He]?a(He,1,Je+He):l[ut]?a(ut,1):l[Je]?a(Je,1):l[He]?a(He,1):l[Ge]?a(Ge,1):l[Qi]?a(Qi,1):pu,h=l[tt]?a(tt):rs,p=l[Ke]?a(Ke):rs,g=l[Rt]?a(Rt):rs,m=l[un]?a(un):rs;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),p(u),g(u),m(u))}}function lP(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function Ba(e,t,n){return t+e*7-(n+6)%7}function e3(e){return(e+6)%7}function Zh(e,t,n){return e+(t-1)*7+n}const cP={[ve]:e=>e.getFullYear(),[En]:e=>Math.floor(e.getMonth()/3),[Oe]:e=>e.getMonth(),[Ge]:e=>e.getDate(),[tt]:e=>e.getHours(),[Ke]:e=>e.getMinutes(),[Rt]:e=>e.getSeconds(),[un]:e=>e.getMilliseconds(),[Qi]:e=>jD(e),[ut]:e=>Jm(e),[ut+He]:(e,t)=>Ba(Jm(e),e.getDay(),Zm(t)),[He]:(e,t)=>Ba(1,e.getDay(),Zm(t)),[Je]:e=>Qm(e),[ve+Je]:e=>qD(e),[Je+He]:(e,t)=>Zh(GD(t),Qm(e),e3(e.getDay()))},fP={[En]:e=>3*e,[ut]:(e,t)=>Ba(e,0,Zm(t)),[Je]:(e,t)=>Zh(GD(t),e,0)};function t3(e,t){return ZD(e,t||1,cP,fP,sP)}const dP={[ve]:e=>e.getUTCFullYear(),[En]:e=>Math.floor(e.getUTCMonth()/3),[Oe]:e=>e.getUTCMonth(),[Ge]:e=>e.getUTCDate(),[tt]:e=>e.getUTCHours(),[Ke]:e=>e.getUTCMinutes(),[Rt]:e=>e.getUTCSeconds(),[un]:e=>e.getUTCMilliseconds(),[Qi]:e=>YD(e),[ut]:e=>e1(e),[He]:(e,t)=>Ba(1,e.getUTCDay(),n1(t)),[ut+He]:(e,t)=>Ba(e1(e),e.getUTCDay(),n1(t)),[Je]:e=>t1(e),[ve+Je]:e=>KD(e),[Je+He]:(e,t)=>Zh(QD(t),t1(e),e3(e.getUTCDay()))},hP={[En]:e=>3*e,[ut]:(e,t)=>Ba(e,0,n1(t)),[Je]:(e,t)=>Zh(QD(t),e,0)};function n3(e,t){return ZD(e,t||1,dP,hP,oP)}const pP={[ve]:A8,[En]:pA.every(3),[Oe]:pA,[ut]:qF,[Je]:Bh,[Ge]:Sa,[He]:Sa,[Qi]:Sa,[tt]:E8,[Ke]:x8,[Rt]:Ly,[un]:jF},gP={[ve]:UF,[En]:wm.every(3),[Oe]:wm,[ut]:Py,[Je]:zh,[Ge]:uo,[He]:uo,[Qi]:uo,[tt]:zF,[Ke]:BF,[Rt]:Ly,[un]:jF};function vu(e){return pP[e]}function xu(e){return gP[e]}function i3(e,t,n){return e?e.offset(t,n):void 0}function r3(e,t,n){return i3(vu(e),t,n)}function s3(e,t,n){return i3(xu(e),t,n)}function o3(e,t,n,i){return e?e.range(t,n,i):void 0}function a3(e,t,n,i){return o3(vu(e),t,n,i)}function u3(e,t,n,i){return o3(xu(e),t,n,i)}const dl=1e3,hl=dl*60,pl=hl*60,ep=pl*24,mP=ep*7,kw=ep*30,i1=ep*365,l3=[ve,Oe,Ge,tt,Ke,Rt,un],gl=l3.slice(0,-1),ml=gl.slice(0,-1),yl=ml.slice(0,-1),yP=yl.slice(0,-1),bP=[ve,ut],Dw=[ve,Oe],c3=[ve],Bu=[[gl,1,dl],[gl,5,5*dl],[gl,15,15*dl],[gl,30,30*dl],[ml,1,hl],[ml,5,5*hl],[ml,15,15*hl],[ml,30,30*hl],[yl,1,pl],[yl,3,3*pl],[yl,6,6*pl],[yl,12,12*pl],[yP,1,ep],[bP,1,mP],[Dw,1,kw],[Dw,3,3*kw],[c3,1,i1]];function f3(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Jh(t))/n;let r=Iy(a=>a[2]).right(Bu,i),s,o;return r===Bu.length?(s=c3,o=Na(t[0]/i1,t[1]/i1,n)):r?(r=Bu[i/Bu[r-1][2]<Bu[r][2]/i?r-1:r],s=r[0],o=r[1]):(s=l3,o=Math.max(Na(t[0],t[1],n),1)),{units:s,step:o}}const vP={[ve]:e=>e.getFullYear(),[Oe]:e=>e.getMonth(),[Ge]:e=>e.getDate(),[He]:e=>e.getDay(),[tt]:e=>e.getHours(),[Ke]:e=>e.getMinutes(),[Rt]:e=>e.getSeconds(),[un]:e=>e.getMilliseconds()},xP={[ve]:e=>e.getUTCFullYear(),[Oe]:e=>e.getUTCMonth(),[Ge]:e=>e.getUTCDate(),[He]:e=>e.getUTCDay(),[tt]:e=>e.getUTCHours(),[Ke]:e=>e.getUTCMinutes(),[Rt]:e=>e.getUTCSeconds(),[un]:e=>e.getUTCMilliseconds()},i0=[{units:[ve,Oe,Ge,tt,Ke,Rt,un],step:1,aligned:()=>!0},{units:[ve,Oe,Ge,tt,Ke,Rt],step:1,aligned:(e,t)=>e.every(n=>t[un](n)===0)},{units:[ve,Oe,Ge,tt,Ke],step:1,aligned:(e,t)=>e.every(n=>t[Rt](n)===0)},{units:[ve,Oe,Ge,tt,Ke],step:5,aligned:(e,t)=>e.every(n=>t[Ke](n)%5===0)},{units:[ve,Oe,Ge,tt,Ke],step:10,aligned:(e,t)=>e.every(n=>t[Ke](n)%10===0)},{units:[ve,Oe,Ge,tt],step:1,aligned:(e,t)=>e.every(n=>t[Ke](n)===0)},{units:[ve,Oe,Ge],step:1,aligned:(e,t)=>e.every(n=>t[tt](n)===0)},{units:[ve,ut],step:1,skippable:!0,aligned:(e,t)=>new Set(e.map(n=>t[He](n))).size===1},{units:[ve,Oe],step:1,aligned:(e,t)=>e.every(n=>t[Ge](n)===1)},{units:[ve,Oe],step:3,aligned:(e,t)=>e.every(n=>t[Oe](n)%3===0)},{units:[ve],step:1,aligned:(e,t)=>e.every(n=>t[Oe](n)===0)},{units:[ve],step:10,aligned:(e,t)=>e.every(n=>t[ve](n)%10===0)},{aligned:()=>!1}];function d3(e,t,n){const i=n?xP:vP,r=e.map(c=>{const f=t(c),d=new Date(f);return Number.isNaN(+d)&&R(`Invalid date: ${f}`),d}),s=i0.findIndex(c=>!c.aligned(r,i)),o=i0.findIndex(c=>!c.skippable&&!c.aligned(r,i)),a=o>s+1?o:s,{units:u,step:l}=i0[a-1];return{units:u,step:l}}function bl(e){const t={};return n=>t[n]||(t[n]=e(n))}function EP(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=AP(i,r);const o=s<i.length?i.slice(s):"";for(;--s>r;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function AP(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function h3(e){const t=bl(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=Sm(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return EP(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=Sm(o??",f");const a=Na(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=l8(a,u))||(o.precision=l),n(o,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=u8(a,u))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=a8(a))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}let r1;p3();function p3(){return r1=h3({format:WF,formatPrefix:_8})}function g3(e){return h3(D8(e))}function Vd(e){return arguments.length?r1=g3(e):r1}function _w(e,t,n){n=n||{},Y(n)||R(`Invalid time multi-format specifier: ${n}`);const i=t(Rt),r=t(Ke),s=t(tt),o=t(Ge),a=t(ut),u=t(Oe),l=t(En),c=t(ve),f=e(n[un]||".%L"),d=e(n[Rt]||":%S"),h=e(n[Ke]||"%I:%M"),p=e(n[tt]||"%I %p"),g=e(n[Ge]||n[He]||"%a %d"),m=e(n[ut]||"%b %d"),y=e(n[Oe]||"%B"),b=e(n[En]||"%B"),v=e(n[ve]||"%Y");return x=>(i(x)<x?f:r(x)<x?d:s(x)<x?h:o(x)<x?p:u(x)<x?a(x)<x?g:m:c(x)<x?l(x)<x?y:b:v)(x)}function m3(e){const t=bl(e.format),n=bl(e.utcFormat);return{timeFormat:i=>K(i)?t(i):_w(t,vu,i),utcFormat:i=>K(i)?n(i):_w(n,xu,i),timeParse:bl(e.parse),utcParse:bl(e.utcParse)}}let s1;y3();function y3(){return s1=m3({format:S8,parse:$8,utcFormat:PF,utcParse:C8})}function b3(e){return m3(w8(e))}function Vl(e){return arguments.length?s1=b3(e):s1}const o1=(e,t)=>he({},e,t);function v3(e,t){const n=e?g3(e):Vd(),i=t?b3(t):Vl();return o1(n,i)}function Fb(e,t){const n=arguments.length;return n&&n!==2&&R("defaultLocale expects either zero or two arguments."),n?o1(Vd(e),Vl(t)):o1(Vd(),Vl())}function wP(){return p3(),y3(),Fb()}const SP=/^(data:|([A-Za-z]+:)?\/\/)/,CP=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,$P=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Ow="file://";function FP(e){return t=>({options:t||{},sanitize:DP,load:kP,fileAccess:!1,file:_P(e),http:RP})}async function kP(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t==null?void 0:t.http)}async function DP(e,t){t=he({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=CP.test(e.replace($P,""));(e==null||typeof e!="string"||!a)&&R("Sanitize failure, invalid URI: "+H(e));const u=SP.test(e);return(o=t.baseURL)&&!u&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(Ow))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(Ow.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function _P(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):OP}async function OP(){R("No file system access.")}async function RP(e,t){const n=he({},this.options.http,t),i=t&&t.response,r=await fetch(e,n);return r.ok?de(r[i])?r[i]():r.text():R(r.status+""+r.statusText)}const MP=e=>e!=null&&e===e,TP=e=>e==="true"||e==="false"||e===!0||e===!1,NP=e=>!Number.isNaN(Date.parse(e)),x3=e=>!Number.isNaN(+e)&&!(e instanceof Date),IP=e=>x3(e)&&Number.isInteger(+e),a1={boolean:Ab,integer:nn,number:nn,date:wb,string:Sb,unknown:xn},Af=[TP,IP,x3,NP],LP=["boolean","integer","number","date"];function E3(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Af.length,r=Af.map((s,o)=>o+1);for(let s=0,o=0,a,u;s<n;++s)for(u=t?e[s][t]:e[s],a=0;a<i;++a)if(r[a]&&MP(u)&&!Af[a](u)&&(r[a]=0,++o,o===Af.length))return"string";return LP[r.reduce((s,o)=>s===0?o:s,0)-1]}function A3(e,t){return t.reduce((n,i)=>(n[i]=E3(e,i),n),{})}function Rw(e){const t=function(n,i){const r={delimiter:e};return kb(n,i?he(i,r):r)};return t.responseType="text",t}function kb(e,t){return t.header&&(e=t.header.map(H).join(t.delimiter)+`
8
+ `+e),VI(t.delimiter).parse(e+"")}kb.responseType="text";function PP(e){return typeof Buffer=="function"&&de(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Db(e,t){const n=t&&t.property?Qn(t.property):xn;return Y(e)&&!PP(e)?BP(n(e),t):n(JSON.parse(e))}Db.responseType="json";function BP(e,t){return!N(e)&&OD(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const zP={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function w3(e,t){let n,i,r,s;return e=Db(e,t),t&&t.feature?(n=Z7,r=t.feature):t&&t.mesh?(n=tP,r=t.mesh,s=zP[t.filter]):R("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):R("Invalid TopoJSON object: "+r),i&&i.features||[i]}w3.responseType="json";const Yf={dsv:kb,csv:Rw(","),tsv:Rw(" "),json:Db,topojson:w3};function _b(e,t){return arguments.length>1?(Yf[e]=t,this):Q(Yf,e)?Yf[e]:null}function S3(e){const t=_b(e);return t&&t.responseType||"text"}function C3(e,t,n,i){t=t||{};const r=_b(t.type||"json");return r||R("Unknown data format type: "+t.type),e=r(e,t),t.parse&&UP(e,t.parse,n,i),Q(e,"columns")&&delete e.columns,e}function UP(e,t,n,i){if(!e.length)return;const r=Vl();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,u,l,c,f;t==="auto"&&(t=A3(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!a1[p])throw Error("Illegal format pattern: "+h+":"+p);return a1[p]});for(u=0,c=e.length,f=s.length;u<c;++u)for(o=e[u],l=0;l<f;++l)a=s[l],o[a]=d[l](o[a])}const tp=FP(null);function np(e){const t=e||xn,n=[],i={};return n.add=r=>{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function Kf(e,t){try{await t(e)}catch(n){e.error(n)}}const $3=Symbol("vega_id");let jP=1;function ip(e){return!!(e&&re(e))}function re(e){return e[$3]}function F3(e,t){return e[$3]=t,e}function Fe(e){const t=e===Object(e)?e:{data:e};return re(t)?t:F3(t,jP++)}function Ob(e){return rp(e,Fe({}))}function rp(e,t){for(const n in e)t[n]=e[n];return t}function k3(e,t){return F3(t,re(e))}function jo(e,t){return e?t?(n,i)=>e(n,i)||re(t(n))-re(t(i)):(n,i)=>e(n,i)||re(n)-re(i):null}function D3(e){return e&&e.constructor===qo}function qo(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:qo,insert(a){const u=J(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=de(a)?i:t,l=J(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:Ht(l)};return de(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return de(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return s=a,this},reflow(){return o=!0,this},pulse(a,u){const l={},c={};let f,d,h,p,g,m;for(f=0,d=u.length;f<d;++f)l[re(u[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],l[re(g)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],u.forEach(b=>{p(b)&&(l[re(b)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],m=re(g),l[m]?l[m]=1:a.add.push(Fe(e[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[re(g)]<0&&a.rem.push(g);function y(b,v,x){x?b[v]=x(b):a.encode=v,o||(c[re(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,m=l[re(g)],m>0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,u.forEach(b=>{p(b)&&l[re(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?u.filter(b=>l[re(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const Jf="_:mod:_";function sp(){Object.defineProperty(this,Jf,{writable:!0,value:{}})}sp.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[Jf];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=N(n)?1+n.length:-1),r},modified(e,t){const n=this[Jf];if(arguments.length){if(N(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[Jf]={},this}};let qP=0;const WP="pulse",GP=new sp,HP=1,VP=2;function Le(e,t,n,i){this.id=++qP,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function Mw(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Le.prototype={targets(){return this._targets||(this._targets=np(xc))},set(e){return this.value!==e?(this.value=e,1):0},skip:Mw(HP),modified:Mw(VP),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new sp,r=this._argops=this._argops||[],s=[];let o,a,u,l;const c=(f,d,h)=>{h instanceof Le?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===WP)J(a).forEach(f=>{f instanceof Le?f!==this&&(f.targets().add(this),s.push(f)):R("Pulse parameters must be operator instances.")}),this.source=a;else if(N(a))for(i.set(o,-1,Array(u=a.length)),l=0;l<u;++l)c(o,l,a[l]);else c(o,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),s},marshall(e){const t=this._argval||GP,n=this._argops;let i,r,s,o;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],s=i.op,o=s.modified()&&s.stamp===e,t.set(i.name,i.index,s.value,o);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function XP(e,t,n,i){let r=1,s;return e instanceof Le?s=e:e&&e.prototype instanceof Le?s=new e:de(e)?s=new Le(null,e):(r=0,s=new Le(e,t)),this.rank(s),r&&(i=n,n=t),n&&this.connect(s,s.parameters(n,i)),this.touch(s),s}function YP(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let KP=0;function op(e,t,n){this.id=++KP,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function Jr(e,t,n){return new op(e,t,n)}op.prototype={_filter:Zn,_apply:xn,targets(){return this._targets||(this._targets=np(xc))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=Jr(e);return this.targets().add(t),t},apply(e){const t=Jr(null,e);return this.targets().add(t),t},merge(){const e=Jr();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Jr();return this.targets().add(Jr(null,null,vb(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(Jr(null,null,()=>n=!0)),t.targets().add(Jr(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Zn,this._targets=null}};function JP(e,t,n,i){const r=this,s=Jr(n,i),o=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=J(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,o);return s}function QP(e,t){const n=this.locale();return C3(e,t,n.timeParse,n.utcParse)}function ZP(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function eB(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:S3(t&&t.type)});try{r=n.parse(r,t)}catch(s){i=-2,n.warn("Data ingestion failed",e,s)}}catch(s){i=-1,n.warn("Loading failed",e,s)}return{data:r,status:i}}async function tB(e,t,n){const i=this,r=i._pending||nB(i);r.requests+=1;const s=await i.request(t,n);return i.pulse(e,i.changeset().remove(Zn).insert(s.data||[])),r.done(),s}function nB(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const iB={skip:!0};function rB(e,t,n,i,r){return(e instanceof Le?oB:sB)(this,e,t,n,i,r),this}function sB(e,t,n,i,r,s){const o=he({},s,iB);let a,u;de(n)||(n=Ht(n)),i===void 0?a=l=>e.touch(n(l)):de(i)?(u=new Le(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;D3(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=l=>e.update(n(l),i,o),t.apply(a)}function oB(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new Le(null,aB(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function aB(e,t){return t=de(t)?t:Ht(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function uB(e){e.rank=++this._rank}function lB(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&R("Cycle detected in dataflow graph.")}const Xd={},Bi=1,ts=2,vr=4,cB=Bi|ts,Tw=Bi|vr,oa=Bi|ts|vr,Nw=8,zu=16,Iw=32,Lw=64;function ms(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function r0(e,t){const n=[];return es(e,t,i=>n.push(i)),n}function Pw(e,t){const n={};return e.visit(t,i=>{n[re(i)]=1}),i=>n[re(i)]?null:i}function wf(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}ms.prototype={StopPropagation:Xd,ADD:Bi,REM:ts,MOD:vr,ADD_REM:cB,ADD_MOD:Tw,ALL:oa,REFLOW:Nw,SOURCE:zu,NO_SOURCE:Iw,NO_FIELDS:Lw,fork(e){return new ms(this.dataflow).init(this,e)},clone(){const e=this.fork(oa);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(oa|zu)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new ms(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&Lw)&&(n.fields=e.fields),t&Bi?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&ts?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&vr?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&Iw?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||oa;return t&Bi&&this.add.length||t&ts&&this.rem.length||t&vr&&this.mod.length},reflow(e){if(e)return this.fork(oa).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(vr,Pw(this,Bi))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return N(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?N(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Bi&&(n.addF=wf(n.addF,t)),e&ts&&(n.remF=wf(n.remF,t)),e&vr&&(n.modF=wf(n.modF,t)),e&zu&&(n.srcF=wf(n.srcF,t)),n},materialize(e){e=e||oa;const t=this;return e&Bi&&t.addF&&(t.add=r0(t.add,t.addF),t.addF=null),e&ts&&t.remF&&(t.rem=r0(t.rem,t.remF),t.remF=null),e&vr&&t.modF&&(t.mod=r0(t.mod,t.modF),t.modF=null),e&zu&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&zu)return es(n.source,n.srcF,i),n;e&Bi&&es(n.add,n.addF,i),e&ts&&es(n.rem,n.remF,i),e&vr&&es(n.mod,n.modF,i);const r=n.source;if(e&Nw&&r){const s=n.add.length+n.mod.length;s===r.length||(s?es(r,Pw(n,Tw),i):es(r,n.srcF,i))}return n}};function Rb(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const u in o.fields)a[u]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}V(Rb,ms,{fork(e){const t=new ms(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?N(e)?e.some(i=>n[i]):n[e]:0},filter(){R("MultiPulse does not support filtering.")},materialize(){R("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;s<r;++s)i[s].visit(e,t);else for(;s<r;++s)i[s].stamp===n.stamp&&i[s].visit(e,t);return n}});async function fB(e,t,n){const i=this,r=[];if(i._pulse)return _3(i);if(i._pending&&await i._pending,t&&await Kf(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const s=++i._clock;i._pulse=new ms(i,s,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=np(xc);let o=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Xd),u!==Xd&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await Kf(i,c[f].callback)}return n&&await Kf(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function dB(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function hB(e,t,n){return this._pulse?_3(this):(this.evaluate(e,t,n),this)}function pB(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function _3(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function gB(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function mB(e,t){const n=e.source,i=this._clock;return n&&N(n)?new Rb(this,i,n.map(r=>r.pulse),t):this._input[e.id]||yB(this._pulse,n&&n.pulse)}function yB(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Xd&&(e.source=t.source),e)}const Mb={skip:!1,force:!1};function bB(e,t){const n=t||Mb;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function vB(e,t,n){const i=n||Mb;return(e.set(t)||i.force)&&this.touch(e,i),this}function xB(e,t,n){this.touch(e,n||Mb);const i=new ms(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function EB(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),O3(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,AB(t,0,e)):i=n,i}}}function O3(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function AB(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o<r;)a=o+1,a<r&&n(e[o],e[a])>=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,O3(e,i,t,n)}function $a(){this.logger(Xh()),this.logLevel(hb),this._clock=0,this._rank=0,this._locale=Fb();try{this._loader=tp()}catch{}this._touched=np(xc),this._input={},this._pulse=null,this._heap=EB((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Uu(e){return function(){return this._log[e].apply(this,arguments)}}$a.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:Uu("error"),warn:Uu("warn"),info:Uu("info"),debug:Uu("debug"),logLevel:Uu("level"),cleanThreshold:1e4,add:XP,connect:YP,rank:uB,rerank:lB,pulse:xB,touch:bB,update:vB,changeset:qo,ingest:ZP,parse:QP,preload:tB,request:eB,events:JP,on:rB,evaluate:fB,run:hB,runAsync:dB,runAfter:pB,_enqueue:gB,_getPulse:mB};function O(e,t){Le.call(this,e,null,t)}V(O,Le,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const za={};function R3(e){const t=M3(e);return t&&t.Definition||null}function M3(e){return e=e&&e.toLowerCase(),Q(za,e)?za[e]:null}function*T3(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function Tb(e,t,n){const i=Float64Array.from(T3(e,n));return i.sort(Ul),t.map(r=>ZF(i,r))}function Nb(e,t){return Tb(e,[.25,.5,.75],t)}function Ib(e,t){const n=e.length,i=_9(e,t),r=Nb(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function N3(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,u,l,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=s<c?c-a:c,o=Math.ceil(o/a)*a),{start:s,stop:o===s?s+a:o,step:a}}var ei=Math.random;function wB(e){ei=e}function I3(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(T3(e,i)),s=r.length,o=t;let a,u,l,c;for(l=0,c=Array(o);l<o;++l){for(a=0,u=0;u<s;++u)a+=r[~~(ei()*s)];c[l]=a/s}return c.sort(Ul),[$m(c,n/2),$m(c,1-n/2)]}function L3(e,t,n,i){i=i||(d=>d);const r=e.length,s=new Float64Array(r);let o=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;o<a;++o)s[o]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;o<a;++o)s[o]=l;return n?SB(s,t+t/4):s}function SB(e,t){const n=e.length;let i=0,r=1,s,o;for(;e[i]===e[r];)++r;for(;r<n;){for(s=r+1;e[r]===e[s];)++s;if(e[r]-e[r-1]<t){for(o=r+(i+s-r-r>>1);o<r;)e[o++]=e[r];for(;o>r;)e[o--]=e[i]}i=r,r=s}return e}function CB(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function $B(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*ei())},pdf(o){return o===Math.floor(o)&&o>=n&&o<i?1/r:0},cdf(o){const a=Math.floor(o);return a<n?0:a>=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const P3=Math.sqrt(2*Math.PI),FB=Math.SQRT2;let ju=NaN;function ap(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(ju===ju)n=ju,ju=NaN;else{do n=ei()*2-1,i=ei()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,ju=i*s}return e+n*t}function Lb(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*P3)}function up(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function lp(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*FB*kB(2*e-1)}function kB(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function Pb(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>ap(n,i),pdf:s=>Lb(s,n,i),cdf:s=>up(s,n,i),icdf:s=>lp(s,n,i)};return r.mean(e).stdev(t)}function Bb(e,t){const n=Pb();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=Ib(e)),r):t},sample(){return e[~~(ei()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;a<i;++a)o+=n.pdf((s-e[a])/t);return o/t/i},cdf(s){let o=0,a=0;for(;a<i;++a)o+=n.cdf((s-e[a])/t);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function zb(e,t){return e=e||0,t=t??1,Math.exp(e+ap()*t)}function Ub(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*P3*e)}function jb(e,t,n){return up(Math.log(e),t,n)}function qb(e,t,n){return Math.exp(lp(e,t,n))}function B3(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>zb(n,i),pdf:s=>Ub(s,n,i),cdf:s=>jb(s,n,i),icdf:s=>qb(s,n,i)};return r.mean(e).stdev(t)}function z3(e,t){let n=0,i;function r(o){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=o[l]==null?1:+o[l];for(l=0;l<n;++l)a[l]/=u;return a}const s={weights(o){return arguments.length?(i=r(t=o||[]),s):t},distributions(o){return arguments.length?(o?(n=o.length,e=o):(n=0,e=[]),s.weights(t)):e},sample(){const o=ei();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(o<u){a=e[l];break}return a.sample()},pdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(o);return a},cdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(o);return a},icdf(){throw Error("Mixture icdf not supported.")}};return s.distributions(e).weights(t)}function Wb(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*ei()}function Gb(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Hb(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Vb(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function U3(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>Wb(n,i),pdf:s=>Gb(s,n,i),cdf:s=>Hb(s,n,i),icdf:s=>Vb(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function Xb(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function Ec(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function cp(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)s[a]-=u,o[a]-=l;return[s,o,u,l]}function Ac(e,t,n,i){let r=-1,s,o;for(const a of e)s=t(a),o=n(a),s!=null&&(s=+s)>=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function Eu(e,t,n,i,r){let s=0,o=0;return Ac(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;s+=l*l,o+=c*c}),1-s/o}function Yb(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ac(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=Ec(i,r,s,o),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Eu(e,t,n,r,l)}}function j3(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ac(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=Ec(i,r,s,o),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Eu(e,t,n,r,l)}}function q3(e,t,n){const[i,r,s,o]=cp(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;Ac(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=Ec(u/o,a/o,l/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:Eu(e,t,n,o,y)}}function W3(e,t,n){let i=0,r=0,s=0,o=0,a=0,u=0;Ac(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,s+=(h*p-s)/u,o+=(h*h-o)/u,a+=(d-a)/u});const l=Ec(i,r,s,o),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Eu(e,t,n,a,c)}}function Kb(e,t,n){const[i,r,s,o]=cp(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h<a;)p=i[h],g=r[h++],m=p*p,u+=(m-u)/h,l+=(m*p-l)/h,c+=(m*m-c)/h,f+=(p*g-f)/h,d+=(m*g-d)/h;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,x=(f*y-d*l)/b,E=-v*u,w=A=>(A=A-s,v*A*A+x*A+E+o);return{coef:[E-x*s+v*s*s+o,x-2*v*s,v],predict:w,rSquared:Eu(e,t,n,o,w)}}function G3(e,t,n,i){if(i===0)return Xb(e,t,n);if(i===1)return Yb(e,t,n);if(i===2)return Kb(e,t,n);const[r,s,o,a]=cp(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d)*s[p];for(l.push(g),m=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d+h);m[h]=g}c.push(m)}c.push(l);const y=_B(c),b=v=>{v-=o;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)x+=y[d]*Math.pow(v,d);return x};return{coef:DB(f,y,-o,a),predict:b,rSquared:Eu(e,t,n,a,b)}}function DB(e,t,n,i){const r=Array(e);let s,o,a,u;for(s=0;s<e;++s)r[s]=0;for(s=e-1;s>=0;--s)for(a=t[s],u=1,r[s]+=a,o=1;o<=s;++o)u*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*u;return r[0]+=i,r}function _B(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;i<t;++i){for(o=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][o])&&(o=r);for(s=i;s<t+1;++s)a=e[s][i],e[s][i]=e[s][o],e[s][o]=a;for(r=i+1;r<t;++r)for(s=t;s>=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;s<t;++s)a+=e[s][r]*n[s];n[r]=(e[t][r]-a)/e[r][r]}return n}const Bw=2,zw=1e-12;function H3(e,t,n,i){const[r,s,o,a]=cp(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=Bw;){const p=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=p[0],v=p[1],x=y-r[b]>r[v]-y?b:v;let E=0,w=0,A=0,C=0,S=0;const F=1/Math.abs(r[x]-y||1);for(let U=b;U<=v;++U){const _=r[U],$=s[U],D=OB(Math.abs(y-_)*F)*d[U],I=_*D;E+=D,w+=I,A+=$*D,C+=$*I,S+=_*I}const[k,P]=Ec(w/E,A/E,C/E,S/E);c[m]=k+P*y,f[m]=Math.abs(s[m]-c[m]),RB(r,m+1,p)}if(h===Bw)break;const g=ek(f);if(Math.abs(g)<zw)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*g),d[m]=y>=1?zw:(b=1-y*y)*b}return MB(r,c,o,a)}function OB(e){return(e=1-e*e*e)*e*e}function RB(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function MB(e,t,n,i){const r=e.length,s=[];let o=0,a=0,u=[],l;for(;o<r;++o)l=e[o]+n,u[0]===l?u[1]+=(t[o]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[o]],s.push(u));return u[1]+=i,s}const TB=.5*Math.PI/180;function fp(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=g=>[g,e(g)],s=t[0],o=t[1],a=o-s,u=a/i,l=[r(s)],c=[];if(n===i){for(let g=1;g<i;++g)l.push(r(s+g/n*a));return l.push(r(o)),l}else{c.push(r(o));for(let g=n;--g>0;)c.push(r(s+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=NB(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&IB(f,g,d,h,p)>TB?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function NB(e,t){let n=e,i=e;const r=t.length;for(let s=0;s<r;++s){const o=t[s][1];o<n&&(n=o),o>i&&(i=o)}return 1/(i-n)}function IB(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function LB(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function u1(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:LB(e)}function V3(e,t,n){return n||e+(t?"_"+t:"")}const s0=()=>{},PB={init:s0,add:s0,rem:s0,idx:0},Xl={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?Math.max(0,e.dev)/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid?Math.max(0,e.dev)/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(Math.max(0,e.dev)/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid?Math.sqrt(Math.max(0,e.dev)/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(Math.max(0,e.dev)/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},wc=Object.keys(Xl).filter(e=>e!=="__count__");function BB(e,t){return(n,i)=>he({name:e,aggregate_param:i,out:n||e},PB,t)}[...wc,"__count__"].forEach(e=>{Xl[e]=BB(e,Xl[e])});function X3(e,t,n){return Xl[e](n,t)}function Y3(e,t){return e.idx-t.idx}function zB(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=Xl[r]())})};return e.forEach(n),Object.values(t).sort(Y3)}function UB(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function jB(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function qB(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function WB(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function K3(e,t){const n=t||xn,i=zB(e),r=e.slice().sort(Y3);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=UB,s.prototype.add=jB,s.prototype.rem=qB,s.prototype.set=WB,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function Jb(e){this._key=e?Qn(e):re,this.reset()}const Tt=Jb.prototype;Tt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Tt.add=function(e){this._add.push(e)};Tt.rem=function(e){this._rem.push(e)};Tt.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,u,l;for(a=0;a<r;++a)o[n(t[a])]=1;for(a=0,u=0;a<i;++a)o[n(l=e[a])]?o[n(l)]=0:s[u++]=l;return this._rem=[],this._add=s};Tt.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,s;for(;--i>=0;)s=e(t[i])+"",Q(n,s)||(n[s]=1,++r);return r};Tt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=DD(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Tt.argmin=function(e){return this.extent(e)[0]||{}};Tt.argmax=function(e){return this.extent(e)[1]||{}};Tt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Tt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Tt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=Nb(this.values(),e),this._get=e),this._q};Tt.q1=function(e){return this.quartile(e)[0]};Tt.q2=function(e){return this.quartile(e)[1]};Tt.q3=function(e){return this.quartile(e)[2]};Tt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=I3(this.values(),1e3,.05,e),this._get=e),this._ci};Tt.ci0=function(e){return this.ci(e)[0]};Tt.ci1=function(e){return this.ci(e)[1]};function Es(e){O.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Es.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:wc},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};V(Es,O,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}s(e._prev),s(t);function o(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?o(h,u,l):t[h]||e.cell(h,u)}}o("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=J(zt(b)),x=v.length;let E=0,w;for(;E<x;++E)i[w=v[E]]||(i[w]=1,t.push(w))}this._dims=J(e.groupby),this._dnames=this._dims.map(b=>{const v=it(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:u1(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,h,p,g,m,y;for(l!==o.length&&R("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=s[y],d=o[y],h=a[y]||null,f==null&&d!=="count"&&R("Null aggregate field specified."),g=it(f),m=V3(d,g,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}p=c[g],p||(r(f),p=c[g]=[],p.field=f,this._measures.push(p)),d!=="count"&&(this._countOnly=!1),p.push(X3(d,h,m))}return this._measures=this._measures.map(b=>K3(b,b.field)),Object.create(null)},cellkey:u1(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let s=0;s<r;++s)n.agg[s]=new i[s](n)}return n.store&&(n.data=new Jb),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,s={};for(let o=0;o<r;++o)s[n[o]]=i[o](e);return t?k3(t.tuple,s):Fe(s)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,s=i.length;r<s;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,s=e.add,o=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&o.push(u.tuple);for(c=0,f=this._alen;c<f;++c)s.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?o:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const GB=1e-14;function Qb(e){O.call(this,null,e)}Qb.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};V(Qb,O,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,s=i.step,o=e.as||["bin0","bin1"],a=o[0],u=o[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(zt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=N3(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const u=function(l){let c=nn(t(l));return c==null?null:c<r?-1/0:c>s?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(GB+(c-r)/i))};return u.start=r,u.stop=s,u.step=i,this.value=Cn(u,zt(t),e.name||"bin_"+it(t))}});function J3(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:u=>s.push(u),remove:u=>o[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),l&&u&&r.sort(u),s.length&&(r=u?TD(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function Zb(e){O.call(this,[],e)}Zb.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};V(Zb,O,{transform(e,t){const n=t.fork(t.ALL),i=J3(re,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(jo(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function Q3(e){Le.call(this,null,HB,e)}V(Q3,Le);function HB(e){return this.value&&!e.modified()?this.value:bb(e.fields,e.orders)}function ev(e){O.call(this,null,e)}ev.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function VB(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}V(ev,O,{transform(e,t){const n=f=>d=>{for(var h=VB(a(d),e.case,s)||[],p,g=0,m=h.length;g<m;++g)o.test(p=h[g])||f(p)},i=this._parameterCheck(e,t),r=this._counts,s=this._match,o=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=Fe({}),u[r]=a,u[s]=l,o.add.push(u)):l===0?(u&&o.rem.push(u),n[a]=null,i[a]=null):u[s]!==l&&(u[s]=l,o.mod.push(u));return o.modifies(t)}});function tv(e){O.call(this,null,e)}tv.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};V(tv,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=XB(a,r,s,e.filter||Zn)):n.mod=a,n.source=this.value,n.modifies(i)}});function XB(e,t,n,i){for(var r=[],s={},o=e.length,a=0,u,l;a<o;++a)for(s[t]=l=e[a],u=0;u<o;++u)s[n]=e[u],i(s)&&(r.push(Fe(s)),s={},s[t]=l);return r}const Uw={kde:Bb,mixture:z3,normal:Pb,lognormal:B3,uniform:U3},YB="distributions",jw="function",KB="field";function Z3(e,t){const n=e[jw];Q(Uw,n)||R("Unknown distribution function: "+n);const i=Uw[n]();for(const r in e)r===KB?i.data((e.from||t()).map(e[r])):r===YB?i[r](e[r].map(s=>Z3(s,t))):typeof i[r]===jw&&i[r](e[r]);return i}function nv(e){O.call(this,null,e)}const e_=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],JB={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:e_},{name:"weights",type:"number",array:!0}]};nv.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:e_.concat(JB)},{name:"as",type:"string",array:!0,default:["value","density"]}]};V(nv,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=Z3(e.distribution,QB(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&R("Invalid density method: "+o),!e.extent&&!i.data&&R("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],u=e.extent||Ji(i.data()),l=fp(o,u,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Fe(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function QB(e){return()=>e.materialize(e.SOURCE).source}function t_(e,t){return e?e.map((n,i)=>t[i]||it(n)):null}function iv(e,t,n){const i=[],r=f=>f(u);let s,o,a,u,l,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;o<a;++o)u=e[o],l=t.map(r),c=s[l],c||(s[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const n_="bin";function rv(e){O.call(this,null,e)}rv.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:n_}]};const ZB=(e,t)=>Jh(Ji(e,t))/30;V(rv,O,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=iv(t.source,e.groupby,xn),r=e.smooth||!1,s=e.field,o=e.step||ZB(n,s),a=jo((p,g)=>s(p)-s(g)),u=e.as||n_,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const p=i[d].sort(a);h=-1;for(const g of L3(p,o,r,s))g<c&&(c=g),g>f&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(u)}});function i_(e){Le.call(this,null,ez,e),this.modified(!0)}V(i_,Le);function ez(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Cn(n=>t(n,e),zt(t),it(t))}function sv(e){O.call(this,[void 0,void 0],e)}sv.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};V(sv,O,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=nn(i(a));u!=null&&(u<s&&(s=u),u>o&&(o=u))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=it(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function ov(e,t){Le.call(this,e),this.parent=t,this.count=0}V(ov,Le,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function dp(e){O.call(this,{},e),this._keys=bu();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}V(dp,O,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let s=Q(r,e)&&r[e],o,a;return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[e])&&a.tuple,o=n.dataflow,s=new ov(n.fork(n.NO_SOURCE),this),o.add(s).connect(t(o,e,a)),r[e]=s,this.activate(s)),s},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,s=this._keys,o=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=re(u),c=s.get(l);c!==void 0&&(s.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(re(u),l),a(l).add(u)}),o||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=re(u),c=s.get(l),f=i(u);c===f?a(f).mod(u):(s.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(s.get(re(u))).mod(u)}),o&&t.visit(t.REFLOW,u=>{const l=re(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function r_(e){Le.call(this,null,tz,e)}V(r_,Le);function tz(e){return this.value&&!e.modified()?this.value:N(e.name)?J(e.name).map(t=>Qn(t)):Qn(e.name,e.as)}function av(e){O.call(this,bu(),e)}av.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};V(av,O,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=re(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(re(f),1)});function c(f){const d=re(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function uv(e){O.call(this,[],e)}uv.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};V(uv,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=t_(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=Ob(a),f=0;f<o;++f)d[r[f]]=(h=u[f][c])==null?null:h;s&&(d[s]=c),n.add.push(d)}}),this.value=n.source=n.add,s&&n.modifies(s),n.modifies(r)}});function lv(e){O.call(this,[],e)}lv.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};V(lv,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(it),s=e.as||["key","value"],o=s[0],a=s[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=Ob(l),f[o]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(s)}});function cv(e){O.call(this,null,e)}cv.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};V(cv,O,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),s=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(s,o=>o[i]=n(o,e))}});function s_(e){O.call(this,[],e)}V(s_,O,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,u;if(s>0){for(o=[];--s>=0;)o.push(u=Fe(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const Sf={value:"value",median:ek,mean:M9,min:Em,max:ao},nz=[];function fv(e){O.call(this,[],e)}fv.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function iz(e){var t=e.method||Sf.value,n;if(Sf[t]==null)R("Unrecognized imputation method: "+t);else return t===Sf.value?(n=e.value!==void 0?e.value:0,()=>n):Sf[t]}function rz(e){const t=e.field;return n=>n?t(n):NaN}V(fv,O,{transform(e,t){var n=t.fork(t.ALL),i=iz(e),r=rz(e),s=it(e.field),o=it(e.key),a=(e.groupby||[]).map(it),u=sz(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,v,x,E;for(m=0,v=u.length;m<v;++m)for(d=u[m],p=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(g=u.domain[b],E={_impute:!0},y=0,x=p.length;y<x;++y)E[a[y]]=p[y];E[o]=g,E[s]=Number.isNaN(h)?h=i(d,r):h,l.push(Fe(E))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function sz(e,t,n,i){var r=y=>y(m),s=[],o=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;d<g;++d)m=e[d],p=n(m),h=a[p]||(a[p]=o.push(p)),c=(l=t?t.map(r):nz)+"",(f=u[c])||(f=u[c]=[],s.push(f),f.values=l),f[h-1]=m;return s.domain=o,s}function dv(e){Es.call(this,e)}dv.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:wc},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};V(dv,Es,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,s=>n.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{he(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function hv(e){O.call(this,null,e)}hv.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};V(hv,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=iv(i,e.groupby,e.field),s=(e.groupby||[]).map(it),o=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&R("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=Ji(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const p=Bb(h,o)[a],g=e.counts?h.length:1,m=c||Ji(h);fp(p,m,f,d).forEach(y=>{const b={};for(let v=0;v<s.length;++v)b[s[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*g,l.push(Fe(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function o_(e){Le.call(this,null,oz,e)}V(o_,Le);function oz(e){return this.value&&!e.modified()?this.value:Eb(e.fields,e.flat)}function a_(e){O.call(this,[],e),this._pending=null}V(a_,O,{transform(e,t){const n=t.dataflow;return this._pending?o0(this,t,this._pending):az(e)?t.StopPropagation:e.values?o0(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=J(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>o0(this,t,J(i.data)))}});function az(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function o0(e,t,n){n.forEach(Fe);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function pv(e){O.call(this,{},e)}pv.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};V(pv,O,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let u=o?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&R('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&R('The "as" parameter has too few output field names.'),c=c||r.map(it),f=function(p){for(var g=0,m=0,y,b;g<a;++g)if(b=i.get(n[g](p)),b==null)for(y=0;y<d;++y,++m)p[c[m]]=s;else for(y=0;y<d;++y,++m)p[c[m]]=r[y](b)}):(c||R("Missing output field names."),f=function(p){for(var g=0,m;g<a;++g)m=i.get(n[g](p)),p[c[g]]=m??s}),o?l=t.reflow(!0):(h=n.some(p=>t.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function u_(e){Le.call(this,null,uz,e)}V(u_,Le);function uz(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;s<n;++s)o=t[s],o[0]<i&&(i=o[0]),o[1]>r&&(r=o[1]);return[i,r]}function l_(e){Le.call(this,null,lz,e)}V(l_,Le);function lz(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function c_(e){O.call(this,null,e)}V(c_,O,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function gv(e){Es.call(this,e)}gv.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:wc,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};V(gv,Es,{_transform:Es.prototype.transform,transform(e,t){return this._transform(cz(e,t),t)}});function cz(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=zt(n).concat(zt(i)),o=dz(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>fz(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function fz(e,t,n,i){return Cn(r=>t(r)===e?n(r):NaN,i,e+"")}function dz(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(yu),t?r.slice(0,t):r}function f_(e){dp.call(this,e)}V(f_,dp,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(re(s),n,t,s);return(e.modified("field")||i&&t.modified(zt(i)))&&R("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(Fe(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function mv(e){O.call(this,null,e)}mv.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};V(mv,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=t_(e.fields,e.as||[]),s=i?(a,u)=>hz(a,u,i,r):rp;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const u=re(a);n.rem.push(o[u]),o[u]=null}),t.visit(t.ADD,a=>{const u=s(a,Fe({}));o[re(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[re(a)]))}),n}});function hz(e,t,n,i){for(let r=0,s=n.length;r<s;++r)t[i[r]]=n[r](e);return t}function d_(e){O.call(this,null,e)}V(d_,O,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function yv(e){O.call(this,null,e)}yv.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const pz=1e-14;V(yv,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,s=iv(r,e.groupby,e.field),o=(e.groupby||[]).map(it),a=[],u=e.step||.01,l=e.probs||On(u/2,1-pz,u),c=l.length;return s.forEach(f=>{const d=Tb(f,l);for(let h=0;h<c;++h){const p={};for(let g=0;g<o.length;++g)p[o[g]]=f.dims[g];p[i[0]]=l[h],p[i[1]]=d[h],a.push(Fe(p))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function h_(e){O.call(this,null,e)}V(h_,O,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const s=re(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=Ob(r);i[re(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[re(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function bv(e){O.call(this,[],e),this.count=0}bv.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};V(bv,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[re(f)]=1,c),{});let o=this.value,a=this.count,u=0;function l(c){let f,d;o.length<r?o.push(c):(d=~~((a+1)*ei()),d<o.length&&d>=u&&(f=o[d],s[re(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=re(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[re(c)]!==-1)),(t.rem.length||i)&&o.length<r&&t.source&&(u=a=o.length,t.visit(t.SOURCE,c=>{s[re(c)]||l(c)}),u=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f<c;++f)s[re(o[f])]=-1,n.rem.push(o[f]);o=o.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{s[re(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=o.filter(c=>!s[re(c)])),this.count=a,this.value=n.source=o,n}});function vv(e){O.call(this,null,e)}vv.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};V(vv,O,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=On(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,Fe(s)}),n.add=t.add.concat(this.value),n}});function p_(e){O.call(this,null,e),this.modified(!0)}V(p_,O,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function xv(e){O.call(this,null,e)}const g_=["unit0","unit1"];xv.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Cb,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"inferUnits",type:"boolean",default:!1},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:g_}]};V(xv,O,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?xu:vu)(s.unit).offset,a=e.as||g_,u=a[0],l=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(zt(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=s(g),i&&(p[l]=y=o(m,c)),m<f&&(f=m),y>d&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc";e.inferUnits&&(e.units||e.step!=null||e.maxbins!=null||e.extent)&&t.dataflow.warn("TimeUnit inferUnits overrides units, step, maxbins and extent.");const{units:i,step:r}=e.inferUnits?d3(t.materialize(t.SOURCE).source,e.field,n):e.units?{units:e.units,step:e.step||1}:f3({extent:e.extent||Ji(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=$b(i),o=this.value||{},a=(n?n3:t3)(s,r);return a.unit=ye(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function m_(e){O.call(this,bu(),e)}V(m_,O,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function y_(e){O.call(this,null,e)}V(y_,O,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(jo(e.sort)):t.source).map(e.field))}});function gz(e,t,n,i){const r=Yl[e](t,n);return{init:r.init||rs,update:function(s,o){o[i]=r.next(s)}}}const Yl={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=Yl.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||R("ntile num must be greater than zero.");const n=Yl.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||R("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=mz(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function mz(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const yz=Object.keys(Yl);function b_(e){const t=J(e.ops),n=J(e.fields),i=J(e.params),r=J(e.aggregate_params),s=J(e.as),o=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(p){J(zt(p)).forEach(g=>u[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=it(m),x=V3(p,v,s[g]);if(h(m),o.push(x),Q(Yl,p))a.push(gz(p,m,y,x));else{if(m==null&&p!=="count"&&R("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(X3(p,b,x))}}),(c.length||f.length)&&(this.cell=bz(f,c,d)),this.inputs=Object.keys(u)}const v_=b_.prototype;v_.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};v_.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;o<e.i0;++o)n.rem(r[o]);for(o=e.p1;o<e.i1;++o)n.add(r[o]);n.set(t)}for(o=0;o<s;++o)i[o].update(e,t)};function bz(e,t,n){e=e.map(u=>K3(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;o<r;++o)s[o]=new e[o](i);if(i.store)var a=i.data=new Jb;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)s[l].add(s[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)s[l].rem(s[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=s.length;l<c;++l)s[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)s[u].init()},i}function Ev(e){O.call(this,{},e),this._mlen=0,this._mods=[]}Ev.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:yz.concat(wc)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};V(Ev,O,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=jo(e.sort),r=u1(e.groupby),s=a=>this.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new b_(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)vz(this._mods[a],o,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(o.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=J3(re),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function vz(e,t,n,i){const r=i.sort,s=r&&!i.ignorePeers,o=i.frame||[null,0],a=e.data(n),u=a.length,l=s?Iy(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||Ht(-1)};t.init();for(let f=0;f<u;++f)xz(c,o,f,u),s&&Ez(c,l),t.update(c,a[f])}function qw(e,t,n){return e<t?t:e>n?n:e}function xz(e,t,n,i){e.p0=e.i0,e.p1=e.i1;const r=t[0]==null?0:n+t[0],s=t[1]==null?i:n+t[1]+1;e.i0=qw(r,0,i),e.i1=qw(s,0,i),e.index=n}function Ez(e,t){const n=e.i0,i=e.i1-1,r=e.compare,s=e.data,o=s.length-1;n>0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i<o&&!r(s[i],s[i+1])&&(e.i1=t.right(s,s[i]))}const Az=Object.freeze(Object.defineProperty({__proto__:null,aggregate:Es,bin:Qb,collect:Zb,compare:Q3,countpattern:ev,cross:tv,density:nv,dotbin:rv,expression:i_,extent:sv,facet:dp,field:r_,filter:av,flatten:uv,fold:lv,formula:cv,generate:s_,impute:fv,joinaggregate:dv,kde:hv,key:o_,load:a_,lookup:pv,multiextent:u_,multivalues:l_,params:c_,pivot:gv,prefacet:f_,project:mv,proxy:d_,quantile:yv,relay:h_,sample:bv,sequence:vv,sieve:p_,subflow:ov,timeunit:xv,tupleindex:m_,values:y_,window:Ev},Symbol.toStringTag,{value:"Module"}));function ys(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const wz=()=>typeof Image<"u"?Image:null;function Av(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const Sz="identity",Ua="linear",Tr="log",Sc="pow",Cc="sqrt",hp="symlog",xo="time",Eo="utc",Hi="sequential",Au="diverging",ja="quantile",pp="quantize",gp="threshold",Yd="ordinal",l1="point",x_="band",wv="bin-ordinal",bt="continuous",$c="discrete",Fc="discretizing",ii="interpolating",Sv="temporal";function Cz(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function $z(e){return function(t){const n=e.range();let i=t[0],r=t[1],s=-1,o,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(s<0&&(s=u),o=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Cv(){const e=YF().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],p=Av(f,a,u);let g=i[d-0];r=(h-g)/(p||1),o&&(r=Math.floor(r)),g+=(h-g-r*(f-a))*l,s=r*(1-a),o&&(g=Math.round(g),s=Math.round(s));const m=On(f).map(y=>g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),p=h.length-1;let g=+f[0],m=+f[1],y,b,v;if(!(g!==g||m!==m)&&(m<g&&(v=g,g=m,m=v),!(m<h[0]||g>i[1-d])))return y=Math.max(0,Ta(h,g)-1),b=g===m?y:Ta(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Cv().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(u).align(l)},c()}function E_(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return E_(t())},e}function Fz(){return E_(Cv().paddingInner(1))}var kz=Array.prototype.map;function Dz(e){return kz.call(e,nn)}const _z=Array.prototype.slice;function A_(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Ta(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=Dz(i),n):e.slice()},n.range=function(i){return arguments.length?(t=_z.call(i),n):t.slice()},n.tickFormat=function(i,r){return f8(e[0],ye(e),i??10,r)},n.copy=function(){return A_().domain(n.domain()).range(n.range())},n}const Kd=new Map,w_=Symbol("vega_scale");function S_(e){return e[w_]=!0,e}function Ww(e){return e&&e[w_]===!0}function Oz(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?Cz(s):s.invertExtent?$z(s):void 0),s.type=e,S_(s)};return i.metadata=vi(J(n)),i}function $e(e,t,n){return arguments.length>1?(Kd.set(e,Oz(e,t,n)),this):C_(e)?Kd.get(e):void 0}$e(Sz,Zk);$e(Ua,c8,bt);$e(Tr,eD,[bt,Tr]);$e(Sc,ub,bt);$e(Cc,A7,bt);$e(hp,tD,bt);$e(xo,F8,[bt,Sv]);$e(Eo,w7,[bt,Sv]);$e(Hi,lb,[bt,ii]);$e(`${Hi}-${Ua}`,lb,[bt,ii]);$e(`${Hi}-${Tr}`,sD,[bt,ii,Tr]);$e(`${Hi}-${Sc}`,cb,[bt,ii]);$e(`${Hi}-${Cc}`,S7,[bt,ii]);$e(`${Hi}-${hp}`,oD,[bt,ii]);$e(`${Au}-${Ua}`,aD,[bt,ii]);$e(`${Au}-${Tr}`,uD,[bt,ii,Tr]);$e(`${Au}-${Sc}`,fb,[bt,ii]);$e(`${Au}-${Cc}`,C7,[bt,ii]);$e(`${Au}-${hp}`,lD,[bt,ii]);$e(ja,nD,[Fc,ja]);$e(pp,iD,Fc);$e(gp,rD,Fc);$e(wv,A_,[$c,Fc]);$e(Yd,YF,$c);$e(x_,Cv,$c);$e(l1,Fz,$c);function C_(e){return Kd.has(e)}function Wo(e,t){const n=Kd.get(e);return n&&n.metadata[t]}function $v(e){return Wo(e,bt)}function qa(e){return Wo(e,$c)}function c1(e){return Wo(e,Fc)}function Fv(e){return Wo(e,Tr)}function $_(e){return Wo(e,Sv)}function F_(e){return Wo(e,ii)}function k_(e){return Wo(e,ja)}const Rz=["clamp","base","constant","exponent"];function D_(e,t){const n=t[0],i=ye(t)-n;return function(r){return e(n+r*i)}}function mp(e,t,n){return Wy(kv(t||"rgb",n),e)}function __(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function O_(e,t,n){const i=n-t;let r,s,o;return!i||!Number.isFinite(i)?Ht(.5):(r=(s=e.type).indexOf("-"),s=r<0?s:s.slice(r+1),o=$e(s)().domain([t,n]).range([0,1]),Rz.forEach(a=>e[a]?o[a](e[a]()):0),o)}function kv(e,t){const n=J9[Mz(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function Mz(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const Tz={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},Nz={accent:F7,category10:$7,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:k7,observable10:D7,paired:_7,pastel1:O7,pastel2:R7,set1:M7,set2:T7,set3:N7,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function R_(e){if(N(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function M_(e,t){for(const n in e)Dv(n,t(e[n]))}const Gw={};M_(Nz,R_);M_(Tz,e=>mp(R_(e)));function Dv(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Gw[e]=t,this):Gw[e]}const Qf="symbol",Iz="discrete",Lz="gradient",Pz=e=>N(e)?e.map(t=>String(t)):String(e),Bz=(e,t)=>e[1]-t[1],zz=(e,t)=>t[1]-e[1];function _v(e,t,n){let i;if(Ce(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null)){const r=e.domain(),s=Math.min(r[0],ye(r)),o=Math.max(r[0],ye(r));if(t=Math.min(t,Math.floor((o-s)/n||1)+1),!e.bins&&!Fv(e.type)&&!$_(e.type)&&s<o)for(;t>1&&Na(s,o,t)<n;)--t}return Y(t)&&(i=t.step,t=t.interval),K(t)&&(t=e.type===xo?vu(t):e.type==Eo?xu(t):R("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function T_(e,t,n){let i=e.range(),r=i[0],s=ye(i),o=Bz;if(r>s&&(i=s,s=r,r=i,o=zz),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],ye(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function Ov(e,t){return e.bins?T_(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function N_(e,t,n,i,r,s){const o=t.type;let a=Pz;if(o===xo||r===xo)a=e.timeFormat(i);else if(o===Eo||r===Eo)a=e.utcFormat(i);else if(Fv(o)){const u=e.formatFloat(i);if(s||t.bins)a=u;else{const l=I_(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function I_(e,t,n){const i=Ov(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r<r-.5&&(l*=r),l<=o};return n?i.filter(a):a}const f1={[ja]:"quantiles",[pp]:"thresholds",[gp]:"domain"},L_={[ja]:"quantiles",[pp]:"domain"};function P_(e,t){return e.bins?qz(e.bins):e.type===Tr?I_(e,t,!0):f1[e.type]?jz(e[f1[e.type]]()):Ov(e,t)}function Uz(e,t,n){const i=t[L_[t.type]](),r=i.length;let s=r>1?i[1]-i[0]:i[0],o;for(o=1;o<r;++o)s=Math.min(s,i[o]-i[o-1]);return e.formatSpan(0,s,3*10,n)}function jz(e){const t=[-1/0].concat(e);return t.max=1/0,t}function qz(e){const t=e.slice(0,-1);return t.max=ye(e),t}const Wz=e=>f1[e.type]||e.bins;function B_(e,t,n,i,r,s,o){const a=L_[t.type]&&s!==xo&&s!==Eo?Uz(e,t,r):N_(e,t,n,r,s,o);return i===Qf&&Wz(t)?Gz(a):i===Iz?Hz(a):Vz(a)}const Gz=e=>(t,n,i)=>{const r=Hw(i[n+1],Hw(i.max,1/0)),s=Vw(t,e),o=Vw(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},Hw=(e,t)=>e??t,Hz=e=>(t,n)=>n?e(t):null,Vz=e=>t=>e(t),Vw=(e,t)=>Number.isFinite(e)?t(e):null;function Xz(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+ye(t),s=r-i;if(e.type===gp){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function Yz(e,t,n,i){const r=i||t.type;return K(n)&&$_(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===xo?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Eo?e.utcFormat("%A, %d %B %Y, %X UTC"):B_(e,t,5,null,n,i,!0)}function z_(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=Yz(e,t,n.format,n.formatType);if(c1(t.type)){const s=P_(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(qa(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(ye(s))}`}}let U_=0;function Kz(){U_=0}const Jd="p_";function Rv(e){return e&&e.gradient}function j_(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?Jd:"";return r||(r=e.id="gradient_"+U_++,i==="radial"?(e.x1=Ii(e.x1,.5),e.y1=Ii(e.y1,.5),e.r1=Ii(e.r1,0),e.x2=Ii(e.x2,.5),e.y2=Ii(e.y2,.5),e.r2=Ii(e.r2,.5),s=Jd):(e.x1=Ii(e.x1,0),e.y1=Ii(e.y1,0),e.x2=Ii(e.x2,1),e.y2=Ii(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function Ii(e,t){return e??t}function q_(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const Xw={basis:{curve:m9},"basis-closed":{curve:g9},"basis-open":{curve:p9},bundle:{curve:h9,tension:"beta",value:.85},cardinal:{curve:d9,tension:"tension",value:0},"cardinal-open":{curve:f9,tension:"tension",value:0},"cardinal-closed":{curve:c9,tension:"tension",value:0},"catmull-rom":{curve:l9,tension:"alpha",value:.5},"catmull-rom-closed":{curve:u9,tension:"alpha",value:.5},"catmull-rom-open":{curve:a9,tension:"alpha",value:.5},linear:{curve:VF},"linear-closed":{curve:o9},monotone:{horizontal:s9,vertical:r9},natural:{curve:i9},step:{curve:n9},"step-after":{curve:t9},"step-before":{curve:e9}};function Mv(e,t,n){var i=Q(Xw,e)&&Xw[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const Jz={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Qz=/[mlhvzcsqta]([^mlhvzcsqta]*)/gi,Zz=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,eU=/^((\s+,?\s*)|(,\s*))/,tU=/^[01]/;function Wa(e){const t=[];return(e.match(Qz)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=Jz[s],a=nU(s,o,i.slice(1).trim()),u=a.length;if(u<o||u&&u%o!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,o)]),u!==o){s==="m"&&(r=r==="M"?"L":"l");for(let l=o;l<u;l+=o)t.push([r,...a.slice(l,l+o)])}}),t}function nU(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let s=0;s<t;++s){const o=e==="a"&&(s===3||s===4)?tU:Zz,a=n.slice(r).match(o);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(eU);u!==null&&(r+=u[0].length)}return i}const As=Math.PI/180,iU=1e-14,no=Math.PI/2,Wi=Math.PI*2,aa=Math.sqrt(3)/2;var a0={},u0={},W_=[].join;function rU(e,t,n,i,r,s,o,a,u){const l=W_.call(arguments);if(a0[l])return a0[l];const c=o*As,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(a-e)*.5;let g=h*h/(n*n)+p*p/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,E=b*a+v*u,w=m*e+y*t,A=b*e+v*t;let S=1/((w-x)*(w-x)+(A-E)*(A-E))-.25;S<0&&(S=0);let F=Math.sqrt(S);s==r&&(F=-F);const k=.5*(x+w)-F*(A-E),P=.5*(E+A)+F*(w-x),U=Math.atan2(E-P,x-k);let $=Math.atan2(A-P,w-k)-U;$<0&&s===1?$+=Wi:$>0&&s===0&&($-=Wi);const D=Math.ceil(Math.abs($/(no+.001))),I=[];for(let G=0;G<D;++G){const B=U+G*$/D,Z=U+(G+1)*$/D;I[G]=[k,P,B,Z,n,i,f,d]}return a0[l]=I}function sU(e){const t=W_.call(e);if(u0[t])return u0[t];var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],l=e[7];const c=l*o,f=-u*a,d=u*o,h=l*a,p=Math.cos(r),g=Math.sin(r),m=Math.cos(s),y=Math.sin(s),b=.5*(s-r),v=Math.sin(b*.5),x=8/3*v*v/Math.sin(b),E=n+p-x*g,w=i+g+x*p,A=n+m,C=i+y,S=A+x*y,F=C-x*m;return u0[t]=[c*E+f*w,d*E+h*w,c*S+f*F,d*S+h*F,c*A+f*C,d*A+h*C]}const Un=["l",0,0,0,0,0,0,0];function oU(e,t,n){const i=Un[0]=e[0];if(i==="a"||i==="A")Un[1]=t*e[1],Un[2]=n*e[2],Un[3]=e[3],Un[4]=e[4],Un[5]=e[5],Un[6]=t*e[6],Un[7]=n*e[7];else if(i==="h"||i==="H")Un[1]=t*e[1];else if(i==="v"||i==="V")Un[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)Un[r]=(r%2==1?t:n)*e[r];return Un}function Kl(e,t,n,i,r,s){var o,a=null,u=0,l=0,c=0,f=0,d,h,p,g,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),s==null&&(s=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(o=t[b],(r!==1||s!==1)&&(o=oU(o,r,s)),o[0]){case"l":u+=o[1],l+=o[2],e.lineTo(u+n,l+i);break;case"L":u=o[1],l=o[2],e.lineTo(u+n,l+i);break;case"h":u+=o[1],e.lineTo(u+n,l+i);break;case"H":u=o[1],e.lineTo(u+n,l+i);break;case"v":l+=o[1],e.lineTo(u+n,l+i);break;case"V":l=o[1],e.lineTo(u+n,l+i);break;case"m":u+=o[1],l+=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=o[1],l=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+o[5],h=l+o[6],c=u+o[3],f=l+o[4],e.bezierCurveTo(u+o[1]+n,l+o[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=o[5],l=o[6],c=o[3],f=o[4],e.bezierCurveTo(o[1]+n,o[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+o[3],h=l+o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+o[1]+n,l+o[2]+i,d+n,h+i),c=u+o[1],f=l+o[2],u=d,l=h;break;case"S":d=o[3],h=o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"q":d=u+o[3],h=l+o[4],c=u+o[1],f=l+o[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=o[3],h=o[4],e.quadraticCurveTo(o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"t":d=u+o[1],h=l+o[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-p,f=2*l-g):a[0]==="q"&&(c=2*u-c,f=2*l-f),p=c,g=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+o[1],f=l+o[2];break;case"T":d=o[1],h=o[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":Yw(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+u+n,o[7]+l+i]),u+=o[6],l+=o[7];break;case"A":Yw(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),u=o[6],l=o[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=o}}function Yw(e,t,n,i){const r=rU(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let s=0;s<r.length;++s){const o=sU(r[s]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}const Kw=.5773502691896257,Jw={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,Wi)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,s=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-s),e.lineTo(r,-s),e.lineTo(0,-n),e.lineTo(-r,-s),e.lineTo(-i,-s),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=aa*n,r=i-n*Kw,s=n/4;e.moveTo(0,-i-r),e.lineTo(-s,i-r),e.lineTo(s,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=aa*n,r=i-n*Kw;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=aa*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=aa*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=aa*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=aa*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function G_(e){return Q(Jw,e)?Jw[e]:aU(e)}var l0={};function aU(e){if(!Q(l0,e)){const t=Wa(e);l0[e]={draw:function(n,i){Kl(n,t,0,0,Math.sqrt(i)/2)}}}return l0[e]}const Yr=.448084975506;function uU(e){return e.x}function lU(e){return e.y}function cU(e){return e.width}function fU(e){return e.height}function gr(e){return typeof e=="function"?e:()=>+e}function Cf(e,t,n){return Math.max(t,Math.min(e,n))}function H_(){var e=uU,t=lU,n=cU,i=fU,r=gr(0),s=r,o=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Cf(+r.call(this,c),0,b),x=Cf(+s.call(this,c),0,b),E=Cf(+o.call(this,c),0,b),w=Cf(+a.call(this,c),0,b);if(u||(u=h=zy()),v<=0&&x<=0&&E<=0&&w<=0)u.rect(p,g,m,y);else{var A=p+m,C=g+y;u.moveTo(p+v,g),u.lineTo(A-x,g),u.bezierCurveTo(A-Yr*x,g,A,g+Yr*x,A,g+x),u.lineTo(A,C-w),u.bezierCurveTo(A,C-Yr*w,A-Yr*w,C,A-w,C),u.lineTo(p+E,C),u.bezierCurveTo(p+Yr*E,C,p,C-Yr*E,p,C-E),u.lineTo(p,g+v),u.bezierCurveTo(p,g+Yr*v,p+Yr*v,g,p+v,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=gr(c),l):e},l.y=function(c){return arguments.length?(t=gr(c),l):t},l.width=function(c){return arguments.length?(n=gr(c),l):n},l.height=function(c){return arguments.length?(i=gr(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=gr(c),s=f!=null?gr(f):r,a=d!=null?gr(d):r,o=h!=null?gr(h):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function V_(){var e,t,n,i,r=null,s,o,a,u;function l(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,x=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(o+b,a+v),r.arc(o,a,u,x,x+Math.PI)}else r.arc(f,d,p,0,Wi);r.closePath()}else s=1;o=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=zy()),d=0;d<=h;++d)!(d<h&&i(p=f[d],d,f))===g&&(g=!g)&&(s=0),g&&l(+e(p,d,f),+t(p,d,f),+n(p,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function kc(e,t){return e??t}const Dc=e=>e.x||0,_c=e=>e.y||0,dU=e=>e.width||0,hU=e=>e.height||0,pU=e=>(e.x||0)+(e.width||0),gU=e=>(e.y||0)+(e.height||0),mU=e=>e.startAngle||0,yU=e=>e.endAngle||0,bU=e=>e.padAngle||0,vU=e=>e.innerRadius||0,xU=e=>e.outerRadius||0,EU=e=>e.cornerRadius||0,AU=e=>kc(e.cornerRadiusTopLeft,e.cornerRadius)||0,wU=e=>kc(e.cornerRadiusTopRight,e.cornerRadius)||0,SU=e=>kc(e.cornerRadiusBottomRight,e.cornerRadius)||0,CU=e=>kc(e.cornerRadiusBottomLeft,e.cornerRadius)||0,$U=e=>kc(e.size,64),FU=e=>e.size||1,yp=e=>e.defined!==!1,kU=e=>G_(e.shape||"circle"),DU=x9().startAngle(mU).endAngle(yU).padAngle(bU).innerRadius(vU).outerRadius(xU).cornerRadius(EU),_U=cD().x(Dc).y1(_c).y0(gU).defined(yp),OU=cD().y(_c).x1(Dc).x0(pU).defined(yp),RU=XF().x(Dc).y(_c).defined(yp),MU=H_().x(Dc).y(_c).width(dU).height(hU).cornerRadius(AU,wU,SU,CU),TU=L7().type(kU).size($U),NU=V_().x(Dc).y(_c).defined(yp).size(FU);function Tv(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function IU(e,t){return DU.context(e)(t)}function LU(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?OU:_U).curve(Mv(i,n.orient,n.tension)).context(e)(t)}function PU(e,t){const n=t[0],i=n.interpolate||"linear";return RU.curve(Mv(i,n.orient,n.tension)).context(e)(t)}function wu(e,t,n,i){return MU.context(e)(t,n,i)}function BU(e,t){return(t.mark.shape||t.shape).context(e)(t)}function zU(e,t){return TU.context(e)(t)}function UU(e,t){return NU.context(e)(t)}var X_=1;function jU(){X_=1}function Nv(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+X_++),o=r.clipping[s]||(r.clipping[s]={id:s});return de(i)?o.path=i(null):Tv(n)?o.path=wu(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function ht(e){this.clear(),e&&this.union(e)}ht.prototype={clone(){return new ht(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*o+l,u*i+a*o+c,a*s-u*r+l,u*s+a*r+c,a*s-u*o+l,u*s+a*o+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function bp(e){this.mark=e,this.bounds=this.bounds||new ht}function vp(e){bp.call(this,e),this.items=this.items||[]}V(vp,bp);class Y_{constructor(t){this._pending=0,this._loader=t||tp()}pending(){return this._pending}sanitizeURL(t){const n=this;return Qw(n),n._loader.sanitize(t,{context:"href"}).then(i=>(qu(n),i)).catch(()=>(qu(n),null))}loadImage(t){const n=this,i=wz();return Qw(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const o=new i,a=Q(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(o.crossOrigin=a),o.onload=()=>qu(n),o.onerror=()=>qu(n),o.src=s,o}).catch(r=>(qu(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function Qw(e){e._pending+=1}function qu(e){e._pending-=1}function zr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;let r=(t.strokeCap==="square"?Math.SQRT2:1)*i/2;n&&(!t.strokeJoin||t.strokeJoin==="miter")&&(r=Math.max(r,(t.strokeMiterLimit!=null?+t.strokeMiterLimit:4)*i/2)),e.expand(r)}return e}const qU=Wi-1e-8;let xp,Zf,ed,oo,d1,td,h1,p1;const as=(e,t)=>xp.add(e,t),nd=(e,t)=>as(Zf=e,ed=t),Zw=e=>as(e,xp.y1),eS=e=>as(xp.x1,e),io=(e,t)=>d1*e+h1*t,ro=(e,t)=>td*e+p1*t,c0=(e,t)=>as(io(e,t),ro(e,t)),f0=(e,t)=>nd(io(e,t),ro(e,t));function Oc(e,t){return xp=e,t?(oo=t*As,d1=p1=Math.cos(oo),td=Math.sin(oo),h1=-td):(d1=p1=1,oo=td=h1=0),WU}const WU={beginPath(){},closePath(){},moveTo:f0,lineTo:f0,rect(e,t,n,i){oo?(c0(e+n,t),c0(e+n,t+i),c0(e,t+i),f0(e,t)):(as(e+n,t+i),nd(e,t))},quadraticCurveTo(e,t,n,i){const r=io(e,t),s=ro(e,t),o=io(n,i),a=ro(n,i);tS(Zf,r,o,Zw),tS(ed,s,a,eS),nd(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=io(e,t),a=ro(e,t),u=io(n,i),l=ro(n,i),c=io(r,s),f=ro(r,s);nS(Zf,o,u,c,Zw),nS(ed,a,l,f,eS),nd(c,f)},arc(e,t,n,i,r,s){if(i+=oo,r+=oo,Zf=n*Math.cos(r)+e,ed=n*Math.sin(r)+t,Math.abs(r-i)>qU)as(e-n,t-n),as(e+n,t+n);else{const o=l=>as(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(o(i),o(r),r!==i)if(i=i%Wi,i<0&&(i+=Wi),r=r%Wi,r<0&&(r+=Wi),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=Wi,a=i-i%no,u=0;u<4&&a>r;++u,a-=no)o(a);else for(a=i-i%no+no,u=0;u<4&&a<r;++u,a=a+no)o(a)}}};function tS(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function nS(e,t,n,i,r){const s=i-e+3*t-3*n,o=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(s)>iU?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),u=(-o+c)/s,l=(-o-c)/s)):u=.5*a/o,0<u&&u<1&&r(iS(u,e,t,n,i)),0<l&&l<1&&r(iS(l,e,t,n,i))}function iS(e,t,n,i,r){const s=1-e,o=s*s,a=e*e;return o*s*t+3*o*e*n+3*s*a*i+a*e*r}var bs=(bs=ys(1,1))?bs.getContext("2d"):null;const g1=new ht;function Iv(e){return function(t,n){if(!bs)return!0;e(bs,t),g1.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=g1;for(let a=r;a<=o;++a)for(let u=i;u<=s;++u)if(bs.isPointInPath(u,a))return!0;return!1}}function Lv(e,t){return t.contains(e.x||0,e.y||0)}function K_(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(g1.set(n,i,n+r,i+s))}function J_(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,s=e.y2!=null?e.y2:i;return xa(t,n,i,r,s)}function xa(e,t,n,i,r){const{x1:s,y1:o,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,p,g,m;for(m=0;m<4;++m){if(m===0&&(h=-l,p=-(s-t)),m===1&&(h=l,p=a-t),m===2&&(h=-c,p=-(o-n)),m===3&&(h=c,p=u-n),Math.abs(h)<1e-10&&p<0)return!1;if(g=p/h,h<0){if(g>d)return!1;g>f&&(f=g)}else if(h>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function Ga(e,t){e.globalCompositeOperation=t.blend||"source-over"}function ai(e,t){return e??t}function rS(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function GU(e,t,n){const i=n.width(),r=n.height();let s;if(t.gradient==="radial")s=e.createRadialGradient(n.x1+ai(t.x1,.5)*i,n.y1+ai(t.y1,.5)*r,Math.max(i,r)*ai(t.r1,0),n.x1+ai(t.x2,.5)*i,n.y1+ai(t.y2,.5)*r,Math.max(i,r)*ai(t.r2,.5));else{const o=ai(t.x1,0),a=ai(t.y1,0),u=ai(t.x2,1),l=ai(t.y2,0);if(o===u||a===l||i===r)s=e.createLinearGradient(n.x1+o*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=ys(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=rS(f.createLinearGradient(o,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return rS(s,t.stops)}function Q_(e,t,n){return Rv(n)?GU(e,n,t.bounds):n}function Qd(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=Q_(e,t,t.fill),!0):!1}var HU=[];function Ha(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=Q_(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit!=null?t.strokeMiterLimit:4,e.setLineDash&&(e.setLineDash(t.strokeDash||HU),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function VU(e,t){return e.zindex-t.zindex||e.index-t.index}function Pv(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r<s;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(VU)}function xi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const s=Pv(e);if(s&&s.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=s}for(i=0,r=n.length;i<r;++i)t(n[i])}function Zd(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const s=Pv(e);for(s&&s.length&&(n=s),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function Bv(e){return function(t,n,i){xi(n,r=>{(!i||i.intersects(r.bounds))&&Z_(e,t,r,r)})}}function XU(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&Z_(e,t,n.items[0],n.items)}}function Z_(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Ga(t,n),n.fill&&Qd(t,n,r)&&t.fill(),n.stroke&&Ha(t,n,r)&&t.stroke()))}function Ep(e){return e=e||Zn,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,Zd(n,a=>{const u=a.bounds;if(!(u&&!u.contains(s,o)||!u)&&e(t,a,i,r,s,o))return a})}}function Rc(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,u=o.stroke&&n.isPointInStroke,l,c;return u&&(l=o.strokeWidth,c=o.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function zv(e){return Ep(Rc(e))}function co(e,t){return"translate("+e+","+t+")"}function Uv(e){return"rotate("+e+")"}function YU(e,t){return"scale("+e+","+t+")"}function eO(e){return co(e.x||0,e.y||0)}function KU(e){return co(e.x||0,e.y||0)+(e.angle?" "+Uv(e.angle):"")}function JU(e){return co(e.x||0,e.y||0)+(e.angle?" "+Uv(e.angle):"")+(e.scaleX||e.scaleY?" "+YU(e.scaleX||1,e.scaleY||1):"")}function jv(e,t,n){function i(o,a){o("transform",KU(a)),o("d",t(null,a))}function r(o,a){return t(Oc(o,a.angle),a),zr(o,a,!0).translate(a.x||0,a.y||0)}function s(o,a){var u=a.x||0,l=a.y||0,c=a.angle||0;o.translate(u,l),c&&o.rotate(c*=As),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:Bv(s),pick:zv(s),isect:n||Iv(s)}}var QU=jv("arc",IU);function ZU(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<s&&(s=a,o=e[r]));return o}function ej(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,s,o;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o<n))return e[i];return null}function tj(e,t){for(var n=e.length,i,r,s;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s<i*i))return e[n];return null}function qv(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t(Oc(u),c),zr(u,c[0],!0))}function s(u,l){u.beginPath(),t(u,l)}const o=Rc(s);function a(u,l,c,f,d,h){var p=l.items,g=l.bounds;return!p||!p.length||g&&!g.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,o(u,p,c,f)?p[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:XU(s),pick:a,isect:Lv,tip:n}}var nj=qv("area",LU,ZU);function ij(e,t){var n=t.clip;e.save(),de(n)?(e.beginPath(),n(e),e.clip()):tO(e,t.group)}function tO(e,t){e.beginPath(),Tv(t)?wu(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function nO(e){const t=ai(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function rj(e,t){e("transform",eO(t))}function iO(e,t){const n=nO(t);e("d",wu(null,t,n,n))}function sj(e,t){e("class","background"),e("aria-hidden",!0),iO(e,t)}function oj(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?iO(e,t):e("d","")}function aj(e,t,n){const i=t.clip?Nv(n,t,t):null;e("clip-path",i)}function uj(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),zr(e,t),e.translate(t.x||0,t.y||0)}function Jl(e,t,n,i){const r=nO(t);e.beginPath(),wu(e,t,(n||0)+r,(i||0)+r)}const lj=Rc(Jl),cj=Rc(Jl,!1),fj=Rc(Jl,!0);function dj(e,t,n,i){xi(t,r=>{const s=r.x||0,o=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(Jl(e,r,s,o),Ga(e,r),r.fill&&Qd(e,r,u)&&e.fill(),r.stroke&&!a&&Ha(e,r,u)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&tO(e,r),n&&n.translate(-s,-o),xi(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&u&&(Jl(e,r,s,o),Ga(e,r),Ha(e,r,u)&&e.stroke())})}function hj(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return Zd(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(r<c||r>h||s<f||s>p))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&Tv(u)&&!fj(e,u,o,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&cj(e,u,o,a)?(e.restore(),u):(l=Zd(u,b=>pj(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&lj(e,u,o,a)&&(l=u),e.restore(),l||null)})}function pj(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var gj={type:"group",tag:"g",nested:!1,attr:rj,bound:uj,draw:dj,pick:hj,isect:K_,content:aj,background:sj,foreground:oj},Ql={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Wv(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function Gv(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function Hv(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Ap(e,t){return e==="center"?t/2:e==="right"?t:0}function wp(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function mj(e,t,n){const i=Wv(t,n),r=Gv(t,i),s=Hv(t,i),o=(t.x||0)-Ap(t.align,r),a=(t.y||0)-wp(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,Ql["xmlns:xlink"],"xlink:href"),e("transform",co(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function yj(e,t){const n=t.image,i=Gv(t,n),r=Hv(t,n),s=(t.x||0)-Ap(t.align,i),o=(t.y||0)-wp(t.baseline,r);return e.set(s,o,s+i,o+r)}function bj(e,t,n){xi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=Wv(i,this);let s=Gv(i,r),o=Hv(i,r);if(s===0||o===0)return;let a=(i.x||0)-Ap(i.align,s),u=(i.y||0)-wp(i.baseline,o),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=s/c,u+=(o-d)/2,o=d):(d=o*c,a+=(s-d)/2,s=d))),(r.complete||r.toDataURL)&&(Ga(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,s,o))})}var vj={type:"image",tag:"image",nested:!1,attr:mj,bound:yj,draw:bj,pick:Ep(),isect:Zn,get:Wv,xOffset:Ap,yOffset:wp},xj=qv("line",PU,ej);function Ej(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",JU(t)),e("d",t.path)}function id(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,s=t.scaleX||1,o=t.scaleY||1,a=(t.angle||0)*As,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=Wa(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),Kl(e,u,0,0,s,o),e.rotate(-a),e.translate(-i,-r)):Kl(e,u,i,r,s,o)}function Aj(e,t){return id(Oc(e,t.angle),t)?e.set(0,0,0,0):zr(e,t,!0)}var wj={type:"path",tag:"path",nested:!1,attr:Ej,bound:Aj,draw:Bv(id),pick:zv(id),isect:Iv(id)};function Sj(e,t){e("d",wu(null,t))}function Cj(e,t){var n,i;return zr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function sS(e,t){e.beginPath(),wu(e,t)}var $j={type:"rect",tag:"path",nested:!1,attr:Sj,bound:Cj,draw:Bv(sS),pick:zv(sS),isect:K_};function Fj(e,t){e("transform",eO(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function kj(e,t){var n,i;return zr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function rO(e,t,n){var i,r,s,o;return t.stroke&&Ha(e,t,n)?(i=t.x||0,r=t.y||0,s=t.x2!=null?t.x2:i,o=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(s,o),!0):!1}function Dj(e,t,n){xi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&rO(e,i,r)&&(Ga(e,i),e.stroke())}})}function _j(e,t,n,i){return e.isPointInStroke?rO(e,t,1)&&e.isPointInStroke(n,i):!1}var Oj={type:"rule",tag:"line",nested:!1,attr:Fj,bound:kj,draw:Dj,pick:Ep(_j),isect:J_},Rj=jv("shape",BU),Mj=jv("symbol",zU,Lv);const oS=MD();var Nn={height:or,measureWidth:Vv,estimateWidth:eh,width:eh,canvas:sO};sO(!0);function sO(e){Nn.width=e&&bs?Vv:eh}function eh(e,t){return oO(Ss(e,t),or(e))}function oO(e,t){return~~(.8*e.length*t)}function Vv(e,t){return or(e)<=0||!(t=Ss(e,t))?0:aO(t,Sp(e))}function aO(e,t){const n=`(${t}) ${e}`;let i=oS.get(n);return i===void 0&&(bs.font=t,i=bs.measureText(e).width,oS.set(n,i)),i}function or(e){return e.fontSize!=null?+e.fontSize||0:11}function ws(e){return e.lineHeight!=null?e.lineHeight:or(e)+2}function Tj(e){return N(e)?e.length>1?e:e[0]:e}function Mc(e){return Tj(e.lineBreak&&e.text&&!N(e.text)?e.text.split(e.lineBreak):e.text)}function Xv(e){const t=Mc(e);return(N(t)?t.length-1:0)*ws(e)}function Ss(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?Ij(e,n):n}function Nj(e){if(Nn.width===Vv){const t=Sp(e);return n=>aO(n,t)}else if(Nn.width===eh){const t=or(e);return n=>oO(n,t)}else return t=>Nn.width(e,t)}function Ij(e,t){var n=+e.limit,i=Nj(e);if(i(t)<n)return t;var r=e.ellipsis||"…",s=e.dir==="rtl",o=0,a=t.length,u;if(n-=i(r),s){for(;o<a;)u=o+a>>>1,i(t.slice(u))>n?o=u+1:a=u;return r+t.slice(o)}else{for(;o<a;)u=1+(o+a>>>1),i(t.slice(0,u))<n?o=u:a=u-1;return t.slice(0,o)+r}}function Tc(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Sp(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+or(e)+"px "+Tc(e,t)}function Yv(e){var t=e.baseline,n=or(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*ws(e):t==="line-bottom"?.29*n-.5*ws(e):0)}const Lj={left:"start",center:"middle",right:"end"},Ol=new ht;function Cp(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-no,t+=i*Math.cos(r),n+=i*Math.sin(r)),Ol.x1=t,Ol.y1=n,Ol}function Pj(e,t){var n=t.dx||0,i=(t.dy||0)+Yv(t),r=Cp(t),s=r.x1,o=r.y1,a=t.angle||0,u;e("text-anchor",Lj[t.align]||"start"),a?(u=co(s,o)+" "+Uv(a),(n||i)&&(u+=" "+co(n,i))):u=co(s+n,o+i),e("transform",u)}function Kv(e,t,n){var i=Nn.height(t),r=t.align,s=Cp(t),o=s.x1,a=s.y1,u=t.dx||0,l=(t.dy||0)+Yv(t)-Math.round(.8*i),c=Mc(t),f;if(N(c)?(i+=ws(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Nn.width(t,h)),0)):f=Nn.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=o,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*As,o,a);else if(n===2)return e.rotatedPoints(t.angle*As,o,a);return e}function Bj(e,t,n){xi(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=Sp(i),e.textAlign=i.align||"left",s=Cp(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*As),o=a=0),o+=i.dx||0,a+=(i.dy||0)+Yv(i),c=Mc(i),Ga(e,i),N(c))for(l=ws(i),u=0;u<c.length;++u)f=Ss(i,c[u]),i.fill&&Qd(e,i,r)&&e.fillText(f,o,a),i.stroke&&Ha(e,i,r)&&e.strokeText(f,o,a),a+=l;else f=Ss(i,c),i.fill&&Qd(e,i,r)&&e.fillText(f,o,a),i.stroke&&Ha(e,i,r)&&e.strokeText(f,o,a);i.angle&&e.restore()}})}function zj(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=Cp(t),a=o.x1,u=o.y1,l=Kv(Ol,t,1),c=-t.angle*As,f=Math.cos(c),d=Math.sin(c),h=f*r-d*s+(a-f*a+d*u),p=d*r+f*s+(u-d*a-f*u);return l.contains(h,p)}function Uj(e,t){const n=Kv(Ol,e,2);return xa(t,n[0],n[1],n[2],n[3])||xa(t,n[0],n[1],n[4],n[5])||xa(t,n[4],n[5],n[6],n[7])||xa(t,n[2],n[3],n[6],n[7])}var jj={type:"text",tag:"text",nested:!1,attr:Pj,bound:Kv,draw:Bj,pick:Ep(zj),isect:Uj},qj=qv("trail",UU,tj),Bn={arc:QU,area:nj,group:gj,image:vj,line:xj,path:wj,rect:$j,rule:Oj,shape:Rj,symbol:Mj,text:jj,trail:qj};function m1(e,t,n){var i=Bn[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new ht),e,n)}var aS={mark:null};function uO(e,t,n){var i=Bn[e.marktype],r=i.bound,s=e.items,o=s&&s.length,a,u,l,c;if(i.nested)return o?l=s[0]:(aS.mark=e,l=aS),c=m1(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new ht,o)for(a=0,u=s.length;a<u;++a)t.union(m1(s[a],r,n));return e.bounds=t}const Wj=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function lO(e,t){return JSON.stringify(e,Wj,t)}function cO(e){const t=typeof e=="string"?JSON.parse(e):e;return fO(t)}function fO(e){var t=e.marktype,n=e.items,i,r,s;if(n)for(r=0,s=n.length;r<s;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&fO(n[r]);return t&&uO(e),e}class dO{constructor(t){arguments.length?this.root=cO(t):(this.root=uS({marktype:"group",name:"root",role:"frame"}),this.root.items=[new vp(this.root)])}toJSON(t){return lO(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=uS(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function uS(e,t){const n={bounds:new ht,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function us(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function Jv(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function gt(e,t,n,i){var r=e.childNodes[t],s;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(s=r||null,r=us(e.ownerDocument,n,i),e.insertBefore(r,s)),r}function qn(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function hO(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function $p(e,t){if(t.getScreenCTM){const n=Gj(e,t.getScreenCTM());if(n)return n}return Hj(e,t,t.getBoundingClientRect())}function Gj(e,t){if(!t)return null;const n=t.a*t.d-t.b*t.c;if(!n)return null;const i=e.clientX-t.e,r=e.clientY-t.f;return[(t.d*i-t.c*r)/n,(t.a*r-t.b*i)/n]}function Hj(e,t,n){const i=t.offsetWidth?n.width/t.offsetWidth:1,r=t.offsetHeight?n.height/t.offsetHeight:1;return[(e.clientX-n.left)/i-(t.clientLeft||0),(e.clientY-n.top)/r-(t.clientTop||0)]}function Vj(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=Bn[r.marktype]).tip){for(o=$p(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}let Qv=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||tp(),this._tooltip=n||Xj}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),o=us(null,"a");for(const a in r)o.setAttribute(a,r[a]);o.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=Vj(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,o=s.width(),a=s.height();let u=s.x1+r[0]+i.left,l=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:o,height:a,left:u,top:l,right:u+o,bottom:l+a}}};function Xj(e,t,n,i){e.element().setAttribute("title",i||"")}class Nc{constructor(t){this._el=null,this._bgcolor=null,this._loader=new Y_(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(o=>{o&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const Yj="keydown",Kj="keypress",Jj="keyup",pO="dragenter",rd="dragleave",gO="dragover",y1="pointerdown",Qj="pointerup",th="pointermove",sd="pointerout",mO="pointerover",b1="mousedown",Zj="mouseup",yO="mousemove",nh="mouseout",bO="mouseover",ih="click",eq="dblclick",tq="wheel",vO="mousewheel",rh="touchstart",sh="touchmove",oh="touchend",nq=[Yj,Kj,Jj,pO,rd,gO,y1,Qj,th,sd,mO,b1,Zj,yO,nh,bO,ih,eq,tq,vO,rh,sh,oh],v1=th,Rl=nh,x1=ih;class Ic extends Qv{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=nq,this.pointermove=cS([th,yO],[mO,bO],[sd,nh]),this.dragover=cS([gO],[pO],[rd]),this.pointerout=fS([sd,nh]),this.dragleave=fS([rd])}initialize(t,n,i){return this._canvas=t&&Jv(t,"canvas"),[ih,b1,y1,th,sd,rd].forEach(r=>lS(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(vO,t)}pointerdown(t){this._down=this._active,this.fire(y1,t)}mousedown(t){this._down=this._active,this.fire(b1,t)}click(t){this._down===this._active&&(this.fire(ih,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(rh,t,!0)}touchmove(t){this.fire(sh,t,!0)}touchend(t){this.fire(oh,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===x1&&r&&r.href?this.handleHref(n,r,r.href):(t===v1||t===Rl)&&this.handleTooltip(n,r,t!==Rl),s)for(let o=0,a=s.length;o<a;++o)s[o].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(lS(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&r.splice(s,1),this}pickEvent(t){const n=$p(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const o=this.context();return Bn[t.marktype].pick.call(this,o,t,n,i,r,s)}}const iq=e=>e===rh||e===sh||e===oh?[rh,sh,oh]:[e];function lS(e,t){iq(t).forEach(n=>rq(e,n))}function rq(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function vl(e,t,n){t.forEach(i=>e.fire(i,n))}function cS(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?vl(this,e,i):((!r||!r.exit)&&vl(this,n,i),this._active=s,vl(this,t,i),vl(this,e,i))}}function fS(e){return function(t){vl(this,e,t),this._active=null}}function sq(){return typeof window<"u"&&window.devicePixelRatio||1}function oq(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=o?sq():r;e.width=t*u,e.height=n*u;for(const l in s)a[l]=s[l];return o&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class ah extends Nc{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new ht,this._tempb=new ht}initialize(t,n,i,r,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:ys(1,1,this._options.type),t&&this._canvas&&(qn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks"),this._canvas.style.setProperty("vertical-align","bottom")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)oq(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||R("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,o=this._height,a=this._dirty,u=aq(r,s,o);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):uq(i,u.intersect(a),r);return this.clear(-r[0],-r[1],s,o),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=Bn[n.marktype];n.clip&&ij(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,o=this.context();s.type!=="pdf"&&!s.externalContext&&o.clearRect(t,n,i,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(t,n,i,r))}}const aq=(e,t,n)=>new ht().set(0,0,t,n).translate(-e[0],-e[1]);function uq(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class xO extends Qv{constructor(t,n){super(t,n);const i=this;i._hrefHandler=d0(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=d0(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Rl)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(x1,this._hrefHandler),r.removeEventListener(v1,this._tooltipHandler),r.removeEventListener(Rl,this._tooltipHandler)),this._svg=r=t&&Jv(t,"svg"),r&&(r.addEventListener(x1,this._hrefHandler),r.addEventListener(v1,this._tooltipHandler),r.addEventListener(Rl,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const o={type:t,handler:n,listener:d0(this,n)};(r[i]||(r[i]=[])).push(o),this._svg&&this._svg.addEventListener(i,o.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const d0=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},EO="aria-hidden",Zv="aria-label",ex="role",tx="aria-roledescription",AO="graphics-object",nx="graphics-symbol",wO=(e,t,n)=>({[ex]:e,[tx]:t,[Zv]:n||void 0}),lq=vi(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),dS={axis:{desc:"axis",caption:dq},legend:{desc:"legend",caption:hq},"title-text":{desc:"title",caption:e=>`Title text '${pS(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${pS(e)}'`}},hS={ariaRole:ex,ariaRoleDescription:tx,description:Zv};function SO(e,t){const n=t.aria===!1;if(e(EO,n||void 0),n||t.description==null)for(const i in hS)e(hS[i],void 0);else{const i=t.mark.marktype;e(Zv,t.description),e(ex,t.ariaRole||(i==="group"?AO:nx)),e(tx,t.ariaRoleDescription||`${i} mark`)}}function CO(e){return e.aria===!1?{[EO]:!0}:lq[e.role]?null:dS[e.role]?fq(e,dS[e.role]):cq(e)}function cq(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return wO(n?AO:nx,`${t} mark container`,e.description)}function fq(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return wO(t.role||nx,t.desc,e.description||n.description||i(n))}catch{return null}}function pS(e){return J(e.text).join(" ")}function dq(e){const t=e.datum,n=e.orient,i=t.title?$O(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${qa(a)?"discrete":a} scale with ${z_(o,s,e)}`}function hq(e){const t=e.datum,n=t.title?$O(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,u=o.dataflow.locale();return gq(i)+(n?` titled '${n}'`:"")+` for ${pq(s)} with ${z_(u,a,e)}`}function $O(e){try{return J(ye(e.items).items[0].text).join(" ")}catch{return null}}function pq(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+ye(e)}function gq(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const FO=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),mq=e=>FO(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function ix(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},o=(u,l)=>(l!=null&&(t+=` ${u}="${mq(l)}"`),a),a={open(u,...l){s(u),t="<"+u;for(const c of l)for(const f in c)o(f,c[f]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:o,text:u=>(n+=FO(u),a),toString:()=>e};return a}const kO=e=>DO(ix(),e)+"";function DO(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):DO(e,i)}return e.close()}const uh={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},lh={blend:"mix-blend-mode"},_O={fill:"none","stroke-miterlimit":4},Wu=0,gS="http://www.w3.org/2000/xmlns/",pt=Ql.xmlns;class rx extends Nc{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,s){return this._defs={},this._clearDefs(),t&&(this._svg=gt(t,0,"svg",pt),this._svg.setAttributeNS(gS,"xmlns",pt),this._svg.setAttributeNS(gS,"xmlns:xlink",Ql["xmlns:xlink"]),this._svg.setAttribute("version",Ql.version),this._svg.setAttribute("class","marks"),this._svg.style.setProperty("vertical-align","bottom"),qn(t,1),this._root=gt(this._svg,Wu,"g",pt),ls(this._root,_O),qn(this._svg,Wu+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,s)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(ls(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const t=this._svg,n=this._bgcolor;if(!t)return null;const i=t.getAttribute("style");t.removeAttribute("style");let r;n&&(r=gt(t,Wu,"rect",pt),ls(r,{width:this._width,height:this._height,fill:n}));const s=kO(t);return n&&t.removeChild(r),i&&t.setAttribute("style",i),s}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),qn(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))}isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const n=++this._dirtyID;let i,r,s,o,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==s&&(s=r.marktype,o=Bn[s]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,mS(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=o.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,mS(i,n)):this._update(o,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,o=n.marktype,a=Bn[o],u=n.interactive===!1?"none":null,l=a.tag==="g",c=yS(n,t,i,"g",s);if(o!=="group"&&r!=null&&!r.includes(o))return qn(c,0),n._svg;c.setAttribute("class",hO(n));const f=CO(n);for(const g in f)Yt(c,g,f[g]);l||Yt(c,"pointer-events",u),Yt(c,"clip-path",n.clip?Nv(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=yS(g,c,d,a.tag,s);m&&(this._update(a,y,g),l&&vq(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):xi(n,p),qn(c,h),c}_update(t,n,i){Cr=n,Pt=n.__values__,SO(Ml,i),t.attr(Ml,i,this);const r=Eq[t.type];r&&r.call(this,t,n,i),Cr&&this.style(Cr,i)}style(t,n){if(n!=null){for(const i in uh){let r=i==="font"?Tc(n):n[i];if(r===Pt[i])continue;const s=uh[i];r==null?t.removeAttribute(s):(Rv(r)&&(r=j_(r,this._defs.gradient,OO())),t.setAttribute(s,r+"")),Pt[i]=r}for(const i in lh)od(t,lh[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=gt(t,Wu+1,"defs",pt)),r=yq(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=gt(t,Wu+1,"defs",pt)),r=bq(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):qn(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function mS(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function yq(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=gt(e,n++,"pattern",pt);ls(o,{id:Jd+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=gt(o,0,"rect",pt),ls(o,{width:1,height:1,fill:`url(${OO()}#${t.id})`}),e=gt(e,n++,"radialGradient",pt),ls(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=gt(e,n++,"linearGradient",pt),ls(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)s=gt(e,i,"stop",pt),s.setAttribute("offset",t.stops[i].offset),s.setAttribute("stop-color",t.stops[i].color);return qn(e,i),n}function bq(e,t,n){let i;return e=gt(e,n,"clipPath",pt),e.setAttribute("id",t.id),t.path?(i=gt(e,0,"path",pt),i.setAttribute("d",t.path)):(i=gt(e,0,"rect",pt),ls(i,{x:0,y:0,width:t.width,height:t.height})),qn(e,1),n+1}function vq(e,t,n,i){t=t.lastChild.previousSibling;let r,s=0;xi(n,o=>{r=e.mark(t,o,r,i),++s}),qn(t,1+s)}function yS(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=us(o,i,pt),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=us(o,"path",pt);s.appendChild(a),a.__data__=e;const u=us(o,"g",pt);s.appendChild(u),u.__data__=e;const l=us(o,"path",pt);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||xq(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function xq(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Cr=null,Pt=null;const Eq={group(e,t,n){const i=Cr=t.childNodes[2];Pt=i.__values__,e.foreground(Ml,n,this),Pt=t.__values__,Cr=t.childNodes[1],e.content(Ml,n,this);const r=Cr=t.childNodes[0];e.background(Ml,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==Pt.events&&(Yt(i,"pointer-events",s),Yt(r,"pointer-events",s),Pt.events=s),n.strokeForeground&&n.stroke){const o=n.fill;Yt(i,"display",null),this.style(r,n),Yt(r,"stroke",null),o&&(n.fill=null),Pt=i.__values__,this.style(i,n),o&&(n.fill=o),Cr=null}else Yt(i,"display","none")},image(e,t,n){n.smooth===!1?(od(t,"image-rendering","optimizeSpeed"),od(t,"image-rendering","pixelated")):od(t,"image-rendering",null)},text(e,t,n){const i=Mc(n);let r,s,o,a;N(i)?(s=i.map(u=>Ss(n,u)),r=s.join(`
9
+ `),r!==Pt.text&&(qn(t,0),o=t.ownerDocument,a=ws(n),s.forEach((u,l)=>{const c=us(o,"tspan",pt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Pt.text=r)):(s=Ss(n,i),s!==Pt.text&&(t.textContent=s,Pt.text=s)),Yt(t,"font-family",Tc(n)),Yt(t,"font-size",or(n)+"px"),Yt(t,"font-style",n.fontStyle),Yt(t,"font-variant",n.fontVariant),Yt(t,"font-weight",n.fontWeight)}};function Ml(e,t,n){t!==Pt[e]&&(n?Aq(Cr,e,t,n):Yt(Cr,e,t),Pt[e]=t)}function od(e,t,n){n!==Pt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Pt[t]=n)}function ls(e,t){for(const n in t)Yt(e,n,t[n])}function Yt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function Aq(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function OO(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class RO extends Nc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=ix();n.open("svg",he({},Ql,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",_O,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Bn[n.marktype],r=i.tag,s=[SO,i.attr];t.open("g",{class:hO(n),"clip-path":n.clip?Nv(this,n,n.group):null},CO(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const o=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,s,r!=="g"?r:null)),r==="text"){const l=Mc(a);if(N(l)){const c={x:0,dy:ws(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Ss(a,l[f])).close()}else t.text(Ss(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),xi(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):xi(n,o),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},o=(a,u,l,c)=>{s[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(o,n,this)):i(o,n,this),r&&wq(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const o=n[s],a=o.stops;o.gradient==="radial"?(t.open("pattern",{id:Jd+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):t.open("linearGradient",{id:s,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const s in i){const o=i[s];t.open("clipPath",{id:s}),o.path?t.open("path",{d:o.path}).close():t.open("rect",{x:0,y:0,width:o.width,height:o.height}).close(),t.close()}t.close()}}}function wq(e,t,n,i,r){let s;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(s=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Tc(t),e["font-size"]=or(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const o in uh){let a=t[o];const u=uh[o];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(Rv(a)&&(a=j_(a,r.gradient,"")),e[u]=a)}for(const o in lh){const a=t[o];a!=null&&(s=s||[],s.push(`${lh[o]}: ${a};`))}return s&&(e.style=s.join(" ")),e}const li={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function Sq(e){li.svgMarkTypes=e.svgMarkTypes??["text"],li.svgOnTop=e.svgOnTop??!0,li.debug=e.debug??!1}class E1 extends Nc{constructor(t){super(t),this._svgRenderer=new rx(t),this._canvasRenderer=new ah(t)}initialize(t,n,i,r,s){this._root_el=gt(t,0,"div");const o=gt(this._root_el,0,"div"),a=gt(this._root_el,1,"div");return this._root_el.style.position="relative",li.debug||(o.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=li.svgOnTop?a:o,this._canvasEl=li.svgOnTop?o:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,s),this._svgRenderer.initialize(this._svgEl,n,i,r,s),super.initialize(t,n,i,r,s)}dirty(t){return li.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(s=>!li.svgMarkTypes.includes(s));this._svgRenderer.render(t,li.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return li.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class MO extends Ic{constructor(t,n){super(t,n)}initialize(t,n,i){const r=gt(gt(t,0,"div"),li.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const TO="canvas",NO="hybrid",IO="png",LO="svg",PO="none",cs={Canvas:TO,PNG:IO,SVG:LO,Hybrid:NO,None:PO},Ao={};Ao[TO]=Ao[IO]={renderer:ah,headless:ah,handler:Ic};Ao[LO]={renderer:rx,headless:RO,handler:xO};Ao[NO]={renderer:E1,headless:E1,handler:MO};Ao[PO]={};function Fp(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Ao[e]=t,this):Ao[e]}function BO(e,t,n){const i=[],r=new ht().union(t),s=e.marktype;return s?zO(e,r,n,i):s==="group"?UO(e,r,n,i):R("Intersect scene must be mark node or group item.")}function zO(e,t,n,i){if(Cq(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a<o;++a)UO(r[a],t,n,i);else for(const u=Bn[s].isect;a<o;++a){const l=r[a];jO(l,t,u)&&i.push(l)}}return i}function Cq(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function UO(e,t,n,i){n&&n(e.mark)&&jO(e,t,Bn.group.isect)&&i.push(e);const r=e.items,s=r&&r.length;if(s){const o=e.x||0,a=e.y||0;t.translate(-o,-a);for(let u=0;u<s;++u)zO(r[u],t,n,i);t.translate(o,a)}return i}function jO(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const h0=new ht;function qO(e){const t=e.clip;if(de(t))t(Oc(h0.clear()));else if(t)h0.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(h0)}const $q=1e-9;function sx(e,t,n){return e===t?!0:n==="path"?WO(e,t):e instanceof Date&&t instanceof Date?+e==+t:Ce(e)&&Ce(t)?Math.abs(e-t)<=$q:!e||!t||!Y(e)&&!Y(t)?e==t:Fq(e,t)}function WO(e,t){return sx(Wa(e),Wa(t))}function Fq(e,t){var n=Object.keys(e),i=Object.keys(t),r,s;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),s=n.length-1;s>=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!sx(e[r],t[r],r))return!1;return typeof e==typeof t}function kq(){jU(),Kz()}const Va="top",di="left",pi="right",Cs="bottom",Dq="top-left",_q="top-right",Oq="bottom-left",Rq="bottom-right",ox="start",A1="middle",Kt="end",Mq="x",Tq="y",Lc="group",bS="bounds",ax="axis",ux="title",Nq="frame",Iq="scope",lx="legend",GO="row-header",HO="row-footer",VO="row-title",XO="column-header",YO="column-footer",KO="column-title",Lq="padding",Pq="symbol",JO="fit",QO="fit-x",ZO="fit-y",Bq="pad",cx="none",$f="all",w1="each",fx="flush",fs="column",ds="row";function e5(e){O.call(this,null,e)}V(e5,O,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=Bn[r],o=s.bound;let a=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=Ff(i,o),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===Lc||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Ff(l,o))),i.role){case ax:case lx:case ux:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Ff(l,o))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Ff(l,o))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return qO(i),t.modifies("bounds")}});function Ff(e,t,n){return t(e.bounds.clear(),e,n)}const vS=":vega_identifier:";function dx(e){O.call(this,0,e)}dx.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};V(dx,O,{transform(e,t){const n=zq(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function zq(e){return e._signals[vS]||(e._signals[vS]=e.add(0))}function t5(e){O.call(this,null,e)}V(t5,O,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,Uq(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===Lc?vp:bp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function Uq(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function n5(e){O.call(this,null,e)}const xS={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!i5(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},i5=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),ES=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n<i;r=s,++n)if(i5(r,s=e[n].bounds,t))return!0},jq=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},qq=(e,t,n)=>{var i=e.range(),r=new ht;return t===Va||t===Cs?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},AS=e=>(e.forEach(t=>t.opacity=1),e),wS=(e,t)=>e.reflow(t.modified()).modifies("opacity");V(n5,O,{transform(e,t){const n=xS[e.method]||xS.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(AS(r),t=wS(t,e)),t;if(r=r.filter(jq),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=AS(r),t=wS(t,e),s.length>=3&&ES(s,i)){do s=n(s,i);while(s.length>=3&&ES(s,i));s.length<3&&!ye(r).opacity&&(s.length>1&&(ye(s).opacity=0),ye(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=qq(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{o(u)||(u.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function r5(e){O.call(this,null,e)}V(r5,O,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const It=new ht;function Ea(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Wq(e){var t=e.items[0].orient;return t===di||t===pi}function Gq(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function Hq(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,u=Gq(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&Xv(p),b=0,v=0,x,E;switch(It.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case Va:b=f||0,v=-c,E=Math.max(d,Math.min(h,-m.y1)),m.add(0,-E).add(l,0),p&&kf(e,p,E,g,y,0,-1,m);break;case di:b=-c,v=f||0,E=Math.max(d,Math.min(h,-m.x1)),m.add(-E,0).add(0,l),p&&kf(e,p,E,g,y,1,-1,m);break;case pi:b=n+c,v=f||0,E=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(E,l),p&&kf(e,p,E,g,y,1,1,m);break;case Cs:b=f||0,v=i+c,E=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,E),p&&kf(e,p,E,g,0,0,1,m);break;default:b=r.x,v=r.y}return zr(m.translate(b,v),r),Ea(r,"x",b+o)|Ea(r,"y",v+o)&&(r.bounds=It,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function kf(e,t,n,i,r,s,o,a){const u=t.bounds;if(t.auto){const l=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const SS=(e,t)=>Math.floor(Math.min(e,t)),CS=(e,t)=>Math.ceil(Math.max(e,t));function Vq(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],s=r.items,r.marktype===Lc)switch(r.role){case ax:case lx:case ux:break;case GO:o.rowheaders.push(...s);break;case HO:o.rowfooters.push(...s);break;case XO:o.colheaders.push(...s);break;case YO:o.colfooters.push(...s);break;case VO:o.rowtitle=s[0];break;case KO:o.coltitle=s[0];break;default:o.marks.push(...s)}return o}function Xq(e){return new ht().set(0,0,e.width||0,e.height||0)}function Yq(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function We(e,t,n){const i=Y(e)?e[t]:e;return i??(n!==void 0?n:0)}function $S(e){return e<0?Math.ceil(-e):0}function s5(e,t,n){var i=!n.nodirty,r=n.bounds===fx?Xq:Yq,s=It.set(0,0,0,0),o=We(n.align,fs),a=We(n.align,ds),u=We(n.padding,fs),l=We(n.padding,ds),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),p=Array(c),g=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),E=Array(d),w,A,C,S,F,k,P,U,_,$,D;for(A=0;A<c;++A)p[A]=0;for(A=0;A<f;++A)y[A]=0;for(A=0;A<d;++A)k=t[A],F=E[A]=r(k),k.x=k.x||0,v[A]=0,k.y=k.y||0,x[A]=0,C=A%c,S=~~(A/c),g=Math.max(g,P=Math.ceil(F.x2)),b=Math.max(b,U=Math.ceil(F.y2)),p[C]=Math.max(p[C],P),y[S]=Math.max(y[S],U),h[A]=u+$S(F.x1),m[A]=l+$S(F.y1),i&&e.dirty(t[A]);for(A=0;A<d;++A)A%c===0&&(h[A]=0),A<c&&(m[A]=0);if(o===w1)for(C=1;C<c;++C){for(D=0,A=C;A<d;A+=c)D<h[A]&&(D=h[A]);for(A=C;A<d;A+=c)h[A]=D+p[C-1]}else if(o===$f){for(D=0,A=0;A<d;++A)A%c&&D<h[A]&&(D=h[A]);for(A=0;A<d;++A)A%c&&(h[A]=D+g)}else for(o=!1,C=1;C<c;++C)for(A=C;A<d;A+=c)h[A]+=p[C-1];if(a===w1)for(S=1;S<f;++S){for(D=0,A=S*c,w=A+c;A<w;++A)D<m[A]&&(D=m[A]);for(A=S*c;A<w;++A)m[A]=D+y[S-1]}else if(a===$f){for(D=0,A=c;A<d;++A)D<m[A]&&(D=m[A]);for(A=c;A<d;++A)m[A]=D+b}else for(a=!1,S=1;S<f;++S)for(A=S*c,w=A+c;A<w;++A)m[A]+=y[S-1];for(_=0,A=0;A<d;++A)_=h[A]+(A%c?_:0),v[A]+=_-t[A].x;for(C=0;C<c;++C)for($=0,A=C;A<d;A+=c)$+=m[A],x[A]+=$-t[A].y;if(o&&We(n.center,fs)&&f>1)for(A=0;A<d;++A)F=o===$f?g:p[A%c],_=F-E[A].x2-t[A].x-v[A],_>0&&(v[A]+=_/2);if(a&&We(n.center,ds)&&c!==1)for(A=0;A<d;++A)F=a===$f?b:y[~~(A/c)],$=F-E[A].y2-t[A].y-x[A],$>0&&(x[A]+=$/2);for(A=0;A<d;++A)s.union(E[A].translate(v[A],x[A]));switch(_=We(n.anchor,Mq),$=We(n.anchor,Tq),We(n.anchor,fs)){case Kt:_-=s.width();break;case A1:_-=s.width()/2}switch(We(n.anchor,ds)){case Kt:$-=s.height();break;case A1:$-=s.height()/2}for(_=Math.round(_),$=Math.round($),s.clear(),A=0;A<d;++A)t[A].mark.bounds.clear();for(A=0;A<d;++A)k=t[A],k.x+=v[A]+=_,k.y+=x[A]+=$,s.union(k.mark.bounds.union(k.bounds.translate(v[A],x[A]))),i&&e.dirty(k);return s}function Kq(e,t,n){var i=Vq(t),r=i.marks,s=n.bounds===fx?Jq:Qq,o=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,p,g,m;const y=s5(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(g=We(n.headerBand,ds,null),c=Df(e,i.rowheaders,r,a,u,-We(o,"rowHeader"),SS,0,s,"x1",0,a,1,g)),i.colheaders&&(g=We(n.headerBand,fs,null),f=Df(e,i.colheaders,r,a,a,-We(o,"columnHeader"),SS,1,s,"y1",0,1,a,g)),i.rowfooters&&(g=We(n.footerBand,ds,null),d=Df(e,i.rowfooters,r,a,u,We(o,"rowFooter"),CS,0,s,"x2",a-1,a,1,g)),i.colfooters&&(g=We(n.footerBand,fs,null),h=Df(e,i.colfooters,r,a,a,We(o,"columnFooter"),CS,1,s,"y2",l-a,1,a,g)),i.rowtitle&&(p=We(n.titleAnchor,ds),m=We(o,"rowTitle"),m=p===Kt?d+m:c-m,g=We(n.titleBand,ds,.5),FS(e,i.rowtitle,m,0,y,g)),i.coltitle&&(p=We(n.titleAnchor,fs),m=We(o,"columnTitle"),m=p===Kt?h+m:f-m,g=We(n.titleBand,fs,.5),FS(e,i.coltitle,m,1,y,g))}function Jq(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function Qq(e,t){return e.bounds[t]}function Df(e,t,n,i,r,s,o,a,u,l,c,f,d,h){var p=n.length,g=0,m=0,y,b,v,x,E,w,A,C,S;if(!p)return g;for(y=c;y<p;y+=f)n[y]&&(g=o(g,u(n[y],l)));if(!t.length)return g;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(w=t[b],E=w.mark.bounds,v=y;v>=0&&(A=n[v])==null;v-=d);a?(C=h==null?A.x:Math.round(A.bounds.x1+h*A.bounds.width()),S=g):(C=g,S=h==null?A.y:Math.round(A.bounds.y1+h*A.bounds.height())),E.union(w.bounds.translate(C-(w.x||0),S-(w.y||0))),w.x=C,w.y=S,e.dirty(w),m=o(m,E[l])}return m}function FS(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function Zq(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function eW(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function tW(e,t,n,i,r,s,o){const a=Zq(n,t),u=eW(e,a("offset",0)),l=a("anchor",ox),c=a("frame",Lc),f=l===Kt?1:l===A1?.5:0,d=c===bS?i.x1+f*i.width():f*(s||r.width()+2*r.x1),h=c===bS?r.y1+f*r.height():f*(o||i.height()+2*i.y1),p={align:w1,bounds:a("bounds",fx),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case di:p.anchor={x:Math.floor(i.x1)-u,column:Kt,y:h,row:l};break;case pi:p.anchor={x:Math.ceil(i.x2)+u,y:h,row:l};break;case Va:p.anchor={y:Math.floor(r.y1)-u,row:Kt,x:d,column:l};break;case Cs:p.anchor={y:Math.ceil(r.y2)+u,x:d,column:l};break;case Dq:p.anchor={x:u,y:u};break;case _q:p.anchor={x:s-u,y:u,column:Kt};break;case Oq:p.anchor={x:u,y:o-u,row:Kt};break;case Rq:p.anchor={x:s-u,y:o-u,column:Kt,row:Kt};break}return p}function nW(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),rW(e,n,n.items[0].items[0]),s=iW(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===Pq&&sW(n.items[0].items[0].items[0].items),r!==cx&&(n.x=o=0,n.y=a=0),n.width=u,n.height=l,zr(s.set(o,a,o+u,a+l),n),n.mark.bounds.clear().union(s),n}function iW(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.empty()&&(t.x2=e.padding,t.y2=e.padding),t.x1=e.padding,t.y1=e.padding,t}function rW(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&Gu(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,u=t.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case di:r+=Math.ceil(o.bounds.width())+u;break;case pi:case Cs:break;default:s+=o.bounds.height()+u}switch((r||s)&&Gu(e,n,r,s),o.orient){case di:c+=ua(t,n,o,a,1,1);break;case pi:l+=ua(t,n,o,Kt,0,0)+u,c+=ua(t,n,o,a,1,1);break;case Cs:l+=ua(t,n,o,a,0,0),c+=ua(t,n,o,Kt,-1,0,1)+u;break;default:l+=ua(t,n,o,a,0,0)}(l||c)&&Gu(e,o,l,c),(l=Math.round(o.bounds.x1-i))<0&&(Gu(e,n,-l,0),Gu(e,o,-l,0))}}function ua(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(s||!u)&&!o?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,h=r<=0?0:Xv(n);return Math.round(i===ox?f:i===Kt?d-h:.5*(c-h))}function Gu(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function sW(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function oW(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===di||a===pi?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==Lc?a===di?(p=r.y2,h=r.y1):a===pi?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===di&&(p=i,h=0),v=u===ox?p:u===Kt?h:(p+h)/2,d&&d.text){switch(a){case Va:case Cs:b=f.bounds.height()+c;break;case di:y=f.bounds.width()+c;break;case pi:y=-f.bounds.width()-c;break}It.clear().union(d.bounds),It.translate(y-(d.x||0),b-(d.y||0)),Ea(d,"x",y)|Ea(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(It),d.mark.bounds.clear().union(It),e.dirty(d)),It.clear().union(d.bounds)}else It.clear();switch(It.union(f.bounds),a){case Va:g=v,m=r.y1-It.height()-l;break;case di:g=r.x1-It.width()-l,m=v;break;case pi:g=r.x2+It.width()+l,m=v;break;case Cs:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return Ea(s,"x",g)|Ea(s,"y",m)&&(It.translate(g,m),e.dirty(s),s.bounds.clear().union(It),t.bounds.clear().union(It),e.dirty(s)),s.bounds}function o5(e){O.call(this,null,e)}V(o5,O,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&Kq(n,i,e.layout),uW(n,i,e)}),aW(e.mark.group)?t.reflow():t}});function aW(e){return e&&e.mark.role!=="legend-entry"}function uW(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new ht().set(0,0,r,s),a=o.clone(),u=o.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p<g;++p)switch(f=i[p],f.role){case ax:h=Wq(f)?a:u,h.union(Hq(e,f,r,s));break;case ux:c=f;break;case lx:l.push(nW(e,f));break;case Nq:case Iq:case GO:case HO:case VO:case XO:case YO:case KO:a.union(f.bounds),u.union(f.bounds);break;default:o.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||pi,d!==cx&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];s5(e,b,tW(b,y,n.legends,a,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===JO||n.autosize.type===QO||n.autosize.type===ZO))switch(y.orient){case di:case pi:o.add(b.x1,0).add(b.x2,0);break;case Va:case Cs:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(u),c&&o.union(oW(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),lW(e,t,o,n)}function lW(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===Lq){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===cx?(l=0,f=0,u=o,c=a):s===JO?(u=Math.max(0,o-l-d),c=Math.max(0,a-f-h)):s===QO?(u=Math.max(0,o-l-d),a=c+f+h):s===ZO?(o=u+l+d,c=Math.max(0,a-f-h)):s===Bq&&(o=u+l+d,a=c+f+h),e._resizeView(o,a,u,c,[l,f],r.resize)}const cW=Object.freeze(Object.defineProperty({__proto__:null,bound:e5,identifier:dx,mark:t5,overlap:n5,render:r5,viewlayout:o5},Symbol.toStringTag,{value:"Module"}));function a5(e){O.call(this,null,e)}V(a5,O,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=_v(s,o,e.minstep),u=e.format||N_(n,s,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?T_(s,e.values,a):Ov(s,a);return r&&(i.rem=r),r=l.map((c,f)=>Fe({index:f/(l.length-1||1),tickIndex:f,value:c,label:u(c)})),e.extra&&r.length&&r.push(Fe({index:-1,tickIndex:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function u5(e){O.call(this,null,e)}function fW(){return Fe({})}function dW(e){const t=bu().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}V(u5,O,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||fW,s=e.key||re,o=this.value;return N(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&R("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=dW(s)),t.visit(t.ADD,a=>{const u=s(a);let l=o.get(u);l?l.exit?(o.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),o.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=s(a),l=o.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=s(a),l=o.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function l5(e){O.call(this,null,e)}V(l5,O,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(N(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||Kr,u=r.enter||Kr,l=r.exit||Kr,c=(s&&!o?r[s]:a)||Kr;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==Kr&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==Kr&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),o||c!==Kr){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function c5(e){O.call(this,[],e)}V(c5,O,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||Qf,o=e.scale,a=+e.limit,u=_v(o,e.count==null?5:e.count,e.minstep),l=!!e.values||s===Qf,c=e.format||B_(n,o,u,s,e.formatSpecifier,e.formatType,l),f=e.values||P_(o,u),d,h,p,g,m;return r&&(i.rem=r),s===Qf?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,de(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=Ht(g=p||8),r=r.map((y,b)=>Fe({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(Fe({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===Lz?(d=o.domain(),h=O_(o,d[0],ye(d)),f.length<3&&!e.values&&d[0]!==ye(d)&&(f=[d[0],ye(d)]),r=f.map((y,b)=>Fe({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=Xz(o),r=f.map((y,b)=>Fe({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const hW=e=>e.source.x,pW=e=>e.source.y,gW=e=>e.target.x,mW=e=>e.target.y;function hx(e){O.call(this,{},e)}hx.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};V(hx,O,{transform(e,t){var n=e.sourceX||hW,i=e.sourceY||pW,r=e.targetX||gW,s=e.targetY||mW,o=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=kS.get(u+"-"+a)||kS.get(u);return l||R("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const f5=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,yW=(e,t,n,i)=>f5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),d5=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},bW=(e,t,n,i)=>d5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),h5=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},vW=(e,t,n,i)=>h5(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),xW=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,EW=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,AW=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},wW=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},SW=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},CW=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*o+","+u*a+" "+i*o+","+i*a},kS=bu({line:f5,"line-radial":yW,arc:d5,"arc-radial":bW,curve:h5,"curve-radial":vW,"orthogonal-horizontal":xW,"orthogonal-vertical":EW,"orthogonal-radial":AW,"diagonal-horizontal":wW,"diagonal-vertical":SW,"diagonal-radial":CW});function px(e){O.call(this,null,e)}px.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};V(px,O,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||pu,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=o,d=(a-o)/nk(l),h=On(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p<c;++p)m=l[h[p]],g=u[h[p]],g[i]=f,g[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const DS=5;function $W(e){const t=e.type;return!e.bins&&(t===Ua||t===Sc||t===Cc)}function p5(e){return $v(e)&&e!==Hi}const FW=vi(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function g5(e){O.call(this,null,e),this.modified(!0)}V(g5,O,{transform(e,t){var n=t.dataflow,i=this.value,r=kW(e);(!i||r!==i.type)&&(this.value=i=$e(r)());for(r in e)if(!FW[r]){if(r==="padding"&&p5(i.type))continue;de(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return TW(i,e,MW(i,e,_W(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function kW(e){var t=e.type,n="",i;return t===Hi?Hi+"-"+Ua:(DW(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Hi+"-":i===3?Au+"-":""),(n+t||Ua).toLowerCase())}function DW(e){const t=e.type;return $v(t)&&t!==xo&&t!==Eo&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function _W(e,t,n){const i=OW(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&$W(e),a,u;if(!r)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return p5(s)&&t.padding&&r[0]!==ye(r)&&(r=RW(s,r,t.range,t.padding,t.exponent,t.constant)),e.domain(m5(s,r,n)),s===Yd&&e.unknown(t.domainImplicit?v9:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&_v(e,t.nice)||null),r.length}function OW(e,t,n){return t?(e.domain(m5(e.type,t,n)),t.length):-1}function RW(e,t,n,i,r,s){var o=Math.abs(ye(n)-n[0]),a=o/(o-2*i),u=e===Tr?mb(t,null,a):e===Cc?Hd(t,null,a,.5):e===Sc?Hd(t,null,a,r||1):e===hp?yb(t,null,a,s||1):gb(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function m5(e,t,n){if(Fv(e)){var i=Math.abs(t.reduce((r,s)=>r+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+H(t))}return t}function MW(e,t,n){let i=t.bins;if(i&&!N(i)){const r=e.domain(),s=r[0],o=ye(r),a=i.step;let u=i.start==null?s:i.start,l=i.stop==null?o:i.stop;a||R("Scale bins parameter missing step property."),u<s&&(u=a*Math.ceil(s/a)),l>o&&(l=a*Math.floor(o/a)),i=On(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===wv&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function TW(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=NW(i,t,n);else if(t.scheme&&(s=IW(i,t,n),de(s))){if(e.interpolator)return e.interpolator(s);R(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&F_(i))return e.interpolator(mp(S1(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(kv(t.interpolate,t.interpolateGamma)):de(e.round)?e.round(r):de(e.rangeRound)&&e.interpolate(r?Ph:mc),s&&e.range(S1(s,t.reverse))}function NW(e,t,n){e!==x_&&e!==l1&&R("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===l1?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Av(n,r,i)]}function IW(e,t,n){var i=t.schemeExtent,r,s;return N(t.scheme)?s=mp(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=Dv(r),s||R(`Unrecognized scheme name: ${t.scheme}`)),n=e===gp?n+1:e===wv?n-1:e===Yd?+t.schemeCount||n||DS:e===ja||e===pp?+t.schemeCount||DS:n,F_(e)?_S(s,i,t.reverse):de(s)?__(_S(s,i),n):e===Yd?s:s.slice(0,n)}function _S(e,t,n){return de(e)&&(t||n)?D_(e,S1(t||[0,1],n)):e}function S1(e,t){return t?e.slice().reverse():e}function y5(e){O.call(this,null,e)}V(y5,O,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(jo(e.sort)),this.modified(n),t}});const OS="zero",b5="center",v5="normalize",x5=["y0","y1"];function gx(e){O.call(this,null,e)}gx.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:OS,values:[OS,b5,v5]},{name:"as",type:"string",array:!0,length:2,default:x5}]};V(gx,O,{transform(e,t){var n=e.as||x5,i=n[0],r=n[1],s=jo(e.sort),o=e.field||pu,a=e.offset===b5?LW:e.offset===v5?PW:BW,u,l,c,f;for(u=zW(t.source,e.groupby,s,o),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,o,i,r);return t.reflow(e.modified()).modifies(n)}});function LW(e,t,n,i,r){for(var s=(t-e.sum)/2,o=e.length,a=0,u;a<o;++a)u=e[a],u[i]=s,u[r]=s+=Math.abs(n(u))}function PW(e,t,n,i,r){for(var s=1/e.sum,o=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=o,c[r]=o=s*(l+=Math.abs(n(c)))}function BW(e,t,n,i,r){for(var s=0,o=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=o,c[r]=o+=l):(c[i]=s,c[r]=s+=l)}function zW(e,t,n,i){var r=[],s=g=>g(c),o,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,u=e.length;a<u;++a)c=e[a],f=JSON.stringify(t.map(s)),d=o[f],d||(o[f]=d=[],r.push(d)),d.push(c);for(f=0,p=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>p&&(p=h),n&&d.sort(n)}return r.max=p,r}const UW=Object.freeze(Object.defineProperty({__proto__:null,axisticks:a5,datajoin:u5,encode:l5,legendentries:c5,linkpath:hx,pie:px,scale:g5,sortitems:y5,stack:gx},Symbol.toStringTag,{value:"Module"}));var jW=Math.abs,C1=Math.cos,ch=Math.sin,qW=1e-6,E5=Math.PI,$1=E5/2,RS=WW(2);function MS(e){return e>1?$1:e<-1?-$1:Math.asin(e)}function WW(e){return e>0?Math.sqrt(e):0}function GW(e,t){var n=e*ch(t),i=30,r;do t-=r=(t+ch(t)-n)/(1+C1(t));while(jW(r)>qW&&--i>0);return t/2}function HW(e,t,n){function i(r,s){return[e*r*C1(s=GW(n,s)),t*ch(s)]}return i.invert=function(r,s){return s=MS(s/t),[r/(e*C1(s)),MS((2*s+ch(2*s))/n)]},i}var VW=HW(RS/$1,RS,E5);function XW(){return rr(VW).scale(169.529)}const YW=Pk(),F1=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function KW(e,t){return function n(){const i=t();return i.type=e,i.path=Pk().projection(i),i.copy=i.copy||function(){const r=n();return F1.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},S_(i)}}function mx(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(fh[e]=KW(e,t),this):fh[e]||null}function A5(e){return e&&e.path||YW}const fh={albers:zk,albersusa:bL,azimuthalequalarea:vL,azimuthalequidistant:xL,conicconformal:wL,conicequalarea:jd,conicequidistant:$L,equalEarth:kL,equirectangular:SL,gnomonic:DL,identity:_L,mercator:EL,mollweide:XW,naturalEarth1:OL,orthographic:RL,stereographic:ML,transversemercator:TL};for(const e in fh)mx(e,fh[e]);function JW(){}const mr=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function w5(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),QW(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h<p;++h)if(ZW((g=c[h])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function s(u,l,c){var f=[],d=[],h,p,g,m,y,b;for(h=p=-1,m=u[0]>=l,mr[m<<1].forEach(v);++h<e-1;)g=m,m=u[h+1]>=l,mr[g|m<<1].forEach(v);for(mr[m<<0].forEach(v);++p<t-1;){for(h=-1,m=u[p*e+e]>=l,y=u[p*e]>=l,mr[m<<1|y<<2].forEach(v);++h<e-1;)g=m,m=u[p*e+e+h+1]>=l,b=y,y=u[p*e+h+1]>=l,mr[g|m<<1|y<<2|b<<3].forEach(v);mr[m|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,mr[y<<2].forEach(v);++h<e-1;)b=y,y=u[p*e+h+1]>=l,mr[y<<2|b<<3].forEach(v);mr[y<<3].forEach(v);function v(x){var E=[x[0][0]+h,x[0][1]+p],w=[x[1][0]+h,x[1][1]+p],A=o(E),C=o(w),S,F;(S=d[A])?(F=f[C])?(delete d[S.end],delete f[F.start],S===F?(S.ring.push(w),c(S.ring)):f[S.start]=d[F.end]={start:S.start,end:F.end,ring:S.ring.concat(F.ring)}):(delete d[S.end],S.ring.push(w),d[S.end=C]=S):(S=f[C])?(F=d[A])?(delete f[S.start],delete d[F.end],S===F?(S.ring.push(w),c(S.ring)):f[F.start]=d[S.end]={start:F.start,end:S.end,ring:F.ring.concat(S.ring)}):(delete f[S.start],S.ring.unshift(E),f[S.start=A]=S):f[A]=d[C]={start:A,end:C,ring:[E,w]}}}function o(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d<e&&p===d&&(m=l[g*e+p-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&g===h&&(m=l[(g-1)*e+p],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||R("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:JW,i):n===a},i}function QW(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function ZW(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=eG(e,t[n]))return r;return 0}function eG(e,t){for(var n=t[0],i=t[1],r=-1,s=0,o=e.length,a=o-1;s<o;a=s++){var u=e[s],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(tG(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function tG(e,t,n){var i;return nG(e,t,n)&&iG(e[i=+(e[0]===t[0])],n[i],t[i])}function nG(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function iG(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function S5(e,t,n){return function(i){var r=Ji(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,u=t?Na(s,o,e):a/(e+1);return On(s+u,o,u)}}function yx(e){O.call(this,null,e)}yx.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};V(yx,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||xn,s=w5().smooth(e.smooth!==!1),o=e.thresholds||rG(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,N(o)?o:o(c.values));sG(f,c,l,e),f.forEach(d=>{u.push(rp(l,Fe(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function rG(e,t,n){const i=S5(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>ao(t(r).values)))}function sG(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(de(r)&&(r=r(n,i)),de(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=(Ce(r)?r:r[0])||1,a=(Ce(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(C5(t,o,a,u,l))}function C5(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(u),f}}function TS(e,t,n){const i=e>=0?e:Ib(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function p0(e){return de(e)?e:Ht(+e)}function $5(){var e=u=>u[0],t=u=>u[1],n=pu,i=[-1,-1],r=960,s=500,o=2;function a(u,l){const c=TS(i[0],u,e)>>o,f=TS(i[1],u,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(x=>{const E=d+(+e(x)>>o),w=h+(+t(x)>>o);E>=0&&E<p&&w>=0&&w<g&&(m[E+w*p]+=+n(x))}),c>0&&f>0?(la(p,g,m,y,c),ca(p,g,y,m,f),la(p,g,m,y,c),ca(p,g,y,m,f),la(p,g,m,y,c),ca(p,g,y,m,f)):c>0?(la(p,g,m,y,c),la(p,g,y,m,c),la(p,g,m,y,c),b=y):f>0&&(ca(p,g,m,y,f),ca(p,g,y,m,f),ca(p,g,m,y,f),b=y);const v=l?Math.pow(2,-2*o):1/nk(b);for(let x=0,E=p*g;x<E;++x)b[x]*=v;return{values:b,scale:1<<o,width:p,height:g,x1:d,y1:h,x2:d+(r>>o),y2:h+(s>>o)}}return a.x=function(u){return arguments.length?(e=p0(u),a):e},a.y=function(u){return arguments.length?(t=p0(u),a):t},a.weight=function(u){return arguments.length?(n=p0(u),a):n},a.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||R("invalid size"),r=l,s=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||R("invalid cell size"),o=Math.floor(Math.log(u)/Math.LN2),a):1<<o},a.bandwidth=function(u){return arguments.length?(u=J(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&R("invalid bandwidth"),i=u,a):i},a}function la(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<t;++o)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+o*e]),a>=r&&(a>=s&&(u-=n[a-s+o*e]),i[a-r+o*e]=u/Math.min(a+1,e-1+s-a,s))}function ca(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<e;++o)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[o+a*e]),a>=r&&(a>=s&&(u-=n[o+(a-s)*e]),i[o+(a-r)*e]=u/Math.min(a+1,t-1+s-a,s))}function bx(e){O.call(this,null,e)}bx.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const oG=["x","y","weight","size","cellSize","bandwidth"];function F5(e,t){return oG.forEach(n=>t[n]!=null?e[n](t[n]):0),e}V(bx,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=aG(i,e.groupby),s=(e.groupby||[]).map(it),o=F5($5(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<s.length;++d)c[s[d]]=f[d];return c}return u=r.map(c=>Fe(l({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function aG(e,t){var n=[],i=c=>c(a),r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function vx(e){O.call(this,null,e)}vx.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};V(vx,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=w5().smooth(e.smooth!==!1),r=e.values,s=e.thresholds||S5(e.count||10,e.nice,!!r),o=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=F5($5(),e)(r,!0),u=C5(a,a.scale||1,a.scale||1,0,0),o=[a.width,a.height],r=a.values),s=N(s)?s:s(r),r=i.size(o)(r,s),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Fe),n}});const k1="Feature",xx="FeatureCollection",uG="MultiPoint";function Ex(e){O.call(this,null,e)}Ex.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};V(Ex,O,{transform(e,t){var n=this._features,i=this._points,r=e.fields,s=r&&r[0],o=r&&r[1],a=e.geojson||!r&&xn,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(zt(a))||s&&t.modified(zt(s))||o&&t.modified(zt(o)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),s&&o&&(t.visit(u,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:k1,geometry:{type:uG,coordinates:i}})),this.value={type:xx,features:n}}});function Ax(e){O.call(this,null,e)}Ax.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};V(Ax,O,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||xn,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=A5(e.projection),n.materialize().reflow()):o=r===xn||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=lG(i,e.pointRadius);return n.visit(o,u=>u[s]=i(r(u))),i.pointRadius(a),n.modifies(s)}});function lG(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function wx(e){O.call(this,null,e)}wx.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};V(wx,O,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function Sx(e){O.call(this,null,e)}Sx.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};V(Sx,O,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=cG(A5(e.projection),e.field||Qn("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function cG(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function Cx(e){O.call(this,[],e),this.generator=J4()}Cx.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};V(Cx,O,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)de(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(k3(n[0],r)):t.add.push(Fe(r)),n[0]=r,t}});function $x(e){O.call(this,null,e)}$x.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};V($x,O,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||xn,s=dG(e.opacity,e),o=fG(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?ao(n.map(l=>ao(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=he({},l,u);i||(f.$max=ao(c.values||[])),l[a]=hG(c,f,o.dep?o:Ht(o(f)),s.dep?s:Ht(s(f)))}),t.reflow(!0).modifies(a)}});function fG(e,t){let n;return de(e)?(n=i=>bd(e(i,t)),n.dep=k5(e)):n=Ht(bd(e||"#888")),n}function dG(e,t){let n;return de(e)?(n=i=>e(i,t),n.dep=k5(e)):e?n=Ht(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function k5(e){if(!de(e))return!1;const t=vi(zt(e));return t.$x||t.$y||t.$value||t.$max}function hG(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:rs,d=ys(u-o,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-o,l-a),g=p.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=o,v=m*r;b<u;++b,y+=4){t.$x=b-o,t.$value=f(b+v);const x=n(t);g[y+0]=x.r,g[y+1]=x.g,g[y+2]=x.b,g[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}function D5(e){O.call(this,null,e),this.modified(!0)}V(D5,O,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=gG(e.type),F1.forEach(i=>{e[i]!=null&&NS(n,i,e[i])})):F1.forEach(i=>{e.modified(i)&&NS(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&pG(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function pG(e,t){const n=mG(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function gG(e){const t=mx((e||"mercator").toLowerCase());return t||R("Unrecognized projection type: "+e),t()}function NS(e,t,n){de(e[t])&&e[t](n)}function mG(e){return e=J(e),e.length===1?e[0]:{type:xx,features:e.reduce((t,n)=>t.concat(yG(n)),[])}}function yG(e){return e.type===xx?e.features:J(e).filter(t=>t!=null).map(t=>t.type===k1?t:{type:k1,geometry:t})}const bG=Object.freeze(Object.defineProperty({__proto__:null,contour:vx,geojson:Ex,geopath:Ax,geopoint:wx,geoshape:Sx,graticule:Cx,heatmap:$x,isocontour:yx,kde2d:bx,projection:D5},Symbol.toStringTag,{value:"Module"})),IS={center:XI,collide:h4,nbody:S4,link:g4,x:C4,y:$4},xl="forces",D1=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],vG=["static","iterations"],_5=["x","y","vx","vy"];function Fx(e){O.call(this,null,e)}Fx.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:_5}]};V(Fx,O,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(D1),s=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&O5(n,e,0,t)):(this.value=n=EG(t.source,e),n.on("tick",xG(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(vG)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/s)),e.static)for(n.stop();--s>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==xl||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,s=i.length,o;r<s;++r)if(i[r].name==="links"&&(o=i[r].op.source)){n.pulse(o,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(_5)}});function xG(e,t){return()=>e.touch(t).run()}function EG(e,t){const n=w4(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),O5(n,t,!0).on("end",()=>s=!0)}function O5(e,t,n,i){var r=J(t.forces),s,o,a,u;for(s=0,o=D1.length;s<o;++s)a=D1[s],a!==xl&&t.modified(a)&&e[a](t[a]);for(s=0,o=r.length;s<o;++s)u=xl+s,a=n||t.modified(xl,s)?wG(r[s]):i&&AG(r[s],i)?e.force(u):null,a&&e.force(u,a);for(o=e.numForces||0;s<o;++s)e.force(xl+s,null);return e.numForces=r.length,e}function AG(e,t){var n,i;for(n in e)if(de(i=e[n])&&t.modified(zt(i)))return 1;return 0}function wG(e){var t,n;Q(IS,e.force)||R("Unrecognized force: "+e.force),t=IS[e.force]();for(n in e)de(t[n])&&SG(t[n],e[n],e);return t}function SG(e,t,n){e(de(t)?i=>t(i,n):t)}const CG=Object.freeze(Object.defineProperty({__proto__:null,force:Fx},Symbol.toStringTag,{value:"Module"}));function _1(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function kx(e){O.call(this,null,e)}kx.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const $G=e=>e.values;V(kx,O,{transform(e,t){t.source||R("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&ip(o.data)&&r.rem.push(o.data)}),this.value=s=$9({values:J(e.keys).reduce((o,a)=>(o.key(a),o),FG()).entries(r.source)},$G),n&&s.each(o=>{o.children&&(o=Fe(o.data),r.add.push(o),r.source.push(o))}),_1(s,re,re)),r.source.root=s,r}});function FG(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],u={},l={};let c=-1,f,d,h;for(;++c<o;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],s);return l}function i(r,s){if(++s>e.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Ur(e){O.call(this,null,e)}const kG=(e,t)=>e.parent===t.parent?1:2;V(Ur,O,{transform(e,t){(!t.source||!t.source.root)&&R(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(jo(e.sort,o=>o.data)),DG(n,this.params,e),n.separation&&n.separation(e.separation!==!1?kG:pu);try{this.value=n(r)}catch(o){R(o)}return r.each(o=>_G(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function DG(e,t,n){for(let i,r=0,s=t.length;r<s;++r)i=t[r],i in n&&e[i](n[i])}function _G(e,t,n){const i=e.data,r=t.length-1;for(let s=0;s<r;++s)i[n[s]]=e[t[s]];i[n[r]]=e.children?e.children.length:0}const O1=["x","y","r","depth","children"];function Dx(e){Ur.call(this,e)}Dx.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:O1.length,default:O1}]};V(Dx,Ur,{layout:e7,params:["radius","size","padding"],fields:O1});const R1=["x0","y0","x1","y1","depth","children"];function _x(e){Ur.call(this,e)}_x.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:R1.length,default:R1}]};V(_x,Ur,{layout:t7,params:["size","round","padding"],fields:R1});function Ox(e){O.call(this,null,e)}Ox.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};V(Ox,O,{transform(e,t){t.source||R("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),s=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),s&&(n=r.source.length?_1(bw().id(e.key).parentId(e.parentKey)(r.source),e.key,Zn):_1(bw()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const LS={tidy:f7,cluster:jL},M1=["x","y","depth","children"];function Rx(e){Ur.call(this,e)}Rx.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:M1.length,default:M1}]};V(Rx,Ur,{layout(e){const t=e||"tidy";if(Q(LS,t))return LS[t]();R("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:M1});function Mx(e){O.call(this,[],e)}Mx.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};V(Mx,O,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),s={};return i||R("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,o=>s[re(o)]=1),i.each(o=>{const a=o.data,u=o.parent&&o.parent.data;u&&s[re(a)]&&s[re(u)]&&r.add.push(Fe({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[re(o)]=1),n.forEach(o=>{(s[re(o.source)]||s[re(o.target)])&&r.mod.push(o)})),r}});const PS={binary:d7,dice:Uh,slice:Uy,slicedice:h7,squarify:k9,resquarify:p7},T1=["x0","y0","x1","y1","depth","children"];function Tx(e){Ur.call(this,e)}Tx.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:T1.length,default:T1}]};V(Tx,Ur,{layout(){const e=F9();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Q(PS,t)?e.tile(PS[t]):R("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:T1});const OG=Object.freeze(Object.defineProperty({__proto__:null,nest:kx,pack:Dx,partition:_x,stratify:Ox,tree:Rx,treelinks:Mx,treemap:Tx},Symbol.toStringTag,{value:"Module"})),g0=4278190080;function RG(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function MG(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,u=ys(s,o).getContext("2d"),l=ys(s,o).getContext("2d"),c=a&&ys(s,o).getContext("2d");n.forEach(C=>ad(u,C,!1)),ad(l,t,!1),a&&ad(c,t,!0);const f=m0(u,s,o),d=m0(l,s,o),h=a&&m0(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,E,w,A;for(y=0;y<o;++y)for(m=0;m<s;++m)x=y*s+m,E=f[x]&g0,A=d[x]&g0,w=a&&h[x]&g0,(E||w||A)&&(b=e(m),v=e(y),!r&&(E||A)&&p.set(b,v),a&&(E||w)&&g.set(b,v));return[p,g]}function m0(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function ad(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(s=>ad(e,s.items,n))}):Bn[i].draw(e,{items:n?t.map(TG):t})}function TG(e){const t=rp(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const yr=5,Xt=31,Zl=32,ns=new Uint32Array(Zl+1),fi=new Uint32Array(Zl+1);fi[0]=0;ns[0]=~fi[0];for(let e=1;e<=Zl;++e)fi[e]=fi[e-1]<<1|1,ns[e]=~fi[e];function NG(e,t){const n=new Uint32Array(~~((e*t+Zl)/Zl));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>yr]&1<<(a&Xt)},set:(s,o)=>{const a=o*e+s;i(a>>>yr,1<<(a&Xt))},clear:(s,o)=>{const a=o*e+s;r(a>>>yr,~(1<<(a&Xt)))},getRange:(s,o,a,u)=>{let l=u,c,f,d,h;for(;l>=o;--l)if(c=l*e+s,f=l*e+a,d=c>>>yr,h=f>>>yr,d===h){if(n[d]&ns[c&Xt]&fi[(f&Xt)+1])return!0}else{if(n[d]&ns[c&Xt]||n[h]&fi[(f&Xt)+1])return!0;for(let p=d+1;p<h;++p)if(n[p])return!0}return!1},setRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>yr,d=c>>>yr,f===d)i(f,ns[l&Xt]&fi[(c&Xt)+1]);else for(i(f,ns[l&Xt]),i(d,fi[(c&Xt)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>yr,d=c>>>yr,f===d)r(f,fi[l&Xt]|ns[(c&Xt)+1]);else for(r(f,fi[l&Xt]),r(d,ns[(c&Xt)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(s,o,a,u)=>s<0||o<0||u>=t||a>=e}}function IG(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>NG(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function LG(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,u=a.length,l=o.datum.fontSize,c=Nn.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v<u;++v)d=a[v].x,p=a[v].y,h=a[v].x2===void 0?d:a[v].x2,g=a[v].y2===void 0?p:a[v].y2,m=(d+h)/2,y=(p+g)/2,b=Math.abs(h-d+g-p),b>=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=l/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&r<h&&(o.align="right"),o.baseline="middle",p<0&&g<=s?o.baseline="top":0<=p&&s<g&&(o.baseline="bottom"),!0}}function dh(e,t,n,i,r,s){let o=n/2;return e-o<0||e+o>r||t-(o=i/2)<0||t+o>s}function hs(e,t,n,i,r,s,o,a){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(l,f,c,d)||o.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function PG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!dh(p,g,d,h,r,s)&&!hs(e,p,g,h,d,m,o,a)&&!hs(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,hs(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Nn.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,E,w,A,C,S,F,k,P,U,_,$,D,I,G;for(let B=0;B<f;++B){for(b=c[B].x,x=c[B].y,v=c[B].x2===void 0?b:c[B].x2,E=c[B].y2===void 0?x:c[B].y2,b>v&&(G=b,b=v,v=G),x>E&&(G=x,x=E,E=G),F=e(b),P=e(v),k=~~((F+P)/2),U=e(x),$=e(E),_=~~((U+$)/2),C=k;C>=F;--C)for(S=_;S>=U;--S)I=u(C,S,p,h,d),I&&([l.x,l.y,p,g]=I);for(C=k;C<=P;++C)for(S=_;S<=$;++S)I=u(C,S,p,h,d),I&&([l.x,l.y,p,g]=I);!g&&!n&&(D=Math.abs(v-b+E-x),w=(b+v)/2,A=(x+E)/2,D>=y&&!dh(w,A,h,d,r,s)&&!hs(e,w,A,d,h,d,o,null)&&(y=D,l.x=w,l.y=A,m=!0))}return g||m?(w=h/2,A=d/2,o.setRange(e(l.x-w),e(l.y-A),e(l.x+w),e(l.y+A)),l.align="center",l.baseline="middle",!0):!1}}const BG=[-1,-1,1,1],zG=[-1,1,-1,1];function UG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Nn.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,E,w,A,C,S,F,k,P,U,_;for(let $=0;$<f;++$){for(v=c[$].x,E=c[$].y,x=c[$].x2===void 0?v:c[$].x2,w=c[$].y2===void 0?E:c[$].y2,p.push([e((v+x)/2),e((E+w)/2)]);p.length;)if([S,F]=p.pop(),!(o.get(S,F)||a.get(S,F)||u.get(S,F))){u.set(S,F);for(let D=0;D<4;++D)A=S+BG[D],C=F+zG[D],u.outOfBounds(A,C,A,C)||p.push([A,C]);if(A=e.invert(S),C=e.invert(F),k=g,P=s,!dh(A,C,h,d,r,s)&&!hs(e,A,C,d,h,k,o,a)&&!hs(e,A,C,d,h,d,o,null)){for(;P-k>=1;)U=(k+P)/2,hs(e,A,C,d,h,U,o,a)?P=U:k=U;k>g&&(l.x=A,l.y=C,g=k,m=!0)}}!m&&!n&&(_=Math.abs(x-v+w-E),A=(v+x)/2,C=(E+w)/2,_>=b&&!dh(A,C,h,d,r,s)&&!hs(e,A,C,d,h,d,o,null)&&(b=_,l.x=A,l.y=C,y=!0))}return m||y?(A=h/2,C=d/2,o.setRange(e(l.x-A),e(l.y-C),e(l.x+A),e(l.y+C)),l.align="center",l.baseline="middle",!0):!1}}const jG=["right","center","left"],qG=["bottom","middle","top"];function WG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,h,p,g,m,y,b,v,x,E,w,A,C,S,F,k;for(let P=0;P<u;++P){if(h=(n[P]&3)-1,p=(n[P]>>>2&3)-1,g=h===0&&p===0||i[P]<0,m=h&&p?Math.SQRT1_2:1,y=i[P]<0?-1:1,b=c[1+h]+i[P]*h*m,A=c[4+p]+y*f*p/2+i[P]*p*m,x=A-f/2,E=A+f/2,C=e(b),F=e(x),k=e(E),!d)if(BS(C,C,F,k,o,a,b,b,x,E,c,g))d=Nn.width(l.datum,l.datum.text);else continue;if(w=b+y*d*h/2,b=w-d/2,v=w+d/2,C=e(b),S=e(v),BS(C,S,F,k,o,a,b,v,x,E,c,g))return l.x=h?h*y<0?v:b:w,l.y=p?p*y<0?E:x:A,l.align=jG[h*y+1],l.baseline=qG[p*y+1],o.setRange(C,F,S,k),!0}return!1}}function BS(e,t,n,i,r,s,o,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const y0=0,b0=4,v0=8,x0=0,E0=1,A0=2,GG={"top-left":y0+x0,top:y0+E0,"top-right":y0+A0,left:b0+x0,middle:b0+E0,right:b0+A0,"bottom-left":v0+x0,bottom:v0+E0,"bottom-right":v0+A0},HG={naive:LG,"reduced-search":PG,floodfill:UG};function VG(e,t,n,i,r,s,o,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=XG(i,f),h=YG(r,f),p=KG(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=JG(p,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,E=-1;const w=e.map(F=>{const k=b?Nn.width(F,F.text):void 0;return x=Math.max(x,k),E=Math.max(E,F.fontSize),{datum:F,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(F),textWidth:k}});l=l===null||l===1/0?Math.max(x,E)+Math.max(...i):l;const A=IG(t[0],t[1],l);let C;if(!v){n&&w.sort((P,U)=>n(P.datum,U.datum));let F=!1;for(let P=0;P<h.length&&!F;++P)F=h[P]===5||d[P]<0;const k=(p&&o||m)&&e.map(P=>P.datum);C=s.length||k?MG(A,k||[],s,F,m):RG(A,o&&w)}const S=m?HG[c](A,C,o,u):WG(A,C,h,d);return w.forEach(F=>F.opacity=+S(F)),w}function XG(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function YG(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=GG[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function KG(e){return e&&e.mark&&e.mark.marktype}function JG(e,t,n,i){const r=s=>[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const N1=["x","y","opacity","align","baseline"],R5=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Nx(e){O.call(this,null,e)}Nx.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:R5},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:N1.length,default:N1}]};V(Nx,O,{transform(e,t){function n(s){const o=e[s];return de(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&R("Size parameter should be specified as a [width, height] array.");const r=e.as||N1;return VG(t.materialize(t.SOURCE).source||[],e.size,e.sort,J(e.offset==null?1:e.offset),J(e.anchor||R5),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const QG=Object.freeze(Object.defineProperty({__proto__:null,label:Nx},Symbol.toStringTag,{value:"Module"}));function M5(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Ix(e){O.call(this,null,e)}Ix.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};V(Ix,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=M5(i,e.groupby),s=(e.groupby||[]).map(it),o=s.length,a=e.as||[it(e.x),it(e.y)],u=[];r.forEach(l=>{H3(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<o;++d)f[s[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Fe(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const I1={constant:Xb,linear:Yb,log:j3,exp:q3,pow:W3,quad:Kb,poly:G3},ZG=(e,t)=>e==="poly"?t:e==="quad"?2:1;function Lx(e){O.call(this,null,e)}Lx.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(I1)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};V(Lx,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=M5(i,e.groupby),s=(e.groupby||[]).map(it),o=e.method||"linear",a=e.order==null?3:e.order,u=ZG(o,a),l=e.as||[it(e.x),it(e.y)],c=I1[o],f=[];let d=e.extent;Q(I1,o)||R("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(Fe({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Ji(h,e.x),y=b=>{const v={};for(let x=0;x<s.length;++x)v[s[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Fe(v))};o==="linear"||o==="constant"?m.forEach(b=>y([b,g.predict(b)])):fp(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const eH=Object.freeze(Object.defineProperty({__proto__:null,loess:Ix,regression:Lx},Symbol.toStringTag,{value:"Module"}));function Px(e){O.call(this,null,e)}Px.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const tH=[-1e5,-1e5,1e5,1e5];V(Px,O,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:tH;const s=this.value=Yy.from(i,e.x,e.y).voronoi(r);for(let o=0,a=i.length;o<a;++o){const u=s.cellPolygon(o);i[o][n]=u&&!iH(u)?nH(u):null}return t.reflow(e.modified()).modifies(n)}});function nH(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function iH(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const rH=Object.freeze(Object.defineProperty({__proto__:null,voronoi:Px},Symbol.toStringTag,{value:"Module"}));var w0=Math.PI/180,El=64,ud=2048;function sH(){var e=[256,256],t,n,i,r,s,o,a,u=T5,l=[],c=Math.random,f={};f.layout=function(){for(var p=d(ys()),g=fH((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(w=>({text:t(w),font:n(w),style:r(w),weight:s(w),rotate:o(w),size:~~(i(w)+1e-14),padding:a(w),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:w})).sort((w,A)=>A.size-w.size);++b<y;){var E=x[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,oH(p,E,x,b),E.hasText&&h(g,E,m)&&(v.push(E),m?uH(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(El<<5)/g,p.height=ud/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),x=u(e),E=c()<.5?1:-1,w=-E,A,C,S;(A=x(w+=E))&&(C=~~A[0],S=~~A[1],!(Math.min(Math.abs(C),Math.abs(S))>=v));)if(g.x=y+C,g.y=b+S,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!aH(g,p,e[0]))&&(!m||lH(g,m))){for(var F=g.sprite,k=g.width>>5,P=e[0]>>5,U=g.x-(k<<4),_=U&127,$=32-_,D=g.y1-g.y0,I=(g.y+g.y0)*P+(U>>5),G,B=0;B<D;B++){G=0;for(var Z=0;Z<=k;Z++)p[I+Z]|=G<<$|(Z<k?(G=F[B*k+Z])>>>_:0);I+=P}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=qs(p),f):n},f.fontStyle=function(p){return arguments.length?(r=qs(p),f):r},f.fontWeight=function(p){return arguments.length?(s=qs(p),f):s},f.rotate=function(p){return arguments.length?(o=qs(p),f):o},f.text=function(p){return arguments.length?(t=qs(p),f):t},f.spiral=function(p){return arguments.length?(u=dH[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=qs(p),f):i},f.padding=function(p){return arguments.length?(a=qs(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function oH(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(El<<5)/s,ud/s);var o=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font,c=r.measureText(t.text+"m").width*s,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*w0),m=Math.cos(t.rotate*w0),y=c*m,b=c*g,v=d*m,x=d*g;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),o+c>=El<<5&&(o=0,a+=u,u=0),a+d>=ud)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*w0),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var E=r.getImageData(0,0,(El<<5)/s,ud/s).data,w=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)w[h]=0;if(o=t.xoff,o==null)return;a=t.yoff;var A=0,C=-1;for(p=0;p<d;p++){for(h=0;h<c;h++){var S=f*p+(h>>5),F=E[(a+p)*(El<<5)+(o+h)<<2]?1<<31-h%32:0;w[S]|=F,A|=F}A?C=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+C,t.sprite=w.slice(0,(t.y1-t.y0)*f)}}}function aH(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>o:0))&t[l+d])return!0;l+=n}return!1}function uH(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function lH(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function T5(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function cH(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(s){var o=s<0?-1:1;switch(Math.sqrt(1+4*o*s)-o&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function fH(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function qs(e){return typeof e=="function"?e:function(){return e}}var dH={archimedean:T5,rectangular:cH};const N5=["x","y","font","fontSize","fontStyle","fontWeight","angle"],hH=["text","font","rotate","fontSize","fontStyle","fontWeight"];function Bx(e){O.call(this,sH(),e)}Bx.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:N5}]};V(Bx,O,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&R("Wordcloud size dimensions must be non-zero.");function n(p){const g=e[p];return de(g)&&t.modified(g.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||hH.some(n)))return;const r=t.materialize(t.SOURCE).source,s=this.value,o=e.as||N5;let a=e.fontSize||14,u;if(de(a)?u=e.fontSizeRange:a=Ht(a),u){const p=a,g=$e("sqrt")().domain(Ji(r,p)).range(u);a=m=>g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(ei).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;p<h;++p)g=l[p],m=g.datum,m[o[0]]=g.x+f,m[o[1]]=g.y+d,m[o[2]]=g.font,m[o[3]]=g.size,m[o[4]]=g.style,m[o[5]]=g.weight,m[o[6]]=g.rotate;return t.reflow(i).modifies(o)}});const pH=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:Bx},Symbol.toStringTag,{value:"Module"})),gH=e=>new Uint8Array(e),mH=e=>new Uint16Array(e),Tl=e=>new Uint32Array(e);function yH(){let e=8,t=[],n=Tl(0),i=_f(0,e),r=_f(0,e);return{data:()=>t,seen:()=>n=bH(n,t.length),add(s){for(let o=0,a=t.length,u=s.length,l;o<u;++o)l=s[o],l._index=a++,t.push(l)},remove(s,o){const a=t.length,u=Array(a-s),l=t;let c,f,d;for(f=0;!o[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],o[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=_f(s,e,i),r=_f(s,e))}}}function bH(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function _f(e,t,n){const i=(t<257?gH:t<65537?mH:Tl)(e);return n&&i.set(n),i}function zS(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,s){const o=this,a=o.bisect(o.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)s[u[d]]|=i;for(d=c;d<f;++d)s[u[d]]|=i;return o}}}function US(){let e=Tl(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Tl(f);let h=Array(f),p,g,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=vH(h,d),c)p=t,g=e,t=Array(c+f),e=Tl(c+f),xH(l,p,g,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function s(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function o(a,u){let l;return u?l=u.length:(u=t,l=n),[hA(u,a[0],0,l),hA(u,a[1],0,l)]}return{insert:i,remove:r,bisect:o,reindex:s,index:()=>e,size:()=>n}}function vH(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return r<s?-1:r>s?1:0}),O9(e,t)}function xH(e,t,n,i,r,s,o,a,u){let l=0,c=0,f;for(f=0;l<i&&c<o;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=s[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<o;++c,++f)a[f]=r[c],u[f]=s[c]+e}function zx(e){O.call(this,yH(),e),this._indices=null,this._dims=null}zx.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};V(zx,O,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,u,l;for(;a<o;++a)u=n[a].fname,l=r[u]||(r[u]=US()),s.push(zS(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,s=this._indices,o=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let g,m,y,b,v,x,E,w,A;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(x={},b=t.mod,E=0,w=b.length;E<w;++E)x[b[E]._index]=1;for(E=0;E<h;++E)A=i[E],(!o[E]||e.modified("fields",E)||t.modified(A.fields))&&(y=A.fname,(g=p[y])||(s[y]=m=US(),p[y]=g=m.insert(A,t.source,0)),o[E]=zS(m,E,r[E]).onAdd(g,u));for(E=0,w=a.data().length;E<w;++E)v[E]||(l[E]!==u[E]?f.push(E):x[E]&&u[E]!==c&&d.push(E));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,s=this._dims,o=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=s.length;let d=r.size(),h,p,g;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)p=a[h].fname,g=u[p]||(u[p]=o[p].insert(a[h],i,d)),s[h].onAdd(g,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),s=i.all(),o=e.mod;let a,u,l;for(a=0,u=o.length;a<u;++a)l=o[a]._index,r[l]!==s&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,s=r.curr(),o=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,o[h]=p=s[h],s[h]=a,p!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,u,l;for(n.filters=0,l=0;l<o;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<o;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],s,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,s=r.seen(),o=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],p=l[1],g=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(f>h)for(m=h,y=Math.min(f,p);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;if(d>p)for(m=Math.max(f,p),y=d;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(d<p)for(m=Math.max(h,d),y=p;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,s=r.curr(),o=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let p,g,m;if(l<f)for(p=l,g=Math.min(f,c);p<g;++p)m=o[p],s[m]^=h,n.push(m);else if(l>f)for(p=f,g=Math.min(l,d);p<g;++p)m=o[p],s[m]^=h,i.push(m);if(c>d)for(p=Math.max(l,d),g=c;p<g;++p)m=o[p],s[m]^=h,n.push(m);else if(c<d)for(p=Math.max(f,c),g=d;p<g;++p)m=o[p],s[m]^=h,i.push(m);e.range=t.slice()}});function Ux(e){O.call(this,null,e)}Ux.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};V(Ux,O,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))return t.StopPropagation;const s=t.fork(t.ALL),o=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:o[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?o[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const EH=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:zx,resolvefilter:Ux},Symbol.toStringTag,{value:"Module"})),AH="RawCode",wo="Literal",wH="Property",SH="Identifier",CH="ArrayExpression",$H="BinaryExpression",I5="CallExpression",FH="ConditionalExpression",kH="LogicalExpression",DH="MemberExpression",_H="ObjectExpression",OH="UnaryExpression";function Ci(e){this.type=e}Ci.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=RH(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function RH(e){switch(e.type){case CH:return e.elements;case $H:case kH:return[e.left,e.right];case I5:return[e.callee].concat(e.arguments);case FH:return[e.test,e.consequent,e.alternate];case DH:return[e.object,e.property];case _H:return e.properties;case wH:return[e.key,e.value];case OH:return[e.argument];case SH:case wo:case AH:default:return[]}}var ar,ee,M,Ut,Re,kp=1,Pc=2,So=3,Ms=4,Dp=5,Go=6,hn=7,Bc=8,MH=9;ar={};ar[kp]="Boolean";ar[Pc]="<end>";ar[So]="Identifier";ar[Ms]="Keyword";ar[Dp]="Null";ar[Go]="Numeric";ar[hn]="Punctuator";ar[Bc]="String";ar[MH]="RegularExpression";var TH="ArrayExpression",NH="BinaryExpression",IH="CallExpression",LH="ConditionalExpression",L5="Identifier",PH="Literal",BH="LogicalExpression",zH="MemberExpression",UH="ObjectExpression",jH="Property",qH="UnaryExpression",xt="Unexpected token %0",WH="Unexpected number",GH="Unexpected string",HH="Unexpected identifier",VH="Unexpected reserved word",XH="Unexpected end of input",L1="Invalid regular expression",S0="Invalid regular expression: missing /",P5="Octal literals are not allowed in strict mode.",YH="Duplicate data property in object literal not allowed in strict mode",_t="ILLEGAL",ec="Disabled.",KH=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),JH=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function _p(e,t){if(!e)throw new Error("ASSERT: "+t)}function Er(e){return e>=48&&e<=57}function jx(e){return"0123456789abcdefABCDEF".includes(e)}function Nl(e){return"01234567".includes(e)}function QH(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function tc(e){return e===10||e===13||e===8232||e===8233}function zc(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&KH.test(String.fromCharCode(e))}function hh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&JH.test(String.fromCharCode(e))}const ZH={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function B5(){for(;M<Ut;){const e=ee.charCodeAt(M);if(QH(e)||tc(e))++M;else break}}function P1(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)M<Ut&&jx(ee[M])?(i=ee[M++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):we({},xt,_t);return String.fromCharCode(r)}function eV(){var e,t,n,i;for(e=ee[M],t=0,e==="}"&&we({},xt,_t);M<Ut&&(e=ee[M++],!!jx(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&we({},xt,_t),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function z5(){var e,t;for(e=ee.charCodeAt(M++),t=String.fromCharCode(e),e===92&&(ee.charCodeAt(M)!==117&&we({},xt,_t),++M,e=P1("u"),(!e||e==="\\"||!zc(e.charCodeAt(0)))&&we({},xt,_t),t=e);M<Ut&&(e=ee.charCodeAt(M),!!hh(e));)++M,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),ee.charCodeAt(M)!==117&&we({},xt,_t),++M,e=P1("u"),(!e||e==="\\"||!hh(e.charCodeAt(0)))&&we({},xt,_t),t+=e);return t}function tV(){var e,t;for(e=M++;M<Ut;){if(t=ee.charCodeAt(M),t===92)return M=e,z5();if(hh(t))++M;else break}return ee.slice(e,M)}function nV(){var e,t,n;return e=M,t=ee.charCodeAt(M)===92?z5():tV(),t.length===1?n=So:ZH.hasOwnProperty(t)?n=Ms:t==="null"?n=Dp:t==="true"||t==="false"?n=kp:n=So,{type:n,value:t,start:e,end:M}}function C0(){var e=M,t=ee.charCodeAt(M),n,i=ee[M],r,s,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++M,{type:hn,value:String.fromCharCode(t),start:e,end:M};default:if(n=ee.charCodeAt(M+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return M+=2,{type:hn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:M};case 33:case 61:return M+=2,ee.charCodeAt(M)===61&&++M,{type:hn,value:ee.slice(e,M),start:e,end:M}}}if(o=ee.substr(M,4),o===">>>=")return M+=4,{type:hn,value:o,start:e,end:M};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return M+=3,{type:hn,value:s,start:e,end:M};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return M+=2,{type:hn,value:r,start:e,end:M};if(r==="//"&&we({},xt,_t),"<>=!+-*%&|^/".includes(i))return++M,{type:hn,value:i,start:e,end:M};we({},xt,_t)}function iV(e){let t="";for(;M<Ut&&jx(ee[M]);)t+=ee[M++];return t.length===0&&we({},xt,_t),zc(ee.charCodeAt(M))&&we({},xt,_t),{type:Go,value:parseInt("0x"+t,16),start:e,end:M}}function rV(e){let t="0"+ee[M++];for(;M<Ut&&Nl(ee[M]);)t+=ee[M++];return(zc(ee.charCodeAt(M))||Er(ee.charCodeAt(M)))&&we({},xt,_t),{type:Go,value:parseInt(t,8),octal:!0,start:e,end:M}}function jS(){var e,t,n;if(n=ee[M],_p(Er(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=M,e="",n!=="."){if(e=ee[M++],n=ee[M],e==="0"){if(n==="x"||n==="X")return++M,iV(t);if(Nl(n))return rV(t);n&&Er(n.charCodeAt(0))&&we({},xt,_t)}for(;Er(ee.charCodeAt(M));)e+=ee[M++];n=ee[M]}if(n==="."){for(e+=ee[M++];Er(ee.charCodeAt(M));)e+=ee[M++];n=ee[M]}if(n==="e"||n==="E")if(e+=ee[M++],n=ee[M],(n==="+"||n==="-")&&(e+=ee[M++]),Er(ee.charCodeAt(M)))for(;Er(ee.charCodeAt(M));)e+=ee[M++];else we({},xt,_t);return zc(ee.charCodeAt(M))&&we({},xt,_t),{type:Go,value:parseFloat(e),start:t,end:M}}function sV(){var e="",t,n,i,r,s=!1;for(t=ee[M],_p(t==="'"||t==='"',"String literal must starts with a quote"),n=M,++M;M<Ut;)if(i=ee[M++],i===t){t="";break}else if(i==="\\")if(i=ee[M++],!i||!tc(i.charCodeAt(0)))switch(i){case"u":case"x":ee[M]==="{"?(++M,e+=eV()):e+=P1(i);break;case"n":e+=`
10
+ `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:Nl(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),M<Ut&&Nl(ee[M])&&(s=!0,r=r*8+"01234567".indexOf(ee[M++]),"0123".includes(i)&&M<Ut&&Nl(ee[M])&&(r=r*8+"01234567".indexOf(ee[M++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&ee[M]===`
11
+ `&&++M;else{if(tc(i.charCodeAt(0)))break;e+=i}return t!==""&&we({},xt,_t),{type:Bc,value:e,octal:s,start:n,end:M}}function oV(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";we({},L1)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{we({},L1)}try{return new RegExp(e,t)}catch{return null}}function aV(){var e,t,n,i,r;for(e=ee[M],_p(e==="/","Regular expression literal must start with a slash"),t=ee[M++],n=!1,i=!1;M<Ut;)if(e=ee[M++],t+=e,e==="\\")e=ee[M++],tc(e.charCodeAt(0))&&we({},S0),t+=e;else if(tc(e.charCodeAt(0)))we({},S0);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||we({},S0),r=t.substr(1,t.length-2),{value:r,literal:t}}function uV(){var e,t,n;for(t="",n="";M<Ut&&(e=ee[M],!!hh(e.charCodeAt(0)));)++M,e==="\\"&&M<Ut?we({},xt,_t):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&we({},L1,n),{value:n,literal:t}}function lV(){var e,t,n,i;return Re=null,B5(),e=M,t=aV(),n=uV(),i=oV(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:M}}function cV(e){return e.type===So||e.type===Ms||e.type===kp||e.type===Dp}function U5(){if(B5(),M>=Ut)return{type:Pc,start:M,end:M};const e=ee.charCodeAt(M);return zc(e)?nV():e===40||e===41||e===59?C0():e===39||e===34?sV():e===46?Er(ee.charCodeAt(M+1))?jS():C0():Er(e)?jS():C0()}function mn(){const e=Re;return M=e.end,Re=U5(),M=e.end,e}function j5(){const e=M;Re=U5(),M=e}function fV(e){const t=new Ci(TH);return t.elements=e,t}function qS(e,t,n){const i=new Ci(e==="||"||e==="&&"?BH:NH);return i.operator=e,i.left=t,i.right=n,i}function dV(e,t){const n=new Ci(IH);return n.callee=e,n.arguments=t,n}function hV(e,t,n){const i=new Ci(LH);return i.test=e,i.consequent=t,i.alternate=n,i}function qx(e){const t=new Ci(L5);return t.name=e,t}function Al(e){const t=new Ci(PH);return t.value=e.value,t.raw=ee.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function WS(e,t,n){const i=new Ci(zH);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function pV(e){const t=new Ci(UH);return t.properties=e,t}function GS(e,t,n){const i=new Ci(jH);return i.key=t,i.value=n,i.kind=e,i}function gV(e,t){const n=new Ci(qH);return n.operator=e,n.argument=t,n.prefix=!0,n}function we(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(_p(o<i.length,"Message reference must be in range"),i[o]));throw n=new Error(r),n.index=M,n.description=r,n}function Op(e){e.type===Pc&&we(e,XH),e.type===Go&&we(e,WH),e.type===Bc&&we(e,GH),e.type===So&&we(e,HH),e.type===Ms&&we(e,VH),we(e,xt,e.value)}function jt(e){const t=mn();(t.type!==hn||t.value!==e)&&Op(t)}function ze(e){return Re.type===hn&&Re.value===e}function $0(e){return Re.type===Ms&&Re.value===e}function mV(){const e=[];for(M=Re.start,jt("[");!ze("]");)ze(",")?(mn(),e.push(null)):(e.push(Co()),ze("]")||jt(","));return mn(),fV(e)}function HS(){M=Re.start;const e=mn();return e.type===Bc||e.type===Go?(e.octal&&we(e,P5),Al(e)):qx(e.value)}function yV(){var e,t,n,i;if(M=Re.start,e=Re,e.type===So)return n=HS(),jt(":"),i=Co(),GS("init",n,i);if(e.type===Pc||e.type===hn)Op(e);else return t=HS(),jt(":"),i=Co(),GS("init",t,i)}function bV(){var e=[],t,n,i,r={},s=String;for(M=Re.start,jt("{");!ze("}");)t=yV(),t.key.type===L5?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?we({},YH):r[i]=!0,e.push(t),ze("}")||jt(",");return jt("}"),pV(e)}function vV(){jt("(");const e=Wx();return jt(")"),e}const xV={if:1};function EV(){var e,t,n;if(ze("("))return vV();if(ze("["))return mV();if(ze("{"))return bV();if(e=Re.type,M=Re.start,e===So||xV[Re.value])n=qx(mn().value);else if(e===Bc||e===Go)Re.octal&&we(Re,P5),n=Al(mn());else{if(e===Ms)throw new Error(ec);e===kp?(t=mn(),t.value=t.value==="true",n=Al(t)):e===Dp?(t=mn(),t.value=null,n=Al(t)):ze("/")||ze("/=")?(n=Al(lV()),j5()):Op(mn())}return n}function AV(){const e=[];if(jt("("),!ze(")"))for(;M<Ut&&(e.push(Co()),!ze(")"));)jt(",");return jt(")"),e}function wV(){M=Re.start;const e=mn();return cV(e)||Op(e),qx(e.value)}function SV(){return jt("."),wV()}function CV(){jt("[");const e=Wx();return jt("]"),e}function $V(){var e,t,n;for(e=EV();;)if(ze("."))n=SV(),e=WS(".",e,n);else if(ze("("))t=AV(),e=dV(e,t);else if(ze("["))n=CV(),e=WS("[",e,n);else break;return e}function VS(){const e=$V();if(Re.type===hn&&(ze("++")||ze("--")))throw new Error(ec);return e}function ld(){var e,t;if(Re.type!==hn&&Re.type!==Ms)t=VS();else{if(ze("++")||ze("--"))throw new Error(ec);if(ze("+")||ze("-")||ze("~")||ze("!"))e=mn(),t=ld(),t=gV(e.value,t);else{if($0("delete")||$0("void")||$0("typeof"))throw new Error(ec);t=VS()}}return t}function XS(e){let t=0;if(e.type!==hn&&e.type!==Ms)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function FV(){var e,t,n,i,r,s,o,a,u,l;if(e=Re,u=ld(),i=Re,r=XS(i),r===0)return u;for(i.prec=r,mn(),t=[e,Re],o=ld(),s=[u,i,o];(r=XS(Re))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=qS(a,u,o),s.push(n);i=mn(),i.prec=r,s.push(i),t.push(Re),n=ld(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=qS(s[l-1].value,s[l-2],n),l-=2;return n}function Co(){var e,t,n;return e=FV(),ze("?")&&(mn(),t=Co(),jt(":"),n=Co(),e=hV(e,t,n)),e}function Wx(){const e=Co();if(ze(","))throw new Error(ec);return e}function q5(e){ee=e,M=0,Ut=ee.length,Re=null,j5();const t=Wx();if(Re.type!==Pc)throw new Error("Unexpect token after expression.");return t}var W5={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function G5(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&R("Missing arguments to clamp function."),o.length>3&&R("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),btoa:"btoa",atob:"atob",encodeURIComponent:"encodeURIComponent",regexp:s,test:n("test",s),if:function(o){o.length<3&&R("Missing arguments to if function."),o.length>3&&R("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function kV(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function H5(e){e=e||{};const t=e.allowed?vi(e.allowed):{},n=e.forbidden?vi(e.forbidden):{},i=e.constants||W5,r=(e.functions||G5)(f),s=e.globalvar,o=e.fieldvar,a=de(s)?s:p=>`${s}["${p}"]`;let u={},l={},c=0;function f(p){if(K(p))return p;const g=d[p.type];return g==null&&R("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:Q(n,g)?R("Illegal identifier: "+g):Q(i,g)?i[g]:Q(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(l[kV(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&R("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=Q(r,g)&&r[g];return y||R("Unrecognized function: "+g),de(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>{for(const g of p.properties){const m=g.key.type==="Literal"?String(g.key.value):g.key.name;db.has(m)&&R("Illegal property: "+m)}return"{"+p.properties.map(f).join(",")+"}"},Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const YS=Symbol("vega_selection_getter");function V5(e){return(!e.getter||!e.getter[YS])&&(e.getter=Qn(e.field),e.getter[YS]=!0),e.getter}const Gx="intersect",KS="union",DV="vlMulti",_V="vlPoint",JS="or",OV="and",Ui="_vgsid_",nc=Qn(Ui),RV="E",MV="R",TV="R-E",NV="R-LE",IV="R-RE",LV="E-LT",PV="E-LTE",BV="E-GT",zV="E-GTE",UV="E-VALID",jV="E-ONE",ph="index:unit";function QS(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s<r;++s)if(a=n[s],o=V5(a)(e),gs(o)&&(o=nn(o)),gs(i[s])&&(i[s]=nn(i[s])),N(i[s])&&gs(i[s][0])&&(i[s]=i[s].map(nn)),a.type===RV){if(N(i[s])?!i[s].includes(o):o!==i[s])return!1}else if(a.type===MV){if(!va(o,i[s]))return!1}else if(a.type===IV){if(!va(o,i[s],!0,!1))return!1}else if(a.type===TV){if(!va(o,i[s],!1,!1))return!1}else if(a.type===NV){if(!va(o,i[s],!1,!0))return!1}else if(a.type===LV){if(o>=i[s])return!1}else if(a.type===PV){if(o>i[s])return!1}else if(a.type===BV){if(o<=i[s])return!1}else if(a.type===zV){if(o<i[s])return!1}else if(a.type===UV){if(o===null||isNaN(o))return!1}else if(a.type===jV&&i[s].indexOf(o)===-1)return!1;return!0}function qV(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],s=i?i[ph]&&i[ph].value:void 0,o=n===Gx,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],s&&o){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=QS(t,l),c[d]=h?-1:++f,h&&s.size===1)return!0;if(!h&&f===s.get(d).count)return!1}else if(h=QS(t,l),o^h)return h;return a&&o}const X5=Iy(nc),WV=X5.left,GV=X5.right;function HV(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],s=i?i[ph]&&i[ph].value:void 0,o=n===Gx,a=nc(t),u=WV(r,a);if(u===r.length||nc(r[u])!==a)return!1;if(s&&o){if(s.size===1)return!0;if(GV(r,a)-u<s.size)return!1}return!0}function VV(e,t){return N(e)||R("First argument to selectionTuples must be an array."),Y(t)||R("Second argument to selectionTuples must be an object."),e.map(n=>he(t.fields?{values:t.fields.map(i=>V5(i)(n.datum))}:{[Ui]:nc(n.datum)},t))}function XV(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},u={},l,c,f,d,h,p,g,m,y,b,v=s.length,x=0,E,w;x<v;++x)if(l=s[x],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,w=c.length;E<w;++E)h=c[E],g=o[h.field]||(o[h.field]={}),m=g[d]||(g[d]=[]),u[h.field]=y=h.type.charAt(0),b=F0[`${y}_union`],g[d]=b(m,J(f[E]));n&&(m=a[d]||(a[d]=[]),m.push(J(f).reduce((A,C,S)=>(A[c[S].field]=C,A),{})))}else h=Ui,p=nc(l),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Ui]:p}));if(t=t||KS,o[Ui]?o[Ui]=F0[`${Ui}_${t}`](...Object.values(o[Ui])):Object.keys(o).forEach(A=>{o[A]=Object.keys(o[A]).map(C=>o[A][C]).reduce((C,S)=>C===void 0?S:F0[`${u[A]}_${t}`](C,S))}),s=Object.keys(a),n&&s.length){const A=i?_V:DV;o[A]=t===KS?{[JS]:s.reduce((C,S)=>(C.push(...a[S]),C),[])}:{[OV]:s.map(C=>({[JS]:a[C]}))}}return o}var F0={[`${Ui}_union`]:L9,[`${Ui}_intersect`]:N9,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.includes(t[n])||e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.includes(n)):t},R_union:function(e,t){var n=nn(t[0]),i=nn(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=nn(t[0]),i=nn(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const YV=":",KV="@";function Hx(e,t,n,i){t[0].type!==wo&&R("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&ye(t).value,o="unit",a=KV+o,u=YV+r;s===Gx&&!Q(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),Q(i,u)||(i[u]=n.getData(r).tuplesRef())}function Y5(e){const t=this.context.data[e];return t?t.values.value:[]}function JV(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function QV(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Zn).insert(t)),1}const ZV={easeLinear:Z9,easeQuad:wA,easeQuadIn:eI,easeQuadOut:tI,easeQuadInOut:wA,easeCubic:yA,easeCubicIn:b9,easeCubicOut:y9,easeCubicInOut:yA,easePoly:SA,easePolyIn:nI,easePolyOut:iI,easePolyInOut:SA,easeSin:CA,easeSinIn:rI,easeSinOut:sI,easeSinInOut:CA,easeExp:$A,easeExpIn:oI,easeExpOut:aI,easeExpInOut:$A,easeCircle:FA,easeCircleIn:uI,easeCircleOut:lI,easeCircleInOut:FA,easeBounce:ql,easeBounceIn:bI,easeBounceOut:ql,easeBounceInOut:vI,easeBack:kA,easeBackIn:xI,easeBackOut:EI,easeBackInOut:kA,easeElastic:DA,easeElasticIn:AI,easeElasticOut:DA,easeElasticInOut:wI};function eX(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}function tX(e,t){if(!N(e)||!e.length)return;const n=e.length,i=e[0],r=+t;if(n===1||!(r>0))return i;if(r>=1)return ye(e);const s=r*(n-1),o=Math.floor(s),a=s-o;return a?e[o]+a*(e[o+1]-e[o]):e[o]}const Uc=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},nX=Uc("format"),K5=Uc("timeFormat"),iX=Uc("utcFormat"),rX=Uc("timeParse"),sX=Uc("utcParse"),Of=new Date(2e3,0,1);function Rp(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Of.setYear(2e3),Of.setMonth(e),Of.setDate(t),K5.call(this,Of,n))}function oX(e){return Rp.call(this,e,1,"%B")}function aX(e){return Rp.call(this,e,1,"%b")}function uX(e){return Rp.call(this,0,2+e,"%A")}function lX(e){return Rp.call(this,0,2+e,"%a")}const cX=":",fX="@",B1="%",J5="$";function Vx(e,t,n,i){t[0].type!==wo&&R("First argument to data functions must be a string literal.");const r=t[0].value,s=cX+r;if(!Q(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function dX(e,t,n,i){t[0].type!==wo&&R("First argument to indata must be a string literal."),t[1].type!==wo&&R("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=fX+s;Q(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function qt(e,t,n,i){if(t[0].type===wo)ZS(n,i,t[0].value);else for(e in n.scales)ZS(n,i,e)}function ZS(e,t,n){const i=B1+n;if(!Q(t,i))try{t[i]=e.scaleRef(n)}catch{}}function $i(e,t){if(K(e)){const n=t.scales[e];return n&&Ww(n.value)?n.value:void 0}else if(de(e))return Ww(e)?e:void 0}function hX(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=qt,n._range=qt,n._scale=qt;const i=r=>"_["+(r.type===wo?H(B1+r.value):H(B1)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function Xx(e,t){return function(n,i,r){if(n){const s=$i(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const pX=Xx("area",_4),gX=Xx("bounds",T4),mX=Xx("centroid",z4);function yX(e,t){const n=$i(e,(t||this).context);return n&&n.scale()}function bX(e,t){const n=$i(e,(t||this).context);return n&&n.translate()}function vX(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function Yx(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function xX(){return Yx(this.context.dataflow,"warn",arguments)}function EX(){return Yx(this.context.dataflow,"info",arguments)}function AX(){return Yx(this.context.dataflow,"debug",arguments)}function k0(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function z1(e){const t=bd(e),n=k0(t.r),i=k0(t.g),r=k0(t.b);return .2126*n+.7152*i+.0722*r}function wX(e,t){const n=z1(e),i=z1(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function SX(){const e=[].slice.call(arguments);return e.unshift({}),he(...e)}function Q5(e,t){return e===t||e!==e&&t!==t?!0:N(e)?N(t)&&e.length===t.length?CX(e,t):!1:Y(e)&&Y(t)?Z5(e,t):!1}function CX(e,t){for(let n=0,i=e.length;n<i;++n)if(!Q5(e[n],t[n]))return!1;return!0}function Z5(e,t){for(const n in e)if(!Q5(e[n],t[n]))return!1;return!0}function eC(e){return t=>Z5(e,t)}function $X(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],u=a.input,l=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=o.changeset(),c.stamp=l,o.runAfter(()=>{a.modified=!0,o.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Zn:N(n)||ip(n)?n:eC(n),c.remove(f)),t&&c.insert(t),i&&(f=eC(i),u.value.some(f)?c.remove(f):c.insert(i)),r){if(de(r))throw Error("modify parameter must be a data tuple, not a function");for(d in s)c.modify(r,d,s[d])}return 1}function FX(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function kX(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const tC={};function DX(e,t){const n=tC[t]||(tC[t]=Qn(t));return N(e)?e.map(n):n(e)}function Mp(e){return N(e)||ArrayBuffer.isView(e)?e:null}function Kx(e){return Mp(e)||(K(e)?e:null)}function _X(e,...t){return Mp(e).join(...t)}function OX(e,...t){return Kx(e).indexOf(...t)}function RX(e,...t){return Kx(e).lastIndexOf(...t)}function MX(e,...t){return Kx(e).slice(...t)}function TX(e,t,n){return de(n)&&R("Function argument passed to replace."),!K(t)&&!xb(t)&&R("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function NX(e){return Mp(e).slice().reverse()}function IX(e){return Mp(e).slice().sort(yu)}function LX(e,t,n){return Av(e||0,t||0,n||0)}function PX(e,t){const n=$i(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function BX(e,t){const n=$i(e,(t||this).context);return n?n.copy():void 0}function zX(e,t){const n=$i(e,(t||this).context);return n?n.domain():[]}function UX(e,t,n){const i=$i(e,(n||this).context);return i?N(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function jX(e,t){const n=$i(e,(t||this).context);return n&&n.range?n.range():[]}function qX(e,t,n){const i=$i(e,(n||this).context);return i?i(t):void 0}function WX(e,t,n,i,r){e=$i(e,(r||this).context);const s=q_(t,n);let o=e.domain(),a=o[0],u=ye(o),l=xn;return u-a?l=O_(e,a,u):e=(e.interpolator?$e("sequential")().interpolator(e.interpolator()):$e("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(o=e.ticks(+i||15),a!==o[0]&&o.unshift(a),u!==ye(o)&&o.push(u)),o.forEach(c=>s.stop(l(c),e(c))),s}function GX(e,t,n){const i=$i(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function HX(e){let t=null;return function(n){return n?Kl(n,t=t||Wa(e)):e}}const eR=e=>e.data;function tR(e,t){const n=Y5.call(t,e);return n.root&&n.root.lookup||{}}function VX(e,t,n){const i=tR(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(eR):void 0}function XX(e,t){const n=tR(e,this)[t];return n?n.ancestors().map(eR):void 0}const nR=()=>typeof window<"u"&&window||null;function YX(){const e=nR();return e?e.screen:{}}function KX(){const e=nR();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function JX(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function iR(e,t,n){if(!e)return[];const[i,r]=e,s=new ht().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return BO(o,s,QX(t))}function QX(e){let t=null;if(e){const n=J(e.marktype),i=J(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function ZX(e,t,n,i=5){e=J(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function eY(e){return J(e).reduce((t,[n,i],r)=>t+=r==0?`M ${n},${i} `:r===e.length-1?" Z":`L ${n},${i} `,"")}function tY(e,t,n){const{x:i,y:r,mark:s}=n,o=new ht().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<o.x1&&(o.x1=u),u>o.x2&&(o.x2=u),l<o.y1&&(o.y1=l),l>o.y2&&(o.y2=l);return o.translate(i,r),iR([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(u=>nY(u.x,u.y,t))}function nY(e,t,n){let i=0;for(let r=0,s=n.length-1;r<n.length;s=r++){const[o,a]=n[s],[u,l]=n[r];l>t!=a>t&&e<(o-u)*(t-l)/(a-l)+u&&i++}return i&1}const ic={random(){return ei()},cumulativeNormal:up,cumulativeLogNormal:jb,cumulativeUniform:Hb,densityNormal:Lb,densityLogNormal:Ub,densityUniform:Gb,quantileNormal:lp,quantileLogNormal:qb,quantileUniform:Vb,sampleNormal:ap,sampleLogNormal:zb,sampleUniform:Wb,isArray:N,isBoolean:Uo,isDate:gs,isDefined(e){return e!==void 0},isNumber:Ce,isObject:Y,isRegExp:xb,isString:K,isTuple:ip,isValid(e){return e!=null&&e===e},toBoolean:Ab,toDate(e){return wb(e)},toNumber:nn,toString:Sb,indexof:OX,join:_X,lastindexof:RX,replace:TX,reverse:NX,sort:IX,slice:MX,flush:_D,lerp:RD,interpolateLinear:tX,merge:SX,pad:ND,peek:ye,pluck:DX,span:Jh,inrange:va,truncate:ID,rgb:bd,lab:Am,hcl:k8,hsl:Cm,luminance:z1,contrast:wX,sequence:On,format:nX,utcFormat:iX,utcParse:sX,utcOffset:s3,utcSequence:u3,timeFormat:K5,timeParse:rX,timeOffset:r3,timeSequence:a3,timeUnitSpecifier:PD,monthFormat:oX,monthAbbrevFormat:aX,dayFormat:uX,dayAbbrevFormat:lX,quarter:$D,utcquarter:FD,week:zD,utcweek:VD,isoweek:UD,utcisoweek:XD,dayofyear:BD,utcdayofyear:HD,warn:xX,info:EX,debug:AX,extent(e){return Ji(e)},inScope:vX,intersect:iR,clampRange:kD,pinchDistance:FX,pinchAngle:kX,screen:YX,containerSize:JX,windowSize:KX,bandspace:LX,setdata:QV,pathShape:HX,panLinear:AD,panLog:wD,panPow:SD,panSymlog:CD,zoomLinear:gb,zoomLog:mb,zoomPow:Hd,zoomSymlog:yb,encode:eX,modify:$X,lassoAppend:ZX,lassoPath:eY,intersectLasso:tY,...ZV},iY=["view","item","group","xy","x","y"],rY="event.vega.",rR="this.",Jx={},sR={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${H(J5+e)}]`,functions:sY,constants:W5,visitors:Jx},U1=H5(sR);function sY(e){const t=G5(e);iY.forEach(n=>t[n]=rY+n);for(const n in ic)t[n]=rR+n;return he(t,hX(e,ic,Jx)),t}function st(e,t,n){return arguments.length===1?ic[e]:(ic[e]=t,n&&(Jx[e]=n),U1&&(U1.functions[e]=rR+e),this)}st("bandwidth",PX,qt);st("copy",BX,qt);st("domain",zX,qt);st("range",jX,qt);st("invert",UX,qt);st("scale",qX,qt);st("gradient",WX,qt);st("geoArea",pX,qt);st("geoBounds",gX,qt);st("geoCentroid",mX,qt);st("geoShape",GX,qt);st("geoScale",yX,qt);st("geoTranslate",bX,qt);st("indata",JV,dX);st("data",Y5,Vx);st("treePath",VX,Vx);st("treeAncestors",XX,Vx);st("vlSelectionTest",qV,Hx);st("vlSelectionIdTest",HV,Hx);st("vlSelectionResolve",XV,Hx);st("vlSelectionTuples",VV);function Zi(e,t){const n={};let i;try{e=K(e)?e:H(e)+"",i=q5(e)}catch{R("Expression parse error: "+e)}i.visit(s=>{if(s.type!==I5)return;const o=s.callee.name,a=sR.visitors[o];a&&a(o,s.arguments,t,n)});const r=U1(i);return r.globals.forEach(s=>{const o=J5+s;!Q(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:he({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function oY(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const aY=vi(["rule"]),nC=vi(["group","image","rect"]);function uY(e,t){let n="";return aY[t]||(e.x2&&(e.x?(nC[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(nC[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function Qx(e){return(e+"").toLowerCase()}function lY(e){return Qx(e)==="operator"}function cY(e){return Qx(e)==="collect"}function Hu(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function fY(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
12
+ : (u > v || v == null) && u != null ? ${i}
13
+ : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
14
+ : v !== v && u === u ? ${i} : `}var dY={operator:(e,t)=>Hu(e,["_"],t.code),parameter:(e,t)=>Hu(e,["datum","_"],t.code),event:(e,t)=>Hu(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return Hu(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+H(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=uY(i,n),r+="return m;",Hu(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(H).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let u,l;return s.path?(u=`a${s.path}`,l=`b${s.path}`):((n=n||{})["f"+o]=s,u=`this.f${o}(a)`,l=`this.f${o}(b)`),fY(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function hY(e){const t=this;lY(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function pY(e){const t=this;if(e.params){const n=t.get(e.id);n||R("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function gY(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=N(r)?r.map(s=>iC(s,n,t)):iC(r,n,t)}return t}function iC(e,t,n){if(!e||!Y(e))return e;for(let i=0,r=rC.length,s;i<r;++i)if(s=rC[i],Q(e,s.key))return s.parse(e,t,n);return e}var rC=[{key:"$ref",parse:mY},{key:"$key",parse:bY},{key:"$expr",parse:yY},{key:"$field",parse:vY},{key:"$encode",parse:EY},{key:"$compare",parse:xY},{key:"$context",parse:AY},{key:"$subflow",parse:wY},{key:"$tupleid",parse:SY}];function mY(e,t){return t.get(e.$ref)||R("Operator not defined: "+e.$ref)}function yY(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=Cn(t.parameterExpression(e.$expr),e.$fields))}function bY(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=Eb(e.$key,e.$flat,t.expr.codegen))}function vY(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=Qn(e.$field,e.$name,t.expr.codegen))}function xY(e,t){const n="c:"+e.$compare+"_"+e.$order,i=J(e.$compare).map(r=>r&&r.$tupleid?re:r);return t.fn[n]||(t.fn[n]=bb(i,e.$order,t.expr.codegen))}function EY(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=Cn(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function AY(e,t){return t}function wY(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(s),a.detachSubflow=()=>t.detach(o),a}}function SY(){return re}function CY(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&R("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function $Y(e){var t=this,n=Y(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||R("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const FY={skip:!0};function kY(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function DY(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],FY)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(Zn).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function oR(e,t,n,i){return new aR(e,t,n,i)}function aR(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||dY,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function sC(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}aR.prototype=sC.prototype={fork(){const e=new sC(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),cY(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[Qx(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:oY,parseOperator:hY,parseOperatorParameters:pY,parseParameters:gY,parseStream:CY,parseUpdate:$Y,getState:kY,setState:DY};function _Y(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),uR(t,e.description()))}function uR(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function OY(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const D0="default";function RY(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:D0,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?K(r)?r:r.user:D0,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return K(i)||(r=i.item,i=i.user),j1(e,i&&i!==D0?i:r||i),r},{cursor:t})}function j1(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function gh(e,t){var n=e._runtime.data;return Q(n,t)||R("Unrecognized data set: "+t),n[t]}function MY(e,t){return arguments.length<2?gh(this,e).values.value:Tp.call(this,e,qo().remove(Zn).insert(t))}function Tp(e,t){D3(t)||R("Second argument to changes must be a changeset.");const n=gh(this,e);return n.modified=!0,this.pulse(n.input,t)}function TY(e,t){return Tp.call(this,e,qo().insert(t))}function NY(e,t){return Tp.call(this,e,qo().remove(t))}function lR(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function cR(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function Np(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function IY(e){var t=Np(e),n=lR(e),i=cR(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function LY(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=Np(e),o=t.changedTouches?t.changedTouches[0]:t,s=$p(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=PY(e,n,s),t}function PY(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,u;if(o){for(u=t;u;u=u.mark.group)if(u.mark.name===o){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;K(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:Ht(e),item:Ht(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}function fR(e){e._resizeObserver&&(e._resizeObserver.disconnect(),e._resizeObserver=null);const t=e.container(),n=e._containerListeners;if(typeof ResizeObserver>"u"||!t||!n.length)return;let i=t.clientWidth,r=t.clientHeight;e._resizeObserver=new ResizeObserver(()=>{!t.clientWidth&&!t.clientHeight||t.clientWidth===i&&t.clientHeight===r||(i=t.clientWidth,r=t.clientHeight,n.forEach(s=>s({type:"resize",target:t})))}),e._resizeObserver.observe(t)}const oC="view",BY="timer",zY="window",UY="container",jY="resize",qY={trap:!1};function WY(e){const t=he({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{N(i[s])&&(i[s]=vi(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector","container"]),t}function dR(e,t,n,i){e._eventListeners.push({type:n,sources:J(t),handler:i})}function GY(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function Vu(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||Y(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function HY(e,t,n){var i=this,r=new op(n),s=function(l,c){i.runAsync(null,()=>{e===oC&&GY(i,t)&&l.preventDefault(),r.receive(LY(i,l,c))})},o;if(e===BY)Vu(i,"timer",t)&&i.timer(s,t);else if(e===oC)Vu(i,"view",t)&&i.addEventListener(t,s,qY);else if(e===UY)t!==jY?i.warn("Unsupported container event type: "+t):Vu(i,"container",t)&&(i._containerListeners.push(s),i.container()&&fR(i));else if(e===zY?Vu(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&Vu(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=o.length;a<u;++a)o[a].addEventListener(t,s);dR(i,o,t,s)}return r}function aC(e){return e.item}function uC(e){return e.item.mark.source}function lC(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function VY(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",aC),uC,lC(e)),this.on(this.events("view","pointerout",aC),uC,lC(t)),this}function XY(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),i=this._eventListeners,r,s,o,a,u;for(r=t.length;--r>=0;)t[r].stop();for(this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),r=i.length;--r>=0;)for(o=i[r],s=o.sources.length;--s>=0;)o.sources[s].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function In(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const YY="vega-bind",KY="vega-bind-name",JY="vega-bind-radio",QY=/^on/i;function ZY(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=vb(i.debounce,r.update))),(i.input==null&&i.element?eK:nK)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function eK(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),dR(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(tK(r))}}function tK(e){return typeof Event<"u"?new Event(e):{type:e}}function nK(e,t,n,i){const r=i.signal(n.signal),s=In("div",{class:YY}),o=n.input==="radio"?s:s.appendChild(In("label"));o.appendChild(In("span",{class:KY},n.name||n.signal)),t.appendChild(s);let a=cC;switch(n.input){case"checkbox":a=iK;break;case"select":a=rK;break;case"radio":a=sK;break;case"range":a=oK;break}a===cC?a(e,o,n,r,i):a(e,o,n,r)}function cC(e,t,n,i,r){const s=In("input");for(const o in n)QY.test(o)?r.warn(`Ignoring unsupported signal binding property "${o}" for signal "${n.signal}".`):o!=="signal"&&o!=="element"&&s.setAttribute(o==="input"?"type":o,n[o]);s.setAttribute("name",n.signal),s.value=i,t.appendChild(s),s.addEventListener("input",()=>e.update(s.value)),e.elements=[s],e.set=o=>s.value=o}function iK(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=In("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function rK(e,t,n,i){const r=In("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const u={value:o};mh(o,i)&&(u.selected=!0),r.appendChild(In("option",u,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,u=n.options.length;a<u;++a)if(mh(n.options[a],o)){r.selectedIndex=a;return}}}function sK(e,t,n,i){const r=In("span",{class:JY}),s=n.labels||[];t.appendChild(r),e.elements=n.options.map((o,a)=>{const u={type:"radio",name:n.signal,value:o};mh(o,i)&&(u.checked=!0);const l=In("input",u);l.addEventListener("change",()=>e.update(o));const c=In("label",{},(s[a]||o)+"");return c.prepend(l),r.appendChild(c),l}),e.set=o=>{const a=e.elements,u=a.length;for(let l=0;l<u;++l)mh(a[l].value,o)&&(a[l].checked=!0)}}function oK(e,t,n,i){i=i!==void 0?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,s=n.min||Math.min(0,r,+i)||0,o=n.step||Na(s,r,100),a=In("input",{type:"range",name:n.signal,min:s,max:r,step:o});a.value=i;const u=In("span",{},+i);t.appendChild(a),t.appendChild(u);const l=()=>{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function mh(e,t){return e===t||e+""==t+""}function hR(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,lR(e),cR(e),Np(e),r,s).background(e.background())}function Zx(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function aK(e,t,n,i){const r=new i(e.loader(),Zx(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,Np(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function uK(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=Fp(i);e=n._el=e?_0(n,e,!0):null,_Y(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Ic,a=e?s.renderer:s.headless;return n._renderer=a?hR(n,n._renderer,e,a):null,n._handler=aK(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=_0(n,t,!0):e.appendChild(In("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=_0(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{ZY(n,u.element||t,u)})),fR(n),n}function _0(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const Xu=e=>+e||0,lK=e=>({top:e,bottom:e,left:e,right:e});function fC(e){return Y(e)?{top:Xu(e.top),bottom:Xu(e.bottom),left:Xu(e.left),right:Xu(e.right)}:lK(Xu(e))}async function e2(e,t,n,i){const r=Fp(t),s=r&&r.headless;return s||R("Unrecognized renderer type: "+t),await e.runAsync(),hR(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function cK(e,t){e!==cs.Canvas&&e!==cs.SVG&&e!==cs.PNG&&R("Unrecognized image type: "+e);const n=await e2(this,e,t);return e===cs.SVG?fK(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function fK(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function dK(e,t){return(await e2(this,cs.Canvas,e,t)).canvas()}async function hK(e){return(await e2(this,cs.SVG,e)).svg()}function pK(e,t,n){return oR(e,za,ic,n).parse(t)}function gK(e){var t=this._runtime.scales;return Q(t,e)||R("Unrecognized scale or projection: "+e),t[e].value}var pR="width",gR="height",t2="padding",dC={skip:!0};function mR(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===t2?i.left+i.right:0)}function yR(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===t2?i.top+i.bottom:0)}function mK(e){var t=e._signals,n=t[pR],i=t[gR],r=t[t2];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=mR(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=yR(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function yK(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(pR,n,dC),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(gR,i,dC),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(u=>u.resize())},!1,1)}function bK(e){return this._runtime.getState(e||{data:vK,signals:xK,recurse:!0})}function vK(e,t){return t.modified&&N(t.input.value)&&!e.startsWith("_:vega:_")}function xK(e,t){return!(e==="parent"||t instanceof za.proxy)}function EK(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function AK(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(Q9(n,t))}function wK(e,t,n,i){const r=e.element();r&&r.setAttribute("title",SK(i))}function SK(e){return e==null?"":N(e)?bR(e):Y(e)&&!gs(e)?CK(e):e+""}function CK(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(N(n)?bR(n):vR(n))}).join(`
15
+ `)}function bR(e){return"["+e.map(vR).join(", ")+"]"}function vR(e){return N(e)?"[…]":Y(e)&&!gs(e)?"{…}":e}function $K(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function xR(e,t){const n=this;if(t=t||{},$a.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const s=he({},e.locale,t.locale);n.locale(v3(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||cs.Canvas,n._scenegraph=new dO;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||wK,n._redraw=!0,n._handler=new Ic().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._containerListeners=[],n._resizeObserver=null,n._eventConfig=WY(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=pK(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:he({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=mR(n,n._width),n._viewHeight=yR(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,mK(n),OY(n),RY(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function Rf(e,t){return Q(e._signals,t)?e._signals[t]:R("Unrecognized signal name: "+H(t))}function ER(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function hC(e,t,n,i){let r=ER(n,i);return r||(r=Zx(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function pC(e,t,n){const i=ER(t,n);return i&&t._targets.remove(i),e}V(xR,$a,{async evaluate(e,t,n){if(await $a.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,IY(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&Kf(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&uR(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=Rf(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",fC(e)):fC(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Fp(e)||R("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&($a.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(Rf(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:yK,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=Zx(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return hC(this,e,Rf(this,e),t)},removeSignalListener(e,t){return pC(this,Rf(this,e),t)},addDataListener(e,t){return hC(this,e,gh(this,e).values,t)},removeDataListener(e,t){return pC(this,gh(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=j1(this,null);this._globalCursor=!!e,t&&j1(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:AK,events:HY,finalize:XY,hover:VY,data:MY,change:Tp,insert:TY,remove:NY,scale:gK,initialize:uK,toImageURL:cK,toCanvas:dK,toSVG:hK,getState:bK,setState:EK,_watchPixelRatio:$K});const FK="view",yh="[",bh="]",AR="{",wR="}",kK=":",SR=",",DK="@",_K=">",OK=/[[\]{}]/,RK={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let CR,$R;function Ts(e,t,n){return CR=t||FK,$R=n||RK,FR(e.trim()).map(q1)}function MK(e){return $R[e]}function Il(e,t,n,i,r){const s=e.length;let o=0,a;for(;t<s;++t){if(a=e[t],!o&&a===n)return t;r&&r.includes(a)?--o:i&&i.includes(a)&&++o}return t}function FR(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=Il(e,r,SR,yh+AR,bh+wR),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function q1(e){return e[0]==="["?TK(e):NK(e)}function TK(e){const t=e.length;let n=1,i;if(n=Il(e,n,bh,yh,bh),n===t)throw"Empty between selector: "+e;if(i=FR(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==_K)throw"Expected '>' after between selector: "+e;i=i.map(q1);const r=q1(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function NK(e){const t={source:CR},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,u,l;if(e[o-1]===wR){if(a=e.lastIndexOf(AR),a>=0){try{i=IK(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===DK&&(r=++a),u=Il(e,a,kK),u<o&&(n.push(e.substring(s,u).trim()),s=a=++u),a=Il(e,a,yh),a===o)n.push(e.substring(s,o).trim());else if(n.push(e.substring(s,a).trim()),l=[],s=++a,s===o)throw"Unmatched left bracket: "+e;for(;a<o;){if(a=Il(e,a,bh),a===o)throw"Unmatched left bracket: "+e;if(l.push(e.substring(s,a).trim()),a<o-1&&e[++a]!==yh)throw"Expected left bracket: "+e;s=++a}if(!(o=n.length)||OK.test(n[o-1]))throw"Invalid event selector: "+e;return o>1?(t.type=n[1],r?t.markname=n[0].slice(1):MK(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function IK(e){const t=e.split(SR);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function LK(e){return Y(e)?e:{type:e||"pad"}}const Yu=e=>+e||0,PK=e=>({top:e,bottom:e,left:e,right:e});function BK(e){return Y(e)?e.signal?e:{top:Yu(e.top),bottom:Yu(e.bottom),left:Yu(e.left),right:Yu(e.right)}:PK(Yu(e))}const Et=e=>Y(e)&&!N(e)?he({},e):{value:e};function gC(e,t,n,i){return n!=null?(Y(n)&&!N(n)||N(n)&&n.length&&Y(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function Mt(e,t,n){for(const i in t)gC(e,i,t[i]);for(const i in n)gC(e,i,n[i],"update")}function Su(e,t,n){for(const i in t)n&&Q(n,i)||(e[i]=he(e[i]||{},t[i]));return e}function ga(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const n2="mark",i2="frame",r2="scope",zK="axis",UK="axis-domain",jK="axis-grid",qK="axis-label",WK="axis-tick",GK="axis-title",HK="legend",VK="legend-band",XK="legend-entry",YK="legend-gradient",kR="legend-label",KK="legend-symbol",JK="legend-title",QK="title",ZK="title-text",eJ="title-subtitle";function tJ(e,t,n,i,r){const s={},o={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!ga(u,e)&&O0(s,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===i2?r.group:n===n2?he({},r.mark,r[t]):null;for(u in c)l=ga(u,e)||(u==="fill"||u==="stroke")&&(ga("fill",e)||ga("stroke",e)),l||O0(s,u,c[u]);J(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)ga(h,e)||O0(s,h,d[h])}),e=he({},e);for(u in s)c=s[u],c.signal?(a=a||{})[u]=c:o[u]=c;return e.enter=he(o,e.enter),a&&(e.update=he(a,e.update)),e}function O0(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const DR=e=>K(e)?H(e):e.signal?`(${e.signal})`:_R(e);function Ip(e){if(e.gradient!=null)return iJ(e);let t=e.signal?`(${e.signal})`:e.color?nJ(e.color):e.field!=null?_R(e.field):e.value!==void 0?H(e.value):void 0;return e.scale!=null&&(t=rJ(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${cd(e.exponent)})`),e.mult!=null&&(t+=`*${cd(e.mult)}`),e.offset!=null&&(t+=`+${cd(e.offset)}`),e.round&&(t=`round(${t})`),t}const Mf=(e,t,n,i)=>`(${e}(${[t,n,i].map(Ip).join(",")})+'')`;function nJ(e){return e.c?Mf("hcl",e.h,e.c,e.l):e.h||e.s?Mf("hsl",e.h,e.s,e.l):e.l||e.a?Mf("lab",e.l,e.a,e.b):e.r||e.g||e.b?Mf("rgb",e.r,e.g,e.b):null}function iJ(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:H(n));for(;t.length&&ye(t)==null;)t.pop();return t.unshift(DR(e.gradient)),`gradient(${t.join(",")})`}function cd(e){return Y(e)?"("+Ip(e)+")":e}function _R(e){return OR(Y(e)?e:{datum:e})}function OR(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):R("Invalid field reference: "+H(e));return e.signal||(i=K(i)?sr(i).map(H).join("]["):OR(i)),t+"["+i+"]"}function rJ(e,t){const n=DR(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+cd(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function sJ(e){let t="";return e.forEach(n=>{const i=Ip(n);t+=n.test?`(${n.test})?${i}:`:i}),ye(t)===":"&&(t+="null"),t}function RR(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=tJ(e,t,n,i,r.config);for(const a in e)o[a]=oJ(e[a],t,s,r);return s}function oJ(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=uJ(aJ(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function aJ(e){return N(e)?sJ(e):Ip(e)}function uJ(e,t,n,i){const r=Zi(e,t);return r.$fields.forEach(s=>i[s]=1),he(n,r.$params),r.$expr}const lJ="outer",cJ=["value","update","init","react","bind"];function mC(e,t){R(e+' for "outer" push: '+H(t))}function MR(e,t){const n=e.name;if(e.push===lJ)t.signals[n]||mC("No prior signal definition",n),cJ.forEach(i=>{e[i]!==void 0&&mC("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function W1(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function Lp(e,t,n,i){return new W1(e,t,n,i)}function vh(e,t){return Lp("operator",e,t)}function ie(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function rc(e,t){return t?{$field:e,$name:t}:{$field:e}}const G1=rc("key");function yC(e,t){return{$compare:e,$order:t}}function fJ(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const dJ="ascending",hJ="descending";function pJ(e){return Y(e)?(e.order===hJ?"-":"+")+Pp(e.op,e.field):""}function Pp(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:(t==null?void 0:t.replace(/\W+/g,"_").replace(/^_+|_+$/g,""))||"")}const s2="scope",H1="view";function lt(e){return e&&e.signal}function gJ(e){return e&&e.expr}function fd(e){if(lt(e))return!0;if(Y(e)){for(const t in e)if(fd(e[t]))return!0}return!1}function ci(e,t){return e??t}function fo(e){return e&&e.signal||e}const bC="timer";function sc(e,t){return(e.merge?yJ:e.stream?bJ:e.type?vJ:R("Invalid stream specification: "+H(e)))(e,t)}function mJ(e){return e===s2?H1:e||H1}function yJ(e,t){const n=e.merge.map(r=>sc(r,t)),i=o2({merge:n},e,t);return t.addStream(i).id}function bJ(e,t){const n=sc(e.stream,t),i=o2({stream:n},e,t);return t.addStream(i).id}function vJ(e,t){let n;e.type===bC?(n=t.event(bC,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(mJ(e.source),e.type);const i=o2({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function o2(e,t,n){let i=t.between;return i&&(i.length!==2&&R('Stream "between" parameter must have 2 entries: '+H(t)),e.between=[sc(i[0],n),sc(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(xJ(t.marktype,t.markname,t.markrole)),t.source===s2&&i.push("inScope(event.item)"),i.length&&(e.filter=Zi("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function xJ(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const EJ={code:"_.$value",ast:{type:"Identifier",value:"value"}};function AJ(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||R("Signal update missing events specification."),K(s)&&(s=Ts(s,t.isSubscope()?s2:H1)),s=J(s).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[SJ(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&R("Signal encode and update are mutually exclusive."),o="encode(item(),"+H(i)+")"),r.update=K(o)?Zi(o,t):o.expr!=null?Zi(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:EJ,$params:{$value:t.signalRef(o.signal)}}:R("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(he(wJ(u,t),r)))}function wJ(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):sc(e,t)}}function SJ(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function CJ(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?R("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=Zi(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>AJ(r,t,n.id))}const Ie=e=>(t,n,i)=>Lp(e,n,t||void 0,i),TR=Ie("aggregate"),$J=Ie("axisticks"),NR=Ie("bound"),Fi=Ie("collect"),vC=Ie("compare"),FJ=Ie("datajoin"),IR=Ie("encode"),kJ=Ie("expression"),DJ=Ie("facet"),_J=Ie("field"),OJ=Ie("key"),RJ=Ie("legendentries"),MJ=Ie("load"),TJ=Ie("mark"),NJ=Ie("multiextent"),IJ=Ie("multivalues"),LJ=Ie("overlap"),PJ=Ie("params"),LR=Ie("prefacet"),BJ=Ie("projection"),zJ=Ie("proxy"),UJ=Ie("relay"),PR=Ie("render"),jJ=Ie("scale"),Ho=Ie("sieve"),qJ=Ie("sortitems"),BR=Ie("viewlayout"),WJ=Ie("values");let GJ=0;const zR={min:"min",max:"max",count:"sum"};function HJ(e,t){const n=e.type||"linear";C_(n)||R("Unrecognized scale type: "+H(n)),t.addScale(e.name,{type:n,domain:void 0})}function VJ(e,t){const n=t.getScale(e.name).params;let i;n.domain=UR(e.domain,e,t),e.range!=null&&(n.range=qR(e,t,n)),e.interpolate!=null&&iQ(e.interpolate,n),e.nice!=null&&(n.nice=nQ(e.nice,t)),e.bins!=null&&(n.bins=tQ(e.bins,t));for(i in e)Q(n,i)||i==="name"||(n[i]=Vn(e[i],t))}function Vn(e,t){return Y(e)?e.signal?t.signalRef(e.signal):R("Unsupported object: "+H(e)):e}function dd(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Vn(n,t))}function Bp(e){R("Can not find data set: "+H(e))}function UR(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&R("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(N(e)?XJ:e.fields?KJ:YJ)(e,t,n)}function XJ(e,t,n){return e.map(i=>Vn(i,n))}function YJ(e,t,n){const i=n.getData(e.data);return i||Bp(e.data),qa(t.type)?i.valuesRef(n,e.field,jR(e.sort,!1)):k_(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function KJ(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=K(o)?{data:i,field:o}:N(o)||o.signal?JJ(o,n):o,s.push(o),s),[]);return(qa(t.type)?QJ:k_(t.type)?ZJ:eQ)(e,n,r)}function JJ(e,t){const n="_:vega:_"+GJ++,i=Fi({});if(N(e)&&!e.some(lt))i.value={$ingest:e};else{const r=N(e)?"["+e.map(o=>lt(o)?o.signal:H(o)).join(",")+"]":e.signal,s="setdata("+H(n)+","+r+")";i.params.input=t.signalRef(s)}return t.addDataPipeline(n,[i,Ho({})]),{data:n,field:"data"}}function QJ(e,t,n){const i=jR(e.sort,!0);let r,s;const o=n.map(l=>{const c=t.getData(l.data);return c||Bp(l.data),c.countsRef(t,l.field,i)}),a={groupby:G1,pulse:o};i&&(r=i.op||"count",s=i.field?Pp(r,i.field):"count",a.ops=[zR[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(TR(a));const u=t.add(Fi({pulse:ie(r)}));return s=t.add(WJ({field:G1,sort:t.sortRef(i),pulse:ie(u)})),ie(s)}function jR(e,t){return e&&(!e.field&&!e.op?Y(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?R("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!zR[e.op]&&R("Multiple domain scales can not be sorted using "+e.op)),e}function ZJ(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||Bp(r.data),s.domainRef(t,r.field)});return ie(t.add(IJ({values:i})))}function eQ(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||Bp(r.data),s.extentRef(t,r.field)});return ie(t.add(NJ({extents:i})))}function tQ(e,t){return e.signal||N(e)?dd(e,t):t.objectProperty(e)}function nQ(e,t){return e.signal?t.signalRef(e.signal):Y(e)?{interval:Vn(e.interval),step:Vn(e.step)}:Vn(e)}function iQ(e,t){t.interpolate=Vn(e.type||e),e.gamma!=null&&(t.interpolateGamma=Vn(e.gamma))}function qR(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(K(r)){if(i&&Q(i,r))return e=he({},e,{range:i[r]}),qR(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=qa(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:R("Unrecognized scale range value: "+H(r))}else if(r.scheme){n.scheme=N(r.scheme)?dd(r.scheme,t):Vn(r.scheme,t),r.extent&&(n.schemeExtent=dd(r.extent,t)),r.count&&(n.schemeCount=Vn(r.count,t));return}else if(r.step){n.rangeStep=Vn(r.step,t);return}else{if(qa(e.type)&&!N(r))return UR(r,e,t);N(r)||R("Unsupported range type: "+H(r))}return r.map(s=>(N(s)?dd:Vn)(s,t))}function rQ(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=V1(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=V1(n[r],r,t));t.addProjection(e.name,i)}function V1(e,t,n){return N(e)?e.map(i=>V1(i,t,n)):Y(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:R("Unsupported parameter object: "+H(e)):e}const ki="top",Cu="left",$u="right",$s="bottom",WR="center",sQ="vertical",oQ="start",aQ="middle",uQ="end",X1="index",a2="label",lQ="offset",Xa="perc",cQ="perc2",Yn="value",jc="guide-label",u2="guide-title",fQ="group-title",dQ="group-subtitle",xC="symbol",hd="gradient",Y1="discrete",K1="size",hQ="shape",pQ="fill",gQ="stroke",mQ="strokeWidth",yQ="strokeDash",bQ="opacity",l2=[K1,hQ,pQ,gQ,mQ,yQ,bQ],qc={name:1,style:1,interactive:1},Ae={value:0},Kn={value:1},zp="group",GR="rect",c2="rule",vQ="symbol",Vo="text";function oc(e){return e.type=zp,e.interactive=e.interactive||!1,e}function $n(e,t){const n=(i,r)=>ci(e[i],ci(t[i],r));return n.isVertical=i=>sQ===ci(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>ci(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>ci(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>ci(e.columns,ci(t.columns,+n.isVertical(!0))),n}function HR(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function xQ(e,t,n){const i=t.config.style[n];return i&&i[e]}function Up(e,t,n){return`item.anchor === '${oQ}' ? ${e} : item.anchor === '${uQ}' ? ${t} : ${n}`}const f2=Up(H(Cu),H($u),H(WR));function EQ(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},Y(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function VR(e,t){return t?e?Y(e)?Object.assign({},e,{offset:VR(e.offset,t)}):{value:e,offset:t}:t:e}function zn(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Su(e.encode,t,qc)):e.interactive=!1,e}function AQ(e,t,n,i){const r=$n(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;s?(l=[0,1],c=[0,0],f=o,d=a):(l=[0,0],c=[1,0],f=a,d=o);const h={enter:u={opacity:Ae,x:Ae,y:Ae,width:Et(f),height:Et(d)},update:he({},u,{opacity:Kn,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Ae}};return Mt(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),zn({type:GR,role:YK,encode:h},i)}function wQ(e,t,n,i,r){const s=$n(e,n),o=s.isVertical(),a=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,h="";o?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:Ae,fill:{scale:t,field:Yn}};p[l]={signal:h+"datum."+Xa,mult:u},p[c]=Ae,p[f]={signal:h+"datum."+cQ,mult:u},p[d]=Et(a);const g={enter:p,update:he({},p,{opacity:Kn}),exit:{opacity:Ae}};return Mt(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),zn({type:GR,role:VK,key:Yn,from:r,encode:g},i)}const SQ=`datum.${Xa}<=0?"${Cu}":datum.${Xa}>=1?"${$u}":"${WR}"`,CQ=`datum.${Xa}<=0?"${$s}":datum.${Xa}>=1?"${ki}":"${aQ}"`;function EC(e,t,n,i){const r=$n(e,t),s=r.isVertical(),o=Et(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const p={enter:l={opacity:Ae},update:c={opacity:Kn,text:{field:a2}},exit:{opacity:Ae}};return Mt(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:ci(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=c.baseline={signal:CQ},f="y",d="x",h="1-"):(l.align=c.align={signal:SQ},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+Xa,mult:a},l[d]=c[d]=o,o.offset=ci(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+X1}:void 0,zn({type:Vo,role:kR,style:jc,key:Yn,from:i,encode:p,overlap:u},n)}function $Q(e,t,n,i,r){const s=$n(e,t),o=n.entries,a=!!(o&&o.interactive),u=o?o.name:void 0,l=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${lQ} : datum.${K1}`,h=l?Et(l):{field:K1},p=`datum.${X1}`,g=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:Ae,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Kn,x:y.x,y:y.y},exit:{opacity:Ae}};let E=null,w=null;e.fill||(E=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),Mt(m,{fill:s("symbolFillColor",E),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",w),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),l2.forEach(F=>{e[F]&&(b[F]=y[F]={scale:e[F],field:Yn})});const A=zn({type:vQ,role:KK,key:Yn,from:f,clip:l?!0:void 0,encode:m},n.symbols),C=Et(c);C.offset=s("labelOffset"),m={enter:y={opacity:Ae,x:{signal:d,offset:C},y:h},update:b={opacity:Kn,text:{field:a2},x:y.x,y:y.y},exit:{opacity:Ae}},Mt(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const S=zn({type:Vo,role:kR,style:jc,key:Yn,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:Ae,height:l?Et(l):Ae,opacity:Ae},exit:{opacity:Ae},update:b={opacity:Kn,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,x={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,x={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:X1}},oc({role:r2,from:i,encode:Su(m,o,qc),marks:[A,S],name:u,interactive:a,sort:x})}function FQ(e,t){const n=$n(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const d2='item.orient === "left"',h2='item.orient === "right"',jp=`(${d2} || ${h2})`,kQ=`datum.vgrad && ${jp}`,DQ=Up('"top"','"bottom"','"middle"'),_Q=Up('"right"','"left"','"center"'),OQ=`datum.vgrad && ${h2} ? (${_Q}) : (${jp} && !(datum.vgrad && ${d2})) ? "left" : ${f2}`,RQ=`item._anchor || (${jp} ? "middle" : "start")`,MQ=`${kQ} ? (${d2} ? -90 : 90) : 0`,TQ=`${jp} ? (datum.vgrad ? (${h2} ? "bottom" : "top") : ${DQ}) : "top"`;function NQ(e,t,n,i){const r=$n(e,t),s={enter:{opacity:Ae},update:{opacity:Kn,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ae}};return Mt(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:RQ},angle:{signal:MQ},align:{signal:OQ},baseline:{signal:TQ},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),zn({type:Vo,role:JK,style:u2,from:i,encode:s},n)}function IQ(e,t){let n;return Y(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+AC(e.path)+")":e.sphere&&(n="geoShape("+AC(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function AC(e){return Y(e)&&e.signal?e.signal:H(e)}function XR(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===zp?r2:t||n2}function LQ(e){return{marktype:e.type,name:e.name||void 0,role:e.role||XR(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function PQ(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function p2(e,t){const n=R3(e.type);n||R("Unrecognized transform type: "+H(e.type));const i=Lp(n.type.toLowerCase(),null,YR(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function YR(e,t,n){const i={},r=e.params.length;for(let s=0;s<r;++s){const o=e.params[s];i[o.name]=BQ(o,t,n)}return i}function BQ(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return zQ(e,t,n);if(r===void 0){e.required&&R("Missing required "+H(t.type)+" parameter: "+H(e.name));return}else{if(i==="param")return UQ(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!lt(r)?r.map(s=>wC(e,s,n)):wC(e,r,n)}function wC(e,t,n){const i=e.type;if(lt(t))return CC(i)?R("Expression references can not be signals."):R0(i)?n.fieldRef(t):$C(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||R0(i);return r&&jQ(t)?n.exprRef(t.expr,t.as):r&&qQ(t)?rc(t.field,t.as):CC(i)?Zi(t,n):WQ(i)?ie(n.getData(t).values):R0(i)?rc(t):$C(i)?n.compareRef(t):t}}function zQ(e,t,n){return K(t.from)||R('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function UQ(e,t,n){const i=t[e.name];return e.array?(N(i)||R("Expected an array of sub-parameters. Instead: "+H(i)),i.map(r=>SC(e,r,n))):SC(e,i,n)}function SC(e,t,n){const i=e.params.length;let r;for(let o=0;o<i;++o){r=e.params[o];for(const a in r.key)if(r.key[a]!==t[a]){r=null;break}if(r)break}r||R("Unsupported parameter: "+H(t));const s=he(YR(r,t,n),r.key);return ie(n.add(PJ(s)))}const jQ=e=>e&&e.expr,qQ=e=>e&&e.field,WQ=e=>e==="data",CC=e=>e==="expr",R0=e=>e==="field",$C=e=>e==="compare";function GQ(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||R("Only group marks can be faceted."),i.field!=null?o=a=pd(i,n):(e.data?a=ie(n.getData(e.data).aggregate):(s=p2(he({type:"aggregate",groupby:J(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=pd(i,n),o=a=ie(n.add(s))),r=n.keyRef(i.groupby,!0))):o=ie(n.add(Fi(null,[{}]))),o||(o=pd(e,n)),{key:r,pulse:o,parent:a}}function pd(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:ie(t.getData(e.data).output)}function $o(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}$o.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=ie(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(o=t[a]);return new $o(e,s,r,i,o)};function KR(e){return K(e)?e:null}function FC(e,t,n){const i=Pp(n.op,n.field);let r;if(t.ops){for(let s=0,o=t.as.length;s<o;++s)if(t.as[s]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function Ku(e,t,n,i,r,s,o){const a=t[n]||(t[n]={}),u=pJ(s);let l=KR(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=s?{field:G1,pulse:t.countsRef(e,r,s)}:{field:e.fieldRef(r),pulse:ie(t.output)};u&&(d.sort=e.sortRef(s)),f=e.add(Lp(i,void 0,d)),o&&(t.index[r]=f),c=ie(f),l!=null&&(a[l]=c)}return c}$o.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),s=KR(t);let o,a,u;return s!=null&&(e=i.scope,o=r[s]),o?n&&n.field&&FC(e,o.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:ie(i.output)},n&&n.field&&FC(e,u,n),a=e.add(TR(u)),o=e.add(Fi({pulse:ie(a)})),o={agg:a,ref:ie(o)},s!=null&&(r[s]=o)),o.ref},tuplesRef(){return ie(this.values)},extentRef(e,t){return Ku(e,this,"extent","extent",t,!1)},domainRef(e,t){return Ku(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return Ku(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return Ku(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return Ku(e,this,"indata","tupleindex",t,!0,!0)}};function HQ(e,t,n){const i=e.from.facet,r=i.name,s=pd(i,t);let o;i.name||R("Facet must have a name: "+H(i)),i.data||R("Facet must reference a data set: "+H(i)),i.field?o=t.add(LR({field:t.fieldRef(i.field),pulse:s})):i.groupby?o=t.add(DJ({key:t.keyRef(i.groupby),group:ie(t.proxy(n.parent)),pulse:s})):R("Facet must specify groupby or field: "+H(i));const a=t.fork(),u=a.add(Fi()),l=a.add(Ho({pulse:ie(u)}));a.addData(r,new $o(a,u,u,l)),a.addSignal("parent",null),o.params.subflow={$subflow:a.parse(e).toRuntime()}}function VQ(e,t,n){const i=t.add(LR({pulse:n.pulse})),r=t.fork();r.add(Ho()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function JR(e,t,n){const i=e.remove,r=e.insert,s=e.toggle,o=e.modify,a=e.values,u=t.add(vh()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,s,o,a].map(f=>f??"null").join(",")+"),0)",c=Zi(l,t);u.update=c.$expr,u.params=c.$params}function qp(e,t){const n=XR(e),i=e.type===zp,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===r2||n===i2,a,u,l,c,f,d,h;const p=n===n2||o||r,g=GQ(e.from,i,t);u=t.add(FJ({key:g.key||(e.key?rc(e.key):void 0),pulse:g.pulse,clean:!i}));const m=ie(u);u=l=t.add(Fi({pulse:m})),u=t.add(TJ({markdef:LQ(e),interactive:PQ(e.interactive,t),clip:IQ(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ie(u)}));const y=ie(u);u=c=t.add(IR(RR(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(w=>{const A=p2(w,t),C=A.metadata;(C.generates||C.changes)&&R("Mark transforms should not generate new data."),C.nomod||(c.params.mod=!0),A.params.pulse=ie(u),t.add(u=A)}),e.sort&&(u=t.add(qJ({sort:t.compareRef(e.sort),pulse:ie(u)})));const b=ie(u);(r||o)&&(o=t.add(BR({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=ie(o));const v=t.add(NR({mark:y,pulse:d||b}));h=ie(v),i&&(p&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||h,m),r?HQ(e,t,g):p?VQ(e,t,g):t.parse(e),t.popState(),p&&(o&&a.push(o),a.push(v))),s&&(h=XQ(s,h,t));const x=t.add(PR({pulse:h})),E=t.add(Ho({pulse:ie(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new $o(t,l,x,E)),e.on&&e.on.forEach(w=>{(w.insert||w.remove||w.toggle)&&R("Marks only support modify triggers."),JR(w,t,f)}))}function XQ(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:lt(s)?n.signalRef(s.signal):s,method:lt(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=lt(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return ie(n.add(LJ(o)))}function YQ(e,t){const n=t.config.legend,i=e.encode||{},r=$n(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,u=s.style,l={};let c=0,f,d,h;l2.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||R("Missing valid scale for legend.");const p=KQ(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=ie(t.add(Fi(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=ie(t.add(RJ(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===hd?(h=[AQ(e,c,n,i.gradient),EC(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${fo(r.gradientLength())})/100))`)):p===Y1?h=[wQ(e,c,n,i.gradient,b),EC(e,n,i.labels,b)]:(f=FQ(e,n),h=[$Q(e,n,i,b,fo(f.columns))],d.size=ZQ(e,t,h[0].marks)),h=[oc({role:XK,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(NQ(e,n,i.title,m)),qp(oc({role:HK,from:m,encode:Su(QQ(r,e,n),s,qc),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:u}),t)}function KQ(e,t){let n=e.type||xC;return!e.type&&JQ(e)===1&&(e.fill||e.stroke)&&(n=$v(t)?hd:c1(t)?Y1:xC),n!==hd?n:c1(t)?Y1:hd}function JQ(e){return l2.reduce((t,n)=>t+(e[n]?1:0),0)}function QQ(e,t,n){const i={enter:{},update:{}};return Mt(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function ZQ(e,t,n){const i=fo(kC("size",e,n)),r=fo(kC("strokeWidth",e,n)),s=fo(eZ(n[1].encode,t,jc));return Zi(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function kC(e,t,n){return t[e]?`scale("${t[e]}",datum)`:HR(e,n[0].encode)}function eZ(e,t,n){return HR("fontSize",e)||xQ("fontSize",t,n)}const tZ=`item.orient==="${Cu}"?-90:item.orient==="${$u}"?90:0`;function nZ(e,t){e=K(e)?{text:e}:e;const n=$n(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,u=[],l={},c=ie(t.add(Fi(null,[l])));return u.push(sZ(e,n,iZ(e),c)),e.subtitle&&u.push(oZ(e,n,i.subtitle,c)),qp(oc({role:QK,from:c,encode:rZ(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function iZ(e){const t=e.encode;return t&&t.title||he({name:e.name,interactive:e.interactive,style:e.style},t)}function rZ(e,t){const n={enter:{},update:{}};return Mt(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:f2},angle:{signal:tZ},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Su(n,t,qc)}function sZ(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Mt(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),zn({type:Vo,role:ZK,style:fQ,from:i,encode:o},n)}function oZ(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Mt(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),zn({type:Vo,role:eJ,style:dQ,from:i,encode:o},n)}function aZ(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(p2(i,t))}),e.on&&e.on.forEach(i=>{JR(i,t,e.name)}),t.addDataPipeline(e.name,uZ(e,t,n))}function uZ(e,t,n){const i=[];let r=null,s=!1,o=!1,a,u,l,c,f;for(e.values?lt(e.values)||fd(e.format)?(i.push(DC(t,e)),i.push(r=Ws())):i.push(r=Ws({$ingest:e.values,$format:e.format})):e.url?fd(e.url)||fd(e.format)?(i.push(DC(t,e)),i.push(r=Ws())):i.push(r=Ws({$request:e.url,$format:e.format})):e.source&&(r=a=J(e.source).map(d=>ie(t.getData(d).output)),i.push(null)),u=0,l=n.length;u<l;++u)c=n[u],f=c.metadata,!r&&!f.source&&i.push(r=Ws()),i.push(c),f.generates&&(o=!0),f.modifies&&!o&&(s=!0),f.source?r=c:f.changes&&(r=null);return a&&(l=a.length-1,i[0]=UJ({derive:s,pulse:l?a:a[0]}),(s||l)&&i.splice(1,0,Ws())),r||i.push(Ws()),i.push(Ho({})),i}function Ws(e){const t=Fi({},e);return t.metadata={source:!0},t}function DC(e,t){return MJ({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const QR=e=>e===$s||e===ki,Wp=(e,t,n)=>lt(e)?dZ(e.signal,t,n):e===Cu||e===ki?t:n,At=(e,t,n)=>lt(e)?cZ(e.signal,t,n):QR(e)?t:n,yi=(e,t,n)=>lt(e)?fZ(e.signal,t,n):QR(e)?n:t,ZR=(e,t,n)=>lt(e)?hZ(e.signal,t,n):e===ki?{value:t}:{value:n},lZ=(e,t,n)=>lt(e)?pZ(e.signal,t,n):e===$u?{value:t}:{value:n},cZ=(e,t,n)=>eM(`${e} === '${ki}' || ${e} === '${$s}'`,t,n),fZ=(e,t,n)=>eM(`${e} !== '${ki}' && ${e} !== '${$s}'`,t,n),dZ=(e,t,n)=>g2(`${e} === '${Cu}' || ${e} === '${ki}'`,t,n),hZ=(e,t,n)=>g2(`${e} === '${ki}'`,t,n),pZ=(e,t,n)=>g2(`${e} === '${$u}'`,t,n),eM=(e,t,n)=>(t=t!=null?Et(t):t,n=n!=null?Et(n):n,_C(t)&&_C(n)?(t=t?t.signal||H(t.value):null,n=n?n.signal||H(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[he({test:e},t)].concat(n||[])),_C=e=>e==null||Object.keys(e).length===1,g2=(e,t,n)=>({signal:`${e} ? (${Aa(t)}) : (${Aa(n)})`}),gZ=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${Cu}' ? (${Aa(i)}) : `:"")+(n!=null?`${e} === '${$s}' ? (${Aa(n)}) : `:"")+(r!=null?`${e} === '${$u}' ? (${Aa(r)}) : `:"")+(t!=null?`${e} === '${ki}' ? (${Aa(t)}) : `:"")+"(null)"}),Aa=e=>lt(e)?e.signal:e==null?null:H(e),mZ=(e,t)=>t===0?0:lt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Fa=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function fa(e,t,n,i){let r;if(t&&Q(t,e))return t[e];if(Q(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[u2][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[jc][r]}return null}function OC(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function yZ(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,u,l;if(lt(o)){const f=OC([n.axisX,n.axisY]),d=OC([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=At(o,fa(l,n.axisX,r,i),fa(l,n.axisY,r,i));u={};for(l of d)u[l]=gZ(o.signal,fa(l,n.axisTop,r,i),fa(l,n.axisBottom,r,i),fa(l,n.axisLeft,r,i),fa(l,n.axisRight,r,i))}else a=o===ki||o===$s?n.axisX:n.axisY,u=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||u||s?he({},r,a,u,s):r}function bZ(e,t,n,i){const r=$n(e,t),s=e.orient;let o,a;const u={enter:o={opacity:Ae},update:a={opacity:Kn},exit:{opacity:Ae}};Mt(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=RC(e,0),c=RC(e,1);return o.x=a.x=At(s,l,Ae),o.x2=a.x2=At(s,c),o.y=a.y=yi(s,l,Ae),o.y2=a.y2=yi(s,c),zn({type:c2,role:UK,from:i,encode:u},n)}function RC(e,t){return{scale:e.scale,range:t}}function vZ(e,t,n,i,r){const s=$n(e,t),o=e.orient,a=e.gridScale,u=Wp(o,1,-1),l=xZ(e.offset,u);let c,f,d;const h={enter:c={opacity:Ae},update:d={opacity:Kn},exit:f={opacity:Ae}};Mt(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const p={scale:e.scale,field:Yn,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=At(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:he(g,{mult:u,offset:l});return c.x=d.x=At(o,p,m),c.y=d.y=yi(o,p,m),c.x2=d.x2=yi(o,y),c.y2=d.y2=At(o,y),f.x=At(o,p),f.y=yi(o,p),zn({type:c2,role:jK,key:Yn,from:i,encode:h},n)}function xZ(e,t){if(t!==1)if(!Y(e))e=lt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=he({},e);for(;n.mult!=null;)if(Y(n.mult))n=n.mult=he({},n.mult);else return n.mult=lt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function EZ(e,t,n,i,r,s){const o=$n(e,t),a=e.orient,u=Wp(a,-1,1);let l,c,f;const d={enter:l={opacity:Ae},update:f={opacity:Kn},exit:c={opacity:Ae}};Mt(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const h=Et(r);h.mult=u;const p={scale:e.scale,field:Yn,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=l.y=At(a,Ae,p),f.y2=l.y2=At(a,h),c.x=At(a,p),f.x=l.x=yi(a,Ae,p),f.x2=l.x2=yi(a,h),c.y=yi(a,p),zn({type:c2,role:WK,key:Yn,from:i,encode:d},n)}function M0(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function AZ(e,t,n,i,r,s){const o=$n(e,t),a=e.orient,u=e.scale,l=Wp(a,-1,1),c=fo(o("labelFlush")),f=fo(o("labelFlushOffset")),d=o("labelAlign"),h=o("labelBaseline");let p=c===0||!!c,g;const m=Et(r);m.mult=l,m.offset=Et(o("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:Yn,band:.5,offset:VR(s.offset,o("labelOffset"))},b=At(a,p?M0(u,c,'"left"','"right"','"center"'):{value:"center"},lZ(a,"left","right")),v=At(a,ZR(a,"bottom","top"),p?M0(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=M0(u,c,`-(${f})`,f,0);p=p&&f;const E={opacity:Ae,x:At(a,y,m),y:yi(a,y,m)},w={enter:E,update:g={opacity:Kn,text:{field:a2},x:E.x,y:E.y,align:b,baseline:v},exit:{opacity:Ae,x:E.x,y:E.y}};Mt(w,{dx:!d&&p?At(a,x):null,dy:!h&&p?yi(a,x):null}),Mt(w,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:h});const A=o("labelBound");let C=o("labelOverlap");return C=C||A?{separation:o("labelSeparation"),method:C,order:"datum.index",bound:A?{scale:u,orient:a,tolerance:A}:null}:void 0,g.align!==b&&(g.align=Fa(g.align,b)),g.baseline!==v&&(g.baseline=Fa(g.baseline,v)),zn({type:Vo,role:qK,style:jc,key:Yn,from:i,encode:w,overlap:C},n)}function wZ(e,t,n,i){const r=$n(e,t),s=e.orient,o=Wp(s,-1,1);let a,u;const l={enter:a={opacity:Ae,anchor:Et(r("titleAnchor",null)),align:{signal:f2}},update:u=he({},a,{opacity:Kn,text:Et(e.title)}),exit:{opacity:Ae}},c={signal:`lerp(range("${e.scale}"), ${Up(0,1,.5)})`};return u.x=At(s,c),u.y=yi(s,c),a.angle=At(s,Ae,mZ(o,90)),a.baseline=At(s,ZR(s,$s,ki),{value:$s}),u.angle=a.angle,u.baseline=a.baseline,Mt(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),SZ(r,s,l,n),l.update.align=Fa(l.update.align,a.align),l.update.angle=Fa(l.update.angle,a.angle),l.update.baseline=Fa(l.update.baseline,a.baseline),zn({type:Vo,role:GK,style:u2,from:i,encode:l},n)}function SZ(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=Fa(Et(a),n.update[u]),!1):!ga(u,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?Et(o):At(t,Et(o),Et(s))}function CZ(e,t){const n=yZ(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,u=$n(e,n),l=EQ(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=ie(t.add(Fi({},[c]))),d=ie(t.add($J({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(vZ(e,n,i.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(EZ(e,n,i.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(AZ(e,n,i.labels,d,p,l))),c.domain&&h.push(bZ(e,n,i.domain,f)),c.title&&h.push(wZ(e,n,i.title,f)),qp(oc({role:zK,from:f,encode:Su($Z(u,e),r,qc),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:o,style:a}),t)}function $Z(e,t){const n={enter:{},update:{}};return Mt(n,{orient:e("orient"),offset:e("offset")||0,position:ci(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function tM(e,t,n){const i=J(e.signals),r=J(e.scales);return n||i.forEach(s=>MR(s,t)),J(e.projections).forEach(s=>rQ(s,t)),r.forEach(s=>HJ(s,t)),J(e.data).forEach(s=>aZ(s,t)),r.forEach(s=>VJ(s,t)),(n||i).forEach(s=>CJ(s,t)),J(e.axes).forEach(s=>CZ(s,t)),J(e.marks).forEach(s=>qp(s,t)),J(e.legends).forEach(s=>YQ(s,t)),e.title&&nZ(e.title,t),t.parseLambdas(),t}const FZ=e=>Su({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function kZ(e,t){const n=t.config,i=ie(t.root=t.add(vh())),r=DZ(e,n);r.forEach(l=>MR(l,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add(Fi()),o=t.add(IR(RR(FZ(e.encode),zp,i2,e.style,t,{pulse:ie(s)}))),a=t.add(BR({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:ie(o)}));t.operators.pop(),t.pushState(ie(o),ie(a),null),tM(e,t,r),t.operators.push(a);let u=t.add(NR({mark:i,pulse:ie(a)}));return u=t.add(PR({pulse:ie(u)})),u=t.add(Ho({pulse:ie(u)})),t.addData("root",new $o(t,s,s,u)),t}function Ju(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function DZ(e,t){const n=o=>ci(e[o],t[o]),i=[Ju("background",n("background")),Ju("autosize",LK(n("autosize"))),Ju("padding",BK(n("padding"))),Ju("width",n("width")||0),Ju("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return J(e.signals).forEach(o=>{Q(r,o.name)?o=he(r[o.name],o):i.push(o),s[o.name]=o}),J(t.signals).forEach(o=>{!Q(s,o.name)&&!Q(r,o.name)&&i.push(o)}),i}function nM(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function MC(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}nM.prototype=MC.prototype={parse(e){return tM(e,this)},fork(){return new MC(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof W1?ie(e):e;return this.add(zJ({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(ie(this.add(Ho({pulse:e})))),this._parent.push(t),this._lookup.push(n?ie(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return ye(this._parent)},encode(){return ye(this._encode)},lookup(){return ye(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(K(e))return rc(e,t);e.signal||R("Unsupported field reference: "+H(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=ie(this.add(_J(r)))}return i},compareRef(e){let t=!1;const n=s=>lt(s)?(t=!0,this.signalRef(s.signal)):gJ(s)?(t=!0,this.exprRef(s.expr)):s,i=J(e.field).map(n),r=J(e.order).map(n);return t?ie(this.add(vC({fields:i,orders:r}))):yC(i,r)},keyRef(e,t){let n=!1;const i=s=>lt(s)?(n=!0,ie(r[s.signal])):s,r=this.signals;return e=J(e).map(i),n?ie(this.add(OJ({fields:e,flat:t}))):fJ(e,t)},sortRef(e){if(!e)return e;const t=Pp(e.op,e.field),n=e.order||dJ;return n.signal?ie(this.add(vC({fields:t,orders:this.signalRef(n.signal)}))):yC(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return Q(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&R("Duplicate signal name: "+H(e));const n=t instanceof W1?t:this.add(vh(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||R("Unrecognized signal name: "+H(e)),this.signals[e]},signalRef(e){return this.signals[e]?ie(this.signals[e]):(Q(this.lambdas,e)||(this.lambdas[e]=this.add(vh(null))),ie(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const i=e[t],r=Zi(i,this),s=this.lambdas[i];s.params=r.$params,s.update=r.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!Y(e)?e:this.signalRef(e.signal||m2(e))},exprRef(e,t){const n={expr:Zi(e,this)};return t&&(n.expr.$name=t),ie(this.add(kJ(n)))},addBinding(e,t){this.bindings||R("Nested signals do not support binding: "+H(e)),this.bindings.push(he({signal:e},t))},addScaleProj(e,t){Q(this.scales,e)&&R("Duplicate scale or projection name: "+H(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,jJ(t))},addProjection(e,t){this.addScaleProj(e,BJ(t))},getScale(e){return this.scales[e]||R("Unrecognized scale name: "+H(e)),this.scales[e]},scaleRef(e){return ie(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return Q(this.data,e)&&R("Duplicate data set name: "+H(e)),this.data[e]=t},getData(e){return this.data[e]||R("Undefined data set name: "+H(e)),this.data[e]},addDataPipeline(e,t){return Q(this.data,e)&&R("Duplicate data set name: "+H(e)),this.addData(e,$o.fromEntries(this,t))}};function m2(e){return(N(e)?_Z:OZ)(e)}function _Z(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(Y(r)?r.signal||m2(r):H(r))}return n+"]"}function OZ(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+H(i)+":"+(Y(r)?r.signal||m2(r):H(r));return t+"}"}function RZ(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:o,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function MZ(e,t,n){return Y(e)||R("Input Vega specification must be an object."),t=gu(RZ(),t,e.config),kZ(e,new nM(t,n)).toRuntime()}var TZ="6.4.0";he(za,Az,cW,UW,bG,CG,QG,OG,eH,rH,pH,EH);const NZ=TZ,IZ=Object.freeze(Object.defineProperty({__proto__:null,Bounds:ht,CanvasHandler:Ic,CanvasRenderer:ah,DATE:Ge,DAY:He,DAYOFYEAR:Qi,Dataflow:$a,Debug:pD,DisallowedObjectProperties:db,Error:hb,EventStream:op,Gradient:q_,GroupItem:vp,HOURS:tt,Handler:Qv,HybridHandler:MO,HybridRenderer:E1,ISOWEEK:Je,Info:hD,Item:bp,MILLISECONDS:un,MINUTES:Ke,MONTH:Oe,Marks:Bn,MultiPulse:Rb,None:dD,Operator:Le,Parameters:sp,Pulse:ms,QUARTER:En,RenderType:cs,Renderer:Nc,ResourceLoader:Y_,SECONDS:Rt,SVGHandler:xO,SVGRenderer:rx,SVGStringRenderer:RO,Scenegraph:dO,TIME_UNITS:Cb,Transform:O,View:xR,WEEK:ut,Warn:pb,YEAR:ve,accessor:Cn,accessorFields:zt,accessorName:it,array:J,ascending:yu,bandwidthNRD:Ib,bin:N3,bootstrapCI:I3,boundClip:qO,boundContext:Oc,boundItem:m1,boundMark:uO,boundStroke:zr,changeset:qo,clampRange:kD,codegenExpression:H5,compare:bb,constant:Ht,cumulativeLogNormal:jb,cumulativeNormal:up,cumulativeUniform:Hb,dayofyear:BD,debounce:vb,defaultLocale:Fb,definition:R3,densityLogNormal:Ub,densityNormal:Lb,densityUniform:Gb,detectTimeUnits:d3,domChild:gt,domClear:qn,domCreate:us,domFind:Jv,dotbin:L3,error:R,expressionFunction:st,extend:he,extent:Ji,extentIndex:DD,falsy:Kr,fastmap:bu,field:Qn,flush:_D,font:Sp,fontFamily:Tc,fontSize:or,format:Yf,formatLocale:Vd,formats:_b,hasOwnProperty:Q,id:xc,identity:xn,inferType:E3,inferTypes:A3,ingest:Fe,inherits:V,inrange:va,interpolate:kv,interpolateColors:mp,interpolateRange:D_,intersect:BO,intersectBoxLine:xa,intersectPath:Iv,intersectPoint:Lv,intersectRule:J_,isArray:N,isBoolean:Uo,isDate:gs,isFunction:de,isIterable:OD,isNumber:Ce,isObject:Y,isRegExp:xb,isString:K,isTuple:ip,isoweek:UD,key:Eb,lerp:RD,lineHeight:ws,loader:tp,locale:v3,logger:Xh,lruCache:MD,markup:ix,merge:TD,mergeConfig:gu,multiLineOffset:Xv,one:pu,pad:ND,panLinear:AD,panLog:wD,panPow:SD,panSymlog:CD,parse:MZ,parseExpression:q5,parseSelector:Ts,path:zy,pathCurves:Mv,pathEqual:WO,pathParse:Wa,pathRectangle:H_,pathRender:Kl,pathSymbols:G_,pathTrail:V_,peek:ye,point:$p,projection:mx,quantileLogNormal:qb,quantileNormal:lp,quantileUniform:Vb,quantiles:Tb,quantizeInterpolator:__,quarter:$D,quartiles:Nb,get random(){return ei},randomInteger:$B,randomKDE:Bb,randomLCG:CB,randomLogNormal:B3,randomMixture:z3,randomNormal:Pb,randomUniform:U3,read:C3,regressionConstant:Xb,regressionExp:q3,regressionLinear:Yb,regressionLoess:H3,regressionLog:j3,regressionPoly:G3,regressionPow:W3,regressionQuad:Kb,renderModule:Fp,repeat:fl,resetDefaultLocale:wP,resetSVGDefIds:kq,responseType:S3,runtimeContext:oR,sampleCurve:fp,sampleLogNormal:zb,sampleNormal:ap,sampleUniform:Wb,scale:$e,sceneEqual:sx,sceneFromJSON:cO,scenePickVisit:Zd,sceneToJSON:lO,sceneVisit:xi,sceneZOrder:Pv,scheme:Dv,serializeXML:kO,setHybridRendererOptions:Sq,setRandom:wB,span:Jh,splitAccessPath:sr,stringValue:H,textMetrics:Nn,timeBin:f3,timeFloor:t3,timeFormatLocale:Vl,timeInterval:vu,timeOffset:r3,timeSequence:a3,timeUnitSpecifier:PD,timeUnits:$b,toBoolean:Ab,toDate:wb,toNumber:nn,toSet:vi,toString:Sb,transform:M3,transforms:za,truncate:ID,truthy:Zn,tupleid:re,typeParsers:a1,utcFloor:n3,utcInterval:xu,utcOffset:s3,utcSequence:u3,utcdayofyear:HD,utcisoweek:XD,utcquarter:FD,utcweek:VD,version:NZ,visitArray:es,week:zD,writeConfig:mu,zero:rs,zoomLinear:gb,zoomLog:mb,zoomPow:Hd,zoomSymlog:yb},Symbol.toStringTag,{value:"Module"}));function LZ(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var PZ={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},BZ={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},zZ={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const UZ=Array.prototype.slice,Gs=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,UZ.call(t,1))},jZ=(e,t=0,n=1,i=0,r=0,s=0,o=0)=>K(e)?new Date(e):new Date(e,t,n,i,r,s,o);var qZ={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,hypot:Math.hypot,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:jZ,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return Gs("join",arguments)},indexof:function(){return Gs("indexOf",arguments)},lastindexof:function(){return Gs("lastIndexOf",arguments)},slice:function(){return Gs("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(yu),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return Gs("substring",arguments,String)},split:function(){return Gs("split",arguments,String)},replace:function(){return Gs("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),encodeURIComponent:e=>encodeURIComponent(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const WZ=["view","item","group","xy","x","y"],J1=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&J1.add(setImmediate);const GZ={Literal:(e,t)=>t.regex&&t.value&&(t.value.global||t.value.sticky)?new RegExp(t.regex.pattern,t.regex.flags):t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:PZ[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),J1.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||qZ[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>BZ[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>zZ[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);e.memberDepth-=1;const s=e(i.value);return db.has(r)?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):J1.has(s)?console.error(`Prevented interpretation of method "${r}" which could lead to insecure code execution`):n[r]=s,n},{})};function Qu(e,t,n,i,r,s){const o=a=>GZ[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,WZ.forEach(a=>o.fn[a]=(...u)=>r.vega[a](...u)),o(e)}var HZ={operator(e,t){const n=t.ast,i=e.functions;return r=>Qu(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>Qu(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Qu(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return Qu(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const u=o.datum;let l=0,c;for(const f in i)c=Qu(i[f].ast,r,a,u,void 0,o),o[f]!==c&&(o[f]=c,l=1);return n!=="rule"&&LZ(o,i,s),l}}};const VZ="RawCode",XZ="Literal",YZ="Property",KZ="Identifier",JZ="ArrayExpression",QZ="BinaryExpression",ZZ="CallExpression",eee="ConditionalExpression",tee="LogicalExpression",nee="MemberExpression",iee="ObjectExpression",ree="UnaryExpression";function Di(e){this.type=e}Di.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=see(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function see(e){switch(e.type){case JZ:return e.elements;case QZ:case tee:return[e.left,e.right];case ZZ:return[e.callee].concat(e.arguments);case eee:return[e.test,e.consequent,e.alternate];case nee:return[e.object,e.property];case iee:return e.properties;case YZ:return[e.key,e.value];case ree:return[e.argument];case KZ:case XZ:case VZ:default:return[]}}var ur,te,T,Wt,Me,Gp=1,Wc=2,Fo=3,Ns=4,Hp=5,Xo=6,pn=7,Gc=8,oee=9;ur={};ur[Gp]="Boolean";ur[Wc]="<end>";ur[Fo]="Identifier";ur[Ns]="Keyword";ur[Hp]="Null";ur[Xo]="Numeric";ur[pn]="Punctuator";ur[Gc]="String";ur[oee]="RegularExpression";var aee="ArrayExpression",uee="BinaryExpression",lee="CallExpression",cee="ConditionalExpression",iM="Identifier",fee="Literal",dee="LogicalExpression",hee="MemberExpression",pee="ObjectExpression",gee="Property",mee="UnaryExpression",wt="Unexpected token %0",yee="Unexpected number",bee="Unexpected string",vee="Unexpected identifier",xee="Unexpected reserved word",Eee="Unexpected end of input",Q1="Invalid regular expression",T0="Invalid regular expression: missing /",rM="Octal literals are not allowed in strict mode.",Aee="Duplicate data property in object literal not allowed in strict mode",Ot="ILLEGAL",ac="Disabled.",wee=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),See=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Vp(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ar(e){return e>=48&&e<=57}function y2(e){return"0123456789abcdefABCDEF".includes(e)}function Ll(e){return"01234567".includes(e)}function Cee(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function uc(e){return e===10||e===13||e===8232||e===8233}function Hc(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&wee.test(String.fromCharCode(e))}function xh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&See.test(String.fromCharCode(e))}const $ee={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function sM(){for(;T<Wt;){const e=te.charCodeAt(T);if(Cee(e)||uc(e))++T;else break}}function Z1(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)T<Wt&&y2(te[T])?(i=te[T++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):Se({},wt,Ot);return String.fromCharCode(r)}function Fee(){var e,t,n,i;for(e=te[T],t=0,e==="}"&&Se({},wt,Ot);T<Wt&&(e=te[T++],!!y2(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&Se({},wt,Ot),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function oM(){var e,t;for(e=te.charCodeAt(T++),t=String.fromCharCode(e),e===92&&(te.charCodeAt(T)!==117&&Se({},wt,Ot),++T,e=Z1("u"),(!e||e==="\\"||!Hc(e.charCodeAt(0)))&&Se({},wt,Ot),t=e);T<Wt&&(e=te.charCodeAt(T),!!xh(e));)++T,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),te.charCodeAt(T)!==117&&Se({},wt,Ot),++T,e=Z1("u"),(!e||e==="\\"||!xh(e.charCodeAt(0)))&&Se({},wt,Ot),t+=e);return t}function kee(){var e,t;for(e=T++;T<Wt;){if(t=te.charCodeAt(T),t===92)return T=e,oM();if(xh(t))++T;else break}return te.slice(e,T)}function Dee(){var e,t,n;return e=T,t=te.charCodeAt(T)===92?oM():kee(),t.length===1?n=Fo:$ee.hasOwnProperty(t)?n=Ns:t==="null"?n=Hp:t==="true"||t==="false"?n=Gp:n=Fo,{type:n,value:t,start:e,end:T}}function N0(){var e=T,t=te.charCodeAt(T),n,i=te[T],r,s,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++T,{type:pn,value:String.fromCharCode(t),start:e,end:T};default:if(n=te.charCodeAt(T+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return T+=2,{type:pn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:T};case 33:case 61:return T+=2,te.charCodeAt(T)===61&&++T,{type:pn,value:te.slice(e,T),start:e,end:T}}}if(o=te.substr(T,4),o===">>>=")return T+=4,{type:pn,value:o,start:e,end:T};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return T+=3,{type:pn,value:s,start:e,end:T};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return T+=2,{type:pn,value:r,start:e,end:T};if(r==="//"&&Se({},wt,Ot),"<>=!+-*%&|^/".includes(i))return++T,{type:pn,value:i,start:e,end:T};Se({},wt,Ot)}function _ee(e){let t="";for(;T<Wt&&y2(te[T]);)t+=te[T++];return t.length===0&&Se({},wt,Ot),Hc(te.charCodeAt(T))&&Se({},wt,Ot),{type:Xo,value:parseInt("0x"+t,16),start:e,end:T}}function Oee(e){let t="0"+te[T++];for(;T<Wt&&Ll(te[T]);)t+=te[T++];return(Hc(te.charCodeAt(T))||Ar(te.charCodeAt(T)))&&Se({},wt,Ot),{type:Xo,value:parseInt(t,8),octal:!0,start:e,end:T}}function TC(){var e,t,n;if(n=te[T],Vp(Ar(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=T,e="",n!=="."){if(e=te[T++],n=te[T],e==="0"){if(n==="x"||n==="X")return++T,_ee(t);if(Ll(n))return Oee(t);n&&Ar(n.charCodeAt(0))&&Se({},wt,Ot)}for(;Ar(te.charCodeAt(T));)e+=te[T++];n=te[T]}if(n==="."){for(e+=te[T++];Ar(te.charCodeAt(T));)e+=te[T++];n=te[T]}if(n==="e"||n==="E")if(e+=te[T++],n=te[T],(n==="+"||n==="-")&&(e+=te[T++]),Ar(te.charCodeAt(T)))for(;Ar(te.charCodeAt(T));)e+=te[T++];else Se({},wt,Ot);return Hc(te.charCodeAt(T))&&Se({},wt,Ot),{type:Xo,value:parseFloat(e),start:t,end:T}}function Ree(){var e="",t,n,i,r,s=!1;for(t=te[T],Vp(t==="'"||t==='"',"String literal must starts with a quote"),n=T,++T;T<Wt;)if(i=te[T++],i===t){t="";break}else if(i==="\\")if(i=te[T++],!i||!uc(i.charCodeAt(0)))switch(i){case"u":case"x":te[T]==="{"?(++T,e+=Fee()):e+=Z1(i);break;case"n":e+=`
16
+ `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:Ll(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),T<Wt&&Ll(te[T])&&(s=!0,r=r*8+"01234567".indexOf(te[T++]),"0123".includes(i)&&T<Wt&&Ll(te[T])&&(r=r*8+"01234567".indexOf(te[T++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&te[T]===`
17
+ `&&++T;else{if(uc(i.charCodeAt(0)))break;e+=i}return t!==""&&Se({},wt,Ot),{type:Gc,value:e,octal:s,start:n,end:T}}function Mee(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";Se({},Q1)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Se({},Q1)}try{return new RegExp(e,t)}catch{return null}}function Tee(){var e,t,n,i,r;for(e=te[T],Vp(e==="/","Regular expression literal must start with a slash"),t=te[T++],n=!1,i=!1;T<Wt;)if(e=te[T++],t+=e,e==="\\")e=te[T++],uc(e.charCodeAt(0))&&Se({},T0),t+=e;else if(uc(e.charCodeAt(0)))Se({},T0);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||Se({},T0),r=t.substr(1,t.length-2),{value:r,literal:t}}function Nee(){var e,t,n;for(t="",n="";T<Wt&&(e=te[T],!!xh(e.charCodeAt(0)));)++T,e==="\\"&&T<Wt?Se({},wt,Ot):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Se({},Q1,n),{value:n,literal:t}}function Iee(){var e,t,n,i;return Me=null,sM(),e=T,t=Tee(),n=Nee(),i=Mee(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:T}}function Lee(e){return e.type===Fo||e.type===Ns||e.type===Gp||e.type===Hp}function aM(){if(sM(),T>=Wt)return{type:Wc,start:T,end:T};const e=te.charCodeAt(T);return Hc(e)?Dee():e===40||e===41||e===59?N0():e===39||e===34?Ree():e===46?Ar(te.charCodeAt(T+1))?TC():N0():Ar(e)?TC():N0()}function yn(){const e=Me;return T=e.end,Me=aM(),T=e.end,e}function uM(){const e=T;Me=aM(),T=e}function Pee(e){const t=new Di(aee);return t.elements=e,t}function NC(e,t,n){const i=new Di(e==="||"||e==="&&"?dee:uee);return i.operator=e,i.left=t,i.right=n,i}function Bee(e,t){const n=new Di(lee);return n.callee=e,n.arguments=t,n}function zee(e,t,n){const i=new Di(cee);return i.test=e,i.consequent=t,i.alternate=n,i}function b2(e){const t=new Di(iM);return t.name=e,t}function wl(e){const t=new Di(fee);return t.value=e.value,t.raw=te.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function IC(e,t,n){const i=new Di(hee);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function Uee(e){const t=new Di(pee);return t.properties=e,t}function LC(e,t,n){const i=new Di(gee);return i.key=t,i.value=n,i.kind=e,i}function jee(e,t){const n=new Di(mee);return n.operator=e,n.argument=t,n.prefix=!0,n}function Se(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(Vp(o<i.length,"Message reference must be in range"),i[o]));throw n=new Error(r),n.index=T,n.description=r,n}function Xp(e){e.type===Wc&&Se(e,Eee),e.type===Xo&&Se(e,yee),e.type===Gc&&Se(e,bee),e.type===Fo&&Se(e,vee),e.type===Ns&&Se(e,xee),Se(e,wt,e.value)}function Gt(e){const t=yn();(t.type!==pn||t.value!==e)&&Xp(t)}function Ue(e){return Me.type===pn&&Me.value===e}function I0(e){return Me.type===Ns&&Me.value===e}function qee(){const e=[];for(T=Me.start,Gt("[");!Ue("]");)Ue(",")?(yn(),e.push(null)):(e.push(ko()),Ue("]")||Gt(","));return yn(),Pee(e)}function PC(){T=Me.start;const e=yn();return e.type===Gc||e.type===Xo?(e.octal&&Se(e,rM),wl(e)):b2(e.value)}function Wee(){var e,t,n,i;if(T=Me.start,e=Me,e.type===Fo)return n=PC(),Gt(":"),i=ko(),LC("init",n,i);if(e.type===Wc||e.type===pn)Xp(e);else return t=PC(),Gt(":"),i=ko(),LC("init",t,i)}function Gee(){var e=[],t,n,i,r={},s=String;for(T=Me.start,Gt("{");!Ue("}");)t=Wee(),t.key.type===iM?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?Se({},Aee):r[i]=!0,e.push(t),Ue("}")||Gt(",");return Gt("}"),Uee(e)}function Hee(){Gt("(");const e=v2();return Gt(")"),e}const Vee={if:1};function Xee(){var e,t,n;if(Ue("("))return Hee();if(Ue("["))return qee();if(Ue("{"))return Gee();if(e=Me.type,T=Me.start,e===Fo||Vee[Me.value])n=b2(yn().value);else if(e===Gc||e===Xo)Me.octal&&Se(Me,rM),n=wl(yn());else{if(e===Ns)throw new Error(ac);e===Gp?(t=yn(),t.value=t.value==="true",n=wl(t)):e===Hp?(t=yn(),t.value=null,n=wl(t)):Ue("/")||Ue("/=")?(n=wl(Iee()),uM()):Xp(yn())}return n}function Yee(){const e=[];if(Gt("("),!Ue(")"))for(;T<Wt&&(e.push(ko()),!Ue(")"));)Gt(",");return Gt(")"),e}function Kee(){T=Me.start;const e=yn();return Lee(e)||Xp(e),b2(e.value)}function Jee(){return Gt("."),Kee()}function Qee(){Gt("[");const e=v2();return Gt("]"),e}function Zee(){var e,t,n;for(e=Xee();;)if(Ue("."))n=Jee(),e=IC(".",e,n);else if(Ue("("))t=Yee(),e=Bee(e,t);else if(Ue("["))n=Qee(),e=IC("[",e,n);else break;return e}function BC(){const e=Zee();if(Me.type===pn&&(Ue("++")||Ue("--")))throw new Error(ac);return e}function gd(){var e,t;if(Me.type!==pn&&Me.type!==Ns)t=BC();else{if(Ue("++")||Ue("--"))throw new Error(ac);if(Ue("+")||Ue("-")||Ue("~")||Ue("!"))e=yn(),t=gd(),t=jee(e.value,t);else{if(I0("delete")||I0("void")||I0("typeof"))throw new Error(ac);t=BC()}}return t}function zC(e){let t=0;if(e.type!==pn&&e.type!==Ns)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function ete(){var e,t,n,i,r,s,o,a,u,l;if(e=Me,u=gd(),i=Me,r=zC(i),r===0)return u;for(i.prec=r,yn(),t=[e,Me],o=gd(),s=[u,i,o];(r=zC(Me))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=NC(a,u,o),s.push(n);i=yn(),i.prec=r,s.push(i),t.push(Me),n=gd(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=NC(s[l-1].value,s[l-2],n),l-=2;return n}function ko(){var e,t,n;return e=ete(),Ue("?")&&(yn(),t=ko(),Gt(":"),n=ko(),e=zee(e,t,n)),e}function v2(){const e=ko();if(Ue(","))throw new Error(ac);return e}function tte(e){te=e,T=0,Wt=te.length,Me=null,uM();const t=v2();if(Me.type!==Wc)throw new Error("Unexpect token after expression.");return t}var nte="6.4.3",ite={version:nte};function x2(e){return q(e,"or")}function E2(e){return q(e,"and")}function A2(e){return q(e,"not")}function md(e,t){if(A2(e))md(e.not,t);else if(E2(e))for(const n of e.and)md(n,t);else if(x2(e))for(const n of e.or)md(n,t);else t(e)}function ka(e,t){return A2(e)?{not:ka(e.not,t)}:E2(e)?{and:e.and.map(n=>ka(n,t))}:x2(e)?{or:e.or.map(n=>ka(n,t))}:t(e)}const le=structuredClone;function lM(e){throw new Error(e)}function Ya(e,t){const n={};for(const i of t)Q(e,i)&&(n[i]=e[i]);return n}function Ln(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Te(e)).join(",")})`};function pe(e){if(Ce(e))return e;const t=K(e)?e:Te(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return n}function ey(e){return e===!1||e===null}function be(e,t){return e.includes(t)}function Ka(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function w2(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function cM(e,...t){for(const n of t)rte(e,n??{});return e}function rte(e,t){for(const n of z(t))mu(e,n,t[n],!0)}function Rn(e,t){const n=[],i={};let r;for(const s of e)r=t(s),!(r in i)&&(i[r]=1,n.push(s));return n}function ste(e,t){const n=z(e),i=z(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function fM(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function S2(e,t){for(const n of e)if(t.has(n))return!0;return!1}function ty(e){const t=new Set;for(const n of e){const r=sr(n).map((o,a)=>a===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function C2(e,t){return e===void 0||t===void 0?!0:S2(ty(e),ty(t))}function Pe(e){return z(e).length===0}const z=Object.keys,dt=Object.values,Fs=Object.entries;function Ja(e){return e===!0||e===!1}function Eh(e){return K(e)||Ce(e)||Ja(e)}function Xe(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Pl(e,t){return A2(e)?`!(${Pl(e.not,t)})`:E2(e)?`(${e.and.map(n=>Pl(n,t)).join(") && (")})`:x2(e)?`(${e.or.map(n=>Pl(n,t)).join(") || (")})`:t(e)}function Ah(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&Ah(e[n],t)&&delete e[n],Pe(e)}function Vc(e){return e.charAt(0).toUpperCase()+e.substr(1)}function $2(e,t="datum"){const n=sr(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(H).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function dM(e,t="datum"){return`${t}[${H(sr(e).join("."))}]`}function _e(e){return`datum['${e.replaceAll("'","\\'")}']`}function hM(e){return e.replaceAll("\\'","'").replaceAll("\\.",".")}function ote(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function ti(e){return`${sr(e).map(ote).join("\\.")}`}function Do(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Fu(e){return`${sr(e).join(".")}`}function Qa(e){return e?sr(e).length:0}function ct(...e){return e.find(t=>t!==void 0)}let pM=42;function gM(e){const t=++pM;return e?String(e)+t:t}function ate(){pM=42}function mM(e){return yM(e)?e:`__${e}`}function yM(e){return e.startsWith("__")}function lc(e){if(e!==void 0)return(e%360+360)%360}function Yp(e){return Ce(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const UC=Object.getPrototypeOf(structuredClone({}));function Mn(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!Mn(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;for(const s of e.entries())if(!Mn(s[1],t.get(s[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==UC.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==UC.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!Mn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Te(e){const t=[];return function n(i){if(i!=null&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?`${i}`:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;r<i.length;r++)r&&(s+=","),s+=n(i[r])||"null";return`${s}]`}if(i===null)return"null";if(t.includes(i))throw new TypeError("Converting circular structure to JSON");const o=t.push(i)-1,a=Object.keys(i).sort();for(s="",r=0;r<a.length;r++){const u=a[r],l=n(i[u]);l&&(s&&(s+=","),s+=`${JSON.stringify(u)}:${l}`)}return t.splice(o,1),`{${s}}`}(e)}function q(e,t){return Y(e)&&Q(e,t)&&e[t]!==void 0}const kr="row",Dr="column",Kp="facet",qe="x",yt="y",_i="x2",lr="y2",Nr="xOffset",ku="yOffset",Oi="radius",jr="radius2",ri="theta",qr="theta2",Ri="latitude",Mi="longitude",Ti="latitude2",ni="longitude2",Is="time",An="color",cr="fill",fr="stroke",wn="shape",Wr="size",Yo="angle",Gr="opacity",Ls="fillOpacity",Ps="strokeOpacity",Bs="strokeWidth",zs="strokeDash",Xc="text",Za="order",Yc="detail",Jp="key",_o="tooltip",Qp="href",Zp="url",eg="description",ute={x:1,y:1,x2:1,y2:1},bM={theta:1,theta2:1,radius:1,radius2:1};function vM(e){return Q(bM,e)}const F2={longitude:1,longitude2:1,latitude:1,latitude2:1};function xM(e){switch(e){case Ri:return"y";case Ti:return"y2";case Mi:return"x";case ni:return"x2"}}function EM(e){return Q(F2,e)}const lte=z(F2),k2={...ute,...bM,...F2,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,time:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function Da(e){return e===An||e===cr||e===fr}const AM={row:1,column:1,facet:1},Xn=z(AM),D2={...k2,...AM},cte=z(D2),{order:Bfe,detail:zfe,tooltip:Ufe,...fte}=D2,{row:jfe,column:qfe,facet:Wfe,...dte}=fte;function hte(e){return Q(dte,e)}function wM(e){return Q(D2,e)}const pte=[_i,lr,Ti,ni,qr,jr];function SM(e){return Ko(e)!==e}function Ko(e){switch(e){case _i:return qe;case lr:return yt;case Ti:return Ri;case ni:return Mi;case qr:return ri;case jr:return Oi}return e}function ks(e){if(vM(e))switch(e){case ri:return"startAngle";case qr:return"endAngle";case Oi:return"outerRadius";case jr:return"innerRadius"}return e}function dr(e){switch(e){case qe:return _i;case yt:return lr;case Ri:return Ti;case Mi:return ni;case ri:return qr;case Oi:return jr}}function Sn(e){switch(e){case qe:case _i:return"width";case yt:case lr:return"height"}}function CM(e){switch(e){case qe:return"xOffset";case yt:return"yOffset";case _i:return"x2Offset";case lr:return"y2Offset";case ri:return"thetaOffset";case Oi:return"radiusOffset";case qr:return"theta2Offset";case jr:return"radius2Offset"}}function _2(e){switch(e){case qe:return"xOffset";case yt:return"yOffset"}}function gte(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const mte=z(k2),{x:Gfe,y:Hfe,x2:Vfe,y2:Xfe,xOffset:Yfe,yOffset:Kfe,latitude:Jfe,longitude:Qfe,latitude2:Zfe,longitude2:ede,theta:tde,theta2:nde,radius:ide,radius2:rde,...O2}=k2,yte=z(O2),R2={x:1,y:1},Hr=z(R2);function ft(e){return Q(R2,e)}const M2={theta:1,radius:1},bte=z(M2);function tg(e){return e==="width"?qe:yt}const $M={xOffset:1,yOffset:1};function Kc(e){return Q($M,e)}const vte={time:1};function L0(e){return e in vte}const{text:sde,tooltip:ode,href:ade,url:ude,description:lde,detail:cde,key:fde,order:dde,...FM}=O2,xte=z(FM);function Ete(e){return Q(O2,e)}function Ate(e){switch(e){case An:case cr:case fr:case Wr:case wn:case Gr:case Bs:case zs:return!0;case Ls:case Ps:case Yo:case Is:return!1}}const kM={...R2,...M2,...$M,...FM},T2=z(kM);function hr(e){return Q(kM,e)}function wte(e,t){return Cte(e)[t]}const DM={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:hde,...Ste}=DM;function Cte(e){switch(e){case An:case cr:case fr:case eg:case Yc:case Jp:case _o:case Qp:case Za:case Gr:case Ls:case Ps:case Bs:case Kp:case kr:case Dr:return DM;case qe:case yt:case Nr:case ku:case Ri:case Mi:case Is:return Ste;case _i:case lr:case Ti:case ni:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Wr:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case zs:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case wn:return{point:"always",geoshape:"always"};case Xc:return{text:"always"};case Yo:return{point:"always",square:"always",text:"always"};case Zp:return{image:"always"};case ri:return{text:"always",arc:"always"};case Oi:return{text:"always",arc:"always"};case qr:case jr:return{arc:"always"}}}function P0(e){switch(e){case qe:case yt:case ri:case Oi:case Nr:case ku:case Wr:case Yo:case Bs:case Gr:case Ls:case Ps:case Is:case _i:case lr:case qr:case jr:return;case Kp:case kr:case Dr:case wn:case zs:case Xc:case _o:case Qp:case Zp:case eg:return"discrete";case An:case cr:case fr:return"flexible";case Ri:case Mi:case Ti:case ni:case Yc:case Jp:case Za:return}}const $te={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Fte={count:1,min:1,max:1};function Ir(e){return q(e,"argmin")}function Us(e){return q(e,"argmax")}function N2(e){return K(e)&&Q($te,e)}const kte=new Set(["count","valid","missing","distinct"]);function ng(e){return K(e)&&kte.has(e)}function Dte(e){return K(e)&&be(["min","max"],e)}const _te=new Set(["count","sum","distinct","valid","missing"]),Ote=new Set(["mean","average","median","q1","q3","min","max"]);function _M(e){return Uo(e)&&(e=pg(e,void 0)),`bin${z(e).map(t=>ig(e[t])?Xe(`_${t}_${Fs(e[t])}`):Xe(`_${t}_${e[t]}`)).join("")}`}function Be(e){return e===!0||Jo(e)&&!e.binned}function Ct(e){return e==="binned"||Jo(e)&&e.binned===!0}function Jo(e){return Y(e)}function ig(e){return q(e,"param")}function jC(e){switch(e){case kr:case Dr:case Wr:case An:case cr:case fr:case Bs:case Gr:case Ls:case Ps:case wn:return 6;case zs:return 4;default:return 10}}function Jc(e){return q(e,"expr")}function $t(e,{level:t}={level:0}){const n=z(e||{}),i={};for(const r of n)i[r]=t===0?_n(e[r]):$t(e[r],{level:t-1});return i}function OM(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=Ya(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function is(e){return K(e)||N(e)&&K(e[0])}function ne(e){return q(e,"signal")}function Qo(e){return q(e,"step")}function RM(e){return N(e)?!1:q(e,"fields")&&!q(e,"data")}function Rte(e){return N(e)?!1:q(e,"fields")&&q(e,"data")}function $r(e){return N(e)?!1:q(e,"field")&&q(e,"data")}const Mte={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},Tte=z(Mte),Nte={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},ny=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"],Ite=" – ";function MM(e){const t=N(e.condition)?e.condition.map(qC):qC(e.condition);return{..._n(e),condition:t}}function _n(e){if(Jc(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function qC(e){if(Jc(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function je(e){if(Jc(e)){const{expr:t,...n}=e;return{signal:t,...n}}return ne(e)?e:e!==void 0?{value:e}:void 0}function Lte(e){return ne(e)?e.signal:H(e)}function WC(e){return ne(e)?e.signal:H(e.value)}function gi(e){return ne(e)?e.signal:e==null?null:H(e)}function Pte(e,t,n){for(const i of n){const r=er(i,t.markDef,t.config);r!==void 0&&(e[i]=je(r))}return e}function TM(e){return[].concat(e.type,e.style??[])}function De(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&q(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:er(e,t,n,i)}function er(e,t,n,{vgChannel:i}={}){const r=iy(e,t,n.style);return ct(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function iy(e,t,n){return NM(e,TM(t),n)}function NM(e,t,n){t=J(t);let i;for(const r of t){const s=n[r];q(s,e)&&(i=s[e])}return i}function IM(e,t){return J(e).reduce((n,i)=>(n.field.push(X(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function LM(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Mn(r,i))return;n.push(i)}),n}function PM(e,t){return Mn(e,t)||!t?e:e?[...J(e),...J(t)].join(", "):t}function BM(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((is(n)||ne(n))&&(is(i)||ne(i)))return{explicit:e.explicit,value:PM(n,i)};if(is(n)||ne(n))return{explicit:e.explicit,value:n};if(is(i)||ne(i))return{explicit:e.explicit,value:i};if(!is(n)&&!ne(n)&&!is(i)&&!ne(i))return{explicit:e.explicit,value:LM(n,i)};throw new Error("It should never reach here")}function I2(e){return`Invalid specification ${Te(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Bte='Autosize "fit" only works for single views and layered views.';function GC(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function HC(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function VC(e){return e?`Dropping "fit-${e}" because spec has discrete ${Sn(e)}.`:'Dropping "fit" because spec has discrete size.'}function L2(e){return`Unknown field for ${e}. Cannot calculate view size.`}function XC(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function zte(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Ute(e){return`The "nearest" transform is not supported for ${e} marks.`}function zM(e){return`Selection not supported for ${e} yet.`}function jte(e){return`Cannot find a selection named "${e}".`}const qte="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Wte="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Gte="Legend bindings are only supported for selections over an individual field or encoding channel.";function Hte(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Vte(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Xte="The same selection must be used to override scale domains in a layered view.",Yte='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Kte(e){return`Unknown repeated value "${e}".`}function YC(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Jte="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",P2="Animation involving facet, layer, or concat is currently unsupported.";function Qte(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${H(e)}.`}function Zte(e,t,n,i){return`${e.length?"Multiple ":"No "}matching ${H(t)} encoding found for selection ${H(n.param)}. Using "field": ${H(i)}.`}const ene="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function tne(e){return`Unrecognized parse "${e}".`}function KC(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const nne="Attempt to add the same child twice.";function ine(e){return`Ignoring an invalid transform: ${Te(e)}.`}const rne='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function JC(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function sne(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Te(t)} is overridden by a child projection ${Te(n)}.`}const one="Arc marks uses theta channel rather than angle, replacing angle with theta.";function ane(e){return`${e}Offset dropped because ${e} is continuous`}function une(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Te(n)}}.`}function UM(e){return`Invalid field type "${e}".`}function lne(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function cne(e){return`Invalid aggregation operator "${e}".`}function jM(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function fne(e){return`Position range does not support relative band size for ${e}.`}function ry(e,t){return`Dropping ${Te(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const dne="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function rg(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function hne(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function pne(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function gne(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function mne(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function B0(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function yne(e){return`The ${e} for range marks cannot be an expression`}function bne(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function vne(e,t){return`Specified orient "${e}" overridden with "${t}".`}function xne(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Ene(e){return`Cannot use the relative band size with ${e} scale.`}function Ane(e){return`Using unaggregated domain with raw field has no effect (${Te(e)}).`}function wne(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Sne(e){return`Unaggregated domain is currently unsupported for log scale (${Te(e)}).`}function Cne(e){return`Cannot apply size to non-oriented mark "${e}".`}function $ne(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Fne(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function qM(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function WM(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function kne(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Te(n)} and ${Te(i)}). Using ${Te(n)}.`}function Dne(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Te(n)} and ${Te(i)}). Using the union of the two domains.`}function _ne(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function One(e){return`Dropping sort property ${Te(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const QC="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Rne="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Mne="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",Tne="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function Nne(e,t){return`Unioning discrete legend values from ${e} and ${t}.`}function Ine(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Lne(e){return`Stack is applied to a non-linear scale (${e}).`}function Pne(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function wh(e,t){return`Invalid ${e}: ${Te(t)}.`}function Bne(e){return`Dropping day from datetime ${Te(e)} as day cannot be combined with other units.`}function zne(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Une(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function jne(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function ZC(e){return`1D error band does not support ${e}.`}function GM(e){return`Channel ${e} is required for "binned" bin.`}function qne(e){return`Channel ${e} should not be used with "binned" bin.`}function Wne(e){return`Domain for ${e} is required for threshold scale.`}const HM=Xh(pb);let Oo=HM;function Gne(e){return Oo=e,Oo}function Hne(){return Oo=HM,Oo}function B2(...e){Oo.error(...e)}function W(...e){Oo.warn(...e)}function Vne(...e){Oo.debug(...e)}function Zo(e){if(e&&Y(e)){for(const t of U2)if(q(e,t))return!0}return!1}const VM=["january","february","march","april","may","june","july","august","september","october","november","december"],Xne=VM.map(e=>e.substr(0,3)),XM=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Yne=XM.map(e=>e.substr(0,3));function Kne(e){if(Yp(e)&&(e=+e),Ce(e))return e>4&&W(wh("quarter",e)),e-1;throw new Error(wh("quarter",e))}function Jne(e){if(Yp(e)&&(e=+e),Ce(e))return e-1;{const t=e.toLowerCase(),n=VM.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Xne.indexOf(i);if(r!==-1)return r;throw new Error(wh("month",e))}}function Qne(e){if(Yp(e)&&(e=+e),Ce(e))return e%7;{const t=e.toLowerCase(),n=XM.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Yne.indexOf(i);if(r!==-1)return r;throw new Error(wh("day",e))}}function z2(e,t){const n=[];if(t&&e.day!==void 0&&z(e).length>1&&(W(Bne(e)),e=le(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?Jne(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Kne(e.quarter):e.quarter;n.push(Ce(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?Qne(e.day):e.day;n.push(Ce(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function Ro(e){const n=z2(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Zne(e){const n=z2(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function eie(e){const t=z2(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const YM={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},U2=z(YM);function tie(e){return Q(YM,e)}function ea(e){return Y(e)?e.binned:KM(e)}function KM(e){return e==null?void 0:e.startsWith("binned")}function j2(e){return e.startsWith("utc")}function nie(e){return e.substring(3)}const iie={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function sg(e){return U2.filter(t=>QM(e,t))}function JM(e){const t=sg(e);return t[t.length-1]}function QM(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function rie(e,t,{end:n}={end:!1}){const i=$2(t),r=j2(e)?"utc":"";function s(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let o;const a={};for(const u of U2)QM(e,u)&&(a[u]=s(u),o=u);return n&&(a[o]+="+1"),Zne(a)}function ZM(e){if(!e)return;const t=sg(e);return`timeUnitSpecifier(${Te(t)}, ${Te(iie)})`}function sie(e,t,n){if(!e)return;const i=ZM(e);return`${n||j2(e)?"utc":"time"}Format(${t}, ${i})`}function St(e){if(!e)return;let t;return K(e)?KM(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:Y(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),j2(t.unit)&&(t.utc=!0,t.unit=nie(t.unit)),t}function oie(e){const{utc:t,...n}=St(e);return n.unit?(t?"utc":"")+z(n).map(i=>Xe(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):`${t?"utc":""}timeunit${z(n).map(i=>Xe(`_${i}_${n[i]}`)).join("")}`}function eT(e,t=n=>n){const n=St(e),i=JM(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=tT(i,n.step),a={...r,[o]:+r[o]+s};return`${t(Ro(a))} - ${t(Ro(r))}`}}const aie={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function uie(e){return Q(aie,e)}function tT(e,t=1){if(uie(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function lie(e){return q(e,"param")}function q2(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function W2(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function G2(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function H2(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function V2(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function X2(e){if(e!=null&&e.field){if(N(e.range)&&e.range.length===2)return!0;if(ne(e.range))return!0}return!1}function Y2(e){return!!(e!=null&&e.field)&&(N(e.oneOf)||N(e.in))}function cie(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function nT(e){return Y2(e)||q2(e)||X2(e)||W2(e)||H2(e)||G2(e)||V2(e)}function Li(e,t){return gg(e,{timeUnit:t,wrapTime:!0})}function fie(e,t){return e.map(n=>Li(n,t))}function iT(e,t=!0){const{field:n}=e,i=St(e.timeUnit),{unit:r,binned:s}=i||{},o=X(e,{expr:"datum"}),a=r?`time(${s?o:rie(r,n)})`:o;if(q2(e))return`${a}===${Li(e.equal,r)}`;if(W2(e)){const u=e.lt;return`${a}<${Li(u,r)}`}else if(H2(e)){const u=e.gt;return`${a}>${Li(u,r)}`}else if(G2(e)){const u=e.lte;return`${a}<=${Li(u,r)}`}else if(V2(e)){const u=e.gte;return`${a}>=${Li(u,r)}`}else{if(Y2(e))return`indexof([${fie(e.oneOf,r).join(",")}], ${a}) !== -1`;if(cie(e))return og(a,e.valid);if(X2(e)){const{range:u}=$t(e),l=ne(u)?{signal:`${u.signal}[0]`}:u[0],c=ne(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return`inrange(${a}, [${Li(l,r)}, ${Li(c,r)}])`;const f=[];return l!==null&&f.push(`${a} >= ${Li(l,r)}`),c!==null&&f.push(`${a} <= ${Li(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Te(e)}`)}function og(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function die(e){return nT(e)&&e.timeUnit?{...e,timeUnit:St(e.timeUnit)}:e}const Qc={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function hie(e){return e==="quantitative"||e==="temporal"}function K2(e){return e==="ordinal"||e==="nominal"}const Mo=Qc.quantitative,J2=Qc.ordinal,eu=Qc.temporal,Q2=Qc.nominal,Du=Qc.geojson;function pie(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Mo:return"quantitative";case"t":case eu:return"temporal";case"o":case J2:return"ordinal";case"n":case Q2:return"nominal";case Du:return"geojson"}}const Ft={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},sy={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function gie(e,t){const n=sy[e],i=sy[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const mie={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function e$(e){return mie[e]}const rT=new Set(["linear","log","pow","sqrt","symlog"]),sT=new Set([...rT,"time","utc"]);function oT(e){return rT.has(e)}const aT=new Set(["quantile","quantize","threshold"]),yie=new Set([...sT,...aT,"sequential","identity"]),bie=new Set(["ordinal","bin-ordinal","point","band"]);function rt(e){return bie.has(e)}function Ei(e){return yie.has(e)}function Gi(e){return sT.has(e)}function tu(e){return aT.has(e)}const vie={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function xie(e){return!K(e)&&q(e,"name")}function uT(e){return q(e,"param")}function Eie(e){return q(e,"unionWith")}function Aie(e){return Y(e)&&"field"in e}const wie={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:pde,domain:gde,range:mde,rangeMax:yde,rangeMin:bde,scheme:vde,...Sie}=wie,Cie=z(Sie);function oy(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return Gi(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Gi(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return Gi(e);case"nice":return Gi(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Ei(e)&&!be(["log","time","utc","threshold","quantile"],e)}}function lT(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Da(e)?void 0:xne(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function $ie(e,t){return be([J2,Q2],t)?e===void 0||rt(e):t===eu?be([Ft.TIME,Ft.UTC,void 0],e):t===Mo?oT(e)||tu(e)||e===void 0:!0}function Fie(e,t,n=!1){if(!hr(e))return!1;switch(e){case qe:case yt:case Nr:case ku:case ri:case Oi:return Gi(t)||t==="band"?!0:t==="point"?!n:!1;case Is:return be(["linear","band"],t);case Wr:case Bs:case Gr:case Ls:case Ps:case Yo:return Gi(t)||tu(t)||be(["band","point","ordinal"],t);case An:case cr:case fr:return t!=="band";case zs:case wn:return t==="ordinal"||tu(t)}}function kie(e){return Y(e)&&"value"in e}const fn={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},cT=fn.arc,ag=fn.area,ug=fn.bar,Die=fn.image,lg=fn.line,cg=fn.point,_ie=fn.rect,Sh=fn.rule,fT=fn.text,Z2=fn.tick,Oie=fn.trail,eE=fn.circle,tE=fn.square,dT=fn.geoshape;function js(e){return["line","area","trail"].includes(e)}function cc(e){return["rect","bar","image","arc","tick"].includes(e)}const Rie=new Set(z(fn));function tr(e){return q(e,"type")}const Mie=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Tie=["fill","fillOpacity"],Nie=[...Mie,...Tie],Iie={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},t$=z(Iie),z0=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],Lie={area:["line","point"],bar:z0,rect:z0,line:["point"],tick:["bandSize","thickness",...z0]},Pie={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},Bie={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},hT=z(Bie);function To(e){return q(e,"band")}const zie={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Uie=5,nE={binSpacing:0,continuousBandSize:Uie,minBandSize:.25,timeUnitBandPosition:.5},jie={...nE,binSpacing:1},qie={...nE,thickness:1};function Wie(e){return tr(e)?e.type:e}function pT(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function iE({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Ei(i)||r)return"always-valid";const s=pT(De("invalid",e,t),{isPath:js(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":s}function Gie(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function gT({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,o=t.domainHasZero();return o==="definitely"?{scale:e,value:0}:o==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:s})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function mT({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){var c;const o=n==null?void 0:n.get("type"),a=wi(t),u=ng(a==null?void 0:a.aggregate),l=iE({scaleChannel:e,markDef:r,config:s,scaleType:o,isCountAggregate:u});if(a&&l==="show"){const f=((c=s.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:og(X(a,{expr:"datum"}),!1),...Hie(f,n,i)}}}function Hie(e,t,n){if(kie(e)){const{value:i}=e;return ne(i)?{signal:i.signal}:{value:i}}return gT({scale:t,scaleName:n,mode:"zeroOrMin"})}function rE(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:o}=e,a=Ko(t),u=sE(e),l=mT({scaleChannel:a,channelDef:n,scale:r,scaleName:s,markDef:i,config:o});return l!==void 0?[l,u]:u}function Vie(e){const{datum:t}=e;return Zo(t)?Ro(t):`${Te(t)}`}function ho(e,t,n,i){const r={};if(t&&(r.scale=t),pr(e)){const{datum:s}=e;Zo(s)?r.signal=Ro(s):ne(s)?r.signal=s.signal:Jc(s)?r.signal=s.expr:r.value=s}else r.field=X(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function Ch({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!ne(o)&&0<o&&o<1?"datum":void 0,u=X(t,{expr:a,suffix:r}),l=n!==void 0?X(n,{expr:a}):X(t,{suffix:s,expr:a}),c={};if(o===0||o===1){c.scale=e;const f=o===0?u:l;c.field=f}else{const f=ne(o)?`(1-${o.signal}) * ${u} + ${o.signal} * ${l}`:`${1-o} * ${u} + ${o} * ${l}`;c.signal=`scale("${e}", ${f})`}return i&&(c.offset=i),c}function Xie({scaleName:e,fieldDef:t}){const n=X(t,{expr:"datum"}),i=X(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function sE({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l,bandPosition:c}){if(t){if(ce(t)){const f=o==null?void 0:o.get("type");if(ln(t)){c??(c=Lr({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:p}=t;if(Be(d)||c&&h&&p===eu)return a!=null&&a.impute?ho(t,s,{binSuffix:"mid"},{offset:u}):c&&!rt(f)?Ch({scaleName:s,fieldOrDatumDef:t,bandPosition:c,offset:u}):ho(t,s,rf(t,e)?{binSuffix:"range"}:{},{offset:u});if(Ct(d)){if(j(n))return Ch({scaleName:s,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});W(GM(e===qe?_i:lr))}}return ho(t,s,rt(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(Ai(t)){const f=t.value,d=u?{offset:u}:{};return{...Bl(e,f),...d}}}return de(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function Bl(e,t){return be(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:be(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:je(t)}function No(e){return e&&e!=="number"&&e!=="time"}function yT(e,t,n){return`${e}(${t}${n?`, ${Te(n)}`:""})`}function oE({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s}){var l;if(No(n))return mi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:s});const o=bT(e,i,r),a=nu(e);if(t===void 0&&n===void 0&&s.customFormatTypes){if(a==="quantitative"){if(r&&s.normalizedNumberFormatType)return mi({fieldOrDatumDef:e,format:s.normalizedNumberFormat,formatType:s.normalizedNumberFormatType,expr:i,config:s});if(s.numberFormatType)return mi({fieldOrDatumDef:e,format:s.numberFormat,formatType:s.numberFormatType,expr:i,config:s})}if(a==="temporal"&&s.timeFormatType&&j(e)&&e.timeUnit===void 0)return mi({fieldOrDatumDef:e,format:s.timeFormat,formatType:s.timeFormatType,expr:i,config:s})}function u(c){return j(c)?St(c.timeUnit)||{}:{unit:void 0,utc:void 0}}if(su(e)){const{unit:c,utc:f}=u(e),d=Kie({field:o,timeUnit:c,format:t,formatType:s.timeFormatType,rawTimeFormat:s.timeFormat,isUTCScale:f||ta(e)&&((l=e.scale)==null?void 0:l.type)===Ft.UTC});return d?{signal:d}:void 0}if(t=ay({type:a,specifiedFormat:t,config:s,normalizeStack:r}),j(e)&&Be(e.bin)){const c=X(e,{expr:i,binSuffix:"end"});return{signal:Zc(o,c,t,n,s)}}else return t||nu(e)==="quantitative"?{signal:`${ET(o,t)}`}:{signal:`isValid(${o}) ? ${o} : ""+${o}`}}function bT(e,t,n){return j(e)?n?`${X(e,{expr:t,suffix:"end"})}-${X(e,{expr:t,suffix:"start"})}`:X(e,{expr:t}):Vie(e)}function mi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s,field:o}){if(o??(o=bT(e,i,r)),o!=="datum.value"&&j(e)&&Be(e.bin)){const a=X(e,{expr:i,binSuffix:"end"});return{signal:Zc(o,a,t,n,s)}}return{signal:yT(n,o,t)}}function vT(e,t,n,i,r,s){var o;if(!(K(i)&&No(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&nu(e)==="quantitative"&&(r.normalizedNumberFormatType&&iu(e)&&e.stack==="normalize"||r.numberFormatType))){if(iu(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return ay({type:"quantitative",config:r,normalizeStack:!0});if(su(e)){const a=j(e)?(o=St(e.timeUnit))==null?void 0:o.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:Yie({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:s})}return ay({type:t,specifiedFormat:n,config:r})}}function xT(e,t,n){var i;if(e&&(ne(e)||e==="number"||e==="time"))return e;if(su(t)&&n!=="time"&&n!=="utc")return j(t)&&((i=St(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function ay({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(K(t))return t;if(e===Mo)return i?n.normalizedNumberFormat:n.numberFormat}function Yie({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:ZM(t)}:i?void 0:n.timeFormat)}function ET(e,t){return`format(${e}, "${t||""}")`}function n$(e,t,n,i){return No(n)?yT(n,e,t):ET(e,(K(t)?t:void 0)??i.numberFormat)}function Zc(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return Zc(e,t,r.numberFormat,r.numberFormatType,r);const s=n$(e,n,i,r),o=n$(t,n,i,r);return`${og(e,!1)} ? "null" : ${s} + "${Ite}" + ${o}`}function Kie({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:s}){return!t||n?!t&&i?`${i}(${e}, ${Te(n)})`:(n=K(n)?n:r,`${s?"utc":"time"}Format(${e}, ${Te(n)})`):sie(t,e,s)}const fg="min",Jie={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function i$(e){return Q(Jie,e)}function Qie(e){return q(e,"encoding")}function _r(e){return e&&(e.op==="count"||q(e,"field"))}function AT(e){return e&&N(e)}function ef(e){return q(e,"row")||q(e,"column")}function aE(e){return q(e,"header")}function dg(e){return q(e,"facet")}function Zie(e){return q(e,"param")}function ere(e){return!K(e)&&q(e,"repeat")}function r$(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function uE(e){return q(e,"sort")}function Lr({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(ce(e)&&e.bandPosition!==void 0)return e.bandPosition;if(j(e)){const{timeUnit:r,bin:s}=e;if(r&&!t)return er("timeUnitBandPosition",n,i);if(Be(s))return .5}}function wT({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:s,useVlSizeChannel:o}){var l,c,f;const a=Sn(e),u=De(o?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(j(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:er("timeUnitBandSize",i,r)};if(Be(h)&&!rt(s))return{band:1}}if(cc(i.type))return s?rt(s)?((l=r[i.type])==null?void 0:l.discreteBandSize)||{band:1}:(c=r[i.type])==null?void 0:c.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function ST(e,t,n,i){return Be(e.bin)||e.timeUnit&&ln(e)&&e.type==="temporal"?Lr({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function CT(e){return q(e,"sort")&&!q(e,"field")}function tf(e){return q(e,"condition")}function hg(e){const t=e==null?void 0:e.condition;return!!t&&!N(t)&&j(t)}function nf(e){const t=e==null?void 0:e.condition;return!!t&&!N(t)&&ce(t)}function tre(e){const t=e==null?void 0:e.condition;return!!t&&(N(t)||Ai(t))}function j(e){return q(e,"field")||(e==null?void 0:e.aggregate)==="count"}function nu(e){return e==null?void 0:e.type}function pr(e){return q(e,"datum")}function ps(e){return ln(e)&&!Fh(e)||$h(e)}function s$(e){return ln(e)&&e.type==="quantitative"&&!e.bin||$h(e)}function $h(e){return pr(e)&&Ce(e.datum)}function ce(e){return j(e)||pr(e)}function ln(e){return e&&(q(e,"field")||e.aggregate==="count")&&q(e,"type")}function Ai(e){return q(e,"value")}function ta(e){return q(e,"scale")||q(e,"sort")}function iu(e){return q(e,"axis")||q(e,"stack")||q(e,"impute")}function $T(e){return q(e,"legend")}function FT(e){return q(e,"format")||q(e,"formatType")}function nre(e){return Ln(e,["legend","axis","header","scale"])}function ire(e){return q(e,"op")}function X(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,s="";if(sre(e))n=mM("count");else{let o;if(!t.nofn)if(ire(e))o=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;Be(a)?(o=_M(a),r=(t.binSuffix??"")+(t.suffix??"")):u?Us(u)?(s=`["${n}"]`,n=`argmax_${u.argmax}`):Ir(u)?(s=`["${n}"]`,n=`argmin_${u.argmin}`):o=String(u):l&&!ea(l)&&(o=oie(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}o&&(n=n?`${o}_${n}`:o)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?Fu(n):t.expr?dM(n,t.expr)+s:ti(n)+s}function Fh(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return j(e)&&!!e.bin;case"temporal":return!1}throw new Error(UM(e.type))}function rre(e){var t;return ta(e)&&tu((t=e.scale)==null?void 0:t.type)}function sre(e){return e.aggregate==="count"}function ore(e,t){var o;const{field:n,bin:i,timeUnit:r,aggregate:s}=e;if(s==="count")return t.countTitle;if(Be(i))return`${n} (binned)`;if(r&&!ea(r)){const a=(o=St(r))==null?void 0:o.unit;if(a)return`${n} (${sg(a).join("-")})`}else if(s)return Us(s)?`${n} for max ${s.argmax}`:Ir(s)?`${n} for min ${s.argmin}`:`${Vc(s)} of ${n}`;return n}function are(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(Us(t))return`${r} for argmax(${t.argmax})`;if(Ir(t))return`${r} for argmin(${t.argmin})`;const s=i&&!ea(i)?St(i):void 0,o=t||(s==null?void 0:s.unit)||(s==null?void 0:s.maxbins)&&"timeunit"||Be(n)&&"bin";return o?`${o.toUpperCase()}(${r})`:r}const kT=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return are(e);default:return ore(e,t)}};let DT=kT;function _T(e){DT=e}function ure(){_T(kT)}function _a(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=lE(e))==null?void 0:a.title;if(!j(e))return r??e.title;const s=e,o=i?cE(s,t):void 0;return n?ct(r,s.title,o):r??s.title??o}function lE(e){if(iu(e)&&e.axis)return e.axis;if($T(e)&&e.legend)return e.legend;if(aE(e)&&e.header)return e.header}function cE(e,t){return DT(e,t)}function ru(e){if(FT(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=lE(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function lre(e,t){var s;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(uE(e)&&N(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Us(n)&&!Ir(n))return"quantitative";if(ta(e)&&((s=e.scale)!=null&&s.type))switch(sy[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function wi(e){if(j(e))return e;if(hg(e))return e.condition}function mt(e){if(ce(e))return e;if(nf(e))return e.condition}function OT(e,t,n,i={}){if(Eh(e)){const r=K(e)?"string":Ce(e)?"number":"boolean";return W(une(t,r,e)),{value:e}}return ce(e)?kh(e,t,n,i):nf(e)?{...e,condition:kh(e.condition,t,n,i)}:e}function kh(e,t,n,i){if(FT(e)){const{format:r,formatType:s,...o}=e;if(No(s)&&!n.customFormatTypes)return W(JC(t)),kh(o,t,n,i)}else{const r=iu(e)?"axis":$T(e)?"legend":aE(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(No(o)&&!n.customFormatTypes)return W(JC(t)),kh({...e,[r]:a},t,n,i)}}return j(e)?fE(e,t,i):cre(e)}function cre(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Ce(n)?"quantitative":K(n)?"nominal":Zo(n)?"temporal":void 0,{...e,type:t}}function fE(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!N2(i)&&!Us(i)&&!Ir(i)&&(W(cne(i)),delete a.aggregate),r&&(a.timeUnit=St(r)),o&&(a.field=`${o}`),Be(s)&&(a.bin=pg(s,t)),Ct(s)&&!ft(t)&&W(qne(t)),ln(a)){const{type:u}=a,l=pie(u);u!==l&&(a.type=l),u!=="quantitative"&&ng(i)&&(W(lne(u,i)),a.type="quantitative")}else if(!SM(t)){const u=lre(a,t);a.type=u}if(ln(a)){const{compatible:u,warning:l}=fre(a,t)||{};u===!1&&W(l)}if(uE(a)&&K(a.sort)){const{sort:u}=a;if(i$(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&i$(l))return{...a,sort:{encoding:l,order:"descending"}}}if(aE(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function pg(e,t){return Uo(e)?{maxbins:jC(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:jC(t)}:e}const da={compatible:!0};function fre(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case kr:case Dr:case Kp:return Fh(e)?da:{compatible:!1,warning:pne(t)};case qe:case yt:case Nr:case ku:case An:case cr:case fr:case Xc:case Yc:case Jp:case _o:case Qp:case Zp:case Yo:case ri:case Oi:case eg:return da;case Mi:case ni:case Ri:case Ti:return n!==Mo?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:da;case Gr:case Ls:case Ps:case Bs:case Wr:case qr:case jr:case _i:case lr:case Is:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:da;case wn:case zs:return!Fh(e)&&!rre(e)?{compatible:!1,warning:gne(t)}:da;case Za:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:da}}function su(e){const{formatType:t}=ru(e);return t==="time"||!t&&dre(e)}function dre(e){return e&&(e.type==="temporal"||j(e)&&!!e.timeUnit)}function gg(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const s=t&&((u=St(t))==null?void 0:u.unit);let o=s||n==="temporal",a;return Jc(e)?a=e.expr:ne(e)?a=e.signal:Zo(e)?(o=!0,a=Ro(e)):(K(e)||Ce(e))&&o&&(a=`datetime(${Te(e)})`,tie(s)&&(Ce(e)&&e<1e4||K(e)&&isNaN(Date.parse(e)))&&(a=Ro({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:Te(e)}function RT(e,t){const{type:n}=e;return t.map(i=>{const r=j(e)&&!ea(e.timeUnit)?e.timeUnit:void 0,s=gg(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function rf(e,t){return Be(e.bin)?hr(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const o$={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function sf(e){return e==null?void 0:e.condition}const MT=["domain","grid","labels","ticks","title"],hre={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},TT={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},pre={...TT,style:1,labelExpr:1,encoding:1};function a$(e){return Q(pre,e)}const gre={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},NT=z(gre);function Vr(e){return q(e,"mark")}class mg{constructor(t,n){L(this,"name");L(this,"run");this.name=t,this.run=n}hasMatchingType(t){return Vr(t)?Wie(t.mark)===this.name:!1}}function po(e,t){const n=e==null?void 0:e[t];return n?N(n)?Ka(n,i=>!!i.field):j(n)||hg(n):!1}function IT(e,t){const n=e==null?void 0:e[t];return n?N(n)?Ka(n,i=>!!i.field):j(n)||pr(n)||nf(n):!1}function LT(e,t){if(ft(t)){const n=e[t];if((j(n)||pr(n))&&(K2(n.type)||j(n)&&n.timeUnit)){const i=_2(t);return IT(e,i)}}return!1}function PT(e){return Ka(cte,t=>{if(po(e,t)){const n=e[t];if(N(n))return Ka(n,i=>!!i.aggregate);{const i=wi(n);return i&&!!i.aggregate}}return!1})}function BT(e,t){const n=[],i=[],r=[],s=[],o={};return dE(e,(a,u)=>{if(j(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=lE(a),g=p==null?void 0:p.title;let m=X(a,{forAs:!0});const y={...g?[]:{title:_a(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(Us(c)?(b="argmax",m=X({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):Ir(c)?(b="argmin",m=X({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};l&&(v.field=l),s.push(v)}}else if(n.push(m),ln(a)&&Be(f)){if(i.push({bin:f,field:l,as:m}),n.push(X(a,{binSuffix:"end"})),rf(a,u)&&n.push(X(a,{binSuffix:"range"})),ft(u)){const b={field:`${m}_end`};o[`${u}2`]=b}y.bin="binned",SM(u)||(y.type=Mo)}else if(d&&!ea(d)){r.push({timeUnit:d,field:l,as:m});const b=ln(a)&&a.type!==eu&&"time";b&&(u===Xc||u===_o?y.formatType=b:Ete(u)?y.legend={formatType:b,...y.legend}:ft(u)&&(y.axis={formatType:b,...y.axis}))}o[u]=y}else n.push(l),o[u]=e[u]}else o[u]=e[u]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function mre(e,t,n){const i=wte(t,n);if(i){if(i==="binned"){const r=e[t===_i?qe:yt];return!!(j(r)&&j(e[t])&&Ct(r.bin))}}else return!1;return!0}function yre(e,t,n,i){const r={};for(const s of z(e))wM(s)||W(hne(s));for(let s of mte){if(!e[s])continue;const o=e[s];if(Kc(s)){const a=gte(s),u=r[a];if(j(u)&&hie(u.type)&&j(o)&&!u.timeUnit){W(ane(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(W(one),s=ri),!mre(e,s,t)){W(rg(s,t));continue}if(s===Wr&&t==="line"){const a=wi(e[s]);if(a!=null&&a.aggregate){W(dne);continue}}if(s===An&&(n?"fill"in e:"stroke"in e)){W(jM("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Yc||s===Za&&!N(o)&&!Ai(o)||s===_o&&N(o)){if(o){if(s===Za){const a=e[s];if(CT(a)){r[s]=a;continue}}r[s]=J(o).reduce((a,u)=>(j(u)?a.push(fE(u,s)):W(ry(u,s)),a),[])}}else{if(s===_o&&o===null)r[s]=null;else if(!j(o)&&!pr(o)&&!Ai(o)&&!tf(o)&&!ne(o)){W(ry(o,s));continue}r[s]=OT(o,s,i)}}return r}function yg(e,t){const n={};for(const i of z(e)){const r=OT(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function bre(e){const t=[];for(const n of z(e))if(po(e,n)){const i=e[n],r=J(i);for(const s of r)j(s)?t.push(s):hg(s)&&t.push(s.condition)}return t}function dE(e,t,n){if(e)for(const i of z(e)){const r=e[i];if(N(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function vre(e,t,n,i){return e?z(e).reduce((r,s)=>{const o=e[s];return N(o)?o.reduce((a,u)=>t.call(i,a,u,s),r):t.call(i,r,o,s)},n):n}function zT(e,t){return z(t).reduce((n,i)=>{switch(i){case qe:case yt:case Qp:case eg:case Zp:case _i:case lr:return n;case Nr:case ku:{if(e==="line"||e==="area"||e==="trail"){const r=t[i];if(j(r)){const o=t[i===Nr?qe:yt];if(j(o)&&!o.aggregate&&!r.aggregate){const a=X(o,{}),u=X(r,{});a&&u&&a!==u&&n.push(a)}}}return n}case ri:case qr:case Oi:case jr:case Is:case Ri:case Mi:case Ti:case ni:case Xc:case wn:case Yo:case _o:return n;case Za:if(e==="line"||e==="trail")return n;case Yc:case Jp:{const r=t[i];if(N(r)||j(r))for(const s of J(r))s.aggregate||n.push(X(s,{}));return n}case Wr:if(e==="trail")return n;case An:case cr:case fr:case Gr:case Ls:case Ps:case zs:case Bs:{const r=wi(t[i]);return r&&!r.aggregate&&n.push(X(r,{})),n}}},[])}function xre(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(N(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return N(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function uy(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const u=i?` of ${hE(t)}`:"";return{field:o+t.field,type:t.type,title:ne(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),s=bre(n).map(nre);return{tooltip:[...r,...Rn(s,pe)]}}function hE(e){const{title:t,field:n}=e;return ct(t,n)}function pE(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=hE(n);return UT(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...K(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function UT(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...tr(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...Uo(e[t])?{}:e[t]}}]:[]}function jT(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:Tf(s,n),continuousAxisChannelDef2:Tf(o,n),continuousAxisChannelDefError:Tf(a,n),continuousAxisChannelDefError2:Tf(u,n),continuousAxis:r}}function Tf(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&W(jne(n,t)),i}else return e}function qT(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(tr(n)&&n.orient)return n.orient;if(ps(r)){if(ps(s)){const o=j(r)&&r.aggregate,a=j(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return su(s)&&!su(r)?"horizontal":"vertical"}return"horizontal"}else{if(ps(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Dh="boxplot",Ere=["box","median","outliers","rule","ticks"],Are=new mg(Dh,GT);function WT(e){return Ce(e)?"tukey":e}function GT(e,{config:t}){e={...e,encoding:yg(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=tr(n)?n:{type:n};r&&W(zM("boxplot"));const u=a.extent??t.boxplot.extent,l=De("size",a,t),c=a.invalid,f=WT(u),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:E,customTooltipWithoutAggregatedField:w}=wre(e,u,t),A=Fu(g.field),{color:C,size:S,...F}=v,k=Q6=>pE(a,m,g,Q6,t.boxplot),P=k(F),U=k(v),_=(Y(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",$=k({...F,...S?{size:S}:{},color:{condition:{test:`${_e(`lower_box_${g.field}`)} >= ${_e(`upper_box_${g.field}`)}`,...C||{value:_}}}}),D=uy([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),I={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},G=f==="min-max"?D:uy([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),B=[...P({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:G}),...P({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:G}),...P({partName:"ticks",mark:I,positionPrefix:"lower_whisker",extraEncoding:G}),...P({partName:"ticks",mark:I,positionPrefix:"upper_whisker",extraEncoding:G})],Z=[...f!=="tukey"?B:[],...U({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:E,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:D}),...$({partName:"median",mark:{type:"tick",invalid:c,...Y(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:D})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(p),layer:Z};const fe=_e(`lower_box_${g.field}`),ue=_e(`upper_box_${g.field}`),xe=`(${ue} - ${fe})`,ot=`${fe} - ${u} * ${xe}`,ke=`${ue} + ${u} * ${xe}`,Ni=_e(g.field),K6={joinaggregate:HT(g.field),groupby:y},tA={transform:[{filter:`(${ot} <= ${Ni}) && (${Ni} <= ${ke})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${A}`},{op:"max",field:g.field,as:`upper_whisker_${A}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${A}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${A}`},...b],groupby:y}],layer:B},{tooltip:Cfe,...J6}=F,{scale:nA,axis:iA}=g,rA=hE(g),sA=UT(a,"outliers",t.boxplot,{transform:[{filter:`(${Ni} < ${ot}) || (${Ni} > ${ke})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...rA!==void 0?{title:rA}:{},...nA!==void 0?{scale:nA}:{},...iA!==void 0?{axis:iA}:{}},...J6,...C?{color:C}:{},...w?{tooltip:w}:{}}})[0];let lf;const oA=[...d,...h,K6];return sA?lf={transform:oA,layer:[sA,tA]}:(lf=tA,lf.transform.unshift(...oA)),{...o,layer:[lf,{transform:p,layer:Z}]}}function HT(e){const t=Fu(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function wre(e,t,n){const i=qT(e,Dh),{continuousAxisChannelDef:r,continuousAxis:s}=jT(e,i,Dh),o=r.field,a=Fu(o),u=WT(t),l=[...HT(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`${_e(`upper_box_${a}`)} - ${_e(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${_e(`upper_box_${a}`)} + ${_e(`iqr_${a}`)} * ${t}, ${_e(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${_e(`lower_box_${a}`)} - ${_e(`iqr_${a}`)} * ${t}, ${_e(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=xre(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=BT(p,n),x=i==="vertical"?"horizontal":"vertical",E=i,w=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:w,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:E,customTooltipWithoutAggregatedField:h}}const gE="errorbar",Sre=["ticks","rule"],Cre=new mg(gE,VT);function VT(e,{config:t}){e={...e,encoding:yg(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:u,tooltipEncoding:l}=XT(e,gE,t);delete s.size;const c=pE(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function $re(e,t){const{encoding:n}=e;if(Fre(n))return{orient:qT(e,t),inputType:"raw"};const i=kre(n),r=Dre(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(ce(a)&&ce(u))throw new Error(`${t} cannot have both x2 and y2`);if(ce(a)){if(ps(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(ce(u)){if(ps(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(ce(u)&&!ce(a))throw new Error(`${t} cannot have xError2 without xError`);if(ce(c)&&!ce(l))throw new Error(`${t} cannot have yError2 without yError`);if(ce(a)&&ce(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(ce(a)){if(ps(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(ce(l)){if(ps(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Fre(e){return(ce(e.x)||ce(e.y))&&!ce(e.x2)&&!ce(e.y2)&&!ce(e.xError)&&!ce(e.xError2)&&!ce(e.yError)&&!ce(e.yError2)}function kre(e){return ce(e.x2)||ce(e.y2)}function Dre(e){return ce(e.xError)||ce(e.xError2)||ce(e.yError)||ce(e.yError2)}function XT(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,u=tr(i)?i:{type:i};s&&W(zM(t));const{orient:l,inputType:c}=$re(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=jT(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=_re(u,f,d,h,p,c,t,n),{[g]:x,[g==="x"?"x2":"y2"]:E,[g==="x"?"xError":"yError"]:w,[g==="x"?"xError2":"yError2"]:A,...C}=r,{bins:S,timeUnits:F,aggregate:k,groupby:P,encoding:U}=BT(C,n),_=[...k,...m],$=c!=="raw"?[]:P,D=uy(b,f,U,v);return{transform:[...a.transform??[],...S,...F,..._.length===0?[]:[{aggregate:_,groupby:$}],...y],groupby:$,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:U,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:D}}function _re(e,t,n,i,r,s,o,a){let u=[],l=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&W(Une(h,p,o)),p==="stderr"||p==="stdev")u=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`${_e(`center_${c}`)} + ${_e(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${_e(`center_${c}`)} - ${_e(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Vc(h)},{fieldPrefix:"upper_",titlePrefix:u$(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:u$(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:_a({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:_a({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:_a({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&W(zne(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],l=[{calculate:_e(n.field),as:`upper_${c}`},{calculate:_e(c),as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${_e(c)} + ${_e(i.field)}`,as:`upper_${c}`}],r?l.push({calculate:`${_e(c)} + ${_e(r.field)}`,as:`lower_${c}`}):l.push({calculate:`${_e(c)} - ${_e(i.field)}`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:Do(Do(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function u$(e,t,n){return`${Vc(e)} ${n} ${t}`}const mE="errorband",Ore=["band","borders"],Rre=new mg(mE,YT);function YT(e,{config:t}){e={...e,encoding:yg(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:u}=XT(e,mE,t),l=o,c=pE(l,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):l.interpolate?W(ZC("interpolate")):l.tension&&W(ZC("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const KT={};function yE(e,t,n){const i=new mg(e,t);KT[e]={normalizer:i,parts:n}}function Mre(){return z(KT)}yE(Dh,GT,Ere);yE(gE,VT,Sre);yE(mE,YT,Ore);const Tre=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],JT={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},QT={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},Nre=z(JT),Ire=z(QT),Lre={header:1,headerRow:1,headerColumn:1,headerFacet:1},ZT=z(Lre),eN=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Pre={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Bre={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Si="_vgsid_",zre={point:{on:"click",fields:[Si],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function bE(e){return e==="legend"||!!(e!=null&&e.legend)}function U0(e){return bE(e)&&Y(e)}function vE(e){return!!(e!=null&&e.select)}function tN(e){const t=[];for(const n of e||[]){if(vE(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function Ure(e){return bg(e)||EE(e)||xE(e)}function xE(e){return q(e,"concat")}function bg(e){return q(e,"vconcat")}function EE(e){return q(e,"hconcat")}function nN({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function nr(e){return q(e,"step")}function l$(e){return q(e,"view")||q(e,"width")||q(e,"height")}const c$=20,jre={align:1,bounds:1,center:1,columns:1,spacing:1},qre=z(jre);function Wre(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(dg(e)&&!ef(e.facet)||xE(e))&&(r.columns=o),bg(e)&&(r.columns=1);for(const a of qre)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=Ce(u)?u:{row:u.row??s,column:u.column??s}}else r[a]=e[a];return r}function ly(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function cy(e,t){const n=_h(e,t);return nr(n)?n.step:iN}function _h(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return ct(n,{step:e.step})}const iN=20,Gre={continuousWidth:300,continuousHeight:300,step:iN},Hre={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:Gre,mark:Pie,arc:{},area:{},bar:jie,circle:{},geoshape:{},image:{},line:{},point:{},rect:nE,rule:{color:"black"},square:{},text:{color:"black"},tick:qie,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:vie,projection:{},legend:Pre,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:zre,style:{},title:{},facet:{spacing:c$},concat:{spacing:c$},normalizedNumberFormat:".0%"},br=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],f$={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},d$={blue:br[0],orange:br[1],red:br[2],teal:br[3],green:br[4],yellow:br[5],purple:br[6],pink:br[7],brown:br[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Vre(e={}){return{signals:[{name:"color",value:Y(e)?{...d$,...e}:d$}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Xre(e){return{signals:[{name:"fontSize",value:Y(e)?{...f$,...e}:f$}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function Yre(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function rN(e){const t=z(e||{}),n={};for(const i of t){const r=e[i];n[i]=sf(r)?MM(r):_n(r)}return n}function Kre(e){const t=z(e),n={};for(const i of t)n[i]=rN(e[i]);return n}const Jre=[...hT,...NT,...ZT,"background","padding","legend","lineBreak","scale","style","title","view"];function sN(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=gu({},le(Hre),n?Yre(n):{},t?Vre(t):{},i?Xre(i):{},s||{});r&&mu(o,"selection",r,!0);const a=Ln(o,Jre);for(const u of["background","lineBreak","padding"])o[u]&&(a[u]=_n(o[u]));for(const u of hT)o[u]&&(a[u]=$t(o[u]));for(const u of NT)o[u]&&(a[u]=rN(o[u]));for(const u of ZT)o[u]&&(a[u]=$t(o[u]));if(o.legend&&(a.legend=$t(o.legend)),o.scale){const{invalid:u,...l}=o.scale,c=$t(u,{level:1});a.scale={...$t(l),...z(c).length>0?{invalid:c}:{}}}return o.style&&(a.style=Kre(o.style)),o.title&&(a.title=$t(o.title)),o.view&&(a.view=$t(o.view)),a}const Qre=new Set(["view",...Rie]),Zre=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],ese={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Lie};function tse(e){e=le(e);for(const t of Zre)delete e[t];if(e.axis)for(const t in e.axis)sf(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Tre)delete e.legend[t];if(e.mark){for(const t of t$)delete e.mark[t];e.mark.tooltip&&Y(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(tN(e.params)),delete e.params);for(const t of Qre){for(const i of t$)delete e[t][i];const n=ese[t];if(n)for(const i of n)delete e[t][i];ise(e,t)}for(const t of Mre())delete e[t];nse(e);for(const t in e)Y(e[t])&&Pe(e[t])&&delete e[t];return Pe(e)?void 0:e}function nse(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=OM(e.title);Pe(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Pe(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Pe(i)?delete e.title:e.title=i}function ise(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};Pe(s)||(e.style[n??t]=s),delete e[t]}function vg(e){return q(e,"layer")}function rse(e){return q(e,"repeat")}function sse(e){return!N(e.repeat)&&q(e.repeat,"layer")}class AE{map(t,n){return dg(t)?this.mapFacet(t,n):rse(t)?this.mapRepeat(t,n):EE(t)?this.mapHConcat(t,n):bg(t)?this.mapVConcat(t,n):xE(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(vg(t))return this.mapLayer(t,n);if(Vr(t))return this.mapUnit(t,n);throw new Error(I2(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const ose={zero:1,center:1,normalize:1};function ase(e){return Q(ose,e)}const use=new Set([cT,ug,ag,Sh,cg,eE,tE,lg,fT,Z2]),lse=new Set([ug,ag,cT]);function ha(e){return j(e)&&nu(e)==="quantitative"&&!e.bin}function h$(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(j(o)&&j(a))if(ha(o)&&ha(a)){if(o.stack)return t;if(a.stack)return r;const u=j(o)&&!!o.aggregate,l=j(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(ha(o))return t;if(ha(a))return r}else{if(ha(o))return s&&n==="vertical"?void 0:t;if(ha(a))return s&&n==="horizontal"?void 0:r}}function cse(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function oN(e,t){var g,m;const n=tr(e)?e:{type:e},i=n.type;if(!use.has(i))return null;const r=h$(t,"x",n)||h$(t,"theta",n);if(!r)return null;const s=t[r],o=j(s)?X(s,{}):void 0,a=cse(r),u=[],l=new Set;if(t[a]){const y=t[a],b=j(y)?X(y,{}):void 0;b&&b!==o&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=j(f)?X(f,{}):void 0;d&&d!==o&&(u.push(c),l.add(d));const h=yte.reduce((y,b)=>{if(b!=="tooltip"&&po(t,b)){const v=t[b];for(const x of J(v)){const E=wi(x);if(E.aggregate)continue;const w=X(E,{});(!w||!l.has(w))&&y.push({channel:b,fieldDef:E})}}return y},[]);let p;return s.stack!==void 0?Uo(s.stack)?p=s.stack?"zero":null:p=s.stack:lse.has(i)&&(p="zero"),!p||!ase(p)||PT(t)&&h.length===0?null:((g=s==null?void 0:s.scale)!=null&&g.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==Ft.LINEAR&&s!=null&&s.stack&&W(Lne(s.scale.type)),ce(t[dr(r)])?(s.stack!==void 0&&W(Ine(r)),null):(j(s)&&s.aggregate&&!_te.has(s.aggregate)&&W(Pne(s.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:s.impute===null?!1:js(i),stackBy:h,offset:p}))}function aN(e,t,n){const i=$t(e),r=De("orient",i,n);if(i.orient=pse(i.type,t,r),r!==void 0&&r!==i.orient&&W(vne(i.orient,r)),i.type==="bar"&&i.orient){const u=De("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:zie[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=De("opacity",i,n),o=De("fillOpacity",i,n);return s===void 0&&o===void 0&&(i.opacity=dse(i.type,t)),De("cursor",i,n)===void 0&&(i.cursor=fse(i,t,n)),i}function fse(e,t,n){return t.href||e.href||De("href",e,n)?"pointer":e.cursor}const uN=.7;function dse(e,t){if(be([cg,Z2,eE,tE],e)&&!PT(t))return uN}function hse(e,t,{graticule:n}){if(n)return!1;const i=er("filled",e,t),r=e.type;return ct(i,r!==cg&&r!==lg&&r!==Sh)}function pse(e,t,n){switch(e){case cg:case eE:case tE:case _ie:case Die:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case fT:case ug:if(j(i)&&(Ct(i.bin)||j(r)&&r.aggregate&&!i.aggregate))return"vertical";if(j(r)&&(Ct(r.bin)||j(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(j(i)&&i.type===Mo&&!Be(i.bin)||$h(i))&&j(r)&&Ct(r.bin)?"horizontal":"vertical";if(!o)return(j(r)&&r.type===Mo&&!Be(r.bin)||$h(r))&&j(i)&&Ct(i.bin)?"vertical":"horizontal"}case Sh:if(s&&!(j(i)&&Ct(i.bin))&&o&&!(j(r)&&Ct(r.bin)))return;case ag:if(o)return j(r)&&Ct(r.bin)?"horizontal":"vertical";if(s)return j(i)&&Ct(i.bin)?"vertical":"horizontal";if(e===Sh){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case lg:case Z2:{const a=s$(i),u=s$(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=ln(i)&&i.type===eu,c=ln(r)&&r.type===eu;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function gse(e){const{point:t,line:n,...i}=e;return z(i).length>1?i:i.type}function mse(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Ln(e[t],["point","line"])});return e}function j0(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?Y(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?Y(t.point)?t.point:{}:void 0}function p$(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class yse{constructor(){L(this,"name","path-overlay")}hasMatchingType(t,n){if(Vr(t)){const{mark:i,encoding:r}=t,s=tr(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!j0(s,n[s.type],r);case"area":return!!j0(s,n[s.type],r)||!!p$(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:u,encoding:l,...c}=t,f=yg(l,r),d=tr(a)?a:{type:a},h=j0(d,r[d.type],f),p=d.type==="area"&&p$(d,r[d.type]),g=[{name:u,...s?{params:s}:{},mark:gse({...d.type==="area"&&De("opacity",d,r)==null&&De("fillOpacity",d,r)==null?{opacity:uN}:{},...d}),encoding:Ln(f,["shape"])}],m=oN(aN(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=Ln(y,["y2","x2"]),p&&g.push({...o?{projection:o}:{},mark:{type:"line",...Ya(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...Ya(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:mse(r)})}}function bse(e,t){return t?ef(e)?cN(e,t):lN(e,t):e}function q0(e,t){return t?cN(e,t):e}function fy(e,t,n){const i=t[e];if(ere(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};W(Kte(i.repeat));return}return t}function lN(e,t){if(e=fy("field",e,t),e!==void 0){if(e===null)return null;if(uE(e)&&_r(e.sort)){const n=fy("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function g$(e,t){if(j(e))return lN(e,t);{const n=fy("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function m$(e,t){if(ce(e)){const n=g$(e,t);if(n)return n;if(tf(e))return{condition:e.condition}}else{if(nf(e)){const n=g$(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function cN(e,t){const n={};for(const i in e)if(q(e,i)){const r=e[i];if(N(r))n[i]=r.map(s=>m$(s,t)).filter(s=>s);else{const s=m$(r,t);s!==void 0&&(n[i]=s)}}return n}class vse{constructor(){L(this,"name","RuleForRangedLine")}hasMatchingType(t){if(Vr(t)){const{encoding:n,mark:i}=t;if(i==="line"||tr(i)&&i.type==="line")for(const r of pte){const s=Ko(r),o=n[s];if(n[r]&&(j(o)&&!Ct(o.bin)||pr(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return W(bne(!!r.x2,!!r.y2)),i({...t,mark:Y(s)?{...s,type:"rule"}:"rule"},n)}}class xse extends AE{constructor(){super(...arguments);L(this,"nonFacetUnitNormalizers",[Are,Cre,Rre,new yse,new vse])}map(n,i){if(Vr(n)){const r=po(n.encoding,kr),s=po(n.encoding,Dr),o=po(n.encoding,Kp);if(r||s||o)return this.mapFacetedUnit(n,i)}return super.map(n,i)}mapUnit(n,i){const{parentEncoding:r,parentProjection:s}=i,o=q0(n.encoding,i.repeater),a={...n,...n.name?{name:[i.repeaterPrefix,n.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||s)return this.mapUnitWithParentEncodingOrProjection(a,i);const u=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(a,i.config))return l.run(a,i,u);return a}mapRepeat(n,i){return sse(n)?this.mapLayerRepeat(n,i):this.mapNonLayerRepeat(n,i)}mapLayerRepeat(n,i){const{repeat:r,spec:s,...o}=n,{row:a,column:u,layer:l}=r,{repeater:c={},repeaterPrefix:f=""}=i;return a||u?this.mapRepeat({...n,repeat:{...a?{row:a}:{},...u?{column:u}:{}},spec:{repeat:{layer:l},spec:s}},i):{...o,layer:l.map(d=>{const h={...c,layer:d},p=`${(s.name?`${s.name}_`:"")+f}child__layer_${Xe(d)}`,g=this.mapLayerOrUnit(s,{...i,repeater:h,repeaterPrefix:p});return g.name=p,g})}}mapNonLayerRepeat(n,i){const{repeat:r,spec:s,data:o,...a}=n;!N(r)&&n.columns&&(n=Ln(n,["columns"]),W(YC("repeat")));const u=[],{repeater:l={},repeaterPrefix:c=""}=i,f=!N(r)&&r.row||[l?l.row:null],d=!N(r)&&r.column||[l?l.column:null],h=N(r)&&r||[l?l.repeat:null];for(const g of h)for(const m of f)for(const y of d){const b={repeat:g,row:m,column:y,layer:l.layer},v=`${(s.name?`${s.name}_`:"")+c}child__${N(r)?`${Xe(g)}`:(r.row?`row_${Xe(m)}`:"")+(r.column?`column_${Xe(y)}`:"")}`,x=this.map(s,{...i,repeater:b,repeaterPrefix:v});x.name=v,u.push(Ln(x,["data"]))}const p=N(r)?n.columns:r.column?r.column.length:1;return{data:s.data??o,align:"all",...a,columns:p,concat:u}}mapFacet(n,i){const{facet:r}=n;return ef(r)&&n.columns&&(n=Ln(n,["columns"]),W(YC("facet"))),super.mapFacet(n,i)}mapUnitWithParentEncodingOrProjection(n,i){const{encoding:r,projection:s}=n,{parentEncoding:o,parentProjection:a,config:u}=i,l=b$({parentProjection:a,projection:s}),c=y$({parentEncoding:o,encoding:q0(r,i.repeater)});return this.mapUnit({...n,...l?{projection:l}:{},...c?{encoding:c}:{}},{config:u})}mapFacetedUnit(n,i){const{row:r,column:s,facet:o,...a}=n.encoding,{mark:u,width:l,projection:c,height:f,view:d,params:h,encoding:p,...g}=n,{facetMapping:m,layout:y}=this.getFacetMappingAndLayout({row:r,column:s,facet:o},i),b=q0(a,i.repeater);return this.mapFacet({...g,...y,facet:m,spec:{...l?{width:l}:{},...f?{height:f}:{},...d?{view:d}:{},...c?{projection:c}:{},mark:u,encoding:b,...h?{params:h}:{}}},i)}getFacetMappingAndLayout(n,i){const{row:r,column:s,facet:o}=n;if(r||s){o&&W(mne([...r?[kr]:[],...s?[Dr]:[]]));const a={},u={};for(const l of[kr,Dr]){const c=n[l];if(c){const{align:f,center:d,spacing:h,columns:p,...g}=c;a[l]=g;for(const m of["align","center","spacing"])c[m]!==void 0&&(u[m]??(u[m]={}),u[m][l]=c[m])}}return{facetMapping:a,layout:u}}else{const{align:a,center:u,spacing:l,columns:c,...f}=o;return{facetMapping:bse(f,i.repeater),layout:{...a?{align:a}:{},...u?{center:u}:{},...l?{spacing:l}:{},...c?{columns:c}:{}}}}}mapLayer(n,{parentEncoding:i,parentProjection:r,...s}){const{encoding:o,projection:a,...u}=n,l={...s,parentEncoding:y$({parentEncoding:i,encoding:o,layer:!0}),parentProjection:b$({parentProjection:r,projection:a})};return super.mapLayer({...u,...n.name?{name:[l.repeaterPrefix,n.name].filter(c=>c).join("_")}:{}},l)}}function y$({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...z(e),...z(t)]);for(const s of r){const o=t[s],a=e[s];if(ce(o)){const u={...a,...o};i[s]=u}else nf(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||Ai(a)||ne(a)||ce(a)||N(a))&&(i[s]=a)}}else i=t;return!i||Pe(i)?void 0:i}function b$(e){const{parentProjection:t,projection:n}=e;return t&&n&&W(sne({parentProjection:t,projection:n})),n??t}function wE(e){return q(e,"filter")}function Ese(e){return q(e,"stop")}function fN(e){return q(e,"lookup")}function Ase(e){return q(e,"data")}function wse(e){return q(e,"param")}function Sse(e){return q(e,"pivot")}function Cse(e){return q(e,"density")}function $se(e){return q(e,"quantile")}function Fse(e){return q(e,"regression")}function kse(e){return q(e,"loess")}function Dse(e){return q(e,"sample")}function _se(e){return q(e,"window")}function Ose(e){return q(e,"joinaggregate")}function Rse(e){return q(e,"flatten")}function Mse(e){return q(e,"calculate")}function dN(e){return q(e,"bin")}function Tse(e){return q(e,"impute")}function Nse(e){return q(e,"timeUnit")}function Ise(e){return q(e,"aggregate")}function Lse(e){return q(e,"stack")}function Pse(e){return q(e,"fold")}function Bse(e){return q(e,"extent")&&!q(e,"density")&&!q(e,"regression")}function zse(e){return e.map(t=>wE(t)?{filter:ka(t.filter,die)}:t)}class Use extends AE{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=v$(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=v$(t,n),t.encoding){const i={};for(const[r,s]of Fs(t.encoding))i[r]=hN(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:Fs(i).map(([s,o])=>{const{init:a,bind:u,empty:l,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=l!=="none";for(const f of dt(n.selectionPredicates[s]??{}))f.empty=l!=="none";return{name:s,value:a,select:c,bind:u}})}:t}}function v$(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(wE(s))return{filter:dy(s,t)};if(dN(s)&&Jo(s.bin))return{...s,bin:pN(s.bin)};if(fN(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function hN(e,t){var i,r;const n=le(e);if(j(n)&&Jo(n.bin)&&(n.bin=pN(n.bin)),ta(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(tf(n))if(N(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:u,...l}=s;return a?s:{...l,test:dy(s,t)}});else{const{selection:s,param:o,test:a,...u}=hN(n.condition,t);n.condition=o?n.condition:{...u,test:dy(n.condition,t)}}return n}function pN(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function dy(e,t){const n=i=>ka(i,r=>{var a;const s=t.emptySelections[r]??!0,o={param:r,empty:s};return(a=t.selectionPredicates)[r]??(a[r]=[]),t.selectionPredicates[r].push(o),o});return e.selection?n(e.selection):ka(e.test||e.filter,i=>i.selection?n(i.selection):i)}class hy extends AE{map(t,n){const i=n.selections??[];if(t.params&&!Vr(t)){const r=[];for(const s of t.params)vE(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(K(a)&&(a===t.name||r.includes(a))||N(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=hy.prototype[e];hy.prototype[e]=function(n,i){return t.call(this,n,jse(n,i))}}function jse(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function gN(e,t){t===void 0&&(t=sN(e.config));const n=Hse(e,t),{width:i,height:r}=e,s=Vse(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const qse=new xse,Wse=new Use,Gse=new hy;function Hse(e,t={}){const n={config:t};return Gse.map(qse.map(Wse.map(e,n),n),n)}function x$(e){return K(e)?{type:e}:e??{}}function Vse(e,t,n){let{width:i,height:r}=t;const s=Vr(e)||vg(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(W(GC("width")),i=void 0),r=="container"&&(W(GC("height")),r=void 0));const a={type:"pad",...o,...n?x$(n.autosize):{},...x$(e.autosize)};if(a.type==="fit"&&!s&&(W(Bte),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&W(HC("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&W(HC("height")),!Mn(a,{type:"pad"}))return a}function Xse(e){return["fit","fit-x","fit-y"].includes(e)}function Yse(e){return e?`fit-${tg(e)}`:"fit"}const Kse=["background","padding"];function E$(e,t){const n={};for(const i of Kse)e&&e[i]!==void 0&&(n[i]=_n(e[i]));return t&&(n.params=e.params),n}class Xr{constructor(t={},n={}){L(this,"explicit");L(this,"implicit");this.explicit=t,this.implicit=n}clone(){return new Xr(le(this.explicit),le(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return ct(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of z(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function zi(e){return{explicit:!0,value:e}}function Fn(e){return{explicit:!1,value:e}}function mN(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:xg(t,n,i,r)}}function xg(e,t,n,i){return e.explicit&&t.explicit&&W(kne(n,i,e.value,t.value)),e}function Ds(e,t,n,i,r=xg){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Mn(e.value,t.value)?e:r(e,t,n,i)}class Jse extends Xr{constructor(n={},i={},r=!1){super(n,i);L(this,"explicit");L(this,"implicit");L(this,"parseNothing");this.explicit=n,this.implicit=i,this.parseNothing=r}clone(){const n=super.clone();return n.parseNothing=this.parseNothing,n}}function ou(e){return q(e,"url")}function fc(e){return q(e,"values")}function yN(e){return q(e,"name")&&!ou(e)&&!fc(e)&&!vs(e)}function vs(e){return e&&(bN(e)||vN(e)||SE(e))}function bN(e){return q(e,"sequence")}function vN(e){return q(e,"sphere")}function SE(e){return q(e,"graticule")}var Qe;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Qe||(Qe={}));function xN({invalid:e,isPath:t}){switch(pT(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function Qse(e){const{marks:t,scales:n}=xN(e);return t===n?Qe.Main:n==="include-invalid-values"?Qe.PreFilterInvalid:Qe.PostFilterInvalid}class Ne{constructor(t,n){L(this,"debugName");L(this,"_children",[]);L(this,"_parent",null);L(this,"_hash");this.debugName=n,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){W(nne);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class bn extends Ne{constructor(n,i,r,s){super(n,i);L(this,"type");L(this,"refCounts");L(this,"_source");L(this,"_name");this.type=r,this.refCounts=s,this._source=this._name=i,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const n=new this.constructor;return n.debugName=`clone_${this.debugName}`,n._source=this._source,n._name=`clone_${this._name}`,n.type=this.type,n.refCounts=this.refCounts,n.refCounts[n._name]=0,n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${gM()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(n){this._source=n}}function W0(e){return e.as!==void 0}function A$(e){return`${e}_end`}class Vi extends Ne{constructor(n,i){super(n);L(this,"timeUnits");this.timeUnits=i}clone(){return new Vi(null,le(this.timeUnits))}static makeFromEncoding(n,i){const r=i.reduceFieldDef((s,o,a)=>{const{field:u,timeUnit:l}=o;if(l){let c;if(ea(l)){if(Ve(i)){const{mark:f,markDef:d,config:h}=i,p=Lr({fieldDef:o,markDef:d,config:h});(cc(f)||p)&&(c={timeUnit:St(l),field:u})}}else c={as:X(o,{forAs:!0}),field:u,timeUnit:l};if(Ve(i)){const{mark:f,markDef:d,config:h}=i,p=Lr({fieldDef:o,markDef:d,config:h});cc(f)&&ft(a)&&p!==.5&&(c.rectBandPosition=p)}c&&(s[pe(c)]=c)}return s},{});return Pe(r)?null:new Vi(n,r)}static makeFromTransform(n,i){const{timeUnit:r,...s}={...i},o=St(r),a={...s,timeUnit:o};return new Vi(n,{[pe(a)]:a})}merge(n){this.timeUnits={...this.timeUnits};for(const i in n.timeUnits)this.timeUnits[i]||(this.timeUnits[i]=n.timeUnits[i]);for(const i of n.children)n.removeChild(i),i.parent=this;n.remove()}removeFormulas(n){const i={};for(const[r,s]of Fs(this.timeUnits)){const o=W0(s)?s.as:`${s.field}_end`;n.has(o)||(i[r]=s)}this.timeUnits=i}producedFields(){return new Set(dt(this.timeUnits).map(n=>W0(n)?n.as:A$(n.field)))}dependentFields(){return new Set(dt(this.timeUnits).map(n=>n.field))}hash(){return`TimeUnit ${pe(this.timeUnits)}`}assemble(){const n=[];for(const i of dt(this.timeUnits)){const{rectBandPosition:r}=i,s=St(i.timeUnit);if(W0(i)){const{field:o,as:a}=i,{unit:u,utc:l,...c}=s,f=[a,`${a}_end`];n.push({field:ti(o),type:"timeunit",...u?{units:sg(u)}:{},...l?{timezone:"utc"}:{},...c,as:f}),n.push(...w$(f,r,s))}else if(i){const{field:o}=i,a=hM(o),u=EN({timeUnit:s,field:a}),l=A$(a);n.push({type:"formula",expr:u,as:l}),n.push(...w$([a,l],r,s))}}return n}}const Eg="offsetted_rect_start",Ag="offsetted_rect_end";function EN({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=JM(i),{part:o,step:a}=tT(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', ${_e(t)}, ${n?-a:a})`}function w$([e,t],n,i){if(n!==void 0&&n!==.5){const r=_e(e),s=_e(t);return[{type:"formula",expr:S$([EN({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Eg}`},{type:"formula",expr:S$([r,s],n+.5),as:`${e}_${Ag}`}]}return[]}function S$([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const of="_tuple_fields";class Zse{constructor(...t){L(this,"hasChannel");L(this,"hasField");L(this,"hasSelectionId");L(this,"timeUnit");L(this,"items");this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const eoe={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new Zse),s={},o={},a=new Set,u=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=Xe(`${i}_${m}`);for(let b=1;a.has(y);b++)y=Xe(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?J(n.value):null;let{fields:d,encodings:h}=Y(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(Y(p))for(const g of z(p))hte(g)?(h||(h=[])).push(g):l==="interval"?(W(Yte),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){W(zte(p,g.aggregate));continue}else if(!m){W(XC(p));continue}if(g.timeUnit&&!ea(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[pe(y)]=y}if(!s[m]){const y=l==="interval"&&hr(p)&&Ei(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===Si,EM(p)?(b.geoChannel=p,b.channel=xM(p),r.hasChannel[b.channel]=s[m]):r.hasChannel[p]=s[m]}}else W(XC(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===Si}f&&(t.init=f.map(p=>r.items.map(g=>Y(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Pe(o)||(r.timeUnit=new Vi(null,o))},signals:(e,t,n)=>{const i=t.name+of;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(CN)})}},AN="_curr",yd="anim_value",ma="anim_clock",py="eased_anim_clock",wN="min_extent",SN="max_range_extent",G0="last_tick_at",H0="is_playing",toe=1/60*1e3,noe=(e,t)=>[{name:py,update:ma},{name:`${e}_domain`,init:`domain('${t}')`},{name:wN,init:`extent(${e}_domain)[0]`},{name:SN,init:`extent(range('${t}'))[1]`},{name:yd,update:`invert('${t}', ${py})`}],ioe={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(Xi(t)&&(n=n.concat([{name:ma,init:"0",on:[{events:{type:"timer",throttle:toe},update:`${H0} ? (${ma} + (now() - ${G0}) > ${SN} ? 0 : ${ma} + (now() - ${G0})) : ${ma}`}]},{name:G0,init:"now()",on:[{events:[{signal:ma},{signal:H0}],update:"now()"}]},{name:H0,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+of,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=dt(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+Oa):c,[]).map(c=>`indexof(item().mark.name, '${c}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${go(e)}, `;if(t.project.hasSelectionId)l+=`${Si}: ${o}[${H(Si)}]`;else if(Xi(t))l+=`fields: ${r}, values: [${yd} ? ${yd} : ${wN}]`;else{const c=s.items.map(f=>{const d=e.fieldDef(f.channel);return d!=null&&d.bin?`[${o}[${H(e.vgField(f.channel,{}))}], ${o}[${H(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${o}[${H(f.field)}]`}).join(", ");l+=`fields: ${r}, values: [${c}]`}if(Xi(t))return n.concat(noe(t.name,e.scaleName(Is)),[{name:i+Br,on:[{events:[{signal:py},{signal:yd}],update:`{${l}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+Br,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function CN(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=ti(r.field),r}function Io(e,t=!0,n=xn){if(N(e)){const i=e.map(r=>Io(r,t,n));return t?`[${i.join(", ")}]`:i}else if(Zo(e))return n(t?Ro(e):eie(e));return t?n(Te(e)):e}function roe(e,t){for(const n of dt(e.component.selection??{})){const i=n.name;let r=`${i}${Br}, ${n.resolve==="global"?"true":`{unit: ${go(e)}}`}`;for(const s of wg)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+Ooe,on:[{events:{signal:n.name+Br},update:`modify(${H(n.name+Lo)}, ${r})`}]})}return CE(t)}function soe(e,t){if(e.component.selection&&z(e.component.selection).length){const n=H(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Ts("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return CE(t)}function ooe(e,t){let n=!1;for(const i of dt(e.component.selection??{})){const r=i.name,s=H(r+Lo);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${qN}(${s}, ${H(a)}${u}`})}n=!0;for(const a of wg)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),CE(t)}function aoe(e,t){const n=[],i=[],r=go(e,{escape:!1});for(const s of dt(e.component.selection??{})){const o={name:s.name+Lo};if(s.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Si}}]),s.init){const u=s.project.items.map(CN);o.values=s.project.hasSelectionId?s.init.map(l=>({unit:r,[Si]:Io(l,!1)[0]})):s.init.map(l=>({unit:r,fields:u,values:Io(l,!1)}))}if([...n,...t].filter(u=>u.name===s.name+Lo).length||n.push(o),Xi(s)&&t.length){const u=e.lookupDataSource(e.getDataName(Qe.Main)),l=t.find(f=>f.name===u),c=l.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(c){l.transform=l.transform.filter(d=>d!==c);const f={name:l.name+AN,source:l.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function $N(e,t){for(const n of dt(e.component.selection??{}))for(const i of wg)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function uoe(e,t){for(const n of e.children)Ve(n)&&(t=$N(n,t));return t}function loe(e,t,n,i){const r=XN(e,t.param,t);return{signal:Ei(n.get("type"))&&N(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function CE(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const Or={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!hr(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&W(Wte),!s||!Ei(o)){W(qte);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||my(e)||i.length===0)return n;const r=n.find(o=>o.name===t.name);let s=r.update;if(s.includes(qN))r.update=`{${i.map(o=>`${H(ti(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${H(ti(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!my(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function gy(e,t){return`domain(${H(e.scaleName(t))})`}function my(e){return e.parent&&Tu(e.parent)&&(!e.parent.parent||my(e.parent.parent))}const Oa="_brush",FN="_scale_trigger",Zu="geo_interval_init_tick",kN="_init",coe="_center",foe={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...Y(n.select)?n.select:{}};r.fields=[Si],r.encodings||(r.encodings=n.value?z(n.value):[Mi,Ri]),n.select={type:"interval",...r}}if(t.translate&&!Or.defined(t)){const r=`!event.item || event.item.mark.name !== ${H(t.name+Oa)}`;for(const s of t.events){if(!s.between){W(`${s} is not an ordered event stream for interval selections.`);continue}const o=J((i=s.between[0]).filter??(i.filter=[]));o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+Br,s=dt(t.project.hasChannel).filter(a=>a.channel===qe||a.channel===yt),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,u)=>a.concat(doe(e,t,u,o==null?void 0:o[u.index])),[])),e.hasProjection){const a=H(e.projectionName()),u=e.projectionName()+coe,{x:l,y:c}=t.project.hasChannel,f=l==null?void 0:l.signals.visual,d=c==null?void 0:c.signals.visual,h=l?o==null?void 0:o[l.index]:`${u}[0]`,p=c?o==null?void 0:o[c.index]:`${u}[1]`,g=E=>e.getSizeSignalRef(E).signal,m=`[[${f?`${f}[0]`:"0"}, ${d?`${d}[0]`:"0"}],[${f?`${f}[1]`:g("width")}, ${d?`${d}[1]`:g("height")}]]`;o&&(n.unshift({name:i+kN,init:`[scale(${a}, [${l?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${l?h[1]:h}, ${c?p[1]:p}])]`}),(!l||!c)&&(n.find(w=>w.name===u)||n.unshift({name:u,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${H(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${go(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=s.map(E=>E.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...o?[{signal:Zu}]:[]],update:v}]})}else{if(!Or.defined(t)){const l=i+FN,c=s.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=H(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Ei(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:`${c.join(" && ")} ? ${l} : {}`}]})}const a=s.map(l=>l.signals.data),u=`unit: ${go(e)}, fields: ${i+of}, values`;return n.concat({name:r,...o?{init:`{${u}: ${Io(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Ve(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===Zu).length||n.unshift({name:Zu,value:null,on:[{events:"timer{1}",update:`${Zu} === null ? {} : ${Zu}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r==null?void 0:r.signals.visual,a=s==null?void 0:s.signals.visual,u=`data(${H(t.name+Lo)})`;if(Or.defined(t)||!r&&!s)return n;const l={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of z(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${go(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=z(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+Oa}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+Oa,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}};function doe(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=H(r?e.scaleName(s):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(s===qe?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${o}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=Or.defined(t),p=e.getScaleComponent(s),g=p?p.get("type"):void 0,m=i?{init:Io(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+FN},update:Ei(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:Io(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===qe?0:1,h=t.name+kN,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:o,...p,on:f}]}}function _u({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=tf(t)&&t.condition;let o=[];s&&(o=J(s).map(l=>{const c=r(l);if(Zie(l)){const{param:f,empty:d}=l;return{test:VN(e,{param:f,empty:d}),...c}}else return{test:Mh(e,l.test),...c}})),i!==void 0&&o.push(i);const a=r(t);return a!==void 0&&o.push(a),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function $E(e,t="text"){const n=e.encoding[t];return _u({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>FE(i,e.config),invalidValueRef:void 0})}function FE(e,t,n="datum"){if(e){if(Ai(e))return je(e.value);if(ce(e)){const{format:i,formatType:r}=ru(e);return oE({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function DN(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(N(o))return{tooltip:C$({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return _u({model:e,channelDef:o,vgChannel:"tooltip",mainRefFn:l=>{const c=ON(l,r,a);if(c)return c;if(l===null)return;let f=De("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),K(f))return{value:f};if(Y(f))return ne(f)?f:f.content==="encoding"?C$(n,s,r,t):{signal:a}},invalidValueRef:void 0})}}function _N(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s=new Set,o=i?"datum.datum":"datum",a=[];function u(c,f){const d=Ko(f),h=ln(c)?c:{...c,type:e[d].type},p=h.title||cE(h,r),g=J(p).join(", ").replaceAll(/"/g,'\\"');let m;if(ft(f)){const y=f==="x"?"x2":"y2",b=wi(e[y]);if(Ct(h.bin)&&b){const v=X(h,{expr:o}),x=X(b,{expr:o}),{format:E,formatType:w}=ru(h);m=Zc(v,x,E,w,r),s.add(y)}}if((ft(f)||f===ri||f===Oi)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=ru(h);m=oE({fieldOrDatumDef:h,format:y,formatType:b,expr:o,config:r,normalizeStack:!0}).signal}m??(m=ON(h,r,o).signal),a.push({channel:f,key:g,value:m})}dE(e,(c,f)=>{j(c)?u(c,f):hg(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!s.has(c)&&!l[f]&&(l[f]=d);return l}function C$(e,t,n,{reactiveGeom:i}={}){const r=_N(e,t,n,{reactiveGeom:i}),s=Fs(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function ON(e,t,n="datum"){if(j(e)&&K2(e.type)&&!e.timeUnit&&!ru(e).format&&!ru(e).formatType){const i=`${n}["${e.field}"]`;return{signal:`isValid(${i}) ? isArray(${i}) ? join(${i}, '\\n') : ${i} : ""+${i}`}}return FE(e,t,n)}function hoe(e){const{markDef:t,config:n}=e,i=De("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...poe(e),...goe(e)}}function poe(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=De("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:Q(Nte,t)?{}:{ariaRoleDescription:{value:t}}}function goe(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return _u({model:e,channelDef:s,vgChannel:"description",mainRefFn:u=>FE(u,e.config),invalidValueRef:void 0});const o=De("description",n,i);if(o!=null)return{description:je(o)};if(i.aria===!1)return{};const a=_N(t,r,i);if(!Pe(a))return{description:{signal:Fs(a).filter(([u])=>!u.startsWith("_")).map(([u,l])=>[u,l.replaceAll("\\n"," ")]).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function kt(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??(u=De(e,i,s,{vgChannel:o,ignoreVgConfig:!tf(l)})),u!==void 0&&(a=je(u)));const c={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=mT({...c,scaleChannel:e,channelDef:l});return _u({model:t,channelDef:l,vgChannel:o??e,invalidValueRef:f,mainRefFn:h=>sE({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function RN(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??De("filled",n,r),a=be(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,u=De(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,l=De(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...u?{fill:je(u)}:{},...l?{stroke:je(l)}:{}};return n.color&&(o?n.fill:n.stroke)&&W(jM("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...kt("color",e,{vgChannel:c,defaultValue:o?u:l}),...kt("fill",e,{defaultValue:i.fill?u:void 0}),...kt("stroke",e,{defaultValue:i.stroke?l:void 0})}}function moe(e){const{encoding:t,mark:n}=e,i=t.order;return!js(n)&&Ai(i)?_u({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>je(r.value),invalidValueRef:void 0}):{}}function au({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:sE({channel:s,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:je(o),bandPosition:r})};const u=t[s];return u?{offsetType:"visual",offset:u}:{}}function rn(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,u=r[e],l=r[dr(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=au({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),p=kE({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&ft(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:yoe({channel:e,channelDef:u,channel2Def:l,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function yoe(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(ce(n)&&r&&t===r.fieldChannel){if(j(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return Ch({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return ho(n,i,{suffix:"end"},{offset:s})}return rE(e)}function kE({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=Ko(n),u=ks(n),l=De(n,s,o,{vgChannel:u});if(l!==void 0)return Bl(n,l);switch(t){case"zeroOrMin":return $$({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:o});case"zeroOrMax":return $$({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:o});case"mid":return{...e[Sn(n)],mult:.5}}}}function $$({mainChannel:e,config:t,...n}){const i=gT(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:o}=r.zeroOrMax;return{signal:`min(${s},${o})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const boe={left:"x",center:"xc",right:"x2"},voe={top:"y",middle:"yc",bottom:"y2"};function MN(e,t,n,i="middle"){if(e==="radius"||e==="theta")return ks(e);const r=e==="x"?"align":"baseline",s=De(r,t,n);let o;return ne(s)?(W(yne(r)),o=void 0):o=s,e==="x"?boe[o||(i==="top"?"left":"center")]:voe[o||i]}function Oh(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?TN(e,t,{defaultPos:n,defaultPos2:i}):rn(e,t,{defaultPos:n})}function TN(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=dr(e),a=Sn(e),u=xoe(t,i,o),l=u[a]?MN(e,r,s):ks(e);return{...rn(e,t,{defaultPos:n,vgChannel:l}),...u}}function xoe(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,u=Ko(n),l=Sn(n),c=ks(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:p}=n in i||n in s?au({channel:n,markDef:s,encoding:i,model:e}):au({channel:u,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=Sn(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=Eoe({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:h,stack:o,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:Nf(n,s)||Nf(n,{[n]:iy(n,s,a.style),[l]:iy(l,s,a.style)})||Nf(n,a[r])||Nf(n,a.mark)||{[c]:kE({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Eoe({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l}){return ce(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?ho(t,s,{suffix:"start"},{offset:u}):rE({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function Nf(e,t){const n=Sn(e),i=ks(e);if(t[i]!==void 0)return{[i]:Bl(e,t[i])};if(t[e]!==void 0)return{[i]:Bl(e,t[e])};if(t[n]){const r=t[n];if(To(r))W(fne(n));else return{[n]:Bl(e,r)}}}function Pr(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=dr(t),a=Sn(t),u=i[t],l=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??De("size",r,n,{vgChannel:a}),p=CM(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return j(u)&&(Be(u.bin)||Ct(u.bin)||u.timeUnit&&!l)&&!(h&&!To(h))&&!i[p]&&!rt(f)?Soe({fieldDef:u,fieldDef2:l,channel:t,model:e}):(ce(u)&&rt(f)||g)&&!l?woe(u,t,e):TN(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Aoe(e,t,n,i,r,s,o){if(To(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=er("minBandSize",{type:o},i);return{signal:c?`max(${gi(c)}, ${l})`:l}}else r.band!==1&&W(Ene(u))}else return{mult:r.band,field:{group:e}};else{if(ne(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(Qo(u)&&Ce(u.step))return{value:u.step-2}}if(!s){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=ct(u,o==="tick"?f:o==="bar"?l:c);if(ne(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(Ce(d))return{signal:`${1-d} * ${e}`}}return{value:cy(i.view,e)-2}}function woe(e,t,n){var k,P;const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=Sn(t),f=dr(t),d=CM(t),h=n.scaleName(d),p=n.getScaleComponent(_2(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=kt("size",n,{vgChannel:c,defaultRef:je(i.size)}):W(Cne(i.type)));const y=!!m,b=wT({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(k=l||p)==null?void 0:k.get("type"),useVlSizeChannel:g});m=m||{[c]:Aoe(c,h||u,p||l,s,b,!!e,i.type)};const v=((P=l||p)==null?void 0:P.get("type"))==="band"&&To(b)&&!y?"top":"middle",x=MN(t,i,s,v),E=x==="xc"||x==="yc",{offset:w,offsetType:A}=au({channel:t,markDef:i,encoding:r,model:n,bandPosition:E?.5:0}),S=(E&&A!=="encoding"&&j(e)&&e.timeUnit&&!r[f]?Lr({fieldDef:e,markDef:i,config:s}):void 0)??(E?A==="encoding"?0:.5:ne(b)?{signal:`(1-${b})/2`}:To(b)?(1-b.band)/2:0),F=rE({channel:t,channelDef:e,markDef:i,config:s,scaleName:u,scale:l,stack:o,offset:w,defaultRef:kE({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:S});if(c)return{[x]:F,...m};{const U=ks(f),_=m[c],$=w?{..._,offset:w}:_;return{[x]:F,[U]:N(F)?[F[0],{...F[1],offset:$}]:{...F,offset:$}}}}function F$(e,t,n,i,r,s,o){if(vM(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(ne(n)||ne(r)||ne(i)||s){const l=gi(n),c=gi(r),f=gi(i),d=gi(s),p=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function Soe({fieldDef:e,fieldDef2:t,channel:n,model:i}){var F;const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=wT({channel:n,fieldDef:e,markDef:s,config:r,scaleType:l}),d=(F=i.component.axes[n])==null?void 0:F[0],h=(d==null?void 0:d.get("translate"))??.5,p=ft(n)?De("binSpacing",s,r)??0:0,g=dr(n),m=ks(n),y=ks(g),b=er("minBandSize",s,r),{offset:v}=au({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:x}=au({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),E=Xie({fieldDef:e,scaleName:u}),w=F$(n,p,c,h,v,b,E),A=F$(g,p,c,h,x??v,b,E),C=ne(f)?{signal:`(1-${f.signal})/2`}:To(f)?(1-f.band)/2:.5,S=Lr({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(Be(e.bin)||e.timeUnit){const k=e.timeUnit&&S!==.5;return{[y]:k$({fieldDef:e,scaleName:u,bandPosition:C,offset:A,useRectOffsetField:k}),[m]:k$({fieldDef:e,scaleName:u,bandPosition:ne(C)?{signal:`1-${C.signal}`}:1-C,offset:w,useRectOffsetField:k})}}else if(Ct(e.bin)){const k=ho(e,u,{},{offset:A});if(j(t))return{[y]:k,[m]:ho(t,u,{},{offset:w})};if(Jo(e.bin)&&e.bin.step)return{[y]:k,[m]:{signal:`scale("${u}", ${X(e,{expr:"datum"})} + ${e.bin.step})`,offset:w}}}W(GM(g))}function k$({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Ch({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Eg,endSuffix:Ag}:{}})}const Coe=new Set(["aria","width","height"]);function si(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?RN(e):{};return{...$oe(e.markDef,t),...D$("fill",n),...D$("stroke",i),...kt("opacity",e),...kt("fillOpacity",e),...kt("strokeOpacity",e),...kt("strokeWidth",e),...kt("strokeDash",e),...moe(e),...DN(e),...$E(e,"href"),...hoe(e)}}function D$(e,t){return t?{[e]:t}:{}}function $oe(e,t){return Tte.reduce((n,i)=>(!Coe.has(i)&&q(e,i)&&t[i]!=="ignore"&&(n[i]=je(e[i])),n),{})}function DE(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{var l;let o;if(!hr(s)||!(o=e.getScaleType(s)))return;const a=ng(r.aggregate),u=iE({scaleChannel:s,markDef:n,config:t,scaleType:o,isCountAggregate:a});if(Gie(u)){const c=e.vgField(s,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(s=>og(s,!0)).join(" && ")}}}function _$(e,t){if(t!==void 0)return{[e]:je(t)}}const V0="voronoi",NN={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(V0)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(js(s))return W(Ute(s)),n;const o={name:e.getName(V0),type:"path",interactive:!0,aria:!1,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...DN(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(V0)&&(u=!0)}),u||n.splice(a+1,0,o),n}},IN={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!bE(e.bind),parse:(e,t,n)=>WN(t,n),topLevelSignals:(e,t,n)=>{var u;const i=t.name,r=t.project,s=t.bind,o=(u=t.init)==null?void 0:u[0],a=NN.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((l,c)=>{const f=Xe(`${i}_${l.field}`);n.filter(h=>h.name===f).length||n.unshift({name:f,...o?{init:Io(o[c])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${H(l.field)}] : null`}]:[],bind:s[l.field]??s[l.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(l=>l.name===i+Br),o=i+of,a=r.items.map(l=>Xe(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(s.update=`${u} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},Rh="_toggle",LN={defined:e=>e.type==="point"&&!Xi(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Rh,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Br,i=t.name+Rh;return`${i} ? null : ${n}, ${t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${go(e)}}, `}${i} ? ${n} : null`}},Foe={defined:e=>e.clear!==void 0&&e.clear!==!1&&!Xi(e),parse:(e,t)=>{t.clear&&(t.clear=K(t.clear)?Ts(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(IN.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===Xe(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+Br);i(r,"null"),LN.defined(t)&&(r=n.findIndex(s=>s.name===t.name+Rh),i(r,"false"))}return n}},PN={defined:e=>{const t=e.resolve==="global"&&e.bind&&bE(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Si;return t&&!n&&W(Gte),t&&n},parse:(e,t,n)=>{const i=le(n);if(i.select=K(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},WN(t,i),Y(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=J(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=U0(t.bind)?t.bind.legend:"click",s=K(r)?Ts(r,"view"):J(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=U0(t.bind)&&t.bind.legend,s=o=>a=>{const u=le(a);return u.markname=o,u};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${Xe(o.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+Br),o=i+of,a=r.items.filter(d=>d.hasLegend).map(d=>Xe(`${i}_${Xe(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(s.update=l,delete s.value,delete s.on);const c=n.find(d=>d.name===i+Rh),f=U0(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function koe(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of dt(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&PN.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const BN="_translate_anchor",zN="_translate_delta",Doe={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Or.defined(t),s=i+BN,{x:o,y:a}=t.project.hasChannel;let u=Ts(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+Oa,l))),n.push({name:s,value:{},on:[{events:u.map(l=>l.between[0]),update:`{x: x(unit), y: y(unit)${o!==void 0?`, extent_x: ${r?gy(e,qe):`slice(${o.signals.visual})`}`:""}${a!==void 0?`, extent_y: ${r?gy(e,yt):`slice(${a.signals.visual})`}`:""}}`}]},{name:i+zN,value:{},on:[{events:u,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&O$(e,t,o,"width",n),a!==void 0&&O$(e,t,a,"height",n),n}};function O$(e,t,n,i,r){const s=t.name,o=s+BN,a=s+zN,u=n.channel,l=Or.defined(t),c=r.find(E=>E.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d==null?void 0:d.get("type"),p=d==null?void 0:d.get("reverse"),g=l?u===qe?p?"":"-":p?"-":"":"",m=`${o}.extent_${u}`,y=`${g}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:l?x:`clampRange(${x}, 0, ${f})`})}const UN="_zoom_anchor",jN="_zoom_delta",_oe={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Or.defined(t),s=i+jN,{x:o,y:a}=t.project.hasChannel,u=H(e.scaleName(qe)),l=H(e.scaleName(yt));let c=Ts(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+Oa,f))),n.push({name:i+UN,on:[{events:c,update:r?`{${[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")}}`:"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&R$(e,t,o,"width",n),a!==void 0&&R$(e,t,a,"height",n),n}};function R$(e,t,n,i,r){const s=t.name,o=n.channel,a=Or.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c==null?void 0:c.get("type"),d=a?gy(e,o):u.name,h=s+jN,p=`${s}${UN}.${o}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Lo="_store",Br="_tuple",Ooe="_modify",qN="vlSelectionResolve",wg=[ioe,foe,eoe,LN,IN,Or,PN,Foe,Doe,_oe,NN];function Roe(e){let t=e.parent;for(;t&&!Pn(t);)t=t.parent;return t}function go(e,{escape:t}={escape:!0}){let n=t?H(e.name):e.name;const i=Roe(e);if(i){const{facet:r}=i;for(const s of Xn)r[s]&&(n+=` + '__facet_${s}_' + (facet[${H(i.vgField(s))}])`)}return n}function _E(e){return dt(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function WN(e,t){(K(t.select)||!t.select.on)&&delete e.events,(K(t.select)||!t.select.clear)&&delete e.clear,(K(t.select)||!t.select.toggle)&&delete e.toggle}function Xi(e){var t;return(t=e.events)==null?void 0:t.find(n=>"type"in n&&n.type==="timer")}function yy(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...yy(e.object)),t.push(...yy(e.property))),t)}function GN(e){return e.object.type==="MemberExpression"?GN(e.object):e.object.name==="datum"}function HN(e){const t=tte(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&GN(i)&&n.add(yy(i).slice(1).join("."))}),n}class Ou extends Ne{constructor(n,i,r){super(n);L(this,"model");L(this,"filter");L(this,"expr");L(this,"_dependentFields");this.model=i,this.filter=r,this.expr=Mh(this.model,this.filter,this),this._dependentFields=HN(this.expr)}clone(){return new Ou(null,this.model,le(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Moe(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;let r=0;for(const s of t){const o=Xe(s.name),a=s.select,u=K(a)?a:a.type,l=Y(a)?le(a):{type:u},c=i[u];for(const h in c)h==="fields"||h==="encodings"||(h==="mark"&&(l.mark={...c.mark,...l.mark}),(l[h]===void 0||l[h]===!0)&&(l[h]=le(c[h]??l[h])));const f=n[o]={...l,name:o,type:u,init:s.value,bind:s.bind,events:K(l.on)?Ts(l.on,"scope"):J(le(l.on))};if(Xi(f)&&(r++,r>1)){delete n[o];continue}const d=le(s);for(const h of wg)h.defined(f)&&h.parse&&h.parse(e,f,d)}return r>1&&W(Jte),n}function VN(e,t,n,i="datum"){const r=K(t)?t:t.param,s=Xe(r),o=H(s+Lo);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${H(a.resolve)})`,c=`${u}${o}, ${i}${l}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function XN(e,t,n){const i=Xe(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&W(Qte(s));else if(r&&!s){const a=o.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,W(Zte(a,r,n,s))):s=a[0].field}return`${o.name}[${H(ti(s))}]`}function Toe(e,t){for(const[n,i]of Fs(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new bn(new Ou(t,e,{param:n}),r,Qe.Lookup,e.component.data.outputNodeRefCounts)}}function Mh(e,t,n){return Pl(t,i=>K(i)?i:lie(i)?VN(e,i,n):iT(i))}function Noe(e,t){if(e)return N(e)&&!is(e)?e.map(n=>cE(n,t)).join(", "):e}function X0(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function Sl(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const p=h,g=hre[p],m=c[p];if(g&&g!==t&&g!=="both")delete c[p];else if(sf(m)){const{condition:y,...b}=m,v=J(y),x=o$[p];if(x){const{vgProp:E,part:w}=x,A=[...v.map(C=>{const{test:S,...F}=C;return{test:Mh(null,S),...F}}),b];X0(c,w,E,A),delete c[p]}else if(x===null){const E={signal:v.map(w=>{const{test:A,...C}=w;return`${Mh(null,A)} ? ${WC(C)} : `}).join("")+WC(b)};c[p]=E}}else if(ne(m)){const y=o$[p];if(y){const{vgProp:b,part:v}=y;X0(c,v,b,m),delete c[p]}}be(["labelAlign","labelBaseline"],p)&&c[p]===null&&delete c[p]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Pe(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:ct(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&ne(c.encode.labels.update.text)&&(p=Do(a,"datum.label",c.encode.labels.update.text.signal)),X0(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of MT)e.hasAxisPart(p)||delete c.encode[p];Pe(c.encode)&&delete c.encode}const h=Noe(u,n);return{scale:o,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:ct(l,0)}}}}function YN(e){const{axes:t}=e.component,n=[];for(const i of Hr)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function Ioe(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Sl(r,"grid",t)),...i.map(r=>Sl(r,"grid",t)),...n.map(r=>Sl(r,"main",t)),...i.map(r=>Sl(r,"main",t))].filter(r=>r)}function M$(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...z(o),...z(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${s}" ? ${gi(o[c])} : ${gi(a[c])}`};return l}return t[r]})])}function Loe(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:oT(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=ne(n)?"axisOrient":`axis${Vc(n)}`,a=[...r,...r.map(l=>s+l.substr(4))],u=["axis",o,s];return{vlOnlyAxisConfig:M$(a,i,e,n),vgAxisConfig:M$(u,i,e,n),axisConfigStyle:Poe([...u,...a],i)}}function Poe(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=J(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function by(e,t,n,i={}){var s;const r=NM(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const T$={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Boe(n,e),gridScale:({model:e,channel:t})=>zoe(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||JN(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||KN(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??joe(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??qoe(t.type,n,j(t)&&!!t.timeUnit,j(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??Goe({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??Hoe({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=QN(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return LM(r?[r$(r)]:[],j(o)?[r$(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Voe(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Xoe(n,t)};function Boe(e,t){return!rt(e)&&j(t)&&!Be(t==null?void 0:t.bin)&&!Ct(t==null?void 0:t.bin)}function zoe(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function Uoe(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return ne(s)?s:lc(s);{const{configValue:o}=by("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?lc(o):n===qe&&be([Q2,J2],e.type)&&!(j(e)&&e.timeUnit)?270:void 0}}function vy(e){return`(((${e.signal} % 360) + 360) % 360)`}function KN(e,t,n,i){if(e!==void 0)if(n==="x"){if(ne(e)){const r=vy(e),s=ne(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(ne(t)){const r=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${r} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(ne(e)){const r=vy(e),s=ne(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${r} <= 45 || 315 <= ${r} || (135 <= ${r} && ${r} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${r} && ${r} <= 135) === ${s} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(ne(t)){const r=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${r} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function JN(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,s=i?"bottom":"left";if(ne(e)){const o=vy(e),a=ne(t)?`(${t.signal} === "${s}")`:t===s;return{signal:`(${r?`(${o} + 90)`:o} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${o} && ${o} < ${180+r}) === ${a} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(ne(t)){const o=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${o} "${s}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===s)?"left":"right"}function joe(e,t){if(t==="x"&&be(["quantitative","temporal"],e))return!0}function qoe(e,t,n,i){if(n&&!Y(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function Woe(e){return e==="x"?"bottom":"left"}function Goe({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!rt(t)&&t!=="log"){if(j(e)){if(Be(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&be(["month","hours","day","quarter"],(r=St(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function Hoe({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(j(t)){const{timeUnit:n}=t;if(n){const i=eT(n);if(i)return{signal:i}}}}function QN(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),s=i?i.title:void 0,o=r?r.title:void 0;if(s&&o)return PM(s,o);if(s)return s;if(o)return o;if(s!==void 0)return s;if(o!==void 0)return o}function Voe(e,t){const n=e.values;if(N(n))return RT(t,n);if(ne(n))return n}function Xoe(e,t){return e==="rect"&&Fh(t)?1:0}class uu extends Ne{constructor(n,i){super(n);L(this,"transform");L(this,"_dependentFields");this.transform=i,this._dependentFields=HN(this.transform.calculate)}clone(){return new uu(null,le(this.transform))}static parseAllForSortIndex(n,i){return i.forEachFieldDef((r,s)=>{if(ta(r)&&AT(r.sort)){const{field:o,timeUnit:a}=r,u=r.sort,l=u.map((c,f)=>`${iT({field:o,timeUnit:a,equal:c})} ? ${f} : `).join("")+u.length;n=new uu(n,{calculate:l,as:lu(r,s,{forAs:!0})})}}),n}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${pe(this.transform)}`}}function lu(e,t,n){return X(e,{prefix:t,suffix:"sort_index",...n})}function Sg(e,t){return be(["top","bottom"],t)?"column":be(["left","right"],t)||e==="row"?"row":"column"}function cu(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return ct((t||{})[e],r[e],n.header[e])}function Cg(e,t,n,i){const r={};for(const s of e){const o=cu(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const OE=["row","column"],RE=["header","footer"];function Yoe(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=Cg(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=Sg(t,a),l=lc(o);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...e6(l,u),...ZN(u,l,s),...t6(i,r,t,Nre,JT)}}}function ZN(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=JN(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function e6(e,t){const n=KN(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Koe(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of RE)if(n[r])for(const s of n[r]){const o=Qoe(e,t,r,n,s);o!=null&&i.push(o)}return i}function Joe(e,t){const{sort:n}=e;return _r(n)?{field:X(n,{expr:"datum"}),order:n.order??"ascending"}:N(n)?{field:lu(e,t,{expr:"datum"}),order:"ascending"}:{field:X(e,{expr:"datum"}),order:n??"ascending"}}function xy(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:u}=Cg(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=oE({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=Sg(t,a);return{text:{signal:u?Do(Do(u,"datum.label",l),"datum.value",X(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...e6(s,c),...ZN(c,s,o),...t6(n,e,t,Ire,QT)}}function Qoe(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=Cg(["labelOrient"],o.header,a,t);(t==="row"&&!be(["top","bottom"],f)||t==="column"&&!be(["left","right"],f))&&(s=xy(o,t,a))}const u=Pn(e)&&!ef(e.facet),l=r.axes,c=(l==null?void 0:l.length)>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:Joe(o,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const Zoe={column:{start:0,end:1},row:{start:1,end:0}};function eae(e,t){return Zoe[t][e]}function tae(e,t){const n={};for(const i of Xn){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=Cg(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=Sg(i,o),u=eae(s,a);u!==void 0&&(n[a]=u)}}return Pe(n)?void 0:n}function t6(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=cu(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function ME(e){return[...If(e,"width"),...If(e,"height"),...If(e,"childWidth"),...If(e,"childHeight")]}function If(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(i==null||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(rt(o)&&Qo(a)){const u=e.scaleName(n);return Pn(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[N$(u,a)]:[N$(u,a),{name:r,update:n6(u,s,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=ly(e.config.view,s?"width":"height"),u=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function N$(e,t){const n=`${e}_step`;return ne(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function n6(e,t,n){const i=t.get("type"),r=t.get("padding"),s=ct(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${gi(o)}, ${gi(s)}) * ${e}_step`}function i6(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function r6(e,t){return z(e).reduce((n,i)=>({...n,..._u({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>je(r.value),invalidValueRef:void 0})}),{})}function s6(e,t){if(Pn(t))return e==="theta"?"independent":"shared";if(Tu(t))return"shared";if(zE(t))return ft(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function TE(e,t){const n=e.scale[t],i=ft(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&W(_ne(t)),"independent"):e[i][t]||"shared"}const nae={...Bre,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},o6=z(nae);class iae extends Xr{}const I$={symbols:rae,gradient:sae,labels:oae,entries:aae};function rae(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:u,mark:l}=n,c=o.filled&&l!=="trail";let f={...Pte({},n,Nie),...RN(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,p=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?a6(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===An)delete f.fill;else if(q(f.fill,"field"))h?delete f.fill:(f.fill=je(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=je(g??1));else if(N(f.fill)){const m=Ey(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=je(m))}}if(f.stroke){if(i==="stroke"||!c&&i===An)delete f.stroke;else if(q(f.stroke,"field")||p)delete f.stroke;else if(N(f.stroke)){const m=ct(Ey(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==Gr){const m=j(t)&&l6(n,r,t);m?f.opacity=[{test:m,...je(g??1)},je(u.legend.unselectedOpacity)]:g&&(f.opacity=je(g))}return f={...f,...e},Pe(f)?void 0:f}function sae(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?a6(o.opacity)||s.opacity:void 0;return l&&(a.opacity=je(l)),a={...a,...e},Pe(a)?void 0:a}function oae(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=j(t)?l6(n,r,t):void 0,u=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=s;let f;No(c)?f=mi({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:o}):l===void 0&&c===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=mi({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&j(t)&&t.timeUnit===void 0&&(f=mi({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Pe(d)?void 0:d}function aae(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function a6(e){return u6(e,(t,n)=>Math.max(t,n.value))}function Ey(e){return u6(e,(t,n)=>ct(t,n.value))}function u6(e,t){if(tre(e))return J(e.condition).reduce(t,e.value);if(Ai(e))return e.value}function l6(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=H(n.field);return i.map(s=>`(!length(data(${H(Xe(s)+Lo)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const L$={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return vT(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return xT(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??pae(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??gae(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??lae(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>_a(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Da(n)&&Gi(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>uae(t,e)};function uae(e,t){const n=e.values;if(N(n))return RT(t,n);if(ne(n))return n}function lae(e,t,n,i){if(t!=="shape"){const r=Ey(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function cae(e){const{legend:t}=e;return ct(t.type,fae(e))}function fae({channel:e,timeUnit:t,scaleType:n}){if(Da(e)){if(be(["quarter","month","day"],t))return"symbol";if(Gi(n))return"gradient"}return"symbol"}function dae({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??hae(n,t)}function hae(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function pae({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(Gi(r))return n==="horizontal"?i==="top"||i==="bottom"?P$(t,"width",o,s):o:P$(t,"height",u,a)}function P$(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function gae(e){if(be(["quantile","threshold","log","symlog"],e))return"greedy"}function c6(e){const t=Ve(e)?mae(e):xae(e);return e.component.legends=t,t}function mae(e){const{encoding:t}=e,n={};for(const i of[An,...eN]){const r=mt(t[i]);!r||!e.getScaleComponent(i)||i===wn&&j(r)&&r.type===Du||(n[i]=vae(e,i))}return n}function yae(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function bae(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function vae(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new iae({},yae(e,t));koe(e,t,a);const u=n!==void 0?!n:o.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=mt(r[t]),f=j(c)?(x=St(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||s.legend.orient||"right",h=cae({legend:n,channel:t,timeUnit:f,scaleType:l}),p=dae({legend:n,legendType:h,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:l,orient:d,legendType:h,direction:p};for(const E of o6){if(h==="gradient"&&E.startsWith("symbol")||h==="symbol"&&E.startsWith("gradient"))continue;const w=E in L$?L$[E](g):n[E];if(w!==void 0){const A=bae(w,E,n,e.fieldDef(t));(A||s.legend[E]===void 0)&&a.set(E,w,A)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const E of["labels","legend","title","symbols","gradient","entries"]){const w=r6(m[E]??{},e),A=E in I$?I$[E](w,v):w;A!==void 0&&!Pe(A)&&(b[E]={...y!=null&&y.length&&j(c)?{name:`${Xe(c.field)}_legend_${E}`}:{},...y!=null&&y.length?{interactive:!0}:{},update:y!=null&&y.length?{...A,cursor:{value:"pointer"}}:A})}return Pe(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function xae(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){c6(i);for(const r of z(i.component.legends))n.legend[r]=TE(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=f6(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of z(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function f6(e,t){var s,o,a,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of o6){const c=Ds(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return Eae(f,d);case"title":return BM(f,d);case"type":return r=!0,Fn("symbol")}return xg(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&Ah(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&Ah(e.explicit,["encode","gradient"])),e}function Eae(e,t){return t.value==="circle"?t:e}function Aae(e,t,n,i){if(rf(t,n)){const r=Ve(e)?e.axis(n)??e.legend(n)??{}:{},s=X(t,{expr:"datum"}),o=X(t,{expr:"datum",binSuffix:"end"});return{formulaAs:X(t,{binSuffix:"range",forAs:!0}),formula:Zc(s,o,r.format,r.formatType,i)}}return{}}function d6(e,t){return`${_M(e)}_${t}`}function wae(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function NE(e,t,n){const i=pg(n,void 0)??{},r=d6(i,t);return e.getName(`${r}_bins`)}function Sae(e){return"as"in e}function B$(e,t,n){let i,r;Sae(e)?i=K(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[X(e,{forAs:!0}),X(e,{binSuffix:"end",forAs:!0})];const s={...pg(t,void 0)},o=d6(s,e.field),{signal:a,extentSignal:u}=wae(n,o);if(ig(s.extent)){const c=s.extent;r=XN(n,c.param,c),delete s.extent}const l={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:o,binComponent:l}}class Yi extends Ne{constructor(n,i){super(n);L(this,"bins");this.bins=i}clone(){return new Yi(null,le(this.bins))}static makeFromEncoding(n,i){const r=i.reduceFieldDef((s,o,a)=>{if(ln(o)&&Be(o.bin)){const{key:u,binComponent:l}=B$(o,o.bin,i);s[u]={...l,...s[u],...Aae(i,o,a,i.config)}}return s},{});return Pe(r)?null:new Yi(n,r)}static makeFromTransform(n,i,r){const{key:s,binComponent:o}=B$(i,i.bin,r);return new Yi(n,{[s]:o})}merge(n,i){for(const r of z(n.bins))r in this.bins?(i(n.bins[r].signal,this.bins[r].signal),this.bins[r].as=Rn([...this.bins[r].as,...n.bins[r].as],pe)):this.bins[r]=n.bins[r];for(const r of n.children)n.removeChild(r),r.parent=this;n.remove()}producedFields(){return new Set(dt(this.bins).map(n=>n.as).flat(2))}dependentFields(){return new Set(dt(this.bins).map(n=>n.field))}hash(){return`Bin ${pe(this.bins)}`}assemble(){return dt(this.bins).flatMap(n=>{const i=[],[r,...s]=n.as,{extent:o,...a}=n.bin,u={type:"bin",field:ti(n.field),as:r,signal:n.signal,...ig(o)?{extent:null}:{extent:o},...n.span?{span:{signal:`span(${n.span})`}}:{},...a};!o&&n.extentSignal&&(i.push({type:"extent",field:ti(n.field),signal:n.extentSignal}),u.extent={signal:n.extentSignal}),i.push(u);for(const l of s)for(let c=0;c<2;c++)i.push({type:"formula",expr:X({field:r[c]},{expr:"datum"}),as:l[c]});return n.formula&&i.push({type:"formula",expr:n.formula,as:n.formulaAs}),i})}}function Cae(e,t,n,i){var s;const r=Ve(i)?i.encoding[dr(t)]:void 0;if(ln(n)&&Ve(i)&&ST(n,r,i.markDef,i.config)){e.add(X(n,{})),e.add(X(n,{suffix:"end"}));const{mark:o,markDef:a,config:u}=i,l=Lr({fieldDef:n,markDef:a,config:u});cc(o)&&l!==.5&&ft(t)&&(e.add(X(n,{suffix:Eg})),e.add(X(n,{suffix:Ag}))),n.bin&&rf(n,t)&&e.add(X(n,{binSuffix:"range"}))}else if(EM(t)){const o=xM(t);e.add(i.getName(o))}else e.add(X(n));return ta(n)&&Aie((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function $ae(e,t){for(const n of z(t)){const i=t[n];for(const r of z(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class bi extends Ne{constructor(n,i,r){super(n);L(this,"dimensions");L(this,"measures");this.dimensions=i,this.measures=r}clone(){return new bi(null,new Set(this.dimensions),le(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(n,i){let r=!1;i.forEachFieldDef(a=>{a.aggregate&&(r=!0)});const s={},o=new Set;return!r||(i.forEachFieldDef((a,u)=>{const{aggregate:l,field:c}=a;if(l)if(l==="count")s["*"]??(s["*"]={}),s["*"].count=new Set([X(a,{forAs:!0})]);else{if(Ir(l)||Us(l)){const f=Ir(l)?"argmin":"argmax",d=l[f];s[d]??(s[d]={}),s[d][f]=new Set([X({op:f,field:d},{forAs:!0})])}else s[c]??(s[c]={}),s[c][l]=new Set([X(a,{forAs:!0})]);hr(u)&&i.scaleDomain(u)==="unaggregated"&&(s[c]??(s[c]={}),s[c].min=new Set([X({field:c,aggregate:"min"},{forAs:!0})]),s[c].max=new Set([X({field:c,aggregate:"max"},{forAs:!0})]))}else Cae(o,u,a,i)}),o.size+z(s).length===0)?null:new bi(n,o,s)}static makeFromTransform(n,i){var o;const r=new Set,s={};for(const a of i.aggregate){const{op:u,field:l,as:c}=a;u&&(u==="count"?(s["*"]??(s["*"]={}),s["*"].count=new Set([c||X(a,{forAs:!0})])):(s[l]??(s[l]={}),(o=s[l])[u]??(o[u]=new Set),s[l][u].add(c||X(a,{forAs:!0}))))}for(const a of i.groupby??[])r.add(a);return r.size+z(s).length===0?null:new bi(n,r,s)}merge(n){return fM(this.dimensions,n.dimensions)?($ae(this.measures,n.measures),!0):(Vne("different dimensions, cannot merge"),!1)}addDimensions(n){n.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...z(this.measures)])}producedFields(){const n=new Set;for(const i of z(this.measures))for(const r of z(this.measures[i])){const s=this.measures[i][r];s.size===0?n.add(`${r}_${i}`):s.forEach(n.add,n)}return n}hash(){return`Aggregate ${pe({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const n=[],i=[],r=[];for(const o of z(this.measures))for(const a of z(this.measures[o]))for(const u of this.measures[o][a])r.push(u),n.push(a),i.push(o==="*"?null:ti(o));return{type:"aggregate",groupby:[...this.dimensions].map(ti),ops:n,fields:i,as:r}}}class Ru extends Ne{constructor(n,i,r,s){super(n);L(this,"model");L(this,"name");L(this,"data");L(this,"column");L(this,"row");L(this,"facet");L(this,"childModel");this.model=i,this.name=r,this.data=s;for(const o of Xn){const a=i.facet[o];if(a){const{bin:u,sort:l}=a;this[o]={name:i.getName(`${o}_domain`),fields:[X(a),...Be(u)?[X(a,{binSuffix:"end"})]:[]],..._r(l)?{sortField:l}:N(l)?{sortIndexField:lu(a,o)}:{}}}}this.childModel=i.child}hash(){let n="Facet";for(const i of Xn)this[i]&&(n+=` ${i.charAt(0)}:${pe(this[i])}`);return n}get fields(){var i;const n=[];for(const r of Xn)(i=this[r])!=null&&i.fields&&n.push(...this[r].fields);return n}dependentFields(){const n=new Set(this.fields);for(const i of Xn)this[i]&&(this[i].sortField&&n.add(this[i].sortField.field),this[i].sortIndexField&&n.add(this[i].sortIndexField));return n}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const n={};for(const i of Hr){const r=this.childModel.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(rt(s)&&Qo(o)){const a=Bo(this.childModel,i),u=BE(a);u?n[i]=u:W(L2(i))}}}return n}assembleRowColumnHeaderData(n,i,r){const s={row:"y",column:"x",facet:void 0}[n],o=[],a=[],u=[];s&&r&&r[s]&&(i?(o.push(`distinct_${r[s]}`),a.push("max")):(o.push(r[s]),a.push("distinct")),u.push(`distinct_${r[s]}`));const{sortField:l,sortIndexField:c}=this[n];if(l){const{op:f=fg,field:d}=l;o.push(d),a.push(f),u.push(X(l,{forAs:!0}))}else c&&(o.push(c),a.push("max"),u.push(c));return{name:this[n].name,source:i??this.data,transform:[{type:"aggregate",groupby:this[n].fields,...o.length?{fields:o,ops:a,as:u}:{}}]}}assembleFacetHeaderData(n){var l,c;const{columns:i}=this.model.layout,{layoutHeaders:r}=this.model.component,s=[],o={};for(const f of OE){for(const d of RE){const h=((l=r[f])==null?void 0:l[d])??[];for(const p of h)if(((c=p.axes)==null?void 0:c.length)>0){o[f]=!0;break}}if(o[f]){const d=`length(data("${this.facet.name}"))`,h=f==="row"?i?{signal:`ceil(${d} / ${i})`}:1:i?{signal:`min(${d}, ${i})`}:{signal:d};s.push({name:`${this.facet.name}_${f}`,transform:[{type:"sequence",start:0,stop:h}]})}}const{row:a,column:u}=o;return(a||u)&&s.unshift(this.assembleRowColumnHeaderData("facet",null,n)),s}assemble(){const n=[];let i=null;const r=this.getChildIndependentFieldsWithStep(),{column:s,row:o,facet:a}=this;if(s&&o&&(r.x||r.y)){i=`cross_${this.column.name}_${this.row.name}`;const u=[].concat(r.x??[],r.y??[]),l=u.map(()=>"distinct");n.push({name:i,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:u,ops:l}]})}for(const u of[Dr,kr])this[u]&&n.push(this.assembleRowColumnHeaderData(u,i,r));if(a){const u=this.assembleFacetHeaderData(r);u&&n.push(...u)}return n}}function z$(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Fae(e,t){const n=$2(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=z$(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=z$(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return W(tne(t)),null}function kae(e){const t={};return md(e.filter,n=>{if(nT(n)){let i=null;q2(n)?i=_n(n.equal):G2(n)?i=_n(n.lte):W2(n)?i=_n(n.lt):H2(n)?i=_n(n.gt):V2(n)?i=_n(n.gte):X2(n)?i=n.range[0]:Y2(n)&&(i=(n.oneOf??n.in)[0]),i&&(Zo(i)?t[n.field]="date":Ce(i)?t[n.field]="number":K(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Dae(e){const t={};function n(i){su(i)?t[i.field]="date":i.type==="quantitative"&&Dte(i.aggregate)?t[i.field]="number":Qa(i.field)>1?i.field in t||(t[i.field]="flatten"):ta(i)&&_r(i.sort)&&Qa(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Ve(e)||Pn(e))&&e.forEachFieldDef((i,r)=>{if(ln(i))n(i);else{const s=Ko(r),o=e.fieldDef(s);n({...i,type:o.type})}}),Ve(e)){const{mark:i,markDef:r,encoding:s}=e;if(js(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];j(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function _ae(e){const t={};if(Ve(e)&&e.component.selection)for(const n of z(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Qa(r.field)>1&&(t[r.field]="flatten")}return t}class Bt extends Ne{constructor(n,i){super(n);L(this,"_parse");this._parse=i}clone(){return new Bt(null,le(this._parse))}hash(){return`Parse ${pe(this._parse)}`}static makeExplicit(n,i,r){var a;let s={};const o=i.data;return!vs(o)&&((a=o==null?void 0:o.format)!=null&&a.parse)&&(s=o.format.parse),this.makeWithAncestors(n,s,{},r)}static makeWithAncestors(n,i,r,s){for(const u of z(r)){const l=s.getWithExplicit(u);l.value!==void 0&&(l.explicit||l.value===r[u]||l.value==="derived"||r[u]==="flatten"?delete r[u]:W(KC(u,r[u],l.value)))}for(const u of z(i)){const l=s.get(u);l!==void 0&&(l===i[u]?delete i[u]:W(KC(u,i[u],l)))}const o=new Xr(i,r);s.copyAll(o);const a={};for(const u of z(o.combine())){const l=o.get(u);l!==null&&(a[u]=l)}return z(a).length===0||s.parseNothing?null:new Bt(n,a)}get parse(){return this._parse}merge(n){this._parse={...this._parse,...n.parse},n.remove()}assembleFormatParse(){const n={};for(const i of z(this._parse)){const r=this._parse[i];Qa(i)===1&&(n[i]=r)}return n}producedFields(){return new Set(z(this._parse))}dependentFields(){return new Set(z(this._parse))}assembleTransforms(n=!1){return z(this._parse).filter(i=>n?Qa(i)>1:!0).map(i=>{const r=Fae(i,this._parse[i]);return r?{type:"formula",expr:r,as:Fu(i)}:null}).filter(i=>i!==null)}}class _s extends Ne{clone(){return new _s(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Si])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Si}}}class af extends Ne{constructor(n,i){super(n);L(this,"params");this.params=i}clone(){return new af(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${pe(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class uf extends Ne{constructor(n,i){super(n);L(this,"params");this.params=i}clone(){return new uf(null,this.params)}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${pe(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Po extends Ne{constructor(n){super(null);L(this,"_data");L(this,"_name");L(this,"_generator");n??(n={name:"source"});let i;if(vs(n)||(i=n.format?{...Ln(n.format,["parse"])}:{}),fc(n))this._data={values:n.values};else if(ou(n)){if(this._data={url:n.url},!i.type){let r=/(?:\.([^.]+))?$/.exec(n.url)[1];be(["json","csv","tsv","dsv","topojson"],r)||(r="json"),i.type=r}}else vN(n)?this._data={values:[{type:"Sphere"}]}:(yN(n)||vs(n))&&(this._data={});this._generator=vs(n),n.name&&(this._name=n.name),i&&!Pe(i)&&(this._data.format=i)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(n){this._name=n}set parent(n){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}function IE(e){return e instanceof Po||e instanceof af||e instanceof uf}var Ma;class LE{constructor(){cA(this,Ma);Bg(this,Ma,!1)}setModified(){Bg(this,Ma,!0)}get modifiedFlag(){return lA(this,Ma)}}Ma=new WeakMap;class na extends LE{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class PE extends LE{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Oae extends PE{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r<n.length;r++)i[n[r]]===void 0?i[n[r]]=[t.children[r]]:i[n[r]].push(t.children[r]);for(const r of z(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Rae extends PE{constructor(n){super();L(this,"requiresSelectionId");this.requiresSelectionId=n&&_E(n)}run(n){n instanceof _s&&(this.requiresSelectionId&&(IE(n.parent)||n.parent instanceof bi||n.parent instanceof Bt)||(this.setModified(),n.remove()))}}class Mae extends LE{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Vi&&(i=t.producedFields(),S2(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class Tae extends PE{constructor(){super()}run(t){t instanceof bn&&!t.isRequired()&&(this.setModified(),t.remove())}}class Nae extends na{run(t){if(!IE(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof Bt)if(t instanceof Bt)this.setModified(),t.merge(n);else{if(C2(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Iae extends na{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof Bt);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const u of z(a))u in r?r[u]!==a[u]&&s.add(u):r[u]=a[u]}for(const o of s)delete r[o];if(!Pe(r)){this.setModified();const o=new Bt(t,r);for(const a of n){if(a instanceof Bt)for(const u of z(r))delete a.parse[u];t.removeChild(a),a.parent=o,a instanceof Bt&&z(a.parse).length===0&&a.remove()}}}}}class Lae extends na{run(t){t instanceof bn||t.numChildren()>0||t instanceof Ru||t instanceof Po||(this.setModified(),t.remove())}}class Pae extends na{run(t){const n=t.children.filter(r=>r instanceof Vi),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class Bae extends na{run(t){const n=t.children.filter(r=>r instanceof bi),i={};for(const r of n){const s=pe(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of z(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class zae extends na{constructor(n){super();L(this,"model");this.model=n}run(n){const i=!(IE(n)||n instanceof Ou||n instanceof Bt||n instanceof _s),r=[],s=[];for(const o of n.children)o instanceof Yi&&(i&&!C2(n.producedFields(),o.dependentFields())?r.push(o):s.push(o));if(r.length>0){const o=r.pop();for(const a of r)o.merge(a,this.model.renameSignal.bind(this.model));this.setModified(),n instanceof Yi?n.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(s.length>1){const o=s.pop();for(const a of s)o.merge(a,this.model.renameSignal.bind(this.model));this.setModified()}}}class Uae extends na{run(t){const n=[...t.children];if(!Ka(n,o=>o instanceof bn)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof bn){let a=o;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof bn)a=u;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class ia extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i}clone(){return new ia(null,le(this.transform))}addDimensions(n){this.transform.groupby=Rn(this.transform.groupby.concat(n),i=>i)}dependentFields(){const n=new Set;return this.transform.groupby&&this.transform.groupby.forEach(n.add,n),this.transform.joinaggregate.map(i=>i.field).filter(i=>i!==void 0).forEach(n.add,n),n}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(n){return n.as??X(n)}hash(){return`JoinAggregateTransform ${pe(this.transform)}`}assemble(){const n=[],i=[],r=[];for(const o of this.transform.joinaggregate)i.push(o.op),r.push(this.getDefaultName(o)),n.push(o.field===void 0?null:o.field);const s=this.transform.groupby;return{type:"joinaggregate",as:r,ops:i,fields:n,...s!==void 0?{groupby:s}:{}}}}class fu extends Ne{constructor(n,i){super(n);L(this,"filter");this.filter=i}clone(){return new fu(null,{...this.filter})}static make(n,i,r){const{config:s,markDef:o}=i,{marks:a,scales:u}=r;if(a==="include-invalid-values"&&u==="include-invalid-values")return null;const l=i.reduceFieldDef((c,f,d)=>{const h=hr(d)&&i.getScaleComponent(d);if(h){const p=h.get("type"),{aggregate:g}=f,m=iE({scaleChannel:d,markDef:o,config:s,scaleType:p,isCountAggregate:ng(g)});m!=="show"&&m!=="always-valid"&&(c[f.field]=f)}return c},{});return z(l).length?new fu(n,l):null}dependentFields(){return new Set(z(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${pe(this.filter)}`}assemble(){const n=z(this.filter).reduce((i,r)=>{const s=this.filter[r],o=X(s,{expr:"datum"});return s!==null&&(s.type==="temporal"?i.push(`(isDate(${o}) || (${Ay(o)}))`):s.type==="quantitative"&&i.push(Ay(o))),i},[]);return n.length>0?{type:"filter",expr:n.join(" && ")}:null}}function Ay(e){return`isValid(${e}) && isFinite(+${e})`}function jae(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=X(i);return r&&t.push(r),t},[])}function qae(e){return N(e)&&e.every(t=>K(t))&&e.length>1}class Rr extends Ne{constructor(n,i){super(n);L(this,"_stack");this._stack=i}clone(){return new Rr(null,le(this._stack))}static makeFromTransform(n,i){const{stack:r,groupby:s,as:o,offset:a="zero"}=i,u=[],l=[];if(i.sort!==void 0)for(const d of i.sort)u.push(d.field),l.push(ct(d.order,"ascending"));const c={field:u,order:l};let f;return qae(o)?f=o:K(o)?f=[o,`${o}_end`]:f=[`${i.stack}_start`,`${i.stack}_end`],new Rr(n,{dimensionFieldDefs:[],stackField:r,groupby:s,offset:a,sort:c,facetby:[],as:f})}static makeFromEncoding(n,i){const r=i.stack,{encoding:s}=i;if(!r)return null;const{groupbyChannels:o,fieldChannel:a,offset:u,impute:l}=r,c=o.map(p=>{const g=s[p];return wi(g)}).filter(p=>!!p),f=jae(i),d=i.encoding.order;let h;if(N(d)||j(d))h=IM(d);else{const p=CT(d)?d.sort:a==="y"?"descending":"ascending";h=f.reduce((g,m)=>(g.field.includes(m)||(g.field.push(m),g.order.push(p)),g),{field:[],order:[]})}return new Rr(n,{dimensionFieldDefs:c,stackField:i.vgField(a),facetby:[],stackby:f,sort:h,offset:u,impute:l,as:[i.vgField(a,{suffix:"start",forAs:!0}),i.vgField(a,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(n){this._stack.facetby.push(...n)}dependentFields(){const n=new Set;return n.add(this._stack.stackField),this.getGroupbyFields().forEach(n.add,n),this._stack.facetby.forEach(n.add,n),this._stack.sort.field.forEach(n.add,n),n}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${pe(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:n,impute:i,groupby:r}=this._stack;return n.length>0?n.map(s=>s.bin?i?[X(s,{binSuffix:"mid"})]:[X(s,{}),X(s,{binSuffix:"end"})]:[X(s)]).flat():r??[]}assemble(){const n=[],{facetby:i,dimensionFieldDefs:r,stackField:s,stackby:o,sort:a,offset:u,impute:l,as:c}=this._stack;if(l)for(const f of r){const{bandPosition:d=.5,bin:h}=f;if(h){const p=X(f,{expr:"datum"}),g=X(f,{expr:"datum",binSuffix:"end"});n.push({type:"formula",expr:`${Ay(p)} ? ${d}*${p}+${1-d}*${g} : ${p}`,as:X(f,{binSuffix:"mid",forAs:!0})})}n.push({type:"impute",field:s,groupby:[...o,...i],key:X(f,{binSuffix:"mid"}),method:"value",value:0})}return n.push({type:"stack",groupby:[...this.getGroupbyFields(),...i],field:s,sort:a,as:c,offset:u}),n}}class Mu extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i}clone(){return new Mu(null,le(this.transform))}addDimensions(n){this.transform.groupby=Rn(this.transform.groupby.concat(n),i=>i)}dependentFields(){const n=new Set;return(this.transform.groupby??[]).forEach(n.add,n),(this.transform.sort??[]).forEach(i=>n.add(i.field)),this.transform.window.map(i=>i.field).filter(i=>i!==void 0).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(n){return n.as??X(n)}hash(){return`WindowTransform ${pe(this.transform)}`}assemble(){const n=[],i=[],r=[],s=[];for(const d of this.transform.window)i.push(d.op),r.push(this.getDefaultName(d)),s.push(d.param===void 0?null:d.param),n.push(d.field===void 0?null:d.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&i.every(d=>N2(d)))return{type:"joinaggregate",as:r,ops:i,fields:n,...a!==void 0?{groupby:a}:{}};const u=[],l=[];if(this.transform.sort!==void 0)for(const d of this.transform.sort)u.push(d.field),l.push(d.order??"ascending");const c={field:u,order:l},f=this.transform.ignorePeers;return{type:"window",params:s,as:r,ops:i,fields:n,sort:c,...f!==void 0?{ignorePeers:f}:{},...a!==void 0?{groupby:a}:{},...o!==void 0?{frame:o}:{}}}}function Wae(e){function t(n){if(!(n instanceof Ru)){const i=n.clone();if(i instanceof bn){const r=Sy+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof bi||i instanceof Rr||i instanceof Mu||i instanceof ia)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function wy(e){if(e instanceof Ru)if(e.numChildren()===1&&!(e.children[0]instanceof bn)){const t=e.children[0];(t instanceof bi||t instanceof Rr||t instanceof Mu||t instanceof ia)&&t.addDimensions(e.fields),t.swapWithParent(),wy(e)}else{const t=e.model.component.data.main;h6(t);const n=Wae(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(wy)}function h6(e){if(e instanceof bn&&e.type===Qe.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Ru||(t.swapWithParent(),h6(e))}}const Sy="scale_",Lf=5;function Cy(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Cy(t.children))return!1}return!0}function oi(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function U$(e,t,n){let i=e.sources,r=!1;return r=oi(new Tae,i)||r,r=oi(new Rae(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=oi(new Lae,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=oi(new Nae,i)||r,r=oi(new zae(t),i)||r,r=oi(new Mae,i)||r,r=oi(new Iae,i)||r,r=oi(new Bae,i)||r,r=oi(new Pae,i)||r,r=oi(new Oae,i)||r,r=oi(new Uae,i)||r),e.sources=i,r}function Gae(e,t){Cy(e.sources);let n=0,i=0;for(let r=0;r<Lf&&U$(e,t,!0);r++)n++;e.sources.map(wy);for(let r=0;r<Lf&&U$(e,t,!1);r++)i++;Cy(e.sources),Math.max(n,i)===Lf&&W(`Maximum optimization runs(${Lf}) reached.`)}class vt{constructor(t){L(this,"signal");Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new vt(()=>t(n))}}function p6(e){Ve(e)?Hae(e):Vae(e)}function Hae(e){const t=e.component.scales;for(const n of z(t)){const i=Yae(e,n);if(t[n].setWithExplicit("domains",i),Jae(e,n),e.component.data.isFaceted){let s=e;for(;!Pn(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)$r(a)&&(a.data=Sy+a.data.replace(Sy,""))}}}function Vae(e){for(const n of e.children)p6(n);const t=e.component.scales;for(const n of z(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=Ds(i,o.getWithExplicit("domains"),"domains","scale",$y);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&W(Xte),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function Xae(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=j$(t,n);if(!r){W(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=j$(t,n);if(r)return"unaggregated"}return e}function Yae(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=Xae(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&mt(i.x2)?mt(i.x)?Ds(Qr(n,r,e,"x"),Qr(n,r,e,"x2"),"domain","scale",$y):Qr(n,r,e,"x2"):t==="y"&&mt(i.y2)?mt(i.y)?Ds(Qr(n,r,e,"y"),Qr(n,r,e,"y2"),"domain","scale",$y):Qr(n,r,e,"y2"):Qr(n,r,e,t)}function Kae(e,t,n){return e.map(i=>({signal:`{data: ${gg(i,{timeUnit:n,type:t})}}`}))}function Y0(e,t,n){var r;const i=(r=St(n))==null?void 0:r.unit;return t==="temporal"||i?Kae(e,t,i):[e]}function Qr(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:u}=n,l=mt(r[i]),{type:c}=l,f=l.timeUnit,d=Qse({invalid:er("invalid",s,a),isPath:js(o)});if(Eie(t)){const g=Qr(e,void 0,n,i),m=Y0(t.unionWith,c,f);return zi([...m,...g.value])}else{if(ne(t))return zi([t]);if(t&&t!=="unaggregated"&&!uT(t))return zi(Y0(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Fn([[0,1]]);const g=n.requestDataName(d);return Fn([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const h=hr(i)&&j(l)?Qae(n,i,e):void 0;if(pr(l)){const g=Y0([l.datum],c,f);return Fn(g)}const p=l;if(t==="unaggregated"){const{field:g}=l;return Fn([{data:n.requestDataName(d),field:X({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:X({field:g,aggregate:"max"})}])}else if(Be(p.bin)){if(rt(e))return Fn(e==="bin-ordinal"?[]:[{data:Ja(h)?n.requestDataName(d):n.requestDataName(Qe.Raw),field:n.vgField(i,rf(p,i)?{binSuffix:"range"}:{}),sort:h===!0||!Y(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:g}=p;if(Be(g)){const m=NE(n,p.field,g);return Fn([new vt(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Fn([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(p.timeUnit&&be(["time","utc"],e)){const g=r[dr(i)];if(ST(p,g,s,a)){const m=n.requestDataName(d),y=Lr({fieldDef:p,fieldDef2:g,markDef:s,config:a}),b=cc(o)&&y!==.5&&ft(i);return Fn([{data:m,field:n.vgField(i,b?{suffix:Eg}:{})},{data:m,field:n.vgField(i,{suffix:b?Ag:"end"})}])}}return Fn(h?[{data:Ja(h)?n.requestDataName(d):n.requestDataName(Qe.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function K0(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":fg),...i?{field:ti(i)}:{},...r?{order:r}:{}}}function Jae(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=uT(i)?i:void 0,o=Jo(r)&&ig(r.extent)?r.extent:void 0;(s||o)&&n.set("selectionExtent",s??o,!0)}function Qae(e,t,n){if(!rt(n))return;const i=e.fieldDef(t),r=i.sort;if(AT(r))return{op:"min",field:lu(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(_r(r)){const a=s&&!o.has(r.field);return K0(r,a)}else if(Qie(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=s&&!o.has(f);if(Ir(c)||Us(c))return K0({field:X(l),order:u},d);if(N2(c)||!c)return K0({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(be(["ascending",void 0],r))return!0}}function j$(e,t){const{aggregate:n,type:i}=e;return n?K(n)&&!Ote.has(n)?{valid:!1,reason:wne(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Sne(e)}:{valid:!0}:{valid:!1,reason:Ane(e)}}function $y(e,t,n,i){return e.explicit&&t.explicit&&W(Dne(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Zae(e){const t=Rn(e.map(o=>{if($r(o)){const{sort:a,...u}=o;return u}return o}),pe),n=Rn(e.map(o=>{if($r(o)){const a=o.sort;return a!==void 0&&!Ja(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),pe);if(t.length===0)return;if(t.length===1){const o=e[0];if($r(o)&&n.length>0){let a=n[0];if(n.length>1){W(QC);const u=n.filter(l=>Y(l)&&"op"in l&&l.op!=="min");n.every(l=>Y(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(Y(a)&&"field"in a){const u=a.field;o.field===u&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=Rn(n.map(o=>Ja(o)||!("op"in o)||K(o.op)&&Q(Fte,o.op)?o:(W(One(o)),!0)),pe);let r;i.length===1?r=i[0]:i.length>1&&(W(QC),r=!0);const s=Rn(e.map(o=>$r(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function BE(e){if($r(e)&&K(e.field))return e.field;if(RM(e)){let t;for(const n of e.fields)if($r(n)&&K(n.field)){if(!t)t=n.field;else if(t!==n.field)return W(Rne),t}return W(Mne),t}else if(Rte(e)){W(Tne);const t=e.fields[0];return K(t)?t:void 0}}function Bo(e,t){const i=e.component.scales[t].get("domains").map(r=>($r(r)&&(r.data=e.lookupDataSource(r.data)),r));return Zae(i)}function eue(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function g6(e,t){if(Ve(e)){const i=e.fieldDef(t);if(i!=null&&i.field)return i.field}const n=(e.children??[]).map(i=>g6(i,t)).filter(i=>!!i);if(n.length>0){const i=Rn(n,pe);return i.length===1?i[0]:void 0}}function tue(e,t,n){if(t===n)return!0;const i=e.getScaleType(t),r=e.getScaleType(n);if(!i||!r)return!1;const s=rt(i),o=rt(r);return s===o}function nue(e,t){return e?`field:${e}`:`channel:${String(t)}`}function iue(e){if(N(e)){const t=e.filter(Eh);return t.length>0?t:null}if(RM(e)){const t=[];if(t.push(...e.fields.flatMap(n=>N(n)?n.filter(Eh):[])),t.length>0)return Rn(t,pe)}return null}function Fy(e,t){try{const n=Bo(e,t);return iue(n)}catch{return null}}function rue(e,t,n){const i=Fy(e,t),r=Fy(e,n);return i&&r?Rn([...i,...r],pe):null}function q$(e,t,n){if(t&&t.length>0){const i=e.getWithExplicit("values");i!=null&&i.explicit||(n&&W(n),e.set("values",t,!1))}}function sue(e,t,n){const i=e.getScaleComponent(t),r=e.getScaleComponent(n);if(!i||!r)return!1;const s=i.getWithExplicit("domains"),o=r.getWithExplicit("domains");if(!(s!=null&&s.explicit&&(o!=null&&o.explicit)))return!1;const a=Bo(e,t),u=Bo(e,n);return pe(a)===pe(u)}function m6(e){const t=e.component.legends,n={};for(const r of z(t)){const s=g6(e,r),o=nue(s,r);if(!n[o]){n[o]=[{channel:r,cmpt:t[r].clone()}];continue}let a=!1;for(const u of n[o]){if(!tue(e,u.channel,r))continue;if(f6(u.cmpt,t[r])){const c=e.getScaleType(u.channel),f=e.getScaleType(r);c&&f&&rt(c)&&rt(f)&&(sue(e,u.channel,r)?q$(u.cmpt,Fy(e,u.channel)):q$(u.cmpt,rue(e,u.channel,r),Nne(u.channel,r))),a=!0;break}}a||n[o].push({channel:r,cmpt:t[r].clone()})}return dt(n).flat().map(r=>oue(r.cmpt,e.config)).filter(r=>r!==void 0)}function oue(e,t){var o,a,u;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const l=s.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!s.stroke&&(l.stroke={value:"transparent"});for(const c of eN)s[c]&&delete l[c]}if(s.title||delete s.title,i!==void 0){let l=i;(u=(a=s.encode)==null?void 0:a.labels)!=null&&u.update&&ne(s.encode.labels.update.text)&&(l=Do(i,"datum.label",s.encode.labels.update.text.signal)),eue(s,"labels","text",{signal:l})}return s}}function aue(e){return Tu(e)||zE(e)?uue(e):y6(e)}function uue(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),y6(e))}function y6(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const u=ne(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return be(o,u)||o.push(u),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const lue=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class b6 extends Xr{constructor(n,i,r,s){super({...i},{name:n});L(this,"specifiedProjection");L(this,"size");L(this,"data");L(this,"merged",!1);this.specifiedProjection=i,this.size=r,this.data=s}get isFit(){return!!this.data}}function v6(e){e.component.projection=Ve(e)?cue(e):hue(e)}function cue(e){if(e.hasProjection){const t=$t(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?fue(e):void 0,s=new b6(e.projectionName(!0),{...$t(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function fue(e){const t=[],{encoding:n}=e;for(const i of[[Mi,Ri],[ni,Ti]])(mt(n[i[0]])||mt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(wn)&&e.typedFieldDef(wn).type===Du&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Qe.Main)),t}function due(e,t){const n=w2(lue,r=>!!(!Q(e.explicit,r)&&!Q(t.explicit,r)||Q(e.explicit,r)&&Q(t.explicit,r)&&Mn(e.get(r),t.get(r))));if(Mn(e.size,t.size)){if(n)return e;if(Mn(e.explicit,{}))return t;if(Mn(t.explicit,{}))return e}return null}function hue(e){if(e.children.length===0)return;let t;for(const i of e.children)v6(i);const n=w2(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=due(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new b6(i,t.specifiedProjection,t.size,le(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function x6(e){return Tu(e)||zE(e)?e.children.reduce((t,n)=>t.concat(x6(n)),W$(e)):W$(e)}function W$(e){return z(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=pue(r.range,s,n,e),h=Bo(e,n),p=a?loe(e,a,i,h):null;return t.push({name:s,type:o,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function pue(e,t,n,i){if(ft(n)){if(Qo(e))return{step:{signal:`${t}_step`}}}else if(Y(e)&&$r(e))return{...e,data:i.lookupDataSource(e.data)};return e}class E6 extends Xr{constructor(n,i){super({},{name:n});L(this,"merged",!1);this.setWithExplicit("type",i)}domainHasZero(){const n=this.get("type");if(be([Ft.LOG,Ft.TIME,Ft.UTC],n))return"definitely-not";const i=this.get("zero");if(i===!0||i===void 0&&be([Ft.LINEAR,Ft.SQRT,Ft.POW],n))return"definitely";const r=this.get("domains");if(r.length>0){let s=!1,o=!1,a=!1;for(const u of r){if(N(u)){const l=u[0],c=u[u.length-1];if(Ce(l)&&Ce(c))if(l<=0&&c>=0){s=!0;continue}else{o=!0;continue}}a=!0}if(s)return"definitely";if(o&&!a)return"definitely-not"}return"maybe"}}const gue=["range","scheme"];function mue(e){const t=e.component.scales;for(const n of T2){const i=t[n];if(!i)continue;const r=yue(n,e);i.setWithExplicit("range",r)}}function G$(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=Sn(t),o=e.getName(s);if(Y(i)&&i.binned&&i.step!==void 0)return new vt(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${u})`});if(Be(i)){const a=NE(e,r,i);return new vt(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(o)} / (${l})`})}}}function yue(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of gue)if(n[f]!==void 0){const d=oy(s,f),h=lT(e,f);if(!d)W(qM(s,f,e));else if(h)W(h);else switch(f){case"range":{const p=n.range;if(N(p)){if(ft(e))return zi(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return vt.fromName(y,m)}return g}))}else if(Y(p))return zi({data:t.requestDataName(Qe.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return zi(p)}case"scheme":return zi(bue(n[f]))}}const o=e===qe||e==="xOffset"?"width":"height",a=i[o];if(nr(a)){if(ft(e))if(rt(s)){const f=w6(a,t,e);if(f)return zi({step:f})}else W(WM(o));else if(Kc(e)){const f=e===Nr?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=S6(a,s);if(p)return zi(p)}}}const{rangeMin:u,rangeMax:l}=n,c=vue(e,t);return(u!==void 0||l!==void 0)&&oy(s,"rangeMin")&&N(c)&&c.length===2?zi([u??c[0],l??c[1]]):Fn(c)}function bue(e){return xie(e)?{scheme:e.name,...Ln(e,["name"])}:{scheme:e}}function A6(e,t,n,{center:i}={}){const r=Sn(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===yt&&Ei(n)?i?[vt.fromName(a=>`${o(a)}/2`,s),vt.fromName(a=>`-${o(a)}/2`,s)]:[vt.fromName(o,s),0]:i?[vt.fromName(a=>`-${o(a)}/2`,s),vt.fromName(a=>`${o(a)}/2`,s)]:[0,vt.fromName(o,s)]}function vue(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=mt(s[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case qe:case yt:{if(be(["point","band"],u)){const f=C6(e,n,i.view);if(nr(f))return{step:w6(f,t,e)}}return A6(e,t,u)}case Nr:case ku:return xue(e,t,u);case Wr:{const f=wue(r,i),d=Sue(r,n,t,i);return tu(u)?Aue(f,d,Eue(u,i,l,e)):[f,d]}case ri:return[0,Math.PI*2];case Yo:return[0,360];case Oi:return[0,new vt(()=>{const f=t.getSignalName(Pn(t.parent)?"child_width":"width"),d=t.getSignalName(Pn(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Is:return{step:1e3/i.scale.framesPerSecond};case Bs:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case zs:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case wn:return"symbol";case An:case cr:case fr:return u==="ordinal"?o==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Gr:case Ls:case Ps:return[i.scale.minOpacity,i.scale.maxOpacity]}}function w6(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=_2(n),o=i[s];if(nN({step:e,offsetIsDiscrete:ce(o)&&K2(o.type)})==="offset"&&IT(i,s)){const u=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${Lte(f)})`}}else return e.step}function S6(e,t){if(nN({step:e,offsetIsDiscrete:rt(t)})==="offset")return{step:e.step}}function xue(e,t,n){const i=e===Nr?"x":"y",r=t.getScaleComponent(i);if(!r)return A6(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:u}=t;if(s==="band"){const l=C6(i,t.size,t.config.view);if(nr(l)){const c=S6(l,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const l=t.encoding[i];if(j(l)&&l.timeUnit){const c=eT(l.timeUnit,p=>`scale('${o}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=Lr({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const p=ne(f)?`${f.signal}/2${h}`:`${f/2+d}`,g=ne(f)?`(1 - ${f.signal}/2)${h}`:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return lM(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function C6(e,t,n){const i=e===qe?"width":"height",r=t[i];return r!==void 0?r:_h(n,i)}function Eue(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&N(n)?n.length+1:(W(Wne(i)),3)}}function Aue(e,t,n){const i=()=>{const r=gi(t),s=gi(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return ne(t)?new vt(i):{signal:i()}}function wue(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(rg("size",e))}const H$=.95;function Sue(e,t,n,i){const r={x:G$(n,"x"),y:G$(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=V$(t,r,i.view);return Ce(s)?s-1:new vt(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=V$(t,r,i.view);return Ce(s)?Math.pow(H$*s,2):new vt(()=>`pow(${H$} * ${s.signal}, 2)`)}}throw new Error(rg("size",e))}function V$(e,t,n){const i=nr(e.width)?e.width.step:cy(n,"width"),r=nr(e.height)?e.height.step:cy(n,"height");return t.x||t.y?new vt(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function $6(e,t){Ve(e)?Cue(e,t):k6(e,t)}function Cue(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of z(n)){const u=o[a],l=n[a],c=e.getScaleComponent(a),f=mt(r[a]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=oy(h,t),y=lT(a,t);if(d!==void 0&&(m?y&&W(y):W(qM(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":Zo(u[t])||v==="temporal"||b?l.set(t,{signal:gg(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=q(X$,t)?X$[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:s,config:i,hasNestedOffsetScale:LT(r,a),hasSecondaryRangeChannel:!!r[dr(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const X$={bins:({model:e,fieldOrDatumDef:t})=>j(t)?$ue(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Fue(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>kue(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Due(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>_ue(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>Oue(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=j(e)?e.sort:void 0;return Rue(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>Mue(e,t,n,i,r,s.scale,o)};function F6(e){Ve(e)?mue(e):k6(e,"range")}function k6(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?F6(i):$6(i,t);for(const i of z(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=Ds(r,a,t,"scale",mN((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function $ue(e,t){const n=t.bin;if(Be(n)){const i=NE(e,t.field,n);return new vt(()=>e.getSignalName(i))}else if(Ct(n)&&Jo(n)&&n.step!==void 0)return{step:n.step}}function Fue(e,t){if(be([An,cr,fr],e)&&t!=="nominal")return"hcl"}function kue(e,t,n,i,r,s){var o;if(!((o=wi(s))!=null&&o.bin||N(n)||r!=null||i!=null||be([Ft.TIME,Ft.UTC],e)))return ft(t)?!0:void 0}function Due(e,t,n,i,r,s){if(ft(e)){if(Gi(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(j(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===Ft.POINT)return n.pointPadding}}function _ue(e,t,n,i,r,s=!1){if(e===void 0){if(ft(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return s?c:ct(o,n==="bar"?a:n==="tick"?l:u)}else if(Kc(t)&&i===Ft.BAND)return r.offsetBandPaddingInner}}function Oue(e,t,n,i,r,s=!1){if(e===void 0){if(ft(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===Ft.BAND)return ct(o,ne(i)?{signal:`${i.signal}/2`}:i/2)}else if(Kc(t)){if(n===Ft.POINT)return .5;if(n===Ft.BAND)return r.offsetBandPaddingOuter}}}function Rue(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Ei(e)&&t==="descending"?ne(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Ei(e)&&t==="descending")return!0}function Mue(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&Ei(r)){if(N(n)){const u=n[0],l=n[n.length-1];if(Ce(u)&&u<=0&&Ce(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!tu(r))return!0;if(!(j(t)&&t.bin)&&be([...Hr,...bte],e)){const{orient:u,type:l}=i;return be(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:be(["bar","area"],l)&&!o?!0:s==null?void 0:s.zero}return!1}function Tue(e,t,n,i,r=!1){const s=Nue(t,n,i,r),{type:o}=e;return hr(t)?o!==void 0?Fie(t,o)?j(n)&&!$ie(o,n.type)?(W(Fne(o,s)),s):o:(W($ne(t,o,s)),s):s:null}function Nue(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(Da(e)||P0(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&W(B0(e,"ordinal")),"ordinal";if(L0(e))return"band";if(ft(e)||Kc(e)){if(be(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in M2)return"band";const s=n[Sn(e)];return To(s)||iu(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return Da(e)?"time":P0(e)==="discrete"?(W(B0(e,"temporal")),"ordinal"):j(t)&&t.timeUnit&&St(t.timeUnit).utc?"utc":L0(e)?"band":"time";case"quantitative":return Da(e)?j(t)&&Be(t.bin)?"bin-ordinal":"linear":P0(e)==="discrete"?(W(B0(e,"quantitative")),"ordinal"):L0(e)?"band":"linear";case"geojson":return}throw new Error(UM(t.type))}function Iue(e,{ignoreRange:t}={}){D6(e),p6(e);for(const n of Cie)$6(e,n);t||F6(e)}function D6(e){Ve(e)?e.component.scales=Lue(e):e.component.scales=Bue(e)}function Lue(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of T2){const o=mt(t[s]);if(o&&n===dT&&s===wn&&o.type===Du)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const u=LT(t,s),l=Tue(a,s,o,i,u);r[s]=new E6(e.scaleName(`${s}`,!0),{value:l,explicit:a.type===l})}}return r}const Pue=mN((e,t)=>e$(e)-e$(t));function Bue(e){var r;const t=e.component.scales={},n={},i=e.component.resolve;for(const s of e.children){D6(s);for(const o of z(s.component.scales))if((r=i.scale)[o]??(r[o]=s6(o,e)),i.scale[o]==="shared"){const a=n[o],u=s.component.scales[o].getWithExplicit("type");a?gie(a.value,u.value)?n[o]=Ds(a,u,"type","scale",Pue):(i.scale[o]="independent",delete n[o]):n[o]=u}}for(const s of z(n)){const o=e.scaleName(s,!0),a=n[s];t[s]=new E6(o,a);for(const u of e.children){const l=u.component.scales[s];l&&(u.renameScale(l.get("name"),o),l.merged=!0)}}return t}class J0{constructor(){L(this,"nameMap");this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Ve(e){return(e==null?void 0:e.type)==="unit"}function Pn(e){return(e==null?void 0:e.type)==="facet"}function zE(e){return(e==null?void 0:e.type)==="concat"}function Tu(e){return(e==null?void 0:e.type)==="layer"}class UE{constructor(t,n,i,r,s,o,a){L(this,"type");L(this,"parent");L(this,"config");L(this,"name");L(this,"size");L(this,"title");L(this,"description");L(this,"data");L(this,"transforms");L(this,"layout");L(this,"scaleNameMap");L(this,"projectionNameMap");L(this,"signalNameMap");L(this,"component");L(this,"view");this.type=n,this.parent=i,this.config=s,this.parent=i,this.config=s,this.view=$t(a),this.name=t.name??r,this.title=is(t.title)?{text:t.title}:t.title?$t(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new J0,this.projectionNameMap=i?i.projectionNameMap:new J0,this.signalNameMap=i?i.signalNameMap:new J0,this.data=t.data,this.description=t.description,this.transforms=zse(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Wre(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:dg(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new Xr,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?le(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Iue(this)}parseProjection(){v6(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){c6(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of z(i)){const o=i[s];o!==void 0&&(r[s]=je(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=je(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Pe(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=tae(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of Xn)t[i].title&&n.push(Yoe(this,i));for(const i of OE)n=n.concat(Koe(this,i));return n}assembleAxes(){return Ioe(this.component.axes,this.config)}assembleLegends(){return m6(this)}assembleProjections(){return aue(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...OM(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return be(["unit","layer"],this.type)?be(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),Pe(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Pn(this.parent)?x6(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return Xe((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Qe[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Pn(this.parent)){const n=i6(t),i=tg(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(rt(s)&&Qo(o)){const a=r.get("name"),u=Bo(this,i),l=BE(u);if(l){const c=X({aggregate:"distinct",field:l},{expr:"datum"});return{signal:n6(a,r,c)}}else return W(L2(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(wM(t)&&hr(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(jte(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class _6 extends UE{vgField(t,n={}){const i=this.fieldDef(t);if(i)return X(i,n)}reduceFieldDef(t,n){return vre(this.getMapping(),(i,r,s)=>{const o=wi(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){dE(this.getMapping(),(i,r)=>{const s=wi(i);s&&t(s,r)},n)}}class $g extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i,this.transform=le(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];const s=this.transform.resolve??"shared";this.transform.resolve=s}clone(){return new $g(null,le(this.transform))}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${pe(this.transform)}`}assemble(){const{density:n,...i}=this.transform,r={type:"kde",field:n,...i};return r.resolve=this.transform.resolve,r}}class Fg extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i,this.transform=le(i)}clone(){return new Fg(null,le(this.transform))}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${pe(this.transform)}`}assemble(){const{extent:n,param:i}=this.transform;return{type:"extent",field:n,signal:i}}}class kg extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i,this.transform=le(i);const{flatten:r,as:s=[]}=this.transform;this.transform.as=r.map((o,a)=>s[a]??o)}clone(){return new kg(this.parent,le(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${pe(this.transform)}`}assemble(){const{flatten:n,as:i}=this.transform;return{type:"flatten",fields:n,as:i}}}class Dg extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i,this.transform=le(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}clone(){return new Dg(null,le(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${pe(this.transform)}`}assemble(){const{fold:n,as:i}=this.transform;return{type:"fold",fields:n,as:i}}}class Ra extends Ne{constructor(n,i,r,s){super(n);L(this,"fields");L(this,"geojson");L(this,"signal");this.fields=i,this.geojson=r,this.signal=s}clone(){return new Ra(null,le(this.fields),this.geojson,this.signal)}static parseAll(n,i){if(i.component.projection&&!i.component.projection.isFit)return n;let r=0;for(const s of[[Mi,Ri],[ni,Ti]]){const o=s.map(a=>{const u=mt(i.encoding[a]);return j(u)?u.field:pr(u)?{expr:`${u.datum}`}:Ai(u)?{expr:`${u.value}`}:void 0});(o[0]||o[1])&&(n=new Ra(n,o,null,i.getName(`geojson_${r++}`)))}if(i.channelHasField(wn)){const s=i.typedFieldDef(wn);s.type===Du&&(n=new Ra(n,null,s.field,i.getName(`geojson_${r}`)))}return n}dependentFields(){const n=(this.fields??[]).filter(K);return new Set([...this.geojson?[this.geojson]:[],...n])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${pe(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class dc extends Ne{constructor(n,i,r,s){super(n);L(this,"projection");L(this,"fields");L(this,"as");this.projection=i,this.fields=r,this.as=s}clone(){return new dc(null,this.projection,le(this.fields),le(this.as))}static parseAll(n,i){if(!i.projectionName())return n;for(const r of[[Mi,Ri],[ni,Ti]]){const s=r.map(a=>{const u=mt(i.encoding[a]);return j(u)?u.field:pr(u)?{expr:`${u.datum}`}:Ai(u)?{expr:`${u.value}`}:void 0}),o=r[0]===ni?"2":"";(s[0]||s[1])&&(n=new dc(n,i.projectionName(),s,[i.getName(`x${o}`),i.getName(`y${o}`)]))}return n}dependentFields(){return new Set(this.fields.filter(K))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${pe(this.fields)} ${pe(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class mo extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i}clone(){return new mo(null,le(this.transform))}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(n){const{start:i=0,stop:r,step:s}=n;return{signal:`sequence(${[i,r,...s?[s]:[]].join(",")})`}}static makeFromTransform(n,i){return new mo(n,i)}static makeFromEncoding(n,i){const r=i.encoding,s=r.x,o=r.y;if(j(s)&&j(o)){const a=s.impute?s:o.impute?o:void 0;if(a===void 0)return;const u=s.impute?o:o.impute?s:void 0,{method:l,value:c,frame:f,keyvals:d}=a.impute,h=zT(i.mark,r);return new mo(n,{impute:a.field,key:u.field,...l?{method:l}:{},...c!==void 0?{value:c}:{},...f?{frame:f}:{},...d!==void 0?{keyvals:d}:{},...h.length?{groupby:h}:{}})}return null}hash(){return`Impute ${pe(this.transform)}`}assemble(){const{impute:n,key:i,keyvals:r,method:s,groupby:o,value:a,frame:u=[null,null]}=this.transform,l={type:"impute",field:n,key:i,...r?{keyvals:Ese(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!s||s==="value"?a:null};if(s&&s!=="value"){const c={type:"window",as:[`imputed_${n}_value`],ops:[s],fields:[n],frame:u,ignorePeers:!1,...o?{groupby:o}:{}},f={type:"formula",expr:`datum.${n} === null ? datum.imputed_${n}_value : datum.${n}`,as:n};return[l,c,f]}else return[l]}}class _g extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i,this.transform=le(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??i.on,r[1]??i.loess]}clone(){return new _g(null,le(this.transform))}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${pe(this.transform)}`}assemble(){const{loess:n,on:i,...r}=this.transform;return{type:"loess",x:i,y:n,...r}}}class hc extends Ne{constructor(n,i,r){super(n);L(this,"transform");L(this,"secondary");this.transform=i,this.secondary=r}clone(){return new hc(null,le(this.transform),this.secondary)}static make(n,i,r,s){const o=i.component.data.sources,{from:a}=r;let u=null;if(Ase(a)){let l=M6(a.data,o);l||(l=new Po(a.data),o.push(l));const c=i.getName(`lookup_${s}`);u=new bn(l,c,Qe.Lookup,i.component.data.outputNodeRefCounts),i.component.data.outputNodes[c]=u}else if(wse(a)){const l=a.param;r={as:l,...r};let c;try{c=i.getSelectionComponent(Xe(l),l)}catch{throw new Error(Hte(l))}if(u=c.materialized,!u)throw new Error(Vte(l))}return new hc(n,r,u.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?J(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${pe({transform:this.transform,secondary:this.secondary})}`}assemble(){let n;if(this.transform.from.fields)n={values:this.transform.from.fields,...this.transform.as?{as:J(this.transform.as)}:{}};else{let i=this.transform.as;K(i)||(W(rne),i="_lookup"),n={as:[i]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...n,...this.transform.default?{default:this.transform.default}:{}}}}class Og extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i,this.transform=le(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}clone(){return new Og(null,le(this.transform))}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${pe(this.transform)}`}assemble(){const{quantile:n,...i}=this.transform;return{type:"quantile",field:n,...i}}}class Rg extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i,this.transform=le(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??i.on,r[1]??i.regression]}clone(){return new Rg(null,le(this.transform))}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${pe(this.transform)}`}assemble(){const{regression:n,on:i,...r}=this.transform;return{type:"regression",x:i,y:n,...r}}}class Mg extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i}clone(){return new Mg(null,le(this.transform))}addDimensions(n){this.transform.groupby=Rn((this.transform.groupby??[]).concat(n),i=>i)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${pe(this.transform)}`}assemble(){const{pivot:n,value:i,groupby:r,limit:s,op:o}=this.transform;return{type:"pivot",field:n,value:i,...s!==void 0?{limit:s}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class Tg extends Ne{constructor(n,i){super(n);L(this,"transform");this.transform=i}clone(){return new Tg(null,le(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${pe(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function O6(e){let t=0;function n(i,r){if(i instanceof Po&&!i.isGenerator&&!ou(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof Bt&&(i.parent instanceof Po&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Ru){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof af||i instanceof uf||i instanceof fu||i instanceof Ou||i instanceof uu||i instanceof dc||i instanceof bi||i instanceof hc||i instanceof Mu||i instanceof ia||i instanceof Dg||i instanceof kg||i instanceof $g||i instanceof _g||i instanceof Og||i instanceof Rg||i instanceof _s||i instanceof Tg||i instanceof Mg||i instanceof Fg)&&r.transform.push(i.assemble()),(i instanceof Yi||i instanceof Vi||i instanceof mo||i instanceof Rr||i instanceof Ra)&&r.transform.push(...i.assemble()),i instanceof bn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof bn?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof bn&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function zue(e){const t=[],n=O6(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Uue(e,t){const n=[],i=O6(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function jue(e){return e==="top"||e==="left"||ne(e)?"header":"footer"}function que(e){for(const t of Xn)Wue(e,t);Y$(e,"x"),Y$(e,"y")}function Wue(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],u=cu("title",null,i,t);let l=_a(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=N(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=cu("labelOrient",a.header,i,t),f=a.header!==null?ct((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=be(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[R6(e,t,f)]}}}function R6(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function Y$(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=TE(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const u=jue(a.get("orient"));o[u]??(o[u]=[R6(e,s,!1)]);const l=Sl(a,"main",e.config,{header:!0});l&&o[u][0].axes.push(l),a.mainExtracted=!0}}}}function Gue(e){jE(e),Th(e,"width"),Th(e,"height")}function Hue(e){jE(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Th(e,t),Th(e,n)}function jE(e){for(const t of e.children)t.parseLayoutSize()}function Th(e,t){const n=i6(t),i=tg(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??s6(i,e);if(l==="independent"&&u.value==="step"){o=void 0;break}if(o){if(l==="independent"&&o.value!==u.value){o=void 0;break}o=Ds(o,u,n,"")}else o=u}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function Vue(e){const{size:t,component:n}=e;for(const i of Hr){const r=Sn(i);if(t[r]!=null&&t[r]!=null){const s=t[r];n.layoutSize.set(r,nr(s)?"step":s,!0)}else{const s=Xue(e,r);n.layoutSize.set(r,s,!1)}}}function Xue(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(rt(s)){const a=_h(i.view,t);return Qo(o)||nr(a)?"step":a}else return ly(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return ly(i.view,t);{const s=_h(i.view,t);return nr(s)?s.step:s}}}function ky(e,t,n){return X(t,{suffix:`by_${X(e)}`,...n})}class zl extends _6{constructor(n,i,r,s){super(n,"facet",i,r,s,n.resolve);L(this,"facet");L(this,"child");L(this,"children");this.child=VE(n.spec,this,this.getName("child"),void 0,s),this.children=[this.child],this.facet=this.initFacet(n.facet)}initFacet(n){if(!ef(n))return{facet:this.initFacetFieldDef(n,"facet")};const i=z(n),r={};for(const s of i){if(![kr,Dr].includes(s)){W(rg(s,"facet"));break}const o=n[s];if(o.field===void 0){W(ry(o,s));break}r[s]=this.initFacetFieldDef(o,s)}return r}initFacetFieldDef(n,i){const r=fE(n,i);return r.header?r.header=$t(r.header):r.header===null&&(r.header=null),r}channelHasField(n){return q(this.facet,n)}fieldDef(n){return this.facet[n]}parseData(){this.component.data=Ng(this),this.child.parseData()}parseLayoutSize(){jE(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,dt(this.component.selection).some(n=>Xi(n))&&B2(P2)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),que(this)}assembleSelectionTopLevelSignals(n){return this.child.assembleSelectionTopLevelSignals(n)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(n){return this.child.assembleSelectionData(n)}getHeaderLayoutMixins(){const n={};for(const i of Xn)for(const r of RE){const s=this.component.layoutHeaders[i],o=s[r],{facetFieldDef:a}=s;if(a){const u=cu("titleOrient",a.header,this.config,i);if(["right","bottom"].includes(u)){const l=Sg(i,u);n.titleAnchor??(n.titleAnchor={}),n.titleAnchor[l]="end"}}if(o!=null&&o[0]){const u=i==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";i!=="facet"&&!this.child.component.layoutSize.get(u)&&(n[l]??(n[l]={}),n[l][i]=.5),s.title&&(n.offset??(n.offset={}),n.offset[i==="row"?"rowTitle":"columnTitle"]=10)}}return n}assembleDefaultLayout(){const{column:n,row:i}=this.facet,r=n?this.columnDistinctSignal():i?1:void 0;let s="all";return(!i&&this.component.resolve.scale.x==="independent"||!n&&this.component.resolve.scale.y==="independent")&&(s="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:s}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof zl))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(n){return this.parent&&this.parent instanceof zl?{...this.channelHasField("column")?{encode:{update:{columns:{field:X(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(n)}:super.assembleGroup(n)}getCardinalityAggregateForChild(){const n=[],i=[],r=[];if(this.child instanceof zl){if(this.child.channelHasField("column")){const s=X(this.child.facet.column);n.push(s),i.push("distinct"),r.push(`distinct_${s}`)}}else for(const s of Hr){const o=this.child.component.scales[s];if(o&&!o.merged){const a=o.get("type"),u=o.get("range");if(rt(a)&&Qo(u)){const l=Bo(this.child,s),c=BE(l);c?(n.push(c),i.push("distinct"),r.push(`distinct_${c}`)):W(L2(s))}}}return{fields:n,ops:i,as:r}}assembleFacet(){const{name:n,data:i}=this.component.data.facetRoot,{row:r,column:s}=this.facet,{fields:o,ops:a,as:u}=this.getCardinalityAggregateForChild(),l=[];for(const f of Xn){const d=this.facet[f];if(d){l.push(X(d));const{bin:h,sort:p}=d;if(Be(h)&&l.push(X(d,{binSuffix:"end"})),_r(p)){const{field:g,op:m=fg}=p,y=ky(d,p);r&&s?(o.push(y),a.push("max"),u.push(y)):(o.push(g),a.push(m),u.push(y))}else if(N(p)){const g=lu(d,f);o.push(g),a.push("max"),u.push(g)}}}const c=!!r&&!!s;return{name:n,data:i,groupby:l,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:a,as:u}:{}}}:{}}}facetSortFields(n){const{facet:i}=this,r=i[n];return r?_r(r.sort)?[ky(r,r.sort,{expr:"datum"})]:N(r.sort)?[lu(r,n,{expr:"datum"})]:[X(r,{expr:"datum"})]:[]}facetSortOrder(n){const{facet:i}=this,r=i[n];if(r){const{sort:s}=r;return[(_r(s)?s.order:!N(s)&&s)||"ascending"]}return[]}assembleLabelTitle(){var s;const{facet:n,config:i}=this;if(n.facet)return xy(n.facet,"facet",i);const r={row:["top","bottom"],column:["left","right"]};for(const o of OE)if(n[o]){const a=cu("labelOrient",(s=n[o])==null?void 0:s.header,i,o);if(r[o].includes(a))return xy(n[o],o,i)}}assembleMarks(){const{child:n}=this,i=this.component.data.facetRoot,r=zue(i),s=n.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||n.assembleTitle(),a=n.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...a?{style:a}:{},from:{facet:this.assembleFacet()},sort:{field:Xn.map(l=>this.facetSortFields(l)).flat(),order:Xn.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...s?{encode:{update:s}}:{},...n.assembleGroup(soe(this,[]))}]}getMapping(){return this.facet}}function Yue(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(_r(s.sort)){const{field:o,op:a=fg}=s.sort;e=r=new ia(e,{joinaggregate:[{op:a,field:o,as:ky(s,s.sort,{forAs:!0})}],groupby:[X(s)]})}return r}return null}function M6(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((u||f)&&u!==f)){if(fc(e)&&fc(a)){if(Mn(e.values,a.values))return o}else if(ou(e)&&ou(a)){if(e.url===a.url)return o}else if(yN(e)&&e.name===o.dataName)return o}}return null}function Kue(e,t){if(e.data||!e.parent){if(e.data===null){const i=new Po({values:[]});return t.push(i),i}const n=M6(e.data,t);if(n)return vs(e.data)||(n.data.format=cM({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new Po(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Jue(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(Mse(r))o=e=new uu(e,r),s="derived";else if(wE(r)){const a=kae(r);o=e=Bt.makeWithAncestors(e,{},a,n)??e,e=new Ou(e,t,r.filter)}else if(dN(r))o=e=Yi.makeFromTransform(e,r,t),s="number";else if(Nse(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new Bt(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Vi.makeFromTransform(e,r);else if(Ise(r))o=e=bi.makeFromTransform(e,r),s="number",_E(t)&&(e=new _s(e));else if(fN(r))o=e=hc.make(e,t,r,i++),s="derived";else if(_se(r))o=e=new Mu(e,r),s="number";else if(Ose(r))o=e=new ia(e,r),s="number";else if(Lse(r))o=e=Rr.makeFromTransform(e,r),s="derived";else if(Pse(r))o=e=new Dg(e,r),s="derived";else if(Bse(r))o=e=new Fg(e,r),s="derived";else if(Rse(r))o=e=new kg(e,r),s="derived";else if(Sse(r))o=e=new Mg(e,r),s="derived";else if(Dse(r))e=new Tg(e,r);else if(Tse(r))o=e=mo.makeFromTransform(e,r),s="derived";else if(Cse(r))o=e=new $g(e,r),s="derived";else if($se(r))o=e=new Og(e,r),s="derived";else if(Fse(r))o=e=new Rg(e,r),s="derived";else if(kse(r))o=e=new _g(e,r),s="derived";else{W(ine(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function Ng(e){var m;let t=Kue(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(vs(r)||ou(r)||fc(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Jse;vs(r)?(bN(r)?t=new uf(t,r.sequence):SE(r)&&(t=new af(t,r.graticule)),o.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(o.parseNothing=!0),t=Bt.makeExplicit(t,e,o)??t,t=new _s(t);const a=e.parent&&Tu(e.parent);(Ve(e)||Pn(e))&&a&&(t=Yi.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Jue(t,e,o));const u=_ae(e),l=Dae(e);t=Bt.makeWithAncestors(t,{},{...u,...l},o)??t,Ve(e)&&(t=Ra.parseAll(t,e),t=dc.parseAll(t,e)),(Ve(e)||Pn(e))&&(a||(t=Yi.makeFromEncoding(t,e)??t),t=Vi.makeFromEncoding(t,e)??t,t=uu.parseAllForSortIndex(t,e));const c=t=Pf(Qe.Raw,e,t);if(Ve(e)){const y=bi.makeFromEncoding(t,e);y&&(t=y,_E(e)&&(t=new _s(t))),t=mo.makeFromEncoding(t,e)??t,t=Rr.makeFromEncoding(t,e)??t}let f,d;if(Ve(e)){const{markDef:y,mark:b,config:v}=e,x=De("invalid",y,v),{marks:E,scales:w}=d=xN({invalid:x,isPath:js(b)});E!==w&&w==="include-invalid-values"&&(f=t=Pf(Qe.PreFilterInvalid,e,t)),E==="exclude-invalid-values"&&(t=fu.make(t,e,d)??t)}const h=t=Pf(Qe.Main,e,t);let p;if(Ve(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=fu.make(t,e,d)??t,p=t=Pf(Qe.PostFilterInvalid,e,t))}Ve(e)&&Toe(e,h);let g=null;if(Pn(e)){const y=e.getName("facet");t=Yue(t,e.facet)??t,g=new Ru(t,e,y,h.getSource()),n[y]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:g,ancestorParse:o,preFilterInvalid:f,postFilterInvalid:p}}function Pf(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),o=new bn(n,s,e,r);return i[s]=o,o}class Que extends UE{constructor(n,i,r,s){var o,a,u,l;super(n,"concat",i,r,s,n.resolve);L(this,"children");(((a=(o=n.resolve)==null?void 0:o.axis)==null?void 0:a.x)==="shared"||((l=(u=n.resolve)==null?void 0:u.axis)==null?void 0:l.y)==="shared")&&W(ene),this.children=this.getChildren(n).map((c,f)=>VE(c,this,this.getName(`concat_${f}`),void 0,s))}parseData(){this.component.data=Ng(this);for(const n of this.children)n.parseData()}parseSelections(){this.component.selection={};for(const n of this.children){n.parseSelections();for(const i of z(n.component.selection))this.component.selection[i]=n.component.selection[i]}dt(this.component.selection).some(n=>Xi(n))&&B2(P2)}parseMarkGroup(){for(const n of this.children)n.parseMarkGroup()}parseAxesAndHeaders(){for(const n of this.children)n.parseAxesAndHeaders()}getChildren(n){return bg(n)?n.vconcat:EE(n)?n.hconcat:n.concat}parseLayoutSize(){Hue(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(n){return this.children.reduce((i,r)=>r.assembleSelectionTopLevelSignals(i),n)}assembleSignals(){return this.children.forEach(n=>n.assembleSignals()),[]}assembleLayoutSignals(){const n=ME(this);for(const i of this.children)n.push(...i.assembleLayoutSignals());return n}assembleSelectionData(n){return this.children.reduce((i,r)=>r.assembleSelectionData(i),n)}assembleMarks(){return this.children.map(n=>{const i=n.assembleTitle(),r=n.assembleGroupStyle(),s=n.assembleGroupEncodeEntry(!1);return{type:"group",name:n.getName("group"),...i?{title:i}:{},...r?{style:r}:{},...s?{encode:{update:s}}:{},...n.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const n=this.layout.columns;return{...n!=null?{columns:n}:{},bounds:"full",align:"each"}}}function Zue(e){return e===!1||e===null}const ele={disable:1,gridScale:1,scale:1,...TT,labelExpr:1,encode:1},T6=z(ele);class qE extends Xr{constructor(n={},i={},r=!1){super();L(this,"explicit");L(this,"implicit");L(this,"mainExtracted");this.explicit=n,this.implicit=i,this.mainExtracted=r}clone(){return new qE(le(this.explicit),le(this.implicit),this.mainExtracted)}hasAxisPart(n){return n==="axis"?!0:n==="grid"||n==="title"?!!this.get(n):!Zue(this.get(n))}hasOrientSignalRef(){return ne(this.explicit.orient)}}function tle(e,t,n){const{encoding:i,config:r}=e,s=mt(i[t])??mt(i[dr(t)]),o=e.axis(t)||{},{format:a,formatType:u}=o;if(No(u))return{text:mi({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(nu(s)==="quantitative"){if(iu(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:mi({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:mi({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(nu(s)==="temporal"&&r.timeFormatType&&j(s)&&!s.timeUnit)return{text:mi({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function nle(e){return Hr.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[lle(n,e)]),t),{})}const ile={bottom:"top",top:"bottom",left:"right",right:"left"};function rle(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of z(r.component.axes))n.axis[s]=TE(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=sle(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of Hr){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:u}=o.getWithExplicit("orient");if(!ne(a)){if(i[a]>0&&!u){const l=ile[a];i[a]>i[l]&&o.set("orient",l,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function sle(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const r=e[i],s=t[i];if(!!r!=!!s)return;if(r&&s){const o=r.getWithExplicit("orient"),a=s.getWithExplicit("orient");if(o.explicit&&a.explicit&&o.value!==a.value)return;e[i]=ole(r,s)}}}else return t.map(n=>n.clone());return e}function ole(e,t){for(const n of T6){const i=Ds(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return BM(r,s);case"gridScale":return{explicit:r.explicit,value:ct(r.value,s.value)}}return xg(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function ale(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(ne(n.labelAngle)?n.labelAngle:lc(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===QN(i,r))return!0}return e===n[t]}const ule=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function lle(e,t){var y,b;let n=t.axis(e);const i=new qE,r=mt(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((y=o[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=o.axis)==null?void 0:b.orient)||Woe(e),u=t.getScaleComponent(e).get("type"),l=Loe(e,u,a,t.config),c=n!==void 0?!n:by("disable",o.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=Uoe(r,n,e,o.style,l),d=xT(n.formatType,r,u),h=vT(r,r.type,n.format,n.formatType,o,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:s,config:o};for(const v of T6){const x=v in T$?T$[v](p):a$(v)?n[v]:void 0,E=x!==void 0,w=ale(x,v,n,t,e);if(E&&w)i.set(v,x,w);else{const{configValue:A=void 0,configFrom:C=void 0}=a$(v)&&v!=="values"?by(v,o.style,n.style,l):{},S=A!==void 0;E&&!S?i.set(v,x,w):(C!=="vgAxisConfig"||ule.has(v)&&S||sf(A)||ne(A))&&i.set(v,A,!1)}}const g=n.encoding??{},m=MT.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const E=r6(g[x]??{},t),w=x==="labels"?tle(t,e,E):E;return w!==void 0&&!Pe(w)&&(v[x]={update:w}),v},{});return Pe(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function cle({encoding:e,size:t}){for(const n of Hr){const i=Sn(n);nr(t[i])&&ps(e[n])&&(delete t[i],W(WM(i)))}return t}const fle={vgMark:"arc",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...Pr(e,"radius"),...Pr(e,"theta")})},dle={vgMark:"area",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Oh("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Oh("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...DE(e)})},hle={vgMark:"rect",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Pr(e,"x"),...Pr(e,"y")})},ple={vgMark:"shape",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&j(n)&&n.type===Du?{field:X(n,{expr:"datum"})}:{}}]}},gle={vgMark:"image",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Pr(e,"x"),...Pr(e,"y"),...$E(e,"url")})},mle={vgMark:"line",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...kt("size",e,{vgChannel:"strokeWidth"}),...DE(e)})},yle={vgMark:"trail",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...kt("size",e),...DE(e)})};function WE(e,t){const{config:n}=e;return{...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...kt("size",e),...kt("angle",e),...ble(e,n,t)}}function ble(e,t,n){return n?{shape:{value:n}}:kt("shape",e)}const vle={vgMark:"symbol",encodeEntry:e=>WE(e)},xle={vgMark:"symbol",encodeEntry:e=>WE(e,"circle")},Ele={vgMark:"symbol",encodeEntry:e=>WE(e,"square")},Ale={vgMark:"rect",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Pr(e,"x"),...Pr(e,"y")})},wle={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Oh("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Oh("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...kt("size",e,{vgChannel:"strokeWidth"})}}},Sle={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...si(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...$E(e),...kt("size",e,{vgChannel:"fontSize"}),...kt("angle",e),..._$("align",Cle(e.markDef,n,t)),..._$("baseline",$le(e.markDef,n,t)),...rn("radius",e,{defaultPos:null}),...rn("theta",e,{defaultPos:null})}}};function Cle(e,t,n){if(De("align",e,n)===void 0)return"center"}function $le(e,t,n){if(De("baseline",e,n)===void 0)return"middle"}const Fle={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",s=i==="horizontal"?"y":"x",o=i==="horizontal"?"height":"width";return{...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Pr(e,r),...rn(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[o]:je(De("thickness",n,t))}}},Bf={arc:fle,area:dle,bar:hle,circle:xle,geoshape:ple,image:gle,line:mle,point:vle,rect:Ale,rule:wle,square:Ele,text:Sle,tick:Fle,trail:yle};function kle(e){if(be([lg,ag,Oie],e.mark)){const t=zT(e.mark,e.encoding);if(t.length>0)return Dle(e,t)}else if(e.mark===ug){const t=ny.some(n=>De(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return _le(e)}return GE(e)}const K$="faceted_path_";function Dle(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:K$+e.requestDataName(Qe.Main),data:e.requestDataName(Qe.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:GE(e,{fromPrefix:K$})}]}const J$="stack_group_";function _le(e){var l;const[t]=GE(e,{fromPrefix:J$}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...Ya(t.encode.update,["y","yc","y2","height",...ny]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Ln(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...Ya(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Ln(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of ny){const f=er(c,e.markDef,e.config);t.encode.update[c]?(s[c]=t.encode.update[c],delete t.encode.update[c]):f&&(s[c]=je(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=X(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(X(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=er(f,e.markDef,e.config);return d!==void 0?{...c,[f]:je(d)}:c}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Qe.Main),name:J$+e.requestDataName(Qe.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function Ole(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!N(o)&&Ai(o)&&ey(o.value)||!o&&ey(De("order",r,s)))){if((N(o)||j(o))&&!n)return IM(o,{expr:"datum"});if(js(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(j(u))return{field:a}}}}function GE(e,t={fromPrefix:""}){var h;const{mark:n,markDef:i,encoding:r,config:s}=e,o=ct(i.clip,Rle(e),Mle(e)),a=TM(i),u=r.key,l=Ole(e),c=Tle(e);c&&Object.values(e.component.selection).some(p=>p.type==="point"&&!p.bind&&p.on!=="pointerover")&&((h=e.markDef).cursor??(h.cursor="pointer"));const f=De("aria",i,s),d=Bf[n].postEncodingTransform?Bf[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Bf[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Qe.Main)},encode:{update:Bf[n].encodeEntry(e)},...d?{transform:d}:{}}]}function Rle(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Mle(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function Tle(e){if(!e.component.selection)return null;const t=z(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=z(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class N6 extends _6{constructor(n,i,r,s={},o){super(n,"unit",i,r,o,void 0,l$(n)?n.view:void 0);L(this,"markDef");L(this,"encoding");L(this,"specifiedScales",{});L(this,"stack");L(this,"specifiedAxes",{});L(this,"specifiedLegends",{});L(this,"specifiedProjection",{});L(this,"selection",[]);L(this,"children",[]);L(this,"correctDataNames",n=>{var i,r,s;return(i=n.from)!=null&&i.data&&(n.from.data=this.lookupDataSource(n.from.data),"time"in this.encoding&&(n.from.data=n.from.data+AN)),(s=(r=n.from)==null?void 0:r.facet)!=null&&s.data&&(n.from.facet.data=this.lookupDataSource(n.from.facet.data)),n});const a=tr(n.mark)?{...n.mark}:{type:n.mark},u=a.type;a.filled===void 0&&(a.filled=hse(a,o,{graticule:n.data&&SE(n.data)}));const l=this.encoding=yre(n.encoding||{},u,a.filled,o);this.markDef=aN(a,l,o),this.size=cle({encoding:l,size:l$(n)?{...s,...n.width!==void 0?{width:n.width}:{},...n.height!==void 0?{height:n.height}:{}}:s}),this.stack=oN(this.markDef,l),this.specifiedScales=this.initScales(u,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=n.projection,this.selection=(n.params??[]).filter(c=>vE(c)),this.alignStackOrderWithColorDomain()}get hasProjection(){const{encoding:n}=this,i=this.mark===dT,r=n&&lte.some(s=>ce(n[s]));return i||r}scaleDomain(n){const i=this.specifiedScales[n];return i?i.domain:void 0}axis(n){return this.specifiedAxes[n]}legend(n){return this.specifiedLegends[n]}initScales(n,i){return T2.reduce((r,s)=>{const o=mt(i[s]);return o&&(r[s]=this.initScale(o.scale??{})),r},{})}initScale(n){const{domain:i,range:r}=n,s=$t(n);return N(i)&&(s.domain=i.map(_n)),N(r)&&(s.range=r.map(_n)),s}initAxes(n){return Hr.reduce((i,r)=>{const s=n[r];if(ce(s)||r===qe&&ce(n.x2)||r===yt&&ce(n.y2)){const o=ce(s)?s.axis:void 0;i[r]=o&&this.initAxis({...o})}return i},{})}initAxis(n){const i=z(n),r={};for(const s of i){const o=n[s];r[s]=sf(o)?MM(o):_n(o)}return r}initLegends(n){return xte.reduce((i,r)=>{const s=mt(n[r]);if(s&&Ate(r)){const o=s.legend;i[r]=o&&$t(o)}return i},{})}alignStackOrderWithColorDomain(){var m;const{color:n,fill:i,order:r,xOffset:s,yOffset:o}=this.encoding,a=i||n,u=j(a)?a:void 0,l=u==null?void 0:u.field,c=u==null?void 0:u.scale,f=u==null?void 0:u.type,d=c==null?void 0:c.domain,h=s||o,p=j(h)?h:void 0,g=`_${l}_sort_index`;if(!r&&Array.isArray(d)&&typeof l=="string"&&f==="nominal")if(p&&!p.sort)p.sort=d;else{if(!this.stack)return;const y=`indexof(${H(d)}, datum['${l}'])`,b=((m=this.markDef)==null?void 0:m.orient)==="horizontal"?"ascending":"descending";this.transforms.push({calculate:y,as:g}),this.encoding.order={field:g,type:"quantitative",sort:b}}}parseData(){this.component.data=Ng(this)}parseLayoutSize(){Vue(this)}parseSelections(){this.component.selection=Moe(this,this.selection)}parseMarkGroup(){this.component.mark=kle(this)}parseAxesAndHeaders(){this.component.axes=nle(this)}assembleSelectionTopLevelSignals(n){return ooe(this,n)}assembleSignals(){return[...YN(this),...roe(this,[])]}assembleSelectionData(n){return aoe(this,n)}assembleLayout(){return null}assembleLayoutSignals(){return ME(this)}assembleMarks(){let n=this.component.mark??[];return(!this.parent||!Tu(this.parent))&&(n=$N(this,n)),n.map(this.correctDataNames)}assembleGroupStyle(){const{style:n}=this.view||{};return n!==void 0?n:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(n){return po(this.encoding,n)}fieldDef(n){const i=this.encoding[n];return wi(i)}typedFieldDef(n){const i=this.fieldDef(n);return ln(i)?i:null}}class HE extends UE{constructor(n,i,r,s,o){super(n,"layer",i,r,o,n.resolve,n.view);L(this,"children");const a={...s,...n.width?{width:n.width}:{},...n.height?{height:n.height}:{}};this.children=n.layer.map((u,l)=>{if(vg(u))return new HE(u,this,this.getName(`layer_${l}`),a,o);if(Vr(u))return new N6(u,this,this.getName(`layer_${l}`),a,o);throw new Error(I2(u))})}parseData(){this.component.data=Ng(this);for(const n of this.children)n.parseData()}parseLayoutSize(){Gue(this)}parseSelections(){this.component.selection={};for(const n of this.children){n.parseSelections();for(const i of z(n.component.selection))this.component.selection[i]=n.component.selection[i]}dt(this.component.selection).some(n=>Xi(n))&&B2(P2)}parseMarkGroup(){for(const n of this.children)n.parseMarkGroup()}parseAxesAndHeaders(){rle(this)}assembleSelectionTopLevelSignals(n){return this.children.reduce((i,r)=>r.assembleSelectionTopLevelSignals(i),n)}assembleSignals(){return this.children.reduce((n,i)=>n.concat(i.assembleSignals()),YN(this))}assembleLayoutSignals(){return this.children.reduce((n,i)=>n.concat(i.assembleLayoutSignals()),ME(this))}assembleSelectionData(n){return this.children.reduce((i,r)=>r.assembleSelectionData(i),n)}assembleGroupStyle(){const n=new Set;for(const r of this.children)for(const s of J(r.assembleGroupStyle()))n.add(s);const i=Array.from(n);return i.length>1?i:i.length===1?i[0]:void 0}assembleTitle(){let n=super.assembleTitle();if(n)return n;for(const i of this.children)if(n=i.assembleTitle(),n)return n}assembleLayout(){return null}assembleMarks(){return uoe(this,this.children.flatMap(n=>n.assembleMarks()))}assembleLegends(){return this.children.reduce((n,i)=>n.concat(i.assembleLegends()),m6(this))}}function VE(e,t,n,i,r){if(dg(e))return new zl(e,t,n,r);if(vg(e))return new HE(e,t,n,i,r);if(Vr(e))return new N6(e,t,n,i,r);if(Ure(e))return new Que(e,t,n,r);throw new Error(I2(e))}function Nle(e,t={}){t.logger&&Gne(t.logger),t.fieldTitle&&_T(t.fieldTitle);try{const n=sN(gu(t.config,e.config)),i=gN(e,n),r=VE(i,null,"",void 0,n);return r.parse(),Gae(r.component.data,r),{spec:Lle(r,Ile(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Hne(),t.fieldTitle&&ure()}}function Ile(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):K(t)&&(t={type:t}),r&&s&&Xse(t.type)){if(r==="step"&&s==="step")W(VC()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";W(VC(tg(o)));const a=o==="width"?"height":"width";t.type=Yse(a)}}return{...z(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...E$(n,!1),...E$(e,!0)}}function Lle(e,t,n={},i){const r=e.config?tse(e.config):void 0,s=Uue(e.component.data,n),o=e.assembleSelectionData(s),a=e.assembleProjections(),u=e.assembleTitle(),l=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v6.json",...e.description?{description:e.description}:{},...h,...u?{title:u}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...tN(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Ple=ite.version,Ble=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Qa,accessPathWithDatum:$2,accessWithDatumToUnescapedPath:_e,compile:Nle,contains:be,deepEqual:Mn,deleteNestedProperty:Ah,duplicate:le,entries:Fs,every:w2,fieldIntersection:C2,flatAccessWithDatum:dM,getFirstDefined:ct,hasIntersection:S2,hasProperty:q,hash:pe,internalField:mM,isBoolean:Ja,isEmpty:Pe,isEqual:ste,isInternalField:yM,isNullOrFalse:ey,isNumeric:Yp,isPrimitive:Eh,keys:z,logicalExpr:Pl,mergeDeep:cM,never:lM,normalize:gN,normalizeAngle:lc,omit:Ln,pick:Ya,prefixGenerator:ty,removePathFromField:Fu,replaceAll:Do,replacePathInField:ti,resetIdCounter:ate,setEqual:fM,some:Ka,stringify:Te,titleCase:Vc,unescapeSingleQuoteAndPathDot:hM,unique:Rn,uniqueId:gM,vals:dt,varName:Xe,version:Ple},Symbol.toStringTag,{value:"Module"}));function I6(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var zle="3.0.0",Ule={version:zle};const pa="#fff",Q$="#888",jle={background:"#333",view:{stroke:Q$},title:{color:pa,subtitleColor:pa},style:{"guide-label":{fill:pa},"guide-title":{fill:pa}},axis:{domainColor:pa,gridColor:Q$,tickColor:pa}},Hs="#4572a7",qle={background:"#fff",arc:{fill:Hs},area:{fill:Hs},line:{stroke:Hs,strokeWidth:2},path:{stroke:Hs},rect:{fill:Hs},shape:{stroke:Hs},symbol:{fill:Hs,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},Vs="#30a2da",Q0="#cbcbcb",Wle="#999",Gle="#333",Z$="#f0f0f0",eF="#333",Hle={arc:{fill:Vs},area:{fill:Vs},axis:{domainColor:Q0,grid:!0,gridColor:Q0,gridWidth:1,labelColor:Wle,labelFontSize:10,titleColor:Gle,tickColor:Q0,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Z$,group:{fill:Z$},legend:{labelColor:eF,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:eF,titleFontSize:14,titlePadding:10},line:{stroke:Vs,strokeWidth:2},path:{stroke:Vs,strokeWidth:.5},rect:{fill:Vs},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:Vs},bar:{binSpacing:2,fill:Vs,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Xs="#000",Vle={group:{fill:"#e5e5e5"},arc:{fill:Xs},area:{fill:Xs},line:{stroke:Xs},path:{stroke:Xs},rect:{fill:Xs},shape:{stroke:Xs},symbol:{fill:Xs,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Xle=22,Yle="normal",tF="Benton Gothic, sans-serif",nF=11.5,Kle="normal",Ys="#82c6df",Z0="Benton Gothic Bold, sans-serif",iF="normal",rF=13,el={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},Jle={background:"#ffffff",title:{anchor:"start",color:"#000000",font:Z0,fontSize:Xle,fontWeight:Yle},arc:{fill:Ys},area:{fill:Ys},line:{stroke:Ys,strokeWidth:2},path:{stroke:Ys},rect:{fill:Ys},shape:{stroke:Ys},symbol:{fill:Ys,size:30},axis:{labelFont:tF,labelFontSize:nF,labelFontWeight:Kle,titleFont:Z0,titleFontSize:rF,titleFontWeight:iF},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:tF,labelFontSize:nF,symbolType:"square",titleFont:Z0,titleFontSize:rF,titleFontWeight:iF},range:{category:el["category-6"],diverging:el["fireandice-6"],heatmap:el["fire-7"],ordinal:el["fire-7"],ramp:el["fire-7"]}},Ks="#ab5787",zf="#979797",Qle={background:"#f9f9f9",arc:{fill:Ks},area:{fill:Ks},line:{stroke:Ks},path:{stroke:Ks},rect:{fill:Ks},shape:{stroke:Ks},symbol:{fill:Ks,size:30},axis:{domainColor:zf,domainWidth:.5,gridWidth:.2,labelColor:zf,tickColor:zf,tickWidth:.2,titleColor:zf},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Js="#3e5c69",Zle={background:"#fff",arc:{fill:Js},area:{fill:Js},line:{stroke:Js},path:{stroke:Js},rect:{fill:Js},shape:{stroke:Js},symbol:{fill:Js},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},jn="#1696d2",sF="#000000",ece="#FFFFFF",Uf="Lato",em="Lato",tce="Lato",nce="#DEDDDD",ice=18,tl={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},rce={background:ece,title:{anchor:"start",fontSize:ice,font:Uf},axisX:{domain:!0,domainColor:sF,domainWidth:1,grid:!1,labelFontSize:12,labelFont:em,labelAngle:0,tickColor:sF,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Uf},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:nce,gridWidth:1,labelFontSize:12,labelFont:em,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Uf,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:em,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Uf,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:tl["six-groups-cat-1"],diverging:tl["diverging-colors"],heatmap:tl["diverging-colors"],ordinal:tl["six-groups-seq"],ramp:tl["shades-blue"]},area:{fill:jn},rect:{fill:jn},line:{color:jn,stroke:jn,strokeWidth:5},trail:{color:jn,stroke:jn,strokeWidth:0,size:1},path:{stroke:jn,strokeWidth:.5},point:{filled:!0},text:{font:tce,color:jn,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:jn,stroke:null}},arc:{fill:jn},shape:{stroke:jn},symbol:{fill:jn,size:30}},Qs="#3366CC",oF="#ccc",jf="Arial, sans-serif",sce={arc:{fill:Qs},area:{fill:Qs},path:{stroke:Qs},rect:{fill:Qs},shape:{stroke:Qs},symbol:{stroke:Qs},circle:{fill:Qs},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:jf,fontSize:12},"guide-title":{font:jf,fontSize:12},"group-title":{font:jf,fontSize:12}},title:{font:jf,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:oF,tickColor:oF,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},XE=e=>e*(1/3+1),aF=XE(9),uF=XE(10),lF=XE(12),nl="Segoe UI",cF="wf_standard-font, helvetica, arial, sans-serif",fF="#252423",il="#605E5C",dF="transparent",oce="#C8C6C4",ui="#118DFF",ace="#12239E",uce="#E66C37",lce="#6B007B",cce="#E044A7",fce="#744EC2",dce="#D9B300",hce="#D64550",L6=ui,P6="#DEEFFF",hF=[P6,L6],pce=[P6,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",L6],gce={view:{stroke:dF},background:dF,font:nl,header:{titleFont:cF,titleFontSize:lF,titleColor:fF,labelFont:nl,labelFontSize:uF,labelColor:il},axis:{ticks:!1,grid:!1,domain:!1,labelColor:il,labelFontSize:aF,titleFont:cF,titleColor:fF,titleFontSize:lF,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:oce,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:ui},line:{stroke:ui,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:nl,fontSize:aF,fill:il},arc:{fill:ui},area:{fill:ui,line:!0,opacity:.6},path:{stroke:ui},rect:{fill:ui},point:{fill:ui,filled:!0,size:75},shape:{stroke:ui},symbol:{fill:ui,strokeWidth:1.5,size:50},legend:{titleFont:nl,titleFontWeight:"bold",titleColor:il,labelFont:nl,labelFontSize:uF,labelColor:il,symbolType:"circle",symbolSize:75},range:{category:[ui,ace,uce,lce,cce,fce,dce,hce],diverging:hF,heatmap:hF,ordinal:pce}},tm='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',mce='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',nm=400,qf={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},yce=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],bce=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Ig({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=qf.gridBg[e],r=qf.textPrimary[e],s=qf.textSecondary[e],o=n==="dark"?yce:bce,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:tm,fontWeight:600},axis:{labelColor:s,labelFontSize:12,labelFont:mce,labelFontWeight:nm,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:qf.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:tm,fill:s,fontWeight:nm},"guide-title":{font:tm,fill:s,fontWeight:nm}},range:{category:o,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const vce=Ig({theme:"white",background:"#ffffff"}),xce=Ig({theme:"g10",background:"#f4f4f4"}),Ece=Ig({theme:"g90",background:"#262626"}),Ace=Ig({theme:"g100",background:"#161616"}),wce=Ule.version,Sce=Object.freeze(Object.defineProperty({__proto__:null,carbong10:xce,carbong100:Ace,carbong90:Ece,carbonwhite:vce,dark:jle,excel:qle,fivethirtyeight:Hle,ggplot2:Vle,googlecharts:sce,latimes:Jle,powerbi:gce,quartz:Qle,urbaninstitute:rce,version:wce,vox:Zle},Symbol.toStringTag,{value:"Module"}));function Cce(e,t,n,i){if(N(e))return`[${e.map(r=>t(K(r)?r:pF(r,n))).join(", ")}]`;if(Y(e)){let r="";const{title:s,image:o,...a}=e;s&&(r+=`<h2>${t(s)}</h2>`),o&&(r+=`<img src="${new URL(t(o),i||location.href).href}">`);const u=Object.keys(a);if(u.length>0){r+="<table>";for(const l of u){let c=a[l];c!==void 0&&(Y(c)&&(c=pF(c,n)),r+=`<tr><td class="key">${t(l)}</td><td class="value">${t(c)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)}function $ce(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function pF(e,t){return JSON.stringify(e,$ce(t))}var Fce=`#vg-tooltip-element {
18
+ visibility: hidden;
19
+ padding: 8px;
20
+ position: fixed;
21
+ z-index: 1000;
22
+ font-family: sans-serif;
23
+ font-size: 11px;
24
+ border-radius: 3px;
25
+ box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
26
+ white-space: pre-line;
27
+ }
28
+ #vg-tooltip-element.visible {
29
+ visibility: visible;
30
+ }
31
+ #vg-tooltip-element h2 {
32
+ margin-top: 0;
33
+ margin-bottom: 10px;
34
+ font-size: 13px;
35
+ }
36
+ #vg-tooltip-element table {
37
+ border-spacing: 0;
38
+ }
39
+ #vg-tooltip-element table tr {
40
+ border: none;
41
+ }
42
+ #vg-tooltip-element table tr td {
43
+ overflow: hidden;
44
+ text-overflow: ellipsis;
45
+ padding-top: 2px;
46
+ padding-bottom: 2px;
47
+ vertical-align: text-top;
48
+ }
49
+ #vg-tooltip-element table tr td.key {
50
+ color: #808080;
51
+ max-width: 150px;
52
+ text-align: right;
53
+ padding-right: 4px;
54
+ }
55
+ #vg-tooltip-element table tr td.value {
56
+ display: block;
57
+ max-width: 300px;
58
+ max-height: 7em;
59
+ text-align: left;
60
+ }
61
+ #vg-tooltip-element {
62
+ /* The default theme is the light theme. */
63
+ background-color: rgba(255, 255, 255, 0.95);
64
+ border: 1px solid #d9d9d9;
65
+ color: black;
66
+ }
67
+ #vg-tooltip-element.dark-theme {
68
+ background-color: rgba(32, 32, 32, 0.9);
69
+ border: 1px solid #f5f5f5;
70
+ color: white;
71
+ }
72
+ #vg-tooltip-element.dark-theme td.key {
73
+ color: #bfbfbf;
74
+ }
75
+ `;const B6="vg-tooltip-element",kce={offsetX:10,offsetY:10,id:B6,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Dce,maxDepth:2,formatTooltip:Cce,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function Dce(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function _ce(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Fce.toString().replaceAll(B6,e)}function z6(e,t,{offsetX:n,offsetY:i}){const r=U6({x1:e.clientX,x2:e.clientX,y1:e.clientY,y2:e.clientY},t,n,i),s=["bottom-right","bottom-left","top-right","top-left"];for(const o of s)if(j6(r[o],t))return r[o];return r["top-left"]}function Oce(e,t,n,i,r){const{position:s,offsetX:o,offsetY:a}=r,u=e._el.getBoundingClientRect(),l=e._origin,c=Rce(u,l,n),f=U6(c,i,o,a),d=Array.isArray(s)?s:[s];for(const h of d)if(j6(f[h],i)&&!Mce(t,f[h],i))return f[h];return z6(t,i,r)}function Rce(e,t,n){const i=n.isVoronoi?n.datum.bounds:n.bounds;let r=e.left+t[0]+i.x1,s=e.top+t[1]+i.y1,o=n;for(;o.mark.group;)o=o.mark.group,r+=o.x??0,s+=o.y??0;const a=i.x2-i.x1,u=i.y2-i.y1;return{x1:r,x2:r+a,y1:s,y2:s+u}}function U6(e,t,n,i){const r=(e.x1+e.x2)/2,s=(e.y1+e.y2)/2,o=e.x1-t.width-n,a=r-t.width/2,u=e.x2+n,l=e.y1-t.height-i,c=s-t.height/2,f=e.y2+i;return{top:{x:a,y:l},bottom:{x:a,y:f},left:{x:o,y:c},right:{x:u,y:c},"top-left":{x:o,y:l},"top-right":{x:u,y:l},"bottom-left":{x:o,y:f},"bottom-right":{x:u,y:f}}}function j6(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function Mce(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class Tce{constructor(t){L(this,"call");L(this,"options");L(this,"el");this.options={...kce,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=_ce(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=this.options.anchor==="mark"?Oce(t,n,i,this.el.getBoundingClientRect(),this.options):z6(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}var im={};/*!
76
+ * https://github.com/Starcounter-Jack/JSON-Patch
77
+ * (c) 2017-2022 Joachim Wester
78
+ * MIT licensed
79
+ */var Nce=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ice=Object.prototype.hasOwnProperty;function Dy(e,t){return Ice.call(e,t)}function _y(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)Dy(e,r)&&i.push(r);return i}function Tn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Oy(e){for(var t=0,n=e.length,i;t<n;){if(i=e.charCodeAt(t),i>=48&&i<=57){t++;continue}return!1}return!0}function eo(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function q6(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Ry(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(Ry(e[t]))return!0}else if(typeof e=="object"){for(var i=_y(e),r=i.length,s=0;s<r;s++)if(Ry(e[i[s]]))return!0}}return!1}function gF(e,t){var n=[e];for(var i in t){var r=typeof t[i]=="object"?JSON.stringify(t[i],null,2):t[i];typeof r<"u"&&n.push(i+": "+r)}return n.join(`
80
+ `)}var W6=function(e){Nce(t,e);function t(n,i,r,s,o){var a=this.constructor,u=e.call(this,gF(n,{name:i,index:r,operation:s,tree:o}))||this;return u.name=i,u.index=r,u.operation=s,u.tree=o,Object.setPrototypeOf(u,a.prototype),u.message=gF(n,{name:i,index:r,operation:s,tree:o}),u}return t}(Error),et=W6,Lce=Tn,wa={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=Nh(n,this.path);i&&(i=Tn(i));var r=yo(n,{op:"remove",path:this.from}).removed;return yo(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=Nh(n,this.from);return yo(n,{op:"add",path:this.path,value:Tn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:pc(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Pce={add:function(e,t,n){return Oy(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var i=e.splice(t,1);return{newDocument:n,removed:i[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:wa.move,copy:wa.copy,test:wa.test,_get:wa._get};function Nh(e,t){if(t=="")return e;var n={op:"_get",path:t};return yo(e,n),n.value}function yo(e,t,n,i,r,s){if(n===void 0&&(n=!1),i===void 0&&(i=!0),r===void 0&&(r=!0),s===void 0&&(s=0),n&&(typeof n=="function"?n(t,0,e,t.path):Ih(t,0)),t.path===""){var o={newDocument:e};if(t.op==="add")return o.newDocument=t.value,o;if(t.op==="replace")return o.newDocument=t.value,o.removed=e,o;if(t.op==="move"||t.op==="copy")return o.newDocument=Nh(e,t.from),t.op==="move"&&(o.removed=e),o;if(t.op==="test"){if(o.test=pc(e,t.value),o.test===!1)throw new et("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o.newDocument=e,o}else{if(t.op==="remove")return o.removed=e,o.newDocument=null,o;if(t.op==="_get")return t.value=e,o;if(n)throw new et("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return o}}else{i||(e=Tn(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,p=void 0;for(typeof n=="function"?p=n:p=Ih;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=q6(h)),r&&(h=="__proto__"||h=="prototype"&&c>0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!Oy(h))throw new et("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);Oy(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new et("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=Pce[t.op].call(t,l,h,e);if(o.test===!1)throw new et("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=wa[t.op].call(t,l,h,e);if(o.test===!1)throw new et("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new et("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}function Lg(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new et("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Tn(e));for(var s=new Array(t.length),o=0,a=t.length;o<a;o++)s[o]=yo(e,t[o],n,!0,r,o),e=s[o].newDocument;return s.newDocument=e,s}function Bce(e,t,n){var i=yo(e,t);if(i.test===!1)throw new et("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function Ih(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new et("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(wa[e.op]){if(typeof e.path!="string")throw new et("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new et('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new et("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new et("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Ry(e.value))throw new et("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new et("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new et("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=G6([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new et("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new et("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function G6(e,t,n){try{if(!Array.isArray(e))throw new et("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Lg(Tn(t),Tn(e),n||!0);else{n=n||Ih;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof et)return r;throw r}}function pc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),i=Array.isArray(t),r,s,o;if(n&&i){if(s=e.length,s!=t.length)return!1;for(r=s;r--!==0;)if(!pc(e[r],t[r]))return!1;return!0}if(n!=i)return!1;var a=Object.keys(e);if(s=a.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!t.hasOwnProperty(a[r]))return!1;for(r=s;r--!==0;)if(o=a[r],!pc(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var zce=Object.freeze({__proto__:null,JsonPatchError:et,_areEquals:pc,applyOperation:yo,applyPatch:Lg,applyReducer:Bce,deepClone:Lce,getValueByPointer:Nh,validate:G6,validator:Ih});/*!
81
+ * https://github.com/Starcounter-Jack/JSON-Patch
82
+ * (c) 2017-2021 Joachim Wester
83
+ * MIT license
84
+ */var YE=new WeakMap,Uce=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),jce=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function qce(e){return YE.get(e)}function Wce(e,t){return e.observers.get(t)}function Gce(e,t){e.observers.delete(t.callback)}function Hce(e,t){t.unobserve()}function Vce(e,t){var n=[],i,r=qce(e);if(!r)r=new Uce(e),YE.set(e,r);else{var s=Wce(r,t);i=s&&s.observer}if(i)return i;if(i={},r.value=Tn(e),t){i.callback=t,i.next=null;var o=function(){My(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){My(i),clearTimeout(i.next),Gce(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new jce(t,i)),i}function My(e,t){t===void 0&&(t=!1);var n=YE.get(e.object);KE(n.value,e.object,e.patches,"",t),e.patches.length&&Lg(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function KE(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=_y(t),o=_y(e),a=!1,u=o.length-1;u>=0;u--){var l=o[u],c=e[l];if(Dy(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?KE(c,f,n,i+"/"+eo(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+eo(l),value:Tn(c)}),n.push({op:"replace",path:i+"/"+eo(l),value:Tn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+eo(l),value:Tn(c)}),n.push({op:"remove",path:i+"/"+eo(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var u=0;u<s.length;u++){var l=s[u];!Dy(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+eo(l),value:Tn(t[l])})}}}function Xce(e,t,n){n===void 0&&(n=!1);var i=[];return KE(e,t,i,"",n),i}var Yce=Object.freeze({__proto__:null,compare:Xce,generate:My,observe:Vce,unobserve:Hce});Object.assign({},zce,Yce,{JsonPatchError:W6,deepClone:Tn,escapePathComponent:eo,unescapePathComponent:q6});function Kce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rm,mF;function Jce(){if(mF)return rm;mF=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const i=this.map.get(n);if(i!==void 0)return this.map.delete(n),this.map.set(n,i),i}delete(n){return this.map.delete(n)}set(n,i){if(!this.delete(n)&&i!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,i)}return this}}return rm=e,rm}var sm,yF;function JE(){if(yF)return sm;yF=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return sm=i=>i?typeof i!="object"?e:i:t,sm}var Wf={exports:{}},om,bF;function QE(){if(bF)return om;bF=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return om={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},om}var am,vF;function Pg(){return vF||(vF=1,am=typeof process=="object"&&im&&im.NODE_DEBUG&&/\bsemver\b/i.test(im.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),am}var xF;function ZE(){return xF||(xF=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=QE(),s=Pg();t=e.exports={};const o=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],c=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",r],[d,i]],p=m=>{for(const[y,b]of h)m=m.split(`${y}*`).join(`${y}{0,${b}}`).split(`${y}+`).join(`${y}{1,${b}}`);return m},g=(m,y,b)=>{const v=p(y),x=f++;s(m,x,y),c[m]=x,u[x]=y,l[x]=v,o[x]=new RegExp(y,b?"g":void 0),a[x]=new RegExp(v,b?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${u[c.PRERELEASEIDENTIFIER]}(?:\\.${u[c.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[c.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${u[c.BUILDIDENTIFIER]}(?:\\.${u[c.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[c.MAINVERSION]}${u[c.PRERELEASE]}?${u[c.BUILD]}?`),g("FULL",`^${u[c.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[c.MAINVERSIONLOOSE]}${u[c.PRERELEASELOOSE]}?${u[c.BUILD]}?`),g("LOOSE",`^${u[c.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[c.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:${u[c.PRERELEASE]})?${u[c.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:${u[c.PRERELEASELOOSE]})?${u[c.BUILD]}?)?)?`),g("XRANGE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[c.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[c.COERCEPLAIN]+`(?:${u[c.PRERELEASE]})?(?:${u[c.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[c.COERCE],!0),g("COERCERTLFULL",u[c.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[c.LONECARET]}${u[c.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[c.LONECARET]}${u[c.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[c.GTLT]}\\s*(${u[c.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]}|${u[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[c.XRANGEPLAIN]})\\s+-\\s+(${u[c.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[c.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Wf,Wf.exports)),Wf.exports}var um,EF;function Qce(){if(EF)return um;EF=1;const e=/^[0-9]+$/,t=(i,r)=>{if(typeof i=="number"&&typeof r=="number")return i===r?0:i<r?-1:1;const s=e.test(i),o=e.test(r);return s&&o&&(i=+i,r=+r),i===r?0:s&&!o?-1:o&&!s?1:i<r?-1:1};return um={compareIdentifiers:t,rcompareIdentifiers:(i,r)=>t(r,i)},um}var lm,AF;function eA(){if(AF)return lm;AF=1;const e=Pg(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=QE(),{safeRe:i,t:r}=ZE(),s=JE(),{compareIdentifiers:o}=Qce();class a{constructor(l,c){if(c=s(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=l.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h<n)return h}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof a)){if(typeof l=="string"&&l===this.version)return 0;l=new a(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof a||(l=new a(l,this.options)),this.major<l.major?-1:this.major>l.major?1:this.minor<l.minor?-1:this.minor>l.minor?1:this.patch<l.patch?-1:this.patch>l.patch?1:0}comparePre(l){if(l instanceof a||(l=new a(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let c=0;do{const f=this.prerelease[c],d=l.prerelease[c];if(e("prerelease compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return o(f,d)}while(++c)}compareBuild(l){l instanceof a||(l=new a(l,this.options));let c=0;do{const f=this.build[c],d=l.build[c];if(e("build compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return o(f,d)}while(++c)}inc(l,c,f){if(l.startsWith("pre")){if(!c&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(c){const d=`-${c}`.match(this.options.loose?i[r.PRERELEASELOOSE]:i[r.PRERELEASE]);if(!d||d[1]!==c)throw new Error(`invalid identifier: ${c}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,f),this.inc("pre",c,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,f),this.inc("pre",c,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),o(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return lm=a,lm}var cm,wF;function Nu(){if(wF)return cm;wF=1;const e=eA();return cm=(n,i,r)=>new e(n,r).compare(new e(i,r)),cm}var fm,SF;function Zce(){if(SF)return fm;SF=1;const e=Nu();return fm=(n,i,r)=>e(n,i,r)===0,fm}var dm,CF;function efe(){if(CF)return dm;CF=1;const e=Nu();return dm=(n,i,r)=>e(n,i,r)!==0,dm}var hm,$F;function tfe(){if($F)return hm;$F=1;const e=Nu();return hm=(n,i,r)=>e(n,i,r)>0,hm}var pm,FF;function nfe(){if(FF)return pm;FF=1;const e=Nu();return pm=(n,i,r)=>e(n,i,r)>=0,pm}var gm,kF;function ife(){if(kF)return gm;kF=1;const e=Nu();return gm=(n,i,r)=>e(n,i,r)<0,gm}var mm,DF;function rfe(){if(DF)return mm;DF=1;const e=Nu();return mm=(n,i,r)=>e(n,i,r)<=0,mm}var ym,_F;function sfe(){if(_F)return ym;_F=1;const e=Zce(),t=efe(),n=tfe(),i=nfe(),r=ife(),s=rfe();return ym=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return i(a,l,c);case"<":return r(a,l,c);case"<=":return s(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},ym}var bm,OF;function ofe(){if(OF)return bm;OF=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}bm=t;const n=JE(),{safeRe:i,t:r}=ZE(),s=sfe(),o=Pg(),a=eA(),u=H6();return bm}var vm,RF;function H6(){if(RF)return vm;RF=1;const e=/\s+/g;class t{constructor($,D){if(D=r(D),$ instanceof t)return $.loose===!!D.loose&&$.includePrerelease===!!D.includePrerelease?$:new t($.raw,D);if($ instanceof s)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=D,this.loose=!!D.loose,this.includePrerelease=!!D.includePrerelease,this.raw=$.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(G=>!g(G[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const G of this.set)if(G.length===1&&m(G[0])){this.set=[G];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){$>0&&(this.formatted+="||");const D=this.set[$];for(let I=0;I<D.length;I++)I>0&&(this.formatted+=" "),this.formatted+=D[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){const I=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+$,G=i.get(I);if(G)return G;const B=this.options.loose,Z=B?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];$=$.replace(Z,P(this.options.includePrerelease)),o("hyphen replace",$),$=$.replace(u[l.COMPARATORTRIM],c),o("comparator trim",$),$=$.replace(u[l.TILDETRIM],f),o("tilde trim",$),$=$.replace(u[l.CARETTRIM],d),o("caret trim",$);let fe=$.split(" ").map(ke=>b(ke,this.options)).join(" ").split(/\s+/).map(ke=>k(ke,this.options));B&&(fe=fe.filter(ke=>(o("loose invalid filter",ke,this.options),!!ke.match(u[l.COMPARATORLOOSE])))),o("range list",fe);const ue=new Map,xe=fe.map(ke=>new s(ke,this.options));for(const ke of xe){if(g(ke))return[ke];ue.set(ke.value,ke)}ue.size>1&&ue.has("")&&ue.delete("");const ot=[...ue.values()];return i.set(I,ot),ot}intersects($,D){if(!($ instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>y(I,D)&&$.set.some(G=>y(G,D)&&I.every(B=>G.every(Z=>B.intersects(Z,D)))))}test($){if(!$)return!1;if(typeof $=="string")try{$=new a($,this.options)}catch{return!1}for(let D=0;D<this.set.length;D++)if(U(this.set[D],$,this.options))return!0;return!1}}vm=t;const n=Jce(),i=new n,r=JE(),s=ofe(),o=Pg(),a=eA(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:f,caretTrimReplace:d}=ZE(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=QE(),g=_=>_.value==="<0.0.0-0",m=_=>_.value==="",y=(_,$)=>{let D=!0;const I=_.slice();let G=I.pop();for(;D&&I.length;)D=I.every(B=>G.intersects(B,$)),G=I.pop();return D},b=(_,$)=>(_=_.replace(u[l.BUILD],""),o("comp",_,$),_=w(_,$),o("caret",_),_=x(_,$),o("tildes",_),_=C(_,$),o("xrange",_),_=F(_,$),o("stars",_),_),v=_=>!_||_.toLowerCase()==="x"||_==="*",x=(_,$)=>_.trim().split(/\s+/).map(D=>E(D,$)).join(" "),E=(_,$)=>{const D=$.loose?u[l.TILDELOOSE]:u[l.TILDE];return _.replace(D,(I,G,B,Z,fe)=>{o("tilde",_,I,G,B,Z,fe);let ue;return v(G)?ue="":v(B)?ue=`>=${G}.0.0 <${+G+1}.0.0-0`:v(Z)?ue=`>=${G}.${B}.0 <${G}.${+B+1}.0-0`:fe?(o("replaceTilde pr",fe),ue=`>=${G}.${B}.${Z}-${fe} <${G}.${+B+1}.0-0`):ue=`>=${G}.${B}.${Z} <${G}.${+B+1}.0-0`,o("tilde return",ue),ue})},w=(_,$)=>_.trim().split(/\s+/).map(D=>A(D,$)).join(" "),A=(_,$)=>{o("caret",_,$);const D=$.loose?u[l.CARETLOOSE]:u[l.CARET],I=$.includePrerelease?"-0":"";return _.replace(D,(G,B,Z,fe,ue)=>{o("caret",_,G,B,Z,fe,ue);let xe;return v(B)?xe="":v(Z)?xe=`>=${B}.0.0${I} <${+B+1}.0.0-0`:v(fe)?B==="0"?xe=`>=${B}.${Z}.0${I} <${B}.${+Z+1}.0-0`:xe=`>=${B}.${Z}.0${I} <${+B+1}.0.0-0`:ue?(o("replaceCaret pr",ue),B==="0"?Z==="0"?xe=`>=${B}.${Z}.${fe}-${ue} <${B}.${Z}.${+fe+1}-0`:xe=`>=${B}.${Z}.${fe}-${ue} <${B}.${+Z+1}.0-0`:xe=`>=${B}.${Z}.${fe}-${ue} <${+B+1}.0.0-0`):(o("no pr"),B==="0"?Z==="0"?xe=`>=${B}.${Z}.${fe}${I} <${B}.${Z}.${+fe+1}-0`:xe=`>=${B}.${Z}.${fe}${I} <${B}.${+Z+1}.0-0`:xe=`>=${B}.${Z}.${fe} <${+B+1}.0.0-0`),o("caret return",xe),xe})},C=(_,$)=>(o("replaceXRanges",_,$),_.split(/\s+/).map(D=>S(D,$)).join(" ")),S=(_,$)=>{_=_.trim();const D=$.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return _.replace(D,(I,G,B,Z,fe,ue)=>{o("xRange",_,I,G,B,Z,fe,ue);const xe=v(B),ot=xe||v(Z),ke=ot||v(fe),Ni=ke;return G==="="&&Ni&&(G=""),ue=$.includePrerelease?"-0":"",xe?G===">"||G==="<"?I="<0.0.0-0":I="*":G&&Ni?(ot&&(Z=0),fe=0,G===">"?(G=">=",ot?(B=+B+1,Z=0,fe=0):(Z=+Z+1,fe=0)):G==="<="&&(G="<",ot?B=+B+1:Z=+Z+1),G==="<"&&(ue="-0"),I=`${G+B}.${Z}.${fe}${ue}`):ot?I=`>=${B}.0.0${ue} <${+B+1}.0.0-0`:ke&&(I=`>=${B}.${Z}.0${ue} <${B}.${+Z+1}.0-0`),o("xRange return",I),I})},F=(_,$)=>(o("replaceStars",_,$),_.trim().replace(u[l.STAR],"")),k=(_,$)=>(o("replaceGTE0",_,$),_.trim().replace(u[$.includePrerelease?l.GTE0PRE:l.GTE0],"")),P=_=>($,D,I,G,B,Z,fe,ue,xe,ot,ke,Ni)=>(v(I)?D="":v(G)?D=`>=${I}.0.0${_?"-0":""}`:v(B)?D=`>=${I}.${G}.0${_?"-0":""}`:Z?D=`>=${D}`:D=`>=${D}${_?"-0":""}`,v(xe)?ue="":v(ot)?ue=`<${+xe+1}.0.0-0`:v(ke)?ue=`<${xe}.${+ot+1}.0-0`:Ni?ue=`<=${xe}.${ot}.${ke}-${Ni}`:_?ue=`<${xe}.${ot}.${+ke+1}-0`:ue=`<=${ue}`,`${D} ${ue}`.trim()),U=(_,$,D)=>{for(let I=0;I<_.length;I++)if(!_[I].test($))return!1;if($.prerelease.length&&!D.includePrerelease){for(let I=0;I<_.length;I++)if(o(_[I].semver),_[I].semver!==s.ANY&&_[I].semver.prerelease.length>0){const G=_[I].semver;if(G.major===$.major&&G.minor===$.minor&&G.patch===$.patch)return!0}return!1}return!0};return vm}var xm,MF;function afe(){if(MF)return xm;MF=1;const e=H6();return xm=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},xm}var ufe=afe(),V6=Kce(ufe);function lfe(e,t,n){const i=e.open(t),r=250,{origin:s}=new URL(t);let o=40;function a(l){l.source===i&&(o=0,e.removeEventListener("message",a,!1))}e.addEventListener("message",a,!1);function u(){o<=0||(i.postMessage(n,s),setTimeout(u,r),o-=1)}setTimeout(u,r)}var cfe=`.vega-embed {
85
+ position: relative;
86
+ display: inline-block;
87
+ box-sizing: border-box;
88
+ }
89
+ .vega-embed.fit-x {
90
+ display: block;
91
+ width: 100%;
92
+ }
93
+ .vega-embed.has-actions {
94
+ padding-right: 38px;
95
+ }
96
+ .vega-embed details:not([open]) > :not(summary) {
97
+ display: none !important;
98
+ }
99
+ .vega-embed summary {
100
+ list-style: none;
101
+ position: absolute;
102
+ top: 0;
103
+ right: 0;
104
+ padding: 6px;
105
+ z-index: 1000;
106
+ background: white;
107
+ box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
108
+ color: #1b1e23;
109
+ border: 1px solid #aaa;
110
+ border-radius: 999px;
111
+ opacity: 0.2;
112
+ transition: opacity 0.4s ease-in;
113
+ cursor: pointer;
114
+ line-height: 0px;
115
+ }
116
+ .vega-embed summary::-webkit-details-marker {
117
+ display: none;
118
+ }
119
+ .vega-embed summary:active {
120
+ box-shadow: #aaa 0px 0px 0px 1px inset;
121
+ }
122
+ .vega-embed summary svg {
123
+ width: 14px;
124
+ height: 14px;
125
+ }
126
+ .vega-embed details[open] summary {
127
+ opacity: 0.7;
128
+ }
129
+ .vega-embed:hover summary, .vega-embed:focus-within summary {
130
+ opacity: 1 !important;
131
+ transition: opacity 0.2s ease;
132
+ }
133
+ .vega-embed .vega-actions {
134
+ position: absolute;
135
+ z-index: 1001;
136
+ top: 35px;
137
+ right: -9px;
138
+ display: flex;
139
+ flex-direction: column;
140
+ padding-bottom: 8px;
141
+ padding-top: 8px;
142
+ border-radius: 4px;
143
+ box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
144
+ border: 1px solid #d9d9d9;
145
+ background: white;
146
+ animation-duration: 0.15s;
147
+ animation-name: scale-in;
148
+ animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
149
+ text-align: left;
150
+ }
151
+ .vega-embed .vega-actions a {
152
+ padding: 8px 16px;
153
+ font-family: sans-serif;
154
+ font-size: 14px;
155
+ font-weight: 600;
156
+ white-space: nowrap;
157
+ color: #434a56;
158
+ text-decoration: none;
159
+ }
160
+ .vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
161
+ background-color: #f7f7f9;
162
+ color: black;
163
+ }
164
+ .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
165
+ content: "";
166
+ display: inline-block;
167
+ position: absolute;
168
+ }
169
+ .vega-embed .vega-actions::before {
170
+ left: auto;
171
+ right: 14px;
172
+ top: -16px;
173
+ border: 8px solid rgba(0, 0, 0, 0);
174
+ border-bottom-color: #d9d9d9;
175
+ }
176
+ .vega-embed .vega-actions::after {
177
+ left: auto;
178
+ right: 15px;
179
+ top: -14px;
180
+ border: 7px solid rgba(0, 0, 0, 0);
181
+ border-bottom-color: #fff;
182
+ }
183
+ .vega-embed .chart-wrapper.fit-x {
184
+ width: 100%;
185
+ }
186
+ .vega-embed .chart-wrapper.fit-y {
187
+ height: 100%;
188
+ }
189
+
190
+ .vega-embed-wrapper {
191
+ max-width: 100%;
192
+ overflow: auto;
193
+ padding-right: 14px;
194
+ }
195
+
196
+ @keyframes scale-in {
197
+ from {
198
+ opacity: 0;
199
+ transform: scale(0.6);
200
+ }
201
+ to {
202
+ opacity: 1;
203
+ transform: scale(1);
204
+ }
205
+ }
206
+ `;function ffe(e){let t;try{({protocol:t}=new URL(e))}catch{return!1}return t==="http:"||t==="https:"}function X6(e,...t){for(const n of t)dfe(e,n);return e}function dfe(e,t){for(const n of Object.keys(t))mu(e,n,t[n],!0)}var hfe="7.2.0",pfe={version:hfe};const xde=pfe.version,Pi=IZ;let gc=Ble;const Gf=typeof window<"u"?window:void 0;var LF;gc===void 0&&((LF=Gf==null?void 0:Gf.vl)!=null&&LF.compile)&&(gc=Gf.vl);const gfe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},mfe={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Cl={vega:"Vega","vega-lite":"Vega-Lite"},Lh={vega:Pi.version,"vega-lite":gc?gc.version:"not available"},yfe={vega:e=>e,"vega-lite":(e,t,n)=>gc.compile(e,{config:n,logger:t}).spec},bfe=`
207
+ <svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
208
+ <circle r="2" cy="8" cx="2"></circle>
209
+ <circle r="2" cy="8" cx="8"></circle>
210
+ <circle r="2" cy="8" cx="14"></circle>
211
+ </svg>`,vfe="chart-wrapper";function xfe(e){return typeof e=="function"}function TF(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,s=`</code></pre>${n}</body></html>`,o=window.open("");o.document.write(r+e+s),o.document.title=`${Cl[i]} JSON Source`}function Efe(e,t,n){if(e.$schema){const i=I6(e.$schema);n&&n!==i.library&&t.warn(`The given visualization spec is written in ${Cl[i.library]}, but mode argument sets ${Cl[n]??n}.`);const r=i.library;return V6(Lh[r],`^${i.version.slice(1)}`)||t.warn(`The input spec uses ${Cl[r]} ${i.version}, but the current version of ${Cl[r]} is v${Lh[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":n??"vega"}function Y6(e){return!!(e&&"load"in e)}function NF(e){return Y6(e)?e:Pi.loader(e)}function Afe(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return K(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Ede(e,t,n={}){let i,r;K(t)?(r=NF(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=Afe(i),o=s.loader;(!r||o)&&(r=NF(n.loader??o));const a=await IF(s,r),u=await IF(n,r),l={...X6(u,a),config:gu(u.config??{},a.config??{})};return await Sfe(e,i,l,r)}async function IF(e,t){const n=K(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=K(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function wfe(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Sfe(e,t,n={},i){const r=n.theme?gu(Sce[n.theme],n.config??{}):n.config,s=Uo(n.actions)?n.actions:X6({},gfe,n.actions??{}),o={...mfe,...n.i18n},a=n.renderer??"svg",u=n.logger??Xh(Pi.Warn);n.logLevel!==void 0&&u.level(n.logLevel);const l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const E="vega-embed-style",{root:w,rootContainer:A}=wfe(c);if(!w.getElementById(E)){const C=document.createElement("style");C.id=E,C.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?cfe.toString():n.defaultStyle,A.appendChild(C)}}const f=Efe(t,u,n.mode);let d=yfe[f](t,u,r);if(f==="vega-lite"&&d.$schema){const E=I6(d.$schema);V6(Lh.vega,`^${E.version.slice(1)}`)||u.warn(`The compiled spec uses Vega ${E.version}, but current version is v${Lh.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const E=document.createElement("div");E.classList.add(vfe),c.appendChild(E),h=E}const p=n.patch;if(p&&(d=p instanceof Function?p(d):Lg(d,p,!0,!1).newDocument),n.formatLocale&&Pi.formatLocale(n.formatLocale),n.timeFormatLocale&&Pi.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const E in n.expressionFunctions){const w=n.expressionFunctions[E];"fn"in w?Pi.expressionFunction(E,w.fn,w.visitor):w instanceof Function&&Pi.expressionFunction(E,w)}const{ast:g}=n,m=Pi.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||Pi.View)(m,{loader:i,logger:u,renderer:a,...g?{expr:Pi.expressionInterpreter??n.expr??HZ}:{}});if(y.addSignalListener("autosize",(E,w)=>{const{type:A}=w,C=A=="fit-x"||A=="fit",S=A=="fit-y"||A=="fit";for(const F of new Set([h,c]))F.classList.toggle("fit-x",C),F.classList.toggle("fit-y",S)}),n.tooltip!==!1){const{loader:E,tooltip:w}=n,A=E&&!Y6(E)?E==null?void 0:E.baseURL:void 0,C=xfe(w)?w:new Tce({baseURL:A,...w===!0?{}:w}).call;y.tooltip(C)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:E,updateSet:w}=typeof b=="boolean"?{}:b;y.hover(E,w)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(s!==!1){let E=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const S=document.createElement("details");S.title=o.CLICK_TO_VIEW_ACTIONS,c.append(S),E=S;const F=document.createElement("summary");F.innerHTML=bfe,S.append(F),v=k=>{S.contains(k.target)||S.removeAttribute("open")},document.addEventListener("click",v)}const w=document.createElement("div");if(E.append(w),w.classList.add("vega-actions"),s===!0||s.export!==!1){for(const S of["svg","png"])if(s===!0||s.export===!0||s.export[S]){const F=o[`${S.toUpperCase()}_ACTION`],k=document.createElement("a"),P=Y(n.scaleFactor)?n.scaleFactor[S]:n.scaleFactor;k.text=F,k.href="#",k.target="_blank",k.download=`${l}.${S}`,k.addEventListener("mousedown",async function(U){U.preventDefault();const _=await y.toImageURL(S,P);this.href=_}),w.append(k)}}if(s===!0||s.source!==!1){const S=document.createElement("a");S.text=o.SOURCE_ACTION,S.href="#",S.addEventListener("click",function(F){TF(t0(t),n.sourceHeader??"",n.sourceFooter??"",f),F.preventDefault()}),w.append(S)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const S=document.createElement("a");S.text=o.COMPILED_ACTION,S.href="#",S.addEventListener("click",function(F){TF(t0(d),n.sourceHeader??"",n.sourceFooter??"","vega"),F.preventDefault()}),w.append(S)}const A=n.editorUrl??"https://vega.github.io/editor/",C=s===!0||s.editor!==!1;if(C&&!ffe(A))u.warn(`Ignoring the editor action since editorUrl is not an http or https url: ${A}`);else if(C){const S=document.createElement("a");S.text=o.EDITOR_ACTION,S.href="#",S.addEventListener("click",function(F){lfe(window,A,{config:r,mode:p?"vega":f,renderer:a,spec:t0(p?d:t)}),F.preventDefault()}),w.append(S)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}export{gfe as DEFAULT_ACTIONS,Ede as default,Efe as guessMode,Pi as vega,gc as vegaLite,xde as version};