@antv/g2 5.2.9 → 5.2.11

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 (458) hide show
  1. package/dist/g2.lite.min.js +22 -22
  2. package/dist/g2.min.js +22 -22
  3. package/esm/animation/scaleInY.js +1 -1
  4. package/esm/animation/scaleInY.js.map +1 -1
  5. package/esm/animation/waveIn.js +1 -1
  6. package/esm/animation/waveIn.js.map +1 -1
  7. package/esm/api/runtime.js +0 -1
  8. package/esm/api/runtime.js.map +1 -1
  9. package/esm/component/axis.js +2 -2
  10. package/esm/component/axis.js.map +1 -1
  11. package/esm/component/legendCategory.js +1 -1
  12. package/esm/component/legendCategory.js.map +1 -1
  13. package/esm/component/legendContinuous.js +1 -1
  14. package/esm/component/legendContinuous.js.map +1 -1
  15. package/esm/component/slider.js +1 -1
  16. package/esm/component/slider.js.map +1 -1
  17. package/esm/composition/d3Projection.d.ts +1 -1
  18. package/esm/composition/d3Projection.js +1 -1
  19. package/esm/composition/d3Projection.js.map +1 -1
  20. package/esm/composition/facetRect.js +1 -1
  21. package/esm/composition/facetRect.js.map +1 -1
  22. package/esm/composition/geoView.js +1 -1
  23. package/esm/composition/geoView.js.map +1 -1
  24. package/esm/data/cluster.d.ts +1 -1
  25. package/esm/data/cluster.js +1 -1
  26. package/esm/data/cluster.js.map +1 -1
  27. package/esm/data/fetch.js +1 -1
  28. package/esm/data/fetch.js.map +1 -1
  29. package/esm/data/join.js +1 -1
  30. package/esm/data/join.js.map +1 -1
  31. package/esm/data/kde.js +1 -1
  32. package/esm/data/kde.js.map +1 -1
  33. package/esm/data/tree.js +1 -1
  34. package/esm/data/tree.js.map +1 -1
  35. package/esm/data/utils/arc/arc.js +1 -1
  36. package/esm/data/utils/arc/arc.js.map +1 -1
  37. package/esm/data/utils/d3-sankey/align.js +1 -1
  38. package/esm/data/utils/d3-sankey/align.js.map +1 -1
  39. package/esm/data/utils/d3-sankey/sankey.js +1 -1
  40. package/esm/data/utils/d3-sankey/sankey.js.map +1 -1
  41. package/esm/data/wordCloud.js +1 -1
  42. package/esm/data/wordCloud.js.map +1 -1
  43. package/esm/index.d.ts +2 -0
  44. package/esm/interaction/chartIndex.js +1 -1
  45. package/esm/interaction/chartIndex.js.map +1 -1
  46. package/esm/interaction/elementHighlight.js +1 -1
  47. package/esm/interaction/elementHighlight.js.map +1 -1
  48. package/esm/interaction/elementSelect.js +1 -1
  49. package/esm/interaction/elementSelect.js.map +1 -1
  50. package/esm/interaction/legendHighlight.js +1 -1
  51. package/esm/interaction/legendHighlight.js.map +1 -1
  52. package/esm/interaction/tooltip.js +3 -7
  53. package/esm/interaction/tooltip.js.map +1 -1
  54. package/esm/interaction/treemapDrillDown.d.ts +2 -2
  55. package/esm/interaction/treemapDrillDown.js.map +1 -1
  56. package/esm/interaction/utils.js +2 -2
  57. package/esm/interaction/utils.js.map +1 -1
  58. package/esm/label-transform/contrastReverse.js +1 -1
  59. package/esm/label-transform/contrastReverse.js.map +1 -1
  60. package/esm/label-transform/overlapDodgeY.js +1 -1
  61. package/esm/label-transform/overlapDodgeY.js.map +1 -1
  62. package/esm/lib/core.d.ts +1 -0
  63. package/esm/lib/core.js +2 -1
  64. package/esm/lib/core.js.map +1 -1
  65. package/esm/lib/std.d.ts +1 -0
  66. package/esm/mark/area.js +1 -1
  67. package/esm/mark/area.js.map +1 -1
  68. package/esm/mark/boxplot.js +1 -1
  69. package/esm/mark/boxplot.js.map +1 -1
  70. package/esm/mark/forceGraph.js +1 -1
  71. package/esm/mark/forceGraph.js.map +1 -1
  72. package/esm/mark/line.js +1 -1
  73. package/esm/mark/line.js.map +1 -1
  74. package/esm/mark/pack.js +1 -1
  75. package/esm/mark/pack.js.map +1 -1
  76. package/esm/mark/utils.d.ts +1 -1
  77. package/esm/runtime/component.js +2 -2
  78. package/esm/runtime/component.js.map +1 -1
  79. package/esm/runtime/layout.js +1 -1
  80. package/esm/runtime/layout.js.map +1 -1
  81. package/esm/runtime/mark.js +1 -1
  82. package/esm/runtime/mark.js.map +1 -1
  83. package/esm/runtime/plot.js +2 -2
  84. package/esm/runtime/plot.js.map +1 -1
  85. package/esm/runtime/scale.js +2 -2
  86. package/esm/runtime/scale.js.map +1 -1
  87. package/esm/runtime/transform.js +1 -1
  88. package/esm/runtime/transform.js.map +1 -1
  89. package/esm/runtime/types/mark.d.ts +1 -1
  90. package/esm/shape/area/area.js +1 -1
  91. package/esm/shape/area/area.js.map +1 -1
  92. package/esm/shape/area/curve.d.ts +1 -1
  93. package/esm/shape/area/curve.js +1 -1
  94. package/esm/shape/area/curve.js.map +1 -1
  95. package/esm/shape/area/hv.js +1 -1
  96. package/esm/shape/area/hv.js.map +1 -1
  97. package/esm/shape/area/hvh.js +1 -1
  98. package/esm/shape/area/hvh.js.map +1 -1
  99. package/esm/shape/area/smooth.js +1 -1
  100. package/esm/shape/area/smooth.js.map +1 -1
  101. package/esm/shape/area/vh.js +1 -1
  102. package/esm/shape/area/vh.js.map +1 -1
  103. package/esm/shape/box/box.js +1 -1
  104. package/esm/shape/box/box.js.map +1 -1
  105. package/esm/shape/box/violin.js +1 -1
  106. package/esm/shape/box/violin.js.map +1 -1
  107. package/esm/shape/connector/connector.js +1 -1
  108. package/esm/shape/connector/connector.js.map +1 -1
  109. package/esm/shape/density/density.js +1 -1
  110. package/esm/shape/density/density.js.map +1 -1
  111. package/esm/shape/heatmap/heatmap.js +2 -2
  112. package/esm/shape/heatmap/heatmap.js.map +1 -1
  113. package/esm/shape/interval/color.js +1 -1
  114. package/esm/shape/interval/color.js.map +1 -1
  115. package/esm/shape/interval/funnel.js +1 -1
  116. package/esm/shape/interval/funnel.js.map +1 -1
  117. package/esm/shape/label/position/area.js +1 -1
  118. package/esm/shape/label/position/area.js.map +1 -1
  119. package/esm/shape/label/position/utils.js +1 -1
  120. package/esm/shape/label/position/utils.js.map +1 -1
  121. package/esm/shape/line/curve.d.ts +1 -1
  122. package/esm/shape/line/curve.js +1 -1
  123. package/esm/shape/line/curve.js.map +1 -1
  124. package/esm/shape/line/hv.js +1 -1
  125. package/esm/shape/line/hv.js.map +1 -1
  126. package/esm/shape/line/hvh.js +1 -1
  127. package/esm/shape/line/hvh.js.map +1 -1
  128. package/esm/shape/line/line.js +1 -1
  129. package/esm/shape/line/line.js.map +1 -1
  130. package/esm/shape/line/smooth.js +1 -1
  131. package/esm/shape/line/smooth.js.map +1 -1
  132. package/esm/shape/line/trail.js +1 -1
  133. package/esm/shape/line/trail.js.map +1 -1
  134. package/esm/shape/line/vh.js +1 -1
  135. package/esm/shape/line/vh.js.map +1 -1
  136. package/esm/shape/lineXY/line.js +1 -1
  137. package/esm/shape/lineXY/line.js.map +1 -1
  138. package/esm/shape/link/arc.js +1 -1
  139. package/esm/shape/link/arc.js.map +1 -1
  140. package/esm/shape/link/smooth.js +1 -1
  141. package/esm/shape/link/smooth.js.map +1 -1
  142. package/esm/shape/link/vhv.js +1 -1
  143. package/esm/shape/link/vhv.js.map +1 -1
  144. package/esm/shape/polygon/polygon.js +1 -1
  145. package/esm/shape/polygon/polygon.js.map +1 -1
  146. package/esm/shape/polygon/ribbon.js +1 -1
  147. package/esm/shape/polygon/ribbon.js.map +1 -1
  148. package/esm/shape/text/advance.js +1 -1
  149. package/esm/shape/text/advance.js.map +1 -1
  150. package/esm/shape/utils.d.ts +1 -1
  151. package/esm/shape/utils.js +1 -1
  152. package/esm/shape/utils.js.map +1 -1
  153. package/esm/shape/vector/vector.js +1 -1
  154. package/esm/shape/vector/vector.js.map +1 -1
  155. package/esm/transform/bin.js +1 -1
  156. package/esm/transform/bin.js.map +1 -1
  157. package/esm/transform/flexX.js +1 -1
  158. package/esm/transform/flexX.js.map +1 -1
  159. package/esm/transform/groupN.js +1 -1
  160. package/esm/transform/groupN.js.map +1 -1
  161. package/esm/transform/normalizeY.js +1 -1
  162. package/esm/transform/normalizeY.js.map +1 -1
  163. package/esm/transform/sample.js +1 -1
  164. package/esm/transform/sample.js.map +1 -1
  165. package/esm/transform/select.js +1 -1
  166. package/esm/transform/select.js.map +1 -1
  167. package/esm/transform/sort.d.ts +1 -1
  168. package/esm/transform/sort.js +1 -1
  169. package/esm/transform/sort.js.map +1 -1
  170. package/esm/transform/stackEnter.js +1 -1
  171. package/esm/transform/stackEnter.js.map +1 -1
  172. package/esm/transform/symmetryY.js +1 -1
  173. package/esm/transform/symmetryY.js.map +1 -1
  174. package/esm/transform/utils/order.d.ts +1 -1
  175. package/esm/transform/utils/order.js +1 -1
  176. package/esm/transform/utils/order.js.map +1 -1
  177. package/esm/utils/bounds.d.ts +4 -2
  178. package/esm/utils/bounds.js +11 -4
  179. package/esm/utils/bounds.js.map +1 -1
  180. package/esm/utils/scale.js +1 -1
  181. package/esm/utils/scale.js.map +1 -1
  182. package/esm/utils/selection.js +1 -1
  183. package/esm/utils/selection.js.map +1 -1
  184. package/esm/utils/treeDataTransform.d.ts +9 -2
  185. package/esm/utils/treeDataTransform.js +6 -2
  186. package/esm/utils/treeDataTransform.js.map +1 -1
  187. package/lib/animation/scaleInY.js +1 -1
  188. package/lib/animation/scaleInY.js.map +1 -1
  189. package/lib/animation/waveIn.js +1 -1
  190. package/lib/animation/waveIn.js.map +1 -1
  191. package/lib/api/runtime.js +0 -1
  192. package/lib/api/runtime.js.map +1 -1
  193. package/lib/component/axis.js +2 -2
  194. package/lib/component/axis.js.map +1 -1
  195. package/lib/component/legendCategory.js +1 -1
  196. package/lib/component/legendCategory.js.map +1 -1
  197. package/lib/component/legendContinuous.js +1 -1
  198. package/lib/component/legendContinuous.js.map +1 -1
  199. package/lib/component/slider.js +1 -1
  200. package/lib/component/slider.js.map +1 -1
  201. package/lib/composition/d3Projection.d.ts +1 -1
  202. package/lib/composition/d3Projection.js +1 -1
  203. package/lib/composition/d3Projection.js.map +1 -1
  204. package/lib/composition/facetRect.js +1 -1
  205. package/lib/composition/facetRect.js.map +1 -1
  206. package/lib/composition/geoView.js +1 -1
  207. package/lib/composition/geoView.js.map +1 -1
  208. package/lib/data/cluster.d.ts +1 -1
  209. package/lib/data/cluster.js +1 -1
  210. package/lib/data/cluster.js.map +1 -1
  211. package/lib/data/fetch.js +1 -1
  212. package/lib/data/fetch.js.map +1 -1
  213. package/lib/data/join.js +1 -1
  214. package/lib/data/join.js.map +1 -1
  215. package/lib/data/kde.js +1 -1
  216. package/lib/data/kde.js.map +1 -1
  217. package/lib/data/tree.js +1 -1
  218. package/lib/data/tree.js.map +1 -1
  219. package/lib/data/utils/arc/arc.js +1 -1
  220. package/lib/data/utils/arc/arc.js.map +1 -1
  221. package/lib/data/utils/d3-sankey/align.js +1 -1
  222. package/lib/data/utils/d3-sankey/align.js.map +1 -1
  223. package/lib/data/utils/d3-sankey/sankey.js +1 -1
  224. package/lib/data/utils/d3-sankey/sankey.js.map +1 -1
  225. package/lib/data/wordCloud.js +1 -1
  226. package/lib/data/wordCloud.js.map +1 -1
  227. package/lib/index.d.ts +2 -0
  228. package/lib/interaction/chartIndex.js +1 -1
  229. package/lib/interaction/chartIndex.js.map +1 -1
  230. package/lib/interaction/elementHighlight.js +1 -1
  231. package/lib/interaction/elementHighlight.js.map +1 -1
  232. package/lib/interaction/elementSelect.js +1 -1
  233. package/lib/interaction/elementSelect.js.map +1 -1
  234. package/lib/interaction/legendHighlight.js +1 -1
  235. package/lib/interaction/legendHighlight.js.map +1 -1
  236. package/lib/interaction/tooltip.js +3 -7
  237. package/lib/interaction/tooltip.js.map +1 -1
  238. package/lib/interaction/treemapDrillDown.d.ts +2 -2
  239. package/lib/interaction/treemapDrillDown.js.map +1 -1
  240. package/lib/interaction/utils.js +2 -2
  241. package/lib/interaction/utils.js.map +1 -1
  242. package/lib/label-transform/contrastReverse.js +1 -1
  243. package/lib/label-transform/contrastReverse.js.map +1 -1
  244. package/lib/label-transform/overlapDodgeY.js +1 -1
  245. package/lib/label-transform/overlapDodgeY.js.map +1 -1
  246. package/lib/lib/core.d.ts +1 -0
  247. package/lib/lib/core.js +1 -0
  248. package/lib/lib/core.js.map +1 -1
  249. package/lib/lib/std.d.ts +1 -0
  250. package/lib/mark/area.js +1 -1
  251. package/lib/mark/area.js.map +1 -1
  252. package/lib/mark/boxplot.js +1 -1
  253. package/lib/mark/boxplot.js.map +1 -1
  254. package/lib/mark/forceGraph.js +1 -1
  255. package/lib/mark/forceGraph.js.map +1 -1
  256. package/lib/mark/line.js +1 -1
  257. package/lib/mark/line.js.map +1 -1
  258. package/lib/mark/pack.js +1 -1
  259. package/lib/mark/pack.js.map +1 -1
  260. package/lib/mark/utils.d.ts +1 -1
  261. package/lib/runtime/component.js +2 -2
  262. package/lib/runtime/component.js.map +1 -1
  263. package/lib/runtime/layout.js +1 -1
  264. package/lib/runtime/layout.js.map +1 -1
  265. package/lib/runtime/mark.js +1 -1
  266. package/lib/runtime/mark.js.map +1 -1
  267. package/lib/runtime/plot.js +2 -2
  268. package/lib/runtime/plot.js.map +1 -1
  269. package/lib/runtime/scale.js +2 -2
  270. package/lib/runtime/scale.js.map +1 -1
  271. package/lib/runtime/transform.js +1 -1
  272. package/lib/runtime/transform.js.map +1 -1
  273. package/lib/runtime/types/mark.d.ts +1 -1
  274. package/lib/shape/area/area.js +1 -1
  275. package/lib/shape/area/area.js.map +1 -1
  276. package/lib/shape/area/curve.d.ts +1 -1
  277. package/lib/shape/area/curve.js +1 -1
  278. package/lib/shape/area/curve.js.map +1 -1
  279. package/lib/shape/area/hv.js +1 -1
  280. package/lib/shape/area/hv.js.map +1 -1
  281. package/lib/shape/area/hvh.js +1 -1
  282. package/lib/shape/area/hvh.js.map +1 -1
  283. package/lib/shape/area/smooth.js +1 -1
  284. package/lib/shape/area/smooth.js.map +1 -1
  285. package/lib/shape/area/vh.js +1 -1
  286. package/lib/shape/area/vh.js.map +1 -1
  287. package/lib/shape/box/box.js +1 -1
  288. package/lib/shape/box/box.js.map +1 -1
  289. package/lib/shape/box/violin.js +1 -1
  290. package/lib/shape/box/violin.js.map +1 -1
  291. package/lib/shape/connector/connector.js +1 -1
  292. package/lib/shape/connector/connector.js.map +1 -1
  293. package/lib/shape/density/density.js +1 -1
  294. package/lib/shape/density/density.js.map +1 -1
  295. package/lib/shape/heatmap/heatmap.js +2 -2
  296. package/lib/shape/heatmap/heatmap.js.map +1 -1
  297. package/lib/shape/interval/color.js +1 -1
  298. package/lib/shape/interval/color.js.map +1 -1
  299. package/lib/shape/interval/funnel.js +1 -1
  300. package/lib/shape/interval/funnel.js.map +1 -1
  301. package/lib/shape/label/position/area.js +1 -1
  302. package/lib/shape/label/position/area.js.map +1 -1
  303. package/lib/shape/label/position/utils.js +1 -1
  304. package/lib/shape/label/position/utils.js.map +1 -1
  305. package/lib/shape/line/curve.d.ts +1 -1
  306. package/lib/shape/line/curve.js +1 -1
  307. package/lib/shape/line/curve.js.map +1 -1
  308. package/lib/shape/line/hv.js +1 -1
  309. package/lib/shape/line/hv.js.map +1 -1
  310. package/lib/shape/line/hvh.js +1 -1
  311. package/lib/shape/line/hvh.js.map +1 -1
  312. package/lib/shape/line/line.js +1 -1
  313. package/lib/shape/line/line.js.map +1 -1
  314. package/lib/shape/line/smooth.js +1 -1
  315. package/lib/shape/line/smooth.js.map +1 -1
  316. package/lib/shape/line/trail.js +1 -1
  317. package/lib/shape/line/trail.js.map +1 -1
  318. package/lib/shape/line/vh.js +1 -1
  319. package/lib/shape/line/vh.js.map +1 -1
  320. package/lib/shape/lineXY/line.js +1 -1
  321. package/lib/shape/lineXY/line.js.map +1 -1
  322. package/lib/shape/link/arc.js +1 -1
  323. package/lib/shape/link/arc.js.map +1 -1
  324. package/lib/shape/link/smooth.js +1 -1
  325. package/lib/shape/link/smooth.js.map +1 -1
  326. package/lib/shape/link/vhv.js +1 -1
  327. package/lib/shape/link/vhv.js.map +1 -1
  328. package/lib/shape/polygon/polygon.js +1 -1
  329. package/lib/shape/polygon/polygon.js.map +1 -1
  330. package/lib/shape/polygon/ribbon.js +1 -1
  331. package/lib/shape/polygon/ribbon.js.map +1 -1
  332. package/lib/shape/text/advance.js +1 -1
  333. package/lib/shape/text/advance.js.map +1 -1
  334. package/lib/shape/utils.d.ts +1 -1
  335. package/lib/shape/utils.js +1 -1
  336. package/lib/shape/utils.js.map +1 -1
  337. package/lib/shape/vector/vector.js +1 -1
  338. package/lib/shape/vector/vector.js.map +1 -1
  339. package/lib/transform/bin.js +1 -1
  340. package/lib/transform/bin.js.map +1 -1
  341. package/lib/transform/flexX.js +1 -1
  342. package/lib/transform/flexX.js.map +1 -1
  343. package/lib/transform/groupN.js +1 -1
  344. package/lib/transform/groupN.js.map +1 -1
  345. package/lib/transform/normalizeY.js +1 -1
  346. package/lib/transform/normalizeY.js.map +1 -1
  347. package/lib/transform/sample.js +1 -1
  348. package/lib/transform/sample.js.map +1 -1
  349. package/lib/transform/select.js +1 -1
  350. package/lib/transform/select.js.map +1 -1
  351. package/lib/transform/sort.d.ts +1 -1
  352. package/lib/transform/sort.js +1 -1
  353. package/lib/transform/sort.js.map +1 -1
  354. package/lib/transform/stackEnter.js +1 -1
  355. package/lib/transform/stackEnter.js.map +1 -1
  356. package/lib/transform/symmetryY.js +1 -1
  357. package/lib/transform/symmetryY.js.map +1 -1
  358. package/lib/transform/utils/order.d.ts +1 -1
  359. package/lib/transform/utils/order.js +1 -1
  360. package/lib/transform/utils/order.js.map +1 -1
  361. package/lib/utils/bounds.d.ts +4 -2
  362. package/lib/utils/bounds.js +11 -4
  363. package/lib/utils/bounds.js.map +1 -1
  364. package/lib/utils/scale.js +1 -1
  365. package/lib/utils/scale.js.map +1 -1
  366. package/lib/utils/selection.js +1 -1
  367. package/lib/utils/selection.js.map +1 -1
  368. package/lib/utils/treeDataTransform.d.ts +9 -2
  369. package/lib/utils/treeDataTransform.js +6 -2
  370. package/lib/utils/treeDataTransform.js.map +1 -1
  371. package/package.json +7 -22
  372. package/src/animation/scaleInY.ts +1 -1
  373. package/src/animation/waveIn.ts +1 -1
  374. package/src/api/runtime.ts +0 -1
  375. package/src/component/axis.ts +2 -2
  376. package/src/component/legendCategory.ts +1 -1
  377. package/src/component/legendContinuous.ts +1 -1
  378. package/src/component/slider.ts +1 -1
  379. package/src/composition/d3Projection.ts +1 -1
  380. package/src/composition/facetRect.ts +1 -1
  381. package/src/composition/geoView.ts +1 -1
  382. package/src/data/cluster.ts +1 -1
  383. package/src/data/fetch.ts +1 -1
  384. package/src/data/join.ts +1 -1
  385. package/src/data/kde.ts +1 -1
  386. package/src/data/tree.ts +1 -1
  387. package/src/data/utils/arc/arc.ts +1 -1
  388. package/src/data/utils/d3-sankey/align.ts +1 -1
  389. package/src/data/utils/d3-sankey/sankey.ts +1 -1
  390. package/src/data/wordCloud.ts +1 -1
  391. package/src/interaction/chartIndex.ts +1 -1
  392. package/src/interaction/elementHighlight.ts +1 -1
  393. package/src/interaction/elementSelect.ts +1 -1
  394. package/src/interaction/legendHighlight.ts +1 -1
  395. package/src/interaction/tooltip.ts +3 -1
  396. package/src/interaction/treemapDrillDown.ts +2 -3
  397. package/src/interaction/utils.ts +2 -2
  398. package/src/label-transform/contrastReverse.ts +1 -1
  399. package/src/label-transform/overlapDodgeY.ts +1 -1
  400. package/src/lib/core.ts +2 -0
  401. package/src/mark/area.ts +1 -1
  402. package/src/mark/boxplot.ts +6 -1
  403. package/src/mark/forceGraph.ts +1 -1
  404. package/src/mark/line.ts +1 -1
  405. package/src/mark/pack.ts +5 -1
  406. package/src/mark/utils.ts +1 -1
  407. package/src/runtime/component.ts +2 -2
  408. package/src/runtime/layout.ts +1 -1
  409. package/src/runtime/mark.ts +1 -1
  410. package/src/runtime/plot.ts +2 -2
  411. package/src/runtime/scale.ts +2 -2
  412. package/src/runtime/transform.ts +2 -2
  413. package/src/runtime/types/mark.ts +1 -1
  414. package/src/shape/area/area.ts +1 -1
  415. package/src/shape/area/curve.ts +1 -1
  416. package/src/shape/area/hv.ts +1 -1
  417. package/src/shape/area/hvh.ts +1 -1
  418. package/src/shape/area/smooth.ts +1 -1
  419. package/src/shape/area/vh.ts +1 -1
  420. package/src/shape/box/box.ts +1 -1
  421. package/src/shape/box/violin.ts +1 -1
  422. package/src/shape/connector/connector.ts +1 -1
  423. package/src/shape/density/density.ts +1 -1
  424. package/src/shape/heatmap/heatmap.ts +2 -2
  425. package/src/shape/interval/color.ts +1 -1
  426. package/src/shape/interval/funnel.ts +1 -1
  427. package/src/shape/label/position/area.ts +1 -1
  428. package/src/shape/label/position/utils.ts +1 -1
  429. package/src/shape/line/curve.ts +6 -1
  430. package/src/shape/line/hv.ts +1 -1
  431. package/src/shape/line/hvh.ts +1 -1
  432. package/src/shape/line/line.ts +1 -1
  433. package/src/shape/line/smooth.ts +1 -1
  434. package/src/shape/line/trail.ts +1 -1
  435. package/src/shape/line/vh.ts +1 -1
  436. package/src/shape/lineXY/line.ts +1 -1
  437. package/src/shape/link/arc.ts +1 -1
  438. package/src/shape/link/smooth.ts +1 -1
  439. package/src/shape/link/vhv.ts +1 -1
  440. package/src/shape/polygon/polygon.ts +1 -1
  441. package/src/shape/polygon/ribbon.ts +1 -1
  442. package/src/shape/text/advance.ts +1 -1
  443. package/src/shape/utils.ts +2 -2
  444. package/src/shape/vector/vector.ts +1 -1
  445. package/src/transform/bin.ts +6 -1
  446. package/src/transform/flexX.ts +1 -1
  447. package/src/transform/groupN.ts +1 -1
  448. package/src/transform/normalizeY.ts +1 -1
  449. package/src/transform/sample.ts +1 -1
  450. package/src/transform/select.ts +1 -1
  451. package/src/transform/sort.ts +1 -1
  452. package/src/transform/stackEnter.ts +1 -1
  453. package/src/transform/symmetryY.ts +1 -1
  454. package/src/transform/utils/order.ts +1 -1
  455. package/src/utils/bounds.ts +22 -4
  456. package/src/utils/scale.ts +1 -1
  457. package/src/utils/selection.ts +1 -1
  458. package/src/utils/treeDataTransform.ts +26 -13
@@ -1,59 +1,59 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,(function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),(r=n.startAngle,i=n.endAngle,r%=2*Math.PI,i%=2*Math.PI,r<0&&(r=2*Math.PI+r),i<0&&(i=2*Math.PI+i),r>=i&&(i+=2*Math.PI),{startAngle:r,endAngle:i}));var r,i},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:a}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,a]]};r.props={};const i=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];i.props={transform:!0};const a=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:a}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:a})]};a.props={};const o=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},s=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:a}=o(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:a})]};s.props={};const c=()=>[["parallel",0,1,0,1]];c.props={};const l=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];l.props={transform:!0};const u=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:a=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:a})]};u.props={};const f=({value:t})=>e=>e.map((()=>t));f.props={};const h=({value:t})=>e=>e.map(t);h.props={};const d=({value:t})=>e=>e.map((e=>e[t]));d.props={};const p=({value:t})=>()=>t;p.props={};var g=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},v=function(t,e){if(!g(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n};function m(t){return"function"==typeof t}function y(t){return null==t}function b(t){return Array.isArray(t)}var x=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function k(t,e){if(t)if(b(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(x(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var w=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return k(t,(function(n,r){m(t)&&"prototype"===r||e.push(r)})),e};var M=function(t){return"object"==typeof t&&null!==t},O={}.toString,E=function(t,e){return O.call(t)==="[object "+e+"]"},S=function(t){if(!M(t)||!E(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function A(t,e){if(!b(t))return null;var n;if(m(e)&&(n=e),S(e)&&(n=function(t){return function(t,e){var n=w(e),r=n.length;if(y(t))return!r;for(var i=0;i<r;i+=1){var a=n[i];if(e[a]!==t[a]||!(a in t))return!1}return!0}(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null}function _(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;r<e;r++)n=Math.max(n,t[r]);return n}var T=function(t){if(b(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},P=function(t,e,n){if(!b(t)&&!S(t))return t;var r=n;return k(t,(function(t,n){r=e(r,t,n)})),r};function C(t){return"string"==typeof t}function L(t){if(g(t)){return t[t.length-1]}}var N=function(t,e,n){return t<e?e:t>n?n:t};function j(t){return"number"==typeof t}function R(t,e,n){return void 0===n&&(n=1e-5),t===e||Math.abs(t-e)<n}var I=function(t,e){if(b(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=m(e)?e(a):a[e];o>r&&(n=a,r=o)}return n}},D=function(t,e){if(b(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=m(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}},B=function(t,e){return(t%e+e)%e},F=function(t){return y(t)?"":t.toString()},z=function(t){var e=F(t);return e.charAt(0).toLowerCase()+e.substring(1)};var G=function(t){var e=F(t);return e.charAt(0).toUpperCase()+e.substring(1)},W=function(t){return E(t,"Boolean")};var $=function(t){return void 0===t},Y=function(t){if("object"!=typeof t||null===t)return t;var e;if(b(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=Y(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=Y(t[i]):e[i]=t[i];return e},H=Y;function V(t,e,n){var r;return function(){var i=this,a=arguments,o=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,a)}),e),o&&t.apply(i,a)}}var q=new Map;function U(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function X(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(U(e,i)){var a=e[i];null!==a&&S(a)?(S(t[i])||(t[i]={}),n<r?X(t[i],a,n+1,r):t[i]=e[i]):b(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var Z=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)X(t,e[r]);return t},K=function(t,e){if(!g(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},Q=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(C(t)||C(e))return!1;if(g(t)||g(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=Q(t[r],e[r]));r++);return n}if(M(t)||M(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=Q(t[i[r]],e[i[r]]));r++);return n}return!1},J=Q,tt=function(t,e,n){for(var r=0,i=C(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},et=Object.prototype.hasOwnProperty,nt=function(t,e){return P(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},rt=function(t,e,n){var r,i,a,o,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,o=t.apply(i,a),r||(i=a=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,a=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,o=t.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(c,u)),o};return l.cancel=function(){clearTimeout(r),s=0,r=i=a=null},l},it=function(){},at=function(t){return t};function ot(t){return y(t)?0:g(t)?t.length:Object.keys(t).length}var st=1e-6,ct="undefined"!=typeof Float32Array?Float32Array:Array;function lt(){var t=new ct(9);return ct!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var ut=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=n[0],d=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=n[6],b=n[7],x=n[8];return t[0]=h*r+d*o+p*l,t[1]=h*i+d*s+p*u,t[2]=h*a+d*c+p*f,t[3]=g*r+v*o+m*l,t[4]=g*i+v*s+m*u,t[5]=g*a+v*c+m*f,t[6]=y*r+b*o+x*l,t[7]=y*i+b*s+x*u,t[8]=y*a+b*c+x*f,t};function ft(){var t=new ct(16);return ct!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function ht(t){var e=new ct(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function dt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function pt(t,e,n,r,i,a,o,s,c,l,u,f,h,d,p,g){var v=new ct(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=a,v[6]=o,v[7]=s,v[8]=c,v[9]=l,v[10]=u,v[11]=f,v[12]=h,v[13]=d,v[14]=p,v[15]=g,v}function gt(t,e,n,r,i,a,o,s,c,l,u,f,h,d,p,g,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=v,t}function vt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function yt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*o,b=n*c-i*o,x=n*l-a*o,k=r*c-i*s,w=r*l-a*s,M=i*l-a*c,O=u*g-f*p,E=u*v-h*p,S=u*m-d*p,A=f*v-h*g,_=f*m-d*g,T=h*m-d*v,P=y*T-b*_+x*A+k*S-w*E+M*O;return P?(P=1/P,t[0]=(s*T-c*_+l*A)*P,t[1]=(i*_-r*T-a*A)*P,t[2]=(g*M-v*w+m*k)*P,t[3]=(h*w-f*M-d*k)*P,t[4]=(c*S-o*T-l*E)*P,t[5]=(n*T-i*S+a*E)*P,t[6]=(v*x-p*M-m*b)*P,t[7]=(u*M-h*x+d*b)*P,t[8]=(o*_-s*S+l*O)*P,t[9]=(r*S-n*_-a*O)*P,t[10]=(p*w-g*x+m*y)*P,t[11]=(f*x-u*w-d*y)*P,t[12]=(s*E-o*A-c*O)*P,t[13]=(n*A-r*E+i*O)*P,t[14]=(g*b-p*k-v*y)*P,t[15]=(u*k-f*b+h*y)*P,t):null}function bt(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],v=t[15];return(e*o-n*a)*(f*v-h*g)-(e*s-r*a)*(u*v-h*p)+(e*c-i*a)*(u*g-f*p)+(n*s-r*o)*(l*v-h*d)-(n*c-i*o)*(l*g-f*d)+(r*c-i*s)*(l*p-u*d)}function xt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=n[0],x=n[1],k=n[2],w=n[3];return t[0]=b*r+x*s+k*f+w*g,t[1]=b*i+x*c+k*h+w*v,t[2]=b*a+x*l+k*d+w*m,t[3]=b*o+x*u+k*p+w*y,b=n[4],x=n[5],k=n[6],w=n[7],t[4]=b*r+x*s+k*f+w*g,t[5]=b*i+x*c+k*h+w*v,t[6]=b*a+x*l+k*d+w*m,t[7]=b*o+x*u+k*p+w*y,b=n[8],x=n[9],k=n[10],w=n[11],t[8]=b*r+x*s+k*f+w*g,t[9]=b*i+x*c+k*h+w*v,t[10]=b*a+x*l+k*d+w*m,t[11]=b*o+x*u+k*p+w*y,b=n[12],x=n[13],k=n[14],w=n[15],t[12]=b*r+x*s+k*f+w*g,t[13]=b*i+x*c+k*h+w*v,t[14]=b*a+x*l+k*d+w*m,t[15]=b*o+x*u+k*p+w*y,t}function kt(t,e,n){var r,i,a,o,s,c,l,u,f,h,d,p,g=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*v+f*m+e[12],t[13]=i*g+c*v+h*m+e[13],t[14]=a*g+l*v+d*m+e[14],t[15]=o*g+u*v+p*m+e[15]),t}function wt(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Mt(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+l*r,t[5]=o*i+u*r,t[6]=s*i+f*r,t[7]=c*i+h*r,t[8]=l*i-a*r,t[9]=u*i-o*r,t[10]=f*i-s*r,t[11]=h*i-c*r,t}function Ot(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-l*r,t[1]=o*i-u*r,t[2]=s*i-f*r,t[3]=c*i-h*r,t[8]=a*r+l*i,t[9]=o*r+u*i,t[10]=s*r+f*i,t[11]=c*r+h*i,t}function Et(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function St(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function At(t,e,n){var r,i,a,o=n[0],s=n[1],c=n[2],l=Math.hypot(o,s,c);return l<st?null:(o*=l=1/l,s*=l,c*=l,r=Math.sin(e),a=1-(i=Math.cos(e)),t[0]=o*o*a+i,t[1]=s*o*a+c*r,t[2]=c*o*a-s*r,t[3]=0,t[4]=o*s*a-c*r,t[5]=s*s*a+i,t[6]=c*s*a+o*r,t[7]=0,t[8]=o*c*a+s*r,t[9]=s*c*a-o*r,t[10]=c*c*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function _t(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Tt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Pt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ct(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,c=i+i,l=a+a,u=r*s,f=r*c,h=r*l,d=i*c,p=i*l,g=a*l,v=o*s,m=o*c,y=o*l;return t[0]=1-(d+g),t[1]=f+y,t[2]=h-m,t[3]=0,t[4]=f-y,t[5]=1-(u+g),t[6]=p+v,t[7]=0,t[8]=h+m,t[9]=p-v,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Lt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Nt(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(c,l,u),t}function jt(t,e){var n=new ct(3);Nt(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,s=e[1]*i,c=e[2]*a,l=e[4]*r,u=e[5]*i,f=e[6]*a,h=e[8]*r,d=e[9]*i,p=e[10]*a,g=o+u+p,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-d)/v,t[1]=(h-c)/v,t[2]=(s-l)/v):o>u&&o>p?(v=2*Math.sqrt(1+o-u-p),t[3]=(f-d)/v,t[0]=.25*v,t[1]=(s+l)/v,t[2]=(h+c)/v):u>p?(v=2*Math.sqrt(1+u-o-p),t[3]=(h-c)/v,t[0]=(s+l)/v,t[1]=.25*v,t[2]=(f+d)/v):(v=2*Math.sqrt(1+p-o-u),t[3]=(s-l)/v,t[0]=(h+c)/v,t[1]=(f+d)/v,t[2]=.25*v),t}function Rt(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],c=e[3],l=a+a,u=o+o,f=s+s,h=a*l,d=a*u,p=a*f,g=o*u,v=o*f,m=s*f,y=c*l,b=c*u,x=c*f,k=r[0],w=r[1],M=r[2],O=i[0],E=i[1],S=i[2],A=(1-(g+m))*k,_=(d+x)*k,T=(p-b)*k,P=(d-x)*w,C=(1-(h+m))*w,L=(v+y)*w,N=(p+b)*M,j=(v-y)*M,R=(1-(h+g))*M;return t[0]=A,t[1]=_,t[2]=T,t[3]=0,t[4]=P,t[5]=C,t[6]=L,t[7]=0,t[8]=N,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+O-(A*O+P*E+N*S),t[13]=n[1]+E-(_*O+C*E+j*S),t[14]=n[2]+S-(T*O+L*E+R*S),t[15]=1,t}function It(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,f=r*s,h=i*o,d=i*s,p=i*c,g=a*o,v=a*s,m=a*c;return t[0]=1-f-p,t[1]=u+m,t[2]=h-v,t[3]=0,t[4]=u-m,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+v,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Dt(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(r-i),t[10]=(i+r)*a,t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}var Bt=Dt;function Ft(t,e,n,r,i,a,o){var s=1/(e-n),c=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(o+a)*l,t[15]=1,t}var zt=Ft;function Gt(t,e,n,r,i,a,o){var s=1/(e-n),c=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=a*l,t[15]=1,t}function Wt(t,e,n,r){var i,a,o,s,c,l,u,f,h,d,p=e[0],g=e[1],v=e[2],m=r[0],y=r[1],b=r[2],x=n[0],k=n[1],w=n[2];return Math.abs(p-x)<st&&Math.abs(g-k)<st&&Math.abs(v-w)<st?vt(t):(u=p-x,f=g-k,h=v-w,i=y*(h*=d=1/Math.hypot(u,f,h))-b*(f*=d),a=b*(u*=d)-m*h,o=m*f-y*u,(d=Math.hypot(i,a,o))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),s=f*o-h*a,c=h*i-u*o,l=u*a-f*i,(d=Math.hypot(s,c,l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=a,t[5]=c,t[6]=f,t[7]=0,t[8]=o,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*p+a*g+o*v),t[13]=-(s*p+c*g+l*v),t[14]=-(u*p+f*g+h*v),t[15]=1,t)}function $t(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Yt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}var Ht=xt,Vt=$t,qt=Object.freeze({__proto__:null,create:ft,clone:ht,copy:dt,fromValues:pt,set:gt,identity:vt,transpose:mt,invert:yt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15];return t[0]=s*(h*m-d*v)-f*(c*m-l*v)+g*(c*d-l*h),t[1]=-(r*(h*m-d*v)-f*(i*m-a*v)+g*(i*d-a*h)),t[2]=r*(c*m-l*v)-s*(i*m-a*v)+g*(i*l-a*c),t[3]=-(r*(c*d-l*h)-s*(i*d-a*h)+f*(i*l-a*c)),t[4]=-(o*(h*m-d*v)-u*(c*m-l*v)+p*(c*d-l*h)),t[5]=n*(h*m-d*v)-u*(i*m-a*v)+p*(i*d-a*h),t[6]=-(n*(c*m-l*v)-o*(i*m-a*v)+p*(i*l-a*c)),t[7]=n*(c*d-l*h)-o*(i*d-a*h)+u*(i*l-a*c),t[8]=o*(f*m-d*g)-u*(s*m-l*g)+p*(s*d-l*f),t[9]=-(n*(f*m-d*g)-u*(r*m-a*g)+p*(r*d-a*f)),t[10]=n*(s*m-l*g)-o*(r*m-a*g)+p*(r*l-a*s),t[11]=-(n*(s*d-l*f)-o*(r*d-a*f)+u*(r*l-a*s)),t[12]=-(o*(f*v-h*g)-u*(s*v-c*g)+p*(s*h-c*f)),t[13]=n*(f*v-h*g)-u*(r*v-i*g)+p*(r*h-i*f),t[14]=-(n*(s*v-c*g)-o*(r*v-i*g)+p*(r*c-i*s)),t[15]=n*(s*h-c*f)-o*(r*h-i*f)+u*(r*c-i*s),t},determinant:bt,multiply:xt,translate:kt,scale:wt,rotate:function(t,e,n,r){var i,a,o,s,c,l,u,f,h,d,p,g,v,m,y,b,x,k,w,M,O,E,S,A,_=r[0],T=r[1],P=r[2],C=Math.hypot(_,T,P);return C<st?null:(_*=C=1/C,T*=C,P*=C,i=Math.sin(n),o=1-(a=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],v=e[9],m=e[10],y=e[11],b=_*_*o+a,x=T*_*o+P*i,k=P*_*o-T*i,w=_*T*o-P*i,M=T*T*o+a,O=P*T*o+_*i,E=_*P*o+T*i,S=T*P*o-_*i,A=P*P*o+a,t[0]=s*b+f*x+g*k,t[1]=c*b+h*x+v*k,t[2]=l*b+d*x+m*k,t[3]=u*b+p*x+y*k,t[4]=s*w+f*M+g*O,t[5]=c*w+h*M+v*O,t[6]=l*w+d*M+m*O,t[7]=u*w+p*M+y*O,t[8]=s*E+f*S+g*A,t[9]=c*E+h*S+v*A,t[10]=l*E+d*S+m*A,t[11]=u*E+p*S+y*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:Mt,rotateY:Ot,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+l*r,t[1]=o*i+u*r,t[2]=s*i+f*r,t[3]=c*i+h*r,t[4]=l*i-a*r,t[5]=u*i-o*r,t[6]=f*i-s*r,t[7]=h*i-c*r,t},fromTranslation:Et,fromScaling:St,fromRotation:At,fromXRotation:_t,fromYRotation:Tt,fromZRotation:Pt,fromRotationTranslation:Ct,fromQuat2:function(t,e){var n=new ct(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+a*a+o*o;return f>0?(n[0]=2*(s*o+u*r+c*a-l*i)/f,n[1]=2*(c*o+u*i+l*r-s*a)/f,n[2]=2*(l*o+u*a+s*i-c*r)/f):(n[0]=2*(s*o+u*r+c*a-l*i),n[1]=2*(c*o+u*i+l*r-s*a),n[2]=2*(l*o+u*a+s*i-c*r)),Ct(t,e,n),t},getTranslation:Lt,getScaling:Nt,getRotation:jt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],c=i+i,l=a+a,u=o+o,f=i*c,h=i*l,d=i*u,p=a*l,g=a*u,v=o*u,m=s*c,y=s*l,b=s*u,x=r[0],k=r[1],w=r[2];return t[0]=(1-(p+v))*x,t[1]=(h+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(h-b)*k,t[5]=(1-(f+v))*k,t[6]=(g+m)*k,t[7]=0,t[8]=(d+y)*w,t[9]=(g-m)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Rt,fromQuat:It,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),c=1/(i-r),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},perspectiveNO:Dt,perspective:Bt,perspectiveZO:function(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(r-i),t[10]=i*a,t[14]=i*r*a):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(o+s),l=2/(i+a);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*c*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Ft,ortho:zt,orthoZO:Gt,lookAt:Wt,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=a-n[1],h=o-n[2],d=u*u+f*f+h*h;d>0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,g=l*u-s*h,v=s*f-c*u;return(d=p*p+g*g+v*v)>0&&(p*=d=1/Math.sqrt(d),g*=d,v*=d),t[0]=p,t[1]=g,t[2]=v,t[3]=0,t[4]=f*v-h*g,t[5]=h*p-u*v,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:$t,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:Yt,equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],v=t[14],m=t[15],y=e[0],b=e[1],x=e[2],k=e[3],w=e[4],M=e[5],O=e[6],E=e[7],S=e[8],A=e[9],_=e[10],T=e[11],P=e[12],C=e[13],L=e[14],N=e[15];return Math.abs(n-y)<=st*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-b)<=st*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=st*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-k)<=st*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(o-w)<=st*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=st*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(c-O)<=st*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=st*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-S)<=st*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=st*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(h-_)<=st*Math.max(1,Math.abs(h),Math.abs(_))&&Math.abs(d-T)<=st*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-P)<=st*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=st*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(v-L)<=st*Math.max(1,Math.abs(v),Math.abs(L))&&Math.abs(m-N)<=st*Math.max(1,Math.abs(m),Math.abs(N))},mul:Ht,sub:Vt});function Ut(){var t=new ct(3);return ct!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Xt(t){var e=new ct(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Zt(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Kt(t,e,n){var r=new ct(3);return r[0]=t,r[1]=e,r[2]=n,r}function Qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Jt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function te(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function ee(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ne(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function re(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function ie(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],c=n[2];return t[0]=i*c-a*s,t[1]=a*o-r*c,t[2]=r*s-i*o,t}function oe(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t}function se(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function ce(t,e,n){var r=e[0],i=e[1],a=e[2];return t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8],t}function le(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(n-a)<=st*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=st*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=st*Math.max(1,Math.abs(i),Math.abs(s))}var ue=ee,fe=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},he=Zt;function de(){var t=new ct(4);return ct!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function pe(t,e,n,r){var i=new ct(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function ge(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}function ve(){var t=new ct(4);return ct!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function me(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function ye(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+o*s+i*l-a*c,t[1]=i*u+o*c+a*s-r*l,t[2]=a*u+o*l+r*c-i*s,t[3]=o*u-r*s-i*c-a*l,t}function be(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function xe(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=a*c*u-o*s*l,t[1]=o*s*u+a*c*l,t[2]=o*c*l-a*s*u,t[3]=o*c*u+a*s*l,t}Ut(),function(){var t=de()}();var ke=pe,we=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Me=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Oe=ye,Ee=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t};function Se(){var t=new ct(2);return ct!=Float32Array&&(t[0]=0,t[1]=0),t}Ut(),Kt(1,0,0),Kt(0,1,0),ve(),ve(),lt(),function(){var t=Se()}();var Ae=function(t,e){return Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ae(t,e)};function _e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ae(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Te=function(){return Te=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Te.apply(this,arguments)};function Pe(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function Ce(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o}function Le(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}c((r=r.apply(t,e||[])).next())}))}function Ne(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function je(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function Re(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function Ie(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var De={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Be(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Fe={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ze(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Fe[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Ge(t){return ze(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function We(t){return Ge(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function $e(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Fe[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Fe[n]))),Fe[n]););}function Ye(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function He(t){return t>=48&&t<=57||43===t||45===t||46===t}function Ve(t){return t>=48&&t<=57}function qe(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,c=!1,l=!1;if(a>=n)t.err="[path-util]: Invalid path value at index ".concat(a,', "pathValue" is missing param');else if(43!==(e=r.charCodeAt(a))&&45!==e||(a+=1,e=r.charCodeAt(a)),Ve(e)||46===e){if(46!==e){if(o=48===e,a+=1,e=r.charCodeAt(a),o&&a<n&&e&&Ve(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;a<n&&Ve(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;Ve(r.charCodeAt(a));)a+=1,c=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid float exponent'));if(a+=1,43!==(e=r.charCodeAt(a))&&45!==e||(a+=1),!(a<n&&Ve(r.charCodeAt(a))))return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid integer exponent'));for(;a<n&&Ve(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" is not a number')}function Ue(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function Xe(t){for(var e=t.pathValue,n=t.max;t.index<n&&Ue(e.charCodeAt(t.index));)t.index+=1}function Ze(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=Fe[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Xe(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|i)||3!==o&&4!==o?qe(t):Ye(t),t.err.length)return;t.data.push(t.param),Xe(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Xe(t))}if(t.index>=t.max)break;if(!He(n.charCodeAt(t.index)))break}$e(t)}else $e(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var Ke=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Qe(t){if(Ge(t))return[].concat(t);var e=function(t){if(ze(t))return[].concat(t);var e=new Ke(t);for(Xe(e);e.index<e.max&&!e.err.length;)Ze(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,a=0;return e.map((function(t){var e,o=t.slice(1).map(Number),s=t[0],c=s.toUpperCase();if("M"===s)return n=o[0],r=o[1],i=n,a=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[c,o[0]+r];break;case"H":e=[c,o[0]+n];break;default:var l=o.map((function(t,e){return t+(e%2?r:n)}));e=[c].concat(l)}else e=[c].concat(o);var u=e.length;switch(c){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,a=r)}return e}))}function Je(t,e){var n=t[0],r=e.x1,i=e.y1,a=e.x2,o=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-a,u=2*i-o;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,h=2*i-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(s)}else if("Q"===n){var d=s[0],p=s[1];e.qx=d,e.qy=p}return c}function tn(t){if(We(t))return[].concat(t);for(var e=Qe(t),n=Te({},De),r=0;r<e.length;r+=1){e[r]=Je(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[a-3]||n.y1}return e}function en(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function nn(t,e,n,r,i,a,o,s,c,l){var u,f,h,d,p,g=t,v=e,m=n,y=r,b=s,x=c,k=120*Math.PI/180,w=Math.PI/180*(+i||0),M=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=en(g,v,-w)).x,v=u.y;var O=(g-(b=(u=en(b,x,-w)).x))/2,E=(v-(x=u.y))/2,S=O*O/(m*m)+E*E/(y*y);S>1&&(m*=S=Math.sqrt(S),y*=S);var A=m*m,_=y*y,T=(a===o?-1:1)*Math.sqrt(Math.abs((A*_-A*E*E-_*O*O)/(A*E*E+_*O*O)));d=T*m*E/y+(g+b)/2,p=T*-y*O/m+(v+x)/2,f=Math.asin(((v-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),h=Math.asin(((x-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),f=g<d?Math.PI-f:f,h=b<d?Math.PI-h:h,f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),o&&f>h&&(f-=2*Math.PI),!o&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>k){var C=h,L=b,N=x;h=f+k*(o&&h>f?1:-1),M=nn(b=d+m*Math.cos(h),x=p+y*Math.sin(h),m,y,i,0,o,L,N,[h,C,d,p])}P=h-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(h),D=Math.sin(h),B=Math.tan(P/4),F=4/3*m*B,z=4/3*y*B,G=[g,v],W=[g+F*R,v-z*j],$=[b+F*D,x-z*I],Y=[b,x];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat($,Y,M);for(var H=[],V=0,q=(M=W.concat($,Y,M)).length;V<q;V+=1)H[V]=V%2?en(M[V-1],M[V],w).y:en(M[V],M[V+1],w).x;return H}function rn(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var an=function(t,e,n,r){return Re(Re([],rn([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function on(t,e){var n,r,i,a,o,s,c,l,u,f=t[0],h=t.slice(1).map(Number),d=h[0],p=h[1],g=e.x1,v=e.y1,m=e.x,y=e.y;switch("TQ".includes(f)||(e.qx=null,e.qy=null),f){case"M":return e.x=d,e.y=p,t;case"A":return n=[g,v].concat(h),["C"].concat(nn(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=d,e.qy=p,n=[g,v].concat(h),["C"].concat((r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],[(l=1/3)*r+(u=2/3)*a,l*i+u*o,l*s+u*a,l*c+u*o,s,c]));case"L":return["C"].concat(an(g,v,d,p));case"Z":return g===m&&v===y?["C",g,v,m,y,m,y]:["C"].concat(an(g,v,m,y))}return t}function sn(t,e){if(void 0===e&&(e=!1),function(t){return We(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,a=tn(t),o=Te({},De),s=[],c="",l=a.length,u=[],f=0;f<l;f+=1){a[f]&&(c=a[f][0]),s[f]=c;var h=on(a[f],o);a[f]=h,Be(a,s,f),l=a.length,"Z"===c&&u.push(f),i=(r=a[f]).length,o.x1=+r[i-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,u]:a}function cn(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ln(t,e,n,r,i){var a=cn([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(i<=0)o={x:t,y:e};else if(i>=a)o={x:n,y:r};else{var s=rn([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function un(t,e){var n=t.x,r=t.y,i=e.x,a=e.y,o=n*i+r*a,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2)));return(n*a-r*i<0?-1:1)*Math.acos(o/s)}function fn(t,e,n,r,i,a,o,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,g=u(n),v=u(r),m=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===v)return ln(t,e,s,c,l).point;var y=(t-s)/2,b=(e-c)/2,x={x:h(m)*y+f(m)*b,y:-f(m)*y+h(m)*b},k=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(v,2);k>1&&(g*=d(k),v*=d(k));var w=(Math.pow(g,2)*Math.pow(v,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2)),M=(a!==o?1:-1)*d(w=w<0?0:w),O=M*(g*x.y/v),E=M*(-v*x.x/g),S=h(m)*O-f(m)*E+(t+s)/2,A=f(m)*O+h(m)*E+(e+c)/2,_={x:(x.x-O)/g,y:(x.y-E)/v},T=un({x:1,y:0},_),P=un(_,{x:(-x.x-O)/g,y:(-x.y-E)/v});!o&&P>0?P-=2*p:o&&P<0&&(P+=2*p);var C=T+(P%=2*p)*l,L=g*h(C),N=v*f(C);return{x:h(m)*L-f(m)*N+S,y:f(m)*L+h(m)*N+A}}function hn(t,e,n,r,i,a,o,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,g=void 0===p||p,v=u.sampleSize,m=void 0===v?30:v,y="number"==typeof l,b=t,x=e,k=0,w=[b,x,k],M=[b,x],O={x:0,y:0},E=[{x:b,y:x}];y&&l<=0&&(O={x:b,y:x});for(var S=0;S<=m;S+=1){if(b=(f=fn(t,e,n,r,i,a,o,s,c,S/m)).x,x=f.y,d&&E.push({x:b,y:x}),g&&(k+=cn(M,[b,x])),M=[b,x],y&&k>=l&&l>w[2]){var A=(k-l)/(k-w[2]);O={x:M[0]*(1-A)+w[0]*A,y:M[1]*(1-A)+w[1]*A}}w=[b,x,k]}return y&&l>=k&&(O={x:s,y:c}),{length:k,point:O,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function dn(t,e,n,r,i,a,o,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*a+Math.pow(c,3)*s}}function pn(t,e,n,r,i,a,o,s,c,l){var u,f=l.bbox,h=void 0===f||f,d=l.length,p=void 0===d||d,g=l.sampleSize,v=void 0===g?10:g,m="number"==typeof c,y=t,b=e,x=0,k=[y,b,x],w=[y,b],M={x:0,y:0},O=[{x:y,y:b}];m&&c<=0&&(M={x:y,y:b});for(var E=0;E<=v;E+=1){if(y=(u=dn(t,e,n,r,i,a,o,s,E/v)).x,b=u.y,h&&O.push({x:y,y:b}),p&&(x+=cn(w,[y,b])),w=[y,b],m&&x>=c&&c>k[2]){var S=(x-c)/(x-k[2]);M={x:w[0]*(1-S)+k[0]*S,y:w[1]*(1-S)+k[1]*S}}k=[y,b,x]}return m&&c>=x&&(M={x:o,y:s}),{length:x,point:M,min:{x:Math.min.apply(null,O.map((function(t){return t.x}))),y:Math.min.apply(null,O.map((function(t){return t.y})))},max:{x:Math.max.apply(null,O.map((function(t){return t.x}))),y:Math.max.apply(null,O.map((function(t){return t.y})))}}}function gn(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function vn(t,e,n,r,i,a,o,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof o,v=t,m=e,y=0,b=[v,m,y],x=[v,m],k={x:0,y:0},w=[{x:v,y:m}];g&&o<=0&&(k={x:v,y:m});for(var M=0;M<=p;M+=1){if(v=(c=gn(t,e,n,r,i,a,M/p)).x,m=c.y,u&&w.push({x:v,y:m}),h&&(y+=cn(x,[v,m])),x=[v,m],g&&y>=o&&o>b[2]){var O=(y-o)/(y-b[2]);k={x:x[0]*(1-O)+b[0]*O,y:x[1]*(1-O)+b[1]*O}}b=[v,m,y]}return g&&o>=y&&(k={x:i,y:a}),{length:y,point:k,min:{x:Math.min.apply(null,w.map((function(t){return t.x}))),y:Math.min.apply(null,w.map((function(t){return t.y})))},max:{x:Math.max.apply(null,w.map((function(t){return t.x}))),y:Math.max.apply(null,w.map((function(t){return t.y})))}}}function mn(t,e,n){for(var r,i,a,o,s,c,l,u,f,h=tn(t),d="number"==typeof e,p=[],g=0,v=0,m=0,y=0,b=[],x=[],k=0,w={x:0,y:0},M=w,O=w,E=w,S=0,A=0,_=h.length;A<_;A+=1)p=(l="M"===(u=(f=h[A])[0]))?p:[g,v].concat(f.slice(1)),l?(M=w={x:m=f[1],y:y=f[2]},k=0,d&&e<.001&&(E=w)):"L"===u?(k=(r=ln(p[0],p[1],p[2],p[3],(e||0)-S)).length,w=r.min,M=r.max,O=r.point):"A"===u?(k=(i=hn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,w=i.min,M=i.max,O=i.point):"C"===u?(k=(a=pn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,w=a.min,M=a.max,O=a.point):"Q"===u?(k=(o=vn(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,w=o.min,M=o.max,O=o.point):"Z"===u&&(k=(s=ln((p=[g,v,m,y])[0],p[1],p[2],p[3],(e||0)-S)).length,w=s.min,M=s.max,O=s.point),d&&S<e&&S+k>=e&&(E=O),x.push(M),b.push(w),S+=k,g=(c="Z"!==u?f.slice(-2):[m,y])[0],v=c[1];return d&&e>=S&&(E={x:g,y:v}),{length:S,point:E,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function yn(t){return function(t){var e=0,n=0,r=0;return sn(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a=t.slice(1),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=a[5];return r=function(t,e,n,r,i,a,o,s){return 3*((s-e)*(n+i)-(o-t)*(r+a)+r*(t-i)-n*(e-a)+s*(i+t/3)-o*(a+e/3))/20}(e,n,o,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function bn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?pn(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),o=rn(n,r,e),s=rn(r,i,e),c=rn(i,a,e),l=rn(o,s,e),u=rn(s,c,e),f=rn(l,u,e);return[["C"].concat(o,l,f),["C"].concat(u,c,a)]}(r):[t,t]:[t],l:i}}))}function xn(t,e,n){var r=bn(t),i=bn(e),a=r.length,o=i.length,s=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,f=n||Math.max(a,o),h=[l,u],d=[f-a,f-o],p=0,g=[r,i].map((function(t,e){return t.l===f?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&d[e]&&t.l>=h[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:xn(g[0],g[1],f)}function kn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function wn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function Mn(t,e){const n=wn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function On(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function En(t,e){const n=wn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function Sn(t,e){const n=[];for(const r of t)n[r]=e;return n}function An(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function _n(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=An(t,n);if(null!==e)return[e,r]}}return[null,null]}function Tn(t){return!(t instanceof Date)&&"object"==typeof t}const Pn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{y1:Mn(Sn(t,0))}})]};function Cn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ln(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Nn(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e}while(i<a)}return i}return 2!==t.length?(e=Cn,n=(e,n)=>Cn(t(e),n),r=(e,n)=>t(e)-n):(e=t===Cn||t===Ln?t:jn,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const o=i(t,e,n,a-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e}while(i<a)}return i}}}function jn(){return 0}function Rn(t){return null===t?NaN:+t}Pn.props={};const In=Nn(Cn),Dn=In.right,Bn=In.left,Fn=Nn(Rn).center;var zn=Dn;function Gn(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function Wn(t,e){const n=function(t,e){let n,r=0,i=0,a=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,a+=n*(e-i));else{let o=-1;for(let s of t)null!=(s=e(s,++o,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,a+=n*(s-i))}if(r>1)return a/(r-1)}(t,e);return n?Math.sqrt(n):n}function $n(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(void 0===n?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}class Yn extends Map{constructor(t,e=Vn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Hn(this,t))}has(t){return super.has(Hn(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function Hn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Vn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function qn(t){return t}function Un(t,...e){return Qn(t,qn,qn,e)}function Xn(t,...e){return Qn(t,Array.from,qn,e)}function Zn(t,e,...n){return Qn(t,qn,e,n)}function Kn(t,e,...n){return Qn(t,Array.from,e,n)}function Qn(t,e,n,r){return function t(i,a){if(a>=r.length)return n(i);const o=new Yn,s=r[a++];let c=-1;for(const t of i){const e=s(t,++c,i),n=o.get(e);n?n.push(t):o.set(e,[t])}for(const[e,n]of o)o.set(e,t(n,a));return e(o)}(t,0)}function Jn(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=er(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>er(n[t],n[e])))),function(t,e){return Array.from(e,(e=>t[e]))}(t,r)}return t.sort(tr(n))}function tr(t=Cn){if(t===Cn)return er;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function er(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var nr=Array.prototype.slice;function rr(t){return()=>t}const ir=Math.sqrt(50),ar=Math.sqrt(10),or=Math.sqrt(2);function sr(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=ir?10:a>=ar?5:a>=or?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?sr(t,e,2*n):[s,c,l]}function cr(t,e,n){return sr(t=+t,e=+e,n=+n)[2]}function lr(t){return Math.max(1,Math.ceil(Math.log(Gn(t))/Math.LN2)+1)}function ur(){var t=qn,e=$n,n=lr;function r(r){Array.isArray(r)||(r=Array.from(r));var i,a,o,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],h=n(c,u,f);if(!Array.isArray(h)){const t=f,n=+h;if(e===$n&&([u,f]=function(t,e,n){let r;for(;;){const i=cr(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,a,o]=r?sr(e,t,n):sr(t,e,n);if(!(a>=i))return[];const s=a-i+1,c=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)c[t]=(a-t)/-o;else for(let t=0;t<s;++t)c[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)c[t]=(i+t)/-o;else for(let t=0;t<s;++t)c[t]=(i+t)*o;return c}(u,f,n),h[0]<=u&&(o=cr(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===$n){const t=cr(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,g=d;h[p]<=u;)++p;for(;h[g-1]>f;)--g;(p||g<d)&&(h=h.slice(p,g),d=g-p);var v,m=new Array(d+1);for(i=0;i<=d;++i)(v=m[i]=[]).x0=i>0?h[i-1]:u,v.x1=i<d?h[i]:f;if(isFinite(o)){if(o>0)for(i=0;i<s;++i)null!=(a=c[i])&&u<=a&&a<=f&&m[Math.min(d,Math.floor((a-u)/o))].push(r[i]);else if(o<0)for(i=0;i<s;++i)if(null!=(a=c[i])&&u<=a&&a<=f){const t=Math.floor((u-a)*o);m[Math.min(d,t+(h[t]<=a))].push(r[i])}}else for(i=0;i<s;++i)null!=(a=c[i])&&u<=a&&a<=f&&m[zn(h,a,0,d)].push(r[i]);return m}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:rr(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:rr([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:rr(Array.isArray(t)?nr.call(t):t),r):n},r}function fr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function hr(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function dr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function pr(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function gr(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?er:tr(i);r>n;){if(r-n>600){const a=r-n+1,o=e-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);gr(t,e,Math.max(n,Math.floor(e-o*c/a+l)),Math.min(r,Math.floor(e+(a-o)*c/a+l)),i)}const a=t[e];let o=n,s=r;for(vr(t,n,e),i(t[r],a)>0&&vr(t,n,r);o<s;){for(vr(t,o,s),++o,--s;i(t[o],a)<0;)++o;for(;i(t[s],a)>0;)--s}0===i(t[n],a)?vr(t,n,s):(++s,vr(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function vr(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function mr(t,e,n=Rn){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>Rn(n(t[r],r,t)))),e<=0)return pr(r);if(e>=1)return hr(r);var r,i=Uint32Array.from(t,((t,e)=>e)),a=r.length-1,o=Math.floor(a*e);return gr(i,o,0,a,((t,e)=>er(r[t],r[e]))),o=function(t,e=Cn){let n,r=!1;if(1===e.length){let i;for(const a of t){const t=e(a);(r?Cn(t,i)>0:0===Cn(t,t))&&(n=a,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,o+1),(t=>r[t])),o>=0?o:-1}}function yr(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}function br(t,e){return function(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return dr(t);if(e>=1)return fr(t);var r,i=(r-1)*e,a=Math.floor(i),o=fr(gr(t,a).subarray(0,a+1));return o+(dr(t.subarray(a+1))-o)*(i-a)}}(t,.5,e)}function xr(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function kr(t){return t}function wr(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),kr)}function Mr(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function Or(t=""){throw new Error(t)}function Er(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||t.attr(e,i)}function Sr(t){return null!=t&&!Number.isNaN(t)}function Ar(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function _r(t,e){return Tr(t,e)||{}}function Tr(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[z(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function Pr(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function Cr(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function Lr(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Nr(t){return null===t||!1===t}function jr(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const a=e[i];S(a)&&S(t[i])?jr(t[i],a,n,r+1):t[i]=a}return t}}function Rr(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function Ir(t){return t.map(((t,e)=>e))}function Dr(t){return t[0]}function Br(t){return t[t.length-1]}function Fr(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function zr(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){zr(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}function Gr(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map((t=>{var e;return[t,null===(e=An(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>Sr(t)));return Array.from(Un(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function Wr(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:Cn(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Xr((n=>t(e[n])))}(t):"series"===t?Hr:"value"===t?Vr:"sum"===t?qr:"maxIndex"===t?Ur:null}function $r(t,e){for(const n of t)n.sort(e)}function Yr(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Hr(t,e,n){return Xr((t=>n[t]))}function Vr(t,e,n){return Xr((t=>e[t]))}function qr(t,e,n){const r=Ir(t),i=Array.from(Un(r,(t=>n[+t])).entries()),a=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return Xr((t=>a.get(n[t])))}function Ur(t,e,n){const r=Ir(t),i=Array.from(Un(r,(t=>n[+t])).entries()),a=new Map(i.map((([t,n])=>[t,hr(n,(t=>e[t]))])));return Xr((t=>a.get(n[t])))}function Xr(t){return(e,n)=>Cn(t(e),t(n))}const Zr=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:a="y1",series:o=!0}=t;return(t,s)=>{var c;const{data:l,encode:u,style:f={}}=s,[h,d]=An(u,"y"),[p,g]=An(u,"y1"),[v]=o?_n(u,"series","color"):An(u,"color"),m=Gr(e,t,s),y=(null!==(c=Wr(n))&&void 0!==c?c:()=>null)(l,h,v);y&&$r(m,y);const b=new Array(t.length),x=new Array(t.length),k=new Array(t.length),w=[],M=[];for(const t of m){r&&t.reverse();const e=p?+p[t[0]]:0,n=[],i=[];for(const r of t){const t=k[r]=+h[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const a=n.length>0?n:i,o=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===h[a[s]];)s--;for(;c<o.length-1&&0===h[o[c]];)c++;w.push(a[s]),M.push(o[c]);let l=e;for(const t of i.reverse()){const e=k[t];l=b[t]=(x[t]=l)+e}let u=e;for(const t of n){const e=k[t];e>0?u=b[t]=(x[t]=u)+e:b[t]=x[t]=u}}const O=new Set(w),E=new Set(M),S="y"===i?b:x,A="y"===a?b:x;let _;return _="point"===s.type?{y0:Mn(h,d),y:wn(S,d)}:{y0:Mn(h,d),y:wn(S,d),y1:wn(A,g)},[t,Z({},s,{encode:Object.assign({},_),style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>E.has(e)},f)})]}};function Kr(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Zr.props={};const Qr=t=>(e,n,r)=>{const{encode:i,transform:a=[]}=n;if(a.some(Kr))return[e,n];const{x:o,y:s}=i;if(void 0===o||void 0===s)return[e,n];const{series:c}=t;return Zr({groupBy:c?["x","series"]:"x"})(e,n,r)};function Jr(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function ti(t){const e=`${t.getFullYear()}-${Jr(t.getMonth()+1)}-${Jr(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${Jr(n)}:${Jr(r)}:${Jr(i)}`:e}Qr.props={};const ei=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(Nr(i))return[t,n];const{title:a}=i;if(void 0!==a)return[t,n];const o=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>An(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===o.length)return[t,n];const s=[];for(const e of t)s[e]={value:o.map((t=>t[e]instanceof Date?ti(t[e]):t[e])).join(", ")};return[t,Z({},n,{tooltip:{title:s}})]}};ei.props={};const ni=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{x:Mn(Sn(t,0))},scale:{x:{guide:null}}})]};ni.props={};const ri=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{y:Mn(Sn(t,0))},scale:{y:{guide:null}}})]};ri.props={};const ii=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{z:Mn(Sn(t,0))},scale:{z:{guide:null}}})]};ii.props={};const ai=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{size:On(Sn(t,3))}})]};ai.props={};const oi=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=Pe(n,["key"]);if(void 0!==r)return[t,e];const a=Object.values(i).map((({value:t})=>t)),o=t.map((t=>a.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,Z({},e,{encode:{key:wn(o)}})]};oi.props={};const si=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[a,o]=An(n,"color");return[t,Z({},e,{encode:{series:wn(a,o)}})]};si.props={};const ci=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Tn)?[t,e]:[t,Z({},e,{encode:{y:wn(n)}})]};ci.props={};const li=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Tn)?[t,e]:[t,Z({},e,{encode:{x:wn(n)}})]};li.props={};const ui=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=An(n,"y");return[t,Z({},e,{encode:{y1:wn([...i])}})]};ui.props={};const fi=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=An(n,"x");return[t,Z({},e,{encode:{x1:wn([...i])}})]};fi.props={};const hi=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Tn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,Z({},e,{encode:{x:wn(r(n,0)),x1:wn(r(n,1))}})]}return[t,e]};hi.props={};const di=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Tn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,Z({},e,{encode:{y:wn(r(n,0)),y1:wn(r(n,1))}})]}return[t,e]};di.props={};const pi=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(Nr(i))return[t,n];const{items:a=[]}=i;if(!a||a.length>0)return[t,n];const o=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:a}=r[t];return i?null:a&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,Z({},n,{tooltip:{items:o}})]}};pi.props={};const gi=()=>(t,e)=>[t,Z({scale:{x:{padding:0},y:{padding:0}}},e)];gi.props={};const vi=()=>(t,e)=>{const{data:n,style:r={}}=e,i=Pe(e,["data","style"]),{x:a,y:o}=r,s=Pe(r,["x","y"]);if(null==a||null==o)return[t,e];const c=o||0;return[[0],Z({},i,{data:[0],cartesian:!0,encode:{x:wn([a||0]),y:wn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};vi.props={};const mi=()=>(t,e)=>{const{style:n={}}=e;return[t,Z({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};mi.props={};const yi=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(Tn))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),a=r.map((t=>t[1]));return[t,Z({},e,{encode:{x:wn(i),y:wn(a)}})]};yi.props={};const bi=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:a}=n;return!a||i?[t,e]:[t,Z({},e,{encode:{series:On(Sn(t,void 0))}})]};bi.props={};const xi=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return Pe(t,["groupBy","reverse","orderBy","padding"]),(t,a)=>{const{data:o,encode:s,scale:c}=a,{series:l}=c,[u]=An(s,"y"),[f]=_n(s,"series","color"),h=Yr(f,l),d=Z({},a,{scale:{series:{domain:h,paddingInner:i}}}),p=Gr(e,t,a),g=Wr(r);if(!g)return[t,Z(d,{encode:{series:wn(f)}})];const v=g(o,u,f);v&&$r(p,v);const m=new Array(t.length);for(const t of p){n&&t.reverse();for(let e=0;e<t.length;e++)m[t[e]]=h[e]}return[t,Z(d,{encode:{series:wn(r?m:f)}})]}};xi.props={};const ki=t=>{const{groupBy:e=["x"],reducer:n=(t,e)=>e[t[0]],orderBy:r=null,reverse:i=!1,duration:a}=t;return(t,o)=>{const{encode:s}=o,c=(Array.isArray(e)?e:[e]).map((t=>[t,An(s,t)[0]]));if(0===c.length)return[t,o];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(Un(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=An(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(a||3e3)/l.length,[f]=a?[Sn(t,u)]:_n(s,"enterDuration",Sn(t,u)),[h]=_n(s,"enterDelay",Sn(t,0)),d=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=fr(n,(t=>+f[t]));for(const t of n)d[t]=+h[t]+e;e+=r}return[t,Z({},o,{encode:{enterDuration:On(f),enterDelay:On(d)}})]}};ki.props={};const wi=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:a}=r,o=Pe(i,["x"]),s=Object.entries(o).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,An(i,t)[0]])),[,c]=s.find((([t])=>"y"===t)),l=s.map((([e])=>[e,new Array(t.length)])),u=Gr(e,t,r),f=function(t){return"function"==typeof t?t:{min:(t,e)=>dr(t,(t=>e[+t])),max:(t,e)=>fr(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>yr(t,(t=>e[+t])),median:(t,e)=>br(t,(t=>e[+t])),sum:(t,e)=>xr(t,(t=>e[+t])),deviation:(t,e)=>Wn(t,(t=>e[+t]))}[t]||fr}(n);for(const t of u){const e=f(t,c);for(const n of t)for(let t=0;t<s.length;t++){const[,r]=s[t],[,i]=l[t];i[n]=+r[n]/e}}const h=Nr(a)||(null==a?void 0:a.items)&&0!==(null==a?void 0:a.items.length);return[t,Z({},r,Object.assign({encode:Object.fromEntries(l.map((([t,e])=>[t,wn(e,An(i,t)[1])])))},!h&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function Mi(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function Oi(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function Ei(t,e,n,r,i){let a=n||0,o=r||t.length;const s=i||(t=>t);for(;a<o;){const n=Math.floor((a+o)/2);s(t[n])>e?o=n:a=n+1}return a}wi.props={};const Si=Math.sqrt(50),Ai=Math.sqrt(10),_i=Math.sqrt(2);function Ti(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/10**i;return i>=0?(a>=Si?10:a>=Ai?5:a>=_i?2:1)*10**i:-(10**-i)/(a>=Si?10:a>=Ai?5:a>=_i?2:1)}function Pi(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const a=r/i;return a>=Si?i*=10:a>=Ai?i*=5:a>=_i&&(i*=2),e<t?-i:i}const Ci=(t,e,n=5)=>{const r=[t,e];let i,a=0,o=r.length-1,s=r[a],c=r[o];return c<s&&([s,c]=[c,s],[a,o]=[o,a]),i=Ti(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=Ti(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=Ti(s,c,n)),i>0?(r[a]=Math.floor(s/i)*i,r[o]=Math.ceil(c/i)*i):i<0&&(r[a]=Math.ceil(s*i)/i,r[o]=Math.floor(c*i)/i),r},Li=1e3,Ni=6e4,ji=36e5,Ri=864e5,Ii=6048e5,Di=2592e6,Bi=31536e6;function Fi(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let a=e;for(;a&&!i(t);)n(t,-1),a-=1})(t,i),e(t)},a=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:a,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,o)=>{const s=[],c=Math.floor(r);for(let l=o?a(t,r):a(t);l<e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const zi=Fi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Gi=Fi(Li,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Li*e)}),(t=>t.getSeconds())),Wi=Fi(Ni,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Ni*e)}),(t=>t.getMinutes())),$i=Fi(ji,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+ji*e)}),(t=>t.getHours())),Yi=Fi(Ri,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ri*e)}),(t=>t.getDate()-1)),Hi=Fi(Di,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),Vi=Fi(Ii,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setDate(t.getDate()+7*e)}),(t=>{const e=Hi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Ii)})),qi=Fi(Bi,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),Ui={millisecond:zi,second:Gi,minute:Wi,hour:$i,day:Yi,week:Vi,month:Hi,year:qi},Xi=Fi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Zi=Fi(Li,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Li*e)}),(t=>t.getUTCSeconds())),Ki=Fi(Ni,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Ni*e)}),(t=>t.getUTCMinutes())),Qi=Fi(ji,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+ji*e)}),(t=>t.getUTCHours())),Ji=Fi(Ri,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ri*e)}),(t=>t.getUTCDate()-1)),ta=Fi(Di,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),ea=Fi(Ii,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ii*e)}),(t=>{const e=ta.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Ii)})),na=Fi(Bi,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),ra={millisecond:Xi,second:Zi,minute:Ki,hour:Qi,day:Ji,week:ea,month:ta,year:na};function ia(t,e,n,r,i){const a=+t,o=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?ra:Ui,{year:n,month:r,week:i,day:a,hour:o,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[o,1],[o,3],[o,6],[o,12],[a,1],[a,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(o-a)/r:n||5,h=r||(o-a)/f,d=s.length,p=Ei(s,h,0,d,u);let g;if(p===d){g=[c,Pi(a/c.duration,o/c.duration,f)]}else if(p){const t=h/u(s[p-1])<u(s[p])/h,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max(Pi(a,o,f),1)]}return g}const aa=(t,e,n,r,i)=>{const a=t>e,o=a?e:t,s=a?t:e,[c,l]=ia(o,s,n,r,i),u=[c.floor(o,l),c.ceil(s,l)];return a?u.reverse():u};function oa(t){return!($(t)||(e=t,null===e)||Number.isNaN(t));var e}const sa=t=>e=>-t(-e),ca=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?sa(r):r},la=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?sa(n):n},ua=(t,e,n,r)=>{const i=t<0,a=ca(r,i),o=la(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[o(Math.floor(a(c))),o(Math.ceil(a(l)))];return s?u.reverse():u};var fa={exports:{}},ha={exports:{}},da=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},pa=Array.prototype.concat,ga=Array.prototype.slice,va=ha.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];da(i)?e=pa.call(e,ga.call(i)):e.push(i)}return e};va.wrap=function(t){return function(){return t(va(arguments))}};var ma={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ya=ha.exports,ba=Object.hasOwnProperty,xa=Object.create(null);for(var ka in ma)ba.call(ma,ka)&&(xa[ma[ka]]=ka);var wa=fa.exports={to:{},get:{}};function Ma(t,e,n){return Math.min(Math.max(e,t),n)}function Oa(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}wa.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=wa.get.hsl(t),n="hsl";break;case"hwb":e=wa.get.hwb(t),n="hwb";break;default:e=wa.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},wa.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var a=2*n;i[n]=parseInt(e.slice(a,a+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:ba.call(ma,e[1])?((i=ma[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=Ma(i[n],0,255);return i[3]=Ma(i[3],0,1),i},wa.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Ma(parseFloat(e[2]),0,100),Ma(parseFloat(e[3]),0,100),Ma(isNaN(n)?1:n,0,1)]}return null},wa.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Ma(parseFloat(e[2]),0,100),Ma(parseFloat(e[3]),0,100),Ma(isNaN(n)?1:n,0,1)]}return null},wa.to.hex=function(){var t=ya(arguments);return"#"+Oa(t[0])+Oa(t[1])+Oa(t[2])+(t[3]<1?Oa(Math.round(255*t[3])):"")},wa.to.rgb=function(){var t=ya(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},wa.to.rgb.percent=function(){var t=ya(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},wa.to.hsl=function(){var t=ya(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},wa.to.hwb=function(){var t=ya(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},wa.to.keyword=function(t){return xa[t.slice(0,3)]};var Ea=fa.exports;function Sa(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Aa(t){const e=Ea.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const a=r<.5?r*(1+n):r+n-r*n,o=2*r-a;return[255*Sa(o,a,e+1/3),255*Sa(o,a,e),255*Sa(o,a,e-1/3),i]}(r):null}const _a=(t,e)=>n=>t*(1-n)+e*n,Ta=(t,e)=>"number"==typeof t&&"number"==typeof e?_a(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Aa(t),r=Aa(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const a=n[i],o=r[i];e[i]=a*(1-t)+o*t}const[i,a,o,s]=e;return`rgba(${Math.round(i)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}})(t,e):()=>t,Pa=(t,e)=>{const n=_a(t,e);return t=>Math.round(n(t))};function Ca({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function La(t){return"object"==typeof t?t.valueOf():t}class Na extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=La,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Ca({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Ca({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class ja{constructor(t){this.options=Z({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Z({},this.options,t),this.rescale(t)}rescale(t){}}const Ra=Symbol("defaultUnknown");function Ia(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Da(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:a}=t;let o=i.get(e);if(void 0===o){if(a!==Ra)return a;o=n.push(e)-1,i.set(e,o)}return r[o%r.length]}function Ba(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Fa extends ja{getDefaultOptions(){return{domain:[],range:[],unknown:Ra}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Ia(this.domainIndexMap,this.getDomain(),this.domainKey),Da({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Ia(this.rangeIndexMap,this.getRange(),this.rangeKey),Da({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Ba(e),this.rangeKey=Ba(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Fa(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function za(t){return Math.round(1e12*t)/1e12}function Ga(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(a,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,v=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),m=v.reduce(((t,e)=>t+e)),y=g/m,b=new Na(e.map(((t,e)=>{const n=v[e]*y;return[t,o?Math.floor(n):n]}))),x=new Na(e.map(((t,e)=>{const n=v[e]*y+p;return[t,o?Math.floor(n):n]}))),k=Array.from(x.values()).reduce(((t,e)=>t+e)),w=u+(h-(k-k/c*i))*s;let M=o?Math.round(w):w;const O=new Array(c);for(let t=0;t<c;t+=1){O[t]=za(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class Wa extends Fa{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Ra,flex:[]}}constructor(t){super(t)}clone(){return new Wa(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:a,valueBandWidth:o,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Ga(t);const{range:i,paddingOuter:a,paddingInner:o,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*a,p=r-o;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-o))*c,u=l*(1-o),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map(((t,e)=>f+e*l));return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=o,this.adjustedRange=a}}const $a=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&n>0)return[a];let s=Ti(a,o,n);if(0===s||!Number.isFinite(s))return[];if(s>0){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i};class Ya extends ja{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:$a}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return j(r)&&j(i)?t(r,i,n):[]}clone(){return new Ya(this.options)}}function Ha(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const Va=[1,5,2,2.5,4,3],qa=100*Number.EPSILON;function Ua(t,e,n,r,i,a){const o=ot(e),s=K(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,a);return(l<qa||a-l<qa)&&r<=0&&i>=0&&(c=1),1-s/(o-1)-n+c}function Xa(t,e,n){const r=ot(e);return 1-K(e,t)/(r-1)-n+1}function Za(t,e,n,r,i,a){const o=(t-1)/(a-i),s=(e-1)/(Math.max(a,r)-Math.min(n,i));return 2-Math.max(o/s,s/o)}function Ka(t,e){return t>=e?2-(t-1)/(e-1):1}function Qa(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function Ja(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const to=(t,e,n=5,r=!0,i=Va,a=[.25,.2,.5,.05])=>{const o=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!o)return[];if(e-t<1e-15||1===o)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=Xa(l,i,c);if(a[0]*u+a[1]+a[2]+a[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=Ka(f,o);if(a[0]*u+a[1]+a[2]*n+a[3]<s.score)break;const h=(e-t)/(f+1)/c/l;let d=Math.ceil(Math.log10(h));for(;d<1/0;){const h=c*l*10**d,p=Ja(t,e,h*(f-1));if(a[0]*u+a[1]*p+a[2]*n+a[3]<s.score)break;const g=Math.floor(e/h)*c-(f-1)*c,v=Math.ceil(t/h)*c;if(g<=v){const n=v-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(h/c),d=n+h*(f-1),p=h,v=Ua(l,i,c,n,d,p),m=Qa(t,e,n,d),y=Za(f,o,t,e,n,d),b=1,x=a[0]*v+a[1]*m+a[2]*y+a[3]*b;x>s.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=Ha(s.lmax),u=Ha(s.lmin),f=Ha(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=Ha(u);for(let t=1;t<h;t+=1)d[t]=Ha(d[t-1]+f);return d};class eo extends ja{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:to}}map(t){return oa(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new eo(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return j(r)&&j(i)?n(r,i,e):[]}}const no=(t,e,n)=>{const[r,i]=t,[a,o]=e;let s,c;return r<i?(s=Oi(r,i),c=n(a,o)):(s=Oi(i,r),c=n(o,a)),Mi(c,s)},ro=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=t[0]>t[r],s=o?[...t].reverse():t,c=o?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=Oi(s[t],s[t+1]),a[t]=n(c[t],c[t+1]);return e=>{const n=Ei(t,e,1,r)-1,o=i[n];return Mi(a[n],o)(e)}},io=(t,e,n,r)=>(Math.min(t.length,e.length)>2?ro:no)(t,e,r?Pa:n);class ao extends ja{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:_a,tickCount:5}}map(t){return oa(t)?this.output(t):this.options.unknown}invert(t){return oa(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Ci}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):at}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:a}=this.options,o=io(n.map(t),r,a,i);this.output=Mi(o,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,a=io(i,r.map(t),_a);this.input=Mi(e,n,a)}}class oo extends ao{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Ta,tickMethod:$a,tickCount:5}}chooseTransforms(){return[at,at]}clone(){return new oo(this.options)}}class so extends Wa{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Ra,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new so(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const co=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class lo extends ao{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Ta,tickMethod:$a,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[at,at];const e=.5===t?co:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new lo(this.options)}}class uo extends lo{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Ta,tickMethod:$a,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new uo(this.options)}}class fo extends ja{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!oa(t))return this.options.unknown;const e=Ei(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new fo(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const ho=(t,e,n,r=10)=>{const i=t<0,a=la(r,i),o=ca(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=o(c),f=o(l),h=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=a(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}else for(;u<=f;u+=1){const t=a(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}2*h.length<n&&(h=$a(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=$a(u,f,t).map(a)}return s?h.reverse():h};class po extends ao{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Ta,tickMethod:ho,tickCount:5}}chooseNice(){return ua}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[ca(t,n),la(t,n)]}clone(){return new po(this.options)}}class go extends fo{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:to}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=Ci(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new go(this.options)}}function vo(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),a=t[i];return a+(t[i+1]-a)*(r-i)}class mo extends fo{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:to}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort(((t,e)=>t-e));const i=[];for(let t=1;t<e;t+=1)i.push(vo(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],a=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||a]}getThresholds(){return this.thresholds}clone(){return new mo(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var yo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,bo=/\[([^]*?)\]/gm;function xo(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function ko(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var a=i[r];for(var o in a)t[o]=a[o]}return t}var wo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Mo=["January","February","March","April","May","June","July","August","September","October","November","December"],Oo=xo(Mo,3),Eo=ko({},{dayNamesShort:xo(wo,3),dayNames:wo,monthNamesShort:Oo,monthNames:Mo,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),So=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Ao={D:function(t){return String(t.getDate())},DD:function(t){return So(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return So(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return So(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return So(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return So(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return So(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return So(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return So(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return So(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return So(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return So(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+So(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+So(Math.floor(Math.abs(e)/60),2)+":"+So(Math.abs(e)%60,2)}},_o={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const To=(t,e,n,r,i)=>{const a=t>e,o=a?e:t,s=a?t:e,[c,l]=ia(o,s,n,r,i),u=c.range(o,new Date(+s+1),l,!0);return a?u.reverse():u};function Po(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Co extends ao{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:To,interpolate:_a,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return aa}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?ra:Ui,r=e?Po:at;return e=>function(t,e,n){if(void 0===e&&(e=_o.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=_o[e]||e).replace(bo,(function(t,e){return r.push(e),"@@@"}));var i=ko(ko({},Eo),n);return(e=e.replace(yo,(function(e){return Ao[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:a,week:o,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":a.floor(t)<t?"hh A":s.floor(t)<t?o.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new Co(this.options)}}var Lo,No=window&&window.__decorate||function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o};let jo=Lo=class extends oo{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:at,tickMethod:$a,tickCount:5}}constructor(t){super(t)}clone(){return new Lo(this.options)}};function Ro(t,e,n){if(null===t)return[-.5,.5];const r=Yr(t,e),i=new Wa({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function Io(t,e,n){return e*(1-t)+n*t}jo=Lo=No([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:a}=this.getOptions(),o=e(r.map(t)),s=a?(t=>e=>{const n=t(e);return j(n)?Math.round(n):n})(i):i;this.output=Mi(s,o,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return Mi(_a(0,1),Oi(e,n))}))],jo);const Do=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:a,scale:o}=e,{x:s,y:c}=o,[l]=An(a,"x"),[u]=An(a,"y"),f=Ro(l,s,n),h=Ro(u,c,r),d=t.map((()=>Io(i(),...h))),p=t.map((()=>Io(i(),...f)));return[t,Z({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:wn(d),dx:wn(p)}})]}};Do.props={};const Bo=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:a}=r,{x:o}=a,[s]=An(i,"x"),c=Ro(s,o,e),l=t.map((()=>Io(n(),...c)));return[t,Z({scale:{x:{padding:.5}}},r,{encode:{dx:wn(l)}})]}};Bo.props={};const Fo=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:a}=r,{y:o}=a,[s]=An(i,"y"),c=Ro(s,o,e),l=t.map((()=>Io(n(),...c)));return[t,Z({scale:{y:{padding:.5}}},r,{encode:{dy:wn(l)}})]}};Fo.props={};const zo=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=Pe(r,["x"]),a=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,An(r,t)[0]])),o=a.map((([e])=>[e,new Array(t.length)])),s=Gr(e,t,n),c=new Array(s.length);for(let t=0;t<s.length;t++){const e=s[t].flatMap((t=>a.map((([,e])=>+e[t])))),[n,r]=$n(e);c[t]=(n+r)/2}const l=Math.max(...c);for(let t=0;t<s.length;t++){const e=l-c[t],n=s[t];for(const t of n)for(let n=0;n<a.length;n++){const[,r]=a[n],[,i]=o[n];i[t]=+r[t]+e}}return[t,Z({},n,{encode:Object.fromEntries(o.map((([t,e])=>[t,wn(e,An(r,t)[1])])))})]}};zo.props={};const Go=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[a]=An(i,"y"),[o,s]=An(i,"y1");n?_n(i,"series","color"):An(i,"color");const c=Gr(e,t,r),l=new Array(t.length);for(const t of c){const e=t.map((t=>+a[t]));for(let n=0;n<t.length;n++){const r=t[n],i=Math.max(...e.filter(((t,e)=>e!==n)));l[r]=+a[r]>i?i:a[r]}}return[t,Z({},r,{encode:{y1:wn(l,s)}})]}};function Wo(t,e){return[t[0]]}function $o(t,e){return[t[t.length-1]]}function Yo(t,e){return[t[hr(t,(t=>e[t]))]]}function Ho(t,e){return[t[pr(t,(t=>e[t]))]]}Go.props={};const Vo=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:a}=i,o=Gr(e,t,i),[s]=An(a,n),c=function(t){return"function"==typeof t?t:{first:Wo,last:$o,max:Yo,min:Ho}[t]||Wo}(r);return[o.flatMap((t=>c(t,s))),i]}};Vo.props={};const qo=(t={})=>{const{selector:e}=t,n=Pe(t,["selector"]);return Vo(Object.assign({channel:"x",selector:e},n))};qo.props={};const Uo=(t={})=>{const{selector:e}=t,n=Pe(t,["selector"]);return Vo(Object.assign({channel:"y",selector:e},n))};function Xo(t){return e=>null===e?t:`${t} of ${e}`}function Zo(){return[(t,e)=>yr(t,(t=>+e[t])),Xo("mean")]}function Ko(){return[(t,e)=>br(t,(t=>+e[t])),Xo("median")]}function Qo(){return[(t,e)=>fr(t,(t=>+e[t])),Xo("max")]}function Jo(){return[(t,e)=>dr(t,(t=>+e[t])),Xo("min")]}function ts(){return[(t,e)=>t.length,Xo("count")]}function es(){return[(t,e)=>xr(t,(t=>+e[t])),Xo("sum")]}function ns(){return[(t,e)=>e[t[0]],Xo("first")]}function rs(){return[(t,e)=>e[t[t.length-1]],Xo("last")]}Uo.props={};const is=(t={})=>{const{groupBy:e}=t,n=Pe(t,["groupBy"]);return(t,r)=>{const{data:i,encode:a}=r,o=e(t,r);if(!o)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:Zo,max:Qo,count:ts,first:ns,last:rs,sum:es,min:Jo,median:Ko}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=An(a,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=An(a,n);return r})(c,e),u=o.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},En(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(a).map((t=>{const[e,n]=An(a,t),r=o.map((t=>e[t[0]]));return[t,wn(r,n)]})),l=o.map((t=>i[t[0]]));return[Ir(o),Z({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};is.props={};const as=(t={})=>{const{channels:e=["x","y"]}=t,n=Pe(t,["channels"]);return is(Object.assign(Object.assign({},n),{groupBy:(t,n)=>Gr(e,t,n)}))};as.props={};const os=(t={})=>as(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));os.props={};const ss=(t={})=>as(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));ss.props={};const cs=(t={})=>as(Object.assign(Object.assign({},t),{channels:["color"]}));function ls(t,e,n){var r;const{reverse:i,slice:a,channel:o}=n,s=Pe(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[o])||void 0===r?void 0:r.domain,[f]=An(c,o),h=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=An(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>fr(t,(t=>+a[t]));if("min"===i)return t=>dr(t,(t=>+a[t]));if("sum"===i)return t=>xr(t,(t=>+a[t]));if("median"===i)return t=>br(t,(t=>+a[t]));if("mean"===i)return t=>yr(t,(t=>+a[t]));if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(o,s,c),d=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,f,u),p=function(t,e,n){return(2!==e.length?Jn(Zn(t,e,n),(([t,e],[n,r])=>Cn(e,r)||Cn(t,n))):Jn(Un(t,n),(([t,n],[r,i])=>e(n,i)||Cn(t,r)))).map((([t])=>t))}(d,h,(t=>f[t]));i&&p.reverse();const g="number"==typeof a?[0,a]:a,v=a?p.slice(...g):p;return[t,Z(e,{scale:{[o]:{domain:v}}})]}cs.props={};const us=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,a=Pe(t,["reverse","slice","channel","ordinal"]);return(t,o)=>i?ls(t,o,Object.assign({reverse:e,slice:n,channel:r},a)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:a}=e,[o]=An(a,i),s=Jn(t,(t=>o[t]));return r&&s.reverse(),[s,e]}(t,o,Object.assign({reverse:e,slice:n,channel:r},a))};us.props={};const fs=(t={})=>us(Object.assign(Object.assign({},t),{channel:"x"}));fs.props={};const hs=(t={})=>us(Object.assign(Object.assign({},t),{channel:"color"}));hs.props={};const ds=(t={})=>us(Object.assign(Object.assign({},t),{channel:"y"}));ds.props={};const ps=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:a,encode:o}=i,[s]=An(o,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(a,e):An(o,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>xr(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=Kn(t,l,(t=>s[t])).map((t=>t[1]));return[t,Z({},i,{scale:{x:{flex:u}}})]}};function gs([t,e],[n,r]){return[t-n,e-r]}function vs([t,e],[n,r]){return[t+n,e+r]}function ms([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function ys([t,e]){return Math.atan2(e,t)}function bs([t,e]){return ys([t,e])+Math.PI/2}function xs(t,e){const n=ys(t),r=ys(e);return n<r?r-n:2*Math.PI-(n-r)}function ks(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[a,o]of t)e=Math.min(a,e),n=Math.max(a,n),r=Math.min(o,r),i=Math.max(o,i);return[e,r,n-e,i-r]}function ws([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function Ms(t){const{padding:e=0,direction:n="col"}=t;return(t,r,i)=>{const a=t.length;if(0===a)return[];const{innerWidth:o,innerHeight:s}=i,c=s/o;let l=Math.ceil(Math.sqrt(r/c)),u=o/l,f=Math.ceil(r/l),h=f*u;for(;h>s;)l+=1,u=o/l,f=Math.ceil(r/l),h=f*u;const d=s-f*u,p=f<=1?0:d/(f-1),[g,v]=f<=1?[(o-a*u)/(a-1),(s-u)/2]:[0,0];return t.map(((t,r)=>{const[i,a,o,s]=ks(t),c="col"===n?r%l:Math.floor(r/f),h="col"===n?Math.floor(r/l):r%f;return`translate(${c*u-i+g*c+.5*e}, ${(f-h-1)*u+d-a-p*h-v+.5*e}) scale(${(u-e)/o}, ${(u-e)/s})`}))}}ps.props={};const Os=t=>(e,n)=>[e,Z({},n,{modifier:Ms(t),axis:!1})];Os.props={};const Es="thresholds";function Ss(t){const[e,n]=$n(t);return Math.min(200,function(t,e,n){const r=Gn(t),i=Wn(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const As=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=Pe(t,["groupChannels","binChannels"]),i={};return is(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(Es))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,a)=>{const{encode:o}=a,s=n.map((t=>{const[e]=An(o,t);return e})),c=_r(r,Es),l=t.filter((t=>s.every((e=>Sr(e[t]))))),u=[...e.map((t=>{const[e]=An(o,t);return e})).filter(Sr).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||Ss(n),a=ur().thresholds(r).value((t=>+n[t]))(l),o=new Map(a.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=o,t=>o.get(t)}))];return Array.from(Un(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};As.props={};const _s=(t={})=>{const{thresholds:e}=t;return As(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function Ts(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const a=n=>1*e[t[n]],o=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,h=0;s.push(h);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,d=Math.floor((t+2)*c)+1;d=Math.min(d,i);const p=d-r;for(;r<d;r++)e+=a(r),n+=o(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const v=Math.floor((t+1)*c)+1,m=[a(h),o(h)];for(l=u=-1;g<v;g++)u=.5*Math.abs((m[0]-e)*(a(g)-m[1])-(m[0]-o(g))*(n-m[0])),u>l&&(l=u,f=g);s.push(f),h=f}return s.push(i-1),s.map((e=>t[e]))}_s.props={};const Ps=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return Ts;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[pr(t,(t=>n[t]))]],max:(t,e,n)=>[t[hr(t,(t=>n[t]))]],median:(t,e,n)=>{return[t[(r=t,i=t=>n[t],mr(r,.5,i))]];var r,i}},n=e[t]||e.median;return(t,e,r,i)=>{const a=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return a.flatMap((t=>n(t,e,r)))}}(e);return(t,e)=>{const{encode:a}=e,o=Gr(r,t,e),[s]=An(a,"x"),[c]=An(a,"y");return[o.flatMap((t=>i(t,s,c,n))),e]}};Ps.props={};const Cs=(t={})=>(e,n)=>{const{encode:r,data:i}=n,a=Object.entries(t).map((([t,e])=>{const[n]=An(r,t);if(!n)return null;const[i,a=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(a){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}})).filter(Sr),o=e.filter((t=>a.every((e=>e(t))))),s=o.map(((t,e)=>e));if(0===a.length){const t=function(t){var e;const{encode:n}=t,r=Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),{y:Object.assign(Object.assign({},t.encode.y),{value:[]})})}),i=null===(e=null==n?void 0:n.color)||void 0===e?void 0:e.field;if(!n||!i)return r;let a;for(const[t,e]of Object.entries(n))"x"!==t&&"y"!==t||e.field!==i||(a=Object.assign(Object.assign({},a),{[t]:Object.assign(Object.assign({},e),{value:[]})}));return a?Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),a)}):r}(n);return[e,t]}const c=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[o[t]])).filter((t=>void 0!==t))})]));return[s,Z({},n,{encode:Object.fromEntries(c),data:o.map((t=>i[t]))})]};function Ls(t){return function(){return t}}Cs.props={};const Ns=Math.abs,js=Math.atan2,Rs=Math.cos,Is=Math.max,Ds=Math.min,Bs=Math.sin,Fs=Math.sqrt,zs=1e-12,Gs=Math.PI,Ws=Gs/2,$s=2*Gs;function Ys(t){return t>=1?Ws:t<=-1?-Ws:Math.asin(t)}const Hs=Math.PI,Vs=2*Hs,qs=1e-6,Us=Vs-qs;function Xs(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class Zs{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Xs:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Xs;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-t,c=r-e,l=a-t,u=o-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>qs)if(Math.abs(u*s-c*l)>qs&&i){let h=n-a,d=r-o,p=s*s+c*c,g=h*h+d*d,v=Math.sqrt(p),m=Math.sqrt(f),y=i*Math.tan((Hs-Math.acos((p+f-g)/(2*v*m)))/2),b=y/m,x=y/v;Math.abs(b-1)>qs&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=t+o,l=e+s,u=1^a,f=a?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>qs||Math.abs(this._y1-l)>qs)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%Vs+Vs),f>Us?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>qs&&this._append`A${n},${n},0,${+(f>=Hs)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Ks(){return new Zs}function Qs(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Zs(e)}function Js(t){return t.innerRadius}function tc(t){return t.outerRadius}function ec(t){return t.startAngle}function nc(t){return t.endAngle}function rc(t){return t&&t.padAngle}function ic(t,e,n,r,i,a,o){var s=t-n,c=e-r,l=(o?a:-a)/Fs(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,p=n+u,g=r+f,v=(h+p)/2,m=(d+g)/2,y=p-h,b=g-d,x=y*y+b*b,k=i-a,w=h*g-p*d,M=(b<0?-1:1)*Fs(Is(0,k*k*x-w*w)),O=(w*b-y*M)/x,E=(-w*y-b*M)/x,S=(w*b+y*M)/x,A=(-w*y+b*M)/x,_=O-v,T=E-m,P=S-v,C=A-m;return _*_+T*T>P*P+C*C&&(O=S,E=A),{cx:O,cy:E,x01:-u,y01:-f,x11:O*(i/k-1),y11:E*(i/k-1)}}function ac(){var t=Js,e=tc,n=Ls(0),r=null,i=ec,a=nc,o=rc,s=null,c=Qs(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Ws,p=a.apply(this,arguments)-Ws,g=Ns(p-d),v=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>zs)if(g>$s-zs)s.moveTo(h*Rs(d),h*Bs(d)),s.arc(0,0,h,d,p,!v),f>zs&&(s.moveTo(f*Rs(p),f*Bs(p)),s.arc(0,0,f,p,d,v));else{var m,y,b=d,x=p,k=d,w=p,M=g,O=g,E=o.apply(this,arguments)/2,S=E>zs&&(r?+r.apply(this,arguments):Fs(f*f+h*h)),A=Ds(Ns(h-f)/2,+n.apply(this,arguments)),_=A,T=A;if(S>zs){var P=Ys(S/f*Bs(E)),C=Ys(S/h*Bs(E));(M-=2*P)>zs?(k+=P*=v?1:-1,w-=P):(M=0,k=w=(d+p)/2),(O-=2*C)>zs?(b+=C*=v?1:-1,x-=C):(O=0,b=x=(d+p)/2)}var L=h*Rs(b),N=h*Bs(b),j=f*Rs(w),R=f*Bs(w);if(A>zs){var I,D=h*Rs(x),B=h*Bs(x),F=f*Rs(k),z=f*Bs(k);if(g<Gs)if(I=function(t,e,n,r,i,a,o,s){var c=n-t,l=r-e,u=o-i,f=s-a,h=f*c-u*l;if(!(h*h<zs))return[t+(h=(u*(e-a)-f*(t-i))/h)*c,e+h*l]}(L,N,F,z,D,B,j,R)){var G=L-I[0],W=N-I[1],$=D-I[0],Y=B-I[1],H=1/Bs(function(t){return t>1?0:t<-1?Gs:Math.acos(t)}((G*$+W*Y)/(Fs(G*G+W*W)*Fs($*$+Y*Y)))/2),V=Fs(I[0]*I[0]+I[1]*I[1]);_=Ds(A,(f-V)/(H-1)),T=Ds(A,(h-V)/(H+1))}else _=T=0}O>zs?T>zs?(m=ic(F,z,L,N,h,T,v),y=ic(D,B,j,R,h,T,v),s.moveTo(m.cx+m.x01,m.cy+m.y01),T<A?s.arc(m.cx,m.cy,T,js(m.y01,m.x01),js(y.y01,y.x01),!v):(s.arc(m.cx,m.cy,T,js(m.y01,m.x01),js(m.y11,m.x11),!v),s.arc(0,0,h,js(m.cy+m.y11,m.cx+m.x11),js(y.cy+y.y11,y.cx+y.x11),!v),s.arc(y.cx,y.cy,T,js(y.y11,y.x11),js(y.y01,y.x01),!v))):(s.moveTo(L,N),s.arc(0,0,h,b,x,!v)):s.moveTo(L,N),f>zs&&M>zs?_>zs?(m=ic(j,R,D,B,f,-_,v),y=ic(L,N,F,z,f,-_,v),s.lineTo(m.cx+m.x01,m.cy+m.y01),_<A?s.arc(m.cx,m.cy,_,js(m.y01,m.x01),js(y.y01,y.x01),!v):(s.arc(m.cx,m.cy,_,js(m.y01,m.x01),js(m.y11,m.x11),!v),s.arc(0,0,f,js(m.cy+m.y11,m.cx+m.x11),js(y.cy+y.y11,y.cx+y.x11),v),s.arc(y.cx,y.cy,_,js(y.y11,y.x11),js(y.y01,y.x01),!v))):s.arc(0,0,f,w,k,v):s.lineTo(j,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Gs/2;return[Rs(r)*n,Bs(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ls(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ls(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ls(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ls(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ls(+t),l):i},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ls(+t),l):a},l.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ls(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function oc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function sc(t){this._context=t}function cc(t){return new sc(t)}function lc(t){return t[0]}function uc(t){return t[1]}function fc(t,e){var n=Ls(!0),r=null,i=cc,a=null,o=Qs(s);function s(s){var c,l,u,f=(s=oc(s)).length,h=!1;for(null==r&&(a=i(u=o())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+t(l,c,s),+e(l,c,s));if(u)return a=null,u+""||null}return t="function"==typeof t?t:void 0===t?lc:Ls(t),e="function"==typeof e?e:void 0===e?uc:Ls(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Ls(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Ls(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ls(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(a=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=a=null:a=i(r=t),s):r},s}function hc(t,e,n){var r=null,i=Ls(!0),a=null,o=cc,s=null,c=Qs(l);function l(l){var u,f,h,d,p,g=(l=oc(l)).length,v=!1,m=new Array(g),y=new Array(g);for(null==a&&(s=o(p=c())),u=0;u<=g;++u){if(!(u<g&&i(d=l[u],u,l))===v)if(v=!v)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=f;--h)s.point(m[h],y[h]);s.lineEnd(),s.areaEnd()}v&&(m[u]=+t(d,u,l),y[u]=+e(d,u,l),s.point(r?+r(d,u,l):m[u],n?+n(d,u,l):y[u]))}if(p)return s=null,p+""||null}function u(){return fc().defined(i).curve(o).context(a)}return t="function"==typeof t?t:void 0===t?lc:Ls(+t),e="function"==typeof e?e:Ls(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?uc:Ls(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ls(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ls(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ls(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ls(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ls(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ls(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:Ls(!!t),l):i},l.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),l):o},l.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),l):a},l}Ks.prototype=Zs.prototype,sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var dc=gc(cc);function pc(t){this._curve=t}function gc(t){function e(e){return new pc(t(e))}return e._curve=t,e}function vc(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(gc(t)):e()._curve},t}function mc(){}function yc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function bc(t,e){this._context=t,this._k=(1-e)/6}function xc(t,e){this._context=t,this._k=(1-e)/6}function kc(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>zs){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>zs){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*l+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function wc(t,e){this._context=t,this._alpha=e}function Mc(t,e){this._context=t,this._alpha=e}pc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},bc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:yc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:yc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new bc(t,e)}return n.tension=function(e){return t(+e)},n}(0),xc.prototype={areaStart:mc,areaEnd:mc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:yc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new xc(t,e)}return n.tension=function(e){return t(+e)},n}(0),wc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:kc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return e?new wc(t,e):new bc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),Mc.prototype={areaStart:mc,areaEnd:mc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:kc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Oc=function t(e){function n(t){return e?new Mc(t,e):new xc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ec(t){this._context=t}function Sc(t){return new Ec(t)}function Ac(t){return t<0?-1:1}function _c(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Ac(a)+Ac(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Tc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Pc(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function Cc(t){this._context=t}function Lc(t){this._context=new Nc(t)}function Nc(t){this._context=t}function jc(t){return new Cc(t)}function Rc(t){return new Lc(t)}function Ic(t,e){this._context=t,this._t=e}function Dc(t){return new Ic(t,.5)}function Bc(t){return new Ic(t,0)}function Fc(t){return new Ic(t,1)}function zc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Gc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Wc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function $c(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function Yc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function Hc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function Vc(t){return $c(t)||Gc(t)}function qc(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function Uc(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}Ec.prototype={areaStart:mc,areaEnd:mc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Cc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Pc(this,this._t0,Tc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Pc(this,Tc(this,n=_c(this,t,e)),n);break;default:Pc(this,this._t0,n=_c(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Lc.prototype=Object.create(Cc.prototype)).point=function(t,e){Cc.prototype.point.call(this,e,t)},Nc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}},Ic.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Xc="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Zc(t){return Zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zc(t)}function Kc(t){var e=function(t,e){if("object"!=Zc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Zc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Zc(e)?e:e+""}function Qc(t,e,n){return(e=Kc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function tl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jc(Object(n),!0).forEach((function(e){Qc(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function el(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Kc(r.key),r)}}function rl(t,e,n){return e&&nl(t.prototype,e),n&&nl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function il(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function al(t,e){if(t){if("string"==typeof t)return il(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?il(t,e):void 0}}function ol(t){return function(t){if(Array.isArray(t))return il(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||al(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sl(t){return sl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sl(t)}function cl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(cl=function(){return!!t})()}function ll(t,e){if(e&&("object"==Zc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ul(t,e,n){return e=sl(e),ll(t,cl()?Reflect.construct(e,n||[],sl(t).constructor):e.apply(t,n))}function fl(t,e){return fl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fl(t,e)}function hl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fl(t,e)}function dl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||al(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var pl={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||t,o),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i<a;i++)o[i]=r[i].fn;return o},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,a),!0;case 6:return u.fn.call(u.context,e,r,i,a,o),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(pl);var gl=pl.exports;function vl(){return vl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=sl(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},vl.apply(null,arguments)}function ml(t,e,n,r){var i=vl(sl(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function yl(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function bl(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function xl(){}var kl=.7,wl=1/kl,Ml="\\s*([+-]?\\d+)\\s*",Ol="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",El="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Sl=/^#([0-9a-f]{3,8})$/,Al=new RegExp(`^rgb\\(${Ml},${Ml},${Ml}\\)$`),_l=new RegExp(`^rgb\\(${El},${El},${El}\\)$`),Tl=new RegExp(`^rgba\\(${Ml},${Ml},${Ml},${Ol}\\)$`),Pl=new RegExp(`^rgba\\(${El},${El},${El},${Ol}\\)$`),Cl=new RegExp(`^hsl\\(${Ol},${El},${El}\\)$`),Ll=new RegExp(`^hsla\\(${Ol},${El},${El},${Ol}\\)$`),Nl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function jl(){return this.rgb().formatHex()}function Rl(){return this.rgb().formatRgb()}function Il(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Sl.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Dl(e):3===n?new Gl(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Bl(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Bl(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Al.exec(t))?new Gl(e[1],e[2],e[3],1):(e=_l.exec(t))?new Gl(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Tl.exec(t))?Bl(e[1],e[2],e[3],e[4]):(e=Pl.exec(t))?Bl(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Cl.exec(t))?ql(e[1],e[2]/100,e[3]/100,1):(e=Ll.exec(t))?ql(e[1],e[2]/100,e[3]/100,e[4]):Nl.hasOwnProperty(t)?Dl(Nl[t]):"transparent"===t?new Gl(NaN,NaN,NaN,0):null}function Dl(t){return new Gl(t>>16&255,t>>8&255,255&t,1)}function Bl(t,e,n,r){return r<=0&&(t=e=n=NaN),new Gl(t,e,n,r)}function Fl(t){return t instanceof xl||(t=Il(t)),t?new Gl((t=t.rgb()).r,t.g,t.b,t.opacity):new Gl}function zl(t,e,n,r){return 1===arguments.length?Fl(t):new Gl(t,e,n,null==r?1:r)}function Gl(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Wl(){return`#${Vl(this.r)}${Vl(this.g)}${Vl(this.b)}`}function $l(){const t=Yl(this.opacity);return`${1===t?"rgb(":"rgba("}${Hl(this.r)}, ${Hl(this.g)}, ${Hl(this.b)}${1===t?")":`, ${t})`}`}function Yl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Hl(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Vl(t){return((t=Hl(t))<16?"0":"")+t.toString(16)}function ql(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Xl(t,e,n,r)}function Ul(t){if(t instanceof Xl)return new Xl(t.h,t.s,t.l,t.opacity);if(t instanceof xl||(t=Il(t)),!t)return new Xl;if(t instanceof Xl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Xl(o,s,c,t.opacity)}function Xl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Zl(t){return(t=(t||0)%360)<0?t+360:t}function Kl(t){return Math.max(0,Math.min(1,t||0))}function Ql(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}yl(xl,Il,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:jl,formatHex:jl,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ul(this).formatHsl()},formatRgb:Rl,toString:Rl}),yl(Gl,zl,bl(xl,{brighter(t){return t=null==t?wl:Math.pow(wl,t),new Gl(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?kl:Math.pow(kl,t),new Gl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Gl(Hl(this.r),Hl(this.g),Hl(this.b),Yl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Wl,formatHex:Wl,formatHex8:function(){return`#${Vl(this.r)}${Vl(this.g)}${Vl(this.b)}${Vl(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:$l,toString:$l})),yl(Xl,(function(t,e,n,r){return 1===arguments.length?Ul(t):new Xl(t,e,n,null==r?1:r)}),bl(xl,{brighter(t){return t=null==t?wl:Math.pow(wl,t),new Xl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?kl:Math.pow(kl,t),new Xl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Gl(Ql(t>=240?t-240:t+120,i,r),Ql(t,i,r),Ql(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Xl(Zl(this.h),Kl(this.s),Kl(this.l),Yl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Yl(this.opacity);return`${1===t?"hsl(":"hsla("}${Zl(this.h)}, ${100*Kl(this.s)}%, ${100*Kl(this.l)}%${1===t?")":`, ${t})`}`}}));const Jl=Math.PI/180,tu=180/Math.PI;var eu=-.14861,nu=1.78277,ru=-.29227,iu=-.90649,au=1.97294,ou=au*iu,su=au*nu,cu=nu*ru-iu*eu;function lu(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof uu)return new uu(t.h,t.s,t.l,t.opacity);t instanceof Gl||(t=Fl(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(cu*r+ou*e-su*n)/(cu+ou-su),a=r-i,o=(au*(n-i)-ru*a)/iu,s=Math.sqrt(o*o+a*a)/(au*i*(1-i)),c=s?Math.atan2(o,a)*tu-120:NaN;return new uu(c<0?c+360:c,s,i,t.opacity)}(t):new uu(t,e,n,null==r?1:r)}function uu(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function fu(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function hu(t,e){var n=Math.min.apply(Math,Re([],je(t),!1)),r=Math.min.apply(Math,Re([],je(e),!1));return{x:n,y:r,width:Math.max.apply(Math,Re([],je(t),!1))-n,height:Math.max.apply(Math,Re([],je(e),!1))-r}}function du(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function pu(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function gu(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),c=1/0,l=-1/0,u=[a,o],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;a<o?a<h&&h<o&&u.push(h):o<h&&h<a&&u.push(h)}for(f=0;f<u.length;f++){var d=du(t,0,n,r,i,u[f]);d<c&&(c=d),d>l&&(l=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,v=-1/0,m=[a,o];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var y=p+f;a<o?a<y&&y<o&&m.push(y):o<y&&y<a&&m.push(y)}for(f=0;f<m.length;f++){var b=pu(0,e,n,r,i,m[f]);b<g&&(g=b),b>v&&(v=b)}return{x:c,y:g,width:l-c,height:v-g}}yl(uu,lu,bl(xl,{brighter(t){return t=null==t?wl:Math.pow(wl,t),new uu(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?kl:Math.pow(kl,t),new uu(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Jl,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Gl(255*(e+n*(eu*r+nu*i)),255*(e+n*(ru*r+iu*i)),255*(e+n*(au*r)),this.opacity)}}));function vu(t,e,n,r,i,a){var o=-1,s=1/0,c=[n,r],l=20;a&&a>200&&(l=a/10);for(var u=1/l,f=u/10,h=0;h<=l;h++){var d=h*u,p=[i.apply(void 0,Re([],je(t.concat([d])),!1)),i.apply(void 0,Re([],je(e.concat([d])),!1))];(y=fu(c[0],c[1],p[0],p[1]))<s&&(o=d,s=y)}if(0===o)return{x:t[0],y:e[0]};if(1===o){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(h=0;h<32&&!(f<1e-4);h++){var v=o-f,m=o+f,y=(p=[i.apply(void 0,Re([],je(t.concat([v])),!1)),i.apply(void 0,Re([],je(e.concat([v])),!1))],fu(c[0],c[1],p[0],p[1]));if(v>=0&&y<s)o=v,s=y;else{var b=[i.apply(void 0,Re([],je(t.concat([m])),!1)),i.apply(void 0,Re([],je(e.concat([m])),!1))],x=fu(c[0],c[1],b[0],b[1]);m<=1&&x<s?(o=m,s=x):f*=.5}}return{x:i.apply(void 0,Re([],je(t.concat([o])),!1)),y:i.apply(void 0,Re([],je(e.concat([o])),!1))}}function mu(t,e,n,r){return fu(t,e,n,r)}function yu(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function bu(t,e,n,r,i,a){var o=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var c=[i-t,a-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(c,s))}function xu(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function ku(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,c=6*t-12*e+6*n,l=3*e-3*t,u=[];if(R(s,0))R(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;R(f,0)?u.push(-c/(2*s)):f>0&&(a=(-c-(o=Math.sqrt(f)))/(2*s),(i=(-c+o)/(2*s))>=0&&i<=1&&u.push(i),a>=0&&a<=1&&u.push(a))}return u}function wu(t,e,n,r,i,a,o,s){for(var c=[t,o],l=[e,s],u=ku(t,n,i,o),f=ku(e,r,a,s),h=0;h<u.length;h++)c.push(xu(t,n,i,o,u[h]));for(h=0;h<f.length;h++)l.push(xu(e,r,a,s,f[h]));return hu(c,l)}function Mu(t,e,n,r,i,a,o,s,c,l,u){var f=function(t,e,n,r,i,a,o,s,c,l,u){return vu([t,n,i,o],[e,r,a,s],c,l,xu,u)}(t,e,n,r,i,a,o,s,c,l,u);return fu(f.x,f.y,c,l)}function Ou(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=fu(r[0],r[1],i[0],i[1])}return e}(t)}function Eu(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Su(t,e,n){var r=t+n-2*e;if(R(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Au(t,e,n,r,i,a){var o=Su(t,n,i)[0],s=Su(e,r,a)[0],c=[t,i],l=[e,a];return void 0!==o&&c.push(Eu(t,n,i,o)),void 0!==s&&l.push(Eu(e,r,a,s)),hu(c,l)}function _u(t,e,n,r,i,a,o,s){var c=function(t,e,n,r,i,a,o,s){return vu([t,n,i],[e,r,a],o,s,Eu)}(t,e,n,r,i,a,o,s);return fu(c.x,c.y,o,s)}function Tu(){Tu=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var a=e&&e.prototype instanceof m?e:m,o=Object.create(a.prototype),s=new P(r||[]);return i(o,"_invoke",{value:S(t,n,s)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",g="completed",v={};function m(){}function y(){}function b(){}var x={};l(x,o,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(C([])));w&&w!==n&&r.call(w,o)&&(x=w);var M=b.prototype=m.prototype=Object.create(x);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,a,o,s){var c=f(t[i],t,a);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==Zc(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(u).then((function(t){l.value=t,o(l)}),(function(t){return n("throw",t,o,s)}))}s(c.arg)}var a;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return a=a?a.then(i,i):i()}})}function S(e,n,r){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===g){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var c=A(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?g:d,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=g,r.method="throw",r.arg=l.arg)}}}function A(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,A(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(Zc(e)+" is not iterable")}return y.prototype=b,i(M,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,c,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},O(E.prototype),l(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new E(u(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},O(M),l(M,c,"Generator"),l(M,o,(function(){return this})),l(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Pu(t,e,n,r,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Cu(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){Pu(a,r,i,o,s,"next",t)}function s(t){Pu(a,r,i,o,s,"throw",t)}o(void 0)}))}}function Lu(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=al(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Nu(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Xc||"undefined"!=typeof self&&self;var ju={exports:{}};!function(t){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(a,Math.floor(r+(s-c)*u/s+f)),o)}var h=t[r],d=i,p=a;for(n(t,i,r),o(t[a],h)>0&&n(t,i,a);d<p;){for(n(t,d,p),d++,p--;o(t[d],h)<0;)d++;for(;o(t[p],h)>0;)p--}0===o(t[i],h)?n(t,i,p):n(t,++p,a),p<=r&&(i=p+1),r<=p&&(a=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];c(i,t.leaf?r(o):o)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function v(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,a){for(var o=[n,r];o.length;)if(!((r=o.pop())-(n=o.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?r(o):o;v(t,s)&&(e.leaf?n.push(o):g(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(v(t,a)){if(e.leaf||g(t,a))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),c=[],l=[];o||c.length;){if(o||(o=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),o.leaf){var u=a(t,o.children,e);if(-1!==u)return o.children.splice(u,1),c.push(o),this._condense(c),this}i||o.leaf||!g(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(c.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(a<=s)return o(i=m(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,r-1))),(i=m([])).leaf=!1,i.height=r;var c=Math.ceil(a/s),l=c*Math.ceil(Math.sqrt(s));y(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);y(t,u,f,c,this.compareMinY);for(var h=u;h<=f;h+=c){var d=Math.min(h+c-1,f);i.children.push(this._build(t,h,d,r-1))}}return o(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var c=e.children[s],l=f(c),u=d(t,c)-l;u<a?(a=u,i=l<i?l:i,o=c):u===a&&l<i&&(i=l,o=c)}e=o||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],a=this._chooseSubtree(r,this.data,e,i);for(a.children.push(t),c(a,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,a=1/0,o=e;o<=n-e;o++){var c=s(t,0,o,this.toBBox),l=s(t,o,n,this.toBBox),u=p(c,l),h=f(c)+f(l);u<i?(i=u,r=o,a=h<a?h:a):u===i&&h<a&&(a=h,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=s(t,0,e,i),o=s(t,n-e,n,i),l=h(a)+h(o),u=e;u<n-e;u++){var f=t.children[u];c(a,t.leaf?i(f):f),l+=h(a)}for(var d=n-e-1;d>=e;d--){var p=t.children[d];c(o,t.leaf?i(p):p),l+=h(o)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)c(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()}(ju);var Ru=ju.exports,Iu=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),Du=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),Bu=function(){return rl((function t(){el(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))}}])}(),Fu=function(){return rl((function t(e){el(this,t),this.clipSpaceNearZ=Du.NEGATIVE_ONE,this.plugins=[],this.config=tl({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),zu=te,Gu=Qt,Wu=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},$u=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Yu=ne,Hu=ue,Vu=function(){function t(){el(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return rl(t,[{key:"update",value:function(t,e){Gu(this.center,t),Gu(this.halfExtents,e),Hu(this.min,this.center,this.halfExtents),zu(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){zu(this.center,e,t),Yu(this.center,this.center,.5),Hu(this.halfExtents,e,t),Yu(this.halfExtents,this.halfExtents,.5),Gu(this.min,t),Gu(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],c=o[1],l=o[2],u=r-s,f=r+s,h=i-c,d=i+c,p=a-l,g=a+l,v=e.center,m=v[0],y=v[1],b=v[2],x=e.halfExtents,k=x[0],w=x[1],M=x[2],O=m-k,E=m+k,S=y-w,A=y+w,_=b-M,T=b+M;O<u&&(u=O),E>f&&(f=E),S<h&&(h=S),A>d&&(d=A),_<p&&(p=_),T>g&&(g=T),n[0]=.5*(u+f),n[1]=.5*(h+d),n[2]=.5*(p+g),o[0]=.5*(f-u),o[1]=.5*(d-h),o[2]=.5*(g-p),this.min[0]=u,this.min[1]=h,this.min[2]=p,this.max[0]=f,this.max[1]=d,this.max[2]=g}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],c=e[8],l=e[1],u=e[5],f=e[9],h=e[2],d=e[6],p=e[10],g=Math.abs(o),v=Math.abs(s),m=Math.abs(c),y=Math.abs(l),b=Math.abs(u),x=Math.abs(f),k=Math.abs(h),w=Math.abs(d),M=Math.abs(p);n[0]=e[12]+o*i[0]+s*i[1]+c*i[2],n[1]=e[13]+l*i[0]+u*i[1]+f*i[2],n[2]=e[14]+h*i[0]+d*i[1]+p*i[2],r[0]=g*a[0]+v*a[1]+m*a[2],r[1]=y*a[0]+b*a[1]+x*a[2],r[2]=k*a[0]+w*a[1]+M*a[2],Hu(this.min,n,r),zu(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=Wu([0,0,0],this.getMin(),e.getMin()),i=$u([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?Gu([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?Gu([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),qu=function(){return rl((function t(e,n){el(this,t),this.distance=e||0,this.normal=n||Kt(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return ie(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/he(this.normal);ne(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&i<=1;return a&&n&&oe(n,t,e,i),a}}])}(),Uu=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),Xu=function(){return rl((function t(e){if(el(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new qu)}),[{key:"extractFromVPMatrix",value:function(t){var e=dl(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15];Jt(this.planes[0].normal,a-n,l-o,d-u),this.planes[0].distance=m-p,Jt(this.planes[1].normal,a+n,l+o,d+u),this.planes[1].distance=m+p,Jt(this.planes[2].normal,a+r,l+s,d+f),this.planes[2].distance=m+g,Jt(this.planes[3].normal,a-r,l-s,d-f),this.planes[3].distance=m-g,Jt(this.planes[4].normal,a-i,l-c,d-h),this.planes[4].distance=m-v,Jt(this.planes[5].normal,a+i,l+c,d+h),this.planes[5].distance=m+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),Zu=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;el(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return rl(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Ku=function(){function t(e,n,r,i){el(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return rl(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=pe(e.x,e.y,0,1),i=pe(e.x+e.width,e.y,0,1),a=pe(e.x,e.y+e.height,0,1),o=pe(e.x+e.width,e.y+e.height,0,1),s=de(),c=de(),l=de(),u=de();ge(s,r,n),ge(c,i,n),ge(l,a,n),ge(u,o,n);var f=Math.min(s[0],c[0],l[0],u[0]),h=Math.min(s[1],c[1],l[1],u[1]),d=Math.max(s[0],c[0],l[0],u[0]),p=Math.max(s[1],c[1],l[1],u[1]);return t.fromRect({x:f,y:h,width:d-f,height:p-h})}}])}(),Qu="Method not implemented.",Ju="Use document.documentElement instead.";function tf(t){return void 0===t?0:t>360||t<-360?t%360:t}var ef=Ut();function nf(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?r?Xt(t):Qt(ef,t):j(t)?r?Kt(t,e,n):Jt(ef,t,e,n):r?Kt(t[0],t[1]||e,t[2]||n):Jt(ef,t[0],t[1]||e,t[2]||n)}var rf=Math.PI/180;function af(t){return t*rf}var of=180/Math.PI;function sf(t){return t*of}var cf=Math.PI/2;function lf(t,e){return 16===e.length?function(t,e){var n,r,i=dl(Nt(Ut(),e),3),a=i[0],o=i[1],s=i[2],c=Math.asin(-e[2]/a);return c<cf?c>-cf?(n=Math.atan2(e[6]/o,e[10]/s),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/o,e[5]/o)):(r=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,c=a*a,l=n*n+o+s+c,u=n*a-r*i;return u>.499995*l?(t[0]=cf,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*l?(t[0]=-cf,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+c)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function uf(t,e,n,r,i){var a,o,s,c,l,u,f,h,d,p,g=Math.cos(t),v=Math.sin(t);return a=r*g,o=i*v,s=0,c=-r*v,l=i*g,u=0,f=e,h=n,d=1,(p=new ct(9))[0]=a,p[1]=o,p[2]=s,p[3]=c,p[4]=l,p[5]=u,p[6]=f,p[7]=h,p[8]=d,p}function ff(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);if(e*i-n*r<0&&(e<i?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var c=1/o;r*=c,i*=c}var l=sf(Math.atan2(n,e));return[t[6],t[7],a,o,l]}var hf=ft(),df=ft(),pf=de(),gf=[Ut(),Ut(),Ut()],vf=Ut();function mf(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var yf=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),bf=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),xf=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),kf="updated",wf=2e-4,Mf=function(){return rl((function t(){el(this,t),this.clipSpaceNearZ=Du.NEGATIVE_ONE,this.eventEmitter=new gl,this.matrix=ft(),this.right=Kt(1,0,0),this.up=Kt(0,1,0),this.forward=Kt(0,0,1),this.position=Kt(0,0,1),this.focalPoint=Kt(0,0,0),this.distanceVector=Kt(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=ft(),this.projectionMatrixInverse=ft(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=yf.EXPLORING,this.trackingMode=bf.DEFAULT,this.projectionMode=xf.PERSPECTIVE,this.frustum=new Xu,this.orthoMatrix=ft()}),[{key:"isOrtho",value:function(){return this.projectionMode===xf.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.type===yf.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===yf.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==yf.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return yt(ft(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=Et(ft(),[t,e,0]);this.jitteredProjectionMatrix=xt(ft(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===xf.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===xf.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===xf.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===xf.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===xf.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===xf.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=Kt(o.x-r,o.y-i,0),c=ie(s,this.right)/Zt(this.right),l=ie(s,this.up)/Zt(this.up),u=dl(this.getPosition(),2),f=u[0],h=u[1],d=dl(this.getFocalPoint(),2),p=d[0],g=d[1];return this.setPosition(f-c,h-l),this.setFocalPoint(p-c,g-l),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=xf.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var a=this.near*Math.tan(af(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,c=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var l=this.view.fullWidth,u=this.view.fullHeight;c+=this.view.offsetX*s/l,a-=this.view.offsetY*o/u,s*=this.view.width/l,o*=this.view.height/u}return function(t,e,n,r,i,a,o){var s,c,l=2*a,u=n-e,f=r-i,h=l/u,d=l/f,p=(n+e)/u,g=(r+i)/f,v=o-a,m=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/v,c=-m/v):(s=-(o+a)/v,c=-2*m/v),t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=d,t[6]=0,t[7]=0,t[8]=p,t[9]=g,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,c,c+s,a-o,a,t,this.far,this.clipSpaceNearZ===Du.ZERO),yt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,a){var o;this.projectionMode=xf.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=l-s,h=l+s,d=u+c,p=u-c;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=g*this.view.offsetX)+g*this.view.width,p=(d-=v*this.view.offsetY)-v*this.view.height}return this.clipSpaceNearZ===Du.NEGATIVE_ONE?zt(this.projectionMatrix,f,h,d,p,i,a):Gt(this.projectionMatrix,f,h,d,p,i,a),yt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=nf(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=Kt(0,1,0);if(this.focalPoint=nf(t,e,n),this.trackingMode===bf.CINEMATIC){var i=ee(Ut(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var a=Zt(i),o=sf(Math.asin(e/a)),s=90+sf(Math.atan2(n,t)),c=ft();Ot(c,c,af(s)),Mt(c,c,af(o)),r=se(Ut(),[0,1,0],c)}return yt(this.matrix,Wt(ft(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<wf&&(this.distance=wf),this.dollyingStep=this.distance/100;var e=Ut();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=tf(t),this.computeMatrix(),this._getAxes(),this.type===yf.ORBITING||this.type===yf.EXPLORING?this._getPosition():this.type===yf.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=tf(t),this.computeMatrix(),this._getAxes(),this.type===yf.ORBITING||this.type===yf.EXPLORING?this._getPosition():this.type===yf.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=tf(t),this.computeMatrix(),this._getAxes(),this.type===yf.ORBITING||this.type===yf.EXPLORING?this._getPosition():this.type===yf.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=me(ve(),[0,0,1],af(this.roll));vt(this.matrix);var e=me(ve(),[1,0,0],af((this.rotateWorld&&this.type!==yf.TRACKING||this.type===yf.TRACKING?1:-1)*this.elevation)),n=me(ve(),[0,1,0],af((this.rotateWorld&&this.type!==yf.TRACKING||this.type===yf.TRACKING?1:-1)*this.azimuth)),r=ye(ve(),n,e);r=ye(ve(),r,t);var i=It(ft(),r);this.type===yf.ORBITING||this.type===yf.EXPLORING?(kt(this.matrix,this.matrix,this.focalPoint),xt(this.matrix,this.matrix,i),kt(this.matrix,this.matrix,[0,0,this.distance])):this.type===yf.TRACKING&&(kt(this.matrix,this.matrix,this.position),xt(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=nf(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){Qt(this.right,nf(ge(de(),[1,0,0,0],this.matrix))),Qt(this.up,nf(ge(de(),[0,1,0,0],this.matrix))),Qt(this.forward,nf(ge(de(),[0,0,1,0],this.matrix))),re(this.right,this.right),re(this.up,this.up),re(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Zt(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===yf.TRACKING||this.rotateWorld?(this.elevation=sf(Math.asin(e/r)),this.azimuth=sf(Math.atan2(-t,-n))):(this.elevation=-sf(Math.asin(e/r)),this.azimuth=-sf(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){Qt(this.position,nf(ge(de(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;ce(this.distanceVector,[0,0,-this.distance],(t=lt(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),te(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=ee(Ut(),this.focalPoint,this.position),this.distance=Zt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===xf.ORTHOGRAPHIC){var t=this.position,e=me(ve(),[0,0,1],-this.roll*Math.PI/180);Rt(this.orthoMatrix,e,Kt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Kt(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=xt(ft(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(kf)}}},{key:"rotate",value:function(t,e,n){throw new Error(Qu)}},{key:"pan",value:function(t,e){throw new Error(Qu)}},{key:"dolly",value:function(t){throw new Error(Qu)}},{key:"createLandmark",value:function(t,e){throw new Error(Qu)}},{key:"gotoLandmark",value:function(t,e){throw new Error(Qu)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(Qu)}}])}(),Of=function(t){return t[t.Standard=0]="Standard",t}({}),Ef=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Sf={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ku(0,0,0,0)},Af=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function _f(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var c=t.apply(this,i);return n.cache=s.set(o,c)||s,c};return n.cache=new(_f.Cache||Map),n}_f.Cache=Map;var Tf=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),Pf=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),Cf=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Lf=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Nf=[{name:"em",unit_type:Tf.kEms},{name:"px",unit_type:Tf.kPixels},{name:"deg",unit_type:Tf.kDegrees},{name:"rad",unit_type:Tf.kRadians},{name:"grad",unit_type:Tf.kGradians},{name:"ms",unit_type:Tf.kMilliseconds},{name:"s",unit_type:Tf.kSeconds},{name:"rem",unit_type:Tf.kRems},{name:"turn",unit_type:Tf.kTurns}],jf=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),Rf=function(t){return t?"number"===t?Tf.kNumber:"percent"===t||"%"===t?Tf.kPercentage:function(t){return Nf.find((function(e){return e.name===t})).unit_type}(t):Tf.kUnknown},If=function(t){var e=1;switch(t){case Tf.kPixels:case Tf.kDegrees:case Tf.kSeconds:break;case Tf.kMilliseconds:e=.001;break;case Tf.kRadians:e=180/Math.PI;break;case Tf.kGradians:e=.9;break;case Tf.kTurns:e=360}return e},Df=function(t){switch(t){case Tf.kNumber:case Tf.kInteger:return"";case Tf.kPercentage:return"%";case Tf.kEms:return"em";case Tf.kRems:return"rem";case Tf.kPixels:return"px";case Tf.kDegrees:return"deg";case Tf.kRadians:return"rad";case Tf.kGradians:return"grad";case Tf.kMilliseconds:return"ms";case Tf.kSeconds:return"s";case Tf.kTurns:return"turn"}return""},Bf=function(){return rl((function t(){el(this,t)}),[{key:"toString",value:function(){return this.buildCSSText(Cf.kNo,Lf.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=jf.kUnitType&&this.getType()<=jf.kClampType}}],[{key:"isAngle",value:function(t){return t===Tf.kDegrees||t===Tf.kRadians||t===Tf.kGradians||t===Tf.kTurns}},{key:"isLength",value:function(t){return t>=Tf.kEms&&t<Tf.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===Tf.kPercentage||t===Tf.kEms||t===Tf.kRems}},{key:"isTime",value:function(t){return t===Tf.kSeconds||t===Tf.kMilliseconds}}])}(),Ff=function(t){function e(t){var n;return el(this,e),(n=ul(this,e)).colorSpace=t,n}return hl(e,t),rl(e,[{key:"getType",value:function(){return jf.kColorType}},{key:"to",value:function(t){return this}}])}(Bf),zf=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Gf=function(t){function e(t,n){var r;return el(this,e),(r=ul(this,e)).type=t,r.value=n,r}return hl(e,t),rl(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return jf.kColorType}}])}(Bf),Wf=function(t){function e(t){var n;return el(this,e),(n=ul(this,e)).value=t,n}return hl(e,t),rl(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return jf.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Bf),$f=function(t){return function(t){switch(t){case Pf.kUNumber:return Tf.kNumber;case Pf.kULength:return Tf.kPixels;case Pf.kUPercent:return Tf.kPercentage;case Pf.kUTime:return Tf.kSeconds;case Pf.kUAngle:return Tf.kDegrees;default:return Tf.kUnknown}}(function(t){switch(t){case Tf.kNumber:case Tf.kInteger:return Pf.kUNumber;case Tf.kPercentage:return Pf.kUPercent;case Tf.kPixels:return Pf.kULength;case Tf.kMilliseconds:case Tf.kSeconds:return Pf.kUTime;case Tf.kDegrees:case Tf.kRadians:case Tf.kGradians:case Tf.kTurns:return Pf.kUAngle;default:return Pf.kUOther}}(t))},Yf=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tf.kNumber;return el(this,e),n=ul(this,e),r="string"==typeof i?Rf(i):i,n.unit=r,n.value=t,n}return hl(e,t),rl(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return jf.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=$f(this.unit);if(n!==$f(t)||n===Tf.kUnknown)return null;var r=If(this.unit)/If(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case Tf.kUnknown:break;case Tf.kInteger:r=Number(this.value).toFixed(0);break;case Tf.kNumber:case Tf.kPercentage:case Tf.kEms:case Tf.kRems:case Tf.kPixels:case Tf.kDegrees:case Tf.kRadians:case Tf.kGradians:case Tf.kMilliseconds:case Tf.kSeconds:case Tf.kTurns:var i=this.value,a=Df(this.unit);if(i<-999999||i>999999){var o=Df(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,o):i+(o||"")}else r="".concat(i).concat(a)}return n+=r}}])}(Bf),Hf=new Yf(0,"px");new Yf(1,"px");var Vf=new Yf(0,"deg"),qf=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return el(this,e),(i=ul(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=a,i.isNone=o,i}return hl(e,t),rl(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(Ff),Uf=new Wf("unset"),Xf={"":Uf,unset:Uf,initial:new Wf("initial"),inherit:new Wf("inherit")},Zf=new qf(0,0,0,0,!0),Kf=new qf(0,0,0,0),Qf=_f((function(t,e,n,r){return new qf(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Jf=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tf.kNumber;return new Yf(t,e)};function th(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new Yf(50,"%");var eh=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,f=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,h=/^\(/,d=/^\)/,p=/^,/,g=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,m=/^rgb/i,y=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function k(t){throw new Error("".concat(x,": ").concat(t))}function w(){var t=L(M);return x.length>0&&k("Invalid input not EOF"),t}function M(){return O("linear-gradient",t,S)||O("repeating-linear-gradient",e,S)||O("radial-gradient",n,A)||O("repeating-radial-gradient",r,A)||O("conic-gradient",i,A)}function O(t,e,n){return E(e,(function(e){var r=n();return r&&(B(p)||k("Missing comma before color stops")),{type:t,orientation:r,colorStops:L(N)}}))}function E(t,e){var n=B(t);if(n){B(h)||k("Missing (");var r=e(n);return B(d)||k("Missing )"),r}}function S(){return D("directional",a,1)||D("angular",f,1)}function A(){var t,e,n=_();return n&&((t=[]).push(n),e=x,B(p)&&((n=_())?t.push(n):x=e)),t}function _(){var t=function(){var t=D("shape",/^(circle)/i,0);t&&(t.style=I()||T());return t}()||function(){var t=D("shape",/^(ellipse)/i,0);t&&(t.style=R()||T());return t}();if(t)t.at=P();else{var e=T();if(e){t=e;var n=P();n&&(t.at=n)}else{var r=C();r&&(t={type:"default-radial",at:r})}}return t}function T(){return D("extent-keyword",o,1)}function P(){if(D("position",/^at/,0)){var t=C();return t||k("Missing positioning value"),t}}function C(){var t={x:R(),y:R()};if(t.x||t.y)return{type:"position",value:t}}function L(t){var e=t(),n=[];if(e)for(n.push(e);B(p);)(e=t())?n.push(e):k("One extra comma");return n}function N(){var t=D("hex",g,1)||E(y,(function(){return{type:"rgba",value:L(j)}}))||E(m,(function(){return{type:"rgb",value:L(j)}}))||D("literal",v,0);return t||k("Expected color definition"),t.length=R(),t}function j(){return B(b)[1]}function R(){return D("%",l,1)||D("position-keyword",s,1)||I()}function I(){return D("px",c,1)||D("em",u,1)}function D(t,e,n){var r=B(e);if(r)return{type:t,value:r[n]}}function B(t){var e=/^[\n\r\t\s]+/.exec(x);e&&F(e[0].length);var n=t.exec(x);return n&&F(n[0].length),n}function F(t){x=x.substring(t)}return function(t){return x=t,w()}}();var nh=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,rh=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ih=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ah=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var oh={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},sh=_f((function(t){var e;return e="angular"===t.type?Number(t.value):oh[t.value]||0,Jf(e,"deg")})),ch=_f((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Jf(e,r),cy:Jf(n,i)}})),lh=_f((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return eh(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),o=1;o<r;o++){var s,c=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!y(c)&&!y(a)){for(var l=1;l<o-i;l++)t[i+l].length={type:"%",value:"".concat(a+(Number(c)-a)*l/(o-i))};i=o,a=Number(c)}}}(r);var i=r.map((function(t){return{offset:Jf(Number(t.length.value),"%"),color:th(t)}}));if("linear-gradient"===e)return new Gf(zf.LinearGradient,{angle:n?sh(n):Vf,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var a,o=ch(n[0].at),s=o.cx,c=o.cy;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;a="extent-keyword"===u?function(t){return Xf[t]||(Xf[t]=new Wf(t)),Xf[t]}(f):Jf(f,u)}return new Gf(zf.RadialGradient,{cx:s,cy:c,size:a,steps:i})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=nh.exec(t);if(n){var r,i=(null===(r=n[2].match(ah))||void 0===r?void 0:r.map((function(t){return t.split(":")})))||[];return[new Gf(zf.LinearGradient,{angle:Jf(parseFloat(n[1]),"deg"),steps:i.map((function(t){var e=dl(t,2),n=e[0],r=e[1];return{offset:Jf(100*Number(n),"%"),color:r}}))})]}}else if("r"===e){var a=function(t){var e=rh.exec(t);if(e){var n,r=(null===(n=e[4].match(ah))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Jf(50,"%"),cy:Jf(50,"%"),steps:r.map((function(t){var e=dl(t,2),n=e[0],r=e[1];return{offset:Jf(100*Number(n),"%"),color:r}}))}}return null}(t);if(a){if(!C(a))return[new Gf(zf.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=ih.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function uh(t){return t&&!!t.image}function fh(t){return t&&!y(t.r)&&!y(t.g)&&!y(t.b)}var hh=_f((function(t){if(uh(t))return tl({repetition:"repeat"},t);if(y(t)&&(t=""),"transparent"===t)return Kf;if("currentColor"===t)t="black";else if("none"===t)return Zf;var e=lh(t);if(e)return e;var n=Il(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Qf.apply(void 0,r)}));function dh(t,e){if(fh(t)&&fh(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(N(e[n],0,255));return e[3]=N(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function ph(t,e){if(y(e))return Jf(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Jf(Number(e),"px");if("deg".search(t)>=0)return Jf(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var r="U(".concat(t.source,")");return n.map((function(t){return Jf(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var gh=function(t){return ph(new RegExp("px","g"),t)},vh=_f(gh);_f((function(t){return ph(new RegExp("%","g"),t)}));var mh=function(t){return j(t)||isFinite(Number(t))?Jf(Number(t)||0,"px"):ph(new RegExp("px|%|em|rem","g"),t)},yh=_f(mh),bh=function(t){return ph(new RegExp("deg|rad|grad|turn","g"),t)},xh=_f(bh);function kh(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,c=$f(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(o=l.value,s=u.value,a=Df(t.unit)):(Yf.isLength(t.unit)||Yf.isLength(e.unit))&&(o=Oh(t,i,n),s=Oh(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function wh(t){var e=0;return t.unit===Tf.kDegrees?e=t.value:t.unit===Tf.kRadians?e=sf(Number(t.value)):t.unit===Tf.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function Mh(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):C(t)?n=t.split(" ").map((function(t){return Number(t)})):j(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Oh(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===Tf.kPixels)return Number(t.value);if(t.unit===Tf.kPercentage&&n){var i=n.nodeName===Iu.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var Eh=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Sh(t){return t.toString()}var Ah=function(t){return"number"==typeof t?Jf(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Jf(Number(t)):Jf(0)},_h=_f(Ah);function Th(t,e){return[t,e,Sh]}function Ph(t,e){return function(n,r){return[n,r,function(n){return Sh(N(n,t,e))}]}}function Ch(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Lh(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=mn(t.parsedStyle.d.absolutePath,void 0,Te(Te({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Nh(t,e){return t[0]===e[0]&&t[1]===e[1]}function jh(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),c=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!c||0===Math.sin(c)||R(c,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(c/2-l)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(u-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}function Rh(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}_f((function(t){return C(t)?t.split(" ").map(_h):t.map(_h)}));var Ih=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)},Dh=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var c=af(r=B(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,u=(t.y-o.y)/2,f={x:Math.cos(c)*l+Math.sin(c)*u,y:-Math.sin(c)*l+Math.cos(c)*u},h=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);h>1&&(e*=Math.sqrt(h),n*=Math.sqrt(h));var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));d=d<0?0:d;var p=(i!==a?1:-1)*Math.sqrt(d),g=p*(e*f.y/n),v=p*(-n*f.x/e),m={x:Math.cos(c)*g-Math.sin(c)*v+(t.x+o.x)/2,y:Math.sin(c)*g+Math.cos(c)*v+(t.y+o.y)/2},y={x:(f.x-g)/e,y:(f.y-v)/n},b=Ih({x:1,y:0},y),x=Ih(y,{x:(-f.x-g)/e,y:(-f.y-v)/n});!a&&x>0?x-=2*Math.PI:a&&x<0&&(x+=2*Math.PI);var k=b+(x%=2*Math.PI)*s,w=e*Math.cos(k),M=n*Math.sin(k);return{x:Math.cos(c)*w-Math.sin(c)*M+m.x,y:Math.sin(c)*w+Math.cos(c)*M+m.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:k,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function Bh(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,c=r.xRotation,l=r.arcFlag,u=r.sweepFlag,f=Dh({x:t.prePoint[0],y:t.prePoint[1]},a,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=Dh({x:t.prePoint[0],y:t.prePoint[1]},a,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=h.x-f.x,p=h.y-f.y,g=Math.sqrt(d*d+p*p);return{x:-d/g,y:-p/g}}function Fh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zh(t,e){return Fh(t)*Fh(e)?(t[0]*e[0]+t[1]*e[1])/(Fh(t)*Fh(e)):1}function Gh(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(zh(t,e))}function Wh(t,e){var n=e[1],r=e[2],i=B(af(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],c=t[1],l=e[6],u=e[7],f=Math.cos(i)*(s-l)/2+Math.sin(i)*(c-u)/2,h=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(c-u)/2,d=f*f/(n*n)+h*h/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(h*h)+r*r*(f*f),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*h/r:0,m=n?g*-r*f/n:0,y=(s+l)/2+Math.cos(i)*v-Math.sin(i)*m,b=(c+u)/2+Math.sin(i)*v+Math.cos(i)*m,x=[(f-v)/n,(h-m)/r],k=[(-1*f-v)/n,(-1*h-m)/r],w=Gh([1,0],x),M=Gh(x,k);return zh(x,k)<=-1&&(M=Math.PI),zh(x,k)>=1&&(M=0),0===o&&M>0&&(M-=2*Math.PI),1===o&&M<0&&(M+=2*Math.PI),{cx:y,cy:b,rx:Nh(t,[l,u])?0:n,ry:Nh(t,[l,u])?0:r,startAngle:w,endAngle:w+M,xRotation:i,arcFlag:a,sweepFlag:o}}function $h(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,o=e*i,s=n-t,c=n+t,l=r-e,u=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,c,r-o,c,r],["C",c,r+o,n+a,u,n,u],["C",n-a,u,s,r+o,s,r],["Z"]]}function Yh(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case Iu.LINE:var r=t.parsedStyle,i=r.x1,a=void 0===i?0:i,o=r.y1,s=void 0===o?0:o,c=r.x2,l=void 0===c?0:c,u=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(a,s,l,void 0===u?0:u);break;case Iu.CIRCLE:var f=t.parsedStyle,h=f.r,d=void 0===h?0:h,p=f.cx,g=void 0===p?0:p,v=f.cy;n=$h(d,d,g,void 0===v?0:v);break;case Iu.ELLIPSE:var m=t.parsedStyle,y=m.rx,b=void 0===y?0:y,x=m.ry,k=void 0===x?0:x,w=m.cx,M=void 0===w?0:w,O=m.cy;n=$h(b,k,M,void 0===O?0:O);break;case Iu.POLYLINE:case Iu.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===Iu.POLYGON);break;case Iu.RECT:var E=t.parsedStyle,S=E.width,A=void 0===S?0:S,_=E.height,T=void 0===_?0:_,P=E.x,C=void 0===P?0:P,L=E.y,j=void 0===L?0:L,R=E.radius,I=R&&R.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var a=dl(i,4),o=a[0],s=a[1],c=a[2],l=a[3],u=t>0?1:-1,f=e>0?1:-1,h=u+f!==0?1:0;return[["M",u*o+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,h,t+n,f*s+r]:null,["L",t+n,e-f*c+r],c?["A",c,c,0,0,h,t+n-u*c,e+r]:null,["L",n+u*l,e+r],l?["A",l,l,0,0,h,n,e+r-f*l]:null,["L",n,f*o+r],o?["A",o,o,0,0,h,u*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(A,T,C,j,I&&R.map((function(t){return N(t,0,Math.min(Math.abs(A)/2,Math.abs(T)/2))})));break;case Iu.PATH:n=ol(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=Kt(e[1],e[2],0);n&&se(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=Kt(e[1],e[2],0),o=Kt(e[3],e[4],0),s=Kt(e[5],e[6],0);n&&(se(a,a,n),se(o,o,n),se(s,s,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var c=Kt(e[6],e[7],0);n&&se(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else if("Q"===e[0]){var l=Kt(e[1],e[2],0),u=Kt(e[3],e[4],0);n&&(se(l,l,n),se(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}(n,0,e)}var Hh=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=tn(t)}catch(n){e=tn(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],a=[r[1],r[2]],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&Nh(a,o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s<o;s++){var c=t[s];r=t[s+1];var l=c[0],u={command:l,prePoint:n,params:c,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[c[1],c[2]],a=s;break;case"A":var f=Wh(n,c);u.arcParams=f}if("Z"===l)n=i,r=t[a+1];else{var h=c.length;n=[c[h-2],c[h-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),u.currentPoint=n,e[a]&&Nh(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=d;var p=u.prePoint;if(["L","H","V"].includes(l))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===l){var g=[c[1],c[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===l){var v=e[s-1],m=Rh(v.currentPoint,p);"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===l){var y=[c[1],c[2]],b=[c[3],c[4]];u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[y[0]-b[0],y[1]-b[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[b[0]-y[0],b[1]-y[1]])}else if("S"===l){var x=e[s-1],k=Rh(x.currentPoint,p),w=[c[1],c[2]];"C"===x.command?(u.command="C",u.startTangent=[p[0]-k[0],p[1]-k[1]],u.endTangent=[n[0]-w[0],n[1]-w[1]]):(u.command="SQ",u.startTangent=[p[0]-w[0],p[1]-w[1]],u.endTangent=[n[0]-w[0],n[1]-w[1]])}else if("A"===l){var M=Bh(u,0),O=M.x,E=M.y,S=Bh(u,1,!1),A=S.x,_=S.y;u.startTangent=[O,E],u.endTangent=[A,_]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;a<t.length;a++){var o=t[a],s=o.currentPoint,c=o.params,l=o.prePoint,u=void 0;switch(o.command){case"Q":u=Au(l[0],l[1],c[1],c[2],c[3],c[4]);break;case"C":u=wu(l[0],l[1],c[1],c[2],c[3],c[4],c[5],c[6]);break;case"A":var f=o.arcParams;u=gu(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1])}u&&(o.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var h=T(n),d=T(r),p=_(n),g=_(r);if(0===i.length)return{x:h,y:d,width:p-h,height:g-d};for(var v=0;v<i.length;v++){var m=i[v],y=m.currentPoint;y[0]===h?h-=jh(m,e).xExtra:y[0]===p&&(p+=jh(m,e).xExtra),y[1]===d?d-=jh(m,e).yExtra:y[1]===g&&(g+=jh(m,e).yExtra)}return{x:h,y:d,width:p-h,height:g-d}}(o,0),c=s.x,l=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},Vh=_f(Hh);function qh(t){return C(t)?Vh(t):Hh(t)}function Uh(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=sn(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=sn(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=xn(r,i));var o,s,c,l,u,f,h,d,p=yn(a[0])!==yn(a[1])?(o=a[0],s=o.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(a[0]);return[p,(c=a[1],l=p,u=c.length-1,f=[],h=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var o,s=i+a;return 0===a||t[s]&&"M"===t[s][0]?(o=t[s],["M"].concat(o.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(c),d.forEach((function(t,e){c.slice(1).forEach((function(t,n){h+=cn(c[(e+n)%u].slice(-2),l[n%u].slice(-2))})),f[e]=h,h=0})),d[f.indexOf(Math.min.apply(null,f))]),function(t){return t}]}function Xh(t,e){return[t.points,e.points,function(t){return t}]}var Zh=null,Kh=/\s*(\w+)\(([^)]*)\)/g;function Qh(t){return function(e){var n=0;return t.map((function(t){return t===Zh?e[n++]:t}))}}function Jh(t){return t}var td={matrix:["NNNNNN",[Zh,Zh,0,0,Zh,Zh,0,0,0,0,1,0,Zh,Zh,0,1],Jh],matrix3d:["NNNNNNNNNNNNNNNN",Jh],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Qh([Zh,Zh,new Yf(1)]),Jh],scaleX:["N",Qh([Zh,new Yf(1),new Yf(1)]),Qh([Zh,new Yf(1)])],scaleY:["N",Qh([new Yf(1),Zh,new Yf(1)]),Qh([new Yf(1),Zh])],scaleZ:["N",Qh([new Yf(1),new Yf(1),Zh])],scale3d:["NNN",Jh],skew:["Aa",null,Jh],skewX:["A",null,Qh([Zh,Vf])],skewY:["A",null,Qh([Vf,Zh])],translate:["Tt",Qh([Zh,Zh,Hf]),Jh],translateX:["T",Qh([Zh,Hf,Hf]),Qh([Zh,Hf])],translateY:["T",Qh([Hf,Zh,Hf]),Qh([Hf,Zh])],translateZ:["L",Qh([Hf,Hf,Zh])],translate3d:["TTL",Jh]};function ed(t){for(var e=[],n=t.length,r=0;r<n;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!td[a])return[];var s=o.map((function(t){return Jf(t)}));e.push({t:a,d:s})}return e}function nd(t){if(Array.isArray(t))return ed(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Kh.lastIndex=0;e=Kh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=td[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var c=[],l=0;l<s.length;l++){var u=o[l],f=s[l],h=void 0;if(void 0===(h=u?{A:function(t){return"0"===t.trim()?Vf:xh(t)},N:_h,T:yh,L:vh}[f.toUpperCase()](u):{a:Vf,n:c[0],t:Hf}[f]))return[];c.push(h)}if(n.push({t:i,d:c}),Kh.lastIndex===t.length)return n}return[]}function rd(t){if(Array.isArray(t))return ed(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Kh.lastIndex=0;e=Kh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=td[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var c=[],l=0;l<s.length;l++){var u=o[l],f=s[l],h=void 0;if(void 0===(h=u?{A:function(t){return"0"===t.trim()?Vf:bh(t)},N:Ah,T:mh,L:gh}[f.toUpperCase()](u):{a:Vf,n:c[0],t:Hf}[f]))return[];c.push(h)}if(n.push({t:i,d:c}),Kh.lastIndex===t.length)return n}return[]}function id(t){var e,n,r,i;switch(t.t){case"rotateX":return i=af(wh(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=af(wh(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=af(wh(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=af(wh(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),c=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*c),2*(e*r*l-n*c),0,2*(e*n*l-r*c),1-2*(e*e+r*r)*l,2*(n*r*l+e*c),0,2*(e*r*l+n*c),2*(n*r*l-e*c),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=af(wh(t.d[0])),f=af(wh(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=af(wh(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=af(wh(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Oh(t.d[0],0,null)||0,n=Oh(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Oh(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Oh(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Oh(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Oh(t.d[0],0,null)||0,n=Oh(t.d[1],0,null)||0,r=Oh(t.d[2],0,null)||0,1];case"perspective":var h=Oh(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,h?-1/h:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function ad(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function od(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}(hf,t))return!1;if(dt(df,hf),df[3]=0,df[7]=0,df[11]=0,df[15]=1,Math.abs(bt(df))<1e-8)return!1;var o,s,c=hf[3],l=hf[7],u=hf[11],f=hf[12],h=hf[13],d=hf[14],p=hf[15];if(0!==c||0!==l||0!==u){if(pf[0]=c,pf[1]=l,pf[2]=u,pf[3]=p,!yt(df,df))return!1;mt(df,df),ge(i,pf,df)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=hf,(o=gf)[0][0]=s[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=Zt(gf[0]),re(gf[0],gf[0]),r[0]=ie(gf[0],gf[1]),mf(gf[1],gf[1],gf[0],1,-r[0]),n[1]=Zt(gf[1]),re(gf[1],gf[1]),r[0]/=n[1],r[1]=ie(gf[0],gf[2]),mf(gf[2],gf[2],gf[0],1,-r[1]),r[2]=ie(gf[1],gf[2]),mf(gf[2],gf[2],gf[1],1,-r[2]),n[2]=Zt(gf[2]),re(gf[2],gf[2]),r[1]/=n[2],r[2]/=n[2],ae(vf,gf[1],gf[2]),ie(gf[0],vf)<0)for(var g=0;g<3;g++)n[g]*=-1,gf[g][0]*=-1,gf[g][1]*=-1,gf[g][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+gf[0][0]-gf[1][1]-gf[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-gf[0][0]+gf[1][1]-gf[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-gf[0][0]-gf[1][1]+gf[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+gf[0][0]+gf[1][1]+gf[2][2],0)),gf[2][1]>gf[1][2]&&(a[0]=-a[0]),gf[0][2]>gf[2][0]&&(a[1]=-a[1]),gf[1][0]>gf[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(id).reduce(ad)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var sd=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var a=0;a<4;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)o[s][3]=a[s];for(var c=0;c<3;c++)for(var l=0;l<3;l++)o[3][c]+=e[l]*o[l][c];var u=i[0],f=i[1],h=i[2],d=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+h*h),p[0][1]=2*(u*f-h*d),p[0][2]=2*(u*h+f*d),p[1][0]=2*(u*f+h*d),p[1][1]=1-2*(u*u+h*h),p[1][2]=2*(f*h-u*d),p[2][0]=2*(u*h-f*d),p[2][1]=2*(f*h+u*d),p[2][2]=1-2*(u*u+f*f),o=t(o,p);var g,v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(v[2][1]=r[2],o=t(o,v)),r[1]&&(v[2][1]=0,v[2][0]=r[0],o=t(o,v)),r[0]&&(v[2][0]=0,v[1][0]=r[0],o=t(o,v));for(var m=0;m<3;m++)for(var y=0;y<3;y++)o[m][y]*=n[m];return 0===(g=o)[0][2]&&0===g[0][3]&&0===g[1][2]&&0===g[1][3]&&0===g[2][0]&&0===g[2][1]&&1===g[2][2]&&0===g[2][3]&&0===g[3][2]&&1===g[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function cd(t){return t.toFixed(6).replace(".000000","")}function ld(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=od(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=od(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=N(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return sd(t[0],t[1],t[2],e,t[4]).map(cd).join(",")}])}function ud(t){return t.replace(/[XY]/,"")}function fd(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function hd(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?Jf(o):Jf(o,t.unit)}))})},a=0;a<t.length;a++)i()}var o,s,c=[],l=[],u=[];if(t.length!==e.length){var f=ld(t,e);c=[f[0]],l=[f[1]],u=[["matrix",[f[2]]]]}else for(var h=0;h<t.length;h++){var d=t[h].t,p=e[h].t,g=t[h].d,v=e[h].d,m=td[d],y=td[p],b=void 0;if(s=p,"perspective"===(o=d)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var x=ld([t[h]],[e[h]]);c.push(x[0]),l.push(x[1]),u.push(["matrix",[x[2]]])}else{if(d===p)b=d;else if(m[2]&&y[2]&&ud(d)===ud(p))b=ud(d),g=m[2](g),v=y[2](v);else{if(!m[1]||!y[1]||fd(d)!==fd(p)){var k=ld(t,e);c=[k[0]],l=[k[1]],u=[["matrix",[k[2]]]];break}b=fd(d),g=m[1](g),v=y[1](v)}for(var w=[],M=[],O=[],E=0;E<g.length;E++){var S=kh(g[E],v[E],n,!1,E);w[E]=S[0],M[E]=S[1],O.push(S[2])}c.push(w),l.push(M),u.push([b,O])}}if(r){var A=c;c=l,l=A}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return u[e][1][n](t)})).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),"".concat(u[e][0],"(").concat(n,")")})).join(" ")}]}var dd=_f((function(t){if(C(t)){if("text-anchor"===t)return[Jf(0,"px"),Jf(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[yh(pd(e[0])),yh(pd(e[1]))]}return[Jf(t[0]||0,"px"),Jf(t[1]||0,"px")]}));function pd(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var gd=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Af.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Af.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Af.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Af.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Af.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Af.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Af.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Af.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Af.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:Af.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Af.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Af.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Af.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Af.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:Af.FILTER},{n:"clipPath",syntax:Af.DEFINED_PATH},{n:"textPath",syntax:Af.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Af.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Af.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Af.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Af.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Af.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Af.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Af.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Af.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Af.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Af.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Af.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Af.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Af.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Af.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Af.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Af.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Af.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Af.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Af.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Af.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Af.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:Af.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Af.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Af.NUMBER,d:function(t){return t===Iu.PATH||t===Iu.POLYGON||t===Iu.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:Af.MARKER},{n:"markerEnd",syntax:Af.MARKER},{n:"markerMid",syntax:Af.MARKER},{n:"markerStartOffset",syntax:Af.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Af.LENGTH,l:!0,int:!0,d:"0"}],vd=new Set(gd.filter((function(t){return!!t.l})).map((function(t){return t.n}))),md={},yd=function(){return rl((function t(e){var n=this;el(this,t),this.runtime=e,gd.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat(ol(t.a||[])).forEach((function(e){md[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=bd(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var a=!!n.forceUpdateGeometry;if(!a)for(var o in e)if(vd.has(o)){a=!0;break}var s,c,l=bd(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=hh(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=hh(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=hh(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Eh.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return ph(/deg|rad|grad|turn|px|%/g,t)||hh(t)}))}),n.lastIndex===t.length)return r}return[]}(e.filter)),l.has("radius")&&!y(e.radius)&&(t.parsedStyle.radius=Mh(e.radius,4)),l.has("lineDash")&&!y(e.lineDash)&&(t.parsedStyle.lineDash=Mh(e.lineDash,2)),l.has("points")&&e.points&&(t.parsedStyle.points=(s=e.points,c=C(s)?s.split(" ").map((function(t){var e=dl(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):s,{points:c,totalLength:0,segments:[]})),l.has("d")&&""===e.d&&(t.parsedStyle.d=tl({},Sf)),l.has("d")&&e.d&&(t.parsedStyle.d=qh(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[Af.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!$(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[Af.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[Af.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=nd(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=dd(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[Af.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[Af.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[Af.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!y(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[Af.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!y(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[Af.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[Af.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[Af.TRANSFORM_ORIGIN].postProcessor(t),a&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Vu),r.renderBounds||(r.renderBounds=new Vu);var i=t.parsedStyle,a=n.update(i,t),o=a.cx,s=void 0===o?0:o,c=a.cy,l=void 0===c?0:c,u=a.cz,f=void 0===u?0:u,h=a.hwidth,d=void 0===h?0:h,p=a.hheight,g=void 0===p?0:p,v=a.hdepth,m=void 0===v?0:v,y=[Math.abs(d),Math.abs(g),m],b=i.stroke,x=i.lineWidth,k=void 0===x?1:x,w=i.increasedLineWidthForHitTesting,M=void 0===w?0:w,O=i.shadowType,E=void 0===O?"outer":O,S=i.shadowColor,A=i.filter,_=void 0===A?[]:A,T=i.transformOrigin,P=[s,l,f];r.contentBounds.update(P,y);var C=e===Iu.POLYLINE||e===Iu.POLYGON||e===Iu.PATH?Math.SQRT2:.5;if(b&&!b.isNone){var L=((k||0)+(M||0))*C;y[0]+=L,y[1]+=L}if(r.renderBounds.update(P,y),S&&E&&"inner"!==E){var N=r.renderBounds,j=N.min,R=N.max,I=i.shadowBlur||0,D=i.shadowOffsetX||0,B=i.shadowOffsetY||0,F=j[0]-I+D,z=R[0]+I+D,G=j[1]-I+B,W=R[1]+I+B;j[0]=Math.min(j[0],F),R[0]=Math.max(R[0],z),j[1]=Math.min(j[1],G),R[1]=Math.max(R[1],W),r.renderBounds.setMinMax(j,R)}_.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,te(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,c=r.renderBounds,l=c.min,u=c.max,f=l[0]-s+a,h=u[0]+s+a,d=l[1]-s+o,p=u[1]+s+o;l[0]=Math.min(l[0],f),u[0]=Math.max(u[0],h),l[1]=Math.min(l[1],d),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(l,u)}})),t.geometry.dirty=!1;var $=g<0,Y=(d<0?-1:1)*(T?Oh(T[0],0,t,!0):0),H=($?-1:1)*(T?Oh(T[1],1,t,!0):0);(Y||H)&&t.setOrigin(Y,H)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===Iu.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===Iu.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function bd(t){return t.constructor.PARSED_STYLE_LIST}var xd=function(){return rl((function t(){el(this,t),this.mixer=Th}),[{key:"calculator",value:function(t,e,n,r){return wh(n)}}])}(),kd=function(){return rl((function t(){el(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Wf&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),wd=function(){return rl((function t(){el(this,t),this.parser=hh,this.mixer=dh}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Wf?"none"===n.value?Zf:Kf:n}}])}(),Md=function(){return rl((function t(){el(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof Wf?[]:n}}])}();function Od(t){var e=t.parsedStyle.fontSize;return y(e)?null:e}var Ed=function(){return rl((function t(){el(this,t),this.mixer=Th}),[{key:"calculator",value:function(t,e,n,r,i){if(j(n))return n;if(!Yf.isRelativeUnit(n.unit))return n.value;if(n.unit===Tf.kPercentage)return 0;if(n.unit===Tf.kEms){if(r.parentNode){var a=Od(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===Tf.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=Od(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Sd=function(){return rl((function t(){el(this,t),this.mixer=Ch}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Ad=function(){return rl((function t(){el(this,t),this.mixer=Ch}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),_d=function(){return rl((function t(){el(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Wf&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),Td=function(){return rl((function t(){el(this,t),this.mixer=Th}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Pd=function(){return rl((function t(){el(this,t),this.mixer=Ph(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===Iu.LINE||i===Iu.PATH||i===Iu.POLYLINE){var a=n.getPoint(r);a&&t.setLocalPosition(a.x,a.y)}}}}])}(),Cd=function(){return rl((function t(){el(this,t),this.mixer=Ph(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ld=function(){return rl((function t(){el(this,t),this.parser=qh,this.mixer=Uh}),[{key:"calculator",value:function(t,e,n){return n instanceof Wf&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ku(0,0,0,0)}:n}}])}(),Nd=rl((function t(){el(this,t),this.mixer=Xh})),jd=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).mixer=Ph(0,1/0),t}return hl(e,t),rl(e)}(Ed),Rd=function(){return rl((function t(){el(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Wf?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Id=function(){return rl((function t(){el(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}(),Dd=new WeakMap;function Bd(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;Dd.has(r)&&Dd.get(r).destroy(n),Dd.set(r,e)}}var Fd="undefined"!=typeof window&&void 0!==window.document;function zd(t){return!!t.getAttribute}function Gd(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Wd(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function $d(t,e){if(Fd)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Yd={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Hd="object"==typeof performance&&performance.now?performance:Date;function Vd(t){return t.nodeName===Iu.FRAGMENT||t.getRootNode().nodeName===Iu.FRAGMENT}function qd(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1,a=!!e&&!e.isNone,o=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=a,i=o):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var Ud=1,Xd="object"==typeof self&&self.self===self?self:"object"==typeof Xc&&Xc.global===Xc?Xc:{},Zd=Date.now(),Kd={},Qd=Date.now(),Jd=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Qd,r=n>16?0:16-n,i=Ud++;return Kd[i]=t,Object.keys(Kd).length>1||setTimeout((function(){Qd=e;var t=Kd;Kd={},Object.keys(t).forEach((function(e){return t[e](Xd.performance&&"function"==typeof Xd.performance.now?Xd.performance.now():Date.now()-Zd)}))}),r),i},tp=function(t){delete Kd[t]},ep=function(t){return"string"!=typeof t?Jd:""===t?Xd.requestAnimationFrame:Xd["".concat(t,"RequestAnimationFrame")]},np=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!ep(t)})),rp=ep(np),ip=function(t){return"string"!=typeof t?tp:""===t?Xd.cancelAnimationFrame:Xd["".concat(t,"CancelAnimationFrame")]||Xd["".concat(t,"CancelRequestAnimationFrame")]}(np);Xd.requestAnimationFrame=rp,Xd.cancelAnimationFrame=ip;var ap=function(){return rl((function t(){el(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}])}(),op=function(){return rl((function t(){el(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=Cu(Tu().mark((function t(){var e,n,r,i,a=arguments;return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,a);case 3:n=t.sent,r=0;case 5:if(!(r<this.callbacks.length-1)){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),sp=function(){return rl((function t(){el(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach((function(t){t.apply(void 0,r)}))}}])}(),cp=function(){return rl((function t(){el(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=arguments,i=this.callbacks[0].apply(void 0,r),a=0;a<this.callbacks.length-1;a++){i=(0,this.callbacks[a])(i)}return i}return null}}])}(),lp=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],up=/([\"\'])[^\'\"]+\1/;function fp(t,e,n){return vt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var hp=ft(),dp=ft(),pp={scale:function(t){St(hp,[t[0].value,t[1].value,1])},scaleX:function(t){St(hp,[t[0].value,1,1])},scaleY:function(t){St(hp,[1,t[0].value,1])},scaleZ:function(t){St(hp,[1,1,t[0].value])},scale3d:function(t){St(hp,[t[0].value,t[1].value,t[2].value])},translate:function(t){Et(hp,[t[0].value,t[1].value,0])},translateX:function(t){Et(hp,[t[0].value,0,0])},translateY:function(t){Et(hp,[0,t[0].value,0])},translateZ:function(t){Et(hp,[0,0,t[0].value])},translate3d:function(t){Et(hp,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Pt(hp,af(wh(t[0])))},rotateX:function(t){_t(hp,af(wh(t[0])))},rotateY:function(t){Tt(hp,af(wh(t[0])))},rotateZ:function(t){Pt(hp,af(wh(t[0])))},rotate3d:function(t){At(hp,af(wh(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){fp(hp,af(t[0].value),af(t[1].value))},skewX:function(t){fp(hp,af(t[0].value),0)},skewY:function(t){fp(hp,0,af(t[0].value))},matrix:function(t){gt(hp,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){gt.apply(qt,[hp].concat(ol(t.map((function(t){return t.value})))))}},gp=Kt(1,1,1),vp=Ut(),mp={translate:function(t,e){wg.sceneGraphService.setLocalScale(t,gp,!1),wg.sceneGraphService.setLocalEulerAngles(t,vp,void 0,void 0,!1),wg.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),wg.sceneGraphService.dirtifyLocal(t,t.transformable)}};function yp(t,e){if(t.length){if(1===t.length&&mp[t[0].t])return void mp[t[0].t](e,t[0].d);for(var n=vt(dp),r=0;r<t.length;r++){var i=t[r],a=i.t,o=i.d,s=pp[a];s&&(s(o),Ht(n,n,hp))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var bp=function(){return rl((function t(){el(this,t),this.parser=rd,this.mixer=hd}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Wf?[]:n}},{key:"postProcessor",value:function(t){yp(t.parsedStyle.transform,t)}}])}(),xp=function(){return rl((function t(){el(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Tf.kPixels&&e[1].unit===Tf.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),kp=function(){return rl((function t(){el(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=Ef.Z_INDEX_CHANGED)}}}])}(),wp=function(){return rl((function t(){el(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,a=void 0===i?0:i,o=t.r,s=void 0===o?0:o;return{cx:r,cy:a,hwidth:s,hheight:s}}}])}(),Mp=function(){return rl((function t(){el(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,a=void 0===i?0:i,o=t.rx,s=void 0===o?0:o,c=t.ry;return{cx:r,cy:a,hwidth:s,hheight:void 0===c?0:c}}}])}(),Op=function(){return rl((function t(){el(this,t)}),[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),c=(o-a)/2,l=(Math.max(n,i)-s)/2;return{cx:a+c,cy:s+l,hwidth:c,hheight:l}}}])}(),Ep=function(){return rl((function t(){el(this,t)}),[{key:"update",value:function(t){var e=t.d.rect,n=e.x,r=e.y,i=e.width/2,a=e.height/2;return{cx:n+i,cy:r+a,hwidth:i,hheight:a}}}])}(),Sp=function(){return rl((function t(){el(this,t)}),[{key:"update",value:function(t){if(t.points&&b(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,ol(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,ol(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,ol(e.map((function(t){return t[1]})))),a=Math.max.apply(Math,ol(e.map((function(t){return t[1]})))),o=(r-n)/2,s=(a-i)/2;return{cx:n+o,cy:i+s,hwidth:o,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Ap=function(){return rl((function t(){el(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,c=void 0===s?0:s,l=t.height,u=c,f=void 0===l?0:l;return o&&!C(o)&&(u||(u=o.width,t.width=u),f||(f=o.height,t.height=f)),{cx:r+u/2,cy:a+f/2,hwidth:u/2,hheight:f/2}}}])}(),_p=function(){return rl((function t(e){el(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,c=t.textBaseline,l=void 0===c?"alphabetic":c,u=t.dx,f=void 0===u?0:u,h=t.dy,d=void 0===h?0:h,p=t.x,g=void 0===p?0:p,v=t.y,m=void 0===v?0:v;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var y=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{}).offscreenCanvas,b=this.globalRuntime.textService.measureText(r,t,y);t.metrics=b;var x=b.width/2,k=b.height/2,w=g+x;"center"===a||"middle"===a?w+=s/2-x:"right"!==a&&"end"!==a||(w+=s-2*x);var M=m-k;return"middle"===l?M+=k:"top"===l||"hanging"===l?M+=2*k:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(M+=0),f&&(w+=f),d&&(M+=d),{cx:w,cy:M,hwidth:x,hheight:k}}}])}(),Tp=function(){return rl((function t(){el(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Pp=function(){return rl((function t(){el(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.width,s=void 0===o?0:o,c=t.height,l=void 0===c?0:c;return{cx:r+s/2,cy:a+l/2,hwidth:s/2,hheight:l/2}}}])}(),Cp=function(){return rl((function t(e){el(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Zu,this.page=new Zu,this.canvas=new Zu,this.viewport=new Zu,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(Qu)}}])}(),Lp=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).client=new Zu,t.movement=new Zu,t.offset=new Zu,t.global=new Zu,t.screen=new Zu,t}return hl(e,t),rl(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw new Error(Qu)}}])}(Cp),Np=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return hl(e,t),rl(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Lp),jp=function(t){function e(){return el(this,e),ul(this,e,arguments)}return hl(e,t),rl(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Lp),Rp=function(t){function e(t,n){var r;return el(this,e),(r=ul(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return hl(e,t),rl(e)}(Cp),Ip=new WeakMap,Dp=function(){return rl((function t(){el(this,t),this.emitter=new gl}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(W(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=m(e)?e:e.handleEvent;var s=m(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(W(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=m(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=m(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Rp(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Ip.get(this);r||(r=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&Ip.set(this,r);if(r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),Bp=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return hl(e,t),rl(e,[{key:"textContent",get:function(){var t="";this.nodeName===Iu.TEXT&&(t+=this.style.text);var e,n=Lu(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.nodeName===Iu.TEXT?t+=r.nodeValue:t+=r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===Iu.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(Qu)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(Qu)}},{key:"lookupPrefix",value:function(t){throw new Error(Qu)}},{key:"normalize",value:function(){throw new Error(Qu)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,c=s===i?a:i;if(s[s.length-c.length]===c[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-c.length,u=c.length-1;u>=0;u--){var f=c[u],h=s[l+u];if(h!==f){var d=f.parentNode.childNodes;return d.indexOf(f)<d.indexOf(h)?c===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Dp);Bp.DOCUMENT_POSITION_DISCONNECTED=1,Bp.DOCUMENT_POSITION_PRECEDING=2,Bp.DOCUMENT_POSITION_FOLLOWING=4,Bp.DOCUMENT_POSITION_CONTAINS=8,Bp.DOCUMENT_POSITION_CONTAINED_BY=16,Bp.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Fp=function(){return rl((function t(e,n){var r=this;el(this,t),this.emitter=new gl,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=ft(),this.tmpVec3=Ut(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;r.dispatchEvent(e,n?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=Hd.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var i=2===n.button;r.dispatchEvent(n,i?"rightup":"mouseup")}var a=r.trackingData(t.pointerId),o=r.findMountedTarget(a.pressTargetsByButton[t.button]),s=o;if(o&&!n.composedPath().includes(o)){for(var c=o;c&&!n.composedPath().includes(c);){if(n.currentTarget=c,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var l=2===n.button;r.notifyTarget(n,l?"rightupoutside":"mouseupoutside")}Bp.isNode(c)&&(c=c.parentNode)}delete a.pressTargetsByButton[t.button],s=c}if(s){var u,f=r.clonePointerEvent(n,"click");f.target=s,f.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:f.target,timeStamp:e});var h=r.context.renderingContext.root.ownerDocument.defaultView,d=a.clicksByButton[t.button];d.target===f.target&&e-d.timeStamp<h.dblClickSpeed?++d.clickCount:d.clickCount=1,d.target=f.target,d.timeStamp=e,f.detail=d.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==f.pointerType&&"touch"!==f.pointerType||r.dispatchEvent(f,"click"),r.dispatchEvent(f,"pointertap")),r.freeEvent(f)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o="mousemove"===t.type?"mouseout":"pointerout",s=r.createPointerEvent(t,o,a||void 0);if(r.dispatchEvent(s,"pointerout"),n&&r.dispatchEvent(s,"mouseout"),!e.composedPath().includes(a)){var c=r.createPointerEvent(t,"pointerleave",a||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseleave"),Bp.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(s)}if(a!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=r.clonePointerEvent(e,l);r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var f=a&&Bp.isNode(a)&&a.parentNode;f&&f!==(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var h=r.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==a&&h.target!==(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)h.currentTarget=h.target,r.notifyTarget(h),n&&r.notifyTarget(h,"mouseenter"),Bp.isNode(h.target)&&(h.target=h.target.parentNode);r.freeEvent(h)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Bp.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Bp.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Bp.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new Zu((t.x-((null==i?void 0:i.left)||0))/n,(t.y-((null==i?void 0:i.top)||0))/r)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new Zu((t.x+((null==i?void 0:i.left)||0))*n,(t.y+((null==i?void 0:i.top)||0))*r)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),c=r.getWorldTransform(),l=xt(this.tmpMatrix,c,s),u=Jt(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return se(u,u,l),new Zu(u[0],u[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=xt(this.tmpMatrix,n,r),a=Jt(this.tmpVec3,t.x,t.y,0);se(this.tmpVec3,this.tmpVec3,i);var o=this.context.config,s=o.width,c=o.height;return new Zu((a[0]+1)/2*s,(1-(a[1]+1)/2)*c)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e);this.emitter.emit(e||t.type,t)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;a<n.length;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)Bp.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,a=r.height,o=r.disableHitTesting;return e<0||n<0||e>i||n>a?null:!o&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e<n.length;e++){var r=n[e],i=this.nativeHTMLMap.get(r);if(i)return i}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(Np);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(jp);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(jp);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Np);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=Hd.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type;var r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Bp.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=zd(e)&&e.getAttribute("cursor");if(n)return n;e=Bp.isNode(e)&&e.parentNode}}}])}(),zp=function(){return rl((function t(){el(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||wg.offscreenCanvas)this.canvas=t||wg.offscreenCanvas,this.context=this.canvas.getContext("2d",tl({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",tl({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",tl({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Gp=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Wp=function(){return rl((function t(e,n){el(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new sp,initAsync:new ap,dirtycheck:new cp,cull:new cp,beginFrame:new sp,beforeRender:new sp,render:new sp,afterRender:new sp,endFrame:new sp,destroy:new sp,pick:new op,pickSync:new cp,pointerDown:new sp,pointerUp:new sp,pointerMove:new sp,pointerOut:new sp,pointerOver:new sp,pointerWheel:new sp,pointerCancel:new sp,click:new sp},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=tl(tl({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Gp.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(Gp.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&a);o&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),o&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var c=o?r.hooks.cull.call(s,r.context.camera):s;c&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(c))}e.dirty=!1,i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var c=[t];c.length>0;){var l=c.pop();s(l);for(var u=l.sortable.sorted||l.childNodes,f=u.length-1;f>=0;f--)c.push(u[f])}}},{key:"sort",value:function(t,e){e.sorted&&e.dirtyReason!==Ef.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;Gd(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Gd)}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Gp.DISPLAY_OBJECT_CHANGED)}}])}(),$p=/\[\s*(.*)=(.*)\s*\]/,Yp=function(){return rl((function t(){el(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match($p),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return y(n)?"":n.toString?n.toString():""}}])}(),Hp=function(t){return t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),Vp=function(t){function e(t,n,r,i,a,o,s,c){var l;return el(this,e),(l=ul(this,e,[null])).relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=a,l.attrChange=o,l.prevParsedValue=s,l.newParsedValue=c,l.type=t,l}return hl(e,t),rl(e)}(Cp);function qp(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}Vp.ADDITION=2,Vp.MODIFICATION=1,Vp.REMOVAL=3;var Up,Xp,Zp,Kp=new Vp(Hp.REPARENT,null,"","","",0,"",""),Qp=Se(),Jp=Ut(),tg=Kt(1,1,1),eg=ft(),ng=Se(),rg=Ut(),ig=ft(),ag=ve(),og=Ut(),sg=ve(),cg=Ut(),lg=Ut(),ug=Ut(),fg=ft(),hg=ve(),dg=ve(),pg=ve(),gg={affectChildren:!0},vg=function(){return rl((function t(e){el(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new Rp(Hp.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===Iu.FRAGMENT,o=Vd(e);t.parentNode=e;var s=a?t.childNodes:[t];j(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var c=e.sortable;if((null!=c&&null!==(r=c.sorted)&&void 0!==r&&r.length||t.parsedStyle.zIndex)&&(-1===c.dirtyChildren.indexOf(t)&&c.dirtyChildren.push(t),c.dirty=!0,c.dirtyReason=Ef.ADDED),!o){if(a)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}i&&t.dispatchEvent(Kp)}}},{key:"detach",value:function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Ef.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n)}}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=Kt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=ag;xe(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);we(pg,a),be(pg,pg),ye(r,pg,r),ye(n.localRotation,r,i),Ee(n.localRotation,n.localRotation),this.dirtifyLocal(t,n)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=Kt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;xe(dg,e[0],e[1],e[2]),Oe(n.localRotation,n.localRotation,dg),this.dirtifyLocal(t,n)}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=Kt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){xe(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);we(hg,be(ag,r)),Oe(n.localRotation,n.localRotation,hg),this.dirtifyLocal(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=Kt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;xe(r.localRotation,e[0],e[1],e[2]),n&&this.dirtifyLocal(t,r)}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=Kt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;le(e,Jp)||(!function(t,e,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=e[0],c=e[1],l=e[2],u=i*l-a*c,f=a*s-r*l,h=r*c-i*s,d=i*h-a*f,p=a*u-r*h,g=r*f-i*u,v=2*o;u*=v,f*=v,h*=v,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+g}(e,e,n.localRotation),te(n.localPosition,n.localPosition,e),this.dirtifyLocal(t,n))}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(ug[0]=e[0],ug[1]=e[1],ug[2]=null!==(n=e[2])&&void 0!==n?n:0,!le(this.getPosition(t),ug)){if(Qt(r.position,ug),null!==t.parentNode&&t.parentNode.transformable){var i=t.parentNode.transformable;dt(fg,i.worldTransform),yt(fg,fg),se(r.localPosition,ug,fg)}else Qt(r.localPosition,ug);this.dirtifyLocal(t,r)}}},{key:"setLocalPosition",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;lg[0]=e[0],lg[1]=e[1],lg[2]=null!==(n=e[2])&&void 0!==n?n:0,le(i.localPosition,lg)||(Qt(i.localPosition,lg),r&&this.dirtifyLocal(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r,i,a,o=t.transformable;r=o.localScale,i=o.localScale,a=Jt(rg,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],this.dirtifyLocal(t,o)}},{key:"setLocalScale",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;Jt(rg,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),le(rg,i.localScale)||(Qt(i.localScale,rg),r&&this.dirtifyLocal(t,i))}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=Jt(rg,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),le(e,Jp)||(te(rg,this.getPosition(t),e),this.setPosition(t,rg))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=ke(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);we(ag,o),be(ag,ag),ye(a.localRotation,ag,e),Ee(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=Me(ag,e,n,r,i));var o=t.transformable;we(o.localRotation,e),a&&this.dirtifyLocal(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(ng,e,n));var i,a,o=t.transformable;i=o.localSkew,a=e,i[0]=a[0],i[1]=a[1],r&&this.dirtifyLocal(t,o)}},{key:"dirtifyLocal",value:function(t,e){Vd(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var r=t.childNodes.length,i=0;i<r;i++)this.dirtifyFragment(t.childNodes[i]);t.nodeName===Iu.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n)&&n.nodeName!==Iu.FRAGMENT&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n))};this.pendingEvents.forEach((function(t,e){e.nodeName!==Iu.FRAGMENT&&(gg.affectChildren=t,t?e.forEach((function(t){n(t,gg)})):n(e,gg))})),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)qp(n),n=n.parentNode;e&&t.forEach((function(t){qp(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new Vp(Hp.ATTR_MODIFIED,n,e,e,t,Vp.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return Lt(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return jt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return Nt(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){Rt(t.localTransform,t.localRotation,t.localPosition,Kt(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(vt(ig),ig[4]=Math.tan(t.localSkew[0]),ig[1]=Math.tan(t.localSkew[1]),xt(t.localTransform,t.localTransform,ig));var e=Rt(ig,Me(ag,0,0,0,1),Jt(rg,1,1,1),t.localScale,t.origin);xt(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2],c=1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2],l=1!==a[0]||1!==a[1]||1!==a[2],u=0!==o[0]||0!==o[1]||0!==o[2];c||l||u?Rt(n,i,r,a,o):s?Et(n,r):vt(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=Lt(og,e),r=jt(sg,e),i=Nt(cg,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,tg,!1),this.setLocalPosition(t,Jp,!1),this.setLocalEulerAngles(t,Jp,void 0,void 0,!1),this.setLocalSkew(t,Qp,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,e);if(!Vu.isEmpty(r)){var i=n||new Vu;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&wg.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Vu}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new Vu).update(r.center,r.halfExtents))})),a||(a=new Vu),n){var o=Wd(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=eg;t.parentNode.transformable&&(e=yt(ig,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Vu.isEmpty(n)){var r=new Vu;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);Vu.isEmpty(r)||(n=new Vu).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=dl(n.getMin(),2),o=a[0],s=a[1],c=dl(n.getMax(),2),l=c[0],u=c[1];return new Ku(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),l-o,u-s)}return new Ku((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}}},{key:"sync",value:function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?xt(e.worldTransform,r.worldTransform,e.localTransform):dt(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}])}(),mg={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},yg=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,bg=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),xg=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),kg=function(){return rl((function t(e){var n=this;el(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!xg.exec(e)&&!bg.exec(t))},this.trimByKinsokuShorui=function(t){var e=ol(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e}),[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=mg.MetricsString+mg.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(mg.BaselineSymbol).width),c=mg.HeightMultiplier*s;s=s*mg.BaselineMultiplier|0,r.width=o,r.height=c,i.fillStyle="#f00",i.fillRect(0,0,o,c),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,c||1).data,u=l.length,f=4*o,h=0,d=0,p=!1;for(h=0;h<s;++h){for(var g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d+=f}for(n.ascent=s-h,d=u-f,p=!1,h=c;h>s;--h){for(var v=0;v<f;v+=4)if(255!==l[d+v]){p=!0;break}if(p)break;d-=f}return n.descent=h-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,c=e.lineWidth,l=void 0===c?1:c,u=e.textBaseline,f=void 0===u?"alphabetic":u,h=e.textAlign,d=void 0===h?"start":h,p=e.letterSpacing,g=void 0===p?0:p,v=e.textPath,m=e.leading,y=void 0===m?0:m,b=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,a=t.fontStyle,o=void 0===a?"normal":a,s=t.fontVariant,c=void 0===s?"normal":s,l=t.fontWeight,u=void 0===l?"normal":l,f=j(n)&&"".concat(n,"px")||"16px",h=i.split(","),d=h.length-1;d>=0;d--){var p=h[d].trim();!up.test(p)&&lp.indexOf(p)<0&&(p='"'.concat(p,'"')),h[d]=p}return"".concat(o," ").concat(c," ").concat(u," ").concat(f," ").concat(h.join(","))}(e),x=this.measureFont(b,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var k=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);k.font=b,e.isOverflowing=!1;var w=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=new Array(w.length),O=0;if(!v){for(var E=0;E<w.length;E++){var S=k.measureText(w[E]).width+(w[E].length-1)*g;M[E]=S,O=Math.max(O,S)}var A=O+l,_=s||x.fontSize+l,T=Math.max(_,x.fontSize+l)+(w.length-1)*(_+y),P=0;return"middle"===f?P=-T/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?P=-T:"top"!==f&&"hanging"!==f||(P=0),{font:b,width:A,height:T,lines:w,lineWidths:M,lineHeight:_+=y,maxLineWidth:O,fontProperties:x,lineMetrics:M.map((function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new Ku(n-l/2,P+e*_,t+l,_)}))}}v.getTotalLength();for(var C=0;C<w.length;C++)k.measureText(w[C]).width,w[C].length}},{key:"wordWrap",value:function(t,e,n){var r=this,i=e.wordWrapWidth,a=void 0===i?0:i,o=e.letterSpacing,s=void 0===o?0:o,c=e.maxLines,l=void 0===c?1/0:c,u=e.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),h=a+s,d="";"ellipsis"===u?d="...":u&&"clip"!==u&&(d=u);var p=[],g=0,v=0,m={},y=function(t){return r.getFromCache(t,s,m,f)},b=Array.from(d).reduce((function(t,e){return t+y(e)}),0);function x(t){if(!(b<=0||b>h)){for(var e=p[t].length,n=0,r=e,i=0;i<e;i++){var a=y(p[t][i]);if(n+a+b>h){r=i;break}n+=a}p[t]=(p[t]||"").slice(0,r)+d}}for(var k=Array.from(t),w=0;w<k.length;w++){var M=k[w],O=t[w-1],E=t[w+1],S=y(M);if(this.isNewline(M)){if(++g>=l){e.isOverflowing=!0,w<k.length-1&&x(g-1);break}v=0,p[g]=""}else{if(v>0&&v+S>h){if(g+1>=l){e.isOverflowing=!0,x(g);break}if(g++,v=0,p[g]="",this.isBreakingSpace(M))continue;this.canBreakInLastChar(M)||(p=this.trimToBreakable(p),v=this.sumTextWidthByCache(p[g]||"",m)),this.shouldBreakByKinsokuShorui(M,E)&&(p=this.trimByKinsokuShorui(p),v+=y(O||""))}v+=S,p[g]=(p[g]||"")+M}}return p.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&mg.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&mg.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=ol(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+1,o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(a,n.length),e[e.length-2]=n.slice(0,o),e}},{key:"canBreakInLastChar",value:function(t){return!t||!yg.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!yg.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n[t];if("number"!=typeof i){var a=t.length*e;i=r.measureText(t).width+a,n[t]=i}return i}}])}(),wg={},Mg=(Xp=new Ap,Zp=new Sp,Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Up={},Iu.FRAGMENT,null),Iu.CIRCLE,new wp),Iu.ELLIPSE,new Mp),Iu.RECT,Xp),Iu.IMAGE,Xp),Iu.GROUP,new Tp),Iu.LINE,new Op),Iu.TEXT,new _p(wg)),Iu.POLYLINE,Zp),Iu.POLYGON,Zp),Qc(Qc(Qc(Up,Iu.PATH,new Ep),Iu.HTML,new Pp),Iu.MESH,null)),Og=function(t){var e=new wd,n=new Ed;return Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(t={},Af.PERCENTAGE,null),Af.NUMBER,new Td),Af.ANGLE,new xd),Af.DEFINED_PATH,new kd),Af.PAINT,e),Af.COLOR,e),Af.FILTER,new Md),Af.LENGTH,n),Af.LENGTH_PERCENTAGE,n),Af.LENGTH_PERCENTAGE_12,new Sd),Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(t,Af.LENGTH_PERCENTAGE_14,new Ad),Af.COORDINATE,new Ed),Af.OFFSET_DISTANCE,new Pd),Af.OPACITY_VALUE,new Cd),Af.PATH,new Ld),Af.LIST_OF_POINTS,new Nd),Af.SHADOW_BLUR,new jd),Af.TEXT,new Rd),Af.TEXT_TRANSFORM,new Id),Af.TRANSFORM,new bp),Qc(Qc(Qc(t,Af.TRANSFORM_ORIGIN,new xp),Af.Z_INDEX,new kp),Af.MARKER,new _d)}();wg.CameraContribution=Mf,wg.AnimationTimeline=null,wg.EasingFunction=null,wg.offscreenCanvasCreator=new zp,wg.sceneGraphSelector=new Yp,wg.sceneGraphService=new vg(wg),wg.textService=new kg(wg),wg.geometryUpdaterFactory=Mg,wg.CSSPropertySyntaxFactory=Og,wg.styleValueRegistry=new yd(wg),wg.layoutRegistry=null,wg.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==Xc?Xc:{},wg.enableStyleSyntax=!0,wg.enableSizeAttenuation=!1;var Eg=0,Sg=new Vp(Hp.INSERTED,null,"","","",0,"",""),Ag=new Vp(Hp.REMOVED,null,"","","",0,"",""),_g=new Rp(Hp.DESTROY),Tg=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).entity=Eg++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:Of.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return hl(e,t),rl(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw new Error(Qu)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return wg.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Vd(this)||t.nodeName!==Iu.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(Sg.relatedNode=this,t.dispatchEvent(Sg)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return Ag.relatedNode=this,t.dispatchEvent(Ag),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),wg.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return wg.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return wg.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return wg.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return wg.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return wg.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return wg.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return wg.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(wg.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=r[0],o=r.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,ol(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.destroyChildren(),this.dispatchEvent(_g),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return wg.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return wg.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return wg.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return wg.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return wg.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw new Error(Qu)}},{key:"getAttributeNode",value:function(t){throw new Error(Qu)}},{key:"getAttributeNodeNS",value:function(t,e){throw new Error(Qu)}},{key:"hasAttributeNS",value:function(t,e){throw new Error(Qu)}},{key:"removeAttributeNS",value:function(t,e){throw new Error(Qu)}},{key:"removeAttributeNode",value:function(t){throw new Error(Qu)}},{key:"setAttributeNS",value:function(t,e,n){throw new Error(Qu)}},{key:"setAttributeNode",value:function(t){throw new Error(Qu)}},{key:"setAttributeNodeNS",value:function(t){throw new Error(Qu)}},{key:"toggleAttribute",value:function(t,e){throw new Error(Qu)}}])}(Bp);function Pg(t){return!(null==t||!t.nodeName)}var Cg=wg.globalThis.Proxy?wg.globalThis.Proxy:function(){},Lg=new Vp(Hp.ATTR_MODIFIED,null,null,null,null,Vp.MODIFICATION,null,null),Ng=Ut(),jg=ve(),Rg=function(t){function e(t){var n;return el(this,e),(n=ul(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||Iu.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),wg.enableStyleSyntax&&(n.style=new Cg({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return hl(e,t),rl(e,[{key:"destroy",value:function(){ml(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=tl({},this.attributes);for(var r in n){var i=n[r];Pg(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor(tl(tl({},this.config),{},{style:n}));return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};wg.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0}),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];$(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),ml(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t];wg.styleValueRegistry.processProperties(this,Qc({},t,e),n),r.dirty=!0;var o,s=this.parsedStyle[t];(this.isConnected&&(Lg.relatedNode=this,Lg.prevValue=i,Lg.newValue=e,Lg.attrName=t,Lg.prevParsedValue=a,Lg.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Lg):(Lg.target=this,this.ownerDocument.defaultView.dispatchEvent(Lg,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(o=this.attributeChangedCallback)||void 0===o||o.call(this,t,i,e,a,s))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=dl(t.getMin(),2),n=e[0],r=e[1],i=dl(t.getMax(),2),a=i[0],o=i[1];return new Ku(n,r,a-n,o-r)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.setOrigin(this,nf(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return wg.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.setPosition(this,nf(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.setLocalPosition(this,nf(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.translate(this,nf(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.translateLocal(this,nf(t,e,n,!1)),this}},{key:"getPosition",value:function(){return wg.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return wg.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=nf(t,e=e||t,n=n||t,!1)),wg.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=nf(t,e=e||t,n=n||t,!1)),wg.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return wg.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return wg.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return sf(dl(lf(Ng,wg.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return sf(dl(lf(Ng,wg.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return wg.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return wg.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return y(e)&&y(n)?wg.sceneGraphService.rotateLocal(this,0,0,t):wg.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return y(e)&&y(n)?wg.sceneGraphService.rotate(this,0,0,t):wg.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return wg.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return wg.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return wg.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return wg.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return wg.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return wg.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return wg.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return wg.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return wg.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){wg.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,ol(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,ol(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?x(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=dl(Lt(Ng,e),2),r=n[0],i=n[1],a=dl(Nt(Ng,e),2),o=a[0],s=a[1],c=jt(jg,e),l=dl(lf(Ng,c),3),u=l[0],f=l[2];return uf(u||f,r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=dl(ff(t),5),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];this.setEulerAngles(o).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=dl(ff(t),5),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];this.setLocalEulerAngles(o).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Tg);Rg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Ig=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return el(this,e),ul(this,e,[tl({type:Iu.CIRCLE},t)])}return hl(e,t),rl(e)}(Rg);Ig.PARSED_STYLE_LIST=new Set([].concat(ol(Rg.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var Dg=["style"],Bg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Nu(n,Dg);return el(this,e),(t=ul(this,e,[tl({style:r},i)])).isCustomElement=!0,t}return hl(e,t),rl(e)}(Rg);Bg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Fg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return el(this,e),ul(this,e,[tl({type:Iu.ELLIPSE},t)])}return hl(e,t),rl(e)}(Rg);Fg.PARSED_STYLE_LIST=new Set([].concat(ol(Rg.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"])),(function(t){function e(){return el(this,e),ul(this,e,[{type:Iu.FRAGMENT}])}return hl(e,t),rl(e)}(Rg)).PARSED_STYLE_LIST=new Set(["class","className"]);var zg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return el(this,e),ul(this,e,[tl({type:Iu.GROUP},t)])}return hl(e,t),rl(e)}(Rg);zg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Gg=["style"],Wg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Nu(n,Gg);return el(this,e),(t=ul(this,e,[tl({type:Iu.HTML,style:r},i)])).cullable.enable=!1,t}return hl(e,t),rl(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=yt(ft(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Vu.isEmpty(e)){var n=new Vu;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Rg);Wg.PARSED_STYLE_LIST=new Set([].concat(ol(Rg.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var $g=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return el(this,e),ul(this,e,[tl({type:Iu.IMAGE},t)])}return hl(e,t),rl(e)}(Rg);$g.PARSED_STYLE_LIST=new Set([].concat(ol(Rg.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var Yg=["style"],Hg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Nu(n,Yg);el(this,e),(t=ul(this,e,[tl({type:Iu.LINE,style:tl({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd;return o&&Pg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),s&&Pg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return hl(e,t),rl(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Pg(r)&&(this.markerStartAngle=0,r.remove()),i&&Pg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Pg(r)&&(this.markerEndAngle=0,r.remove()),i&&Pg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=e.x1,s=e.x2,c=e.y1,l=e.y2,u=t?n:r;if(u&&Pg(u)){var f,h,d,p,g,v,m;t?(p=o,g=c,h=s-o,d=l-c,v=i||0,m=this.markerStartAngle):(p=s,g=l,h=o-s,d=c-l,v=a||0,m=this.markerEndAngle),f=Math.atan2(d,h),u.setLocalEulerAngles(180*f/Math.PI+m),u.setLocalPosition(p+Math.cos(f)*v,g+Math.sin(f)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=yu(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=se(Ut(),Kt(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Zu(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return mu(t.x1,t.y1,t.x2,t.y2)}}])}(Rg);Hg.PARSED_STYLE_LIST=new Set([].concat(ol(Rg.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Vg=["style"],qg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Nu(n,Vg);el(this,e),(t=ul(this,e,[tl({type:Iu.PATH,style:r,initialParsedStyle:{miterLimit:4,d:tl({},Sf)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd,c=a.markerMid;return o&&Pg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),c&&Pg(c)&&t.placeMarkerMid(c),s&&Pg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return hl(e,t),rl(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Pg(r)&&(this.markerStartAngle=0,r.remove()),i&&Pg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Pg(r)&&(this.markerEndAngle=0,r.remove()),i&&Pg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=t?n:r;if(o&&Pg(o)){var s,c,l,u,f,h,d;if(t){var p=dl(this.getStartTangent(),2),g=p[0],v=p[1];u=v[0],f=v[1],c=g[0]-v[0],l=g[1]-v[1],h=i||0,d=this.markerStartAngle}else{var m=dl(this.getEndTangent(),2),y=m[0],b=m[1];u=b[0],f=b[1],c=y[0]-b[0],l=y[1]-b[1],h=a||0,d=this.markerEndAngle}s=Math.atan2(l,c),o.setLocalEulerAngles(180*s/Math.PI+d),o.setLocalPosition(u+Math.cos(s)*h,f+Math.sin(s)*h)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Pg(t))for(var n=1;n<e.length-1;n++){var r=dl(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return Lh(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return mn(t,e,Te(Te({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=se(Ut(),Kt(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Zu(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Lh(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Rg);qg.PARSED_STYLE_LIST=new Set([].concat(ol(Rg.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Ug=["style"],Xg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Nu(n,Ug);el(this,e),(t=ul(this,e,[tl({type:Iu.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd,c=a.markerMid;return o&&Pg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),c&&Pg(c)&&t.placeMarkerMid(c),s&&Pg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return hl(e,t),rl(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Pg(r)&&(this.markerStartAngle=0,r.remove()),i&&Pg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Pg(r)&&(this.markerEndAngle=0,r.remove()),i&&Pg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=(e.points||{}).points,s=t?n:r;if(s&&Pg(s)&&o){var c,l,u,f,h,d,p;if(f=o[0][0],h=o[0][1],t)l=o[1][0]-o[0][0],u=o[1][1]-o[0][1],d=i||0,p=this.markerStartAngle;else{var g=o.length;this.parsedStyle.isClosed?(l=o[g-1][0]-o[0][0],u=o[g-1][1]-o[0][1]):(f=o[g-1][0],h=o[g-1][1],l=o[g-2][0]-o[g-1][0],u=o[g-2][1]-o[g-1][1]),d=a||0,p=this.markerEndAngle}c=Math.atan2(u,l),s.setLocalEulerAngles(180*c/Math.PI+p),s.setLocalPosition(f+Math.cos(c)*d,h+Math.sin(c)*d)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Pg(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Rg);Xg.PARSED_STYLE_LIST=new Set([].concat(ol(Rg.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Zg=["style"],Kg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Nu(t,Zg);return el(this,e),ul(this,e,[tl({type:Iu.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return hl(e,t),rl(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Ou(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=mu(t[0],t[1],n[e+1][0],n[e+1][1]),o+=i,r[1]=o/s,a.push(r))})),this.parsedStyle.points.segments=a}var c=0,l=0;this.parsedStyle.points.segments.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(c=(t-e[0])/(e[1]-e[0]),l=n)}));var u=yu(n[l][0],n[l][1],n[l+1][0],n[l+1][1],c),f=u.x,h=u.y,d=se(Ut(),Kt(f,h,0),e?this.getWorldTransform():this.getLocalTransform());return new Zu(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(Xg);Kg.PARSED_STYLE_LIST=new Set([].concat(ol(Xg.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var Qg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return el(this,e),ul(this,e,[tl({type:Iu.RECT},t)])}return hl(e,t),rl(e)}(Rg);Qg.PARSED_STYLE_LIST=new Set([].concat(ol(Rg.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Jg=["style"],tv=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Nu(t,Jg);return el(this,e),ul(this,e,[tl({type:Iu.TEXT,style:tl({fill:"black"},n)},r)])}return hl(e,t),rl(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Rg);tv.PARSED_STYLE_LIST=new Set([].concat(ol(Rg.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var ev=function(){return rl((function t(){el(this,t),this.registry={},this.define(Iu.CIRCLE,Ig),this.define(Iu.ELLIPSE,Fg),this.define(Iu.RECT,Qg),this.define(Iu.IMAGE,$g),this.define(Iu.LINE,Hg),this.define(Iu.GROUP,zg),this.define(Iu.PATH,qg),this.define(Iu.POLYGON,Xg),this.define(Iu.POLYLINE,Kg),this.define(Iu.TEXT,tv),this.define(Iu.HTML,Wg)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),nv=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,a=t.syntax;wg.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:a})},rv=function(t){function e(){var t;el(this,e),(t=ul(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new wg.AnimationTimeline(t)}catch(t){}var n={};return gd.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=m(i)?i(Iu.GROUP):i)})),t.documentElement=new zg({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return hl(e,t),rl(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?tv:zg);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(Qu)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),a=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(r<0||i<0||r>o||i>s)return null;var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement}},{key:"elementFromPoint",value:(r=Cu(Tu().mark((function t(e,n){var r,i,a,o,s,c,l,u,f,h,d;return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,c=o.height,!(i<0||a<0||i>s||a>c)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,d=h.picked,t.abrupt("return",d&&d[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(r<0||i<0||r>o||i>s)return[];var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f}},{key:"elementsFromPoint",value:(n=Cu(Tu().mark((function t(e,n){var r,i,a,o,s,c,l,u,f,h,d;return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,c=o.height,!(i<0||a<0||i>s||a>c)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,(d=h.picked)[d.length-1]!==this.documentElement&&d.push(this.documentElement),t.abrupt("return",d);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(Ju)}},{key:"insertBefore",value:function(t,e){throw new Error(Ju)}},{key:"removeChild",value:function(t,e){throw new Error(Ju)}},{key:"replaceChild",value:function(t,e,n){throw new Error(Ju)}},{key:"append",value:function(){throw new Error(Ju)}},{key:"prepend",value:function(){throw new Error(Ju)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Bp),iv=function(){function t(e){el(this,t),this.strategies=e}return rl(t,[{key:"apply",value:function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,a=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===a.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=a.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new Rp(Hp.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();iv.tag="Culling";var av=function(){function t(){var e=this;el(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Np(null),this.rootWheelEvent=new jp(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=Lu(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e.bootstrapEvent(e.rootPointerEvent,o,r,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=Lu(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=r.value,s=e.bootstrapEvent(e.rootPointerEvent,o,i,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return rl(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=Lu(e);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=n.bootstrapEvent(n.rootPointerEvent,o,i,t);n.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=Lu(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=e.value,c=n.bootstrapEvent(n.rootPointerEvent,s,i,t);c.type+=a,n.context.eventService.mapEvent(c)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=Lu(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=e.value,o=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(o)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.x,o=i.y;t.viewport.x=a,t.viewport.y=o;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Yd[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var a=this.context.eventService.viewport2Canvas(e.viewport),o=a.x,s=a.y;return e.canvas.x=o,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Hd.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];$(i.button)&&(i.button=0),$(i.buttons)&&(i.buttons=1),$(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),$(i.width)&&(i.width=i.radiusX||1),$(i.height)&&(i.height=i.radiusY||1),$(i.tiltX)&&(i.tiltX=0),$(i.tiltY)&&(i.tiltY=0),$(i.pointerType)&&(i.pointerType="touch"),$(i.pointerId)&&(i.pointerId=i.identifier||0),$(i.pressure)&&(i.pressure=i.force||.5),$(i.twist)&&(i.twist=0),$(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;$(a.isPrimary)&&(a.isPrimary=!0),$(a.width)&&(a.width=1),$(a.height)&&(a.height=1),$(a.tiltX)&&(a.tiltX=0),$(a.tiltY)&&(a.tiltY=0),$(a.pointerType)&&(a.pointerType="mouse"),$(a.pointerId)&&(a.pointerId=1),$(a.pressure)&&(a.pressure=.5),$(a.twist)&&(a.twist=0),$(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();av.tag="Event";var ov=[Iu.CIRCLE,Iu.ELLIPSE,Iu.IMAGE,Iu.RECT,Iu.LINE,Iu.POLYLINE,Iu.POLYGON,Iu.TEXT,Iu.PATH,Iu.HTML],sv=function(){return rl((function t(){el(this,t)}),[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(Vu.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||Uu.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==Uu.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===Uu.OUTSIDE||n===Uu.INSIDE)return n;for(var i=Uu.INSIDE,a=ov.indexOf(t.nodeName)>-1,o=0,s=r.length;o<s;++o){var c=1<<o;if(n&c&&(!a||4!==o&&5!==o)){var l=r[o],u=l.normal,f=l.distance;if(ie(u,e.getPositiveFarPoint(r[o]))+f<0)return Uu.OUTSIDE;ie(u,e.getNegativeFarPoint(r[o]))+f<0&&(i|=c)}}return i}}])}(),cv=function(){function t(){el(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return rl(t,[{key:"apply",value:function(e){var n,r=this,i=e.renderingService,a=e.renderingContext,o=e.rBushRoot,s=a.root.ownerDocument.defaultView;this.rBush=o;var c=function(t){t.target.renderable.dirty=!0,i.dirtify()},l=function(t){r.syncTasks.set(t.target,t.detail.affectChildren),i.dirtify()},u=function(t){var e=t.target;wg.enableSizeAttenuation&&wg.styleValueRegistry.updateSizeAttenuation(e,s.getCamera().getZoom())},f=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.syncTasks.delete(e),wg.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){s.addEventListener(Hp.MOUNTED,u),s.addEventListener(Hp.UNMOUNTED,f),s.addEventListener(Hp.ATTR_MODIFIED,c),s.addEventListener(Hp.BOUNDS_CHANGED,l)})),i.hooks.destroy.tap(t.tag,(function(){s.removeEventListener(Hp.MOUNTED,u),s.removeEventListener(Hp.UNMOUNTED,f),s.removeEventListener(Hp.ATTR_MODIFIED,c),s.removeEventListener(Hp.BOUNDS_CHANGED,l),r.syncTasks.clear()}));var h=null!==(n=wg.globalThis.requestIdleCallback)&&void 0!==n?n:rp.bind(wg.globalThis);i.hooks.endFrame.tap(t.tag,(function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,h((function(){r.syncRTree(!0),r.isFirstTimeRenderingFinished=!0}))):r.syncRTree()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new Vu),i.dirtyRenderBounds.update(r.center,r.halfExtents));var a=dl(r.getMin(),2),o=a[0],s=a[1],c=dl(r.getMax(),2),l=c[0],u=c[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=o,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=u}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var a=t.syncNode(i,e);a&&(n.push(a),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();cv.tag="Prepare";var lv=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),uv=new Rp(Hp.MOUNTED),fv=new Rp(Hp.UNMOUNTED),hv=new Rp(lv.BEFORE_RENDER),dv=new Rp(lv.RERENDER),pv=new Rp(lv.AFTER_RENDER),gv=function(t){function e(t){var n;el(this,e),(n=ul(this,e)).Element=Rg,n.inited=!1,n.context={},n.document=new rv,n.document.defaultView=n,n.customElements=new ev;var r=t.container,i=t.canvas,a=t.offscreenCanvas,o=t.width,s=t.height,c=t.devicePixelRatio,l=t.renderer,u=t.background,f=t.cursor,h=t.document,d=t.requestAnimationFrame,p=t.cancelAnimationFrame,g=t.createImage,v=t.enableLargeImageOptimization,m=t.supportsPointerEvents,y=t.supportsTouchEvents,b=t.supportsCSSTransform,x=t.cleanUpOnDestroy,k=void 0===x||x,w=t.supportsMutipleCanvasesInOneContainer,M=t.useNativeClickEvent,O=t.alwaysTriggerPointerEventOnCanvas,E=t.isTouchEvent,S=t.isMouseEvent,A=t.dblClickSpeed;w||Bd(r,n,k);var _=o,T=s,P=c;return i&&(P=(P=c||Fd&&window.devicePixelRatio||1)>=1?Math.ceil(P):1,_=o||function(t){var e=$d(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/P,T=s||function(t){var e=$d(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/P),a&&(wg.offscreenCanvas=a),n.devicePixelRatio=P,n.requestAnimationFrame=null!=d?d:rp.bind(wg.globalThis),n.cancelAnimationFrame=null!=p?p:ip.bind(wg.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in wg.globalThis,n.supportsPointerEvents=null!=m?m:!!wg.globalThis.PointerEvent,n.isTouchEvent=null!=E?E:function(t){return n.supportsTouchEvents&&t instanceof wg.globalThis.TouchEvent},n.isMouseEvent=null!=S?S:function(t){return!wg.globalThis.MouseEvent||t instanceof wg.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof wg.globalThis.PointerEvent))},n.dblClickSpeed=null!=A?A:200,n.initRenderingContext({container:r,canvas:i,width:_,height:T,renderer:l,offscreenCanvas:a,devicePixelRatio:P,cursor:f||"default",background:u||"transparent",createImage:g,enableLargeImageOptimization:v,document:h,supportsCSSTransform:b,useNativeClickEvent:M,cleanUpOnDestroy:k,alwaysTriggerPointerEventOnCanvas:O}),n.initDefaultCamera(_,T,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return hl(e,t),rl(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new wg.CameraContribution;i.clipSpaceNearZ=n,i.setType(yf.EXPLORING,bf.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(kf,(function(){r.context.renderingContext.renderReasons.add(Gp.CAMERA_CHANGED),wg.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){wg.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;e||this.dispatchEvent(new Rp(lv.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();t&&(this.unmountChildren(n),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),e||this.dispatchEvent(new Rp(lv.AFTER_DESTROY));var r=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};r(uv),r(fv),r(hv),r(dv),r(pv),r(Lg),r(Sg),r(Ag),r(_g)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===xf.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Rp(lv.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(hv.detail=t,pv.detail=t),this.dispatchEvent(hv),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(dv)})),this.dispatchEvent(pv)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Ru,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new av,new cv,new iv([new sv])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(tl(tl({},wg),this.context)),this.context.renderingService=new Wp(wg,this.context),this.context.eventService=new Fp(wg,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new Rp(lv.READY))})):e.dispatchEvent(new Rp(lv.READY)):e.dispatchEvent(new Rp(lv.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(wg)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),ol((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(wg)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(fv):(fv.target=t,this.dispatchEvent(fv,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vd(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(uv):(uv.target=t,this.dispatchEvent(uv,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Dp),vv=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).landmarks=[],t}return hl(e,t),rl(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=tf(e),this.relAzimuth=tf(t),this.relRoll=tf(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===yf.EXPLORING){var r=me(ve(),[1,0,0],af((this.rotateWorld?1:-1)*this.relElevation)),i=me(ve(),[0,1,0],af((this.rotateWorld?1:-1)*this.relAzimuth)),a=me(ve(),[0,0,1],af(this.relRoll)),o=ye(ve(),i,r);o=ye(ve(),o,a);var s=It(ft(),o);kt(this.matrix,this.matrix,[0,0,-this.distance]),xt(this.matrix,this.matrix,s),kt(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===yf.ORBITING||this.type===yf.EXPLORING?this._getPosition():this.type===yf.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=nf(t,e,0),r=Xt(this.position);return te(r,r,ne(Ut(),this.right,n[0])),te(r,r,ne(Ut(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=Xt(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===yf.ORBITING||this.type===yf.EXPLORING?this._getDistance():this.type===yf.TRACKING&&te(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,c=a.focalPoint,l=void 0===c?this.focalPoint:c,u=a.roll,f=a.zoom,h=new wg.CameraContribution;h.setType(this.type,void 0),h.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),h.setFocalPoint(l[0],null!==(r=l[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=l[2])&&void 0!==i?i:this.focalPoint[2]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:ht(h.getWorldTransform()),right:Xt(h.right),up:Xt(h.up),forward:Xt(h.forward),position:Xt(h.getPosition()),focalPoint:Xt(h.getFocalPoint()),distanceVector:Xt(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=C(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=j(n)?{duration:n}:n,a=i.easing,o=void 0===a?"linear":a,s=i.duration,c=void 0===s?100:s,l=i.easingFunction,u=void 0===l?void 0:l,f=i.onfinish,h=void 0===f?void 0:f,d=i.onframe,p=void 0===d?void 0:d;this.cancelLandmarkAnimation();var g,v=r.position,m=r.focalPoint,y=r.zoom,b=r.roll,x=u||wg.EasingFunction(o),k=function(){e.setFocalPoint(m),e.setPosition(v),e.setRoll(b),e.setZoom(y),e.computeMatrix(),e.triggerUpdate(),null==h||h()};if(0===c)return k();var w=function(t){void 0===g&&(g=t);var n=t-g;if(n>=c)k();else{var r,i,a=x(n/c),o=Ut(),s=Ut();if(oe(o,e.focalPoint,m,a),oe(s,e.position,v,a),i=e.roll*(1-a)+b*a,r=e.zoom*(1-a)+y*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(i),e.setZoom(r),fe(o,m)+fe(s,v)<=.01&&void 0===y&&void 0===b)return k();e.computeMatrix(),e.triggerUpdate(),n<c&&(null==p||p(a),e.landmarkAnimationID=e.canvas.requestAnimationFrame(w))}};this.canvas.requestAnimationFrame(w)}}}])}(Mf);wg.CameraContribution=vv;
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,(function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),(r=n.startAngle,i=n.endAngle,r%=2*Math.PI,i%=2*Math.PI,r<0&&(r=2*Math.PI+r),i<0&&(i=2*Math.PI+i),r>=i&&(i+=2*Math.PI),{startAngle:r,endAngle:i}));var r,i},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:a}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,a]]};r.props={};const i=({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]];i.props={};const a=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];a.props={transform:!0};const o=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:a}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:a})]};o.props={};const s=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},c=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:a}=s(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:a})]};c.props={};const l=()=>[["parallel",0,1,0,1]];l.props={};const u=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];u.props={transform:!0};const f=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:a=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:a})]};f.props={};const h=({value:t})=>e=>e.map((()=>t));h.props={};const d=({value:t})=>e=>e.map(t);d.props={};const p=({value:t})=>e=>e.map((e=>e[t]));p.props={};const g=({value:t})=>()=>t;g.props={};var v=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=function(t,e){if(!v(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n};function y(t){return"function"==typeof t}function b(t){return null==t}function x(t){return Array.isArray(t)}var k=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function w(t,e){if(t)if(x(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(k(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var M=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return w(t,(function(n,r){y(t)&&"prototype"===r||e.push(r)})),e};var O=function(t){return"object"==typeof t&&null!==t},E={}.toString,S=function(t,e){return E.call(t)==="[object "+e+"]"},A=function(t){if(!O(t)||!S(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function _(t,e){if(!x(t))return null;var n;if(y(e)&&(n=e),A(e)&&(n=function(t){return function(t,e){var n=M(e),r=n.length;if(b(t))return!r;for(var i=0;i<r;i+=1){var a=n[i];if(e[a]!==t[a]||!(a in t))return!1}return!0}(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null}function T(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;r<e;r++)n=Math.max(n,t[r]);return n}var P=function(t){if(x(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},C=function(t,e,n){if(!x(t)&&!A(t))return t;var r=n;return w(t,(function(t,n){r=e(r,t,n)})),r};function L(t){return"string"==typeof t}function N(t){if(v(t)){return t[t.length-1]}}var j=function(t,e,n){return t<e?e:t>n?n:t};function R(t){return"number"==typeof t}function I(t,e,n){return void 0===n&&(n=1e-5),t===e||Math.abs(t-e)<n}var D=function(t,e){if(x(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=y(e)?e(a):a[e];o>r&&(n=a,r=o)}return n}},B=function(t,e){if(x(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=y(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}},F=function(t,e){return(t%e+e)%e},z=function(t){return b(t)?"":t.toString()},G=function(t){var e=z(t);return e.charAt(0).toLowerCase()+e.substring(1)};var W=function(t){var e=z(t);return e.charAt(0).toUpperCase()+e.substring(1)},$=function(t){return S(t,"Boolean")};var Y=function(t){return void 0===t},H=function(t){if("object"!=typeof t||null===t)return t;var e;if(x(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=H(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=H(t[i]):e[i]=t[i];return e},V=H;function q(t,e,n){var r;return function(){var i=this,a=arguments,o=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,a)}),e),o&&t.apply(i,a)}}var U=new Map;function X(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function Z(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(X(e,i)){var a=e[i];null!==a&&A(a)?(A(t[i])||(t[i]={}),n<r?Z(t[i],a,n+1,r):t[i]=e[i]):x(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var K=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Z(t,e[r]);return t},Q=function(t,e){if(!v(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},J=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(L(t)||L(e))return!1;if(v(t)||v(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=J(t[r],e[r]));r++);return n}if(O(t)||O(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=J(t[i[r]],e[i[r]]));r++);return n}return!1},tt=J,et=function(t,e,n){for(var r=0,i=L(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},nt=Object.prototype.hasOwnProperty,rt=function(t,e){return C(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},it=function(t,e,n){var r,i,a,o,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,o=t.apply(i,a),r||(i=a=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,a=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,o=t.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(c,u)),o};return l.cancel=function(){clearTimeout(r),s=0,r=i=a=null},l},at=function(){},ot=function(t){return t};function st(t){return b(t)?0:v(t)?t.length:Object.keys(t).length}var ct=1e-6,lt="undefined"!=typeof Float32Array?Float32Array:Array;function ut(){var t=new lt(9);return lt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var ft=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=n[0],d=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=n[6],b=n[7],x=n[8];return t[0]=h*r+d*o+p*l,t[1]=h*i+d*s+p*u,t[2]=h*a+d*c+p*f,t[3]=g*r+v*o+m*l,t[4]=g*i+v*s+m*u,t[5]=g*a+v*c+m*f,t[6]=y*r+b*o+x*l,t[7]=y*i+b*s+x*u,t[8]=y*a+b*c+x*f,t};function ht(){var t=new lt(16);return lt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function dt(t){var e=new lt(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function pt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function gt(t,e,n,r,i,a,o,s,c,l,u,f,h,d,p,g){var v=new lt(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=a,v[6]=o,v[7]=s,v[8]=c,v[9]=l,v[10]=u,v[11]=f,v[12]=h,v[13]=d,v[14]=p,v[15]=g,v}function vt(t,e,n,r,i,a,o,s,c,l,u,f,h,d,p,g,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=v,t}function mt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function yt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function bt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*o,b=n*c-i*o,x=n*l-a*o,k=r*c-i*s,w=r*l-a*s,M=i*l-a*c,O=u*g-f*p,E=u*v-h*p,S=u*m-d*p,A=f*v-h*g,_=f*m-d*g,T=h*m-d*v,P=y*T-b*_+x*A+k*S-w*E+M*O;return P?(P=1/P,t[0]=(s*T-c*_+l*A)*P,t[1]=(i*_-r*T-a*A)*P,t[2]=(g*M-v*w+m*k)*P,t[3]=(h*w-f*M-d*k)*P,t[4]=(c*S-o*T-l*E)*P,t[5]=(n*T-i*S+a*E)*P,t[6]=(v*x-p*M-m*b)*P,t[7]=(u*M-h*x+d*b)*P,t[8]=(o*_-s*S+l*O)*P,t[9]=(r*S-n*_-a*O)*P,t[10]=(p*w-g*x+m*y)*P,t[11]=(f*x-u*w-d*y)*P,t[12]=(s*E-o*A-c*O)*P,t[13]=(n*A-r*E+i*O)*P,t[14]=(g*b-p*k-v*y)*P,t[15]=(u*k-f*b+h*y)*P,t):null}function xt(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],v=t[15];return(e*o-n*a)*(f*v-h*g)-(e*s-r*a)*(u*v-h*p)+(e*c-i*a)*(u*g-f*p)+(n*s-r*o)*(l*v-h*d)-(n*c-i*o)*(l*g-f*d)+(r*c-i*s)*(l*p-u*d)}function kt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=n[0],x=n[1],k=n[2],w=n[3];return t[0]=b*r+x*s+k*f+w*g,t[1]=b*i+x*c+k*h+w*v,t[2]=b*a+x*l+k*d+w*m,t[3]=b*o+x*u+k*p+w*y,b=n[4],x=n[5],k=n[6],w=n[7],t[4]=b*r+x*s+k*f+w*g,t[5]=b*i+x*c+k*h+w*v,t[6]=b*a+x*l+k*d+w*m,t[7]=b*o+x*u+k*p+w*y,b=n[8],x=n[9],k=n[10],w=n[11],t[8]=b*r+x*s+k*f+w*g,t[9]=b*i+x*c+k*h+w*v,t[10]=b*a+x*l+k*d+w*m,t[11]=b*o+x*u+k*p+w*y,b=n[12],x=n[13],k=n[14],w=n[15],t[12]=b*r+x*s+k*f+w*g,t[13]=b*i+x*c+k*h+w*v,t[14]=b*a+x*l+k*d+w*m,t[15]=b*o+x*u+k*p+w*y,t}function wt(t,e,n){var r,i,a,o,s,c,l,u,f,h,d,p,g=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*v+f*m+e[12],t[13]=i*g+c*v+h*m+e[13],t[14]=a*g+l*v+d*m+e[14],t[15]=o*g+u*v+p*m+e[15]),t}function Mt(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ot(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+l*r,t[5]=o*i+u*r,t[6]=s*i+f*r,t[7]=c*i+h*r,t[8]=l*i-a*r,t[9]=u*i-o*r,t[10]=f*i-s*r,t[11]=h*i-c*r,t}function Et(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-l*r,t[1]=o*i-u*r,t[2]=s*i-f*r,t[3]=c*i-h*r,t[8]=a*r+l*i,t[9]=o*r+u*i,t[10]=s*r+f*i,t[11]=c*r+h*i,t}function St(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function At(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _t(t,e,n){var r,i,a,o=n[0],s=n[1],c=n[2],l=Math.hypot(o,s,c);return l<ct?null:(o*=l=1/l,s*=l,c*=l,r=Math.sin(e),a=1-(i=Math.cos(e)),t[0]=o*o*a+i,t[1]=s*o*a+c*r,t[2]=c*o*a-s*r,t[3]=0,t[4]=o*s*a-c*r,t[5]=s*s*a+i,t[6]=c*s*a+o*r,t[7]=0,t[8]=o*c*a+s*r,t[9]=s*c*a-o*r,t[10]=c*c*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Tt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Pt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ct(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Lt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,c=i+i,l=a+a,u=r*s,f=r*c,h=r*l,d=i*c,p=i*l,g=a*l,v=o*s,m=o*c,y=o*l;return t[0]=1-(d+g),t[1]=f+y,t[2]=h-m,t[3]=0,t[4]=f-y,t[5]=1-(u+g),t[6]=p+v,t[7]=0,t[8]=h+m,t[9]=p-v,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Nt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function jt(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(c,l,u),t}function Rt(t,e){var n=new lt(3);jt(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,s=e[1]*i,c=e[2]*a,l=e[4]*r,u=e[5]*i,f=e[6]*a,h=e[8]*r,d=e[9]*i,p=e[10]*a,g=o+u+p,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-d)/v,t[1]=(h-c)/v,t[2]=(s-l)/v):o>u&&o>p?(v=2*Math.sqrt(1+o-u-p),t[3]=(f-d)/v,t[0]=.25*v,t[1]=(s+l)/v,t[2]=(h+c)/v):u>p?(v=2*Math.sqrt(1+u-o-p),t[3]=(h-c)/v,t[0]=(s+l)/v,t[1]=.25*v,t[2]=(f+d)/v):(v=2*Math.sqrt(1+p-o-u),t[3]=(s-l)/v,t[0]=(h+c)/v,t[1]=(f+d)/v,t[2]=.25*v),t}function It(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],c=e[3],l=a+a,u=o+o,f=s+s,h=a*l,d=a*u,p=a*f,g=o*u,v=o*f,m=s*f,y=c*l,b=c*u,x=c*f,k=r[0],w=r[1],M=r[2],O=i[0],E=i[1],S=i[2],A=(1-(g+m))*k,_=(d+x)*k,T=(p-b)*k,P=(d-x)*w,C=(1-(h+m))*w,L=(v+y)*w,N=(p+b)*M,j=(v-y)*M,R=(1-(h+g))*M;return t[0]=A,t[1]=_,t[2]=T,t[3]=0,t[4]=P,t[5]=C,t[6]=L,t[7]=0,t[8]=N,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+O-(A*O+P*E+N*S),t[13]=n[1]+E-(_*O+C*E+j*S),t[14]=n[2]+S-(T*O+L*E+R*S),t[15]=1,t}function Dt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,f=r*s,h=i*o,d=i*s,p=i*c,g=a*o,v=a*s,m=a*c;return t[0]=1-f-p,t[1]=u+m,t[2]=h-v,t[3]=0,t[4]=u-m,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+v,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bt(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(r-i),t[10]=(i+r)*a,t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}var Ft=Bt;function zt(t,e,n,r,i,a,o){var s=1/(e-n),c=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(o+a)*l,t[15]=1,t}var Gt=zt;function Wt(t,e,n,r,i,a,o){var s=1/(e-n),c=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=a*l,t[15]=1,t}function $t(t,e,n,r){var i,a,o,s,c,l,u,f,h,d,p=e[0],g=e[1],v=e[2],m=r[0],y=r[1],b=r[2],x=n[0],k=n[1],w=n[2];return Math.abs(p-x)<ct&&Math.abs(g-k)<ct&&Math.abs(v-w)<ct?mt(t):(u=p-x,f=g-k,h=v-w,i=y*(h*=d=1/Math.hypot(u,f,h))-b*(f*=d),a=b*(u*=d)-m*h,o=m*f-y*u,(d=Math.hypot(i,a,o))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),s=f*o-h*a,c=h*i-u*o,l=u*a-f*i,(d=Math.hypot(s,c,l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=a,t[5]=c,t[6]=f,t[7]=0,t[8]=o,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*p+a*g+o*v),t[13]=-(s*p+c*g+l*v),t[14]=-(u*p+f*g+h*v),t[15]=1,t)}function Yt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Ht(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}var Vt=kt,qt=Yt,Ut=Object.freeze({__proto__:null,create:ht,clone:dt,copy:pt,fromValues:gt,set:vt,identity:mt,transpose:yt,invert:bt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15];return t[0]=s*(h*m-d*v)-f*(c*m-l*v)+g*(c*d-l*h),t[1]=-(r*(h*m-d*v)-f*(i*m-a*v)+g*(i*d-a*h)),t[2]=r*(c*m-l*v)-s*(i*m-a*v)+g*(i*l-a*c),t[3]=-(r*(c*d-l*h)-s*(i*d-a*h)+f*(i*l-a*c)),t[4]=-(o*(h*m-d*v)-u*(c*m-l*v)+p*(c*d-l*h)),t[5]=n*(h*m-d*v)-u*(i*m-a*v)+p*(i*d-a*h),t[6]=-(n*(c*m-l*v)-o*(i*m-a*v)+p*(i*l-a*c)),t[7]=n*(c*d-l*h)-o*(i*d-a*h)+u*(i*l-a*c),t[8]=o*(f*m-d*g)-u*(s*m-l*g)+p*(s*d-l*f),t[9]=-(n*(f*m-d*g)-u*(r*m-a*g)+p*(r*d-a*f)),t[10]=n*(s*m-l*g)-o*(r*m-a*g)+p*(r*l-a*s),t[11]=-(n*(s*d-l*f)-o*(r*d-a*f)+u*(r*l-a*s)),t[12]=-(o*(f*v-h*g)-u*(s*v-c*g)+p*(s*h-c*f)),t[13]=n*(f*v-h*g)-u*(r*v-i*g)+p*(r*h-i*f),t[14]=-(n*(s*v-c*g)-o*(r*v-i*g)+p*(r*c-i*s)),t[15]=n*(s*h-c*f)-o*(r*h-i*f)+u*(r*c-i*s),t},determinant:xt,multiply:kt,translate:wt,scale:Mt,rotate:function(t,e,n,r){var i,a,o,s,c,l,u,f,h,d,p,g,v,m,y,b,x,k,w,M,O,E,S,A,_=r[0],T=r[1],P=r[2],C=Math.hypot(_,T,P);return C<ct?null:(_*=C=1/C,T*=C,P*=C,i=Math.sin(n),o=1-(a=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],v=e[9],m=e[10],y=e[11],b=_*_*o+a,x=T*_*o+P*i,k=P*_*o-T*i,w=_*T*o-P*i,M=T*T*o+a,O=P*T*o+_*i,E=_*P*o+T*i,S=T*P*o-_*i,A=P*P*o+a,t[0]=s*b+f*x+g*k,t[1]=c*b+h*x+v*k,t[2]=l*b+d*x+m*k,t[3]=u*b+p*x+y*k,t[4]=s*w+f*M+g*O,t[5]=c*w+h*M+v*O,t[6]=l*w+d*M+m*O,t[7]=u*w+p*M+y*O,t[8]=s*E+f*S+g*A,t[9]=c*E+h*S+v*A,t[10]=l*E+d*S+m*A,t[11]=u*E+p*S+y*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:Ot,rotateY:Et,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+l*r,t[1]=o*i+u*r,t[2]=s*i+f*r,t[3]=c*i+h*r,t[4]=l*i-a*r,t[5]=u*i-o*r,t[6]=f*i-s*r,t[7]=h*i-c*r,t},fromTranslation:St,fromScaling:At,fromRotation:_t,fromXRotation:Tt,fromYRotation:Pt,fromZRotation:Ct,fromRotationTranslation:Lt,fromQuat2:function(t,e){var n=new lt(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+a*a+o*o;return f>0?(n[0]=2*(s*o+u*r+c*a-l*i)/f,n[1]=2*(c*o+u*i+l*r-s*a)/f,n[2]=2*(l*o+u*a+s*i-c*r)/f):(n[0]=2*(s*o+u*r+c*a-l*i),n[1]=2*(c*o+u*i+l*r-s*a),n[2]=2*(l*o+u*a+s*i-c*r)),Lt(t,e,n),t},getTranslation:Nt,getScaling:jt,getRotation:Rt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],c=i+i,l=a+a,u=o+o,f=i*c,h=i*l,d=i*u,p=a*l,g=a*u,v=o*u,m=s*c,y=s*l,b=s*u,x=r[0],k=r[1],w=r[2];return t[0]=(1-(p+v))*x,t[1]=(h+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(h-b)*k,t[5]=(1-(f+v))*k,t[6]=(g+m)*k,t[7]=0,t[8]=(d+y)*w,t[9]=(g-m)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:It,fromQuat:Dt,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),c=1/(i-r),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},perspectiveNO:Bt,perspective:Ft,perspectiveZO:function(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(r-i),t[10]=i*a,t[14]=i*r*a):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(o+s),l=2/(i+a);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*c*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:zt,ortho:Gt,orthoZO:Wt,lookAt:$t,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=a-n[1],h=o-n[2],d=u*u+f*f+h*h;d>0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,g=l*u-s*h,v=s*f-c*u;return(d=p*p+g*g+v*v)>0&&(p*=d=1/Math.sqrt(d),g*=d,v*=d),t[0]=p,t[1]=g,t[2]=v,t[3]=0,t[4]=f*v-h*g,t[5]=h*p-u*v,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Yt,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:Ht,equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],v=t[14],m=t[15],y=e[0],b=e[1],x=e[2],k=e[3],w=e[4],M=e[5],O=e[6],E=e[7],S=e[8],A=e[9],_=e[10],T=e[11],P=e[12],C=e[13],L=e[14],N=e[15];return Math.abs(n-y)<=ct*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-b)<=ct*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=ct*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-k)<=ct*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(o-w)<=ct*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=ct*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(c-O)<=ct*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-E)<=ct*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-S)<=ct*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=ct*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(h-_)<=ct*Math.max(1,Math.abs(h),Math.abs(_))&&Math.abs(d-T)<=ct*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-P)<=ct*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=ct*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(v-L)<=ct*Math.max(1,Math.abs(v),Math.abs(L))&&Math.abs(m-N)<=ct*Math.max(1,Math.abs(m),Math.abs(N))},mul:Vt,sub:qt});function Xt(){var t=new lt(3);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Zt(t){var e=new lt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Kt(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Qt(t,e,n){var r=new lt(3);return r[0]=t,r[1]=e,r[2]=n,r}function Jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function te(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ee(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function ne(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function re(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function ie(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function ae(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function oe(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],c=n[2];return t[0]=i*c-a*s,t[1]=a*o-r*c,t[2]=r*s-i*o,t}function se(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t}function ce(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function le(t,e,n){var r=e[0],i=e[1],a=e[2];return t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8],t}function ue(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(n-a)<=ct*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=ct*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=ct*Math.max(1,Math.abs(i),Math.abs(s))}var fe=ne,he=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},de=Kt;function pe(){var t=new lt(4);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ge(t,e,n,r){var i=new lt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function ve(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}function me(){var t=new lt(4);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ye(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function be(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+o*s+i*l-a*c,t[1]=i*u+o*c+a*s-r*l,t[2]=a*u+o*l+r*c-i*s,t[3]=o*u-r*s-i*c-a*l,t}function xe(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function ke(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=a*c*u-o*s*l,t[1]=o*s*u+a*c*l,t[2]=o*c*l-a*s*u,t[3]=o*c*u+a*s*l,t}Xt(),function(){var t=pe()}();var we=ge,Me=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Oe=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Ee=be,Se=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t};function Ae(){var t=new lt(2);return lt!=Float32Array&&(t[0]=0,t[1]=0),t}Xt(),Qt(1,0,0),Qt(0,1,0),me(),me(),ut(),function(){var t=Ae()}();var _e=function(t,e){return _e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},_e(t,e)};function Te(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}_e(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Pe=function(){return Pe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Pe.apply(this,arguments)};function Ce(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function Le(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o}function Ne(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}c((r=r.apply(t,e||[])).next())}))}function je(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Re(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function Ie(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function De(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var Be={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Fe(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var ze={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ge(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return ze[e]===t.length-1&&"achlmqstvz".includes(e)}))}function We(t){return Ge(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function $e(t){return We(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function Ye(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ze[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,ze[n]))),ze[n]););}function He(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function Ve(t){return t>=48&&t<=57||43===t||45===t||46===t}function qe(t){return t>=48&&t<=57}function Ue(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,c=!1,l=!1;if(a>=n)t.err="[path-util]: Invalid path value at index ".concat(a,', "pathValue" is missing param');else if(43!==(e=r.charCodeAt(a))&&45!==e||(a+=1,e=r.charCodeAt(a)),qe(e)||46===e){if(46!==e){if(o=48===e,a+=1,e=r.charCodeAt(a),o&&a<n&&e&&qe(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;a<n&&qe(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;qe(r.charCodeAt(a));)a+=1,c=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid float exponent'));if(a+=1,43!==(e=r.charCodeAt(a))&&45!==e||(a+=1),!(a<n&&qe(r.charCodeAt(a))))return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid integer exponent'));for(;a<n&&qe(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" is not a number')}function Xe(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function Ze(t){for(var e=t.pathValue,n=t.max;t.index<n&&Xe(e.charCodeAt(t.index));)t.index+=1}function Ke(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=ze[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Ze(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|i)||3!==o&&4!==o?Ue(t):He(t),t.err.length)return;t.data.push(t.param),Ze(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Ze(t))}if(t.index>=t.max)break;if(!Ve(n.charCodeAt(t.index)))break}Ye(t)}else Ye(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var Qe=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Je(t){if(We(t))return[].concat(t);var e=function(t){if(Ge(t))return[].concat(t);var e=new Qe(t);for(Ze(e);e.index<e.max&&!e.err.length;)Ke(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,a=0;return e.map((function(t){var e,o=t.slice(1).map(Number),s=t[0],c=s.toUpperCase();if("M"===s)return n=o[0],r=o[1],i=n,a=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[c,o[0]+r];break;case"H":e=[c,o[0]+n];break;default:var l=o.map((function(t,e){return t+(e%2?r:n)}));e=[c].concat(l)}else e=[c].concat(o);var u=e.length;switch(c){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,a=r)}return e}))}function tn(t,e){var n=t[0],r=e.x1,i=e.y1,a=e.x2,o=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-a,u=2*i-o;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,h=2*i-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(s)}else if("Q"===n){var d=s[0],p=s[1];e.qx=d,e.qy=p}return c}function en(t){if($e(t))return[].concat(t);for(var e=Je(t),n=Pe({},Be),r=0;r<e.length;r+=1){e[r]=tn(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[a-3]||n.y1}return e}function nn(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function rn(t,e,n,r,i,a,o,s,c,l){var u,f,h,d,p,g=t,v=e,m=n,y=r,b=s,x=c,k=120*Math.PI/180,w=Math.PI/180*(+i||0),M=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=nn(g,v,-w)).x,v=u.y;var O=(g-(b=(u=nn(b,x,-w)).x))/2,E=(v-(x=u.y))/2,S=O*O/(m*m)+E*E/(y*y);S>1&&(m*=S=Math.sqrt(S),y*=S);var A=m*m,_=y*y,T=(a===o?-1:1)*Math.sqrt(Math.abs((A*_-A*E*E-_*O*O)/(A*E*E+_*O*O)));d=T*m*E/y+(g+b)/2,p=T*-y*O/m+(v+x)/2,f=Math.asin(((v-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),h=Math.asin(((x-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),f=g<d?Math.PI-f:f,h=b<d?Math.PI-h:h,f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),o&&f>h&&(f-=2*Math.PI),!o&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>k){var C=h,L=b,N=x;h=f+k*(o&&h>f?1:-1),M=rn(b=d+m*Math.cos(h),x=p+y*Math.sin(h),m,y,i,0,o,L,N,[h,C,d,p])}P=h-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(h),D=Math.sin(h),B=Math.tan(P/4),F=4/3*m*B,z=4/3*y*B,G=[g,v],W=[g+F*R,v-z*j],$=[b+F*D,x-z*I],Y=[b,x];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat($,Y,M);for(var H=[],V=0,q=(M=W.concat($,Y,M)).length;V<q;V+=1)H[V]=V%2?nn(M[V-1],M[V],w).y:nn(M[V],M[V+1],w).x;return H}function an(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var on=function(t,e,n,r){return Ie(Ie([],an([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function sn(t,e){var n,r,i,a,o,s,c,l,u,f=t[0],h=t.slice(1).map(Number),d=h[0],p=h[1],g=e.x1,v=e.y1,m=e.x,y=e.y;switch("TQ".includes(f)||(e.qx=null,e.qy=null),f){case"M":return e.x=d,e.y=p,t;case"A":return n=[g,v].concat(h),["C"].concat(rn(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=d,e.qy=p,n=[g,v].concat(h),["C"].concat((r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],[(l=1/3)*r+(u=2/3)*a,l*i+u*o,l*s+u*a,l*c+u*o,s,c]));case"L":return["C"].concat(on(g,v,d,p));case"Z":return g===m&&v===y?["C",g,v,m,y,m,y]:["C"].concat(on(g,v,m,y))}return t}function cn(t,e){if(void 0===e&&(e=!1),function(t){return $e(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,a=en(t),o=Pe({},Be),s=[],c="",l=a.length,u=[],f=0;f<l;f+=1){a[f]&&(c=a[f][0]),s[f]=c;var h=sn(a[f],o);a[f]=h,Fe(a,s,f),l=a.length,"Z"===c&&u.push(f),i=(r=a[f]).length,o.x1=+r[i-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,u]:a}function ln(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function un(t,e,n,r,i){var a=ln([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(i<=0)o={x:t,y:e};else if(i>=a)o={x:n,y:r};else{var s=an([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function fn(t,e){var n=t.x,r=t.y,i=e.x,a=e.y,o=n*i+r*a,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2)));return(n*a-r*i<0?-1:1)*Math.acos(o/s)}function hn(t,e,n,r,i,a,o,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,g=u(n),v=u(r),m=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===v)return un(t,e,s,c,l).point;var y=(t-s)/2,b=(e-c)/2,x={x:h(m)*y+f(m)*b,y:-f(m)*y+h(m)*b},k=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(v,2);k>1&&(g*=d(k),v*=d(k));var w=(Math.pow(g,2)*Math.pow(v,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2)),M=(a!==o?1:-1)*d(w=w<0?0:w),O=M*(g*x.y/v),E=M*(-v*x.x/g),S=h(m)*O-f(m)*E+(t+s)/2,A=f(m)*O+h(m)*E+(e+c)/2,_={x:(x.x-O)/g,y:(x.y-E)/v},T=fn({x:1,y:0},_),P=fn(_,{x:(-x.x-O)/g,y:(-x.y-E)/v});!o&&P>0?P-=2*p:o&&P<0&&(P+=2*p);var C=T+(P%=2*p)*l,L=g*h(C),N=v*f(C);return{x:h(m)*L-f(m)*N+S,y:f(m)*L+h(m)*N+A}}function dn(t,e,n,r,i,a,o,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,g=void 0===p||p,v=u.sampleSize,m=void 0===v?30:v,y="number"==typeof l,b=t,x=e,k=0,w=[b,x,k],M=[b,x],O={x:0,y:0},E=[{x:b,y:x}];y&&l<=0&&(O={x:b,y:x});for(var S=0;S<=m;S+=1){if(b=(f=hn(t,e,n,r,i,a,o,s,c,S/m)).x,x=f.y,d&&E.push({x:b,y:x}),g&&(k+=ln(M,[b,x])),M=[b,x],y&&k>=l&&l>w[2]){var A=(k-l)/(k-w[2]);O={x:M[0]*(1-A)+w[0]*A,y:M[1]*(1-A)+w[1]*A}}w=[b,x,k]}return y&&l>=k&&(O={x:s,y:c}),{length:k,point:O,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function pn(t,e,n,r,i,a,o,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*a+Math.pow(c,3)*s}}function gn(t,e,n,r,i,a,o,s,c,l){var u,f=l.bbox,h=void 0===f||f,d=l.length,p=void 0===d||d,g=l.sampleSize,v=void 0===g?10:g,m="number"==typeof c,y=t,b=e,x=0,k=[y,b,x],w=[y,b],M={x:0,y:0},O=[{x:y,y:b}];m&&c<=0&&(M={x:y,y:b});for(var E=0;E<=v;E+=1){if(y=(u=pn(t,e,n,r,i,a,o,s,E/v)).x,b=u.y,h&&O.push({x:y,y:b}),p&&(x+=ln(w,[y,b])),w=[y,b],m&&x>=c&&c>k[2]){var S=(x-c)/(x-k[2]);M={x:w[0]*(1-S)+k[0]*S,y:w[1]*(1-S)+k[1]*S}}k=[y,b,x]}return m&&c>=x&&(M={x:o,y:s}),{length:x,point:M,min:{x:Math.min.apply(null,O.map((function(t){return t.x}))),y:Math.min.apply(null,O.map((function(t){return t.y})))},max:{x:Math.max.apply(null,O.map((function(t){return t.x}))),y:Math.max.apply(null,O.map((function(t){return t.y})))}}}function vn(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function mn(t,e,n,r,i,a,o,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof o,v=t,m=e,y=0,b=[v,m,y],x=[v,m],k={x:0,y:0},w=[{x:v,y:m}];g&&o<=0&&(k={x:v,y:m});for(var M=0;M<=p;M+=1){if(v=(c=vn(t,e,n,r,i,a,M/p)).x,m=c.y,u&&w.push({x:v,y:m}),h&&(y+=ln(x,[v,m])),x=[v,m],g&&y>=o&&o>b[2]){var O=(y-o)/(y-b[2]);k={x:x[0]*(1-O)+b[0]*O,y:x[1]*(1-O)+b[1]*O}}b=[v,m,y]}return g&&o>=y&&(k={x:i,y:a}),{length:y,point:k,min:{x:Math.min.apply(null,w.map((function(t){return t.x}))),y:Math.min.apply(null,w.map((function(t){return t.y})))},max:{x:Math.max.apply(null,w.map((function(t){return t.x}))),y:Math.max.apply(null,w.map((function(t){return t.y})))}}}function yn(t,e,n){for(var r,i,a,o,s,c,l,u,f,h=en(t),d="number"==typeof e,p=[],g=0,v=0,m=0,y=0,b=[],x=[],k=0,w={x:0,y:0},M=w,O=w,E=w,S=0,A=0,_=h.length;A<_;A+=1)p=(l="M"===(u=(f=h[A])[0]))?p:[g,v].concat(f.slice(1)),l?(M=w={x:m=f[1],y:y=f[2]},k=0,d&&e<.001&&(E=w)):"L"===u?(k=(r=un(p[0],p[1],p[2],p[3],(e||0)-S)).length,w=r.min,M=r.max,O=r.point):"A"===u?(k=(i=dn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,w=i.min,M=i.max,O=i.point):"C"===u?(k=(a=gn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,w=a.min,M=a.max,O=a.point):"Q"===u?(k=(o=mn(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,w=o.min,M=o.max,O=o.point):"Z"===u&&(k=(s=un((p=[g,v,m,y])[0],p[1],p[2],p[3],(e||0)-S)).length,w=s.min,M=s.max,O=s.point),d&&S<e&&S+k>=e&&(E=O),x.push(M),b.push(w),S+=k,g=(c="Z"!==u?f.slice(-2):[m,y])[0],v=c[1];return d&&e>=S&&(E={x:g,y:v}),{length:S,point:E,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function bn(t){return function(t){var e=0,n=0,r=0;return cn(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a=t.slice(1),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=a[5];return r=function(t,e,n,r,i,a,o,s){return 3*((s-e)*(n+i)-(o-t)*(r+a)+r*(t-i)-n*(e-a)+s*(i+t/3)-o*(a+e/3))/20}(e,n,o,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function xn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?gn(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),o=an(n,r,e),s=an(r,i,e),c=an(i,a,e),l=an(o,s,e),u=an(s,c,e),f=an(l,u,e);return[["C"].concat(o,l,f),["C"].concat(u,c,a)]}(r):[t,t]:[t],l:i}}))}function kn(t,e,n){var r=xn(t),i=xn(e),a=r.length,o=i.length,s=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,f=n||Math.max(a,o),h=[l,u],d=[f-a,f-o],p=0,g=[r,i].map((function(t,e){return t.l===f?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&d[e]&&t.l>=h[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:kn(g[0],g[1],f)}function wn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function Mn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function On(t,e){const n=Mn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function En(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function Sn(t,e){const n=Mn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function An(t,e){const n=[];for(const r of t)n[r]=e;return n}function _n(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function Tn(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=_n(t,n);if(null!==e)return[e,r]}}return[null,null]}function Pn(t){return!(t instanceof Date)&&"object"==typeof t}const Cn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{y1:On(An(t,0))}})]};function Ln(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Nn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jn(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e}while(i<a)}return i}return 2!==t.length?(e=Ln,n=(e,n)=>Ln(t(e),n),r=(e,n)=>t(e)-n):(e=t===Ln||t===Nn?t:Rn,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const o=i(t,e,n,a-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e}while(i<a)}return i}}}function Rn(){return 0}function In(t){return null===t?NaN:+t}Cn.props={};const Dn=jn(Ln),Bn=Dn.right,Fn=Dn.left,zn=jn(In).center;var Gn=Bn;function Wn(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function $n(t,e){const n=function(t,e){let n,r=0,i=0,a=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,a+=n*(e-i));else{let o=-1;for(let s of t)null!=(s=e(s,++o,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,a+=n*(s-i))}if(r>1)return a/(r-1)}(t,e);return n?Math.sqrt(n):n}function Yn(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(void 0===n?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}class Hn extends Map{constructor(t,e=qn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Vn(this,t))}has(t){return super.has(Vn(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function Vn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function qn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Un(t){return t}function Xn(t,...e){return Jn(t,Un,Un,e)}function Zn(t,...e){return Jn(t,Array.from,Un,e)}function Kn(t,e,...n){return Jn(t,Un,e,n)}function Qn(t,e,...n){return Jn(t,Array.from,e,n)}function Jn(t,e,n,r){return function t(i,a){if(a>=r.length)return n(i);const o=new Hn,s=r[a++];let c=-1;for(const t of i){const e=s(t,++c,i),n=o.get(e);n?n.push(t):o.set(e,[t])}for(const[e,n]of o)o.set(e,t(n,a));return e(o)}(t,0)}function tr(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=nr(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>nr(n[t],n[e])))),function(t,e){return Array.from(e,(e=>t[e]))}(t,r)}return t.sort(er(n))}function er(t=Ln){if(t===Ln)return nr;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function nr(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var rr=Array.prototype.slice;function ir(t){return()=>t}const ar=Math.sqrt(50),or=Math.sqrt(10),sr=Math.sqrt(2);function cr(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=ar?10:a>=or?5:a>=sr?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?cr(t,e,2*n):[s,c,l]}function lr(t,e,n){return cr(t=+t,e=+e,n=+n)[2]}function ur(t){return Math.max(1,Math.ceil(Math.log(Wn(t))/Math.LN2)+1)}function fr(){var t=Un,e=Yn,n=ur;function r(r){Array.isArray(r)||(r=Array.from(r));var i,a,o,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],h=n(c,u,f);if(!Array.isArray(h)){const t=f,n=+h;if(e===Yn&&([u,f]=function(t,e,n){let r;for(;;){const i=lr(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,a,o]=r?cr(e,t,n):cr(t,e,n);if(!(a>=i))return[];const s=a-i+1,c=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)c[t]=(a-t)/-o;else for(let t=0;t<s;++t)c[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)c[t]=(i+t)/-o;else for(let t=0;t<s;++t)c[t]=(i+t)*o;return c}(u,f,n),h[0]<=u&&(o=lr(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===Yn){const t=lr(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,g=d;h[p]<=u;)++p;for(;h[g-1]>f;)--g;(p||g<d)&&(h=h.slice(p,g),d=g-p);var v,m=new Array(d+1);for(i=0;i<=d;++i)(v=m[i]=[]).x0=i>0?h[i-1]:u,v.x1=i<d?h[i]:f;if(isFinite(o)){if(o>0)for(i=0;i<s;++i)null!=(a=c[i])&&u<=a&&a<=f&&m[Math.min(d,Math.floor((a-u)/o))].push(r[i]);else if(o<0)for(i=0;i<s;++i)if(null!=(a=c[i])&&u<=a&&a<=f){const t=Math.floor((u-a)*o);m[Math.min(d,t+(h[t]<=a))].push(r[i])}}else for(i=0;i<s;++i)null!=(a=c[i])&&u<=a&&a<=f&&m[Gn(h,a,0,d)].push(r[i]);return m}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:ir(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:ir([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:ir(Array.isArray(t)?rr.call(t):t),r):n},r}function hr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function dr(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function pr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function gr(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function vr(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?nr:er(i);r>n;){if(r-n>600){const a=r-n+1,o=e-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);vr(t,e,Math.max(n,Math.floor(e-o*c/a+l)),Math.min(r,Math.floor(e+(a-o)*c/a+l)),i)}const a=t[e];let o=n,s=r;for(mr(t,n,e),i(t[r],a)>0&&mr(t,n,r);o<s;){for(mr(t,o,s),++o,--s;i(t[o],a)<0;)++o;for(;i(t[s],a)>0;)--s}0===i(t[n],a)?mr(t,n,s):(++s,mr(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function mr(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function yr(t,e,n=In){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>In(n(t[r],r,t)))),e<=0)return gr(r);if(e>=1)return dr(r);var r,i=Uint32Array.from(t,((t,e)=>e)),a=r.length-1,o=Math.floor(a*e);return vr(i,o,0,a,((t,e)=>nr(r[t],r[e]))),o=function(t,e=Ln){let n,r=!1;if(1===e.length){let i;for(const a of t){const t=e(a);(r?Ln(t,i)>0:0===Ln(t,t))&&(n=a,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,o+1),(t=>r[t])),o>=0?o:-1}}function br(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}function xr(t,e){return function(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return pr(t);if(e>=1)return hr(t);var r,i=(r-1)*e,a=Math.floor(i),o=hr(vr(t,a).subarray(0,a+1));return o+(pr(t.subarray(a+1))-o)*(i-a)}}(t,.5,e)}function kr(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function wr(t){return t}function Mr(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),wr)}function Or(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function Er(t=""){throw new Error(t)}function Sr(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||t.attr(e,i)}function Ar(t){return null!=t&&!Number.isNaN(t)}function _r(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function Tr(t,e){return Pr(t,e)||{}}function Pr(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[G(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function Cr(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function Lr(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function Nr(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function jr(t){return null===t||!1===t}function Rr(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const a=e[i];A(a)&&A(t[i])?Rr(t[i],a,n,r+1):t[i]=a}return t}}function Ir(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function Dr(t){return t.map(((t,e)=>e))}function Br(t){return t[0]}function Fr(t){return t[t.length-1]}function zr(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function Gr(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){Gr(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}function Wr(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map((t=>{var e;return[t,null===(e=_n(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>Ar(t)));return Array.from(Xn(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function $r(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:Ln(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Zr((n=>t(e[n])))}(t):"series"===t?Vr:"value"===t?qr:"sum"===t?Ur:"maxIndex"===t?Xr:null}function Yr(t,e){for(const n of t)n.sort(e)}function Hr(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Vr(t,e,n){return Zr((t=>n[t]))}function qr(t,e,n){return Zr((t=>e[t]))}function Ur(t,e,n){const r=Dr(t),i=Array.from(Xn(r,(t=>n[+t])).entries()),a=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return Zr((t=>a.get(n[t])))}function Xr(t,e,n){const r=Dr(t),i=Array.from(Xn(r,(t=>n[+t])).entries()),a=new Map(i.map((([t,n])=>[t,dr(n,(t=>e[t]))])));return Zr((t=>a.get(n[t])))}function Zr(t){return(e,n)=>Ln(t(e),t(n))}const Kr=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:a="y1",series:o=!0}=t;return(t,s)=>{var c;const{data:l,encode:u,style:f={}}=s,[h,d]=_n(u,"y"),[p,g]=_n(u,"y1"),[v]=o?Tn(u,"series","color"):_n(u,"color"),m=Wr(e,t,s),y=(null!==(c=$r(n))&&void 0!==c?c:()=>null)(l,h,v);y&&Yr(m,y);const b=new Array(t.length),x=new Array(t.length),k=new Array(t.length),w=[],M=[];for(const t of m){r&&t.reverse();const e=p?+p[t[0]]:0,n=[],i=[];for(const r of t){const t=k[r]=+h[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const a=n.length>0?n:i,o=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===h[a[s]];)s--;for(;c<o.length-1&&0===h[o[c]];)c++;w.push(a[s]),M.push(o[c]);let l=e;for(const t of i.reverse()){const e=k[t];l=b[t]=(x[t]=l)+e}let u=e;for(const t of n){const e=k[t];e>0?u=b[t]=(x[t]=u)+e:b[t]=x[t]=u}}const O=new Set(w),E=new Set(M),S="y"===i?b:x,A="y"===a?b:x;let _;return _="point"===s.type?{y0:On(h,d),y:Mn(S,d)}:{y0:On(h,d),y:Mn(S,d),y1:Mn(A,g)},[t,K({},s,{encode:Object.assign({},_),style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>E.has(e)},f)})]}};function Qr(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Kr.props={};const Jr=t=>(e,n,r)=>{const{encode:i,transform:a=[]}=n;if(a.some(Qr))return[e,n];const{x:o,y:s}=i;if(void 0===o||void 0===s)return[e,n];const{series:c}=t;return Kr({groupBy:c?["x","series"]:"x"})(e,n,r)};function ti(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function ei(t){const e=`${t.getFullYear()}-${ti(t.getMonth()+1)}-${ti(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${ti(n)}:${ti(r)}:${ti(i)}`:e}Jr.props={};const ni=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(jr(i))return[t,n];const{title:a}=i;if(void 0!==a)return[t,n];const o=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>_n(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===o.length)return[t,n];const s=[];for(const e of t)s[e]={value:o.map((t=>t[e]instanceof Date?ei(t[e]):t[e])).join(", ")};return[t,K({},n,{tooltip:{title:s}})]}};ni.props={};const ri=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{x:On(An(t,0))},scale:{x:{guide:null}}})]};ri.props={};const ii=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{y:On(An(t,0))},scale:{y:{guide:null}}})]};ii.props={};const ai=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{z:On(An(t,0))},scale:{z:{guide:null}}})]};ai.props={};const oi=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{size:En(An(t,3))}})]};oi.props={};const si=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=Ce(n,["key"]);if(void 0!==r)return[t,e];const a=Object.values(i).map((({value:t})=>t)),o=t.map((t=>a.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,K({},e,{encode:{key:Mn(o)}})]};si.props={};const ci=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[a,o]=_n(n,"color");return[t,K({},e,{encode:{series:Mn(a,o)}})]};ci.props={};const li=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Pn)?[t,e]:[t,K({},e,{encode:{y:Mn(n)}})]};li.props={};const ui=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Pn)?[t,e]:[t,K({},e,{encode:{x:Mn(n)}})]};ui.props={};const fi=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=_n(n,"y");return[t,K({},e,{encode:{y1:Mn([...i])}})]};fi.props={};const hi=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=_n(n,"x");return[t,K({},e,{encode:{x1:Mn([...i])}})]};hi.props={};const di=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Pn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,K({},e,{encode:{x:Mn(r(n,0)),x1:Mn(r(n,1))}})]}return[t,e]};di.props={};const pi=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Pn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,K({},e,{encode:{y:Mn(r(n,0)),y1:Mn(r(n,1))}})]}return[t,e]};pi.props={};const gi=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(jr(i))return[t,n];const{items:a=[]}=i;if(!a||a.length>0)return[t,n];const o=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:a}=r[t];return i?null:a&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,K({},n,{tooltip:{items:o}})]}};gi.props={};const vi=()=>(t,e)=>[t,K({scale:{x:{padding:0},y:{padding:0}}},e)];vi.props={};const mi=()=>(t,e)=>{const{data:n,style:r={}}=e,i=Ce(e,["data","style"]),{x:a,y:o}=r,s=Ce(r,["x","y"]);if(null==a||null==o)return[t,e];const c=o||0;return[[0],K({},i,{data:[0],cartesian:!0,encode:{x:Mn([a||0]),y:Mn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};mi.props={};const yi=()=>(t,e)=>{const{style:n={}}=e;return[t,K({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};yi.props={};const bi=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(Pn))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),a=r.map((t=>t[1]));return[t,K({},e,{encode:{x:Mn(i),y:Mn(a)}})]};bi.props={};const xi=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:a}=n;return!a||i?[t,e]:[t,K({},e,{encode:{series:En(An(t,void 0))}})]};xi.props={};const ki=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return Ce(t,["groupBy","reverse","orderBy","padding"]),(t,a)=>{const{data:o,encode:s,scale:c}=a,{series:l}=c,[u]=_n(s,"y"),[f]=Tn(s,"series","color"),h=Hr(f,l),d=K({},a,{scale:{series:{domain:h,paddingInner:i}}}),p=Wr(e,t,a),g=$r(r);if(!g)return[t,K(d,{encode:{series:Mn(f)}})];const v=g(o,u,f);v&&Yr(p,v);const m=new Array(t.length);for(const t of p){n&&t.reverse();for(let e=0;e<t.length;e++)m[t[e]]=h[e]}return[t,K(d,{encode:{series:Mn(r?m:f)}})]}};ki.props={};const wi=t=>{const{groupBy:e=["x"],reducer:n=(t,e)=>e[t[0]],orderBy:r=null,reverse:i=!1,duration:a}=t;return(t,o)=>{const{encode:s}=o,c=(Array.isArray(e)?e:[e]).map((t=>[t,_n(s,t)[0]]));if(0===c.length)return[t,o];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(Xn(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=_n(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(a||3e3)/l.length,[f]=a?[An(t,u)]:Tn(s,"enterDuration",An(t,u)),[h]=Tn(s,"enterDelay",An(t,0)),d=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=hr(n,(t=>+f[t]));for(const t of n)d[t]=+h[t]+e;e+=r}return[t,K({},o,{encode:{enterDuration:En(f),enterDelay:En(d)}})]}};wi.props={};const Mi=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:a}=r,o=Ce(i,["x"]),s=Object.entries(o).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,_n(i,t)[0]])),[,c]=s.find((([t])=>"y"===t)),l=s.map((([e])=>[e,new Array(t.length)])),u=Wr(e,t,r),f=function(t){return"function"==typeof t?t:{min:(t,e)=>pr(t,(t=>e[+t])),max:(t,e)=>hr(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>br(t,(t=>e[+t])),median:(t,e)=>xr(t,(t=>e[+t])),sum:(t,e)=>kr(t,(t=>e[+t])),deviation:(t,e)=>$n(t,(t=>e[+t]))}[t]||hr}(n);for(const t of u){const e=f(t,c);for(const n of t)for(let t=0;t<s.length;t++){const[,r]=s[t],[,i]=l[t];i[n]=+r[n]/e}}const h=jr(a)||(null==a?void 0:a.items)&&0!==(null==a?void 0:a.items.length);return[t,K({},r,Object.assign({encode:Object.fromEntries(l.map((([t,e])=>[t,Mn(e,_n(i,t)[1])])))},!h&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function Oi(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function Ei(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function Si(t,e,n,r,i){let a=n||0,o=r||t.length;const s=i||(t=>t);for(;a<o;){const n=Math.floor((a+o)/2);s(t[n])>e?o=n:a=n+1}return a}Mi.props={};const Ai=Math.sqrt(50),_i=Math.sqrt(10),Ti=Math.sqrt(2);function Pi(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/10**i;return i>=0?(a>=Ai?10:a>=_i?5:a>=Ti?2:1)*10**i:-(10**-i)/(a>=Ai?10:a>=_i?5:a>=Ti?2:1)}function Ci(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const a=r/i;return a>=Ai?i*=10:a>=_i?i*=5:a>=Ti&&(i*=2),e<t?-i:i}const Li=(t,e,n=5)=>{const r=[t,e];let i,a=0,o=r.length-1,s=r[a],c=r[o];return c<s&&([s,c]=[c,s],[a,o]=[o,a]),i=Pi(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=Pi(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=Pi(s,c,n)),i>0?(r[a]=Math.floor(s/i)*i,r[o]=Math.ceil(c/i)*i):i<0&&(r[a]=Math.ceil(s*i)/i,r[o]=Math.floor(c*i)/i),r},Ni=1e3,ji=6e4,Ri=36e5,Ii=864e5,Di=6048e5,Bi=2592e6,Fi=31536e6;function zi(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let a=e;for(;a&&!i(t);)n(t,-1),a-=1})(t,i),e(t)},a=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:a,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,o)=>{const s=[],c=Math.floor(r);for(let l=o?a(t,r):a(t);l<e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const Gi=zi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Wi=zi(Ni,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Ni*e)}),(t=>t.getSeconds())),$i=zi(ji,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+ji*e)}),(t=>t.getMinutes())),Yi=zi(Ri,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Ri*e)}),(t=>t.getHours())),Hi=zi(Ii,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ii*e)}),(t=>t.getDate()-1)),Vi=zi(Bi,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),qi=zi(Di,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setDate(t.getDate()+7*e)}),(t=>{const e=Vi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Di)})),Ui=zi(Fi,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),Xi={millisecond:Gi,second:Wi,minute:$i,hour:Yi,day:Hi,week:qi,month:Vi,year:Ui},Zi=zi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Ki=zi(Ni,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Ni*e)}),(t=>t.getUTCSeconds())),Qi=zi(ji,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+ji*e)}),(t=>t.getUTCMinutes())),Ji=zi(Ri,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Ri*e)}),(t=>t.getUTCHours())),ta=zi(Ii,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ii*e)}),(t=>t.getUTCDate()-1)),ea=zi(Bi,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),na=zi(Di,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Di*e)}),(t=>{const e=ea.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Di)})),ra=zi(Fi,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),ia={millisecond:Zi,second:Ki,minute:Qi,hour:Ji,day:ta,week:na,month:ea,year:ra};function aa(t,e,n,r,i){const a=+t,o=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?ia:Xi,{year:n,month:r,week:i,day:a,hour:o,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[o,1],[o,3],[o,6],[o,12],[a,1],[a,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(o-a)/r:n||5,h=r||(o-a)/f,d=s.length,p=Si(s,h,0,d,u);let g;if(p===d){g=[c,Ci(a/c.duration,o/c.duration,f)]}else if(p){const t=h/u(s[p-1])<u(s[p])/h,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max(Ci(a,o,f),1)]}return g}const oa=(t,e,n,r,i)=>{const a=t>e,o=a?e:t,s=a?t:e,[c,l]=aa(o,s,n,r,i),u=[c.floor(o,l),c.ceil(s,l)];return a?u.reverse():u};function sa(t){return!(Y(t)||(e=t,null===e)||Number.isNaN(t));var e}const ca=t=>e=>-t(-e),la=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?ca(r):r},ua=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?ca(n):n},fa=(t,e,n,r)=>{const i=t<0,a=la(r,i),o=ua(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[o(Math.floor(a(c))),o(Math.ceil(a(l)))];return s?u.reverse():u};var ha={exports:{}},da={exports:{}},pa=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},ga=Array.prototype.concat,va=Array.prototype.slice,ma=da.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];pa(i)?e=ga.call(e,va.call(i)):e.push(i)}return e};ma.wrap=function(t){return function(){return t(ma(arguments))}};var ya={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ba=da.exports,xa=Object.hasOwnProperty,ka=Object.create(null);for(var wa in ya)xa.call(ya,wa)&&(ka[ya[wa]]=wa);var Ma=ha.exports={to:{},get:{}};function Oa(t,e,n){return Math.min(Math.max(e,t),n)}function Ea(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}Ma.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=Ma.get.hsl(t),n="hsl";break;case"hwb":e=Ma.get.hwb(t),n="hwb";break;default:e=Ma.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},Ma.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var a=2*n;i[n]=parseInt(e.slice(a,a+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:xa.call(ya,e[1])?((i=ya[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=Oa(i[n],0,255);return i[3]=Oa(i[3],0,1),i},Ma.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Oa(parseFloat(e[2]),0,100),Oa(parseFloat(e[3]),0,100),Oa(isNaN(n)?1:n,0,1)]}return null},Ma.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Oa(parseFloat(e[2]),0,100),Oa(parseFloat(e[3]),0,100),Oa(isNaN(n)?1:n,0,1)]}return null},Ma.to.hex=function(){var t=ba(arguments);return"#"+Ea(t[0])+Ea(t[1])+Ea(t[2])+(t[3]<1?Ea(Math.round(255*t[3])):"")},Ma.to.rgb=function(){var t=ba(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},Ma.to.rgb.percent=function(){var t=ba(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},Ma.to.hsl=function(){var t=ba(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},Ma.to.hwb=function(){var t=ba(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},Ma.to.keyword=function(t){return ka[t.slice(0,3)]};var Sa=ha.exports;function Aa(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function _a(t){const e=Sa.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const a=r<.5?r*(1+n):r+n-r*n,o=2*r-a;return[255*Aa(o,a,e+1/3),255*Aa(o,a,e),255*Aa(o,a,e-1/3),i]}(r):null}const Ta=(t,e)=>n=>t*(1-n)+e*n,Pa=(t,e)=>"number"==typeof t&&"number"==typeof e?Ta(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=_a(t),r=_a(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const a=n[i],o=r[i];e[i]=a*(1-t)+o*t}const[i,a,o,s]=e;return`rgba(${Math.round(i)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}})(t,e):()=>t,Ca=(t,e)=>{const n=Ta(t,e);return t=>Math.round(n(t))};function La({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Na(t){return"object"==typeof t?t.valueOf():t}class ja extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Na,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(La({map:this.map,initKey:this.initKey},t))}has(t){return super.has(La({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class Ra{constructor(t){this.options=K({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=K({},this.options,t),this.rescale(t)}rescale(t){}}const Ia=Symbol("defaultUnknown");function Da(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Ba(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:a}=t;let o=i.get(e);if(void 0===o){if(a!==Ia)return a;o=n.push(e)-1,i.set(e,o)}return r[o%r.length]}function Fa(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class za extends Ra{getDefaultOptions(){return{domain:[],range:[],unknown:Ia}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Da(this.domainIndexMap,this.getDomain(),this.domainKey),Ba({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Da(this.rangeIndexMap,this.getRange(),this.rangeKey),Ba({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Fa(e),this.rangeKey=Fa(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new za(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Ga(t){return Math.round(1e12*t)/1e12}function Wa(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(a,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,v=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),m=v.reduce(((t,e)=>t+e)),y=g/m,b=new ja(e.map(((t,e)=>{const n=v[e]*y;return[t,o?Math.floor(n):n]}))),x=new ja(e.map(((t,e)=>{const n=v[e]*y+p;return[t,o?Math.floor(n):n]}))),k=Array.from(x.values()).reduce(((t,e)=>t+e)),w=u+(h-(k-k/c*i))*s;let M=o?Math.round(w):w;const O=new Array(c);for(let t=0;t<c;t+=1){O[t]=Ga(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:O}}class $a extends za{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Ia,flex:[]}}constructor(t){super(t)}clone(){return new $a(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:a,valueBandWidth:o,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Wa(t);const{range:i,paddingOuter:a,paddingInner:o,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*a,p=r-o;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-o))*c,u=l*(1-o),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map(((t,e)=>f+e*l));return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=o,this.adjustedRange=a}}const Ya=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&n>0)return[a];let s=Pi(a,o,n);if(0===s||!Number.isFinite(s))return[];if(s>0){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i};class Ha extends Ra{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Ya}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return R(r)&&R(i)?t(r,i,n):[]}clone(){return new Ha(this.options)}}function Va(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const qa=[1,5,2,2.5,4,3],Ua=100*Number.EPSILON;function Xa(t,e,n,r,i,a){const o=st(e),s=Q(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,a);return(l<Ua||a-l<Ua)&&r<=0&&i>=0&&(c=1),1-s/(o-1)-n+c}function Za(t,e,n){const r=st(e);return 1-Q(e,t)/(r-1)-n+1}function Ka(t,e,n,r,i,a){const o=(t-1)/(a-i),s=(e-1)/(Math.max(a,r)-Math.min(n,i));return 2-Math.max(o/s,s/o)}function Qa(t,e){return t>=e?2-(t-1)/(e-1):1}function Ja(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function to(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const eo=(t,e,n=5,r=!0,i=qa,a=[.25,.2,.5,.05])=>{const o=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!o)return[];if(e-t<1e-15||1===o)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=Za(l,i,c);if(a[0]*u+a[1]+a[2]+a[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=Qa(f,o);if(a[0]*u+a[1]+a[2]*n+a[3]<s.score)break;const h=(e-t)/(f+1)/c/l;let d=Math.ceil(Math.log10(h));for(;d<1/0;){const h=c*l*10**d,p=to(t,e,h*(f-1));if(a[0]*u+a[1]*p+a[2]*n+a[3]<s.score)break;const g=Math.floor(e/h)*c-(f-1)*c,v=Math.ceil(t/h)*c;if(g<=v){const n=v-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(h/c),d=n+h*(f-1),p=h,v=Xa(l,i,c,n,d,p),m=Ja(t,e,n,d),y=Ka(f,o,t,e,n,d),b=1,x=a[0]*v+a[1]*m+a[2]*y+a[3]*b;x>s.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=Va(s.lmax),u=Va(s.lmin),f=Va(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=Va(u);for(let t=1;t<h;t+=1)d[t]=Va(d[t-1]+f);return d};class no extends Ra{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:eo}}map(t){return sa(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new no(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return R(r)&&R(i)?n(r,i,e):[]}}const ro=(t,e,n)=>{const[r,i]=t,[a,o]=e;let s,c;return r<i?(s=Ei(r,i),c=n(a,o)):(s=Ei(i,r),c=n(o,a)),Oi(c,s)},io=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=t[0]>t[r],s=o?[...t].reverse():t,c=o?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=Ei(s[t],s[t+1]),a[t]=n(c[t],c[t+1]);return e=>{const n=Si(t,e,1,r)-1,o=i[n];return Oi(a[n],o)(e)}},ao=(t,e,n,r)=>(Math.min(t.length,e.length)>2?io:ro)(t,e,r?Ca:n);class oo extends Ra{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Ta,tickCount:5}}map(t){return sa(t)?this.output(t):this.options.unknown}invert(t){return sa(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Li}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):ot}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:a}=this.options,o=ao(n.map(t),r,a,i);this.output=Oi(o,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,a=ao(i,r.map(t),Ta);this.input=Oi(e,n,a)}}class so extends oo{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Pa,tickMethod:Ya,tickCount:5}}chooseTransforms(){return[ot,ot]}clone(){return new so(this.options)}}class co extends $a{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Ia,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new co(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const lo=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class uo extends oo{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Pa,tickMethod:Ya,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[ot,ot];const e=.5===t?lo:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new uo(this.options)}}class fo extends uo{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Pa,tickMethod:Ya,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new fo(this.options)}}class ho extends Ra{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!sa(t))return this.options.unknown;const e=Si(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new ho(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const po=(t,e,n,r=10)=>{const i=t<0,a=ua(r,i),o=la(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=o(c),f=o(l),h=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=a(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}else for(;u<=f;u+=1){const t=a(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}2*h.length<n&&(h=Ya(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=Ya(u,f,t).map(a)}return s?h.reverse():h};class go extends oo{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Pa,tickMethod:po,tickCount:5}}chooseNice(){return fa}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[la(t,n),ua(t,n)]}clone(){return new go(this.options)}}class vo extends ho{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:eo}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=Li(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new vo(this.options)}}function mo(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),a=t[i];return a+(t[i+1]-a)*(r-i)}class yo extends ho{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:eo}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort(((t,e)=>t-e));const i=[];for(let t=1;t<e;t+=1)i.push(mo(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],a=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||a]}getThresholds(){return this.thresholds}clone(){return new yo(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var bo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,xo=/\[([^]*?)\]/gm;function ko(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function wo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var a=i[r];for(var o in a)t[o]=a[o]}return t}var Mo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Oo=["January","February","March","April","May","June","July","August","September","October","November","December"],Eo=ko(Oo,3),So=wo({},{dayNamesShort:ko(Mo,3),dayNames:Mo,monthNamesShort:Eo,monthNames:Oo,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),Ao=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},_o={D:function(t){return String(t.getDate())},DD:function(t){return Ao(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Ao(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return Ao(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Ao(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Ao(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Ao(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Ao(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Ao(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Ao(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Ao(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Ao(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Ao(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Ao(Math.floor(Math.abs(e)/60),2)+":"+Ao(Math.abs(e)%60,2)}},To={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const Po=(t,e,n,r,i)=>{const a=t>e,o=a?e:t,s=a?t:e,[c,l]=aa(o,s,n,r,i),u=c.range(o,new Date(+s+1),l,!0);return a?u.reverse():u};function Co(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Lo extends oo{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:Po,interpolate:Ta,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return oa}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?ia:Xi,r=e?Co:ot;return e=>function(t,e,n){if(void 0===e&&(e=To.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=To[e]||e).replace(xo,(function(t,e){return r.push(e),"@@@"}));var i=wo(wo({},So),n);return(e=e.replace(bo,(function(e){return _o[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:a,week:o,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":a.floor(t)<t?"hh A":s.floor(t)<t?o.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new Lo(this.options)}}var No,jo=window&&window.__decorate||function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o};let Ro=No=class extends so{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:ot,tickMethod:Ya,tickCount:5}}constructor(t){super(t)}clone(){return new No(this.options)}};function Io(t,e,n){if(null===t)return[-.5,.5];const r=Hr(t,e),i=new $a({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function Do(t,e,n){return e*(1-t)+n*t}Ro=No=jo([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:a}=this.getOptions(),o=e(r.map(t)),s=a?(t=>e=>{const n=t(e);return R(n)?Math.round(n):n})(i):i;this.output=Oi(s,o,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return Oi(Ta(0,1),Ei(e,n))}))],Ro);const Bo=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:a,scale:o}=e,{x:s,y:c}=o,[l]=_n(a,"x"),[u]=_n(a,"y"),f=Io(l,s,n),h=Io(u,c,r),d=t.map((()=>Do(i(),...h))),p=t.map((()=>Do(i(),...f)));return[t,K({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:Mn(d),dx:Mn(p)}})]}};Bo.props={};const Fo=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:a}=r,{x:o}=a,[s]=_n(i,"x"),c=Io(s,o,e),l=t.map((()=>Do(n(),...c)));return[t,K({scale:{x:{padding:.5}}},r,{encode:{dx:Mn(l)}})]}};Fo.props={};const zo=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:a}=r,{y:o}=a,[s]=_n(i,"y"),c=Io(s,o,e),l=t.map((()=>Do(n(),...c)));return[t,K({scale:{y:{padding:.5}}},r,{encode:{dy:Mn(l)}})]}};zo.props={};const Go=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=Ce(r,["x"]),a=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,_n(r,t)[0]])),o=a.map((([e])=>[e,new Array(t.length)])),s=Wr(e,t,n),c=new Array(s.length);for(let t=0;t<s.length;t++){const e=s[t].flatMap((t=>a.map((([,e])=>+e[t])))),[n,r]=Yn(e);c[t]=(n+r)/2}const l=Math.max(...c);for(let t=0;t<s.length;t++){const e=l-c[t],n=s[t];for(const t of n)for(let n=0;n<a.length;n++){const[,r]=a[n],[,i]=o[n];i[t]=+r[t]+e}}return[t,K({},n,{encode:Object.fromEntries(o.map((([t,e])=>[t,Mn(e,_n(r,t)[1])])))})]}};Go.props={};const Wo=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[a]=_n(i,"y"),[o,s]=_n(i,"y1");n?Tn(i,"series","color"):_n(i,"color");const c=Wr(e,t,r),l=new Array(t.length);for(const t of c){const e=t.map((t=>+a[t]));for(let n=0;n<t.length;n++){const r=t[n],i=Math.max(...e.filter(((t,e)=>e!==n)));l[r]=+a[r]>i?i:a[r]}}return[t,K({},r,{encode:{y1:Mn(l,s)}})]}};function $o(t,e){return[t[0]]}function Yo(t,e){return[t[t.length-1]]}function Ho(t,e){return[t[dr(t,(t=>e[t]))]]}function Vo(t,e){return[t[gr(t,(t=>e[t]))]]}Wo.props={};const qo=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:a}=i,o=Wr(e,t,i),[s]=_n(a,n),c=function(t){return"function"==typeof t?t:{first:$o,last:Yo,max:Ho,min:Vo}[t]||$o}(r);return[o.flatMap((t=>c(t,s))),i]}};qo.props={};const Uo=(t={})=>{const{selector:e}=t,n=Ce(t,["selector"]);return qo(Object.assign({channel:"x",selector:e},n))};Uo.props={};const Xo=(t={})=>{const{selector:e}=t,n=Ce(t,["selector"]);return qo(Object.assign({channel:"y",selector:e},n))};function Zo(t){return e=>null===e?t:`${t} of ${e}`}function Ko(){return[(t,e)=>br(t,(t=>+e[t])),Zo("mean")]}function Qo(){return[(t,e)=>xr(t,(t=>+e[t])),Zo("median")]}function Jo(){return[(t,e)=>hr(t,(t=>+e[t])),Zo("max")]}function ts(){return[(t,e)=>pr(t,(t=>+e[t])),Zo("min")]}function es(){return[(t,e)=>t.length,Zo("count")]}function ns(){return[(t,e)=>kr(t,(t=>+e[t])),Zo("sum")]}function rs(){return[(t,e)=>e[t[0]],Zo("first")]}function is(){return[(t,e)=>e[t[t.length-1]],Zo("last")]}Xo.props={};const as=(t={})=>{const{groupBy:e}=t,n=Ce(t,["groupBy"]);return(t,r)=>{const{data:i,encode:a}=r,o=e(t,r);if(!o)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:Ko,max:Jo,count:es,first:rs,last:is,sum:ns,min:ts,median:Qo}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=_n(a,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=_n(a,n);return r})(c,e),u=o.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},Sn(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(a).map((t=>{const[e,n]=_n(a,t),r=o.map((t=>e[t[0]]));return[t,Mn(r,n)]})),l=o.map((t=>i[t[0]]));return[Dr(o),K({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};as.props={};const os=(t={})=>{const{channels:e=["x","y"]}=t,n=Ce(t,["channels"]);return as(Object.assign(Object.assign({},n),{groupBy:(t,n)=>Wr(e,t,n)}))};os.props={};const ss=(t={})=>os(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));ss.props={};const cs=(t={})=>os(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));cs.props={};const ls=(t={})=>os(Object.assign(Object.assign({},t),{channels:["color"]}));function us(t,e,n){var r;const{reverse:i,slice:a,channel:o}=n,s=Ce(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[o])||void 0===r?void 0:r.domain,[f]=_n(c,o),h=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=_n(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>hr(t,(t=>+a[t]));if("min"===i)return t=>pr(t,(t=>+a[t]));if("sum"===i)return t=>kr(t,(t=>+a[t]));if("median"===i)return t=>xr(t,(t=>+a[t]));if("mean"===i)return t=>br(t,(t=>+a[t]));if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(o,s,c),d=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,f,u),p=function(t,e,n){return(2!==e.length?tr(Kn(t,e,n),(([t,e],[n,r])=>Ln(e,r)||Ln(t,n))):tr(Xn(t,n),(([t,n],[r,i])=>e(n,i)||Ln(t,r)))).map((([t])=>t))}(d,h,(t=>f[t]));i&&p.reverse();const g="number"==typeof a?[0,a]:a,v=a?p.slice(...g):p;return[t,K(e,{scale:{[o]:{domain:v}}})]}ls.props={};const fs=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,a=Ce(t,["reverse","slice","channel","ordinal"]);return(t,o)=>i?us(t,o,Object.assign({reverse:e,slice:n,channel:r},a)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:a}=e,[o]=_n(a,i),s=tr(t,(t=>o[t]));return r&&s.reverse(),[s,e]}(t,o,Object.assign({reverse:e,slice:n,channel:r},a))};fs.props={};const hs=(t={})=>fs(Object.assign(Object.assign({},t),{channel:"x"}));hs.props={};const ds=(t={})=>fs(Object.assign(Object.assign({},t),{channel:"color"}));ds.props={};const ps=(t={})=>fs(Object.assign(Object.assign({},t),{channel:"y"}));ps.props={};const gs=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:a,encode:o}=i,[s]=_n(o,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(a,e):_n(o,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>kr(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=Qn(t,l,(t=>s[t])).map((t=>t[1]));return[t,K({},i,{scale:{x:{flex:u}}})]}};function vs([t,e],[n,r]){return[t-n,e-r]}function ms([t,e],[n,r]){return[t+n,e+r]}function ys([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function bs([t,e]){return Math.atan2(e,t)}function xs([t,e]){return bs([t,e])+Math.PI/2}function ks(t,e){const n=bs(t),r=bs(e);return n<r?r-n:2*Math.PI-(n-r)}function ws(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[a,o]of t)e=Math.min(a,e),n=Math.max(a,n),r=Math.min(o,r),i=Math.max(o,i);return[e,r,n-e,i-r]}function Ms([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function Os(t){const{padding:e=0,direction:n="col"}=t;return(t,r,i)=>{const a=t.length;if(0===a)return[];const{innerWidth:o,innerHeight:s}=i,c=s/o;let l=Math.ceil(Math.sqrt(r/c)),u=o/l,f=Math.ceil(r/l),h=f*u;for(;h>s;)l+=1,u=o/l,f=Math.ceil(r/l),h=f*u;const d=s-f*u,p=f<=1?0:d/(f-1),[g,v]=f<=1?[(o-a*u)/(a-1),(s-u)/2]:[0,0];return t.map(((t,r)=>{const[i,a,o,s]=ws(t),c="col"===n?r%l:Math.floor(r/f),h="col"===n?Math.floor(r/l):r%f;return`translate(${c*u-i+g*c+.5*e}, ${(f-h-1)*u+d-a-p*h-v+.5*e}) scale(${(u-e)/o}, ${(u-e)/s})`}))}}gs.props={};const Es=t=>(e,n)=>[e,K({},n,{modifier:Os(t),axis:!1})];Es.props={};const Ss="thresholds";function As(t){const[e,n]=Yn(t);return Math.min(200,function(t,e,n){const r=Wn(t),i=$n(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const _s=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=Ce(t,["groupChannels","binChannels"]),i={};return as(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(Ss))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,a)=>{const{encode:o}=a,s=n.map((t=>{const[e]=_n(o,t);return e})),c=Tr(r,Ss),l=t.filter((t=>s.every((e=>Ar(e[t]))))),u=[...e.map((t=>{const[e]=_n(o,t);return e})).filter(Ar).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||As(n),a=fr().thresholds(r).value((t=>+n[t]))(l),o=new Map(a.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=o,t=>o.get(t)}))];return Array.from(Xn(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};_s.props={};const Ts=(t={})=>{const{thresholds:e}=t;return _s(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function Ps(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const a=n=>1*e[t[n]],o=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,h=0;s.push(h);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,d=Math.floor((t+2)*c)+1;d=Math.min(d,i);const p=d-r;for(;r<d;r++)e+=a(r),n+=o(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const v=Math.floor((t+1)*c)+1,m=[a(h),o(h)];for(l=u=-1;g<v;g++)u=.5*Math.abs((m[0]-e)*(a(g)-m[1])-(m[0]-o(g))*(n-m[0])),u>l&&(l=u,f=g);s.push(f),h=f}return s.push(i-1),s.map((e=>t[e]))}Ts.props={};const Cs=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return Ps;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[gr(t,(t=>n[t]))]],max:(t,e,n)=>[t[dr(t,(t=>n[t]))]],median:(t,e,n)=>{return[t[(r=t,i=t=>n[t],yr(r,.5,i))]];var r,i}},n=e[t]||e.median;return(t,e,r,i)=>{const a=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return a.flatMap((t=>n(t,e,r)))}}(e);return(t,e)=>{const{encode:a}=e,o=Wr(r,t,e),[s]=_n(a,"x"),[c]=_n(a,"y");return[o.flatMap((t=>i(t,s,c,n))),e]}};Cs.props={};const Ls=(t={})=>(e,n)=>{const{encode:r,data:i}=n,a=Object.entries(t).map((([t,e])=>{const[n]=_n(r,t);if(!n)return null;const[i,a=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(a){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}})).filter(Ar),o=e.filter((t=>a.every((e=>e(t))))),s=o.map(((t,e)=>e));if(0===a.length){const t=function(t){var e;const{encode:n}=t,r=Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),{y:Object.assign(Object.assign({},t.encode.y),{value:[]})})}),i=null===(e=null==n?void 0:n.color)||void 0===e?void 0:e.field;if(!n||!i)return r;let a;for(const[t,e]of Object.entries(n))"x"!==t&&"y"!==t||e.field!==i||(a=Object.assign(Object.assign({},a),{[t]:Object.assign(Object.assign({},e),{value:[]})}));return a?Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),a)}):r}(n);return[e,t]}const c=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[o[t]])).filter((t=>void 0!==t))})]));return[s,K({},n,{encode:Object.fromEntries(c),data:o.map((t=>i[t]))})]};function Ns(t){return function(){return t}}Ls.props={};const js=Math.abs,Rs=Math.atan2,Is=Math.cos,Ds=Math.max,Bs=Math.min,Fs=Math.sin,zs=Math.sqrt,Gs=1e-12,Ws=Math.PI,$s=Ws/2,Ys=2*Ws;function Hs(t){return t>=1?$s:t<=-1?-$s:Math.asin(t)}const Vs=Math.PI,qs=2*Vs,Us=1e-6,Xs=qs-Us;function Zs(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class Ks{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Zs:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Zs;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-t,c=r-e,l=a-t,u=o-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>Us)if(Math.abs(u*s-c*l)>Us&&i){let h=n-a,d=r-o,p=s*s+c*c,g=h*h+d*d,v=Math.sqrt(p),m=Math.sqrt(f),y=i*Math.tan((Vs-Math.acos((p+f-g)/(2*v*m)))/2),b=y/m,x=y/v;Math.abs(b-1)>Us&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=t+o,l=e+s,u=1^a,f=a?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Us||Math.abs(this._y1-l)>Us)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%qs+qs),f>Xs?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>Us&&this._append`A${n},${n},0,${+(f>=Vs)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Qs(){return new Ks}function Js(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Ks(e)}function tc(t){return t.innerRadius}function ec(t){return t.outerRadius}function nc(t){return t.startAngle}function rc(t){return t.endAngle}function ic(t){return t&&t.padAngle}function ac(t,e,n,r,i,a,o){var s=t-n,c=e-r,l=(o?a:-a)/zs(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,p=n+u,g=r+f,v=(h+p)/2,m=(d+g)/2,y=p-h,b=g-d,x=y*y+b*b,k=i-a,w=h*g-p*d,M=(b<0?-1:1)*zs(Ds(0,k*k*x-w*w)),O=(w*b-y*M)/x,E=(-w*y-b*M)/x,S=(w*b+y*M)/x,A=(-w*y+b*M)/x,_=O-v,T=E-m,P=S-v,C=A-m;return _*_+T*T>P*P+C*C&&(O=S,E=A),{cx:O,cy:E,x01:-u,y01:-f,x11:O*(i/k-1),y11:E*(i/k-1)}}function oc(){var t=tc,e=ec,n=Ns(0),r=null,i=nc,a=rc,o=ic,s=null,c=Js(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-$s,p=a.apply(this,arguments)-$s,g=js(p-d),v=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>Gs)if(g>Ys-Gs)s.moveTo(h*Is(d),h*Fs(d)),s.arc(0,0,h,d,p,!v),f>Gs&&(s.moveTo(f*Is(p),f*Fs(p)),s.arc(0,0,f,p,d,v));else{var m,y,b=d,x=p,k=d,w=p,M=g,O=g,E=o.apply(this,arguments)/2,S=E>Gs&&(r?+r.apply(this,arguments):zs(f*f+h*h)),A=Bs(js(h-f)/2,+n.apply(this,arguments)),_=A,T=A;if(S>Gs){var P=Hs(S/f*Fs(E)),C=Hs(S/h*Fs(E));(M-=2*P)>Gs?(k+=P*=v?1:-1,w-=P):(M=0,k=w=(d+p)/2),(O-=2*C)>Gs?(b+=C*=v?1:-1,x-=C):(O=0,b=x=(d+p)/2)}var L=h*Is(b),N=h*Fs(b),j=f*Is(w),R=f*Fs(w);if(A>Gs){var I,D=h*Is(x),B=h*Fs(x),F=f*Is(k),z=f*Fs(k);if(g<Ws)if(I=function(t,e,n,r,i,a,o,s){var c=n-t,l=r-e,u=o-i,f=s-a,h=f*c-u*l;if(!(h*h<Gs))return[t+(h=(u*(e-a)-f*(t-i))/h)*c,e+h*l]}(L,N,F,z,D,B,j,R)){var G=L-I[0],W=N-I[1],$=D-I[0],Y=B-I[1],H=1/Fs(function(t){return t>1?0:t<-1?Ws:Math.acos(t)}((G*$+W*Y)/(zs(G*G+W*W)*zs($*$+Y*Y)))/2),V=zs(I[0]*I[0]+I[1]*I[1]);_=Bs(A,(f-V)/(H-1)),T=Bs(A,(h-V)/(H+1))}else _=T=0}O>Gs?T>Gs?(m=ac(F,z,L,N,h,T,v),y=ac(D,B,j,R,h,T,v),s.moveTo(m.cx+m.x01,m.cy+m.y01),T<A?s.arc(m.cx,m.cy,T,Rs(m.y01,m.x01),Rs(y.y01,y.x01),!v):(s.arc(m.cx,m.cy,T,Rs(m.y01,m.x01),Rs(m.y11,m.x11),!v),s.arc(0,0,h,Rs(m.cy+m.y11,m.cx+m.x11),Rs(y.cy+y.y11,y.cx+y.x11),!v),s.arc(y.cx,y.cy,T,Rs(y.y11,y.x11),Rs(y.y01,y.x01),!v))):(s.moveTo(L,N),s.arc(0,0,h,b,x,!v)):s.moveTo(L,N),f>Gs&&M>Gs?_>Gs?(m=ac(j,R,D,B,f,-_,v),y=ac(L,N,F,z,f,-_,v),s.lineTo(m.cx+m.x01,m.cy+m.y01),_<A?s.arc(m.cx,m.cy,_,Rs(m.y01,m.x01),Rs(y.y01,y.x01),!v):(s.arc(m.cx,m.cy,_,Rs(m.y01,m.x01),Rs(m.y11,m.x11),!v),s.arc(0,0,f,Rs(m.cy+m.y11,m.cx+m.x11),Rs(y.cy+y.y11,y.cx+y.x11),v),s.arc(y.cx,y.cy,_,Rs(y.y11,y.x11),Rs(y.y01,y.x01),!v))):s.arc(0,0,f,w,k,v):s.lineTo(j,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Ws/2;return[Is(r)*n,Fs(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ns(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ns(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ns(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ns(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ns(+t),l):i},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ns(+t),l):a},l.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ns(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function sc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function cc(t){this._context=t}function lc(t){return new cc(t)}function uc(t){return t[0]}function fc(t){return t[1]}function hc(t,e){var n=Ns(!0),r=null,i=lc,a=null,o=Js(s);function s(s){var c,l,u,f=(s=sc(s)).length,h=!1;for(null==r&&(a=i(u=o())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+t(l,c,s),+e(l,c,s));if(u)return a=null,u+""||null}return t="function"==typeof t?t:void 0===t?uc:Ns(t),e="function"==typeof e?e:void 0===e?fc:Ns(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Ns(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Ns(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ns(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(a=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=a=null:a=i(r=t),s):r},s}function dc(t,e,n){var r=null,i=Ns(!0),a=null,o=lc,s=null,c=Js(l);function l(l){var u,f,h,d,p,g=(l=sc(l)).length,v=!1,m=new Array(g),y=new Array(g);for(null==a&&(s=o(p=c())),u=0;u<=g;++u){if(!(u<g&&i(d=l[u],u,l))===v)if(v=!v)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=f;--h)s.point(m[h],y[h]);s.lineEnd(),s.areaEnd()}v&&(m[u]=+t(d,u,l),y[u]=+e(d,u,l),s.point(r?+r(d,u,l):m[u],n?+n(d,u,l):y[u]))}if(p)return s=null,p+""||null}function u(){return hc().defined(i).curve(o).context(a)}return t="function"==typeof t?t:void 0===t?uc:Ns(+t),e="function"==typeof e?e:Ns(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?fc:Ns(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ns(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ns(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ns(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ns(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ns(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ns(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:Ns(!!t),l):i},l.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),l):o},l.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),l):a},l}Qs.prototype=Ks.prototype,cc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var pc=vc(lc);function gc(t){this._curve=t}function vc(t){function e(e){return new gc(t(e))}return e._curve=t,e}function mc(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(vc(t)):e()._curve},t}function yc(){}function bc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function xc(t,e){this._context=t,this._k=(1-e)/6}function kc(t,e){this._context=t,this._k=(1-e)/6}function wc(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>Gs){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Gs){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*l+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function Mc(t,e){this._context=t,this._alpha=e}function Oc(t,e){this._context=t,this._alpha=e}gc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},xc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:bc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:bc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new xc(t,e)}return n.tension=function(e){return t(+e)},n}(0),kc.prototype={areaStart:yc,areaEnd:yc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:bc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new kc(t,e)}return n.tension=function(e){return t(+e)},n}(0),Mc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return e?new Mc(t,e):new xc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),Oc.prototype={areaStart:yc,areaEnd:yc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ec=function t(e){function n(t){return e?new Oc(t,e):new kc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Sc(t){this._context=t}function Ac(t){return new Sc(t)}function _c(t){return t<0?-1:1}function Tc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(_c(a)+_c(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Pc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Cc(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function Lc(t){this._context=t}function Nc(t){this._context=new jc(t)}function jc(t){this._context=t}function Rc(t){return new Lc(t)}function Ic(t){return new Nc(t)}function Dc(t,e){this._context=t,this._t=e}function Bc(t){return new Dc(t,.5)}function Fc(t){return new Dc(t,0)}function zc(t){return new Dc(t,1)}function Gc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Wc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function $c(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function Yc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function Hc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function Vc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function qc(t){return Yc(t)||Wc(t)}function Uc(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function Xc(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}Sc.prototype={areaStart:yc,areaEnd:yc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Lc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Cc(this,this._t0,Pc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Cc(this,Pc(this,n=Tc(this,t,e)),n);break;default:Cc(this,this._t0,n=Tc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Nc.prototype=Object.create(Lc.prototype)).point=function(t,e){Lc.prototype.point.call(this,e,t)},jc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}},Dc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Zc="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Kc(t){return Kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kc(t)}function Qc(t){var e=function(t,e){if("object"!=Kc(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Kc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Kc(e)?e:e+""}function Jc(t,e,n){return(e=Qc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function el(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tl(Object(n),!0).forEach((function(e){Jc(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function nl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Qc(r.key),r)}}function il(t,e,n){return e&&rl(t.prototype,e),n&&rl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function al(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ol(t,e){if(t){if("string"==typeof t)return al(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?al(t,e):void 0}}function sl(t){return function(t){if(Array.isArray(t))return al(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ol(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cl(t){return cl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cl(t)}function ll(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ll=function(){return!!t})()}function ul(t,e){if(e&&("object"==Kc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function fl(t,e,n){return e=cl(e),ul(t,ll()?Reflect.construct(e,n||[],cl(t).constructor):e.apply(t,n))}function hl(t,e){return hl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hl(t,e)}function dl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hl(t,e)}function pl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||ol(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var gl={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||t,o),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i<a;i++)o[i]=r[i].fn;return o},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,a),!0;case 6:return u.fn.call(u.context,e,r,i,a,o),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(gl);var vl=gl.exports;function ml(){return ml="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=cl(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ml.apply(null,arguments)}function yl(t,e,n,r){var i=ml(cl(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function bl(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function xl(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function kl(){}var wl=.7,Ml=1/wl,Ol="\\s*([+-]?\\d+)\\s*",El="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Al=/^#([0-9a-f]{3,8})$/,_l=new RegExp(`^rgb\\(${Ol},${Ol},${Ol}\\)$`),Tl=new RegExp(`^rgb\\(${Sl},${Sl},${Sl}\\)$`),Pl=new RegExp(`^rgba\\(${Ol},${Ol},${Ol},${El}\\)$`),Cl=new RegExp(`^rgba\\(${Sl},${Sl},${Sl},${El}\\)$`),Ll=new RegExp(`^hsl\\(${El},${Sl},${Sl}\\)$`),Nl=new RegExp(`^hsla\\(${El},${Sl},${Sl},${El}\\)$`),jl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Rl(){return this.rgb().formatHex()}function Il(){return this.rgb().formatRgb()}function Dl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Al.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Bl(e):3===n?new Wl(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Fl(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Fl(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=_l.exec(t))?new Wl(e[1],e[2],e[3],1):(e=Tl.exec(t))?new Wl(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Pl.exec(t))?Fl(e[1],e[2],e[3],e[4]):(e=Cl.exec(t))?Fl(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ll.exec(t))?Ul(e[1],e[2]/100,e[3]/100,1):(e=Nl.exec(t))?Ul(e[1],e[2]/100,e[3]/100,e[4]):jl.hasOwnProperty(t)?Bl(jl[t]):"transparent"===t?new Wl(NaN,NaN,NaN,0):null}function Bl(t){return new Wl(t>>16&255,t>>8&255,255&t,1)}function Fl(t,e,n,r){return r<=0&&(t=e=n=NaN),new Wl(t,e,n,r)}function zl(t){return t instanceof kl||(t=Dl(t)),t?new Wl((t=t.rgb()).r,t.g,t.b,t.opacity):new Wl}function Gl(t,e,n,r){return 1===arguments.length?zl(t):new Wl(t,e,n,null==r?1:r)}function Wl(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function $l(){return`#${ql(this.r)}${ql(this.g)}${ql(this.b)}`}function Yl(){const t=Hl(this.opacity);return`${1===t?"rgb(":"rgba("}${Vl(this.r)}, ${Vl(this.g)}, ${Vl(this.b)}${1===t?")":`, ${t})`}`}function Hl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Vl(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ql(t){return((t=Vl(t))<16?"0":"")+t.toString(16)}function Ul(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Zl(t,e,n,r)}function Xl(t){if(t instanceof Zl)return new Zl(t.h,t.s,t.l,t.opacity);if(t instanceof kl||(t=Dl(t)),!t)return new Zl;if(t instanceof Zl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Zl(o,s,c,t.opacity)}function Zl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Kl(t){return(t=(t||0)%360)<0?t+360:t}function Ql(t){return Math.max(0,Math.min(1,t||0))}function Jl(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}bl(kl,Dl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Rl,formatHex:Rl,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xl(this).formatHsl()},formatRgb:Il,toString:Il}),bl(Wl,Gl,xl(kl,{brighter(t){return t=null==t?Ml:Math.pow(Ml,t),new Wl(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?wl:Math.pow(wl,t),new Wl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Wl(Vl(this.r),Vl(this.g),Vl(this.b),Hl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$l,formatHex:$l,formatHex8:function(){return`#${ql(this.r)}${ql(this.g)}${ql(this.b)}${ql(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Yl,toString:Yl})),bl(Zl,(function(t,e,n,r){return 1===arguments.length?Xl(t):new Zl(t,e,n,null==r?1:r)}),xl(kl,{brighter(t){return t=null==t?Ml:Math.pow(Ml,t),new Zl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?wl:Math.pow(wl,t),new Zl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Wl(Jl(t>=240?t-240:t+120,i,r),Jl(t,i,r),Jl(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Zl(Kl(this.h),Ql(this.s),Ql(this.l),Hl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Hl(this.opacity);return`${1===t?"hsl(":"hsla("}${Kl(this.h)}, ${100*Ql(this.s)}%, ${100*Ql(this.l)}%${1===t?")":`, ${t})`}`}}));const tu=Math.PI/180,eu=180/Math.PI;var nu=-.14861,ru=1.78277,iu=-.29227,au=-.90649,ou=1.97294,su=ou*au,cu=ou*ru,lu=ru*iu-au*nu;function uu(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof fu)return new fu(t.h,t.s,t.l,t.opacity);t instanceof Wl||(t=zl(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(lu*r+su*e-cu*n)/(lu+su-cu),a=r-i,o=(ou*(n-i)-iu*a)/au,s=Math.sqrt(o*o+a*a)/(ou*i*(1-i)),c=s?Math.atan2(o,a)*eu-120:NaN;return new fu(c<0?c+360:c,s,i,t.opacity)}(t):new fu(t,e,n,null==r?1:r)}function fu(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function hu(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function du(t,e){var n=Math.min.apply(Math,Ie([],Re(t),!1)),r=Math.min.apply(Math,Ie([],Re(e),!1));return{x:n,y:r,width:Math.max.apply(Math,Ie([],Re(t),!1))-n,height:Math.max.apply(Math,Ie([],Re(e),!1))-r}}function pu(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function gu(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function vu(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),c=1/0,l=-1/0,u=[a,o],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;a<o?a<h&&h<o&&u.push(h):o<h&&h<a&&u.push(h)}for(f=0;f<u.length;f++){var d=pu(t,0,n,r,i,u[f]);d<c&&(c=d),d>l&&(l=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,v=-1/0,m=[a,o];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var y=p+f;a<o?a<y&&y<o&&m.push(y):o<y&&y<a&&m.push(y)}for(f=0;f<m.length;f++){var b=gu(0,e,n,r,i,m[f]);b<g&&(g=b),b>v&&(v=b)}return{x:c,y:g,width:l-c,height:v-g}}bl(fu,uu,xl(kl,{brighter(t){return t=null==t?Ml:Math.pow(Ml,t),new fu(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?wl:Math.pow(wl,t),new fu(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*tu,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Wl(255*(e+n*(nu*r+ru*i)),255*(e+n*(iu*r+au*i)),255*(e+n*(ou*r)),this.opacity)}}));function mu(t,e,n,r,i,a){var o=-1,s=1/0,c=[n,r],l=20;a&&a>200&&(l=a/10);for(var u=1/l,f=u/10,h=0;h<=l;h++){var d=h*u,p=[i.apply(void 0,Ie([],Re(t.concat([d])),!1)),i.apply(void 0,Ie([],Re(e.concat([d])),!1))];(y=hu(c[0],c[1],p[0],p[1]))<s&&(o=d,s=y)}if(0===o)return{x:t[0],y:e[0]};if(1===o){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(h=0;h<32&&!(f<1e-4);h++){var v=o-f,m=o+f,y=(p=[i.apply(void 0,Ie([],Re(t.concat([v])),!1)),i.apply(void 0,Ie([],Re(e.concat([v])),!1))],hu(c[0],c[1],p[0],p[1]));if(v>=0&&y<s)o=v,s=y;else{var b=[i.apply(void 0,Ie([],Re(t.concat([m])),!1)),i.apply(void 0,Ie([],Re(e.concat([m])),!1))],x=hu(c[0],c[1],b[0],b[1]);m<=1&&x<s?(o=m,s=x):f*=.5}}return{x:i.apply(void 0,Ie([],Re(t.concat([o])),!1)),y:i.apply(void 0,Ie([],Re(e.concat([o])),!1))}}function yu(t,e,n,r){return hu(t,e,n,r)}function bu(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function xu(t,e,n,r,i,a){var o=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var c=[i-t,a-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(c,s))}function ku(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function wu(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,c=6*t-12*e+6*n,l=3*e-3*t,u=[];if(I(s,0))I(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;I(f,0)?u.push(-c/(2*s)):f>0&&(a=(-c-(o=Math.sqrt(f)))/(2*s),(i=(-c+o)/(2*s))>=0&&i<=1&&u.push(i),a>=0&&a<=1&&u.push(a))}return u}function Mu(t,e,n,r,i,a,o,s){for(var c=[t,o],l=[e,s],u=wu(t,n,i,o),f=wu(e,r,a,s),h=0;h<u.length;h++)c.push(ku(t,n,i,o,u[h]));for(h=0;h<f.length;h++)l.push(ku(e,r,a,s,f[h]));return du(c,l)}function Ou(t,e,n,r,i,a,o,s,c,l,u){var f=function(t,e,n,r,i,a,o,s,c,l,u){return mu([t,n,i,o],[e,r,a,s],c,l,ku,u)}(t,e,n,r,i,a,o,s,c,l,u);return hu(f.x,f.y,c,l)}function Eu(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=hu(r[0],r[1],i[0],i[1])}return e}(t)}function Su(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Au(t,e,n){var r=t+n-2*e;if(I(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function _u(t,e,n,r,i,a){var o=Au(t,n,i)[0],s=Au(e,r,a)[0],c=[t,i],l=[e,a];return void 0!==o&&c.push(Su(t,n,i,o)),void 0!==s&&l.push(Su(e,r,a,s)),du(c,l)}function Tu(t,e,n,r,i,a,o,s){var c=function(t,e,n,r,i,a,o,s){return mu([t,n,i],[e,r,a],o,s,Su)}(t,e,n,r,i,a,o,s);return hu(c.x,c.y,o,s)}function Pu(){Pu=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var a=e&&e.prototype instanceof m?e:m,o=Object.create(a.prototype),s=new P(r||[]);return i(o,"_invoke",{value:S(t,n,s)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",g="completed",v={};function m(){}function y(){}function b(){}var x={};l(x,o,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(C([])));w&&w!==n&&r.call(w,o)&&(x=w);var M=b.prototype=m.prototype=Object.create(x);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,a,o,s){var c=f(t[i],t,a);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==Kc(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(u).then((function(t){l.value=t,o(l)}),(function(t){return n("throw",t,o,s)}))}s(c.arg)}var a;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return a=a?a.then(i,i):i()}})}function S(e,n,r){var i=h;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===g){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var c=A(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?g:d,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=g,r.method="throw",r.arg=l.arg)}}}function A(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,A(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(Kc(e)+" is not iterable")}return y.prototype=b,i(M,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,c,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},O(E.prototype),l(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new E(u(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},O(M),l(M,c,"Generator"),l(M,o,(function(){return this})),l(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Cu(t,e,n,r,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Lu(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){Cu(a,r,i,o,s,"next",t)}function s(t){Cu(a,r,i,o,s,"throw",t)}o(void 0)}))}}function Nu(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ol(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ju(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Zc||"undefined"!=typeof self&&self;var Ru={exports:{}};!function(t){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(a,Math.floor(r+(s-c)*u/s+f)),o)}var h=t[r],d=i,p=a;for(n(t,i,r),o(t[a],h)>0&&n(t,i,a);d<p;){for(n(t,d,p),d++,p--;o(t[d],h)<0;)d++;for(;o(t[p],h)>0;)p--}0===o(t[i],h)?n(t,i,p):n(t,++p,a),p<=r&&(i=p+1),r<=p&&(a=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];c(i,t.leaf?r(o):o)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function v(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,a){for(var o=[n,r];o.length;)if(!((r=o.pop())-(n=o.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?r(o):o;v(t,s)&&(e.leaf?n.push(o):g(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(v(t,a)){if(e.leaf||g(t,a))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),c=[],l=[];o||c.length;){if(o||(o=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),o.leaf){var u=a(t,o.children,e);if(-1!==u)return o.children.splice(u,1),c.push(o),this._condense(c),this}i||o.leaf||!g(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(c.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(a<=s)return o(i=m(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,r-1))),(i=m([])).leaf=!1,i.height=r;var c=Math.ceil(a/s),l=c*Math.ceil(Math.sqrt(s));y(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);y(t,u,f,c,this.compareMinY);for(var h=u;h<=f;h+=c){var d=Math.min(h+c-1,f);i.children.push(this._build(t,h,d,r-1))}}return o(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var c=e.children[s],l=f(c),u=d(t,c)-l;u<a?(a=u,i=l<i?l:i,o=c):u===a&&l<i&&(i=l,o=c)}e=o||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],a=this._chooseSubtree(r,this.data,e,i);for(a.children.push(t),c(a,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,a=1/0,o=e;o<=n-e;o++){var c=s(t,0,o,this.toBBox),l=s(t,o,n,this.toBBox),u=p(c,l),h=f(c)+f(l);u<i?(i=u,r=o,a=h<a?h:a):u===i&&h<a&&(a=h,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=s(t,0,e,i),o=s(t,n-e,n,i),l=h(a)+h(o),u=e;u<n-e;u++){var f=t.children[u];c(a,t.leaf?i(f):f),l+=h(a)}for(var d=n-e-1;d>=e;d--){var p=t.children[d];c(o,t.leaf?i(p):p),l+=h(o)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)c(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()}(Ru);var Iu=Ru.exports,Du=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),Bu=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),Fu=function(){return il((function t(){nl(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))}}])}(),zu=function(){return il((function t(e){nl(this,t),this.clipSpaceNearZ=Bu.NEGATIVE_ONE,this.plugins=[],this.config=el({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),Gu=ee,Wu=Jt,$u=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},Yu=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Hu=re,Vu=fe,qu=function(){function t(){nl(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return il(t,[{key:"update",value:function(t,e){Wu(this.center,t),Wu(this.halfExtents,e),Vu(this.min,this.center,this.halfExtents),Gu(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){Gu(this.center,e,t),Hu(this.center,this.center,.5),Vu(this.halfExtents,e,t),Hu(this.halfExtents,this.halfExtents,.5),Wu(this.min,t),Wu(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],c=o[1],l=o[2],u=r-s,f=r+s,h=i-c,d=i+c,p=a-l,g=a+l,v=e.center,m=v[0],y=v[1],b=v[2],x=e.halfExtents,k=x[0],w=x[1],M=x[2],O=m-k,E=m+k,S=y-w,A=y+w,_=b-M,T=b+M;O<u&&(u=O),E>f&&(f=E),S<h&&(h=S),A>d&&(d=A),_<p&&(p=_),T>g&&(g=T),n[0]=.5*(u+f),n[1]=.5*(h+d),n[2]=.5*(p+g),o[0]=.5*(f-u),o[1]=.5*(d-h),o[2]=.5*(g-p),this.min[0]=u,this.min[1]=h,this.min[2]=p,this.max[0]=f,this.max[1]=d,this.max[2]=g}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],c=e[8],l=e[1],u=e[5],f=e[9],h=e[2],d=e[6],p=e[10],g=Math.abs(o),v=Math.abs(s),m=Math.abs(c),y=Math.abs(l),b=Math.abs(u),x=Math.abs(f),k=Math.abs(h),w=Math.abs(d),M=Math.abs(p);n[0]=e[12]+o*i[0]+s*i[1]+c*i[2],n[1]=e[13]+l*i[0]+u*i[1]+f*i[2],n[2]=e[14]+h*i[0]+d*i[1]+p*i[2],r[0]=g*a[0]+v*a[1]+m*a[2],r[1]=y*a[0]+b*a[1]+x*a[2],r[2]=k*a[0]+w*a[1]+M*a[2],Vu(this.min,n,r),Gu(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=$u([0,0,0],this.getMin(),e.getMin()),i=Yu([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?Wu([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?Wu([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),Uu=function(){return il((function t(e,n){nl(this,t),this.distance=e||0,this.normal=n||Qt(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return ae(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/de(this.normal);re(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&i<=1;return a&&n&&se(n,t,e,i),a}}])}(),Xu=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),Zu=function(){return il((function t(e){if(nl(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new Uu)}),[{key:"extractFromVPMatrix",value:function(t){var e=pl(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15];te(this.planes[0].normal,a-n,l-o,d-u),this.planes[0].distance=m-p,te(this.planes[1].normal,a+n,l+o,d+u),this.planes[1].distance=m+p,te(this.planes[2].normal,a+r,l+s,d+f),this.planes[2].distance=m+g,te(this.planes[3].normal,a-r,l-s,d-f),this.planes[3].distance=m-g,te(this.planes[4].normal,a-i,l-c,d-h),this.planes[4].distance=m-v,te(this.planes[5].normal,a+i,l+c,d+h),this.planes[5].distance=m+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),Ku=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;nl(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return il(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Qu=function(){function t(e,n,r,i){nl(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return il(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=ge(e.x,e.y,0,1),i=ge(e.x+e.width,e.y,0,1),a=ge(e.x,e.y+e.height,0,1),o=ge(e.x+e.width,e.y+e.height,0,1),s=pe(),c=pe(),l=pe(),u=pe();ve(s,r,n),ve(c,i,n),ve(l,a,n),ve(u,o,n);var f=Math.min(s[0],c[0],l[0],u[0]),h=Math.min(s[1],c[1],l[1],u[1]),d=Math.max(s[0],c[0],l[0],u[0]),p=Math.max(s[1],c[1],l[1],u[1]);return t.fromRect({x:f,y:h,width:d-f,height:p-h})}}])}(),Ju="Method not implemented.",tf="Use document.documentElement instead.";function ef(t){return void 0===t?0:t>360||t<-360?t%360:t}var nf=Xt();function rf(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?r?Zt(t):Jt(nf,t):R(t)?r?Qt(t,e,n):te(nf,t,e,n):r?Qt(t[0],t[1]||e,t[2]||n):te(nf,t[0],t[1]||e,t[2]||n)}var af=Math.PI/180;function of(t){return t*af}var sf=180/Math.PI;function cf(t){return t*sf}var lf=Math.PI/2;function uf(t,e){return 16===e.length?function(t,e){var n,r,i=pl(jt(Xt(),e),3),a=i[0],o=i[1],s=i[2],c=Math.asin(-e[2]/a);return c<lf?c>-lf?(n=Math.atan2(e[6]/o,e[10]/s),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/o,e[5]/o)):(r=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,c=a*a,l=n*n+o+s+c,u=n*a-r*i;return u>.499995*l?(t[0]=lf,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*l?(t[0]=-lf,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+c)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function ff(t,e,n,r,i){var a,o,s,c,l,u,f,h,d,p,g=Math.cos(t),v=Math.sin(t);return a=r*g,o=i*v,s=0,c=-r*v,l=i*g,u=0,f=e,h=n,d=1,(p=new lt(9))[0]=a,p[1]=o,p[2]=s,p[3]=c,p[4]=l,p[5]=u,p[6]=f,p[7]=h,p[8]=d,p}function hf(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);if(e*i-n*r<0&&(e<i?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var c=1/o;r*=c,i*=c}var l=cf(Math.atan2(n,e));return[t[6],t[7],a,o,l]}var df=ht(),pf=ht(),gf=pe(),vf=[Xt(),Xt(),Xt()],mf=Xt();function yf(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var bf=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),xf=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),kf=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),wf="updated",Mf=2e-4,Of=function(){return il((function t(){nl(this,t),this.clipSpaceNearZ=Bu.NEGATIVE_ONE,this.eventEmitter=new vl,this.matrix=ht(),this.right=Qt(1,0,0),this.up=Qt(0,1,0),this.forward=Qt(0,0,1),this.position=Qt(0,0,1),this.focalPoint=Qt(0,0,0),this.distanceVector=Qt(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=ht(),this.projectionMatrixInverse=ht(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=bf.EXPLORING,this.trackingMode=xf.DEFAULT,this.projectionMode=kf.PERSPECTIVE,this.frustum=new Zu,this.orthoMatrix=ht()}),[{key:"isOrtho",value:function(){return this.projectionMode===kf.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.type===bf.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===bf.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==bf.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return bt(ht(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=St(ht(),[t,e,0]);this.jitteredProjectionMatrix=kt(ht(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===kf.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===kf.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===kf.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===kf.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===kf.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===kf.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=Qt(o.x-r,o.y-i,0),c=ae(s,this.right)/Kt(this.right),l=ae(s,this.up)/Kt(this.up),u=pl(this.getPosition(),2),f=u[0],h=u[1],d=pl(this.getFocalPoint(),2),p=d[0],g=d[1];return this.setPosition(f-c,h-l),this.setFocalPoint(p-c,g-l),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=kf.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var a=this.near*Math.tan(of(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,c=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var l=this.view.fullWidth,u=this.view.fullHeight;c+=this.view.offsetX*s/l,a-=this.view.offsetY*o/u,s*=this.view.width/l,o*=this.view.height/u}return function(t,e,n,r,i,a,o){var s,c,l=2*a,u=n-e,f=r-i,h=l/u,d=l/f,p=(n+e)/u,g=(r+i)/f,v=o-a,m=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/v,c=-m/v):(s=-(o+a)/v,c=-2*m/v),t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=d,t[6]=0,t[7]=0,t[8]=p,t[9]=g,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,c,c+s,a-o,a,t,this.far,this.clipSpaceNearZ===Bu.ZERO),bt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,a){var o;this.projectionMode=kf.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=l-s,h=l+s,d=u+c,p=u-c;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=g*this.view.offsetX)+g*this.view.width,p=(d-=v*this.view.offsetY)-v*this.view.height}return this.clipSpaceNearZ===Bu.NEGATIVE_ONE?Gt(this.projectionMatrix,f,h,d,p,i,a):Wt(this.projectionMatrix,f,h,d,p,i,a),bt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=rf(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=Qt(0,1,0);if(this.focalPoint=rf(t,e,n),this.trackingMode===xf.CINEMATIC){var i=ne(Xt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var a=Kt(i),o=cf(Math.asin(e/a)),s=90+cf(Math.atan2(n,t)),c=ht();Et(c,c,of(s)),Ot(c,c,of(o)),r=ce(Xt(),[0,1,0],c)}return bt(this.matrix,$t(ht(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Mf&&(this.distance=Mf),this.dollyingStep=this.distance/100;var e=Xt();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=ef(t),this.computeMatrix(),this._getAxes(),this.type===bf.ORBITING||this.type===bf.EXPLORING?this._getPosition():this.type===bf.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=ef(t),this.computeMatrix(),this._getAxes(),this.type===bf.ORBITING||this.type===bf.EXPLORING?this._getPosition():this.type===bf.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=ef(t),this.computeMatrix(),this._getAxes(),this.type===bf.ORBITING||this.type===bf.EXPLORING?this._getPosition():this.type===bf.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=ye(me(),[0,0,1],of(this.roll));mt(this.matrix);var e=ye(me(),[1,0,0],of((this.rotateWorld&&this.type!==bf.TRACKING||this.type===bf.TRACKING?1:-1)*this.elevation)),n=ye(me(),[0,1,0],of((this.rotateWorld&&this.type!==bf.TRACKING||this.type===bf.TRACKING?1:-1)*this.azimuth)),r=be(me(),n,e);r=be(me(),r,t);var i=Dt(ht(),r);this.type===bf.ORBITING||this.type===bf.EXPLORING?(wt(this.matrix,this.matrix,this.focalPoint),kt(this.matrix,this.matrix,i),wt(this.matrix,this.matrix,[0,0,this.distance])):this.type===bf.TRACKING&&(wt(this.matrix,this.matrix,this.position),kt(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=rf(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){Jt(this.right,rf(ve(pe(),[1,0,0,0],this.matrix))),Jt(this.up,rf(ve(pe(),[0,1,0,0],this.matrix))),Jt(this.forward,rf(ve(pe(),[0,0,1,0],this.matrix))),ie(this.right,this.right),ie(this.up,this.up),ie(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Kt(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===bf.TRACKING||this.rotateWorld?(this.elevation=cf(Math.asin(e/r)),this.azimuth=cf(Math.atan2(-t,-n))):(this.elevation=-cf(Math.asin(e/r)),this.azimuth=-cf(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){Jt(this.position,rf(ve(pe(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;le(this.distanceVector,[0,0,-this.distance],(t=ut(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),ee(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=ne(Xt(),this.focalPoint,this.position),this.distance=Kt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===kf.ORTHOGRAPHIC){var t=this.position,e=ye(me(),[0,0,1],-this.roll*Math.PI/180);It(this.orthoMatrix,e,Qt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Qt(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=kt(ht(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(wf)}}},{key:"rotate",value:function(t,e,n){throw new Error(Ju)}},{key:"pan",value:function(t,e){throw new Error(Ju)}},{key:"dolly",value:function(t){throw new Error(Ju)}},{key:"createLandmark",value:function(t,e){throw new Error(Ju)}},{key:"gotoLandmark",value:function(t,e){throw new Error(Ju)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(Ju)}}])}(),Ef=function(t){return t[t.Standard=0]="Standard",t}({}),Sf=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Af={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Qu(0,0,0,0)},_f=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function Tf(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var c=t.apply(this,i);return n.cache=s.set(o,c)||s,c};return n.cache=new(Tf.Cache||Map),Tf.cacheList.push(n.cache),n}Tf.Cache=Map,Tf.cacheList=[],Tf.clearCache=function(){Tf.cacheList.forEach((function(t){return t.clear()}))};var Pf=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),Cf=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),Lf=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Nf=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),jf=[{name:"em",unit_type:Pf.kEms},{name:"px",unit_type:Pf.kPixels},{name:"deg",unit_type:Pf.kDegrees},{name:"rad",unit_type:Pf.kRadians},{name:"grad",unit_type:Pf.kGradians},{name:"ms",unit_type:Pf.kMilliseconds},{name:"s",unit_type:Pf.kSeconds},{name:"rem",unit_type:Pf.kRems},{name:"turn",unit_type:Pf.kTurns}],Rf=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),If=function(t){return t?"number"===t?Pf.kNumber:"percent"===t||"%"===t?Pf.kPercentage:function(t){return jf.find((function(e){return e.name===t})).unit_type}(t):Pf.kUnknown},Df=function(t){var e=1;switch(t){case Pf.kPixels:case Pf.kDegrees:case Pf.kSeconds:break;case Pf.kMilliseconds:e=.001;break;case Pf.kRadians:e=180/Math.PI;break;case Pf.kGradians:e=.9;break;case Pf.kTurns:e=360}return e},Bf=function(t){switch(t){case Pf.kNumber:case Pf.kInteger:return"";case Pf.kPercentage:return"%";case Pf.kEms:return"em";case Pf.kRems:return"rem";case Pf.kPixels:return"px";case Pf.kDegrees:return"deg";case Pf.kRadians:return"rad";case Pf.kGradians:return"grad";case Pf.kMilliseconds:return"ms";case Pf.kSeconds:return"s";case Pf.kTurns:return"turn"}return""},Ff=function(){return il((function t(){nl(this,t)}),[{key:"toString",value:function(){return this.buildCSSText(Lf.kNo,Nf.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Rf.kUnitType&&this.getType()<=Rf.kClampType}}],[{key:"isAngle",value:function(t){return t===Pf.kDegrees||t===Pf.kRadians||t===Pf.kGradians||t===Pf.kTurns}},{key:"isLength",value:function(t){return t>=Pf.kEms&&t<Pf.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===Pf.kPercentage||t===Pf.kEms||t===Pf.kRems}},{key:"isTime",value:function(t){return t===Pf.kSeconds||t===Pf.kMilliseconds}}])}(),zf=function(t){function e(t){var n;return nl(this,e),(n=fl(this,e)).colorSpace=t,n}return dl(e,t),il(e,[{key:"getType",value:function(){return Rf.kColorType}},{key:"to",value:function(t){return this}}])}(Ff),Gf=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Wf=function(t){function e(t,n){var r;return nl(this,e),(r=fl(this,e)).type=t,r.value=n,r}return dl(e,t),il(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return Rf.kColorType}}])}(Ff),$f=function(t){function e(t){var n;return nl(this,e),(n=fl(this,e)).value=t,n}return dl(e,t),il(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return Rf.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Ff),Yf=function(t){return function(t){switch(t){case Cf.kUNumber:return Pf.kNumber;case Cf.kULength:return Pf.kPixels;case Cf.kUPercent:return Pf.kPercentage;case Cf.kUTime:return Pf.kSeconds;case Cf.kUAngle:return Pf.kDegrees;default:return Pf.kUnknown}}(function(t){switch(t){case Pf.kNumber:case Pf.kInteger:return Cf.kUNumber;case Pf.kPercentage:return Cf.kUPercent;case Pf.kPixels:return Cf.kULength;case Pf.kMilliseconds:case Pf.kSeconds:return Cf.kUTime;case Pf.kDegrees:case Pf.kRadians:case Pf.kGradians:case Pf.kTurns:return Cf.kUAngle;default:return Cf.kUOther}}(t))},Hf=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pf.kNumber;return nl(this,e),n=fl(this,e),r="string"==typeof i?If(i):i,n.unit=r,n.value=t,n}return dl(e,t),il(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return Rf.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=Yf(this.unit);if(n!==Yf(t)||n===Pf.kUnknown)return null;var r=Df(this.unit)/Df(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case Pf.kUnknown:break;case Pf.kInteger:r=Number(this.value).toFixed(0);break;case Pf.kNumber:case Pf.kPercentage:case Pf.kEms:case Pf.kRems:case Pf.kPixels:case Pf.kDegrees:case Pf.kRadians:case Pf.kGradians:case Pf.kMilliseconds:case Pf.kSeconds:case Pf.kTurns:var i=this.value,a=Bf(this.unit);if(i<-999999||i>999999){var o=Bf(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,o):i+(o||"")}else r="".concat(i).concat(a)}return n+=r}}])}(Ff),Vf=new Hf(0,"px");new Hf(1,"px");var qf=new Hf(0,"deg"),Uf=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return nl(this,e),(i=fl(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=a,i.isNone=o,i}return dl(e,t),il(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(zf),Xf=new $f("unset"),Zf={"":Xf,unset:Xf,initial:new $f("initial"),inherit:new $f("inherit")},Kf=new Uf(0,0,0,0,!0),Qf=new Uf(0,0,0,0),Jf=Tf((function(t,e,n,r){return new Uf(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),th=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pf.kNumber;return new Hf(t,e)};function eh(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new Hf(50,"%");var nh=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,f=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,h=/^\(/,d=/^\)/,p=/^,/,g=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,m=/^rgb/i,y=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function k(t){throw new Error("".concat(x,": ").concat(t))}function w(){var t=L(M);return x.length>0&&k("Invalid input not EOF"),t}function M(){return O("linear-gradient",t,S)||O("repeating-linear-gradient",e,S)||O("radial-gradient",n,A)||O("repeating-radial-gradient",r,A)||O("conic-gradient",i,A)}function O(t,e,n){return E(e,(function(e){var r=n();return r&&(B(p)||k("Missing comma before color stops")),{type:t,orientation:r,colorStops:L(N)}}))}function E(t,e){var n=B(t);if(n){B(h)||k("Missing (");var r=e(n);return B(d)||k("Missing )"),r}}function S(){return D("directional",a,1)||D("angular",f,1)}function A(){var t,e,n=_();return n&&((t=[]).push(n),e=x,B(p)&&((n=_())?t.push(n):x=e)),t}function _(){var t=function(){var t=D("shape",/^(circle)/i,0);t&&(t.style=I()||T());return t}()||function(){var t=D("shape",/^(ellipse)/i,0);t&&(t.style=R()||T());return t}();if(t)t.at=P();else{var e=T();if(e){t=e;var n=P();n&&(t.at=n)}else{var r=C();r&&(t={type:"default-radial",at:r})}}return t}function T(){return D("extent-keyword",o,1)}function P(){if(D("position",/^at/,0)){var t=C();return t||k("Missing positioning value"),t}}function C(){var t={x:R(),y:R()};if(t.x||t.y)return{type:"position",value:t}}function L(t){var e=t(),n=[];if(e)for(n.push(e);B(p);)(e=t())?n.push(e):k("One extra comma");return n}function N(){var t=D("hex",g,1)||E(y,(function(){return{type:"rgba",value:L(j)}}))||E(m,(function(){return{type:"rgb",value:L(j)}}))||D("literal",v,0);return t||k("Expected color definition"),t.length=R(),t}function j(){return B(b)[1]}function R(){return D("%",l,1)||D("position-keyword",s,1)||I()}function I(){return D("px",c,1)||D("em",u,1)}function D(t,e,n){var r=B(e);if(r)return{type:t,value:r[n]}}function B(t){var e=/^[\n\r\t\s]+/.exec(x);e&&F(e[0].length);var n=t.exec(x);return n&&F(n[0].length),n}function F(t){x=x.substring(t)}return function(t){return x=t,w()}}();var rh=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ih=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ah=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,oh=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var sh={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},ch=Tf((function(t){var e;return e="angular"===t.type?Number(t.value):sh[t.value]||0,th(e,"deg")})),lh=Tf((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:th(e,r),cy:th(n,i)}})),uh=Tf((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return nh(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),o=1;o<r;o++){var s,c=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!b(c)&&!b(a)){for(var l=1;l<o-i;l++)t[i+l].length={type:"%",value:"".concat(a+(Number(c)-a)*l/(o-i))};i=o,a=Number(c)}}}(r);var i=r.map((function(t){return{offset:th(Number(t.length.value),"%"),color:eh(t)}}));if("linear-gradient"===e)return new Wf(Gf.LinearGradient,{angle:n?ch(n):qf,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var a,o=lh(n[0].at),s=o.cx,c=o.cy;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;a="extent-keyword"===u?function(t){return Zf[t]||(Zf[t]=new $f(t)),Zf[t]}(f):th(f,u)}return new Wf(Gf.RadialGradient,{cx:s,cy:c,size:a,steps:i})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=rh.exec(t);if(n){var r,i=(null===(r=n[2].match(oh))||void 0===r?void 0:r.map((function(t){return t.split(":")})))||[];return[new Wf(Gf.LinearGradient,{angle:th(parseFloat(n[1]),"deg"),steps:i.map((function(t){var e=pl(t,2),n=e[0],r=e[1];return{offset:th(100*Number(n),"%"),color:r}}))})]}}else if("r"===e){var a=function(t){var e=ih.exec(t);if(e){var n,r=(null===(n=e[4].match(oh))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:th(50,"%"),cy:th(50,"%"),steps:r.map((function(t){var e=pl(t,2),n=e[0],r=e[1];return{offset:th(100*Number(n),"%"),color:r}}))}}return null}(t);if(a){if(!L(a))return[new Wf(Gf.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=ah.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function fh(t){return t&&!!t.image}function hh(t){return t&&!b(t.r)&&!b(t.g)&&!b(t.b)}var dh=Tf((function(t){if(fh(t))return el({repetition:"repeat"},t);if(b(t)&&(t=""),"transparent"===t)return Qf;if("currentColor"===t)t="black";else if("none"===t)return Kf;var e=uh(t);if(e)return e;var n=Dl(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Jf.apply(void 0,r)}));function ph(t,e){if(hh(t)&&hh(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(j(e[n],0,255));return e[3]=j(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function gh(t,e){if(b(e))return th(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return th(Number(e),"px");if("deg".search(t)>=0)return th(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var r="U(".concat(t.source,")");return n.map((function(t){return th(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var vh=function(t){return gh(new RegExp("px","g"),t)},mh=Tf(vh);Tf((function(t){return gh(new RegExp("%","g"),t)}));var yh=function(t){return R(t)||isFinite(Number(t))?th(Number(t)||0,"px"):gh(new RegExp("px|%|em|rem","g"),t)},bh=Tf(yh),xh=function(t){return gh(new RegExp("deg|rad|grad|turn","g"),t)},kh=Tf(xh);function wh(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,c=Yf(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(o=l.value,s=u.value,a=Bf(t.unit)):(Hf.isLength(t.unit)||Hf.isLength(e.unit))&&(o=Eh(t,i,n),s=Eh(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function Mh(t){var e=0;return t.unit===Pf.kDegrees?e=t.value:t.unit===Pf.kRadians?e=cf(Number(t.value)):t.unit===Pf.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function Oh(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):L(t)?n=t.split(" ").map((function(t){return Number(t)})):R(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]:"even"===e&&n.length%2==1?[].concat(sl(n),sl(n)):n}function Eh(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===Pf.kPixels)return Number(t.value);if(t.unit===Pf.kPercentage&&n){var i=n.nodeName===Du.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var Sh=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ah(t){return t.toString()}var _h=function(t){return"number"==typeof t?th(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?th(Number(t)):th(0)},Th=Tf(_h);function Ph(t,e){return[t,e,Ah]}function Ch(t,e){return function(n,r){return[n,r,function(n){return Ah(j(n,t,e))}]}}function Lh(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Nh(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=yn(t.parsedStyle.d.absolutePath,void 0,Pe(Pe({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function jh(t,e){return t[0]===e[0]&&t[1]===e[1]}function Rh(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),c=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!c||0===Math.sin(c)||I(c,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(c/2-l)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(u-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}function Ih(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Tf((function(t){return L(t)?t.split(" ").map(Th):t.map(Th)}));var Dh=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)},Bh=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var c=of(r=F(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,u=(t.y-o.y)/2,f={x:Math.cos(c)*l+Math.sin(c)*u,y:-Math.sin(c)*l+Math.cos(c)*u},h=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);h>1&&(e*=Math.sqrt(h),n*=Math.sqrt(h));var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));d=d<0?0:d;var p=(i!==a?1:-1)*Math.sqrt(d),g=p*(e*f.y/n),v=p*(-n*f.x/e),m={x:Math.cos(c)*g-Math.sin(c)*v+(t.x+o.x)/2,y:Math.sin(c)*g+Math.cos(c)*v+(t.y+o.y)/2},y={x:(f.x-g)/e,y:(f.y-v)/n},b=Dh({x:1,y:0},y),x=Dh(y,{x:(-f.x-g)/e,y:(-f.y-v)/n});!a&&x>0?x-=2*Math.PI:a&&x<0&&(x+=2*Math.PI);var k=b+(x%=2*Math.PI)*s,w=e*Math.cos(k),M=n*Math.sin(k);return{x:Math.cos(c)*w-Math.sin(c)*M+m.x,y:Math.sin(c)*w+Math.cos(c)*M+m.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:k,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function Fh(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,c=r.xRotation,l=r.arcFlag,u=r.sweepFlag,f=Bh({x:t.prePoint[0],y:t.prePoint[1]},a,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=Bh({x:t.prePoint[0],y:t.prePoint[1]},a,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=h.x-f.x,p=h.y-f.y,g=Math.sqrt(d*d+p*p);return{x:-d/g,y:-p/g}}function zh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Gh(t,e){return zh(t)*zh(e)?(t[0]*e[0]+t[1]*e[1])/(zh(t)*zh(e)):1}function Wh(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Gh(t,e))}function $h(t,e){var n=e[1],r=e[2],i=F(of(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],c=t[1],l=e[6],u=e[7],f=Math.cos(i)*(s-l)/2+Math.sin(i)*(c-u)/2,h=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(c-u)/2,d=f*f/(n*n)+h*h/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(h*h)+r*r*(f*f),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*h/r:0,m=n?g*-r*f/n:0,y=(s+l)/2+Math.cos(i)*v-Math.sin(i)*m,b=(c+u)/2+Math.sin(i)*v+Math.cos(i)*m,x=[(f-v)/n,(h-m)/r],k=[(-1*f-v)/n,(-1*h-m)/r],w=Wh([1,0],x),M=Wh(x,k);return Gh(x,k)<=-1&&(M=Math.PI),Gh(x,k)>=1&&(M=0),0===o&&M>0&&(M-=2*Math.PI),1===o&&M<0&&(M+=2*Math.PI),{cx:y,cy:b,rx:jh(t,[l,u])?0:n,ry:jh(t,[l,u])?0:r,startAngle:w,endAngle:w+M,xRotation:i,arcFlag:a,sweepFlag:o}}function Yh(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,o=e*i,s=n-t,c=n+t,l=r-e,u=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,c,r-o,c,r],["C",c,r+o,n+a,u,n,u],["C",n-a,u,s,r+o,s,r],["Z"]]}function Hh(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case Du.LINE:var r=t.parsedStyle,i=r.x1,a=void 0===i?0:i,o=r.y1,s=void 0===o?0:o,c=r.x2,l=void 0===c?0:c,u=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(a,s,l,void 0===u?0:u);break;case Du.CIRCLE:var f=t.parsedStyle,h=f.r,d=void 0===h?0:h,p=f.cx,g=void 0===p?0:p,v=f.cy;n=Yh(d,d,g,void 0===v?0:v);break;case Du.ELLIPSE:var m=t.parsedStyle,y=m.rx,b=void 0===y?0:y,x=m.ry,k=void 0===x?0:x,w=m.cx,M=void 0===w?0:w,O=m.cy;n=Yh(b,k,M,void 0===O?0:O);break;case Du.POLYLINE:case Du.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===Du.POLYGON);break;case Du.RECT:var E=t.parsedStyle,S=E.width,A=void 0===S?0:S,_=E.height,T=void 0===_?0:_,P=E.x,C=void 0===P?0:P,L=E.y,N=void 0===L?0:L,R=E.radius,I=R&&R.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var a=pl(i,4),o=a[0],s=a[1],c=a[2],l=a[3],u=t>0?1:-1,f=e>0?1:-1,h=u+f!==0?1:0;return[["M",u*o+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,h,t+n,f*s+r]:null,["L",t+n,e-f*c+r],c?["A",c,c,0,0,h,t+n-u*c,e+r]:null,["L",n+u*l,e+r],l?["A",l,l,0,0,h,n,e+r-f*l]:null,["L",n,f*o+r],o?["A",o,o,0,0,h,u*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(A,T,C,N,I&&R.map((function(t){return j(t,0,Math.min(Math.abs(A)/2,Math.abs(T)/2))})));break;case Du.PATH:n=sl(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=Qt(e[1],e[2],0);n&&ce(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=Qt(e[1],e[2],0),o=Qt(e[3],e[4],0),s=Qt(e[5],e[6],0);n&&(ce(a,a,n),ce(o,o,n),ce(s,s,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var c=Qt(e[6],e[7],0);n&&ce(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else if("Q"===e[0]){var l=Qt(e[1],e[2],0),u=Qt(e[3],e[4],0);n&&(ce(l,l,n),ce(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}(n,0,e)}var Vh=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=en(t)}catch(n){e=en(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],a=[r[1],r[2]],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&jh(a,o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s<o;s++){var c=t[s];r=t[s+1];var l=c[0],u={command:l,prePoint:n,params:c,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[c[1],c[2]],a=s;break;case"A":var f=$h(n,c);u.arcParams=f}if("Z"===l)n=i,r=t[a+1];else{var h=c.length;n=[c[h-2],c[h-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),u.currentPoint=n,e[a]&&jh(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=d;var p=u.prePoint;if(["L","H","V"].includes(l))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===l){var g=[c[1],c[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===l){var v=e[s-1],m=Ih(v.currentPoint,p);"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===l){var y=[c[1],c[2]],b=[c[3],c[4]];u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[y[0]-b[0],y[1]-b[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[b[0]-y[0],b[1]-y[1]])}else if("S"===l){var x=e[s-1],k=Ih(x.currentPoint,p),w=[c[1],c[2]];"C"===x.command?(u.command="C",u.startTangent=[p[0]-k[0],p[1]-k[1]],u.endTangent=[n[0]-w[0],n[1]-w[1]]):(u.command="SQ",u.startTangent=[p[0]-w[0],p[1]-w[1]],u.endTangent=[n[0]-w[0],n[1]-w[1]])}else if("A"===l){var M=Fh(u,0),O=M.x,E=M.y,S=Fh(u,1,!1),A=S.x,_=S.y;u.startTangent=[O,E],u.endTangent=[A,_]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;a<t.length;a++){var o=t[a],s=o.currentPoint,c=o.params,l=o.prePoint,u=void 0;switch(o.command){case"Q":u=_u(l[0],l[1],c[1],c[2],c[3],c[4]);break;case"C":u=Mu(l[0],l[1],c[1],c[2],c[3],c[4],c[5],c[6]);break;case"A":var f=o.arcParams;u=vu(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1])}u&&(o.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var h=P(n),d=P(r),p=T(n),g=T(r);if(0===i.length)return{x:h,y:d,width:p-h,height:g-d};for(var v=0;v<i.length;v++){var m=i[v],y=m.currentPoint;y[0]===h?h-=Rh(m,e).xExtra:y[0]===p&&(p+=Rh(m,e).xExtra),y[1]===d?d-=Rh(m,e).yExtra:y[1]===g&&(g+=Rh(m,e).yExtra)}return{x:h,y:d,width:p-h,height:g-d}}(o,0),c=s.x,l=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},qh=Tf(Vh);function Uh(t){return L(t)?qh(t):Vh(t)}function Xh(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=cn(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=cn(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=kn(r,i));var o,s,c,l,u,f,h,d,p=bn(a[0])!==bn(a[1])?(o=a[0],s=o.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(a[0]);return[p,(c=a[1],l=p,u=c.length-1,f=[],h=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var o,s=i+a;return 0===a||t[s]&&"M"===t[s][0]?(o=t[s],["M"].concat(o.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(c),d.forEach((function(t,e){c.slice(1).forEach((function(t,n){h+=ln(c[(e+n)%u].slice(-2),l[n%u].slice(-2))})),f[e]=h,h=0})),d[f.indexOf(Math.min.apply(null,f))]),function(t){return t}]}function Zh(t,e){return[t.points,e.points,function(t){return t}]}var Kh=null,Qh=/\s*(\w+)\(([^)]*)\)/g;function Jh(t){return function(e){var n=0;return t.map((function(t){return t===Kh?e[n++]:t}))}}function td(t){return t}var ed={matrix:["NNNNNN",[Kh,Kh,0,0,Kh,Kh,0,0,0,0,1,0,Kh,Kh,0,1],td],matrix3d:["NNNNNNNNNNNNNNNN",td],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Jh([Kh,Kh,new Hf(1)]),td],scaleX:["N",Jh([Kh,new Hf(1),new Hf(1)]),Jh([Kh,new Hf(1)])],scaleY:["N",Jh([new Hf(1),Kh,new Hf(1)]),Jh([new Hf(1),Kh])],scaleZ:["N",Jh([new Hf(1),new Hf(1),Kh])],scale3d:["NNN",td],skew:["Aa",null,td],skewX:["A",null,Jh([Kh,qf])],skewY:["A",null,Jh([qf,Kh])],translate:["Tt",Jh([Kh,Kh,Vf]),td],translateX:["T",Jh([Kh,Vf,Vf]),Jh([Kh,Vf])],translateY:["T",Jh([Vf,Kh,Vf]),Jh([Vf,Kh])],translateZ:["L",Jh([Vf,Vf,Kh])],translate3d:["TTL",td]};function nd(t){for(var e=[],n=t.length,r=0;r<n;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!ed[a])return[];var s=o.map((function(t){return th(t)}));e.push({t:a,d:s})}return e}function rd(t){if(Array.isArray(t))return nd(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Qh.lastIndex=0;e=Qh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=ed[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var c=[],l=0;l<s.length;l++){var u=o[l],f=s[l],h=void 0;if(void 0===(h=u?{A:function(t){return"0"===t.trim()?qf:kh(t)},N:Th,T:bh,L:mh}[f.toUpperCase()](u):{a:qf,n:c[0],t:Vf}[f]))return[];c.push(h)}if(n.push({t:i,d:c}),Qh.lastIndex===t.length)return n}return[]}function id(t){if(Array.isArray(t))return nd(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Qh.lastIndex=0;e=Qh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=ed[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var c=[],l=0;l<s.length;l++){var u=o[l],f=s[l],h=void 0;if(void 0===(h=u?{A:function(t){return"0"===t.trim()?qf:xh(t)},N:_h,T:yh,L:vh}[f.toUpperCase()](u):{a:qf,n:c[0],t:Vf}[f]))return[];c.push(h)}if(n.push({t:i,d:c}),Qh.lastIndex===t.length)return n}return[]}function ad(t){var e,n,r,i;switch(t.t){case"rotateX":return i=of(Mh(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=of(Mh(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=of(Mh(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=of(Mh(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),c=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*c),2*(e*r*l-n*c),0,2*(e*n*l-r*c),1-2*(e*e+r*r)*l,2*(n*r*l+e*c),0,2*(e*r*l+n*c),2*(n*r*l-e*c),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=of(Mh(t.d[0])),f=of(Mh(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=of(Mh(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=of(Mh(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Eh(t.d[0],0,null)||0,n=Eh(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Eh(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Eh(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Eh(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Eh(t.d[0],0,null)||0,n=Eh(t.d[1],0,null)||0,r=Eh(t.d[2],0,null)||0,1];case"perspective":var h=Eh(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,h?-1/h:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function od(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function sd(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}(df,t))return!1;if(pt(pf,df),pf[3]=0,pf[7]=0,pf[11]=0,pf[15]=1,Math.abs(xt(pf))<1e-8)return!1;var o,s,c=df[3],l=df[7],u=df[11],f=df[12],h=df[13],d=df[14],p=df[15];if(0!==c||0!==l||0!==u){if(gf[0]=c,gf[1]=l,gf[2]=u,gf[3]=p,!bt(pf,pf))return!1;yt(pf,pf),ve(i,gf,pf)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=df,(o=vf)[0][0]=s[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=Kt(vf[0]),ie(vf[0],vf[0]),r[0]=ae(vf[0],vf[1]),yf(vf[1],vf[1],vf[0],1,-r[0]),n[1]=Kt(vf[1]),ie(vf[1],vf[1]),r[0]/=n[1],r[1]=ae(vf[0],vf[2]),yf(vf[2],vf[2],vf[0],1,-r[1]),r[2]=ae(vf[1],vf[2]),yf(vf[2],vf[2],vf[1],1,-r[2]),n[2]=Kt(vf[2]),ie(vf[2],vf[2]),r[1]/=n[2],r[2]/=n[2],oe(mf,vf[1],vf[2]),ae(vf[0],mf)<0)for(var g=0;g<3;g++)n[g]*=-1,vf[g][0]*=-1,vf[g][1]*=-1,vf[g][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+vf[0][0]-vf[1][1]-vf[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-vf[0][0]+vf[1][1]-vf[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-vf[0][0]-vf[1][1]+vf[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+vf[0][0]+vf[1][1]+vf[2][2],0)),vf[2][1]>vf[1][2]&&(a[0]=-a[0]),vf[0][2]>vf[2][0]&&(a[1]=-a[1]),vf[1][0]>vf[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(ad).reduce(od)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var cd=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var a=0;a<4;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)o[s][3]=a[s];for(var c=0;c<3;c++)for(var l=0;l<3;l++)o[3][c]+=e[l]*o[l][c];var u=i[0],f=i[1],h=i[2],d=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+h*h),p[0][1]=2*(u*f-h*d),p[0][2]=2*(u*h+f*d),p[1][0]=2*(u*f+h*d),p[1][1]=1-2*(u*u+h*h),p[1][2]=2*(f*h-u*d),p[2][0]=2*(u*h-f*d),p[2][1]=2*(f*h+u*d),p[2][2]=1-2*(u*u+f*f),o=t(o,p);var g,v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(v[2][1]=r[2],o=t(o,v)),r[1]&&(v[2][1]=0,v[2][0]=r[0],o=t(o,v)),r[0]&&(v[2][0]=0,v[1][0]=r[0],o=t(o,v));for(var m=0;m<3;m++)for(var y=0;y<3;y++)o[m][y]*=n[m];return 0===(g=o)[0][2]&&0===g[0][3]&&0===g[1][2]&&0===g[1][3]&&0===g[2][0]&&0===g[2][1]&&1===g[2][2]&&0===g[2][3]&&0===g[3][2]&&1===g[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function ld(t){return t.toFixed(6).replace(".000000","")}function ud(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=sd(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=sd(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=j(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return cd(t[0],t[1],t[2],e,t[4]).map(ld).join(",")}])}function fd(t){return t.replace(/[XY]/,"")}function hd(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function dd(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?th(o):th(o,t.unit)}))})},a=0;a<t.length;a++)i()}var o,s,c=[],l=[],u=[];if(t.length!==e.length){var f=ud(t,e);c=[f[0]],l=[f[1]],u=[["matrix",[f[2]]]]}else for(var h=0;h<t.length;h++){var d=t[h].t,p=e[h].t,g=t[h].d,v=e[h].d,m=ed[d],y=ed[p],b=void 0;if(s=p,"perspective"===(o=d)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var x=ud([t[h]],[e[h]]);c.push(x[0]),l.push(x[1]),u.push(["matrix",[x[2]]])}else{if(d===p)b=d;else if(m[2]&&y[2]&&fd(d)===fd(p))b=fd(d),g=m[2](g),v=y[2](v);else{if(!m[1]||!y[1]||hd(d)!==hd(p)){var k=ud(t,e);c=[k[0]],l=[k[1]],u=[["matrix",[k[2]]]];break}b=hd(d),g=m[1](g),v=y[1](v)}for(var w=[],M=[],O=[],E=0;E<g.length;E++){var S=wh(g[E],v[E],n,!1,E);w[E]=S[0],M[E]=S[1],O.push(S[2])}c.push(w),l.push(M),u.push([b,O])}}if(r){var A=c;c=l,l=A}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return u[e][1][n](t)})).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),"".concat(u[e][0],"(").concat(n,")")})).join(" ")}]}var pd=Tf((function(t){if(L(t)){if("text-anchor"===t)return[th(0,"px"),th(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[bh(gd(e[0])),bh(gd(e[1]))]}return[th(t[0]||0,"px"),th(t[1]||0,"px")]}));function gd(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var vd=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:_f.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:_f.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:_f.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:_f.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:_f.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:_f.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:_f.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:_f.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:_f.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:_f.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:_f.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:_f.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:_f.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:_f.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:_f.FILTER},{n:"clipPath",syntax:_f.DEFINED_PATH},{n:"textPath",syntax:_f.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:_f.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:_f.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:_f.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:_f.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:_f.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:_f.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:_f.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:_f.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:_f.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:_f.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:_f.COORDINATE},{n:"y1",int:!0,l:!0,syntax:_f.COORDINATE},{n:"z1",int:!0,l:!0,syntax:_f.COORDINATE},{n:"x2",int:!0,l:!0,syntax:_f.COORDINATE},{n:"y2",int:!0,l:!0,syntax:_f.COORDINATE},{n:"z2",int:!0,l:!0,syntax:_f.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:_f.PATH,p:50},{n:"points",int:!0,l:!0,syntax:_f.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:_f.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:_f.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:_f.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:_f.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:_f.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:_f.NUMBER,d:function(t){return t===Du.PATH||t===Du.POLYGON||t===Du.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:_f.MARKER},{n:"markerEnd",syntax:_f.MARKER},{n:"markerMid",syntax:_f.MARKER},{n:"markerStartOffset",syntax:_f.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:_f.LENGTH,l:!0,int:!0,d:"0"}],md=new Set(vd.filter((function(t){return!!t.l})).map((function(t){return t.n}))),yd={},bd=function(){return il((function t(e){var n=this;nl(this,t),this.runtime=e,vd.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat(sl(t.a||[])).forEach((function(e){yd[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=xd(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var a=!!n.forceUpdateGeometry;if(!a)for(var o in e)if(md.has(o)){a=!0;break}var s,c,l=xd(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=dh(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=dh(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=dh(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Sh.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return gh(/deg|rad|grad|turn|px|%/g,t)||dh(t)}))}),n.lastIndex===t.length)return r}return[]}(e.filter)),l.has("radius")&&!b(e.radius)&&(t.parsedStyle.radius=Oh(e.radius,4)),l.has("lineDash")&&!b(e.lineDash)&&(t.parsedStyle.lineDash=Oh(e.lineDash,"even")),l.has("points")&&e.points&&(t.parsedStyle.points=(s=e.points,c=L(s)?s.split(" ").map((function(t){var e=pl(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):s,{points:c,totalLength:0,segments:[]})),l.has("d")&&""===e.d&&(t.parsedStyle.d=el({},Af)),l.has("d")&&e.d&&(t.parsedStyle.d=Uh(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[_f.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!Y(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[_f.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[_f.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=rd(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=pd(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[_f.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[_f.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[_f.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!b(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[_f.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!b(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[_f.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[_f.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[_f.TRANSFORM_ORIGIN].postProcessor(t),a&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new qu),r.renderBounds||(r.renderBounds=new qu);var i=t.parsedStyle,a=n.update(i,t),o=a.cx,s=void 0===o?0:o,c=a.cy,l=void 0===c?0:c,u=a.cz,f=void 0===u?0:u,h=a.hwidth,d=void 0===h?0:h,p=a.hheight,g=void 0===p?0:p,v=a.hdepth,m=void 0===v?0:v,y=[Math.abs(d),Math.abs(g),m],b=i.stroke,x=i.lineWidth,k=void 0===x?1:x,w=i.increasedLineWidthForHitTesting,M=void 0===w?0:w,O=i.shadowType,E=void 0===O?"outer":O,S=i.shadowColor,A=i.filter,_=void 0===A?[]:A,T=i.transformOrigin,P=[s,l,f];r.contentBounds.update(P,y);var C=e===Du.POLYLINE||e===Du.POLYGON||e===Du.PATH?Math.SQRT2:.5;if(b&&!b.isNone){var L=((k||0)+(M||0))*C;y[0]+=L,y[1]+=L}if(r.renderBounds.update(P,y),S&&E&&"inner"!==E){var N=r.renderBounds,j=N.min,R=N.max,I=i.shadowBlur||0,D=i.shadowOffsetX||0,B=i.shadowOffsetY||0,F=j[0]-I+D,z=R[0]+I+D,G=j[1]-I+B,W=R[1]+I+B;j[0]=Math.min(j[0],F),R[0]=Math.max(R[0],z),j[1]=Math.min(j[1],G),R[1]=Math.max(R[1],W),r.renderBounds.setMinMax(j,R)}_.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,ee(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,c=r.renderBounds,l=c.min,u=c.max,f=l[0]-s+a,h=u[0]+s+a,d=l[1]-s+o,p=u[1]+s+o;l[0]=Math.min(l[0],f),u[0]=Math.max(u[0],h),l[1]=Math.min(l[1],d),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(l,u)}})),t.geometry.dirty=!1;var $=g<0,Y=(d<0?-1:1)*(T?Eh(T[0],0,t,!0):0),H=($?-1:1)*(T?Eh(T[1],1,t,!0):0);(Y||H)&&t.setOrigin(Y,H)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===Du.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===Du.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function xd(t){return t.constructor.PARSED_STYLE_LIST}var kd=function(){return il((function t(){nl(this,t),this.mixer=Ph}),[{key:"calculator",value:function(t,e,n,r){return Mh(n)}}])}(),wd=function(){return il((function t(){nl(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof $f&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),Md=function(){return il((function t(){nl(this,t),this.parser=dh,this.mixer=ph}),[{key:"calculator",value:function(t,e,n,r){return n instanceof $f?"none"===n.value?Kf:Qf:n}}])}(),Od=function(){return il((function t(){nl(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof $f?[]:n}}])}();function Ed(t){var e=t.parsedStyle.fontSize;return b(e)?null:e}var Sd=function(){return il((function t(){nl(this,t),this.mixer=Ph}),[{key:"calculator",value:function(t,e,n,r,i){if(R(n))return n;if(!Hf.isRelativeUnit(n.unit))return n.value;if(n.unit===Pf.kPercentage)return 0;if(n.unit===Pf.kEms){if(r.parentNode){var a=Ed(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===Pf.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=Ed(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Ad=function(){return il((function t(){nl(this,t),this.mixer=Lh}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),_d=function(){return il((function t(){nl(this,t),this.mixer=Lh}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Td=function(){return il((function t(){nl(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof $f&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),Pd=function(){return il((function t(){nl(this,t),this.mixer=Ph}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Cd=function(){return il((function t(){nl(this,t),this.mixer=Ch(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===Du.LINE||i===Du.PATH||i===Du.POLYLINE){var a=n.getPoint(r);a&&t.setLocalPosition(a.x,a.y)}}}}])}(),Ld=function(){return il((function t(){nl(this,t),this.mixer=Ch(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Nd=function(){return il((function t(){nl(this,t),this.parser=Uh,this.mixer=Xh}),[{key:"calculator",value:function(t,e,n){return n instanceof $f&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Qu(0,0,0,0)}:n}}])}(),jd=il((function t(){nl(this,t),this.mixer=Zh})),Rd=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).mixer=Ch(0,1/0),t}return dl(e,t),il(e)}(Sd),Id=function(){return il((function t(){nl(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n instanceof $f?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Dd=function(){return il((function t(){nl(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}(),Bd=new WeakMap;var Fd="undefined"!=typeof window&&void 0!==window.document;function zd(t){return!!t.getAttribute}function Gd(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Wd(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function $d(t,e){if(Fd)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Yd={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Hd="object"==typeof performance&&performance.now?performance:Date;function Vd(t){return t.nodeName===Du.FRAGMENT||t.getRootNode().nodeName===Du.FRAGMENT}function qd(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1,a=!!e&&!e.isNone,o=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=a,i=o):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var Ud=1,Xd="object"==typeof self&&self.self===self?self:"object"==typeof Zc&&Zc.global===Zc?Zc:{},Zd=Date.now(),Kd={},Qd=Date.now(),Jd=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Qd,r=n>16?0:16-n,i=Ud++;return Kd[i]=t,Object.keys(Kd).length>1||setTimeout((function(){Qd=e;var t=Kd;Kd={},Object.keys(t).forEach((function(e){return t[e](Xd.performance&&"function"==typeof Xd.performance.now?Xd.performance.now():Date.now()-Zd)}))}),r),i},tp=function(t){delete Kd[t]},ep=function(t){return"string"!=typeof t?Jd:""===t?Xd.requestAnimationFrame:Xd["".concat(t,"RequestAnimationFrame")]},np=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!ep(t)})),rp=ep(np),ip=function(t){return"string"!=typeof t?tp:""===t?Xd.cancelAnimationFrame:Xd["".concat(t,"CancelAnimationFrame")]||Xd["".concat(t,"CancelRequestAnimationFrame")]}(np);Xd.requestAnimationFrame=rp,Xd.cancelAnimationFrame=ip;var ap=function(){return il((function t(){nl(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}])}(),op=function(){return il((function t(){nl(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=Lu(Pu().mark((function t(){var e,n,r,i,a=arguments;return Pu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,a);case 3:n=t.sent,r=0;case 5:if(!(r<this.callbacks.length-1)){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),sp=function(){return il((function t(){nl(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach((function(t){t.apply(void 0,r)}))}}])}(),cp=function(){return il((function t(){nl(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=arguments,i=this.callbacks[0].apply(void 0,r),a=0;a<this.callbacks.length-1;a++){i=(0,this.callbacks[a])(i)}return i}return null}}])}(),lp=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],up=/([\"\'])[^\'\"]+\1/;function fp(t,e,n){return mt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var hp=ht(),dp=ht(),pp={scale:function(t){At(hp,[t[0].value,t[1].value,1])},scaleX:function(t){At(hp,[t[0].value,1,1])},scaleY:function(t){At(hp,[1,t[0].value,1])},scaleZ:function(t){At(hp,[1,1,t[0].value])},scale3d:function(t){At(hp,[t[0].value,t[1].value,t[2].value])},translate:function(t){St(hp,[t[0].value,t[1].value,0])},translateX:function(t){St(hp,[t[0].value,0,0])},translateY:function(t){St(hp,[0,t[0].value,0])},translateZ:function(t){St(hp,[0,0,t[0].value])},translate3d:function(t){St(hp,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Ct(hp,of(Mh(t[0])))},rotateX:function(t){Tt(hp,of(Mh(t[0])))},rotateY:function(t){Pt(hp,of(Mh(t[0])))},rotateZ:function(t){Ct(hp,of(Mh(t[0])))},rotate3d:function(t){_t(hp,of(Mh(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){fp(hp,of(t[0].value),of(t[1].value))},skewX:function(t){fp(hp,of(t[0].value),0)},skewY:function(t){fp(hp,0,of(t[0].value))},matrix:function(t){vt(hp,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){vt.apply(Ut,[hp].concat(sl(t.map((function(t){return t.value})))))}},gp=Qt(1,1,1),vp=Xt(),mp={translate:function(t,e){wg.sceneGraphService.setLocalScale(t,gp,!1),wg.sceneGraphService.setLocalEulerAngles(t,vp,void 0,void 0,!1),wg.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),wg.sceneGraphService.dirtifyLocal(t,t.transformable)}};function yp(t,e){if(t.length){if(1===t.length&&mp[t[0].t])return void mp[t[0].t](e,t[0].d);for(var n=mt(dp),r=0;r<t.length;r++){var i=t[r],a=i.t,o=i.d,s=pp[a];s&&(s(o),Vt(n,n,hp))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var bp=function(){return il((function t(){nl(this,t),this.parser=id,this.mixer=dd}),[{key:"calculator",value:function(t,e,n,r){return n instanceof $f?[]:n}},{key:"postProcessor",value:function(t){yp(t.parsedStyle.transform,t)}}])}(),xp=function(){return il((function t(){nl(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Pf.kPixels&&e[1].unit===Pf.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),kp=function(){return il((function t(){nl(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=Sf.Z_INDEX_CHANGED)}}}])}(),wp=function(){return il((function t(){nl(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,a=void 0===i?0:i,o=t.r,s=void 0===o?0:o;return{cx:r,cy:a,hwidth:s,hheight:s}}}])}(),Mp=function(){return il((function t(){nl(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,a=void 0===i?0:i,o=t.rx,s=void 0===o?0:o,c=t.ry;return{cx:r,cy:a,hwidth:s,hheight:void 0===c?0:c}}}])}(),Op=function(){return il((function t(){nl(this,t)}),[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),c=(o-a)/2,l=(Math.max(n,i)-s)/2;return{cx:a+c,cy:s+l,hwidth:c,hheight:l}}}])}(),Ep=function(){return il((function t(){nl(this,t)}),[{key:"update",value:function(t){var e=t.d.rect,n=e.x,r=e.y,i=e.width/2,a=e.height/2;return{cx:n+i,cy:r+a,hwidth:i,hheight:a}}}])}(),Sp=function(){return il((function t(){nl(this,t)}),[{key:"update",value:function(t){if(t.points&&x(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,sl(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,sl(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,sl(e.map((function(t){return t[1]})))),a=Math.max.apply(Math,sl(e.map((function(t){return t[1]})))),o=(r-n)/2,s=(a-i)/2;return{cx:n+o,cy:i+s,hwidth:o,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Ap=function(){return il((function t(){nl(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,c=void 0===s?0:s,l=t.height,u=c,f=void 0===l?0:l;return o&&!L(o)&&(u||(u=o.width,t.width=u),f||(f=o.height,t.height=f)),{cx:r+u/2,cy:a+f/2,hwidth:u/2,hheight:f/2}}}])}(),_p=function(){return il((function t(e){nl(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,c=t.textBaseline,l=void 0===c?"alphabetic":c,u=t.dx,f=void 0===u?0:u,h=t.dy,d=void 0===h?0:h,p=t.x,g=void 0===p?0:p,v=t.y,m=void 0===v?0:v;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var y=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{}).offscreenCanvas,b=this.globalRuntime.textService.measureText(r,t,y);t.metrics=b;var x=b.width/2,k=b.height/2,w=g+x;"center"===a||"middle"===a?w+=s/2-x:"right"!==a&&"end"!==a||(w+=s-2*x);var M=m-k;return"middle"===l?M+=k:"top"===l||"hanging"===l?M+=2*k:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(M+=0),f&&(w+=f),d&&(M+=d),{cx:w,cy:M,hwidth:x,hheight:k}}}])}(),Tp=function(){return il((function t(){nl(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Pp=function(){return il((function t(){nl(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.width,s=void 0===o?0:o,c=t.height,l=void 0===c?0:c;return{cx:r+s/2,cy:a+l/2,hwidth:s/2,hheight:l/2}}}])}(),Cp=function(){return il((function t(e){nl(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ku,this.page=new Ku,this.canvas=new Ku,this.viewport=new Ku,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(Ju)}}])}(),Lp=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).client=new Ku,t.movement=new Ku,t.offset=new Ku,t.global=new Ku,t.screen=new Ku,t}return dl(e,t),il(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw new Error(Ju)}}])}(Cp),Np=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return dl(e,t),il(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Lp),jp=function(t){function e(){return nl(this,e),fl(this,e,arguments)}return dl(e,t),il(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Lp),Rp=function(t){function e(t,n){var r;return nl(this,e),(r=fl(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return dl(e,t),il(e)}(Cp),Ip=new WeakMap,Dp=function(){return il((function t(){nl(this,t),this.emitter=new vl}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if($(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=y(e)?e:e.handleEvent;var s=y(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;($(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=y(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=y(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Rp(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Ip.get(this);r||(r=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&Ip.set(this,r);if(r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),Bp=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return dl(e,t),il(e,[{key:"textContent",get:function(){var t="";this.nodeName===Du.TEXT&&(t+=this.style.text);var e,n=Nu(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.nodeName===Du.TEXT?t+=r.nodeValue:t+=r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===Du.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(Ju)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(Ju)}},{key:"lookupPrefix",value:function(t){throw new Error(Ju)}},{key:"normalize",value:function(){throw new Error(Ju)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,c=s===i?a:i;if(s[s.length-c.length]===c[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-c.length,u=c.length-1;u>=0;u--){var f=c[u],h=s[l+u];if(h!==f){var d=f.parentNode.childNodes;return d.indexOf(f)<d.indexOf(h)?c===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Dp);Bp.DOCUMENT_POSITION_DISCONNECTED=1,Bp.DOCUMENT_POSITION_PRECEDING=2,Bp.DOCUMENT_POSITION_FOLLOWING=4,Bp.DOCUMENT_POSITION_CONTAINS=8,Bp.DOCUMENT_POSITION_CONTAINED_BY=16,Bp.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Fp=function(){return il((function t(e,n){var r=this;nl(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=ht(),this.tmpVec3=Xt(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;r.dispatchEvent(e,n?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=Hd.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var i=2===n.button;r.dispatchEvent(n,i?"rightup":"mouseup")}var a=r.trackingData(t.pointerId),o=r.findMountedTarget(a.pressTargetsByButton[t.button]),s=o;if(o&&!n.composedPath().includes(o)){for(var c=o;c&&!n.composedPath().includes(c);){if(n.currentTarget=c,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var l=2===n.button;r.notifyTarget(n,l?"rightupoutside":"mouseupoutside")}Bp.isNode(c)&&(c=c.parentNode)}delete a.pressTargetsByButton[t.button],s=c}if(s){var u,f=r.clonePointerEvent(n,"click");f.target=s,f.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:f.target,timeStamp:e});var h=r.context.renderingContext.root.ownerDocument.defaultView,d=a.clicksByButton[t.button];d.target===f.target&&e-d.timeStamp<h.getConfig().dblClickSpeed?++d.clickCount:d.clickCount=1,d.target=f.target,d.timeStamp=e,f.detail=d.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==f.pointerType&&"touch"!==f.pointerType||r.dispatchEvent(f,"click"),r.dispatchEvent(f,"pointertap")),r.freeEvent(f)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o="mousemove"===t.type?"mouseout":"pointerout",s=r.createPointerEvent(t,o,a||void 0);if(r.dispatchEvent(s,"pointerout"),n&&r.dispatchEvent(s,"mouseout"),!e.composedPath().includes(a)){var c=r.createPointerEvent(t,"pointerleave",a||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseleave"),Bp.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(s)}if(a!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=r.clonePointerEvent(e,l);r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var f=a&&Bp.isNode(a)&&a.parentNode;f&&f!==(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var h=r.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==a&&h.target!==(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)h.currentTarget=h.target,r.notifyTarget(h),n&&r.notifyTarget(h,"mouseenter"),Bp.isNode(h.target)&&(h.target=h.target.parentNode);r.freeEvent(h)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Bp.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Bp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Bp.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Bp.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new Ku((t.x-((null==i?void 0:i.left)||0))/n,(t.y-((null==i?void 0:i.top)||0))/r)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new Ku((t.x+((null==i?void 0:i.left)||0))*n,(t.y+((null==i?void 0:i.top)||0))*r)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),c=r.getWorldTransform(),l=kt(this.tmpMatrix,c,s),u=te(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return ce(u,u,l),new Ku(u[0],u[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=kt(this.tmpMatrix,n,r),a=te(this.tmpVec3,t.x,t.y,0);ce(this.tmpVec3,this.tmpVec3,i);var o=this.context.config,s=o.width,c=o.height;return new Ku((a[0]+1)/2*s,(1-(a[1]+1)/2)*c)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;a<n.length;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)Bp.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,a=r.height,o=r.disableHitTesting;return e<0||n<0||e>i||n>a?null:!o&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e<n.length;e++){var r=n[e],i=this.nativeHTMLMap.get(r);if(i)return i}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(Np);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(jp);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(jp);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Np);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=Hd.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Bp.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=zd(e)&&e.getAttribute("cursor");if(n)return n;e=Bp.isNode(e)&&e.parentNode}}}])}(),zp=function(){return il((function t(){nl(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||wg.offscreenCanvas)this.canvas=t||wg.offscreenCanvas,this.context=this.canvas.getContext("2d",el({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",el({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",el({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Gp=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Wp=function(){return il((function t(e,n){nl(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new sp,initAsync:new ap,dirtycheck:new cp,cull:new cp,beginFrame:new sp,beforeRender:new sp,render:new sp,afterRender:new sp,endFrame:new sp,destroy:new sp,pick:new op,pickSync:new cp,pointerDown:new sp,pointerUp:new sp,pointerMove:new sp,pointerOut:new sp,pointerOver:new sp,pointerWheel:new sp,pointerCancel:new sp,click:new sp},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=el(el({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Gp.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(Gp.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&a);o&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),o&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var c=o?r.hooks.cull.call(s,r.context.camera):s;c&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(c))}e.dirty=!1,i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var c=[t];c.length>0;){var l=c.pop();s(l);for(var u=l.sortable.sorted||l.childNodes,f=u.length-1;f>=0;f--)c.push(u[f])}}},{key:"sort",value:function(t,e){e.sorted&&e.dirtyReason!==Sf.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;Gd(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Gd)}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Gp.DISPLAY_OBJECT_CHANGED)}}])}(),$p=/\[\s*(.*)=(.*)\s*\]/,Yp=function(){return il((function t(){nl(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match($p),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return b(n)?"":n.toString?n.toString():""}}])}(),Hp=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),Vp=function(t){function e(t,n,r,i,a,o,s,c){var l;return nl(this,e),(l=fl(this,e,[null])).relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=a,l.attrChange=o,l.prevParsedValue=s,l.newParsedValue=c,l.type=t,l}return dl(e,t),il(e)}(Cp);function qp(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}Vp.ADDITION=2,Vp.MODIFICATION=1,Vp.REMOVAL=3;var Up,Xp,Zp,Kp=new Vp(Hp.REPARENT,null,"","","",0,"",""),Qp=Ae(),Jp=Xt(),tg=Qt(1,1,1),eg=ht(),ng=Ae(),rg=Xt(),ig=ht(),ag=me(),og=Xt(),sg=me(),cg=Xt(),lg=Xt(),ug=Xt(),fg=ht(),hg=me(),dg=me(),pg=me(),gg={affectChildren:!0},vg=function(){return il((function t(e){nl(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new Rp(Hp.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===Du.FRAGMENT,o=Vd(e);t.parentNode=e;var s=a?t.childNodes:[t];R(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var c=e.sortable;if((null!=c&&null!==(r=c.sorted)&&void 0!==r&&r.length||t.parsedStyle.zIndex)&&(-1===c.dirtyChildren.indexOf(t)&&c.dirtyChildren.push(t),c.dirty=!0,c.dirtyReason=Sf.ADDED),!o){if(a)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}i&&t.dispatchEvent(Kp)}}},{key:"detach",value:function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Sf.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n)}}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=Qt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=ag;ke(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);Me(pg,a),xe(pg,pg),be(r,pg,r),be(n.localRotation,r,i),Se(n.localRotation,n.localRotation),this.dirtifyLocal(t,n)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=Qt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;ke(dg,e[0],e[1],e[2]),Ee(n.localRotation,n.localRotation,dg),this.dirtifyLocal(t,n)}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=Qt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ke(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);Me(hg,xe(ag,r)),Ee(n.localRotation,n.localRotation,hg),this.dirtifyLocal(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=Qt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;ke(r.localRotation,e[0],e[1],e[2]),n&&this.dirtifyLocal(t,r)}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=Qt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;ue(e,Jp)||(!function(t,e,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=e[0],c=e[1],l=e[2],u=i*l-a*c,f=a*s-r*l,h=r*c-i*s,d=i*h-a*f,p=a*u-r*h,g=r*f-i*u,v=2*o;u*=v,f*=v,h*=v,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+g}(e,e,n.localRotation),ee(n.localPosition,n.localPosition,e),this.dirtifyLocal(t,n))}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(ug[0]=e[0],ug[1]=e[1],ug[2]=null!==(n=e[2])&&void 0!==n?n:0,!ue(this.getPosition(t),ug)){if(Jt(r.position,ug),null!==t.parentNode&&t.parentNode.transformable){var i=t.parentNode.transformable;pt(fg,i.worldTransform),bt(fg,fg),ce(r.localPosition,ug,fg)}else Jt(r.localPosition,ug);this.dirtifyLocal(t,r)}}},{key:"setLocalPosition",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;lg[0]=e[0],lg[1]=e[1],lg[2]=null!==(n=e[2])&&void 0!==n?n:0,ue(i.localPosition,lg)||(Jt(i.localPosition,lg),r&&this.dirtifyLocal(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r,i,a,o=t.transformable;r=o.localScale,i=o.localScale,a=te(rg,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],this.dirtifyLocal(t,o)}},{key:"setLocalScale",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;te(rg,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),ue(rg,i.localScale)||(Jt(i.localScale,rg),r&&this.dirtifyLocal(t,i))}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=te(rg,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),ue(e,Jp)||(ee(rg,this.getPosition(t),e),this.setPosition(t,rg))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=we(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);Me(ag,o),xe(ag,ag),be(a.localRotation,ag,e),Se(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=Oe(ag,e,n,r,i));var o=t.transformable;Me(o.localRotation,e),a&&this.dirtifyLocal(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(ng,e,n));var i,a,o=t.transformable;i=o.localSkew,a=e,i[0]=a[0],i[1]=a[1],r&&this.dirtifyLocal(t,o)}},{key:"dirtifyLocal",value:function(t,e){Vd(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var r=t.childNodes.length,i=0;i<r;i++)this.dirtifyFragment(t.childNodes[i]);t.nodeName===Du.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n)&&n.nodeName!==Du.FRAGMENT&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n))};this.pendingEvents.forEach((function(t,e){e.nodeName!==Du.FRAGMENT&&(gg.affectChildren=t,t?e.forEach((function(t){n(t,gg)})):n(e,gg))})),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)qp(n),n=n.parentNode;e&&t.forEach((function(t){qp(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new Vp(Hp.ATTR_MODIFIED,n,e,e,t,Vp.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return Nt(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return Rt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return jt(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){It(t.localTransform,t.localRotation,t.localPosition,Qt(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(mt(ig),ig[4]=Math.tan(t.localSkew[0]),ig[1]=Math.tan(t.localSkew[1]),kt(t.localTransform,t.localTransform,ig));var e=It(ig,Oe(ag,0,0,0,1),te(rg,1,1,1),t.localScale,t.origin);kt(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2],c=1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2],l=1!==a[0]||1!==a[1]||1!==a[2],u=0!==o[0]||0!==o[1]||0!==o[2];c||l||u?It(n,i,r,a,o):s?St(n,r):mt(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=Nt(og,e),r=Rt(sg,e),i=jt(cg,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,tg,!1),this.setLocalPosition(t,Jp,!1),this.setLocalEulerAngles(t,Jp,void 0,void 0,!1),this.setLocalSkew(t,Qp,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,e);if(!qu.isEmpty(r)){var i=n||new qu;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&wg.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new qu}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new qu).update(r.center,r.halfExtents))})),a||(a=new qu),n){var o=Wd(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=eg;t.parentNode.transformable&&(e=bt(ig,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!qu.isEmpty(n)){var r=new qu;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);qu.isEmpty(r)||(n=new qu).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=pl(n.getMin(),2),o=a[0],s=a[1],c=pl(n.getMax(),2),l=c[0],u=c[1];return new Qu(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),l-o,u-s)}return new Qu((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}}},{key:"sync",value:function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?kt(e.worldTransform,r.worldTransform,e.localTransform):pt(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}])}(),mg={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},yg=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,bg=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),xg=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),kg=function(){return il((function t(e){var n=this;nl(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!xg.exec(e)&&!bg.exec(t))},this.trimByKinsokuShorui=function(t){var e=sl(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e}),[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=mg.MetricsString+mg.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(mg.BaselineSymbol).width),c=mg.HeightMultiplier*s;s=s*mg.BaselineMultiplier|0,r.width=o,r.height=c,i.fillStyle="#f00",i.fillRect(0,0,o,c),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,c||1).data,u=l.length,f=4*o,h=0,d=0,p=!1;for(h=0;h<s;++h){for(var g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d+=f}for(n.ascent=s-h,d=u-f,p=!1,h=c;h>s;--h){for(var v=0;v<f;v+=4)if(255!==l[d+v]){p=!0;break}if(p)break;d-=f}return n.descent=h-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,c=e.lineWidth,l=void 0===c?1:c,u=e.textBaseline,f=void 0===u?"alphabetic":u,h=e.textAlign,d=void 0===h?"start":h,p=e.letterSpacing,g=void 0===p?0:p,v=e.textPath,m=e.leading,y=void 0===m?0:m,b=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,a=t.fontStyle,o=void 0===a?"normal":a,s=t.fontVariant,c=void 0===s?"normal":s,l=t.fontWeight,u=void 0===l?"normal":l,f=R(n)&&"".concat(n,"px")||"16px",h=i.split(","),d=h.length-1;d>=0;d--){var p=h[d].trim();!up.test(p)&&lp.indexOf(p)<0&&(p='"'.concat(p,'"')),h[d]=p}return"".concat(o," ").concat(c," ").concat(u," ").concat(f," ").concat(h.join(","))}(e),x=this.measureFont(b,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var k=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);k.font=b,e.isOverflowing=!1;var w=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=new Array(w.length),O=0;if(!v){for(var E=0;E<w.length;E++){var S=k.measureText(w[E]).width+(w[E].length-1)*g;M[E]=S,O=Math.max(O,S)}var A=O+l,_=s||x.fontSize+l,T=Math.max(_,x.fontSize+l)+(w.length-1)*(_+y),P=0;return"middle"===f?P=-T/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?P=-T:"top"!==f&&"hanging"!==f||(P=0),{font:b,width:A,height:T,lines:w,lineWidths:M,lineHeight:_+=y,maxLineWidth:O,fontProperties:x,lineMetrics:M.map((function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new Qu(n-l/2,P+e*_,t+l,_)}))}}v.getTotalLength();for(var C=0;C<w.length;C++)k.measureText(w[C]).width,w[C].length}},{key:"wordWrap",value:function(t,e,n){var r=this,i=this,a=e.wordWrapWidth,o=void 0===a?0:a,s=e.letterSpacing,c=void 0===s?0:s,l=e.maxLines,u=void 0===l?1/0:l,f=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),d=o+c,p="";"ellipsis"===f?p="...":f&&"clip"!==f&&(p=f);var g=Array.from(t),v=[],m=0,y=0,b=0,x={},k=function(t){return r.getFromCache(t,c,x,h)},w=k(p);function M(t,e,n,r){for(;k(t)<r&&e<g.length-1&&!i.isNewline(g[e+1]);)t+=g[e+=1];for(;k(t)>r&&e>n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function O(t,e){if(!(w<=0||w>d))if(v[t]){var n=M(v[t],e,b+1,d-w);v[t]=n.lineTxt+p}else v[t]=p}for(var E=0;E<g.length;E++){var S=g[E],A=g[E-1],_=g[E+1],T=k(S);if(this.isNewline(S)){if(m+1>=u){e.isOverflowing=!0,E<g.length-1&&O(m,E-1);break}b=E-1,y=0,v[m+=1]=""}else{if(y>0&&y+T>d){var P=M(v[m],E-1,b+1,d);if(P.txtLastCharIndex!==E-1){if(v[m]=P.lineTxt,P.txtLastCharIndex===g.length-1)break;E=P.txtLastCharIndex+1,S=g[E],A=g[E-1],_=g[E+1],T=k(S)}if(m+1>=u){e.isOverflowing=!0,O(m,E-1);break}if(b=E-1,y=0,v[m+=1]="",this.isBreakingSpace(S))continue;this.canBreakInLastChar(S)||(v=this.trimToBreakable(v),y=this.sumTextWidthByCache(v[m]||"",x)),this.shouldBreakByKinsokuShorui(S,_)&&(v=this.trimByKinsokuShorui(v),y+=k(A||""))}y+=T,v[m]=(v[m]||"")+S}}return v.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&mg.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&mg.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=sl(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+1,o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(a,n.length),e[e.length-2]=n.slice(0,o),e}},{key:"canBreakInLastChar",value:function(t){return!t||!yg.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!yg.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n[t];if("number"!=typeof i){var a=t.length*e;i=r.measureText(t).width+a,n[t]=i}return i}}])}(),wg={},Mg=(Xp=new Ap,Zp=new Sp,Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Up={},Du.FRAGMENT,null),Du.CIRCLE,new wp),Du.ELLIPSE,new Mp),Du.RECT,Xp),Du.IMAGE,Xp),Du.GROUP,new Tp),Du.LINE,new Op),Du.TEXT,new _p(wg)),Du.POLYLINE,Zp),Du.POLYGON,Zp),Jc(Jc(Jc(Up,Du.PATH,new Ep),Du.HTML,new Pp),Du.MESH,null)),Og=function(t){var e=new Md,n=new Sd;return Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(t={},_f.PERCENTAGE,null),_f.NUMBER,new Pd),_f.ANGLE,new kd),_f.DEFINED_PATH,new wd),_f.PAINT,e),_f.COLOR,e),_f.FILTER,new Od),_f.LENGTH,n),_f.LENGTH_PERCENTAGE,n),_f.LENGTH_PERCENTAGE_12,new Ad),Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(t,_f.LENGTH_PERCENTAGE_14,new _d),_f.COORDINATE,new Sd),_f.OFFSET_DISTANCE,new Cd),_f.OPACITY_VALUE,new Ld),_f.PATH,new Nd),_f.LIST_OF_POINTS,new jd),_f.SHADOW_BLUR,new Rd),_f.TEXT,new Id),_f.TEXT_TRANSFORM,new Dd),_f.TRANSFORM,new bp),Jc(Jc(Jc(t,_f.TRANSFORM_ORIGIN,new xp),_f.Z_INDEX,new kp),_f.MARKER,new Td)}();wg.CameraContribution=Of,wg.AnimationTimeline=null,wg.EasingFunction=null,wg.offscreenCanvasCreator=new zp,wg.sceneGraphSelector=new Yp,wg.sceneGraphService=new vg(wg),wg.textService=new kg(wg),wg.geometryUpdaterFactory=Mg,wg.CSSPropertySyntaxFactory=Og,wg.styleValueRegistry=new bd(wg),wg.layoutRegistry=null,wg.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==Zc?Zc:{},wg.enableStyleSyntax=!0,wg.enableSizeAttenuation=!1;var Eg=0,Sg=new Vp(Hp.INSERTED,null,"","","",0,"",""),Ag=new Vp(Hp.REMOVED,null,"","","",0,"",""),_g=new Rp(Hp.DESTROY),Tg=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).entity=Eg++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:Ef.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return dl(e,t),il(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw new Error(Ju)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return wg.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Vd(this)||t.nodeName!==Du.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(Sg.relatedNode=this,t.dispatchEvent(Sg)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return Ag.relatedNode=this,t.dispatchEvent(Ag),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),wg.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return wg.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return wg.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return wg.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return wg.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return wg.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return wg.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return wg.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(wg.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=r[0],o=r.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,sl(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.destroyChildren(),this.dispatchEvent(_g),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return wg.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return wg.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return wg.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return wg.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return wg.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw new Error(Ju)}},{key:"getAttributeNode",value:function(t){throw new Error(Ju)}},{key:"getAttributeNodeNS",value:function(t,e){throw new Error(Ju)}},{key:"hasAttributeNS",value:function(t,e){throw new Error(Ju)}},{key:"removeAttributeNS",value:function(t,e){throw new Error(Ju)}},{key:"removeAttributeNode",value:function(t){throw new Error(Ju)}},{key:"setAttributeNS",value:function(t,e,n){throw new Error(Ju)}},{key:"setAttributeNode",value:function(t){throw new Error(Ju)}},{key:"setAttributeNodeNS",value:function(t){throw new Error(Ju)}},{key:"toggleAttribute",value:function(t,e){throw new Error(Ju)}}])}(Bp);function Pg(t){return!(null==t||!t.nodeName)}var Cg=wg.globalThis.Proxy?wg.globalThis.Proxy:function(){},Lg=new Vp(Hp.ATTR_MODIFIED,null,null,null,null,Vp.MODIFICATION,null,null),Ng=Xt(),jg=me(),Rg=function(t){function e(t){var n;return nl(this,e),(n=fl(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||Du.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),wg.enableStyleSyntax&&(n.style=new Cg({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return dl(e,t),il(e,[{key:"destroy",value:function(){yl(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=el({},this.attributes);for(var r in n){var i=n[r];Pg(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor(el(el({},this.config),{},{style:n}));return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};wg.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0}),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];Y(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),yl(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t];wg.styleValueRegistry.processProperties(this,Jc({},t,e),n),r.dirty=!0;var o,s=this.parsedStyle[t];(this.isConnected&&(Lg.relatedNode=this,Lg.prevValue=i,Lg.newValue=e,Lg.attrName=t,Lg.prevParsedValue=a,Lg.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Lg):(Lg.target=this,this.ownerDocument.defaultView.dispatchEvent(Lg,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(o=this.attributeChangedCallback)||void 0===o||o.call(this,t,i,e,a,s))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=pl(t.getMin(),2),n=e[0],r=e[1],i=pl(t.getMax(),2),a=i[0],o=i[1];return new Qu(n,r,a-n,o-r)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.setOrigin(this,rf(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return wg.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.setPosition(this,rf(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.setLocalPosition(this,rf(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.translate(this,rf(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return wg.sceneGraphService.translateLocal(this,rf(t,e,n,!1)),this}},{key:"getPosition",value:function(){return wg.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return wg.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=rf(t,e=e||t,n=n||t,!1)),wg.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=rf(t,e=e||t,n=n||t,!1)),wg.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return wg.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return wg.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return cf(pl(uf(Ng,wg.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return cf(pl(uf(Ng,wg.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return wg.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return wg.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return b(e)&&b(n)?wg.sceneGraphService.rotateLocal(this,0,0,t):wg.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return b(e)&&b(n)?wg.sceneGraphService.rotate(this,0,0,t):wg.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return wg.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return wg.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return wg.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return wg.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return wg.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return wg.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return wg.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return wg.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return wg.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){wg.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,sl(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,sl(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?k(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=pl(Nt(Ng,e),2),r=n[0],i=n[1],a=pl(jt(Ng,e),2),o=a[0],s=a[1],c=Rt(jg,e),l=pl(uf(Ng,c),3),u=l[0],f=l[2];return ff(u||f,r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=pl(hf(t),5),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];this.setEulerAngles(o).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=pl(hf(t),5),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];this.setLocalEulerAngles(o).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Tg);Rg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Ig=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nl(this,e),fl(this,e,[el({type:Du.CIRCLE},t)])}return dl(e,t),il(e)}(Rg);Ig.PARSED_STYLE_LIST=new Set([].concat(sl(Rg.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var Dg=["style"],Bg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ju(n,Dg);return nl(this,e),(t=fl(this,e,[el({style:r},i)])).isCustomElement=!0,t}return dl(e,t),il(e)}(Rg);Bg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Fg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nl(this,e),fl(this,e,[el({type:Du.ELLIPSE},t)])}return dl(e,t),il(e)}(Rg);Fg.PARSED_STYLE_LIST=new Set([].concat(sl(Rg.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"])),(function(t){function e(){return nl(this,e),fl(this,e,[{type:Du.FRAGMENT}])}return dl(e,t),il(e)}(Rg)).PARSED_STYLE_LIST=new Set(["class","className"]);var zg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nl(this,e),fl(this,e,[el({type:Du.GROUP},t)])}return dl(e,t),il(e)}(Rg);zg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Gg=["style"],Wg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ju(n,Gg);return nl(this,e),(t=fl(this,e,[el({type:Du.HTML,style:r},i)])).cullable.enable=!1,t}return dl(e,t),il(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=bt(ht(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!qu.isEmpty(e)){var n=new qu;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Rg);Wg.PARSED_STYLE_LIST=new Set([].concat(sl(Rg.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var $g=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nl(this,e),fl(this,e,[el({type:Du.IMAGE},t)])}return dl(e,t),il(e)}(Rg);$g.PARSED_STYLE_LIST=new Set([].concat(sl(Rg.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var Yg=["style"],Hg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ju(n,Yg);nl(this,e),(t=fl(this,e,[el({type:Du.LINE,style:el({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd;return o&&Pg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),s&&Pg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return dl(e,t),il(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Pg(r)&&(this.markerStartAngle=0,r.remove()),i&&Pg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Pg(r)&&(this.markerEndAngle=0,r.remove()),i&&Pg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=e.x1,s=e.x2,c=e.y1,l=e.y2,u=t?n:r;if(u&&Pg(u)){var f,h,d,p,g,v,m;t?(p=o,g=c,h=s-o,d=l-c,v=i||0,m=this.markerStartAngle):(p=s,g=l,h=o-s,d=c-l,v=a||0,m=this.markerEndAngle),f=Math.atan2(d,h),u.setLocalEulerAngles(180*f/Math.PI+m),u.setLocalPosition(p+Math.cos(f)*v,g+Math.sin(f)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=bu(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=ce(Xt(),Qt(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Ku(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return yu(t.x1,t.y1,t.x2,t.y2)}}])}(Rg);Hg.PARSED_STYLE_LIST=new Set([].concat(sl(Rg.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Vg=["style"],qg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ju(n,Vg);nl(this,e),(t=fl(this,e,[el({type:Du.PATH,style:r,initialParsedStyle:{miterLimit:4,d:el({},Af)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd,c=a.markerMid;return o&&Pg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),c&&Pg(c)&&t.placeMarkerMid(c),s&&Pg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return dl(e,t),il(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Pg(r)&&(this.markerStartAngle=0,r.remove()),i&&Pg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Pg(r)&&(this.markerEndAngle=0,r.remove()),i&&Pg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=t?n:r;if(o&&Pg(o)){var s,c,l,u,f,h,d;if(t){var p=pl(this.getStartTangent(),2),g=p[0],v=p[1];u=v[0],f=v[1],c=g[0]-v[0],l=g[1]-v[1],h=i||0,d=this.markerStartAngle}else{var m=pl(this.getEndTangent(),2),y=m[0],b=m[1];u=b[0],f=b[1],c=y[0]-b[0],l=y[1]-b[1],h=a||0,d=this.markerEndAngle}s=Math.atan2(l,c),o.setLocalEulerAngles(180*s/Math.PI+d),o.setLocalPosition(u+Math.cos(s)*h,f+Math.sin(s)*h)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Pg(t))for(var n=1;n<e.length-1;n++){var r=pl(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return Nh(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return yn(t,e,Pe(Pe({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=ce(Xt(),Qt(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Ku(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Nh(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Rg);qg.PARSED_STYLE_LIST=new Set([].concat(sl(Rg.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Ug=["style"],Xg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=ju(n,Ug);nl(this,e),(t=fl(this,e,[el({type:Du.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var a=t.parsedStyle,o=a.markerStart,s=a.markerEnd,c=a.markerMid;return o&&Pg(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),c&&Pg(c)&&t.placeMarkerMid(c),s&&Pg(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return dl(e,t),il(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Pg(r)&&(this.markerStartAngle=0,r.remove()),i&&Pg(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Pg(r)&&(this.markerEndAngle=0,r.remove()),i&&Pg(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=(e.points||{}).points,s=t?n:r;if(s&&Pg(s)&&o){var c,l,u,f,h,d,p;if(f=o[0][0],h=o[0][1],t)l=o[1][0]-o[0][0],u=o[1][1]-o[0][1],d=i||0,p=this.markerStartAngle;else{var g=o.length;this.parsedStyle.isClosed?(l=o[g-1][0]-o[0][0],u=o[g-1][1]-o[0][1]):(f=o[g-1][0],h=o[g-1][1],l=o[g-2][0]-o[g-1][0],u=o[g-2][1]-o[g-1][1]),d=a||0,p=this.markerEndAngle}c=Math.atan2(u,l),s.setLocalEulerAngles(180*c/Math.PI+p),s.setLocalPosition(f+Math.cos(c)*d,h+Math.sin(c)*d)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Pg(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Rg);Xg.PARSED_STYLE_LIST=new Set([].concat(sl(Rg.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Zg=["style"],Kg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=ju(t,Zg);return nl(this,e),fl(this,e,[el({type:Du.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return dl(e,t),il(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Eu(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=yu(t[0],t[1],n[e+1][0],n[e+1][1]),o+=i,r[1]=o/s,a.push(r))})),this.parsedStyle.points.segments=a}var c=0,l=0;this.parsedStyle.points.segments.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(c=(t-e[0])/(e[1]-e[0]),l=n)}));var u=bu(n[l][0],n[l][1],n[l+1][0],n[l+1][1],c),f=u.x,h=u.y,d=ce(Xt(),Qt(f,h,0),e?this.getWorldTransform():this.getLocalTransform());return new Ku(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(Xg);Kg.PARSED_STYLE_LIST=new Set([].concat(sl(Xg.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var Qg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nl(this,e),fl(this,e,[el({type:Du.RECT},t)])}return dl(e,t),il(e)}(Rg);Qg.PARSED_STYLE_LIST=new Set([].concat(sl(Rg.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Jg=["style"],tv=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=ju(t,Jg);return nl(this,e),fl(this,e,[el({type:Du.TEXT,style:el({fill:"black"},n)},r)])}return dl(e,t),il(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Rg);tv.PARSED_STYLE_LIST=new Set([].concat(sl(Rg.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var ev=function(){return il((function t(){nl(this,t),this.registry={},this.define(Du.CIRCLE,Ig),this.define(Du.ELLIPSE,Fg),this.define(Du.RECT,Qg),this.define(Du.IMAGE,$g),this.define(Du.LINE,Hg),this.define(Du.GROUP,zg),this.define(Du.PATH,qg),this.define(Du.POLYGON,Xg),this.define(Du.POLYLINE,Kg),this.define(Du.TEXT,tv),this.define(Du.HTML,Wg)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),nv=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,a=t.syntax;wg.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:a})},rv=function(t){function e(){var t;nl(this,e),(t=fl(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new wg.AnimationTimeline(t)}catch(t){}var n={};return vd.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=y(i)?i(Du.GROUP):i)})),t.documentElement=new zg({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return dl(e,t),il(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?tv:zg);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(Ju)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),a=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(r<0||i<0||r>o||i>s)return null;var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement}},{key:"elementFromPoint",value:(r=Lu(Pu().mark((function t(e,n){var r,i,a,o,s,c,l,u,f,h,d;return Pu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,c=o.height,!(i<0||a<0||i>s||a>c)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,d=h.picked,t.abrupt("return",d&&d[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(r<0||i<0||r>o||i>s)return[];var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f}},{key:"elementsFromPoint",value:(n=Lu(Pu().mark((function t(e,n){var r,i,a,o,s,c,l,u,f,h,d;return Pu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,c=o.height,!(i<0||a<0||i>s||a>c)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,(d=h.picked)[d.length-1]!==this.documentElement&&d.push(this.documentElement),t.abrupt("return",d);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(tf)}},{key:"insertBefore",value:function(t,e){throw new Error(tf)}},{key:"removeChild",value:function(t,e){throw new Error(tf)}},{key:"replaceChild",value:function(t,e,n){throw new Error(tf)}},{key:"append",value:function(){throw new Error(tf)}},{key:"prepend",value:function(){throw new Error(tf)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Bp),iv=function(){function t(e){nl(this,t),this.strategies=e}return il(t,[{key:"apply",value:function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,a=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===a.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=a.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new Rp(Hp.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();iv.tag="Culling";var av=function(){function t(){var e=this;nl(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Np(null),this.rootWheelEvent=new jp(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=Nu(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e.bootstrapEvent(e.rootPointerEvent,o,r,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=Nu(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=r.value,s=e.bootstrapEvent(e.rootPointerEvent,o,i,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return il(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=Nu(e);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=n.bootstrapEvent(n.rootPointerEvent,o,i,t);n.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=Nu(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=e.value,c=n.bootstrapEvent(n.rootPointerEvent,s,i,t);c.type+=a,n.context.eventService.mapEvent(c)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=Nu(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=e.value,o=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(o)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.x,o=i.y;t.viewport.x=a,t.viewport.y=o;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Yd[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var a=this.context.eventService.viewport2Canvas(e.viewport),o=a.x,s=a.y;return e.canvas.x=o,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Hd.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];Y(i.button)&&(i.button=0),Y(i.buttons)&&(i.buttons=1),Y(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Y(i.width)&&(i.width=i.radiusX||1),Y(i.height)&&(i.height=i.radiusY||1),Y(i.tiltX)&&(i.tiltX=0),Y(i.tiltY)&&(i.tiltY=0),Y(i.pointerType)&&(i.pointerType="touch"),Y(i.pointerId)&&(i.pointerId=i.identifier||0),Y(i.pressure)&&(i.pressure=i.force||.5),Y(i.twist)&&(i.twist=0),Y(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;Y(a.isPrimary)&&(a.isPrimary=!0),Y(a.width)&&(a.width=1),Y(a.height)&&(a.height=1),Y(a.tiltX)&&(a.tiltX=0),Y(a.tiltY)&&(a.tiltY=0),Y(a.pointerType)&&(a.pointerType="mouse"),Y(a.pointerId)&&(a.pointerId=1),Y(a.pressure)&&(a.pressure=.5),Y(a.twist)&&(a.twist=0),Y(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();av.tag="Event";var ov=[Du.CIRCLE,Du.ELLIPSE,Du.IMAGE,Du.RECT,Du.LINE,Du.POLYLINE,Du.POLYGON,Du.TEXT,Du.PATH,Du.HTML],sv=function(){return il((function t(){nl(this,t)}),[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(qu.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||Xu.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==Xu.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===Xu.OUTSIDE||n===Xu.INSIDE)return n;for(var i=Xu.INSIDE,a=ov.indexOf(t.nodeName)>-1,o=0,s=r.length;o<s;++o){var c=1<<o;if(n&c&&(!a||4!==o&&5!==o)){var l=r[o],u=l.normal,f=l.distance;if(ae(u,e.getPositiveFarPoint(r[o]))+f<0)return Xu.OUTSIDE;ae(u,e.getNegativeFarPoint(r[o]))+f<0&&(i|=c)}}return i}}])}(),cv=function(){function t(){nl(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return il(t,[{key:"apply",value:function(e){var n,r=this,i=e.renderingService,a=e.renderingContext,o=e.rBushRoot,s=a.root.ownerDocument.defaultView;this.rBush=o;var c=function(t){t.target.renderable.dirty=!0,i.dirtify()},l=function(t){r.syncTasks.set(t.target,t.detail.affectChildren),i.dirtify()},u=function(t){var e=t.target;wg.enableSizeAttenuation&&wg.styleValueRegistry.updateSizeAttenuation(e,s.getCamera().getZoom())},f=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.syncTasks.delete(e),wg.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){s.addEventListener(Hp.MOUNTED,u),s.addEventListener(Hp.UNMOUNTED,f),s.addEventListener(Hp.ATTR_MODIFIED,c),s.addEventListener(Hp.BOUNDS_CHANGED,l)})),i.hooks.destroy.tap(t.tag,(function(){s.removeEventListener(Hp.MOUNTED,u),s.removeEventListener(Hp.UNMOUNTED,f),s.removeEventListener(Hp.ATTR_MODIFIED,c),s.removeEventListener(Hp.BOUNDS_CHANGED,l),r.syncTasks.clear()}));var h=null!==(n=wg.globalThis.requestIdleCallback)&&void 0!==n?n:rp.bind(wg.globalThis);i.hooks.endFrame.tap(t.tag,(function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,h((function(){r.syncRTree(!0),r.isFirstTimeRenderingFinished=!0}))):r.syncRTree()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new qu),i.dirtyRenderBounds.update(r.center,r.halfExtents));var a=pl(r.getMin(),2),o=a[0],s=a[1],c=pl(r.getMax(),2),l=c[0],u=c[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=o,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=u}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var a=t.syncNode(i,e);a&&(n.push(a),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();cv.tag="Prepare";var lv=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),uv=new Rp(Hp.MOUNTED),fv=new Rp(Hp.UNMOUNTED),hv=new Rp(lv.BEFORE_RENDER),dv=new Rp(lv.RERENDER),pv=new Rp(lv.AFTER_RENDER),gv=function(t){function e(t){var n;nl(this,e),(n=fl(this,e)).Element=Rg,n.inited=!1,n.context={};var r=t.container,i=t.canvas,a=t.renderer,o=t.width,s=t.height,c=t.background,l=t.cursor,u=t.supportsMutipleCanvasesInOneContainer,f=t.cleanUpOnDestroy,h=void 0===f||f,d=t.offscreenCanvas,p=t.devicePixelRatio,g=t.requestAnimationFrame,v=t.cancelAnimationFrame,m=t.createImage,y=t.supportsTouchEvents,b=t.supportsPointerEvents,x=t.isTouchEvent,k=t.isMouseEvent,w=t.dblClickSpeed,M=o,O=s,E=p||Fd&&window.devicePixelRatio||1;return E=E>=1?Math.ceil(E):1,i&&(M=o||function(t){var e=$d(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/E,O=s||function(t){var e=$d(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/E),n.customElements=new ev,n.devicePixelRatio=E,n.requestAnimationFrame=null!=g?g:rp.bind(wg.globalThis),n.cancelAnimationFrame=null!=v?v:ip.bind(wg.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in wg.globalThis,n.supportsPointerEvents=null!=b?b:!!wg.globalThis.PointerEvent,n.isTouchEvent=null!=x?x:function(t){return n.supportsTouchEvents&&t instanceof wg.globalThis.TouchEvent},n.isMouseEvent=null!=k?k:function(t){return!wg.globalThis.MouseEvent||t instanceof wg.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof wg.globalThis.PointerEvent))},d&&(wg.offscreenCanvas=d),n.document=new rv,n.document.defaultView=n,u||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;Bd.has(r)&&Bd.get(r).destroy(n),Bd.set(r,e)}}(r,n,h),n.initRenderingContext(el(el({},t),{},{width:M,height:O,background:null!=c?c:"transparent",cursor:null!=l?l:"default",cleanUpOnDestroy:h,devicePixelRatio:E,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=w?w:200,createImage:null!=m?m:function(){return new window.Image}})),n.initDefaultCamera(M,O,a.clipSpaceNearZ),n.initRenderer(a,!0),n}return dl(e,t),il(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new wg.CameraContribution;i.clipSpaceNearZ=n,i.setType(bf.EXPLORING,xf.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(wf,(function(){r.context.renderingContext.renderReasons.add(Gp.CAMERA_CHANGED),wg.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){wg.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;Tf.clearCache(),e||this.dispatchEvent(new Rp(lv.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();t&&(this.unmountChildren(n),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),e||this.dispatchEvent(new Rp(lv.AFTER_DESTROY));var r=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};r(uv),r(fv),r(hv),r(dv),r(pv),r(Lg),r(Sg),r(Ag),r(_g)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===kf.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Rp(lv.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(hv.detail=t,pv.detail=t),this.dispatchEvent(hv),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(dv)})),this.dispatchEvent(pv)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Iu,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new av,new cv,new iv([new sv])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(el(el({},wg),this.context)),this.context.renderingService=new Wp(wg,this.context),this.context.eventService=new Fp(wg,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)})).catch((function(t){console.error(t)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new Rp(lv.READY))})):e.dispatchEvent(new Rp(lv.READY)):e.dispatchEvent(new Rp(lv.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(wg)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),sl((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(wg)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(fv):(fv.target=t,this.dispatchEvent(fv,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vd(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(uv):(uv.target=t,this.dispatchEvent(uv,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Dp),vv=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).landmarks=[],t}return dl(e,t),il(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=ef(e),this.relAzimuth=ef(t),this.relRoll=ef(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===bf.EXPLORING){var r=ye(me(),[1,0,0],of((this.rotateWorld?1:-1)*this.relElevation)),i=ye(me(),[0,1,0],of((this.rotateWorld?1:-1)*this.relAzimuth)),a=ye(me(),[0,0,1],of(this.relRoll)),o=be(me(),i,r);o=be(me(),o,a);var s=Dt(ht(),o);wt(this.matrix,this.matrix,[0,0,-this.distance]),kt(this.matrix,this.matrix,s),wt(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===bf.ORBITING||this.type===bf.EXPLORING?this._getPosition():this.type===bf.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=rf(t,e,0),r=Zt(this.position);return ee(r,r,re(Xt(),this.right,n[0])),ee(r,r,re(Xt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=Zt(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===bf.ORBITING||this.type===bf.EXPLORING?this._getDistance():this.type===bf.TRACKING&&ee(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,c=a.focalPoint,l=void 0===c?this.focalPoint:c,u=a.roll,f=a.zoom,h=new wg.CameraContribution;h.setType(this.type,void 0),h.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),h.setFocalPoint(l[0],null!==(r=l[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=l[2])&&void 0!==i?i:this.focalPoint[2]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:dt(h.getWorldTransform()),right:Zt(h.right),up:Zt(h.up),forward:Zt(h.forward),position:Zt(h.getPosition()),focalPoint:Zt(h.getFocalPoint()),distanceVector:Zt(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=L(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=R(n)?{duration:n}:n,a=i.easing,o=void 0===a?"linear":a,s=i.duration,c=void 0===s?100:s,l=i.easingFunction,u=void 0===l?void 0:l,f=i.onfinish,h=void 0===f?void 0:f,d=i.onframe,p=void 0===d?void 0:d;this.cancelLandmarkAnimation();var g,v=r.position,m=r.focalPoint,y=r.zoom,b=r.roll,x=u||wg.EasingFunction(o),k=function(){e.setFocalPoint(m),e.setPosition(v),e.setRoll(b),e.setZoom(y),e.computeMatrix(),e.triggerUpdate(),null==h||h()};if(0===c)return k();var w=function(t){void 0===g&&(g=t);var n=t-g;if(n>=c)k();else{var r,i,a=x(n/c),o=Xt(),s=Xt();if(se(o,e.focalPoint,m,a),se(s,e.position,v,a),i=e.roll*(1-a)+b*a,r=e.zoom*(1-a)+y*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(i),e.setZoom(r),he(o,m)+he(s,v)<=.01&&void 0===y&&void 0===b)return k();e.computeMatrix(),e.triggerUpdate(),n<c&&(null==p||p(a),e.landmarkAnimationID=e.canvas.requestAnimationFrame(w))}};this.canvas.requestAnimationFrame(w)}}}])}(Of);wg.CameraContribution=vv;
2
2
  /*!
3
3
  * @antv/g-web-animations-api
4
4
  * @description A simple implementation of Web Animations API.
5
- * @version 2.1.14
6
- * @date 11/27/2024, 2:18:02 PM
5
+ * @version 2.1.20
6
+ * @date 1/17/2025, 2:07:41 PM
7
7
  * @author AntVis
8
8
  * @docs https://g.antv.antgroup.com/
9
9
  */
10
- var mv=function(t){function e(t,n,r,i){var a;return el(this,e),(a=ul(this,e,[t])).currentTime=r,a.timelineTime=i,a.target=n,a.type="finish",a.bubbles=!1,a.currentTarget=n,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=r,a.timelineTime=i,a}return hl(e,t),rl(e)}(Cp),yv=0,bv=function(){return rl((function t(e,n){var r;el(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(yv++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}),[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new mv(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}}},{key:"persist",value:function(){throw new Error(Qu)}},{key:"addEventListener",value:function(t,e,n){throw new Error(Qu)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(Qu)}},{key:"dispatchEvent",value:function(t){throw new Error(Qu)}},{key:"commitStyles",value:function(){throw new Error(Qu)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new mv(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new mv(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),xv=.1,kv="function"==typeof Float32Array,wv=function(t,e){return 1-3*e+3*t},Mv=function(t,e){return 3*e-6*t},Ov=function(t){return 3*t},Ev=function(t,e,n){return((wv(e,n)*t+Mv(e,n))*t+Ov(e))*t},Sv=function(t,e,n){return 3*wv(e,n)*t*t+2*Mv(e,n)*t+Ov(e)},Av=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=kv?new Float32Array(11):new Array(11),a=0;a<11;++a)i[a]=Ev(a*xv,t,n);var o=function(e){for(var r=0,a=1;10!==a&&i[a]<=e;++a)r+=xv;--a;var o=r+(e-i[a])/(i[a+1]-i[a])*xv,s=Sv(o,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var a=Sv(e,n,r);if(0===a)return e;e-=(Ev(e,n,r)-t)/a}return e}(e,o,t,n):0===s?o:function(t,e,n,r,i){var a,o,s=0;do{(a=Ev(o=e+(n-e)/2,r,i)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&++s<10);return o}(e,r,r+xv,t,n)};return function(t){return 0===t||1===t?t:Ev(o(t),e,r)}},_v=function(t){return Math.pow(t,2)},Tv=function(t){return Math.pow(t,3)},Pv=function(t){return Math.pow(t,4)},Cv=function(t){return Math.pow(t,5)},Lv=function(t){return Math.pow(t,6)},Nv=function(t){return 1-Math.cos(t*Math.PI/2)},jv=function(t){return 1-Math.sqrt(1-t*t)},Rv=function(t){return t*t*(3*t-2)},Iv=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Dv=function(t){var e=dl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?1:n,i=e[1],a=void 0===i?.5:i,o=N(Number(r),1,10),s=N(Number(a),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-s/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/s)},Bv=function(t){var e=arguments.length>2?arguments[2]:void 0,n=dl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,a=n[1],o=void 0===a?100:a,s=n[2],c=void 0===s?10:s,l=n[3],u=void 0===l?0:l;i=N(i,.1,1e3),o=N(o,.1,1e3),c=N(c,.1,1e3),u=N(u,.1,1e3);var f=Math.sqrt(o/i),h=c/(2*Math.sqrt(o*i)),d=h<1?f*Math.sqrt(1-h*h):0,p=h<1?(h*f-u)/d:-u+f,g=e?e*t/1e3:t;return g=h<1?Math.exp(-g*h*f)*(1*Math.cos(d*g)+p*Math.sin(d*g)):(1+p*g)*Math.exp(-g*f),0===t||1===t?t:1-g},Fv=function(t){var e=dl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(N(t,0,1)*r)/r},zv=function(t){var e=dl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=e[1],i=e[2],a=e[3];return Av(n,r,i,a)(t)},Gv=Av(.42,0,1,1),Wv=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},$v=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Yv=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Hv={steps:Fv,"step-start":function(t){return Fv(t,[1,"start"])},"step-end":function(t){return Fv(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":zv,ease:function(t){return zv(t,[.25,.1,.25,1])},in:Gv,out:Wv(Gv),"in-out":$v(Gv),"out-in":Yv(Gv),"in-quad":_v,"out-quad":Wv(_v),"in-out-quad":$v(_v),"out-in-quad":Yv(_v),"in-cubic":Tv,"out-cubic":Wv(Tv),"in-out-cubic":$v(Tv),"out-in-cubic":Yv(Tv),"in-quart":Pv,"out-quart":Wv(Pv),"in-out-quart":$v(Pv),"out-in-quart":Yv(Pv),"in-quint":Cv,"out-quint":Wv(Cv),"in-out-quint":$v(Cv),"out-in-quint":Yv(Cv),"in-expo":Lv,"out-expo":Wv(Lv),"in-out-expo":$v(Lv),"out-in-expo":Yv(Lv),"in-sine":Nv,"out-sine":Wv(Nv),"in-out-sine":$v(Nv),"out-in-sine":Yv(Nv),"in-circ":jv,"out-circ":Wv(jv),"in-out-circ":$v(jv),"out-in-circ":Yv(jv),"in-back":Rv,"out-back":Wv(Rv),"in-out-back":$v(Rv),"out-in-back":Yv(Rv),"in-bounce":Iv,"out-bounce":Wv(Iv),"in-out-bounce":$v(Iv),"out-in-bounce":Yv(Iv),"in-elastic":Dv,"out-elastic":Wv(Dv),"in-out-elastic":$v(Dv),"out-in-elastic":Yv(Dv),spring:Bv,"spring-in":Bv,"spring-out":Wv(Bv),"spring-in-out":$v(Bv),"spring-out-in":Yv(Bv)},Vv=function(t){return t};function qv(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Uv="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Xv=new RegExp("cubic-bezier\\(".concat(Uv,",").concat(Uv,",").concat(Uv,",").concat(Uv,"\\)")),Zv=/steps\(\s*(\d+)\s*\)/,Kv=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Qv(t){var e=Xv.exec(t);if(e)return Av.apply(void 0,ol(e.slice(1).map(Number)));var n=Zv.exec(t);if(n)return qv(Number(n[1]),0);var r=Kv.exec(t);return r?qv(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):Hv[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Hv.linear}function Jv(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function tm(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,r,i){var a=i;return 0===t?1!==e&&(a+=n):a+=r/t,a}(a,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,a){var o=t===1/0?e%1:t%1;return 0!==o||2!==n||0===r||0===i&&0!==a||(o=1),o}(o,n.iterationStart,r,n.iterations,i,a),c=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,o),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function em(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(nm(i)){var a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Qv(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(a)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],a=0;a<i.length-1;a++){var o=a,s=a+1,c=i[o].computedOffset,l=i[s].computedOffset,u=c,f=l;0===a&&(u=-1/0,0===l&&(s=o)),a===i.length-2&&(f=1/0,1===c&&(o=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:r,interpolation:im(r,i[o].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,a=0===i?0:r/i;t.setAttribute(n.property,n.interpolation(a),!1,!1)}));else for(var n in r)nm(n)&&t.setAttribute(n,null)}}function nm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var rm=function(t,e,n){return function(r){var i=am(t,e,r);return j(i)?i:n(i)}};function im(t,e,n,r){var i=md[t];if(i&&i.syntax&&i.int){var a=wg.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var o=a.parser,s=o?o(e,r):e,c=o?o(n,r):n,l=a.mixer(s,c,r);if(l){var u=rm.apply(void 0,ol(l));return function(t){return 0===t?e:1===t?n:u(t)}}}}return rm(!1,!0,(function(t){return t?n:e}))}function am(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,a=Math.max(r,i),o=[],s=0;s<a;s++)o.push(am(t[s<r?s:r-1],e[s<i?s:i-1],n));return o}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var om=function(){return rl((function t(){el(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Vv,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}),[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Qv(t),this._easing=t}}])}();function sm(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,a=0;a<i;a++){if(!e[a]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),e[a]=o}void 0!==r[a]&&null!==r[a]&&(e[a][n]=r[a])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in null!=e&&e.composite&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,a=0;a<n.length;a++){var o=n[a].offset;if(y(o))r=!1;else{if(o<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=o}}return n=n.filter((function(t){return Number(t.offset)>=0&&Number(t.offset)<=1})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,a=Number(n[0].computedOffset),o=1;o<r;o++){var s=n[o].computedOffset;if(!y(s)&&!y(a)){for(var c=1;c<o-i;c++)n[i+c].computedOffset=a+(Number(s)-a)*c/(o-i);i=o,a=Number(s)}}}(),n}var cm="backwards|forwards|both|none".split("|"),lm="reverse|alternate|alternate-reverse".split("|");function um(t,e){var n;return function(t,e){var n=new om;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===cm.indexOf(t[e]))return;if("direction"===e&&-1===lm.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}var fm=function(){return rl((function t(e,n,r){var i=this;el(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=um(r,!1),this.timing.effect=this,this.timing.activeDuration=Jv(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=sm(n,this.timing),this.interpolations=em(this.normalizedKeyframes,this.timing,this.target);var a=wg.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}),[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=tm(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=sm(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))}}])}();function hm(t,e){return Number(t.id)-Number(e.id)}var dm=function(){return rl((function t(e){var n=this;el(this,t),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(hm),n.animations=n.tick(t,!0,n.animations)[0],e.forEach((function(e){e[1](t)})),n.applyPendingEffects()},this.document=e}),[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new fm(t,e,n),i=new bv(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(hm),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))}},{key:"tick",value:function(t,e,n){var r,i,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var o=[],s=[],c=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(o.push(n.effect),n.unmarkTarget()),n._needsTick&&(a.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,o),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]}}])}();function pm(t){return new gm([t],null,t,t.ownerDocument)}wg.EasingFunction=Qv,wg.AnimationTimeline=dm;class gm{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],a=[],o=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new gm(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new gm(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new gm([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,a]=Array.isArray(r)?r:[r,null],o=e(i,t);o.__data__=i,null!==a&&(o.__fromElements__=a),this._parent.appendChild(o),n.push(o)}return new gm(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new gm(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new gm([i],null,this._parent,this._document);const a="string"==typeof e?this.createElement(e):e();return a.id=t,n&&(a.className=n),r.appendChild(a),new gm([a],null,this._parent,this._document)}data(t,e=t=>t,n=()=>null){const r=[],i=[],a=new Set(this._elements),o=[],s=new Set,c=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),l=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),u=Un(this._elements,(t=>n(t.__data__)));for(let f=0;f<t.length;f++){const h=t[f],d=e(h,f),p=n(h,f);if(c.has(d)){const t=c.get(d);t.__data__=h,t.__facet__=!1,i.push(t),a.delete(t),c.delete(d)}else if(l.has(d)){const t=l.get(d);t.__data__=h,t.__facet__=!0,i.push(t),l.delete(d)}else if(u.has(d)){const t=u.get(d);o.push([h,t]);for(const e of t)a.delete(e);u.delete(d)}else if(c.has(p)){const t=c.get(p);t.__toData__?t.__toData__.push(h):t.__toData__=[h],s.add(t),a.delete(t)}else r.push(h)}const f=[new gm([],r,this._parent,this._document),new gm(i,null,this._parent,this._document),new gm(a,null,this._parent,this._document),new gm([],o,this._parent,this._document),new gm(s,null,this._parent,this._document)];return new gm(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new gm(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=gm.registry[t];return e?new e:Or(`Unknown node type: ${t}`)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){const a=t(this._enter),o=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return o.merge(a).merge(s).merge(c).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(e){const n=Array.isArray(e)?e:[e];Promise.all(n.map((t=>t.finished))).then((()=>{this._elements[t].remove()}))}else{this._elements[t].remove()}}return new gm([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,a){void 0!==e&&(a[t]=n(r,i,a))}))}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,a){void 0!==e&&(a.style[t]=n(r,i,a))}))}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each((function(t,r,i){n[r]=e(t,r,i)}))}on(t,e){return this.each((function(n,r,i){i.addEventListener(t,e)})),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function vm(t,e,n){return Math.max(e,Math.min(t,n))}function mm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function ym(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function bm(t,e,n,r,i){const a=ys(gs(r,e))+Math.PI,o=ys(gs(r,n))+Math.PI;return t.arc(r[0],r[1],i,a,o,o-a<0),t}function xm(t,e,n,r="y",i="between",a=!1){const o="y"===r||!0===r?n:e,s=((t,e)=>"y"===t||!0===t?e?180:90:e?90:0)(r,a),c=Ir(o),[l,u]=$n(c,(t=>o[t])),f=new oo({domain:[l,u],range:[0,100]}),h=t=>j(o[t])&&!Number.isNaN(o[t])?f.map(o[t]):0,d={between:e=>`${t[e]} ${h(e)}%`,start:e=>0===e?`${t[e]} ${h(e)}%`:`${t[e-1]} ${h(e)}%, ${t[e]} ${h(e)}%`,end:e=>e===t.length-1?`${t[e]} ${h(e)}%`:`${t[e]} ${h(e)}%, ${t[e+1]} ${h(e)}%`};return`linear-gradient(${s}deg, ${c.sort(((t,e)=>h(t)-h(e))).map(d[i]||d.between).join(",")})`}function km(t){const[e,n,r,i]=t;return[i,e,n,r]}function wm(t,e,n){const[r,i,,a]=zc(t)?km(e):e,[o,s]=n,c=t.getCenter(),l=bs(gs(r,c)),u=bs(gs(i,c)),f=u===l&&o!==s?u+2*Math.PI:u;return{startAngle:l,endAngle:f-l>=0?f:2*Math.PI+f,innerRadius:ms(a,c),outerRadius:ms(r,c)}}function Mm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Om(t,e){if(!Gc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Em(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,a,o=0]]=t;return[(e+i)/2,(n+a)/2,(r+o)/2]}function Sm(t,e,n,r,i={}){const{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:c=a,insetRight:l=a,insetBottom:u=a,radiusBottomLeft:f=o,radiusBottomRight:h=o,radiusTopLeft:d=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:v=1/0,minHeight:m=-1/0}=i,y=Pe(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Gc(r)&&!$c(r)){const n=!!zc(r),[i,,a]=n?km(e):e,[o,b]=i,[x,k]=gs(a,i),w=(x>0?o:o+x)+s,M=(k>0?b:b+k)+c,O=Math.abs(x)-(s+l),E=Math.abs(k)-(c+u),S=n?vm(O,m,1/0):vm(O,g,v),A=n?vm(E,g,v):vm(E,m,1/0),_=n?w:w-(S-O)/2,T=n?M-(A-E)/2:M-(A-E);return pm(t.createElement("rect",{})).style("x",_).style("y",T).style("width",S).style("height",A).style("radius",[d,p,h,f]).call(ym,y).node()}const{y:b,y1:x}=n,k=r.getCenter(),w=wm(r,e,[b,x]),M=ac().cornerRadius(o).padAngle(a*Math.PI/180);return pm(t.createElement("path",{})).style("d",M(w)).style("transform",`translate(${k[0]}, ${k[1]})`).style("radius",o).style("inset",a).call(ym,y).node()}gm.registry={g:zg,rect:Qg,circle:Ig,path:qg,text:tv,ellipse:Fg,image:$g,line:Hg,polygon:Xg,polyline:Kg,html:Wg};const Am=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:a=!0}=t,o=Pe(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=Pe(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:v=g,radiusTopRight:m=g,radiusBottomRight:y=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:k=x,innerRadiusTopRight:w=x,innerRadiusBottomRight:M=x,innerRadiusBottomLeft:O=x,lineWidth:E=("stroke"===n||p?d:0),inset:S=0,insetLeft:A=S,insetRight:_=S,insetBottom:T=S,insetTop:P=S,minWidth:C,maxWidth:L,minHeight:N}=o,j=Pe(o,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,D=[i?v:k,i?m:w,a?y:M,a?b:O],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];zc(s)&&B.push(B.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map(((t,e)=>[t,D[e]])))),{inset:S,insetLeft:A,insetRight:_,insetBottom:T,insetTop:P,minWidth:C,maxWidth:L,minHeight:N});return pm(Sm(c,e,r,s,F)).call(ym,h).style("fill","transparent").style(n,R).style(Mm(t),I).style("lineWidth",E).style("stroke",void 0===p?R:p).call(ym,j).node()}};Am.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _m=(t,e)=>Am(Object.assign({colorAttribute:"fill"},t),e);_m.props=Object.assign(Object.assign({},Am.props),{defaultMarker:"square"});const Tm=(t,e)=>Am(Object.assign({colorAttribute:"stroke"},t),e);function Pm(t,e,n){const[r,i,a,o]=t;if(zc(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:a[0],a[1]],o]}return[r,[i[0],e?e[0][1]:i[1]],[a[0],e?e[3][1]:a[1]],o]}Tm.props=Object.assign(Object.assign({},Am.props),{defaultMarker:"hollowSquare"});const Cm=(t,e)=>{const{adjustPoints:n=Pm}=t,r=Pe(t,["adjustPoints"]),{coordinate:i,document:a}=e;return(t,e,o,s)=>{const{index:c}=e,{color:l}=o,u=Pe(o,["color"]),f=s[c+1],h=n(t,f,i),d=!!zc(i),[p,g,v,m]=d?km(h):h,{color:y=l,opacity:b}=e,x=fc().curve(Sc)([p,g,v,m]);return pm(a.createElement("path",{})).call(ym,u).style("d",x).style("fill",y).style("fillOpacity",b).call(ym,r).node()}};function Lm(t,e,n){const[r,i,a,o]=t;if(zc(n)){return[r,[e?e[0][0]:(i[0]+a[0])/2,i[1]],[e?e[3][0]:(i[0]+a[0])/2,a[1]],o]}return[r,[i[0],e?e[0][1]:(i[1]+a[1])/2],[a[0],e?e[3][1]:(i[1]+a[1])/2],o]}Cm.props={defaultMarker:"square"};const Nm=(t,e)=>Cm(Object.assign({adjustPoints:Lm},t),e);function jm(t){const e="function"==typeof t?t:t.render;return class extends Bg{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Nm.props={defaultMarker:"square"};const Rm=jm((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,a=t.ownerDocument;pm(t).maybeAppend("line",(()=>a.createElement("path",{}))).style("d",e).call(ym,r),pm(t).maybeAppend("line1",(()=>a.createElement("path",{}))).style("d",n).call(ym,i)}));const Im=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:a=t=>!Number.isNaN(t)&&null!=t,connect:o=!1}=t,s=Pe(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=Pe(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:v,seriesX:m,seriesY:y}=e,b=Om(c,e),x=zc(c),k=r&&v?xm(v,m,y,r,i,x):p,w=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),k&&{stroke:k}),g&&{lineWidth:g}),b&&{transform:b}),s);let M;if(Gc(c)){const t=c.getCenter();M=e=>vc(fc().curve(dc)).angle(((n,r)=>bs(gs(e[r],t)))).radius(((n,r)=>ms(e[r],t))).defined((([t,e])=>a(t)&&a(e))).curve(n)(e)}else M=fc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>a(t)&&a(e))).curve(n);const[O,E]=function(t,e){const n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,a),S=_r(w,"connect"),A=!!E.length;if(!A||o&&!Object.keys(S).length)return pm(l.createElement("path",{})).style("d",M(O)||[]).call(ym,w).node();if(A&&!o)return pm(l.createElement("path",{})).style("d",M(t)).call(ym,w).node();return pm(new Rm).style("style1",Object.assign(Object.assign({},w),S)).style("style2",w).style("d1",(_=E,_.map(M).join(","))).style("d2",M(t)).node();var _}};Im.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dm=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Gc(n)?Sc:cc;return Im(Object.assign({curve:i},t),e)(...r)}};Dm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"line"});const Bm=(t,e)=>{const n=Pe(t,[]),{coordinate:r}=e;return(...t)=>{const i=Gc(r)?Oc:zc(r)?Rc:jc;return Im(Object.assign({curve:i},n),e)(...t)}};Bm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"smooth"});const Fm=(t,e)=>Im(Object.assign({curve:Fc},t),e);Fm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"hv"});const zm=(t,e)=>Im(Object.assign({curve:Bc},t),e);zm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"vh"});const Gm=(t,e)=>Im(Object.assign({curve:Dc},t),e);function Wm(t,e,n,r,i){const a=ys(gs(n,e)),o=a+Math.PI/2,s=[r/2*Math.cos(o),r/2*Math.sin(o)],c=[i/2*Math.cos(o),i/2*Math.sin(o)],l=[i/2*Math.cos(a),i/2*Math.sin(a)],u=[r/2*Math.cos(a),r/2*Math.sin(a)],f=vs(e,s),h=vs(n,c),d=vs(h,l),p=vs(n,l),g=gs(p,c),v=gs(n,c),m=gs(e,s),y=gs(m,u),b=gs(e,u),x=gs(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...v,i/2),t.lineTo(...m),t.arcTo(...y,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}Gm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"hvh"});const $m=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:a,color:o}=r,{color:s}=i,c=Pe(i,["color"]),l=Ks();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=a[t],o=a[t+1];[...n,...r].every(Sr)&&Wm(l,n,r,i,o)}return pm(n.createElement("path",{})).call(ym,c).style("fill",o||s).style("d",l.toString()).call(ym,t).node()}};$m.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"line"});const Ym=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];Ym.style=["fill"];const Hm=Ym.bind(void 0);Hm.style=["stroke","lineWidth"];const Vm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Vm.style=["fill"];const qm=Vm.bind(void 0);qm.style=["fill"];const Um=Vm.bind(void 0);Um.style=["stroke","lineWidth"];const Xm=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};Xm.style=["fill"];const Zm=Xm.bind(void 0);Zm.style=["stroke","lineWidth"];const Km=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};Km.style=["fill"];const Qm=Km.bind(void 0);Qm.style=["stroke","lineWidth"];const Jm=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};Jm.style=["fill"];const ty=Jm.bind(void 0);ty.style=["stroke","lineWidth"];const ey=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};ey.style=["fill"];const ny=ey.bind(void 0);ny.style=["stroke","lineWidth"];const ry=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};ry.style=["fill"];const iy=ry.bind(void 0);iy.style=["stroke","lineWidth"];const ay=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];ay.style=["stroke","lineWidth"];const oy=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];oy.style=["stroke","lineWidth"];const sy=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];sy.style=["stroke","lineWidth"];const cy=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];cy.style=["stroke","lineWidth"];const ly=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];ly.style=["stroke","lineWidth"];const uy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];uy.style=["stroke","lineWidth"];const fy=uy.bind(void 0);fy.style=["stroke","lineWidth"];const hy=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];hy.style=["stroke","lineWidth"];const dy=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];dy.style=["stroke","lineWidth"];const py=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];py.style=["stroke","lineWidth"];const gy=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];gy.style=["stroke","lineWidth"];const vy=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];vy.style=["stroke","lineWidth"];const my=new Map([["bowtie",ry],["cross",oy],["dash",fy],["diamond",Xm],["dot",uy],["hexagon",ey],["hollowBowtie",iy],["hollowDiamond",Zm],["hollowHexagon",ny],["hollowPoint",Hm],["hollowSquare",Um],["hollowTriangle",Qm],["hollowTriangleDown",ty],["hv",dy],["hvh",gy],["hyphen",ly],["line",ay],["plus",cy],["point",Ym],["rect",qm],["smooth",hy],["square",Vm],["tick",sy],["triangleDown",Jm],["triangle",Km],["vh",py],["vhv",vy]]);function yy(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||Hc(r)){const[[t,n],[r,i]]=e,a=Math.abs((r-t)/2),o=Math.abs((i-n)/2);return Math.max(0,(a+o)/2)}return i}const by=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,a=Pe(t,["colorAttribute","symbol","mode"]),o=my.get(r)||my.get("point"),{coordinate:s,document:c}=e;return(e,r,l)=>{const{lineWidth:u,color:f}=l,h=a.stroke?u||1:u,{color:d=f,transform:p,opacity:g}=r,[v,m]=Em(e),y=yy(i,e,r,s)||a.r||l.r;return pm(c.createElement("path",{})).call(ym,l).style("fill","transparent").style("d",o(v,m,y)).style("lineWidth",h).style("transform",p).style("transformOrigin",`${v-y} ${m-y}`).style("stroke",d).style(Mm(t),g).style(n,d).call(ym,a).node()}};by.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);xy.props=Object.assign({defaultMarker:"hollowBowtie"},by.props);const ky=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);ky.props=Object.assign({defaultMarker:"hollowDiamond"},by.props);const wy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);wy.props=Object.assign({defaultMarker:"hollowHexagon"},by.props);const My=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);My.props=Object.assign({defaultMarker:"hollowPoint"},by.props);const Oy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Oy.props=Object.assign({defaultMarker:"hollowSquare"},by.props);const Ey=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Ey.props=Object.assign({defaultMarker:"hollowTriangle"},by.props);const Sy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Sy.props=Object.assign({defaultMarker:"hollowTriangleDown"},by.props);const Ay=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=Pe(t,["colorAttribute","mode"]),{coordinate:a,document:o}=e;return(e,s,c)=>{const{lineWidth:l,color:u}=c,f=i.stroke?l||1:l,{color:h=u,transform:d,opacity:p}=s,[g,v]=Em(e),m=yy(r,e,s,a)||i.r||c.r;return pm(o.createElement("circle",{})).call(ym,c).style("fill","transparent").style("cx",g).style("cy",v).style("r",m).style("lineWidth",f).style("transform",d).style("transformOrigin",`${g} ${v}`).style("stroke",h).style(Mm(t),p).style(n,h).call(ym,i).node()}},_y=(t,e)=>Ay(Object.assign({colorAttribute:"fill"},t),e);_y.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const Ty=(t,e)=>Ay(Object.assign({colorAttribute:"stroke"},t),e);Ty.props=Object.assign({defaultMarker:"hollowPoint"},_y.props);const Py=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Py.props=Object.assign({defaultMarker:"bowtie"},by.props);const Cy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Cy.props=Object.assign({defaultMarker:"cross"},by.props);const Ly=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Ly.props=Object.assign({defaultMarker:"diamond"},by.props);const Ny=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Ny.props=Object.assign({defaultMarker:"hexagon"},by.props);const jy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);jy.props=Object.assign({defaultMarker:"hyphen"},by.props);const Ry=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Ry.props=Object.assign({defaultMarker:"line"},by.props);const Iy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Iy.props=Object.assign({defaultMarker:"plus"},by.props);const Dy=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);Dy.props=Object.assign({defaultMarker:"point"},by.props);const By=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);By.props=Object.assign({defaultMarker:"square"},by.props);const Fy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Fy.props=Object.assign({defaultMarker:"tick"},by.props);const zy=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);zy.props=Object.assign({defaultMarker:"triangle"},by.props);const Gy=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);Gy.props=Object.assign({defaultMarker:"triangleDown"},by.props);const Wy=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Pe(t,["arrow","arrowSize"]),{document:a}=e;return(t,e,o)=>{const{defaultColor:s}=o,c=Pe(o,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=Ks();if(d.moveTo(...f),d.lineTo(...h),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*ms(t,e):r,a=Math.PI/6,o=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-o-a,c=o-a;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,h,{arrowSize:r});d.moveTo(...t),d.lineTo(...h),d.lineTo(...e)}return pm(a.createElement("path",{})).call(ym,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(ym,i).node()}};function $y(t,e){e(t),t.children&&t.children.forEach((function(t){t&&$y(t,e)}))}function Yy(t){Vy(t,!0)}function Hy(t){Vy(t,!1)}function Vy(t,e){var n=e?"visible":"hidden";$y(t,(function(t){t.attr("visibility",n)}))}Wy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var qy=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,Re([],je(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(Hp.INSERTED,(function(){Hy(r)})),r}return _e(e,t),e}(zg);function Uy(t){var e=t.appendChild(new qy({class:"offscreen"}));return Hy(e),e}var Xy=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Pe(e,["style"]);return t.call(this,Te({style:Te({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return _e(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Uy(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(tv);function Zy(t){return t*Math.PI/180}function Ky(t){return Number((180*t/Math.PI).toPrecision(5))}var Qy=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();function Jy(t,e){return m(t)?t.apply(void 0,Re([],je(e),!1)):t}var tb,eb,nb,rb,ib=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=je(t,2),r=e[0],i=e[1],a=n(i);return[r,{name:a,class:".".concat(a),id:"#".concat(a),toString:function(){return a}}]})));return Object.assign(r,{prefix:n}),r},ab=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var a=je(i,2),o=a[0],s=a[1],c=t;Object.prototype.hasOwnProperty.call(e,o)&&(s?S(s)?(S(t[o])||(c[o]={}),n<r?ab(t[o],s,n+1,r):c[o]=e[o]):b(s)?(c[o]=[],c[o]=c[o].concat(s)):c[o]=s:c[o]=s)}))},ob=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)ab(t,e[r]);return t},sb=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},cb=(eb=function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return tb||(tb=wg.offscreenCanvasCreator.getOrCreateContext(void 0)),tb.font=[a,o,i,"".concat(n,"px"),r].join(" "),tb.measureText(t).width},nb=function(t,e){return[t,Object.values(e||lb(t)).join()].join("")},void 0===(rb=4096)&&(rb=128),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=nb?nb.apply(this,t):t[0];q.has(eb)||q.set(eb,function(t){var e,n,r,i=t||1;function a(t,a){++e>i&&(r=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}(rb));var r=q.get(eb);if(r.has(n))return r.get(n);var i=eb.apply(this,t);return r.set(n,i),i}),lb=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,a=t.style.fontSize;return{fontSize:a="object"==typeof a?a.value:a,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function ub(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function fb(t,e){var n=ub(t);n&&n.attr(e)}function hb(t,e,n){void 0===n&&(n="..."),fb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function db(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var a=n[0];return[a.clientX,a.clientY]}return r&&i?[r,i]:[0,0]}function pb(t){return"function"==typeof t?t():C(t)||j(t)?new Xy({style:{text:String(t)}}):t}function gb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function vb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}function mb(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var a=new Array(r),o=new Array(n),s=0;for(s=0;s<r;++s)a[s]=mb(t[s],e[s]);for(;s<n;++s)o[s]=e[s];for(s=0;s<r;++s)o[s]=a[s](i);return o}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach((function(e){var i=je(e,2),a=i[0],o=i[1];a in t?n[a]=mb(t[a],o):r[a]=o})),function(t){return Object.entries(n).forEach((function(e){var n=je(e,2),i=n[0],a=n[1];return r[i]=a(t)})),r}}(t,e):function(e){return t}}function yb(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,a=0;a<t.length;a++){var o=t[a],s=o.x,c=o.y,l=je([s+o.width,c+o.height],2),u=l[0],f=l[1];s<e&&(e=s),c<n&&(n=c),u>r&&(r=u),f>i&&(i=f)}return new Qy(e,n,r-e,i-n)}var bb=function(t,e,n){var r=t.width,i=t.height,a=n.flexDirection,o=void 0===a?"row":a,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===o,h="row"===o||"column"===o,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=je([0,0],2),g=p[0],v=p[1],m=e.map((function(t){var e,n=t.width,r=t.height,i=je([g,v],2),a=i[0],o=i[1];return e=je([g+n*d[0],v+r*d[1]],2),g=e[0],v=e[1],new Qy(a,o,n,r)})),y=yb(m),b={"flex-start":0,"flex-end":f?r-y.width:i-y.height,center:f?(r-y.width)/2:(i-y.height)/2},x=m.map((function(t){var e=t.x,n=t.y,r=Qy.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));yb(x);var k=function(t){var e=je(f?["height",i]:["width",r],2),n=e[0],a=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return a-t[n];case"center":return a/2-t[n]/2}},w=x.map((function(t){var e=t.x,n=t.y,r=Qy.fromRect(t);return r.x=f?e:e+k(r),r.y=f?n+k(r):n,r})),M=w.map((function(e){var n,r,i=Qy.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return M},xb=function(t,e,n){return[]};function kb(t,e){return[t[0]*e,t[1]*e]}function wb(t,e){return[t[0]+e[0],t[1]+e[1]]}function Mb(t,e){return[t[0]-e[0],t[1]-e[1]]}function Ob(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Eb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Sb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Ab(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function _b(t,e){return+t.toPrecision(e)}function Tb(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function Pb(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],a=0,o=t.length;a<o;a+=2)i.push([t[a],t[a+1]]);var s,c,l,u=function(t,e,n,r){var i,a,o,s,c,l,u=[],f=!!r,h=[1/0,1/0],d=[-1/0,-1/0];if(f){h=(i=je(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=Ob(h,m=t[p]),d=Eb(d,m)}p=0;for(var v=t.length;p<v;p+=1){var m=t[p];if(0!==p||n)if(p!==v-1||n){a=t[[p?p-1:v-1,p-1][n?0:1]];var y=[0,0];y=kb(y=Mb(o=t[n?(p+1)%v:p+1],a),e);var b=Sb(m,a),x=Sb(m,o),k=b+x;0!==k&&(b/=k,x/=k);var w=kb(y,-b),M=kb(y,x);c=wb(m,w),s=Ob(s=wb(m,M),Eb(o,m)),s=Eb(s,Ob(o,m)),c=Ob(c=wb(m,w=kb(w=Mb(s,m),-b/x)),Eb(a,m)),s=wb(m,M=kb(M=Mb(m,c=Eb(c,Ob(a,m))),x/b)),f&&(c=Ob(c=Eb(c,h),d),s=Ob(s=Eb(s,h),d)),u.push(l),u.push(c),l=s}else c=m,u.push(l),u.push(c);else l=m}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,h=[];for(a=0;a<f-1;a+=1)s=u[2*a],c=u[2*a+1],l=i[a+1],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]]);return r&&(s=u[f],c=u[f+1],l=je(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var Cb=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function Lb(t){return Cb.includes(t)}function Nb(t){var e={};for(var n in t)Lb(n)&&(e[n]=t[n]);return e}function jb(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,a=r.height,o=e/Math.max(i,a);return n&&(t.style.transform="scale(".concat(o,")")),o}var Rb=function(){function t(t,n,r,i,a,o,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===a&&(a=[null,null,null,null,null]),void 0===o&&(o=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=a[0],this._update=a[1],this._exit=a[2],this._merge=a[3],this._split=a[4],this._transitions=o,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var a=0;a<this._data.length;a++){var o=this._data[a],s=je(Array.isArray(o)?o:[o,null],2),c=s[0],l=s[1];(f=r(c,a)).__data__=c,null!==l&&(f.__fromElements__=l),this._parent.appendChild(f),i.push(f)}return new n(i,null,this._parent,this._document)}for(a=0;a<this._elements.length;a++){var u=this._elements[a],f=r(c=u.__data__,a);u.appendChild(f),i.push(f)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=Ie(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),a=Ie(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return a.attr("className",i),a},t.prototype.maybeAppendByName=function(t,n){var i=Ie(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,a;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var o=[],s=[],c=new Set(this._elements),l=[],u=new Set,f=new Map(this._elements.map((function(t,n){return[e(t.__data__,n),t]}))),h=new Map(this._facetElements.map((function(t,n){return[e(t.__data__,n),t]}))),d=function(t,e){var n=new Map;return t.forEach((function(t){var r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)})),n}(this._elements,(function(t){return r(t.__data__)})),p=0;p<t.length;p++){var g=t[p],v=e(g,p),m=r(g,p);if(f.has(v))(k=f.get(v)).__data__=g,k.__facet__=!1,s.push(k),c.delete(k),f.delete(v);else if(h.has(v)){(k=h.get(v)).__data__=g,k.__facet__=!0,s.push(k),h.delete(v)}else if(d.has(v)){var y=d.get(v);l.push([g,y]);try{for(var b=(i=void 0,Ne(y)),x=b.next();!x.done;x=b.next()){var k=x.value;c.delete(k)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}d.delete(v)}else if(f.has(m)){(k=f.get(m)).__toData__?k.__toData__.push(g):k.__toData__=[g],u.add(k),c.delete(k)}else o.push(g)}var w=[new n([],o,this._parent,this._document),new n(s,null,this._parent,this._document),new n(c,null,this._parent,this._document),new n([],l,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,w)},t.prototype.merge=function(t){var e=Re(Re([],je(this._elements),!1),je(t._elements),!1),r=Re(Re([],je(this._transitions),!1),je(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var a=t(this._enter),o=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return o.merge(a).merge(s).merge(c).merge(l)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then((function(){return n.remove()})):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each((function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))}))},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each((function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))}))},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each((function(n,r){var i=this;Object.entries(t).forEach((function(t){var a=je(t,2),o=a[0],s=a[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(o,c.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,r){e[r]=t.call(this,n,r)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,Re([this._parent,this],je(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter((function(t){return!!t}))},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var a="string"==typeof e?this.createElement(e):e();return r.appendChild(a),new n([a],null,this._parent,this._document)},t.registry={g:zg,rect:Qg,circle:Ig,path:qg,text:Xy,ellipse:Fg,image:$g,line:Hg,polygon:Xg,polyline:Kg,html:Wg},t}();function Ib(t){return new Rb([t],null,t,t.ownerDocument)}function Db(t){if(j(t))return[t,t,t,t];if(b(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function Bb(t){var e=t.getLocalBounds(),n=je([e.min,e.max],2),r=je(n[0],2),i=r[0],a=r[1],o=je(n[1],2),s=o[0],c=o[1];return{x:i,y:a,width:s-i,height:c-a,left:i,bottom:c,top:a,right:s}}function Fb(t,e){var n=je(t,2),r=n[0],i=n[1],a=je(e,2),o=a[0],s=a[1];return r!==o&&i===s}function zb(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Gb(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",a=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(a):a}var Wb=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function $b(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=je(t,2),a=i[0],o=i[1];if("className"===a||"class"===a);else if(Wb(a,"show")&&Wb(Gb(a,"show"),e)!==n)a===function(t,e){return"".concat(e).concat(zb(t))}(e,"show")?r[a]=o:r[a.replace(new RegExp(zb(e)),"")]=o;else if(!Wb(a,"show")&&Wb(a,e)!==n){var s=Gb(a,e);"filter"===s&&"function"==typeof o||(r[s]=o)}})),r}function Yb(t,e){return Object.entries(t).reduce((function(t,n){var r=je(n,2),i=r[0],a=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=a:t["".concat(e).concat(zb(i))]=a,t}),{})}function Hb(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach((function(t){var a=je(t,2),o=a[0],s=a[1];e.includes(o)||(-1!==n.indexOf(o)?i[o]=s:r[o]=s)})),[r,i]}function Vb(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,(function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,a=r.height,o=je([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:a):t})),2);return[o[0],o[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}var qb=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,Re([],je(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)):t.innerHTML=""};function Ub(){Vy(this,"hidden"!==this.attributes.visibility)}var Xb=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,ob({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return _e(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Uy(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&Ub.call(this)},e.prototype.update=function(t,e){var n;return this.attr(ob({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){return Pe(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(Bg),Zb=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},Kb=Zb,Qb=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Jb=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},tx=Jb;var ex=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function nx(t){var e=function(t){var e="default";if(x(t)&&t instanceof Image)e="image";else if(m(t))e="symbol";else if(C(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var rx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _e(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,a=t.y,o=void 0===a?0:a,s=this.getSubShapeStyle(t),c=s.symbol,l=s.size,u=void 0===l?16:l,f=Pe(s,["symbol","size"]),h=nx(c);gb(!!h,Ib(n),(function(t){t.maybeAppendByClassName("marker",h).attr("className","marker ".concat(h,"-marker")).call((function(t){if("image"===h){var n=2*u;t.styles({img:c,width:n,height:n,x:i-u,y:o-u})}else{n=u/2;var r=m(c)?c:e.getSymbol(c);t.styles(Te({d:null==r?void 0:r(i,o,n)},f))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(Xb);rx.registerSymbol("cross",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]})),rx.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),rx.registerSymbol("line",Qb),rx.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),rx.registerSymbol("tick",(function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]})),rx.registerSymbol("circle",Zb),rx.registerSymbol("point",Kb),rx.registerSymbol("bowtie",(function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]})),rx.registerSymbol("hexagon",(function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]})),rx.registerSymbol("square",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]})),rx.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),rx.registerSymbol("triangle",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]})),rx.registerSymbol("triangle-down",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]})),rx.registerSymbol("line",Qb),rx.registerSymbol("dot",Jb),rx.registerSymbol("dash",tx),rx.registerSymbol("smooth",(function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]})),rx.registerSymbol("hv",(function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})),rx.registerSymbol("vh",(function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})),rx.registerSymbol("hvh",(function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})),rx.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));var ix=function(t){function e(e){var n=this,r=e.style,i=Pe(e,["style"]);return(n=t.call(this,Z({},{type:"column"},Te({style:r},i)))||this).columnsGroup=new zg({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return _e(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,r=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(r,")"),Ib(this.columnsGroup).selectAll(".column").data(e.flat()).join((function(t){return t.append("rect").attr("className","column").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.update=function(t){this.attr(ob({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Rg),ax=function(t){function e(e){var n=this,r=e.style,i=Pe(e,["style"]);return(n=t.call(this,Z({},{type:"lines"},Te({style:r},i)))||this).linesGroup=n.appendChild(new zg),n.areasGroup=n.appendChild(new zg),n.render(),n}return _e(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,r=t.x,i=t.y;this.style.transform="translate(".concat(r,", ").concat(i,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(ob({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Ib(this.linesGroup).selectAll(".line").data(t).join((function(t){return t.append("path").attr("className","line").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.renderAreas=function(t){Ib(this.linesGroup).selectAll(".area").data(t).join((function(t){return t.append("path").attr("className","area").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.style(t)}))}),(function(t){return t.remove()}))},e}(Rg);function ox(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return Re([e===n?"M":"L"],je(t),!1)}));return e?r.reverse():r}function sx(t,e){if(void 0===e&&(e=!1),t.length<=2)return ox(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];J(a,n.slice(-2))||n.push.apply(n,Re([],je(a),!1))}var o=Pb(n,!1);return e?o.unshift(Re(["M"],je(t[r-1]),!1)):o.unshift(Re(["M"],je(t[0]),!1)),o}function cx(t,e,n){var r=H(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function lx(t){return 0===t.length?[0,0]:[T(D(t,(function(t){return T(t)||0}))),_(I(t,(function(t){return _(t)||0})))]}function ux(t){for(var e=H(t),n=e[0].length,r=je([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],a=r[1],o=0;o<e.length;o+=1)for(var s=e[o],c=0;c<n;c+=1)s[c]>=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=a[c],a[c]=s[c]);return e}var fx=function(t){function e(e){return t.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return _e(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=H(t);return j(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?ux(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=je(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var a=$b(this.attributes,"area"),o=$b(this.attributes,"line"),s=this.containerShape.width,c=this.data;if(0===c[0].length)return{lines:[],areas:[]};var l=this.scales,u=function(t,e){var n,r=e.x,i=e.y,a=je(i.getOptions().range||[0,0],2),o=a[0],s=a[1];return s>o&&(n=je([o,s],2),s=n[0],o=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),N(i.map(t),s,o)]}))}))}(c,{type:"line",x:l.x,y:l.y}),f=[];if(a){var h=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var a=t[i],o=sx(a),s=void 0;if(0===i)s=cx(o,e,n);else{var c=sx(t[i-1],!0),l=a[0];c[0][0]="L",s=Re(Re(Re([],je(o),!1),je(c),!1),[Re(["M"],je(l),!1),["Z"]],!1)}r.push(s)}return r}(u,s,h):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var a=ox(t[i]),o=void 0;if(0===i)o=cx(a,e,n);else{var s=ox(t[i-1],!0);s[0][0]="L",o=Re(Re(Re([],je(a),!1),je(s),!1),[["Z"]],!1)}r.push(o)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return cx(e?sx(t):ox(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return Te({stroke:t.getColor(n),d:i?sx(e):ox(e)},o)})),areas:f.map((function(e,n){return Te({d:e,fill:t.getColor(n)},a)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=$b(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,a=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var o=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=ux(s));var c=this.createScales(s),l=c.x,u=c.y,f=je(lx(s),2),h=f[0],d=f[1],p=new oo({domain:[0,d-(h>0?0:h)],range:[0,o*a]}),g=l.getBandWidth(),v=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,a){var o=g/s.length;return Te(Te({fill:t.getColor(i)},e),r?{x:l.map(a),y:u.map(n),width:g,height:p.map(v[i][a])}:{x:l.map(a)+o*i,y:n>=0?u.map(n):u.map(0),width:o,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Ib(n).select(r):Ib(n).append(i)).attr("className","container").node();var a=t.type,o=t.x,s=t.y,c="spark".concat(a),l=Te({x:o,y:s},"line"===a?this.linesStyle:this.columnsStyle);Ib(e).selectAll(".spark").data([a]).join((function(t){return t.append((function(t){return"line"===t?new ax({className:c,style:l}):new ix({className:c,style:l})})).attr("className","spark ".concat(c))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return b(e)?e[t%e.length]:m(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,a=r.scale,o=r.range,s=void 0===o?[]:o,c=r.spacing,l=this.containerShape,u=l.width,f=l.height,h=je(lx(t),2),d=h[0],p=h[1],g=new oo({domain:[null!==(e=s[0])&&void 0!==e?e:d,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-a)]});return"line"===i?{type:i,x:new oo({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Wa({domain:t[0].map((function(t,e){return e})),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:g}},e.tag="sparkline",e}(Xb);function hx(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=je(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,Te(Te({},t[e]),n)]:[e,n]})))}function dx(t,e){t?t.finished.then(e):e()}function px(t,e){"update"in t?t.update(e):t.attr(e)}function gx(t,e,n){return 0===e.length?null:n?t.animate(e,n):(px(t,{style:e.slice(-1)[0]}),null)}function vx(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=je(e,2),a=n[0],o=n[1];if(!y(o)){var s=t.style[a]||t.parsedStyle[a]||0;s!==o&&(r[a]=s,i[a]=o)}})),n?gx(t,[r,i],Te({fill:"both"},n)):(px(t,i),null)}function mx(t,e){return t.style.opacity||(t.style.opacity=1),vx(t,{opacity:0},e)}var yx={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},bx={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},xx={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},kx=ib({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),wx=ib({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Mx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _e(e,t),e.prototype.render=function(t,e){var n=t.x,r=t.y,i=t.size,a=void 0===i?10:i,o=t.radius,s=void 0===o?a/4:o,c=t.orientation,l=Pe(t,["x","y","size","radius","orientation"]),u=a,f=2.4*u,h=Ib(e).maybeAppendByClassName(wx.iconRect,"rect").styles(Te(Te({},l),{width:u,height:f,radius:s,x:n-u/2,y:r-f/2,transformOrigin:"center"})),d=n+1/3*u-u/2,p=n+2/3*u-u/2,g=r+1/4*f-f/2,v=r+3/4*f-f/2;h.maybeAppendByClassName("".concat(wx.iconLine,"-1"),"line").styles(Te({x1:d,x2:d,y1:g,y2:v},l)),h.maybeAppendByClassName("".concat(wx.iconLine,"-2"),"line").styles(Te({x1:p,x2:p,y1:g,y2:v},l)),"vertical"===c&&(h.node().style.transform="rotate(90)")},e}(Xb),Ox=function(t){function e(e){return t.call(this,e,xx)||this}return _e(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,a=n.showLabel,o=$b(this.attributes,"label"),s=o.x,c=void 0===s?0:s,l=o.y,u=void 0===l?0:l,f=o.transform,h=o.transformOrigin,d=je(Hb(Pe(o,["x","y","transform","transformOrigin"]),[]),2),p=d[0],g=d[1],v=Ib(t).maybeAppendByClassName(wx.labelGroup,"g").styles(g),m=Te(Te({},bx),p),y=m.text,b=Pe(m,["text"]);gb(!!a,v,(function(t){e.label=t.maybeAppendByClassName(wx.label,"text").styles(Te(Te({},b),{x:r+c,y:i+u,transform:f,transformOrigin:h,text:"".concat(y)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,a=e.type,o=Te(Te({x:n,y:r,orientation:i},yx),$b(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new Mx({style:o})}:s;Ib(t).maybeAppendByClassName(wx.iconGroup,"g").selectAll(wx.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(a)}).attr("className",wx.icon.name)}),(function(t){return t.update(o)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(Xb),Ex=function(t){function e(e){var n=t.call(this,e,Te(Te(Te({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},Yb(xx,"handle")),Yb(yx,"handleIcon")),Yb(bx,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(db(e));var r=n.availableSpace,i=r.x,a=r.y,o=n.getBBox(),s=o.x,c=o.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,a])-n.getOrientVal([+s,+c])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,a=e.type;t.stopPropagation();var o=n.getOrientVal(db(t)),s=o-n.prevPos;if(s){var c=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(c);break;case"end":r&&n.setValuesOffset(0,c);break;case"selection":r&&n.setValuesOffset(c,c);break;case"track":if(!i)return;n.selectionWidth+=c,"range"===a?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=o}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,a="range"===i?t:t[1],o="range"===i?n.getValues():n.getValues()[1],s=new Rp("valuechange",{detail:{oldValue:a,value:o}});n.dispatchEvent(s),null==r||r(o)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return _e(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=$b(this.attributes,"sparkline");return Te(Te({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=je(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=je(Db(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],a=this.shape;return{x:i,y:e,width:a.width-(i+n),height:a.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(kx.selection.class).each((function(n,r){vx(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&vx(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&vx(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=$b(this.attributes,"track");this.trackShape=Ib(t).maybeAppendByClassName(kx.track,"rect").styles(Te(Te({x:n,y:r},this.shape),i))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.brushable;this.brushArea=Ib(t).maybeAppendByClassName(kx.brushArea,"rect").styles(Te({x:n,y:r,fill:"transparent",cursor:i?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,r=n.x,i=n.y;gb("horizontal"===n.orientation,Ib(t).maybeAppendByClassName(kx.sparklineGroup,"g"),(function(t){var n=Te(Te({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(kx.sparkline,(function(){return new fx({style:n})})).update(n)}))},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,a=r?"range"===i?["start","end"]:["end"]:[],o=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(kx.handle.class).data(a.map((function(t){return{type:t}})),(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new Ox({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(kx.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");o[n]=this,this.addEventListener("pointerdown",o.onDragStart(e))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(o.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");o[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.type,a=e.selectionType;this.foregroundGroup=Ib(t).maybeAppendByClassName(kx.foreground,"g");var o=$b(this.attributes,"selection"),s=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===a?"grab":"invert"===a?"crosshair":"default"})).styles(Te(Te({},o),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(kx.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:Te({},t),index:e,show:"select"===a?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",kx.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=Ib(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),c.onDragStart("selection")(t)})),c.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),c.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),c.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(function(){n.attr("cursor","grabbing")})),this.addEventListener("pointerup",(function(){n.attr("cursor","pointer")})),this.addEventListener("pointerover",(function(){n.attr("cursor","pointer")}))):this.on("pointerdown",c.onDragStart("track"))}))}),(function(t){return t.call(s)}),(function(t){return t.remove()})),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=je(this.range,2),i=r[0],a=r[1],o=je(this.getValues().map((function(t){return _b(t,e)})),2),s=o[0],c=o[1],l=je(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return _b(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,N(f,i,a)];u>f&&(u=(n=je([f,u],2))[0],f=n[1]);var h=f-u;return h>a-i?[i,a]:u<i?s===i&&c===f?[i,f]:[i,h+i]:f>a?c===a&&s===u?[u,a]:[a-h,a]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=je(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,a=i.x,o=i.y,s=i.width,c=i.height;return this.getOrientVal([[{y:o,height:c,x:a,width:n*s},{y:o,height:c,x:n*s+a,width:(r-n)*s},{y:o,height:c,x:r*s,width:(1-r)*s}],[{x:a,width:s,y:o,height:n*c},{x:a,width:s,y:n*c+o,height:(r-n)*c},{x:a,width:s,y:r*c,height:(1-r)*c}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,a=n.width,o=n.height,s=je(this.clampValues(),2),c=s[0],l=s[1],u="start"===t?-e:e,f=("start"===t?c:l)*this.getOrientVal([a,o])+u;return{x:r+this.getOrientVal([f,a/2]),y:i+this.getOrientVal([o/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,a=n.formatter,o=n.autoFitLabel,s=$b(this.attributes,"handle"),c=$b(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=a("start"===t?f[0]:f[1]),d=new Xy({style:Te(Te(Te({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,v=p.height;if(d.destroy(),!o){if("value"===r)return{text:h,x:0,y:-v-l};var m=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-m:m,e}var y=0,b=0,x=this.availableSpace,k=x.width,w=x.height,M=this.calcSelectionArea()[1],O=M.x,E=M.y,S=M.width,A=M.height,_=l+u;if("horizontal"===i){var T=_+g/2;if("start"===t)y=O-_-g>0?-T:T;else y=k-O-S-_>g?T:-T}else{var P=v+_;b="start"===t?E-u>v?-P:_:w-(E+A)-u>v?P:-_}return{x:y,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=$b(this.attributes,"handleLabel");return Te(Te(Te({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=$b(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Te({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.showLabel,a=e.showLabelOnInteraction,o=e.orientation,s=this.calcHandlePosition(t),c=s.x,l=s.y,u=this.calcHandleText(t),f=i;return!i&&a&&(f=!!this.target),Te(Te(Te({},Yb(this.getHandleIconStyle(),"icon")),Yb(Te(Te({},this.getHandleLabelStyle(t)),u),"label")),{transform:"translate(".concat(c+n,", ").concat(l+r,")"),orientation:o,showLabel:f,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=je(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=this.attributes.type,i=je(this.getValues(),2),a=[i[0]+("range"===r?t:0),i[1]+e].sort();n?this.setValues(a):this.innerSetValues(a,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,(function(t){t.stopPropagation(),r.dispatchEvent(new Rp(n,{detail:t}))}))},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r,!0)}},e.tag="slider",e}(Xb),Sx=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new Rp("scroll",r)),n.dispatchEvent(new Rp("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=je(n.getLocalPosition(),2),r=e[0],i=e[1],a=je(n.padding,4),o=a[0],s=a[3],c=n.getOrientVal([r+s,i+o]),l=(n.getOrientVal(db(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Rp("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Rp("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Rp("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Rp("trackMouseleave",{detail:t.detail}))},n}return _e(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Db(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=je(this.range,2),n=e[0],r=e[1];return N(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=je(this.padding,4),r=n[0],i=n[1],a=n[2],o=n[3],s=je(this.getOrientVal([[e,t],[t,e]]),2);return{x:o,y:r,width:+s[0]-(o+i),height:+s[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,a=r.height;return n||this.getOrientVal([a,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=je(this.range,2),i=r[0],a=t*(r[1]-i-n);return[a,a+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,a=e.trackSize,o=e.padding,s=e.slidable,c=$b(this.attributes,"track"),l=$b(this.attributes,"thumb"),u=Te(Te({x:n,y:r,brushable:!1,orientation:i,padding:o,selectionRadius:this.thumbRadius,showHandle:!1,slidable:s,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:a,values:this.getValues()},Yb(c,"track")),Yb(l,"selection"));this.slider=Ib(t).maybeAppendByClassName("scrollbar",(function(){return new Ex({style:u})})).update(u).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=je(this.range,2),i=r[0],a=r[1];this.slider.setValues(this.getValues(N(t,i,a)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",(function(e){e.stopPropagation(),t.onTrackClick(e.detail)})),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(Xb),Ax={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new qg({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};Z({},Ax,{style:{type:"arc"}}),Z({},Ax,{style:{}});var _x=ib({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"),Tx=ib({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Px(t){return t.reduce((function(t,e,n){return t.push(Re([0===n?"M":"L"],je(e),!1)),t}),[])}function Cx(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,a=e.center;if("line"===i)return Px(t);if(!a)return[];var o=Sb(t[0],a),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(Re(["M"],je(e),!1)):t.push(Re(["A",o,o,0,0,s],je(e),!1)),t}),[])}(t,e,n):Px(t)}function Lx(t,e,n){var r=n.type,i=n.connect,a=n.center,o=n.closed?[["Z"]]:[],s=je([Cx(t,n),Cx(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=je([t[0],e.slice(-1)[0]],2),f=u[0],h=u[1],d=function(t,e){return[c,t,l,e,o].flat()};if("line"===i||"surround"===r)return d([Re(["L"],je(h),!1)],[Re(["L"],je(f),!1)]);if(!a)throw new Error("Arc grid need to specified center");var p=je([Sb(h,a),Sb(f,a)],2),g=p[0],v=p[1];return d([Re(["A",g,g,0,0,1],je(h),!1),Re(["L"],je(h),!1)],[Re(["A",v,v,0,0,0],je(f),!1),Re(["L"],je(f),!1)])}var Nx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _e(e,t),e.prototype.render=function(t,e){var n=Pe(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=je(e,1)[0];return Te(Te({},t),{points:Re(Re([],je(e),!1),[n],!1)})})):n}(t),i=Ib(e).maybeAppendByClassName(Tx.lineGroup,"g"),a=Ib(e).maybeAppendByClassName(Tx.regionGroup,"g"),o=function(t,e,n,r){var i=n.animate,a=n.isBillboard,o=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),d:Cx(t.points,n)}}));return t.selectAll(Tx.line.class).data(o,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Jy(Nb(Te({d:t.d},r)),[t,e,o]);this.attr(Te({class:Tx.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},n))}))}),(function(t){return t.transition((function(t,e){return vx(this,Jy(Nb(Te({d:t.d},r)),[t,e,o]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=mx(this,i.exit);return dx(e,(function(){return t.remove()})),e}))})).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,a=n.areaFill;if(e.length<2||!a||!i)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=function(t){return o[t%o.length]},c=[],l=0;l<e.length-1;l++){var u=je([e[l].points,e[l+1].points],2),f=Lx(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(Tx.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=Jy(t,[t,e,c]);this.attr(n)})).attr("className",Tx.region.name)}),(function(t){return t.transition((function(t,e){return vx(this,Jy(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=mx(this,r.exit);return dx(e,(function(){return t.remove()})),e}))})).transitions()}(a,r,t);return Re(Re([],je(o),!1),je(s),!1)},e}(Xb);function jx(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=je(t,2);return[n[0],Jy(n[1],e)]})))}function Rx(t,e){return e&&m(e)?t.filter(e):t}function Ix(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Dx(t,e){if("linear"===e.type){var n=je(e.startPos,2),r=n[0],i=n[1],a=je(e.endPos,2),o=je([a[0]-r,a[1]-i],2);return Ab([o[0],o[1]])}var s=Zy(Ix(t,e));return[-Math.sin(s),Math.cos(s)]}function Bx(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Dx(t,n),"positive"!==e)}function Fx(t,e){return Bx(t,e.labelDirection,e)}function zx(t,e){return"linear"===e.type?function(t,e){var n=je(e.startPos,2),r=n[0],i=n[1],a=je(e.endPos,2),o=je([a[0]-r,a[1]-i],2);return[r+o[0]*t,i+o[1]*t]}(t,e):function(t,e){var n=e.radius,r=je(e.center,2),i=r[0],a=r[1],o=Zy(Ix(t,e));return[i+n*Math.cos(o),a+n*Math.sin(o)]}(t,e)}function Gx(t){return 0===Dx(0,t)[1]}function Wx(t){return 0===Dx(0,t)[0]}function $x(t,e){return e-t==360}function Yx(t,e,n,r,i){var a=e-t,o=je([i,i],2),s=o[0],c=o[1],l=je([Zy(t),Zy(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=je(h(u),2),p=d[0],g=d[1],v=je(h(f),2),m=v[0],y=v[1];if($x(t,e)){var b=je(h((f+u)/2),2);return[["M",p,g],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,m,y]]}var x=a>180?1:0,k=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(k,",").concat(m,",").concat(y)}function Hx(t,e,n,r){var i=e.startAngle,a=e.endAngle,o=e.center,s=e.radius;return t.selectAll(_x.line.class).data([{d:Yx.apply(void 0,Re(Re([i,a],je(o),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",_x.line.name).styles(e).styles({d:function(t){return t.d}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,a=void 0===i?0:i,o=mb(e,n),s=Math.ceil(+a/16),c=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:o(e/(n.length-1))}}));return t.animate(c,Te({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,a=e.radius;return Re(Re([n,r],je(i),!1),[a],!1)}(this),Re(Re([i,a],je(o),!1),[s],!1),r.update);if(e){var n=function(){var e=tt(t.attributes,"__keyframe_data__");t.style.d=Yx.apply(void 0,Re([],je(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Vx(t){var e=je(t,2),n=je(e[0],2),r=n[0],i=n[1],a=je(e[1],2);return{x1:r,y1:i,x2:a[0],y2:a[1]}}function qx(t,e,n,r){var i=e.showTrunc,a=e.startPos,o=e.endPos,s=e.truncRange,c=e.lineExtension,l=je([a,o],2),u=je(l[0],2),f=u[0],h=u[1],d=je(l[1],2),p=d[0],g=d[1],v=je(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=je([t,e,n],3),i=je(r[0],2),a=i[0],o=i[1],s=je(r[1],2),c=s[0],l=s[1],u=je(r[2],2),f=u[0],h=u[1],d=je([c-a,l-o],2),p=d[0],g=d[1],v=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),m=je([-f/v,h/v],2),y=m[0],b=m[1];return[y*p,y*g,b*p,b*g]}(a,o,c):new Array(4).fill(0),4),m=v[0],y=v[1],b=v[2],x=v[3],k=function(e){return t.selectAll(_x.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(_x.line.name," ").concat(t.className)})).styles(n).transition((function(t){return vx(this,Vx(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return vx(this,Vx(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return k([{line:[[f+m,h+y],[p+b,g+x]],className:_x.line.name}]);var w=je(s,2),M=w[0],O=w[1],E=p-f,S=g-h,A=je([f+E*M,h+S*M],2),_=A[0],T=A[1],P=je([f+E*O,h+S*O],2),C=P[0],L=P[1];return k([{line:[[f+m,h+y],[_,T]],className:_x.lineFirst.name},{line:[[C,L],[p+b,g+x]],className:_x.lineSecond.name}])}function Ux(t,e,n){var r,i=e.type,a=$b(e,"line");return r="linear"===i?qx(t,e,Tb(a,"arrow"),n):Hx(t,e,Tb(a,"arrow"),n),function(t,e,n,r){var i,a=n.showArrow,o=n.showTrunc,s=n.lineArrow,c=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select(_x.line.class):o?t.select(_x.lineSecond.class):t.select(_x.line.class),!a||!s||"arc"===n.type&&$x(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=pb(s);f.attr(r),jb(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,a),r}function Xx(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Zx(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,a=je(zx(i,e),2),o=a[0],s=a[1],c=je(kb(function(t,e){return Bx(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[o,s],[o+c[0],s+c[1]]]}}))}function Kx(t,e,n,r){var i=$b(n,"grid"),a=i.type,o=i.areaFill,s=Xx(n),c=Rx(e,n.gridFilter),l="segment"===a?Zx(c,n):function(t,e){var n=e.gridControlAngles,r=Xx(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=je(r,2),a=i[0],o=i[1];return t.map((function(t,r){var i=je(zx(t.value,e),2),s=i[0],c=i[1],l=je([s-a,c-o],2),u=l[0],f=l[1],h=[];return n.forEach((function(t){var e=Zy(t),n=je([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+a,c=u*i+f*r+o;h.push([s,c])})),{points:h,id:r}}))}(c,n),u=Te(Te({},i),{center:s,areaFill:m(o)?c.map((function(t,e){return Jy(o,[t,e,c])})):o,animate:r,data:l});return t.selectAll(_x.grid.class).data([1]).join((function(t){return t.append((function(){return new Nx({style:u})})).attr("className",_x.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var Qx=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,a=r.y1,o=r.x2,s=r.y2,c=Math.cos(t),l=Math.sin(t),u=e-e*c+n*l,f=n-e*l-n*c;return[[c*i-l*s+u,l*i+c*s+f],[c*o-l*s+u,l*o+c*s+f],[c*i-l*a+u,l*i+c*a+f],[c*o-l*a+u,l*o+c*a+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function Jx(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=je(r.min,2),a=i[0],o=i[1],s=je(r.max,2),c=s[0],l=s[1],u=t.getBBox(),f=u.width,h=u.height,d=0,p=0,g=a,v=o,m=ub(t);if(m){h-=1.5;var y=m.style.textAlign,b=m.style.textBaseline;"center"===y?g=(a+c)/2:"right"!==y&&"end"!==y||(g=c),"middle"===b?v=(o+l)/2:"bottom"===b&&(v=l)}var x=je(Db(e),4),k=x[0],w=void 0===k?0:k,M=x[1],O=void 0===M?0:M,E=x[2],S=void 0===E?w:E,A=x[3],_=new Qx((d+=a)-(void 0===A?O:A),(p+=o)-w,d+f+O,p+h+S);return t.setEulerAngles(n),_.rotatedPoints(Zy(n),g,v)}function tk(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function ek(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function nk(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,a,o,s,c,l=[e,[9999,e[1]]],u=0,f=0;do{var h=[t[f],t[(f+1)%n]];if(i=l,a=void 0,o=void 0,s=void 0,c=void 0,a=ek((r=h)[0],r[1],i[0]),o=ek(r[0],r[1],i[1]),s=ek(i[0],i[1],r[0]),c=ek(i[0],i[1],r[1]),a!==o&&s!==c||0===a&&tk(r,i[0])||0===o&&tk(r,i[1])||0===s&&tk(i,r[0])||0===c&&tk(i,r[1])){if(0===ek(h[0],e,h[1]))return tk(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function rk(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return function(t,e){var n=je(t,4),r=n[0],i=n[1],a=n[2],o=n[3],s=je(e,4),c=s[0],l=s[1],u=a-r,f=o-i,h=s[2]-c,d=s[3]-l,p=u*d-h*f;if(0===p)return!1;var g=p>0,v=r-c,m=i-l,y=u*m-f*v;if(y<0===g)return!1;var b=h*m-d*v;return b<0!==g&&y>p!==g&&b>p!==g}(e,t)}))}function ik(t,e,n){var r,i,a=e.crossPadding,o=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var a=t.center,o=t.radius,s=je(a,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-o-u,h=o+u,d=je(Db(e),4),p=d[0],g=d[1],v=d[2],m=d[3];return new Qx(c+f-m,l+f-p,c+h+g,l+h+v)}var y=je(t.startPos,2),b=y[0],x=y[1],k=je(t.endPos,2),w=k[0],M=k[1],O=je(Wx(t)?[-e,0,e,0]:[0,e,0,-e],4),E=O[0],S=O[1],A=O[2],_=O[3],T=kb(Fx(0,t),i),P=new Qx(b,x,w,M);return P.x1+=_,P.y1+=E,P.x2+=S+T[0],P.y2+=A+T[1],P}(e,a),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;return nk([[r,a],[i,a],[i,o],[r,o]],Jx(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,a=Jx(t,n).flat(1),o=Jx(e,n).flat(1),s=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var c=Ne(s),l=c.next();!l.done;l=c.next())if(rk(o,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,Db(n))};try{for(var f=Ne(t),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)?!s||u(s,d)?s=d:(o.add(s),o.add(d)):o.add(d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(o)}function ak(t,e){return void 0===e&&(e={}),y(t)?0:"number"==typeof t?t:Math.floor(cb(t,e))}var ok=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Hy(t),!1)}))};var sk=new Map([["hide",function(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||2===i&&a&&o)){var s,c,l,u=ok,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),g=Math.min.apply(Math,Re([1],je(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(Gx(n)||Wx(n))){var v=Bb(t[0]).left,m=Bb(t[i-1]).right,y=Math.abs(m-v)||1;h=Math.max(Math.floor(i*g/y),h)}for(a&&(s=d.splice(0,1)[0]),o&&(c=d.splice(-1,1)[0],d.reverse()),f(d);h<t.length&&ik((l=c?Re(Re([c],je(p),!1),[s],!1):Re([s],je(p),!1),l.filter(sb)),n,null==e?void 0:e.margin).length;){if(c&&!s&&h%2==0)d.splice(0,1).forEach(r.hide);else if(c&&s){d.splice(0,1).forEach(r.hide)}p=u(f(d),{seq:h}),h++}}}],["rotate",function(t,e,n,r){var i,a,o=e.optionalAngles,s=void 0===o?[0,45,90]:o,c=e.margin,l=e.recoverWhenFailed,u=void 0===l||l,f=t.map((function(t){return t.getLocalEulerAngles()})),h=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)}))};try{for(var d=Ne(s),p=d.next();!p.done;p=d.next()){if(h(p.value),ik(t,n,c).length<1)return}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}u&&h(f)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1)){var i=e.suffix,a=void 0===i?"...":i,o=e.minLength,s=e.maxLength,c=void 0===s?1/0:s,l=e.step,u=void 0===l?" ":l,f=e.margin,h=void 0===f?[0,0,0,0]:f,d=lb(r.getTextShape(t[0])),p=ak(u,d),g=o?ak(o,d):p,v=ak(c,d);(y(v)||v===1/0)&&(v=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));var m=t.slice();je(h,4);for(var b=function(e){if(m.forEach((function(t){r.ellipsis(r.getTextShape(t),e,a)})),(m=ik(t,n,h)).length<1)return{value:void 0}},x=v;x>g+p;x-=p){var k=b(x);if("object"==typeof k)return k.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,a=void 0===i?50:i,o=e.maxLines,s=void 0===o?3:o,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,Re([],je(h),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Gx(t)?"negative"===n?"bottom":"top":"middle"}(n),g=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,a,i,p)}))};if(!(d>s)){for(var v=d;v<=s;v++)if(g(v),ik(t,n,f).length<1)return;l&&g(h)}}]]);function ck(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*function(t){return"positive"===t?-1:1}(e)}),1)}function lk(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function uk(t,e){var n=je(t,2),r=n[0],i=n[1],a=je(e,2),o=a[0],s=a[1],c=je([r*o+i*s,r*s-i*o],2),l=c[0],u=c[1];return Math.atan2(u,l)}function fk(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var a=Fx(t.value,n),o=Dx(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return vb(e,-90,90)||(e+=180),e}(Ky("perpendicular"===i?uk([1,0],a):uk([o[0]<0?-1:1,0],o)))}function hk(t,e,n){var r=n.type,i=n.labelAlign,a=Fx(t,n),o=lk(e),s=lk(Ky(uk([1,0],a))),c="center",l="middle";return"linear"===r?[90,270].includes(s)&&0===o?(c="center",l=1===a[1]?"top":"bottom"):s%180||![90,270].includes(o)?0===s?(vb(o,0,90,!1,!0)||vb(o,0,90)||vb(o,270,360))&&(c="start"):90===s?vb(o,0,90,!1,!0)?c="start":(vb(o,90,180)||vb(o,270,360))&&(c="end"):270===s?vb(o,0,90,!1,!0)?c="end":(vb(o,90,180)||vb(o,270,360))&&(c="start"):180===s&&(90===o?c="start":(vb(o,0,90)||vb(o,270,360))&&(c="end")):c="center":"parallel"===i?l=vb(s,0,180,!0)?"top":"bottom":"horizontal"===i?vb(s,90,270,!1)?c="end":(vb(s,270,360,!1)||vb(s,0,90))&&(c="start"):"perpendicular"===i&&(c=vb(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function dk(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=Jy(s,[t,c,e]),u=je([Fx(t.value,n),ck(o,a)],2),f=je(wb(kb(u[0],l+(1===u[1]?Jy(r?i:0,[t,c,e]):0)),zx(t.value,n)),2);return{x:f[0],y:f[1]}}function pk(t,e){"text"===t.nodeName&&t.attr(e)}function gk(t){!function(t,e,n){var r=e.labelOverlap,i=void 0===r?[]:r;i.length&&i.forEach((function(r){var i=r.type,a=sk.get(i);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some((function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((function(t){return t.querySelector("text")})).length>1)})(t,e,i)&&(null==a||a(t,r,e,n))}))}(this.node().childNodes,t,{hide:Hy,show:Yy,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=hk(e.__data__.value,t,n),i=e.querySelector(_x.labelItem.class);i&&pk(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&hb(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),fb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function vk(t,e,n,r,i){var a=n.indexOf(e),o=Ib(t).append(function(t,e,n,r){var i=r.labelFormatter;return m(i)?function(){return pb(Jy(i,[t,e,n,Fx(t.value,r)]))}:function(){return pb(t.label||"")}}(e,a,n,i)).attr("className",_x.labelItem.name).node(),s=je(Hb(jx(r,[e,a,n])),2),c=s[0],l=s[1],u=l.transform,f=Pe(l,["transform"]);Vb(o,u);var h=fk(e,o,i);return o.getLocalEulerAngles()||o.setLocalEulerAngles(h),pk(o,Te(Te({},hk(e.value,h,i)),c)),t.attr(f),o}function mk(t,e,n,r){var i=Rx(e,n.labelFilter),a=$b(n,"label");return t.selectAll(_x.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",_x.label.name).transition((function(t){vk(this,t,e,a,n);var r=dk(t,e,n),i=r.x,o=r.y;return this.style.transform="translate(".concat(i,", ").concat(o,")"),null})).call((function(){gk.call(t,n)}))}),(function(i){return i.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&Hy(t),e.isVisible()&&Yy(e)};if(!n)return i(),[null];var a=n.duration,o=void 0===a?0:a,s=n.delay,c=void 0===s?0:s,l=Math.ceil(+o/2),u=+o/4,f=je(t.getGeometryBounds().center,2),h=f[0],d=f[1],p=je(e.getGeometryBounds().center,2),g=je([(h+p[0])/2-h,(d+p[1])/2-d],2),v=g[0],m=g[1],y=t.style.opacity,b=void 0===y?1:y,x=e.style.opacity,k=void 0===x?1:x,w=t.style.transform||"",M=e.style.transform||"",O=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(w)},{opacity:0,transform:"translate(".concat(v,", ").concat(m,") ").concat(w)}],Te(Te({fill:"both"},n),{duration:c+l+u})),E=e.animate([{opacity:0,transform:"translate(".concat(-v,", ").concat(-m,") ").concat(M),offset:.01},{opacity:k,transform:"translate(0, 0) ".concat(M)}],Te(Te({fill:"both"},n),{duration:l+u,delay:c+l-u}));return dx(E,i),[O,E]}(this.querySelector(_x.labelItem.class),vk(this,t,e,a,n),r.update),o=dk(t,e,n),s=o.x,c=o.y,l=vx(this,{transform:"translate(".concat(s,", ").concat(c,")")},r.update);return Re(Re([],je(i),!1),[l],!1)})).call((function(e){var r,i,a=tt(e,"_transitions").flat().filter(sb);i=function(){gk.call(t,n)},0===(r=a).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=mx(this.childNodes[0],r.exit);return dx(e,(function(){return Ib(t).remove()})),e}))})).transitions()}function yk(t,e){return Bx(t,e.tickDirection,e)}function bk(t,e,n,r,i){var a=je(function(t,e){var n=je(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,Jy(i.tickLength,[t,e,n])),2),o=je(a[0],2),s=o[0],c=o[1],l=je(a[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function xk(t,e,n,r,i,a){var o=function(t,e,n,r,i){var a=i.tickFormatter,o=yk(e.value,i),s="line";return m(a)&&(s=function(){return Jy(a,[e,n,r,o])}),t.append(s).attr("className",_x.tickItem.name)}(Ib(this),t,e,n,r);!function(t,e,n,r,i,a,o){var s=yk(t.value,a),c=bk(t,e,n,s,a),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=je(Hb(jx(o,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(Te({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,o,this,r,i);var s=je(zx(t.value,r),2),c=s[0],l=s[1];return vx(this,{transform:"translate(".concat(c,", ").concat(l,")")},a)}var kk=ib({text:"text"},"title");function wk(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function Mk(t,e){var n=Object.entries(e).reduce((function(e,n){var r=je(n,2),i=r[0],a=r[1];return t.node().attr(i)||(e[i]=a),e}),{});t.styles(n)}var Ok=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return _e(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,a=t.inset,o=this.querySelector(kk.text.class);if(!o)return new Qy(0,0,+e,+n);var s=o.getBBox(),c=s.width,l=s.height,u=je(Db(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=je([0,0,+e,+n],4),v=g[0],m=g[1],y=g[2],b=g[3],x=wk(r);if(x.includes("i"))return new Qy(v,m,y,b);x.forEach((function(t,r){var i,a,o,s;"t"===t&&(i=je(0===r?[l+d,+n-l-d]:[0,+n],2),m=i[0],b=i[1]),"r"===t&&(a=je([+e-c-p],1),y=a[0]),"b"===t&&(o=je([+n-l-f],1),b=o[0]),"l"===t&&(s=je(0===r?[c+h,+e-c-h]:[0,+e],2),v=s[0],y=s[1])}));var k=je(Db(a),4),w=k[0],M=k[1],O=k[2],E=k[3],S=je([E+M,w+O],2),A=S[0],_=S[1];return new Qy(v+E,m+w,y-A,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Qy(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Pe(t,["width","height","position","spacing"]),i=je(Hb(r),1)[0],a=function(t){var e,n,r,i,a=t,o=a.width,s=a.height,c=a.position,l=je([+o/2,+s/2],2),u=je([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=wk(c);return g.includes("l")&&(f=(e=je([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=je([+o,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=je([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=je([+s,"bottom"],2))[0],p=i[1]),{x:f,y:h,textAlign:d,textBaseline:p}}(t),o=a.x,s=a.y,c=a.textAlign,l=a.textBaseline;gb(!!r.text,Ib(e),(function(t){n.title=t.maybeAppendByClassName(kk.text,"text").styles(i).call(Mk,{x:o,y:s,textAlign:c,textBaseline:l}).node()}))},e}(Xb);function Ek(t,e,n,r,i){var a=je(Hb($b(r,"title")),2),o=a[0],s=a[1],c=s.transform,l=s.transformOrigin,u=Pe(s,["transform","transformOrigin"]);e.styles(u);var f=c||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),o.direction,o.position);t.styles(Te(Te({},o),{transformOrigin:l})),Vb(t.node(),f);var h=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,a=n.titleSpacing,o=wk(i),s=t.node().getLocalBounds(),c=je(s.min,2),l=c[0],u=c[1],f=je(s.halfExtents,2),h=f[0],d=f[1],p=je(e.node().getLocalBounds().halfExtents,2),g=p[0],v=p[1],m=je([l+h,u+d],2),y=m[0],b=m[1],x=je(Db(a),4),k=x[0],w=x[1],M=x[2],O=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var E=n.startPos,S=n.endPos,A=je("start"===i?[E,S]:[S,E],2),_=A[0],T=A[1],P=je(kb(Ab([-T[0]+_[0],-T[1]+_[1]]),k),2),C=P[0],L=P[1];return{x:_[0]+C,y:_[1]+L}}return o.includes("t")&&(b-=d+v+k),o.includes("r")&&(y+=h+g+w),o.includes("l")&&(y-=h+g+O),o.includes("b")&&(b+=d+v+M),{x:y,y:b}}(Ib(n._offscreen||n.querySelector(_x.mainGroup.class)),e,r),d=h.x,p=h.y;return vx(e.node(),{transform:"translate(".concat(d,", ").concat(p,")")},i)}function Sk(t,e,n,r){var i=t.showLine,a=t.showTick,o=t.showLabel,s=gb(i,e.maybeAppendByClassName(_x.lineGroup,"g"),(function(e){return Ux(e,t,r)}))||[],c=gb(a,e.maybeAppendByClassName(_x.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Rx(e,n.tickFilter),a=$b(n,"tick");return t.selectAll(_x.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",_x.tick.name).transition((function(t,e){return xk.call(this,t,e,i,n,a,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),xk.call(this,t,e,i,n,a,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=mx(this.childNodes[0],r.exit);return dx(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=gb(o,e.maybeAppendByClassName(_x.labelGroup,"g"),(function(e){return mk(e,n,t,r)}))||[];return Re(Re(Re([],je(s),!1),je(c),!1),je(l),!1).filter((function(t){return!!t}))}var Ak=function(t){function e(e){return t.call(this,e,Ax)||this}return _e(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,a=t.data,o=t.animate,s=t.showTitle,c=t.showGrid,l=t.dataThreshold,u=t.truncRange,f=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(a,l).filter((function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])})),h=hx(void 0===n?o:n),d=gb(c,Ib(e).maybeAppendByClassName(_x.gridGroup,"g"),(function(e){return Kx(e,f,t,h)}))||[],p=Ib(e).maybeAppendByClassName(_x.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Sk(t,Ib(this.offscreenGroup),f,hx(!1));var g=Sk(t,Ib(p.node()),f,h),v=gb(s,Ib(e).maybeAppendByClassName(_x.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(_x.title.class).data([{title:i}].filter((function(t){return!!t.title})),(function(t,e){return t.title})).join((function(a){return a.append((function(){return pb(i)})).attr("className",_x.title.name).transition((function(){return Ek(Ib(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return Ek(Ib(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,h)}))||[];return Re(Re(Re([],je(d),!1),je(g),!1),je(v),!1).flat().filter((function(t){return!!t}))},e}(Xb),_k=ib({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),Tk=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:ex(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new zg({class:_k.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new zg({class:_k.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return _e(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return N(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=je(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(this.pageViews.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,Re([],je(t),!1))})),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,a=void 0===i?e:i,o=r.pageHeight;return{pageWidth:a,pageHeight:void 0===o?n:o}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,a=this.pageShape,o=a.pageWidth,s=a.pageHeight;return new Qy(n,r,o+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,a=r.playState,o=r.playWindow,s=r.pageViews;if("idle"!==a||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=je(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=gx(o,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return dx(f,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:N(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:N(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(_k.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?Yy(e):Hy(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,a=i.orientation,o=i.controllerPadding,s=r.getBBox().width,c=je("horizontal"===a?[-180,0]:[-90,90],2),l=c[0],u=c[1];e.setLocalEulerAngles(l),n.setLocalEulerAngles(u);var f=e.getBBox(),h=f.width,d=f.height,p=n.getBBox(),g=p.width,v=p.height,m=Math.max(h,s,g),y="horizontal"===a?{offset:[[0,0],[h/2+o,0],[h+s+2*o,0]],textAlign:"start"}:{offset:[[m/2,-d-o],[m/2,0],[m/2,v+o]],textAlign:"center"},b=je(y.offset,3),x=je(b[0],2),k=x[0],w=x[1],M=je(b[1],2),O=M[0],E=M[1],S=je(b[2],2),A=S[0],_=S[1],T=y.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(k,w),r.setLocalPosition(O,E),n.setLocalPosition(A,_)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(_k.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,a=r.pageHeight,o=t<e?-1:1;return"horizontal"===n?[o*i,0]:[0,o*a]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=je(this.getFollowingPageDiff(t),2),i=r[0],a=r[1];n[t].setLocalPosition(i,a)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,i=r.pageWidth,a=r.pageHeight,o=this.pageViews.length>=2,s=t.maybeAppendByClassName(_k.controller,"g");if(Vy(s.node(),o),o){var c=$b(this.attributes,"button"),l=$b(this.attributes,"pageNum"),u=je(Hb(c),2),f=u[0],h=u[1],d=f.size,p=Pe(f,["size"]),g=!s.select(_k.prevBtnGroup.class).node(),v=s.maybeAppendByClassName(_k.prevBtnGroup,"g").styles(h);this.prevBtnGroup=v.node();var m=v.maybeAppendByClassName(_k.prevBtn,"path"),y=s.maybeAppendByClassName(_k.nextBtnGroup,"g").styles(h);this.nextBtnGroup=y.node(),[m,y.maybeAppendByClassName(_k.nextBtn,"path")].forEach((function(t){t.styles(Te(Te({},p),{transformOrigin:"center"})),jb(t.node(),d,!0)}));var b=s.maybeAppendByClassName(_k.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(_k.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(i+n,a/2),g&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i;this.attr("transform","translate(".concat(r,", ").concat(a,")"));var o=Ib(e);this.renderClipPath(o),this.renderController(o),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=V((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(Hp.INSERTED,e),this.playWindow.addEventListener(Hp.REMOVED,e)},e}(Xb);function Pk(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}rx.registerSymbol("hiddenHandle",(function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]})),rx.registerSymbol("verticalHandle",(function(t,e,n){var r=1.4*n,i=n/2,a=n/6,o=t+.4*r;return[["M",t,e],["L",o,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",o,e-i],["Z"],["M",o,e+a],["L",t+r-2,e+a],["M",o,e-a],["L",t+r-2,e-a]]})),rx.registerSymbol("horizontalHandle",(function(t,e,n){var r=1.4*n,i=n/2,a=n/6,o=e+.4*r;return[["M",t,e],["L",t-i,o],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,o],["Z"],["M",t-a,o],["L",t-a,e+r-2],["M",t+a,o],["L",t+a,e+r-2]]}));var Ck=ib({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var Lk=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Ig({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return _e(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,r=t.node().getBBox(),i=r.width,a=r.height,o=e.node().getBBox(),s=o.width,c=o.height;return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,a,c)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=je(Db(t),2),n=e[0],r=e[1],i=this.showValue?r:0,a=n+i;return[n/a,i/a]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,a=i.markerWidth,o=i.height,s=this.actualSpace,c=s.labelWidth,l=s.valueWidth,u=je(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=je(this.span,2);c=(t=je([p[0]*d,p[1]*d],2))[0],l=t[1]}return{width:a+c+l+f+h,height:o,markerWidth:a,labelWidth:c,valueWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=je(Db(t),2),n=e[0],r=e[1];return this.showValue?[n,r]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,a=t.height,o=je(this.spacing,2),s=o[0];return{height:a,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+s,e+n+s+o[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(Ck.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,a=e.markerLineWidth,o=void 0===a?t.lineWidth:a,s=e.markerStroke,c=void 0===s?t.stroke:s,l=+(i||o||(c?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,h=u.height;return(1-l/Math.max(f,h))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=$b(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Ck.markerGroup,"g").style("zIndex",0),gb(!!n,this.markerGroup,(function(){var t,i=e.markerGroup.node(),a=null===(t=i.childNodes)||void 0===t?void 0:t[0],o="string"==typeof n?new rx({style:{symbol:n},className:Ck.marker.name}):n();a?o.nodeName===a.nodeName?a instanceof rx?a.update(Te(Te({},r),{symbol:n})):(!function(t,e){var n,r,i=e.attributes;try{for(var a=Ne(Object.entries(i)),o=a.next();!o.done;o=a.next()){var s=je(o.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}(a,o),Ib(a).styles(r)):(a.remove(),Ib(o).attr("className",Ck.marker.name).styles(r),i.appendChild(o)):(o instanceof rx||Ib(o).attr("className",Ck.marker.name).styles(r),i.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=jb(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")}))},e.prototype.renderLabel=function(t){var e=$b(this.attributes,"label"),n=e.text,r=Pe(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Ck.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Ck.label,(function(){return pb(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=$b(this.attributes,"value"),r=n.text,i=Pe(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Ck.valueGroup,"g").style("zIndex",0),gb(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(Ck.value,(function(){return pb(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=$b(this.attributes,"background");this.background=t.maybeAppendByClassName(Ck.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Ck.background,"rect").styles(Te({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=je(t.position,3),a=i[0],o=i[1],s=i[2],c=r/2;this.markerGroup.styles({transform:"translate(".concat(a,", ").concat(c,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(o,", ").concat(c,")")}),hb(this.labelGroup.select(Ck.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),hb(this.valueGroup.select(Ck.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Ib(e),r=t.x,i=void 0===r?0:r,a=t.y,o=void 0===a?0:a;n.styles({transform:"translate(".concat(i,", ").concat(o,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(Xb),Nk=ib({page:"item-page",navigator:"navigator",item:"item"},"items"),jk=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Rk=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:it,mouseenter:it,mouseleave:it})||this;return n.navigatorShape=[0,0],n}return _e(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=$b(this.attributes,"item"),i=e.map((function(t,i){var a=t.id,o=void 0===a?i:a,s=t.label,c=t.value;return{id:"".concat(o),index:i,style:Te({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=je(n,2);return[r[0],Jy(r[1],[t,i,e])]}))))}}));return i},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,a=e.colPadding,o=je(this.navigatorShape,1)[0],s=je(this.grid,2),c=s[0],l=s[1],u=l*c,f=0;return this.pageViews.children.map((function(e,s){var h,d,p=Math.floor(s/u),g=s%u,v=t.ifHorizontal(l,c),m=[Math.floor(g/v),g%v];"vertical"===n&&m.reverse();var y=je(m,2),b=y[0],x=y[1],k=(r-o-(l-1)*a)/l,w=e.getBBox().height,M=je([0,0],2),O=M[0],E=M[1];return"horizontal"===n?(O=(h=je([f,b*(w+i)],2))[0],E=h[1],f=x===l-1?0:f+k+a):(O=(d=je([x*(k+a),f],2))[0],E=d[1],f=b===c-1?0:f+w+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:k,height:w,x:O,y:E}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,a=je(this.navigatorShape,1)[0],o=je(this.grid,2),s=o[0],c=o[1],l=je([e-a,n],2),u=l[0],f=l[1],h=je([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],v=h[3],m=h[4],y=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,a,o,l,h=t.getBBox(),k=h.width,w=h.height,M=0===b?0:i,O=b+M+k;return O<=u&&jk(m,(function(t){return t<c}))?(n=je([b+M,x,O],3),d=n[0],p=n[1],b=n[2],{width:k,height:w,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(a=je([y+1,0,0,x+w+r],4),y=a[0],m=a[1],b=a[2],(x=a[3])+w<=f&&jk(y,(function(t){return t<s}))?(o=je([b,x,k],3),d=o[0],p=o[1],b=o[2],{width:k,height:w,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(l=je([0,0,k,0,g+1,0,0,0],8),d=l[0],p=l[1],b=l[2],x=l[3],g=l[4],v=l[5],y=l[6],m=l[7],{width:k,height:w,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Pk(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Nk.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Nk.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var a=this.dispatchCustomEvent.bind(this);Ib(t).selectAll(Nk.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Lk({style:e})})).attr("className",Nk.item.name).on("click",(function(){null==n||n(this),a("itemClick",{item:this})})).on("pointerenter",(function(){null==r||r(this),a("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),a("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,a=je(this.navigatorShape,2),o=a[0],s=a[1];this.navigator.update("grid"===n?{pageWidth:r-o,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=je(t,2);return{page:e[0],layouts:e[1]}})),i=Re([],je(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new zg({className:Nk.page.name}));e.forEach((function(t){var e=t.x,n=t.y,a=t.index,o=t.width,s=t.height,c=i[a];r.appendChild(c),function(t,e,n){var r=t,i=C(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(x(r[t])||(r[t]=j(i[e+1])?[]:{}),r=r[t]):r[t]=n}))}(c,"__layout__",t),c.update({x:e,y:n,width:o,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=$b(this.attributes,"nav"),r=ob({orientation:e},n),i=this;return t.selectAll(Nk.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Tk({style:r})})).attr("className",Nk.navigator.name).each((function(){i.navigator=this}))}),(function(t){return t.each((function(){this.update(r)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(Ib(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Rp(t,{detail:e});this.dispatchEvent(n)},e}(Xb),Ik=ib({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Dk={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},Bk=function(t){function e(e){return t.call(this,e,Dk)||this}return _e(e,t),e.prototype.render=function(t,e){var n=Ib(e).maybeAppendByClassName(Ik.markerGroup,"g");this.renderMarker(n);var r=Ib(e).maybeAppendByClassName(Ik.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,a=void 0===i?Pk(r,"horizontalHandle","verticalHandle"):i;gb(!!a,t,(function(t){var n=$b(e.attributes,"marker"),r=Te({symbol:a},n);e.marker=t.maybeAppendByClassName(Ik.marker,(function(){return new rx({style:r})})).update(r)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,a=n.spacing,o=void 0===a?0:a,s=n.formatter;gb(r,t,(function(t){var n,r=$b(e.attributes,"label"),a=r.text,c=Pe(r,["text"]),l=(null===(n=t.select(Ik.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=je(Pk(i,[0,(void 0===h?0:h)+o,"center","top"],[f+o,0,"start","middle"]),4),p=d[0],g=d[1],v=d[2],m=d[3];t.maybeAppendByClassName(Ik.label,"text").styles(Te(Te({},c),{x:p,y:g,text:s(a).toString(),textAlign:v,textBaseline:m}))}))},e}(Xb),Fk={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},zk=ob({},Fk,{}),Gk=ob({},Fk,Yb(Dk,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),Wk=ib({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),$k=function(t){function e(e){return t.call(this,e,zk)||this}return _e(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,a=r.titleText,o=je(Hb($b(this.attributes,"title")),2),s=o[0],c=o[1];this.titleGroup=t.maybeAppendByClassName(Wk.titleGroup,"g").styles(c);var l=Te(Te({width:e,height:n},s),{text:i?a:""});this.title=this.titleGroup.maybeAppendByClassName(Wk.title,(function(){return new Ok({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,a=e.height,o=je(Hb($b(this.attributes,"title",!0)),2),s=o[0],c=o[1],l=Te(Te({},s),{width:i,height:a,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Wk.itemsGroup,"g").styles(Te(Te({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Wk.items.class).data(["items"]).join((function(t){return t.append((function(){return new Rk({style:l})})).attr("className",Wk.items.name).each((function(){u.items=Ib(this)}))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new Qy(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,a=n.inset,o=n.text,s=t.getBBox(),c=e.getBBox(),l=wk(r),u=je(Db(o?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=je(Db(a),4),v=g[0],m=g[1],y=g[2],b=g[3],x=je([p+h,f+d],2),k=x[0],w=x[1],M=je([b+m,v+y],2),O=M[0],E=M[1];if("l"===l[0])return new Qy(s.x,s.y,c.width+s.width+k+O,Math.max(c.height+E,s.height));if("t"===l[0])return new Qy(s.x,s.y,Math.max(c.width+O,s.width),c.height+s.height+w+E);var S=je([e.attributes.width||c.width,e.attributes.height||c.height],2),A=S[0],_=S[1];return new Qy(c.x,c.y,A+s.width+k+O,_+s.height+w+E)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,r=n.width,i=n.height,a=n.x,o=void 0===a?0:a,s=n.y,c=void 0===s?0:s,l=Ib(e);e.style.transform="translate(".concat(o,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(Xb),Yk={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},Hk=ib({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Vk=function(t){function e(e){var n=t.call(this,e,Yk)||this;return n.point=[0,0],n.group=n.appendChild(new zg({})),n.isMutationObserved=!0,n}return _e(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=je(Db(t.padding),4),r=n[0],i=n[1],a=n[2],o=n[3],s=this.label.node().getLocalBounds(),c=s.min,l=s.max,u=new Qy(c[0]-o,c[1]-r,l[0]+i-c[0]+o,l[1]+a-c[1]+r),f=this.getPath(e,u),h=$b(this.attributes,"background");this.background=Ib(this.group).maybeAppendByClassName(Hk.background,"path").styles(Te(Te({},h),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=je(Hb($b(this.attributes,"label")),2),i=r[0],a=r[1],o=Pe(i,["text"]);(this.label=Ib(this.group).maybeAppendByClassName(Hk.labelGroup,"g").styles(a),n)&&this.label.maybeAppendByClassName(Hk.label,(function(){return pb(e(n))})).style("text",e(n).toString()).selectAll("text").styles(o)},e.prototype.adjustLayout=function(){var t=je(this.point,2),e=t[0],n=t[1],r=this.attributes,i=r.x,a=r.y;this.group.attr("transform","translate(".concat(i-e,", ").concat(a-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,a=e.width,o=e.height,s=[["M",r+n,i],["L",r+a-n,i],["A",n,n,0,0,1,r+a,i+n],["L",r+a,i+o-n],["A",n,n,0,0,1,r+a-n,i+o],["L",r+n,i+o],["A",n,n,0,0,1,r,i+o-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],c={top:4,right:6,bottom:0,left:2}[t],l=this.createCorner([s[c].slice(-2),s[c+1].slice(-2)]);return s.splice.apply(s,Re([c+1,1],je(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Fb.apply(void 0,Re([],je(t),!1)),r=je(t,2),i=je(r[0],2),a=i[0],o=i[1],s=je(r[1],2),c=s[0],l=s[1],u=je(n?[c-a,[a,c]]:[l-o,[o,l]],2),f=u[0],h=je(u[1],2),d=h[0],p=h[1],g=f/2,v=e*(f/Math.abs(f)),m=v/2,y=v*Math.sqrt(3)/2*.8,b=je([d,d+g-m,d+g,d+g+m,p],5),x=b[0],k=b[1],w=b[2],M=b[3],O=b[4];return n?(this.point=[w,o-y],[["L",x,o],["L",k,o],["L",w,o-y],["L",M,o],["L",O,o]]):(this.point=[a+y,w],[["L",a,x],["L",a,k],["L",a+y,w],["L",a,M],["L",a,O]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?Hy(this):Yy(this)},e.prototype.bindEvents=function(){this.label.on(Hp.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Xb);function qk(t,e){var n=je(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var Uk=ib({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Xk(t){var e=t.orientation,n=t.size,r=t.length;return Pk(e,[r,n],[n,r])}function Zk(t){var e=t.type,n=je(Xk(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function Kk(t){return Zk(t)}function Qk(t){var e,n=t.orientation,r=t.color,i=t.block,a=t.partition;if(m(r)){e=new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))}))}else e=r;var o=e.length,s=e.map((function(t){return hh(t).toString()}));return o?1===o?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce((function(e,n,a){var o=r[a%r.length];return e+" ".concat(t[a],":").concat(o).concat(a<i-1?" ".concat(t[a+1],":").concat(o):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(a,s,n):s.reduce((function(t,e,n){return t+" ".concat(n/(o-1),":").concat(e)}),"l(".concat(Pk(n,"0","270"),")")):""}function Jk(t){var e=t.orientation,n=t.range;if(!n)return[];var r=je(Xk(t),2),i=r[0],a=r[1],o=je(n,2),s=o[0],c=o[1],l=Pk(e,s*i,0),u=Pk(e,0,s*a),f=Pk(e,c*i,i),h=Pk(e,a,c*a);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var tw=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return _e(e,t),e.prototype.render=function(t,e){!function(t,e){var n=$b(e,"track");t.maybeAppendByClassName(Uk.track,"path").styles(Te({d:Zk(e)},n))}(Ib(e).maybeAppendByClassName(Uk.trackGroup,"g"),t),function(t,e){var n=$b(e,"selection"),r=Qk(e),i=t.maybeAppendByClassName(Uk.selection,"path").styles(Te({d:Kk(e),fill:r},n)),a=i.maybeAppendByClassName(Uk.clipPath,"path").styles({d:Jk(e)}).node();i.style("clipPath",a)}(Ib(e).maybeAppendByClassName(Uk.selectionGroup,"g"),t)},e}(Xb);var ew=function(t){function e(e){var n=t.call(this,e,Gk)||this;return n.eventToOffsetScale=new oo({}),n.innerRibbonScale=new oo({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var a=n.getValueByCanvasPoint(t);if(i){var o=qk(r.map((function(t){return t.value})),a).range,s=n.getRealSelection(o);n.showIndicator((o[0]+o[1])/2,"".concat(s[0],"-").concat(s[1])),n.dispatchIndicated(a,o)}else{var c=n.getTickValue(a);n.showIndicator(c,"".concat(n.getRealValue(c))),n.dispatchIndicated(c)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=je(n.selection,2),i=r[0],a=r[1],o=n.getTickValue(n.getValueByCanvasPoint(t)),s=o-n.prevValue;"start"===e?i!==o&&n.updateSelection(o,a):"end"===e?a!==o&&n.updateSelection(i,o):"ribbon"===e&&0!==s&&(n.prevValue=o,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="pointer",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return _e(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new Qy(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Ib(e));var i=this.availableSpace,a=i.x,o=i.y,s=Ib(e).maybeAppendByClassName(Wk.contentGroup,"g").styles({transform:"translate(".concat(a,", ").concat(o,")")});gb(!!r,s.maybeAppendByClassName(Wk.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Wk.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Wk.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(c),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:function(t){return{min:Math.min.apply(Math,Re([],je(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,Re([],je(t.map((function(t){return t.value}))),!1))}}(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=je(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=je(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Pk(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,a=e.height,o=$b(this.attributes,"title"),s=Te(Te({},o),{width:i,height:a,text:r}),c=this;t.selectAll(Wk.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new Ok({style:s})})).attr("className",Wk.title.name).each((function(){c.title=this}))}),(function(t){return t.update(s)}),(function(t){return t.each((function(){c.title=void 0})).remove()}))},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new Qy(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new Qy(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(_x.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new Qy(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,a=i.width,o=i.height;return{width:a,height:o,size:this.ifHorizontal(o,a)+r+this.labelFixedSpacing,length:this.ifHorizontal(a,o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,a=r.height,o=this.labelShape,s=o.size,c=o.length,l=je(this.ifHorizontal([a,i],[i,a]),2),u=l[0],f=l[1],h=e?this.handleShape:{size:0,length:0},d=h.size,p=h.length,g=this.handleOffsetRatio,v=0,m=this.labelPosition;v=n||(["bottom","right"].includes(m)?Math.min(u-s,(u-d)/g):u*(1-g)>d?Math.max(u-s,0):Math.max((u-s-d)/g,0));var y=Math.max(p,c),b=f-y,x=je(this.ifHorizontal([b,v],[v,b]),2),k=x[0],w=x[1],M=["top","left"].includes(m)?s:0,O=je(this.ifHorizontal([y/2,M],[M,y/2]),2),E=O[0],S=O[1];return new Qy(E,S,k,w)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,o=e.block,s=$b(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,h=f.x,d=f.y,p=this.ribbonShape,g=p.length,v=p.size,m=ob({transform:"translate(".concat(h,", ").concat(d,")"),length:g,size:v,type:r,orientation:i,color:a,block:o,partition:n.map((function(t){return(t.value-l)/(u-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(Wk.ribbon,(function(){return new tw({style:m})})).update(m)},e.prototype.getHandleClassName=function(t){return"".concat(Wk.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=$b(this.attributes,"handle"),i=je(this.selection,2),a=i[0],o=i[1],s=Te(Te({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?Bk:Ox,u=this;this.handlesGroup.selectAll(Wk.handle.class).data(e?[{value:a,type:"start"},{value:o,type:"end"}]:[],(function(t){return t.type})).join((function(t){return t.append((function(){return new l({style:s})})).attr("className",(function(t){var e=t.type;return"".concat(Wk.handle," ").concat(u.getHandleClassName(e))})).each((function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");u[r]=this,this.addEventListener("pointerdown",u.onDragStart(e))}))}),(function(t){return t.update(s).each((function(t){var e=t.value;this.update({labelText:e})}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");u[n]=void 0})).remove()}))},e.prototype.adjustHandles=function(){var t=je(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Qy(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,a=r.height,o=je([Math.max(e,i),Math.max(n,a)],2),s=o[0],c=o[1];return this.cacheHandleBBox=new Qy(0,0,s,c),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=je(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,a=r.y,o=this.ribbonShape.size,s=this.getOffset(e),c=je(this.ifHorizontal([i+s,a+o*this.handleOffsetRatio],[i+o*this.handleOffsetRatio,a+s]),2),l=c[0],u=c[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({transform:"translate(".concat(l,", ").concat(u,")"),formatter:n})},e.prototype.renderIndicator=function(t){var e=$b(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Wk.indicator,(function(){return new Vk({})})).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce((function(e,n,r,i){var a,o,s=null!==(a=null==n?void 0:n.id)&&void 0!==a?a:r.toString();if(e.push(Te(Te({},n),{id:s,index:r,type:"value",label:null!==(o=null==n?void 0:n.label)&&void 0!==o?o:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var c=i[r+1],l=je([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(Te(Te({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(h)}))}return e}),[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=je(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,a=e.labelFormatter,o=$b(this.attributes,"tick"),s=$b(this.attributes,"label"),c=s.align,l=ob(Te({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Yb(o,"tick"),Yb(s,"label"),{data:this.labelData}),u={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter((function(t){return"value"!==t.type}))))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===c&&(!i||i(t,t.index,n.filter((function(t){return t.type===c}))))},labelFormatter:a},f=Te(Te(Te({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Wk.label,(function(){return new Ak({style:f})})).node(),this.label.update(f,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,a=this.ribbonShape.size,o=this.labelPosition,s=this.labelFixedSpacing,c=je([0,0,0],3),l=c[0],u=c[1],f=c[2],h=null!=i?i:a;return e?(f=h,u=s,"positive"===n?"right"===o?(l=h,f=h):"bottom"===o&&(l=f):"negative"===n&&("top"===o||"left"===o)&&(l=a)):"positive"===n?"right"===o?u=h:"bottom"===o&&(l=a+s,u=r):"negative"===n&&("left"===o||"top"===o)&&(u=r),{offset:l,spacing:u,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,a=this.labelAxisStyle,o=a.offset,s=a.spacing,c=a.tickLength,l=je(this.ifHorizontal([[e,n+o],[e+r,n+o]],[[e+o,n+i],[e+o,n]]),2),u=l[0],f=l[1];this.label.update({startPos:u,endPos:f,tickLength:c,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,a=this.ribbonBBox,o=a.x,s=a.y,c=N(t,r,i),l=this.getOffset(c),u=this.ifHorizontal([l+o,s],[o,l+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),Yy(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Hy(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=je(this.selection,2),a=i[0],o=i[1],s=je([t,e],2),c=s[0],l=s[1];n&&(c+=a,l+=o);var u=this.range;r=je(function(t,e,n){var r,i=je(t,2),a=i[0],o=i[1],s=je(e,2),c=s[0],l=s[1],u=je(n,2),f=u[0],h=u[1],d=je([c,l],2),p=d[0],g=d[1],v=g-p;return p>g&&(p=(r=je([g,p],2))[0],g=r[1]),v>o-a?[a,o]:p<a?f===a&&h===g?[a,g]:[a,v+a]:g>o?h===o&&f===p?[p,o]:[o-v,o]:[p,g]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return $(e)?_b(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?qk(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=je(this.ribbon.node().getPosition(),2),a=i[0],o=i[1],s=this.ifHorizontal(a,o),c=this.ifHorizontal.apply(this,Re([],je(db(t)),!1))-s;return N(this.getOffset(c,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,a=this.ribbonShape.length,o=this.eventToOffsetScale;return o.update({domain:[r,i],range:[0,a]}),e?o.invert(t):o.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=je(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new Rp("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal((function(){return{value:t,range:e}}),(function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}})),a=new Rp("indicate",{detail:i});this.dispatchEvent(a)},e}(Xb);function nw(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var rw={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function iw(t){var e;void 0===t&&(t="");var n=nw(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=Te({flex:1},rw),e[".".concat(n.VALUE)]=Te({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},rw),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var aw=function(t){function e(e){var n,r,i=this,a=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,o=nw(a);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(o.CONTAINER,'"></div>'),title:'<div class="'.concat(o.TITLE,'"></div>'),item:'<li class="'.concat(o.LIST_ITEM,'" data-index={index}>\n <span class="').concat(o.NAME,'">\n <span class="').concat(o.MARKER,'" style="background:{color}"></span>\n <span class="').concat(o.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(o.VALUE,'" title="{value}">{value}</span>\n </li>')},style:iw(a)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return _e(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,i=void 0===r?"":r,a=t.color,o=void 0===a?"black":a,s=t.index,c=Pe(t,["name","color","index"]),l=Te({name:i,color:o,index:null!=s?s:e},c);return kn(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}(n.item,l))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=kn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:qb(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,a=n.enterable,o=n.style,s=n.content,c=nw(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=a?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,qb(f,u);var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach((function(e){var n=je(e,2),r=n[0],i=n[1];Re([t],je(t.querySelectorAll(r)),!1).filter((function(t){return t.matches(r)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(i).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(l,o)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},o=this.elementSize,s=o.width,c=o.height,l=[-s/2,-c/2];return i.forEach((function(t){var e=je(l,2),n=e[0],i=e[1],o=je(a[t],2),u=o[0],f=o[1];l=[n+(s/2+r[0])*u,i+(c/2+r[1])*f]})),l},e.prototype.setOffsetPosition=function(t){var e=je(t,2),n=e[0],r=e[1],i=this.attributes,a=i.x,o=void 0===a?0:a,s=i.y,c=void 0===s?0:s,l=i.container,u=l.x,f=l.y;this.element.style.left="".concat(+o+u+n,"px"),this.element.style.top="".concat(+c+f+r,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestamp<e||(this.timestamp=n,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var e=je(t,2),n=e[0],r=e[1],i=this.attributes,a=i.x,o=i.y,s=i.bounding,c=i.position;if(!s)return[n,r];var l=this.element,u=l.offsetWidth,f=l.offsetHeight,h=je([+a+n,+o+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,m=s.y,y={left:d<v,right:d+u>v+s.width,top:p<m,bottom:p+f>m+s.height},b=[];c.split("-").forEach((function(t){y[t]?b.push(g[t]):b.push(t)}));var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,a=n.width,o=n.height;return new Qy(r,i,a,o).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout((function(){e.element.style.transition=n}),10)},e.tag="tooltip",e}(Xb),ow=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[Hp.BOUNDS_CHANGED,Hp.INSERTED,Hp.REMOVED],n.$margin=Db(0),n.$padding=Db(0);var r=e.style||{},i=r.margin,a=void 0===i?0:i,o=r.padding,s=void 0===o?0:o;return n.margin=a,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return _e(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Db(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Db(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,a=t.width,o=t.height,s=je(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new Qy(n-f,i-c,a+f+l,o+c+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=je(this.$padding,4),i=r[0],a=r[1],o=r[2],s=r[3],c=je(this.$margin,4),l=c[0],u=c[3];return new Qy(s+u,i+l,e-s-a,n-i-o)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some((function(t){return!t.isConnected})))try{var t=this.attributes,e=t.x,n=t.y;this.style.transform="translate(".concat(e,", ").concat(n,")");var r=function(t,e,n){if(0===e.length)return[];var r={flex:bb,grid:xb},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map((function(t){return t.getBBox()})),this.attributes);this.children.forEach((function(t,e){var n=r[e],i=n.x,a=n.y;t.style.transform="translate(".concat(i,", ").concat(a,")")}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target&&(e.target.isMutationObserved=!0,t.layout())}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(zg);function sw(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let a=0,o=0;return e>0&&(a=e),r<0&&(a=r),n>0&&(o=n),i<0&&(o=i),[a,o]}const cw=jm((t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:a,labelTransform:o,labelTransformOrigin:s,x:c,y:l,x0:u=c,y0:f=l,text:h,background:d,connector:p,startMarker:g,endMarker:v,coordCenter:m,innerHTML:y}=e,b=Pe(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if(t.style.transform=`translate(${c}, ${l})`,[c,l,u,f].some((t=>!j(t))))return void t.children.forEach((t=>t.remove()));const x=_r(b,"background"),{padding:k}=x,w=Pe(x,["padding"]),M=_r(b,"connector"),{points:O=[]}=M,E=Pe(M,["points"]);let S;S=y?pm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",y).call(ym,Object.assign({transform:o,transformOrigin:s},b)).node():pm(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(ym,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},b)).node();const A=pm(t).maybeAppend("background","rect").style("zIndex",-1).call(ym,function(t,e=[]){const[n=0,r=0,i=n,a=r]=e,o=t.parentNode,s=o.getEulerAngles();o.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[h,d]=l;return o.setEulerAngles(s),{x:u-a,y:f-n,width:2*h+a+r,height:2*d+n+i}}(S,k)).call(ym,d?w:{}).node(),_=function(t,e,n,r,i=!0,a=!0){const o=t=>fc()(t);if(!e[0]&&!e[1])return o([sw(t),e]);if(!n.length)return o([[0,0],e]);const[s,c]=n,l=[...c],u=[...s];if(c[0]!==s[0]){const t=i?-4:4;l[1]=c[1],a&&!i&&(l[0]=Math.max(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),a||i||(l[0]=Math.max(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),!a&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t))),a&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t)))}return o([c,l,u,s,e])}(A,[+u-+c,+f-+l],O,0,+u<m[0],+f<m[1]),T=g&&new rx({id:"startMarker",style:Object.assign({x:0,y:0},_r(b,"startMarker"))}),P=v&&new rx({id:"endMarker",style:Object.assign({x:0,y:0},_r(b,"endMarker"))});pm(t).maybeAppend("connector","path").style("zIndex",0).style("d",_).style("markerStart",T).style("markerEnd",P).call(ym,p?E:{})})),lw=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:a,text:o="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(o),stroke:a,fill:a,fontSize:s},[[f,h]]=e;return pm(new cw).style("x",f).style("y",h).call(ym,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(ym,u).call(ym,t).node()}};lw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const uw=jm((t=>{const e=Pe(t.attributes,["class","x","y","transform"]),n=_r(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",a,o],["Z"]]}(r/2),a=pm(t).maybeAppend("marker",(()=>new rx({}))).call((t=>t.node().update(Object.assign({symbol:i},n)))).node(),[o,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(a);pm(t).maybeAppend("text","text").style("x",o).style("y",s).call(ym,e)})),fw=(t,e)=>{const n=Pe(t,[]);return(t,e,r)=>{const{color:i}=r,a=Pe(r,["color"]),{color:o=i,text:s=""}=e,c={text:String(s),stroke:o,fill:o},[[l,u]]=t;return pm(new uw).call(ym,a).style("transform",`translate(${l},${u})`).call(ym,c).call(ym,n).node()}};fw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hw=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:a,text:o="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(o),stroke:a,fill:a,fontSize:s,textAlign:"center",textBaseline:"middle"},[[f,h]]=e;return pm(new tv).style("x",f).style("y",h).call(ym,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(ym,u).call(ym,t).node()}};hw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dw=jm((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,a=t.ownerDocument;pm(t).maybeAppend("connect-path",(()=>a.createElement("path",{}))).style("d",n).call(ym,i),pm(t).maybeAppend("area-path",(()=>a.createElement("path",{}))).style("d",e).call(ym,r)})),pw=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=t=>!Number.isNaN(t)&&null!=t,connect:a=!1}=t,o=Pe(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(t,e,l)=>{const{color:u}=l,{color:f=u,seriesColor:h,seriesX:d,seriesY:p}=e,g=zc(s),v=Om(s,e),m=r&&h?xm(h,d,p,r,void 0,g):f,y=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:m,fill:m}),v&&{transform:v}),o),[b,x]=function(t,e){const n=[],r=[],i=[];let a=!1,o=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))a=!0;else{if(n.push(l),r.push(u),a&&o){a=!1;const[t,e]=o;i.push([t,l,e,u])}o=[l,u]}}return[n.concat(r),i]}(t,i),k=_r(y,"connect"),w=!!x.length,M=t=>pm(c.createElement("path",{})).style("d",t||"").call(ym,y).node();if(Gc(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),a=t.slice(t.length/2);return function(){var t=hc().curve(dc),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return vc(n())},delete t.lineX0,t.lineEndAngle=function(){return vc(r())},delete t.lineX1,t.lineInnerRadius=function(){return vc(i())},delete t.lineY0,t.lineOuterRadius=function(){return vc(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(gc(t)):e()._curve},t}().angle(((t,n)=>bs(gs(r[n],e)))).outerRadius(((t,n)=>ms(r[n],e))).innerRadius(((t,n)=>ms(a[n],e))).defined(((t,e)=>[...r[e],...a[e]].every(i))).curve(n)(a)};return!w||a&&!Object.keys(k).length?M(e(b)):w&&!a?M(e(t)):pm(new dw).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},k),o)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?hc().y(((t,n)=>e[n][1])).x1(((t,n)=>e[n][0])).x0(((t,e)=>r[e][0])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e):hc().x(((t,n)=>e[n][0])).y1(((t,n)=>e[n][1])).y0(((t,e)=>r[e][1])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e)};return!w||a&&!Object.keys(k).length?M(e(b)):w&&!a?M(e(t)):pm(new dw).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},k),o)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};pw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gw=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Gc(n)?Sc:cc;return pw(Object.assign({curve:i},t),e)(...r)}};gw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"square"});const vw=(t,e)=>{const n=Pe(t,[]),{coordinate:r}=e;return(...t)=>{const i=Gc(r)?Oc:zc(r)?Rc:jc;return pw(Object.assign({curve:i},n),e)(...t)}};vw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"smooth"});const mw=(t,e)=>(...n)=>pw(Object.assign({curve:Dc},t),e)(...n);mw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"hvh"});const yw=(t,e)=>(...n)=>pw(Object.assign({curve:Bc},t),e)(...n);yw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"vh"});const bw=(t,e)=>(...n)=>pw(Object.assign({curve:Fc},t),e)(...n);bw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"hv"});const xw=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Wy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};xw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kw=(t,e)=>{const n=Pe(t,[]),{document:r}=e;return(t,e,i)=>{const{color:a}=i,o=Pe(i,["color"]),{color:s=a,transform:c}=e,[l,u]=t,f=Ks();return f.moveTo(l[0],l[1]),f.bezierCurveTo(l[0]/2+u[0]/2,l[1],l[0]/2+u[0]/2,u[1],u[0],u[1]),pm(r.createElement("path",{})).call(ym,o).style("d",f.toString()).style("stroke",s).style("transform",c).call(ym,n).node()}};function ww(t,e,n,r){const i=Ks();if(Gc(n)){const a=n.getCenter(),o=ms(t,a),s=(ms(e,a)-o)*r+o;return i.moveTo(t[0],t[1]),bm(i,t,e,a,s),i.lineTo(e[0],e[1]),i}return zc(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}kw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Mw=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Pe(t,["cornerRatio"]),{coordinate:i,document:a}=e;return(t,e,o)=>{const{defaultColor:s}=o,c=Pe(o,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=ww(f,h,i,n);return pm(a.createElement("path",{})).call(ym,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(ym,r).node()}};Mw.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ow=(t,e)=>{const n=Pe(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:o}=a,s=Pe(a,["color"]),{color:c=o,transform:l}=e,[u,f]=t,h=Ks();if(h.moveTo(u[0],u[1]),Gc(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{bm(h,u,f,ws(u,f),ms(u,f)/2)}return pm(i.createElement("path",{})).call(ym,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(ym,n).node()}};function Ew(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function Sw(t={}){return[...Ew(t),{name:"title",scale:"identity"}]}function Aw(){return[{type:ei,channel:"color"},{type:pi,channel:["x","y"]}]}function _w(){return[{type:ei,channel:"x"},{type:pi,channel:["y"]}]}function Tw(t={}){return Ew(t)}function Pw(){return[{type:oi}]}function Cw(t,e){return t.getBandWidth(t.invert(e))}function Lw(t,e,n={}){const{x:r,y:i,series:a}=e,{x:o,y:s,series:c}=t,{style:{bandOffset:l=(c?0:.5),bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,h=!!(null==o?void 0:o.getBandWidth),d=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return h||d?(t,e)=>{const n=h?Cw(o,r[e]):0,l=d?Cw(s,i[e]):0,g=p&&a?(Cw(c,a[e])/2+ +a[e])*n:0,[v,m]=t;return[v+u*n+g,m+f*l]}:t=>t}function Nw(t){return parseFloat(t)/100}function jw(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions();return[t,Array.from(t,(t=>{const e=i[t],n=a[t];return[["string"==typeof e?Nw(e)*o:+e,"string"==typeof n?Nw(n)*s:+n]]}))]}Ow.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Rw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o}=a,s=Pe(a,["color"]),{color:c=o,src:l="",size:u=32,transform:f=""}=i;let{width:h=u,height:d=u}=t;const[[p,g]]=e,[v,m]=n.getSize();h="string"==typeof h?Nw(h)*v:h,d="string"==typeof d?Nw(d)*m:d;const y=p-Number(h)/2,b=g-Number(d)/2;return pm(r.createElement("image",{})).call(ym,s).style("x",y).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(ym,t).style("width",h).style("height",d).node()}};function Iw(t,e){const n=Ks();if(Gc(e)){const r=e.getCenter(),i=[...t,t[0]],a=i.map((t=>ms(t,r)));return i.forEach(((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const o=a[i],s=t[i-1],c=a[i-1];void 0!==c&&Math.abs(o-c)<1e-10?bm(n,s,e,r,o):n.lineTo(e[0],e[1])})),n.closePath(),n}return function(t,e){return e.forEach(((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1]))),t.closePath(),t}(n,t)}Rw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o}=a,s=Pe(a,["color"]),{color:c=o,transform:l}=i,u=Iw(e,n);return pm(r.createElement("path",{})).call(ym,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(ym,t).node()}};function Bw(t,e){const[n,r,i,a]=t,o=Ks();if(Gc(e)){const t=e.getCenter(),s=ms(t,n);return o.moveTo(n[0],n[1]),o.quadraticCurveTo(t[0],t[1],i[0],i[1]),bm(o,i,a,t,s),o.quadraticCurveTo(t[0],t[1],r[0],r[1]),bm(o,r,n,t,s),o.closePath(),o}return o.moveTo(n[0],n[1]),o.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(n[0],n[1]),o.closePath(),o}Dw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Fw=(t,e)=>{const n=Pe(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:o}=a,s=Pe(a,["color"]),{color:c=o,transform:l}=e,u=Bw(t,r);return pm(i.createElement("path",{})).call(ym,s).style("d",u.toString()).style("fill",c||o).style("stroke",c||o).style("transform",l).call(ym,n).node()}};function zw(t,e){const n=Ks();if(Gc(e)){const r=e.getCenter(),[i,a]=r,o=ys(gs(t[0],r)),s=ys(gs(t[1],r)),c=ms(r,t[2]),l=ms(r,t[3]),u=ms(r,t[8]),f=ms(r,t[10]),h=ms(r,t[11]);n.moveTo(...t[0]),n.arc(i,a,c,o,s),n.arc(i,a,c,s,o,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,a,l,o,s),n.lineTo(...t[6]),n.arc(i,a,f,s,o,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,a,u,o,s),n.arc(i,a,u,s,o,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,a,h,o,s),n.arc(i,a,h,s,o,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}Fw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=a,f=Pe(a,["color","fill","stroke"]),h=zw(e,n);return pm(r.createElement("path",{})).call(ym,f).style("d",h.toString()).style("stroke",u).style("fill",o||l).style("transform",s).call(ym,t).node()}};function Ww(t,e,n=4){const r=Ks();if(!Gc(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[a,o]=i,s=ms(i,t[3]),c=ms(i,t[8]),l=ms(i,t[10]),u=ys(gs(t[2],i)),f=Math.asin(n/c),h=u-f,d=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(h)*s+a,Math.sin(h)*s+o),r.arc(a,o,s,h,d),r.lineTo(Math.cos(d)*l+a,Math.sin(d)*l+o),r.arc(a,o,l,d,h,!0),r.lineTo(Math.cos(h)*s+a,Math.sin(h)*s+o),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(h+d)/2;return r.moveTo(Math.cos(p)*(c+n/2)+a,Math.sin(p)*(c+n/2)+o),r.arc(Math.cos(p)*c+a,Math.sin(p)*c+o,n/2,p,2*Math.PI+p),r.closePath(),r}Gw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $w=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=a,f=Pe(a,["color","fill","stroke"]),h=Ww(e,n,4);return pm(r.createElement("path",{})).call(ym,f).style("d",h.toString()).style("stroke",u).style("fill",o||l).style("transform",s).call(ym,t).node()}};$w.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Yw=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Pe(t,["arrow","arrowSize"]),{coordinate:a,document:o}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Pe(s,["color","lineWidth"]),{color:f=c,size:h=l}=e,d=n?function(t,e,n){return t.createElement("path",{style:Object.assign({d:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,transformOrigin:"center"},n)})}(o,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},_r(i,"arrow"))):null,p=function(t,e){if(!Gc(e))return fc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return ac()({startAngle:0,endAngle:2*Math.PI,outerRadius:ms(t[0],n),innerRadius:ms(t[1],n)})}(t,a),g=function(t,e){if(!Gc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(a,e.transform);return pm(o.createElement("path",{})).call(ym,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(ym,i).node()}};function Hw(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Yw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Vw=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:a,endMarker:o=!0}=t,s=Pe(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=Pe(n,["color","connectLength1"]),{color:h,transform:d}=e,p=function(t,e,n,r,i=0){const[[a,o],[s,c]]=e;if(zc(t)){const t=a+n,e=t+i;return[[t,o],[e,o],[e,c],[s+r,c]]}const l=o-n,u=l-i;return[[a,l],[a,u],[s,u],[s,c-r]]}(c,t,r,i,null!=a?a:u),g=_r(Object.assign(Object.assign({},s),n),"endMarker");return pm(new qg).call(ym,f).style("d",function(t){return fc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",o?new rx({className:"marker",style:Object.assign(Object.assign({},g),{symbol:Hw})}):null).call(ym,s).node()}};function qw(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function Uw(t,e,n,r){const{bounds:i}=n,[[a,o],[s,c]]=i,l=s-a,u=c-o,f=t=>{const{x:e,y:r}=t,i=Cr(n.x,l),s=Cr(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+a,y:(s||r)+o})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAlign:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function Xw(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s}=n,c=r.getCenter(),l=wm(r,e,[i,a]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=Kw(p,o,s),v=(()=>{const[n,r]=e,i=u+.5*(f-u),[a,o]="inside"===t?Zw(c,p,i):ws(n,r);return{x:a,y:o}})();return Object.assign(Object.assign({},v),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function Zw(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Kw(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Qw(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=wm(r,e,[i,a]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:Kw(p,o,s)},{innerRadius:v,outerRadius:m}=u,y=v+(m-v)*c+l,[b,x]=Zw(d,p,y);return Object.assign({x:b,y:x},g)}function Jw(t){return void 0===t?null:t}function tM(t,e,n,r){const{bounds:i}=n,[a]=i;return{x:Jw(a[0]),y:Jw(a[1])}}function eM(t,e,n,r){const{bounds:i}=n;if(1===i.length)return tM(0,0,n);return(Wc(r)?Xw:Vc(r)?Qw:Uw)(t,e,n,r)}function nM(t,e,n){const r=wm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:a}=r;return i+(a-i)}function rM(t,e,n){const r=wm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:a}=r;return(i+a)/2}function iM(t,e,n,r){const{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:c=o,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),h=rM(e,n,r),d=Math.sin(h)>0?1:-1,p=Kw(h,i,a),g={textAlign:d>0||Wc(r)?"start":"end",textBaseline:"middle",rotate:p},v=nM(e,n,r),m=v+(s?c:o),[[y,b],[x,k],[w,M]]=function(t,e,n,r,i){const[a,o]=Zw(t,e,n),[s,c]=Zw(t,e,r);return[[a,o],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,v,m,s?l:0),O=s?+u*d:0,E=w+O,S={connector:s,connectorPoints:[[x-E,k-M],[w-E,M-M]]};return Object.assign(Object.assign({x0:y,y0:b,x:w+O,y:M},g),S)}function aM(t,e={}){const{labelHeight:n=14,height:r}=e,i=Jn(t,(t=>t.y)),a=i.length,o=new Array(a);for(let t=0;t<a;t++){const e=i[t],{y:r}=e;o[t]={y:r,y1:r+n,labels:[r]}}let s=!0;for(;s;){s=!1;for(let t=o.length-1;t>0;t--){const e=o[t],n=o[t-1];if(n.y1>e.y){s=!0,n.labels.push(...e.labels),o.splice(t,1),n.y1+=e.y1-e.y;const i=n.y1-n.y;n.y1=Math.max(Math.min(n.y1,r),i),n.y=n.y1-i}}}let c=0;for(const t of o){const{y:e,labels:r}=t;let a=e-n;for(const t of r){const e=i[c++],r=a+n-t;e.connectorPoints[0][1]-=r,e.y=a+n,a+=n}}}function oM(t,e){const n=Jn(t,(t=>t.y)),{height:r,labelHeight:i=14}=e,a=Math.ceil(r/i);if(n.length<=a)return aM(n,e);const o=[];for(let t=0;t<n.length;t++)t<n.length-a?(n[t].opacity=0,n[t].connector=!1):o.push(n[t]);aM(o,e)}Vw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sM=new WeakMap;var cM=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,a=e.slice(0,i),o=e.slice(i);let s=hr(a,((t,e)=>Math.abs(t[1]-o[e][1])));s=Math.max(Math.min(s,i-2),1);const c=t=>[a[t][0],(a[t][1]+o[t][1])/2],l=c(s),u=c(s-1),f=ys(gs(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:eM,bottomLeft:eM,bottomRight:eM,inside:eM,left:eM,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?tM(0,0,n):(Wc(r)?Xw:Vc(r)?iM:Uw)(t,e,n,r)},right:eM,spider:function(t,e,n,r,i,a){if(!Vc(r))return{};if(sM.has(e))return sM.get(e);const o=a.map((t=>function(t,e,n){const{connectorLength:r,connectorLength2:i,connectorDistance:a}=e,o=Pe(iM(0,t,e,n),[]),s=n.getCenter(),c=nM(t,e,n),l=rM(t,e,n),u=c+r+i,f=Math.sin(l)>0?1:-1,h=s[0]+(u+ +a)*f,{x:d}=o,p=h-d;return o.x+=p,o.connectorPoints[0][0]-=p,o}(t,n,r))),{width:s,height:c}=r.getOptions(),l=o.filter((t=>t.x<s/2)),u=o.filter((t=>t.x>=s/2)),f=Object.assign(Object.assign({},i),{height:c});return oM(l,f),oM(u,f),o.forEach(((t,e)=>sM.set(a[e],t))),sM.get(e)},surround:function(t,e,n,r){if(!Vc(r))return{};const{connectorLength:i,connectorLength2:a,connectorDistance:o}=n,s=Pe(iM(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(Vc(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find((t=>"polar"===t[0]));if(r)return Math.max(e,n)/2*r[4]}return 0}(r),h=f+i,d=bs([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,v]=Zw(u,d,h);return s.x=g+(a+o)*p,s.y=v,s},top:eM,topLeft:eM,topRight:eM});function lM(t,e,n,r,i,a){const{position:o}=e,{render:s}=i,c=function(t,e){return void 0!==t?t:Vc(e)?"inside":zc(e)?"right":"top"}(o,n),l=r[s?"htmlLabel":"inside"===c?"innerLabel":"label"],u=Object.assign({},l,e),f=cM[qw(c)];if(!f)throw new Error(`Unknown position: ${c}`);return Object.assign(Object.assign({},l),f(c,t,u,n,i,a))}const uM=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,a,o,s)=>{const{text:c,x:l,y:u,transform:f="",transformOrigin:h,className:d=""}=a,p=Pe(a,["text","x","y","transform","transformOrigin","className"]),g=lM(e,a,n,r,t,s),{rotate:v=0,transform:m=""}=g,y=Pe(g,["rotate","transform"]);return pm(new cw).call(ym,y).style("text",`${c}`).style("className",`${d} g2-label`).style("innerHTML",i?i(c,a.datum,a.index):void 0).style("labelTransform",`${m} rotate(${+v}) ${f}`.trim()).style("labelTransformOrigin",h).style("coordCenter",n.getCenter()).call(ym,p).node()}};uM.props={defaultMarker:"point"};const fM=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Pe(t,["arrow","colorAttribute"]),{coordinate:a,document:o}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Pe(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=a.getSize();return pm(o.createElement("path",{})).call(ym,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(ym,i).node()}};fM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hM=(t,e)=>fM(Object.assign({colorAttribute:"fill"},t),e);hM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dM=(t,e)=>fM(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);dM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pM=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:a}=r,{color:o}=i,s=Pe(i,["color"]),{color:c=o}=r,[l,...u]=e,f=Ks();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),pm(n.createElement("path",{})).call(ym,s).style("d",f.toString()).style("stroke",c||o).style("fill",c||o).style("fillOpacity",.4).style("transform",a).call(ym,t).node()}};function gM(t){var e,n,r,i=t||1;function a(t,a){++e>i&&(r=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}function vM(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}pM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},gM(3);const mM=function(t,e=(...t)=>`${t[0]}`,n=16){const r=gM(n);return(...n)=>{const i=e(...n);let a=r.get(i);return r.has(i)?r.get(i):(a=t(...n),r.set(i,a),a)}}(((t,e,n)=>{const r=vM(n,2*t,2*t),i=r.getContext("2d"),a=t,o=t;if(1===e)i.beginPath(),i.arc(a,o,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(a,o,t*e,a,o,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));function yM(t,e,n,r,i,a,o){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},a);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=vM(o,t,e).getContext("2d"),l=function(t,e){const n=vM(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map((t=>{const[e,n]=t.split(":");return[+e,n]})):t}(t).forEach((([t,e])=>{r.addColorStop(t,e)})),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,o);c.clearRect(0,0,t,e),function(t,e,n,r,i,a){const{blur:o}=i;let s=r.length;for(;s--;){const{x:i,y:c,value:l,radius:u}=r[s],f=Math.min(l,n),h=i-u,d=c-u,p=mM(u,1-o,a),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,h,d)}}(c,n,r,i,s,o);const u=function(t,e,n,r,i){const{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:c}=i,l=e,u=n,f=t.getImageData(0,0,l,u),h=f.data,d=h.length;for(let t=3;t<d;t+=4){const e=h[t],n=4*e;if(!n)continue;const i=o||Math.max(0,Math.min(s,Math.max(a,e)));h[t-3]=r[n],h[t-2]=r[n+1],h[t-1]=r[n+2],h[t]=c?r[n+3]:i}return f}(c,t,e,l,s),f=vM(o,t,e).getContext("2d");return f.putImageData(u,0,0),f}const bM=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:a,blur:o,useGradientOpacity:s}=t,c=Pe(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(t,e,h)=>{const{transform:d}=e,[p,g]=l.getSize(),v=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),m=dr(t,(t=>t[2])),y=fr(t,(t=>t[2])),b=p&&g?yM(p,g,m,y,v,function(t,e){return Object.keys(t).reduce(((n,r)=>{const i=t[r];return e(i,r)||(n[r]=i),n}),{})}({gradient:n,opacity:r,minOpacity:a,maxOpacity:i,blur:o,useGradientOpacity:s},(t=>void 0===t)),u):{canvas:null};return pm(f.createElement("image",{})).call(ym,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",d).call(ym,c).node()}};bM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xM=(t,e)=>{const{render:n}=t,r=Pe(t,["render"]);return t=>{const[[i,a]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:a}),e)}};function kM(t,e){return t.getBandWidth(t.invert(e))}xM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const wM={rect:_m,hollow:Tm,funnel:Cm,pyramid:Nm},MM=()=>(t,e,n,r)=>{const{x:i,y:a,y1:o,series:s,size:c}=n,l=e.x,u=e.series,[f]=r.getSize(),h=c?c.map((t=>+t/f)):null,d=c?(t,e,n)=>{const r=t+e/2,i=h[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,(t=>{const e=kM(l,i[t]),n=e*(u?kM(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[h,p]=d(f,n,t),g=+a[t],v=+o[t];return[[h,g],[p,g],[p,v],[h,v]].map((t=>r.map(t)))}));return[t,p]};MM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:wM,channels:[...Sw({shapes:Object.keys(wM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Pw(),{type:Pn},{type:ni}],postInference:[..._w()],interaction:{shareTooltip:!0}};const OM={rect:_m,hollow:Tm},EM=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n,c=Array.from(t,(t=>[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,c]};EM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:OM,channels:[...Sw({shapes:Object.keys(OM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw(),{type:Pn}],postInference:[..._w()],interaction:{shareTooltip:!0}};const SM={line:Dm,smooth:Bm,hv:Fm,vh:zm,hvh:Gm,trail:$m},AM=(t,e,n,r)=>{var i,a;const{series:o,x:s,y:c}=n,{x:l,y:u}=e;if(void 0===s||void 0===c)throw new Error("Missing encode for x or y channel.");const f=o?Array.from(Un(t,(t=>o[t])).values()):[t],h=f.map((t=>t[0])).filter((t=>void 0!==t)),d=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,p=((null===(a=null==u?void 0:u.getBandWidth)||void 0===a?void 0:a.call(u))||0)/2,g=Array.from(f,(t=>t.map((t=>r.map([+s[t]+d,+c[t]+p])))));return[h,g,f]},_M=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),a=[];for(let t=0;t<n.length;t+=2)a.push([n[t],n[t+1]]);return a}))]},TM=()=>(t,e,n,r)=>(Yc(r)?_M:AM)(t,e,n,r);TM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:SM,channels:[...Sw({shapes:Object.keys(SM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Pw(),{type:bi},{type:si}],postInference:[..._w(),{type:ei,channel:"color"},{type:pi,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const PM={hollow:My,hollowDiamond:ky,hollowHexagon:wy,hollowSquare:Oy,hollowTriangleDown:Sy,hollowTriangle:Ey,hollowBowtie:xy,hollowCircle:Ty,point:Dy,plus:Iy,diamond:Ly,square:By,triangle:zy,hexagon:Ny,cross:Cy,bowtie:Py,hyphen:jy,line:Ry,tick:Fy,triangleDown:Gy,circle:_y},CM=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s,y1:c,size:l,dx:u,dy:f}=r,[h,d]=i.getSize(),p=Lw(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+a[t]+ +s[t])/2:+a[t])+e,(c?(+o[t]+ +c[t])/2:+o[t])+n]};return[e,l?Array.from(e,(t=>{const[e,n]=g(t),r=+l[t],a=r/h,o=r/d,s=[e-a,n-o],c=[e+a,n+o];return[i.map(p(s,t)),i.map(p(c,t))]})):Array.from(e,(t=>[i.map(p(g(t),t))]))]};CM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:PM,channels:[...Sw({shapes:Object.keys(PM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Pw(),{type:ni},{type:ri}],postInference:[{type:ai},...Aw()]};const LM={text:lw,badge:fw,tag:hw},NM=t=>{const{cartesian:e=!1}=t;return e?jw:(e,n,r,i)=>{const{x:a,y:o}=r,s=Lw(n,r,t),c=Array.from(e,(t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]}));return[e,c]}};NM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:LM,channels:[...Sw({shapes:Object.keys(LM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...Pw(),{type:yi},{type:vi}],postInference:[...Aw()]};const jM={cell:_m,hollow:Tm},RM=()=>(t,e,n,r)=>{const{x:i,y:a}=n,o=e.x,s=e.y,c=Array.from(t,(t=>{const e=o.getBandWidth(o.invert(+i[t])),n=s.getBandWidth(s.invert(+a[t])),c=+i[t],l=+a[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map((t=>r.map(t)))}));return[t,c]};RM.props={defaultShape:"cell",defaultLabelShape:"label",shape:jM,composite:!1,channels:[...Sw({shapes:Object.keys(jM)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Pw(),{type:ni},{type:ri},{type:gi}],postInference:[...Aw()]};const IM={area:gw,smooth:vw,hvh:mw,vh:yw,hv:bw},DM=()=>(t,e,n,r)=>{var i,a;const{x:o,y:s,y1:c,series:l}=n,{x:u,y:f}=e,h=l?Array.from(Un(t,(t=>l[t])).values()):[t],d=h.map((t=>t[0])).filter((t=>void 0!==t)),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(a=null==f?void 0:f.getBandWidth)||void 0===a?void 0:a.call(f))||0)/2;return[d,Array.from(h,(t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const a=t[i];n[i]=r.map([+o[a]+p,+s[a]+g]),n[e+i]=r.map([+o[a]+p,+c[a]+g])}return n})),h]};DM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:IM,channels:[...Sw({shapes:Object.keys(IM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Pw(),{type:si},{type:Pn},{type:gi}],postInference:[..._w()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const BM={link:xw,arc:Ow,smooth:kw,vhv:Mw},FM=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s=a,y1:c=o}=r,l=Lw(n,r,t),u=e.map((t=>[i.map(l([+a[t],+o[t]],t)),i.map(l([+s[t],+c[t]],t))]));return[e,u]};FM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:BM,channels:[...Sw({shapes:Object.keys(BM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw(),{type:ui},{type:fi}],postInference:[...Aw()]};const zM={image:Rw},GM=t=>{const{cartesian:e}=t;return e?jw:(e,n,r,i)=>{const{x:a,y:o}=r,s=Lw(n,r,t),c=Array.from(e,(t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]}));return[e,c]}};GM.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:zM,channels:[...Sw({shapes:Object.keys(zM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Pw(),{type:yi},{type:vi}],postInference:[...Aw()]};const WM={polygon:Dw,ribbon:Fw},$M=()=>(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("x"))).map((([,t])=>t)),a=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),o=t.map((t=>{const e=[];for(let n=0;n<i.length;n++){const o=i[n][t];if(void 0===o)break;const s=a[n][t];e.push(r.map([+o,+s]))}return e}));return[t,o]};$M.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:WM,channels:[...Sw({shapes:Object.keys(WM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw()],postInference:[...Aw()]};const YM={box:Gw,violin:$w},HM=()=>(t,e,n,r)=>{const{x:i,y:a,y1:o,y2:s,y3:c,y4:l,series:u}=n,f=e.x,h=e.series,d=Array.from(t,(t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(h?h.getBandWidth(h.invert(+(null==u?void 0:u[t]))):1),d=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+d+n/2,[g,v,m,y,b]=[+a[t],+o[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,y],[p-n/2,y],[p+n/2,y],[p+n/2,v],[p-n/2,v],[p-n/2,m],[p+n/2,m],[p,v],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,d]};HM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:YM,channels:[...Sw({shapes:Object.keys(YM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Pw(),{type:ni}],postInference:[..._w()],interaction:{shareTooltip:!0}};const VM={vector:Wy},qM=()=>(t,e,n,r)=>{const{x:i,y:a,size:o,rotate:s}=n,[c,l]=r.getSize(),u=t.map((t=>{const e=+s[t]/180*Math.PI,n=+o[t],u=n/l,f=n/c*Math.cos(e),h=-u*Math.sin(e);return[r.map([+i[t]-f/2,+a[t]-h/2]),r.map([+i[t]+f/2,+a[t]+h/2])]}));return[t,u]};qM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:VM,channels:[...Sw({shapes:Object.keys(VM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Pw()],postInference:[...Aw()]};const UM={line:Yw},XM=t=>(e,n,r,i)=>{const{y:a}=r,o=Lw(n,r,Z({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[0,a[t]],[1,a[t]]].map((e=>i.map(o(e,t))))));return[e,s]};XM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:UM,channels:[...Tw({shapes:Object.keys(UM)}),{name:"y",required:!0}],preInference:[...Pw(),{type:ci}],postInference:[]};const ZM={line:Yw},KM=t=>(e,n,r,i)=>{const{x:a}=r,o=Lw(n,r,Z({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[a[t],1],[a[t],0]].map((e=>i.map(o(e,t))))));return[e,s]};KM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:ZM,channels:[...Tw({shapes:Object.keys(ZM)}),{name:"x",required:!0}],preInference:[...Pw(),{type:li}],postInference:[]};const QM={connector:Vw},JM=(...t)=>FM(...t);function tO(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:a}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+n]}}function eO(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,a)=>{const o=tO("x",e,i,r.x),s=tO("y",n,i,r.y),c=Array.from(t,(t=>{const[e,n]=o(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map((t=>a.map(t)))}));return[t,c]}}JM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:QM,channels:[...Tw({shapes:Object.keys(QM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw()],postInference:[]};const nO={range:_m},rO=()=>eO();rO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:nO,channels:[...Tw({shapes:Object.keys(nO)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw()],postInference:[]};const iO={range:_m},aO=()=>eO({extendY:!0});aO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:iO,channels:[...Tw({shapes:Object.keys(iO)}),{name:"x",required:!0}],preInference:[...Pw(),{type:hi}],postInference:[]};const oO={range:_m},sO=()=>eO({extendX:!0});sO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:oO,channels:[...Tw({shapes:Object.keys(oO)}),{name:"y",required:!0}],preInference:[...Pw(),{type:di}],postInference:[]};const cO={path:hM,hollow:dM},lO=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function uO(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function fO(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=dO)):void 0===e&&(e=hO);for(var n,r,i,a,o,s=new vO(t),c=[s];n=c.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;a>=0;--a)c.push(r=i[a]=new vO(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(gO)}function hO(t){return t.children}function dO(t){return Array.isArray(t)?t[1]:null}function pO(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function gO(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function vO(t){this.data=t,this.depth=this.height=0,this.parent=null}function mO(t){return null==t?null:yO(t)}function yO(t){if("function"!=typeof t)throw new Error;return t}function bO(){return 0}function xO(t){return function(){return t}}function kO(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function wO(t,e,n,r,i){for(var a,o=t.children,s=-1,c=o.length,l=t.value&&(r-e)/t.value;++s<c;)(a=o[s]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*l}lO.props={defaultShape:"path",defaultLabelShape:"label",shape:cO,composite:!1,channels:[...Sw({shapes:Object.keys(cO)}),{name:"d",scale:"identity"}],preInference:[...Pw()],postInference:[]},vO.prototype=fO.prototype={constructor:vO,count:function(){return this.eachAfter(uO)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,a=this,o=[a],s=[],c=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++c,this);return this},eachBefore:function(t,e){for(var n,r,i=this,a=[i],o=-1;i=a.pop();)if(t.call(e,i,++o,this),n=i.children)for(r=n.length-1;r>=0;--r)a.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return fO(this).eachBefore(pO)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)a.push(e[n])}while(a.length)}};var MO={depth:-1},OO={},EO={};function SO(t){return t.id}function AO(t){return t.parentId}function _O(){var t,e=SO,n=AO;function r(r){var i,a,o,s,c,l,u,f,h=Array.from(r),d=e,p=n,g=new Map;if(null!=t){const e=h.map(((e,n)=>function(t){t=`${t}`;let e=t.length;PO(t,e-1)&&!PO(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(TO),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(TO(t)),h.push(EO));d=(t,n)=>e[n],p=(t,e)=>n[e]}for(o=0,i=h.length;o<i;++o)a=h[o],l=h[o]=new vO(a),null!=(u=d(a,o,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?OO:l)),null!=(u=p(a,o,r))&&(u+="")&&(l.parent=u);for(o=0;o<i;++o)if(u=(l=h[o]).parent){if(!(c=g.get(u)))throw new Error("missing: "+u);if(c===OO)throw new Error("ambiguous: "+u);c.children?c.children.push(l):c.children=[l],l.parent=c}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===EO&&1===s.children.length;)s=s.children[0],--i;for(let t=h.length-1;t>=0&&(l=h[t]).data===EO;--t)l.data=null}if(s.parent=MO,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(gO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=mO(t),r):e},r.parentId=function(t){return arguments.length?(n=mO(t),r):n},r.path=function(e){return arguments.length?(t=mO(e),r):t},r}function TO(t){let e=t.length;if(e<2)return"";for(;--e>1&&!PO(t,e););return t.slice(0,e)}function PO(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function CO(t,e,n,r,i){for(var a,o=t.children,s=-1,c=o.length,l=t.value&&(i-n)/t.value;++s<c;)(a=o[s]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*l}var LO=(1+Math.sqrt(5))/2;function NO(t,e,n,r,i,a){for(var o,s,c,l,u,f,h,d,p,g,v,m=[],y=e.children,b=0,x=0,k=y.length,w=e.value;b<k;){c=i-n,l=a-r;do{u=y[x++].value}while(!u&&x<k);for(f=h=u,v=u*u*(g=Math.max(l/c,c/l)/(w*t)),p=Math.max(h/v,v/f);x<k;++x){if(u+=s=y[x].value,s<f&&(f=s),s>h&&(h=s),v=u*u*g,(d=Math.max(h/v,v/f))>p){u-=s;break}p=d}m.push(o={value:u,dice:c<l,children:y.slice(b,x)}),o.dice?wO(o,n,r,i,w?r+=l*u/w:a):CO(o,n,r,w?n+=c*u/w:i,a),w-=u,b=x}return m}var jO=function t(e){function n(t,n,r,i,a){NO(e,t,n,r,i,a)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(LO);function RO(t,e,n,r,i){var a,o,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=o=a=0;a<c;++a)l[a+1]=o+=s[a].value;!function t(e,n,r,i,a,o,c){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=c)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;d<p;){var g=d+p>>>1;l[g]<h?d=g+1:p=g}h-l[d-1]<l[d]-h&&e+1<d&&--d;var v=l[d]-f,m=r-v;if(o-i>c-a){var y=r?(i*m+o*v)/r:o;t(e,d,v,i,a,y,c),t(d,n,m,y,a,o,c)}else{var b=r?(a*m+c*v)/r:c;t(e,d,v,i,a,o,b),t(d,n,m,i,b,o,c)}}(0,c,t.value,e,n,r,i)}function IO(t,e,n,r,i){(1&t.depth?CO:wO)(t,e,n,r,i)}var DO=function t(e){function n(t,n,r,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,c,l,u,f=-1,h=o.length,d=t.value;++f<h;){for(c=(s=o[f]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?wO(s,n,r,i,d?r+=(a-r)*s.value/d:a):CO(s,n,r,d?n+=(i-n)*s.value/d:i,a),d-=s.value}else t._squarify=o=NO(e,t,n,r,i,a),o.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(LO);function BO(t,e=[t.data.name]){t.id=t.id||t.data.name,t.path=e,t.children&&t.children.forEach((n=>{n.id=`${t.id}/${n.data.name}`,n.path=[...e,n.data.name],BO(n,n.path)}))}function FO(t){const e=tt(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{FO(t)}))}function zO(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:RO,treemapDice:wO,treemapSlice:CO,treemapSliceDice:IO,treemapSquarify:jO,treemapResquarify:DO},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),a=function(t,e){return Array.isArray(t)?"function"==typeof e?_O().path(e)(t):_O()(t):fO(t)}(t,e.path);b(t)?FO(a):BO(a),r?a.sum((t=>e.ignoreParentValue&&t.children?0:function(t){return"function"==typeof t?t:e=>e[t]}(r)(t))).sort(e.sort):a.count(),function(){var t=jO,e=!1,n=1,r=1,i=[0],a=bO,o=bO,s=bO,c=bO,l=bO;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(kO),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,h=e.y1-n;f<r&&(r=f=(r+f)/2),h<u&&(u=h=(u+h)/2),e.x0=r,e.y0=u,e.x1=f,e.y1=h,e.children&&(n=i[e.depth+1]=a(e)/2,r+=l(e)-n,u+=o(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(h-=c(e)-n)<u&&(u=h=(u+h)/2),t(e,r,u,f,h))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],r=+t[1],u):[n,r]},u.tile=function(e){return arguments.length?(t=yO(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:xO(+t),u):a},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:xO(+t),u):o},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:xO(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:xO(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:xO(+t),u):l},u}().tile(i).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(a);const o=a.descendants().map((t=>Object.assign(t,{id:t.id.replace(/^\//,""),x:[t.x0,t.x1],y:[t.y0,t.y1]}))),s=o.filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer);return[s,o]}const GO=t=>{const{cartesian:e}=t;return e?jw:(e,n,r,i)=>{const{x:a,y:o}=r,s=Lw(n,r,t),c=Array.from(e,(t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]}));return[e,c]}};GO.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:xM},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw(),{type:yi},{type:vi},{type:mi}]};const WO=(t,e)=>Le(void 0,void 0,void 0,(function*(){const{width:n,height:r}=e,{data:i,encode:a={},scale:o,style:s={},layout:c={}}=t,l=Pe(t,["data","encode","scale","style","layout"]),u=function(t,e){const{text:n="text",value:r="value"}=e;return t.map((t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]})))}(i,a);return Z({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size",shape:"tag"},scale:{x:{range:[0,1]},y:{range:[0,1]}},style:{fontFamily:t=>t.fontFamily}},Object.assign(Object.assign({data:{value:u,transform:[Object.assign({type:"wordCloud",size:[n,r]},c)]},encode:a,scale:o,style:s},l),{axis:!1}))}));WO.props={};const $O={density:pM},YO=()=>(t,e,n,r)=>{const{x:i,series:a}=n,o=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),s=Object.entries(n).filter((([t])=>t.startsWith("size"))).map((([,t])=>t));if(void 0===i||void 0===o||void 0===s)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,(e=>{const n=c.getBandWidth(c.invert(+i[e])),u=n*(l?l.getBandWidth(l.invert(+(null==a?void 0:a[e]))):1),f=(+(null==a?void 0:a[e])||0)*n,h=+i[e]+f+u/2;return[...o.map(((n,r)=>[h+ +s[r][e]/t.length,+o[r][e]])),...o.map(((n,r)=>[h-+s[r][e]/t.length,+o[r][e]])).reverse()].map((t=>r.map(t)))}));return[t,u]};YO.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:$O,channels:[...Sw({shapes:Object.keys($O)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...Pw(),{type:Pn},{type:ni}],postInference:[..._w()],interaction:{shareTooltip:!0}};const HO={heatmap:bM},VO=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n;return[[0],[Array.from(t,(t=>{const e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]}))]]};VO.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:HO,channels:[...Sw({shapes:Object.keys(HO)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Pw(),{type:ni},{type:ri}],postInference:[...Aw()]};const qO=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];qO.props={};const UO=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];UO.props={};const XO=t=>new Wa(t);XO.props={};const ZO=t=>new oo(t);ZO.props={};const KO=t=>new Fa(t);KO.props={};const QO=t=>new eo(t);QO.props={};const JO=t=>new so(t);JO.props={};const tE=t=>new Co(t);tE.props={};const eE=t=>new po(t);eE.props={};const nE=t=>new lo(t);nE.props={};const rE=t=>new fo(t);rE.props={};const iE=t=>new mo(t);iE.props={};const aE=t=>new go(t);aE.props={};const oE=t=>new uo(t);oE.props={};const sE=t=>new jo(t);sE.props={};const cE=t=>new Ya(t);function lE({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:a,padding2:o,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:h,category10:d,category20:p,sizeDefault:g=1,padding:v="auto",margin:m=16}){return{padding:v,margin:m,size:g,color:t,category10:d,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,lineCap:"round"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,lineWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,lineWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:h,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:a,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom",titleTransform:"translate(0, 8)"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransform:"rotate(-90) translate(0, -8)",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[a,a],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:a,colPadding:o,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{".g2-tooltip":{"font-family":"sans-serif"}}}}}cE.props={};const uE=lE({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),fE=t=>Z({},uE,t);fE.props={};const hE=t=>Z({},fE(),{category10:"category10",category20:"category20"},t);hE.props={};const dE=lE({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),pE=t=>Z({},dE,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{".g2-tooltip":{background:"#1f1f1f",opacity:.95},".g2-tooltip-title":{color:"#A6A6A6"},".g2-tooltip-list-item-name-label":{color:"#A6A6A6"},".g2-tooltip-list-item-value":{color:"#A6A6A6"}}}},t),gE=t=>Object.assign({},pE(),{category10:"category10",category20:"category20"},t);gE.props={};const vE=lE({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),mE=t=>Z({},vE,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);function yE(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}mE.props={};var bE,xE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function kE(t){if(!(e=xE.exec(t)))throw new Error("invalid format: "+t);var e;return new wE({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function wE(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function ME(t,e){var n=yE(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}kE.prototype=wE.prototype,wE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var OE={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ME(100*t,e),r:ME,s:function(t,e){var n=yE(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(bE=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+yE(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function EE(t){return t}var SE,AE,_E=Array.prototype.map,TE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function PE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?EE:(e=_E.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?EE:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(_E.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=kE(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,v=t.precision,m=t.trim,y=t.type;"n"===y?(g=!0,y="g"):OE[y]||(void 0===v&&(v=12),m=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===h?a:/[%p]/.test(y)?c:"",k=OE[y],w=/[defgprs%]/.test(y);function M(t){var i,a,c,h=b,M=x;if("c"===y)M=k(t)+M,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:k(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:l:"-"===f||"("===f?"":f)+h,M=("s"===y?TE[8+bE/3]:"")+M+(O&&"("===f?")":""),w)for(i=-1,a=t.length;++i<a;)if(48>(c=t.charCodeAt(i))||c>57){M=(46===c?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var E=h.length+t.length+M.length,S=E<p?new Array(p-E+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-M.length:1/0),S=""),n){case"<":t=h+t+M+S;break;case"=":t=h+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+h+t+M+S.slice(E);break;default:t=S+h+t+M}return s(t)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=kE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=yE(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),a=TE[8+r/3];return function(t){return n(i*t)+a}}}}function CE(t,e,n){return t.querySelector(e)?pm(t).select(e):pm(t).append(n)}function LE(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function NE(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","flex-start","center"],right:["column","flex-start","center"],center:["column","center","center"]};return t in a&&([n,r,i]=a[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}SE=PE({thousands:",",grouping:[3],currency:["$",""]}),AE=SE.format;class jE extends ow{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class RE extends jE{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function IE(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function DE(t){return"vertical"===t||t===-Math.PI/2}function BE(t,e,n){const{bbox:r}=t,{position:i="top",size:a,length:o}=e,s=["top","bottom","center"].includes(i),[c,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,h=a||u||c,d=o||f||l,p=s?"horizontal":"vertical",[g,v]=s?[d,h]:[h,d];return{orientation:p,width:g,height:v,size:h,length:d}}function FE(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Pe(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${G(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}function zE(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function GE(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function WE(t,e,n,r,i,a,o,s){var c;void 0===n&&void 0===a||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),a&&{tickMethod:a}));const l=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=$n(e,(t=>+t)),{tickCount:a}=t.getOptions();return n(r,i,a)}(t,e,a),u=i?l.filter(i):l,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),h=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,d=function(t,e){if(Gc(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:a,insetBottom:o,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[a,o,i]:[s,c,r],h=new oo({domain:[0,1],range:[l/f,1-u/f]});return t=>h.map(t)}(o,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!Hc(e))return i;const a="bottom"===t?[i,1]:[0,i],o=e.map(a);if("bottom"===t){const t=o[0];return new oo({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=o[1];return new oo({domain:[0,r],range:[0,1]}).map(t)}return i}}(o,s),g=t=>["left","right"].includes(t);return Gc(s)||zc(s)?u.map(((e,n,r)=>{var i,a;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=d(t.map(e)+c);return{value:Wc(s)&&"center"===o||zc(s)&&(null===(a=t.getTicks)||void 0===a?void 0:a.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(o)||zc(s)&&g(o)?1-l:l,label:f(h(mm(e),n,r)),id:String(n)}})):u.map(((e,n,r)=>{var i;const a=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(d(t.map(e)+a));return{value:g(o)?1-s:s,label:f(h(mm(e),n,r)),id:String(n)}}))}function $E(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:a}=e,o=[],s=(t,e)=>{e&&o.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},a),o}function YE(t,e,n){return!function(t){return Gc(t)&&zc(t)}(e)&&!Yc(e)&&(void 0===t?!!n.getTicks:t)}function HE(t,e,n,r,i,a){const o=function(t,e,n,r,i){const a=n.axis,o=["top","right","bottom","left"].includes(i)?n[`axis${Mr(i)}`]:n.axisLinear,s=t.getOptions().name,c=n[`axis${G(s)}`]||{};return Object.assign({},a,o,c)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},o),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:DE(a)?10:0,tick:"center"!==r&&void 0}):o}const VE=t=>e=>{const{labelFormatter:n,labelFilter:r=()=>!0}=e;return i=>{var a;const{scales:[o]}=i,s=(null===(a=o.getTicks)||void 0===a?void 0:a.call(o))||o.getOptions().domain,c="string"==typeof n?AE(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:(t,e,n)=>r(s[e],e,s),scale:o});return t(l)(i)}},qE=VE((t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:a,actualPosition:o,position:s,size:c,style:l={},title:u,tickCount:f,tickFilter:h,tickMethod:d,transform:p,indexBBox:g}=t,v=Pe(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:i,value:m,coordinate:y,theme:b})=>{const{bbox:x}=m,[k]=i,{domain:w,xScale:M}=k.getOptions(),O=HE(k,0,b,e,s,a),E=Object.assign(Object.assign(Object.assign({},O),l),v),S=function(t,e,n="xy"){const[r,i,a]=GE(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?a:r:t.includes("bottom")||t.includes("top")?i:a}(o||s,y,t.plane),A=function(t,e,n,r,i){const{x:a,y:o,width:s,height:c}=n;if("bottom"===t)return{startPos:[a,o],endPos:[a+s,o]};if("left"===t)return{startPos:[a+s,o+c],endPos:[a+s,o]};if("right"===t)return{startPos:[a,o+c],endPos:[a,o]};if("top"===t)return{startPos:[a,o+c],endPos:[a+s,o+c]};if("center"===t){if("vertical"===e)return{startPos:[a,o],endPos:[a,o+c]};if("horizontal"===e)return{startPos:[a,o],endPos:[a+s,o]};if("number"==typeof e){const[t,n]=r.getCenter(),[l,u]=qc(r),[f,h]=Uc(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),v=l*d,m=u*d,[y,b]=[t+a-p,n+o-g],[x,k]=[Math.cos(e),Math.sin(e)],w=[y+m*x,b+m*k],M=[y+v*x,b+v*k],O=()=>{const{domain:t}=i.getOptions();return t.length},E=Gc(r)&&i?O():3;return{startPos:w,endPos:M,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[y,b],gridControlAngles:new Array(E).fill(0).map(((t,e,n)=>(h-f)/E*e))}}}return{}}(s,a,x,y,M),_=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(y),T=WE(k,w,f,r,h,d,s,y),P=g?T.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):T,C=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},E),{type:"linear",data:P,crossSize:c,titleText:LE(u),labelOverlap:$E(p,E),grid:YE(E.grid,y,k),gridLength:S,line:!0,indexBBox:g}),E.line?null:{lineOpacity:0}),A),_),n),L=C.labelOverlap.find((t=>"hide"===t.type));return L&&(C.crossSize=!1),new Ak({className:"axis",style:FE(C)})}})),UE=VE((t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:a,tickFilter:o,tickCount:s,tickMethod:c,important:l={},style:u={},indexBBox:f,title:h,grid:d=!1}=t,p=Pe(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:u}=e,{domain:g}=t.getOptions(),v=WE(t,g,s,a,o,c,r,n),m=f?v.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):v,[y,b]=qc(n),x=function(t,e,n,r,i){const{x:a,y:o,width:s,height:c}=e,l=[a+s/2,o+c/2],u=Math.min(s,c)/2,[f,h]=Uc(i),[d,p]=GE(i),g={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,u,y,b,n),{axis:k,axisArc:w={}}=i,M=FE(Z({},k,w,x,Object.assign(Object.assign({type:"arc",data:m,titleText:LE(h),grid:d},p),l)));return new Ak({style:nt(M,["transform"])})}}));qE.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},UE.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const XE=t=>(...e)=>{const n=qE(Object.assign({},{crossPadding:50},t))(...e);return zE(n,t),n};XE.props=Object.assign(Object.assign({},qE.props),{defaultPosition:"bottom"});const ZE=t=>(...e)=>{const n=qE(Object.assign({},{crossPadding:10},t))(...e);return zE(n,t),n};function KE(t,e,n,r){const{radar:i}=t,[a]=r,o=a.getOptions().name,[s,c]=Uc(n),{axisRadar:l={}}=e;return Object.assign(Object.assign({},l),{grid:"position"===o,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map(((t,e)=>(c-s)/i.count*e))})}ZE.props=Object.assign(Object.assign({},qE.props),{defaultPosition:"left"});const QE=t=>{const{important:e={}}=t,n=Pe(t,["important"]);return r=>{const{theme:i,coordinate:a,scales:o}=r;return qE(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},KE(t,i,a,o)),e)}))(r)}};function JE(t,e){const{scales:n,library:r,markState:i}=e,[a,o]=function(t,e){const n=IE(t,"shape"),r=IE(t,"color"),i=n?n.clone():null,a=[];for(const[t,n]of e){const e=t.type,o=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map(((e,r)=>{var a;return i?i.map(e||"point"):(null===(a=null==t?void 0:t.style)||void 0===a?void 0:a.shape)||n.defaultShape||"point"}));"string"==typeof e&&a.push([e,o])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const{range:o}=n.getOptions();return a.map((([t,e])=>{let n=0;for(let t=0;t<a.length;t++){const r=o[t%o.length];e[t]===r&&n++}return[n/e.length,[t,e]]})).sort(((t,e)=>e[0]-t[0]))[0][1]}(n,i),{itemMarker:s,itemMarkerSize:c}=t,l=(t,e)=>{var n,i,o;const s=(null===(o=null===(i=null===(n=r[`mark.${a}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===o?void 0:o.props.defaultMarker)||L(t.split(".")),l="function"==typeof c?c(e):c;return()=>function(t,e){var{d:n,fill:r,lineWidth:i,path:a,stroke:o,color:s}=e,c=Pe(e,["d","fill","lineWidth","path","stroke","color"]);const l=my.get(t)||my.get("point");return(...t)=>new qg({style:Object.assign(Object.assign({},c),{d:l(...t),stroke:l.style.includes("stroke")?s||o:"",fill:l.style.includes("fill")?s||r:"",lineWidth:l.style.includes("lineWidth")?i||i||2:0})})}(s,{color:e.color})(0,0,l)},u=t=>`${o[t]}`;return IE(n,"shape")&&!s?(t,e)=>l(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?l(n,t):n}:(t,e)=>l(s||u(e),t)}function tS(t){const e=IE(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function eS(t,e){const{labelFormatter:n=t=>`${t}`}=t,{scales:r,theme:i}=e,a=function(t,e){const n=IE(t,"size");return n instanceof eo?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),o={itemMarker:JE(Object.assign(Object.assign({},t),{itemMarkerSize:a}),e),itemMarkerSize:a,itemMarkerOpacity:tS(r)},s="string"==typeof n?AE(n):n,c=IE(r,"color"),l=function(t){return t.find((t=>t.getOptions().domain.length>0)).getOptions().domain}(r),u=c?t=>c.map(t):()=>e.theme.color;return Object.assign(Object.assign({},o),{data:l.map((t=>({id:t,label:s(t),color:u(t)})))})}QE.props=Object.assign(Object.assign({},qE.props),{defaultPosition:"center"});const nS=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,cols:c,itemMarker:l}=t,u=Pe(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:f}=u;return e=>{const{value:r,theme:i}=e,{bbox:o}=r,{width:l,height:h}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:a}=BE(t,e,n);return{width:i,height:a}}(r,t,nS),d=NE(a,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(a)?"vertical":"horizontal",width:l,height:h,layout:void 0!==c?"grid":"flex"},void 0!==c&&{gridCol:c}),void 0!==f&&{gridRow:f}),{titleText:LE(s)}),eS(t,e)),{legendCategory:g={}}=i,v=FE(Object.assign({},g,p,u)),m=new RE({style:Object.assign(Object.assign({x:o.x,y:o.y,width:o.width,height:o.height},d),{subOptions:v})});return m.appendChild(new $k({className:"legend-category",style:v})),m}};function rS(t,e,n,r,i){const a=e.thresholds,o=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...a,r].map(o)})}function iS(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],Br(e)];return[n,r]}function aS(t,e,n,r,i,a){const{length:o}=t,s=n||r,c=i.color?a.legendContinuous.ribbonFill||"black":a.color,l=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[hh(e).toString()]})),r}(s,c),[u,f]=iS(l),[h,d]=iS([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Ya))));return Object.assign(Object.assign({},t),{domain:[h,d],data:l.getTicks().map((t=>({value:t}))),color:new Array(Math.floor(o)).fill(0).map(((t,e)=>{const n=(f-u)/(o-1)*e+u,i=l.map(n)||c,a=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,((t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${a})`))}))})}function oS(t,e,n,r,i,a){const o=IE(t,"color"),s=function(t,e,n){const{size:r}=e,i=BE(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(o instanceof fo){const{range:t}=o.getOptions(),[e,n]=iS(o);return o instanceof go||o instanceof mo?rS(s,o,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map(((t,e)=>({value:e,label:t})));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,o,t)}return aS(s,o,IE(t,"size"),IE(t,"opacity"),e,a)}nS.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const sS=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,style:c,crossPadding:l,padding:u}=t,f=Pe(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:o,scale:l})=>{const{bbox:u}=i,{x:h,y:d,width:p,height:g}=u,v=NE(a,n),{legendContinuous:m={}}=o,y=FE(Object.assign({},m,Object.assign(Object.assign({titleText:LE(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>AE(e)(t.label):e},oS(r,l,i,t,sS,o)),c),f)),b=new jE({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},v),{subOptions:y})});return b.appendChild(new ew({className:"legend-continuous",style:y})),b}};sS.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const cS=t=>(...e)=>sS(Object.assign({},{block:!0},t))(...e);cS.props=Object.assign(Object.assign({},sS.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const lS=t=>e=>{const{scales:n}=e,r=IE(n,"size");return sS(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};lS.props=Object.assign(Object.assign({},sS.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const uS=t=>lS(Object.assign({},{block:!0},t));function fS(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}uS.props=Object.assign(Object.assign({},sS.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const hS=(dS={render(t,e){const{width:n,title:r,subtitle:i,spacing:a=2,align:o="left",x:s,y:c}=t,l=Pe(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=_r(l,"title"),f=_r(l,"subtitle"),h=CE(e,".title","text").attr("className","title").call(ym,Object.assign(Object.assign(Object.assign({},fS(0,0,n,o)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();CE(e,".sub-title","text").attr("className","sub-title").call((t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},fS(0,h.max[1]+a,n,o)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends Bg{constructor(t){super(t),this.descriptor=dS}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(Z({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var dS;const pS=t=>({value:e,theme:n})=>{const{x:r,y:i,width:a,height:o}=e.bbox;return new hS({style:Z({},n.title,Object.assign({x:r,y:i,width:a,height:o},t))})};function gS(t){return!!t.getBandWidth}function vS(t,e,n){if(!gS(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),a=n?-1:0,o=t.getStep(),s=n?r:r.map((t=>t+o)),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(Bn(s,e)+a,0,i.length-1);return i[c]}function mS(t,e,n){if(!e)return t.getOptions().domain;if(!gS(t)){const r=Jn(e);if(!n)return r;const[i]=r,{range:a}=t.getOptions(),[o,s]=a,c=o>s?-1:1;return[i,t.invert(t.map(i)+c*n)]}const{domain:r}=t.getOptions(),i=e[0],a=r.indexOf(i);if(n){const t=a+Math.round(r.length*n);return r.slice(a,t)}const o=e[e.length-1],s=r.indexOf(o);return r.slice(a,s+1)}function yS(t,e,n,r,i,a){const{x:o,y:s}=i,c=(t,e)=>{const[n,r]=a.invert(t);return[vS(o,n,e),vS(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[mS(o,[l[0],u[0]]),mS(s,[l[1],u[1]])]}function bS(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}pS.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const xS=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:a}=t,o=Pe(t,["orientation","labelFormatter","size","style","position"]);return r=>{var s;const{scales:[c],value:l,theme:u,coordinate:f}=r,{bbox:h}=l,{width:d,height:p}=h,{slider:g={}}=u,v=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),m="string"==typeof n?AE(n):n,y="horizontal"===e,b=zc(f)&&y,{trackSize:x=g.trackSize}=i,[k,w]=function(t,e,n){const{x:r,y:i,width:a,height:o}=t;return"left"===e?[r+a-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+o-n]:void 0}(h,a,x);return new Ex({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:k,y:w,trackLength:y?d:p,orientation:e,formatter:t=>(m||v)(vS(c,b?1-t:t,!0)),sparklineData:kS(t,r)},i),o))})}};function kS(t,e){const{markState:n}=e;return b(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter((([t])=>"line"===t.type||"area"===t.type)).filter((([t])=>t.slider)).map((([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}}));if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce(((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t)),{});return Object.values(r)}(n,["y","series"])}xS.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const wS=t=>xS(Object.assign(Object.assign({},t),{orientation:"horizontal"}));wS.props=Object.assign(Object.assign({},xS.props),{defaultPosition:"bottom"});const MS=t=>xS(Object.assign(Object.assign({},t),{orientation:"vertical"}));MS.props=Object.assign(Object.assign({},xS.props),{defaultPosition:"left"});const OS=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Pe(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:a})=>{const{bbox:o}=n,{x:s,y:c,width:l,height:u}=o,{scrollbar:f={}}=a,{ratio:h,range:d}=t.getOptions(),p="horizontal"===e?l:u,g=p/h,[v,m]=d,y=m>v?0:1;return new Sx({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:y}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};OS.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const ES=t=>OS(Object.assign(Object.assign({},t),{orientation:"horizontal"}));ES.props=Object.assign(Object.assign({},OS.props),{defaultPosition:"bottom"});const SS=t=>OS(Object.assign(Object.assign({},t),{orientation:"vertical"}));SS.props=Object.assign(Object.assign({},OS.props),{defaultPosition:"left"});const AS=t=>()=>new zg;AS.props={};const _S=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a.style,[u,f]=zc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return a.animate(h,Object.assign(Object.assign({},i),t))}},TS=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a.style,[u,f]=zc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(h,Object.assign(Object.assign({},i),t))}},PS=(t,e)=>{const n=1e-4,{coordinate:r}=e;return nv({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:Af.NUMBER}),(e,i,a)=>{const[o]=e;return Gc(r)?(e=>{const{__data__:i,style:o}=e,{radius:s=0,inset:c=0,fillOpacity:l=1,strokeOpacity:u=1,opacity:f=1}=o,{points:h,y:d,y1:p}=i,g=wm(r,h,[d,p]),{innerRadius:v,outerRadius:m}=g,y=ac().cornerRadius(s).padAngle(c*Math.PI/180),b=new qg({}),x=t=>(b.attr({d:y(t)}),Yh(b)),k=[{scaleInYRadius:v+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:v+n,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.01},{scaleInYRadius:m,fillOpacity:l,strokeOpacity:u,opacity:f}],w=e.animate(k,Object.assign(Object.assign({},a),t));return w.onframe=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:Number(e.style.scaleInYRadius)}))},w.onfinish=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:m}))},w})(o):(e=>{const{style:n}=e,{transform:i="",fillOpacity:o=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=zc(r)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],f=[{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c,offset:.01},{transform:`${i} scale(1, 1)`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c}];return e.animate(f,Object.assign(Object.assign({},a),t))})(o)}},CS=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a.style,[u,f]=zc(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(h,Object.assign(Object.assign({},i),t))}},LS=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:a,strokeOpacity:o,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};LS.props={};const NS=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,c=[{fillOpacity:a,strokeOpacity:o,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};NS.props={};const jS={opacity:1,strokeOpacity:1,fillOpacity:1,lineWidth:0,x:0,y:0,cx:0,cy:0,r:0,rx:0,ry:0,width:0,height:0},RS={[Iu.CIRCLE]:["cx","cy","r"],[Iu.ELLIPSE]:["cx","cy","rx","ry"],[Iu.RECT]:["x","y","width","height"],[Iu.IMAGE]:["x","y","width","height"],[Iu.LINE]:["x1","y1","x2","y2"],[Iu.POLYLINE]:["points"],[Iu.POLYGON]:["points"]};function IS(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=jS[i])}return r}const DS=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function BS(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[a,o]=n;return[r,i,a-r,o-i]}function FS(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function zS(t,e){const[n,r,i,a]=BS(t),o=a/i,s=Math.ceil(Math.sqrt(e/o)),c=[],l=a/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,a=r+u*l;c.push(FS([t,a,e,l]))}f-=t,u+=1}return c}function GS(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function WS(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function $S(t){const e=Yh(t);if(e&&!function(t){return!WS(t,"m")||!WS(t,"M")}(e))return e}function YS(t){const{nodeName:e}=t;if("path"===e){const e=tt(t,"attributes");return e.markerEnd||e.markerStart}return!1}function HS(t,e,n,r){const{nodeName:i}=e,{nodeName:a}=n,o=$S(e),s=$S(n),c=i===a&&"path"!==i,l=void 0===o||void 0===s,u=YS(e)||YS(n);if(c||l||u)return function(t,e,n){let{transform:r}=t.style;const{transform:i}=e.style;GS(e,t);let a=DS;if(t.nodeName===Iu.GROUP){const[n,i,a,o]=BS(t),[s,c,l,u]=BS(e);r=`translate(${n-s}, ${i-c}) scale(${a/l}, ${o/u})`}else a=a.concat(RS[t.nodeName]||[]);const o=[Object.assign({transform:null!=r?r:"none"},IS(t,a,!0)),Object.assign({transform:null!=i?i:"none"},IS(e,a,!0))];return e.animate(o,n)}(e,n,r);const f=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new qg({style:Object.assign(Object.assign({},IS(t,DS)),{d:e})});return GS(r,t),r}(t,o),h=[Object.assign({},IS(e,DS)),Object.assign({},IS(n,DS))];if(o!==s){h[0].d=o,h[1].d=s;const t=f.animate(h,r);return t.onfinish=()=>{const t=f.style.d;Er(f,n),f.style.d=t,f.style.transform="none"},f.style.transform="none",t}return null}const VS=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:zS}(t.split),a=Object.assign(Object.assign({},r),t),{length:o}=e,{length:s}=n;if(1===o&&1===s||o>1&&s>1){const[t]=e,[r]=n;return HS(t,t,r,a)}if(1===o&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map(((e,r)=>HS(e,new qg({style:Object.assign({d:i[r]},IS(t,DS))}),e,n)))}(t,n,a,i)}if(o>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:a,strokeOpacity:o,opacity:s}],l=e.animate(c,n),u=t.map(((t,r)=>HS(t,t,new qg({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,a,i)}return null};VS.props={};const qS=(t,e)=>{const n=1e-4;nv({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Af.NUMBER});const{coordinate:r}=e;return(i,a,o)=>{const[s]=i;if(!Gc(r))return _S(t,e)(i,a,o);const{__data__:c,style:l}=s,{radius:u=0,inset:f=0,fillOpacity:h=1,strokeOpacity:d=1,opacity:p=1}=l,{points:g,y:v,y1:m}=c,y=ac().cornerRadius(u).padAngle(f*Math.PI/180),b=wm(r,g,[v,m]),{startAngle:x,endAngle:k}=b,w=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:h,strokeOpacity:d,opacity:p,offset:.01},{waveInArcAngle:k,fillOpacity:h,strokeOpacity:d,opacity:p}],M=s.animate(w,Object.assign(Object.assign({},o),t));return M.onframe=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:k}))},M}};qS.props={};const US=t=>(e,n,r)=>{const[i]=e,{transform:a="",fillOpacity:o=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c,offset:.01},{transform:`${a} scale(1)`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c}];return i.animate(u,Object.assign(Object.assign({},r),t))},XS=t=>(e,n,r)=>{const[i]=e,{transform:a="",fillOpacity:o=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${a} scale(1)`.trimStart(),transformOrigin:l},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c,offset:.99},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},ZS=t=>(e,n,r)=>{var i,a;const[o]=e,s=(null===(a=(i=o).getTotalLength)||void 0===a?void 0:a.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return o.animate(c,Object.assign(Object.assign({},r),t))};ZS.props={};const KS=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:c}=a.getLocalBounds(),l=2*c[0],u=2*c[1],f=new qg({style:{d:`M${o},${s}L${o+l},${s}L${o+l},${s+u}L${o},${s+u}Z`}});a.appendChild(f),a.style.clipPath=f;return _S(t,e)([f],r,i)};KS.props={};const QS=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:c}=a.getLocalBounds(),l=2*c[0],u=2*c[1],f=new qg({style:{d:`M${o},${s}L${o+l},${s}L${o+l},${s+u}L${o},${s+u}Z`}});a.appendChild(f),a.style.clipPath=f;return PS(t,e)([f],r,i)};QS.props={};const JS="main-layer",tA="label-layer",eA="element",nA="view",rA="plot",iA="component",aA="label",oA="area";
10
+ var mv=function(t){function e(t,n,r,i){var a;return nl(this,e),(a=fl(this,e,[t])).currentTime=r,a.timelineTime=i,a.target=n,a.type="finish",a.bubbles=!1,a.currentTarget=n,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=r,a.timelineTime=i,a}return dl(e,t),il(e)}(Cp),yv=0,bv=function(){return il((function t(e,n){var r;nl(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(yv++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}),[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new mv(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}}},{key:"persist",value:function(){throw new Error(Ju)}},{key:"addEventListener",value:function(t,e,n){throw new Error(Ju)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(Ju)}},{key:"dispatchEvent",value:function(t){throw new Error(Ju)}},{key:"commitStyles",value:function(){throw new Error(Ju)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new mv(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new mv(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),xv=.1,kv="function"==typeof Float32Array,wv=function(t,e){return 1-3*e+3*t},Mv=function(t,e){return 3*e-6*t},Ov=function(t){return 3*t},Ev=function(t,e,n){return((wv(e,n)*t+Mv(e,n))*t+Ov(e))*t},Sv=function(t,e,n){return 3*wv(e,n)*t*t+2*Mv(e,n)*t+Ov(e)},Av=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=kv?new Float32Array(11):new Array(11),a=0;a<11;++a)i[a]=Ev(a*xv,t,n);var o=function(e){for(var r=0,a=1;10!==a&&i[a]<=e;++a)r+=xv;--a;var o=r+(e-i[a])/(i[a+1]-i[a])*xv,s=Sv(o,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var a=Sv(e,n,r);if(0===a)return e;e-=(Ev(e,n,r)-t)/a}return e}(e,o,t,n):0===s?o:function(t,e,n,r,i){var a,o,s=0;do{(a=Ev(o=e+(n-e)/2,r,i)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&++s<10);return o}(e,r,r+xv,t,n)};return function(t){return 0===t||1===t?t:Ev(o(t),e,r)}},_v=function(t){return Math.pow(t,2)},Tv=function(t){return Math.pow(t,3)},Pv=function(t){return Math.pow(t,4)},Cv=function(t){return Math.pow(t,5)},Lv=function(t){return Math.pow(t,6)},Nv=function(t){return 1-Math.cos(t*Math.PI/2)},jv=function(t){return 1-Math.sqrt(1-t*t)},Rv=function(t){return t*t*(3*t-2)},Iv=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Dv=function(t){var e=pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?1:n,i=e[1],a=void 0===i?.5:i,o=j(Number(r),1,10),s=j(Number(a),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-s/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/s)},Bv=function(t){var e=arguments.length>2?arguments[2]:void 0,n=pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,a=n[1],o=void 0===a?100:a,s=n[2],c=void 0===s?10:s,l=n[3],u=void 0===l?0:l;i=j(i,.1,1e3),o=j(o,.1,1e3),c=j(c,.1,1e3),u=j(u,.1,1e3);var f=Math.sqrt(o/i),h=c/(2*Math.sqrt(o*i)),d=h<1?f*Math.sqrt(1-h*h):0,p=h<1?(h*f-u)/d:-u+f,g=e?e*t/1e3:t;return g=h<1?Math.exp(-g*h*f)*(1*Math.cos(d*g)+p*Math.sin(d*g)):(1+p*g)*Math.exp(-g*f),0===t||1===t?t:1-g},Fv=function(t){var e=pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(j(t,0,1)*r)/r},zv=function(t){var e=pl(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=e[1],i=e[2],a=e[3];return Av(n,r,i,a)(t)},Gv=Av(.42,0,1,1),Wv=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},$v=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Yv=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Hv={steps:Fv,"step-start":function(t){return Fv(t,[1,"start"])},"step-end":function(t){return Fv(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":zv,ease:function(t){return zv(t,[.25,.1,.25,1])},in:Gv,out:Wv(Gv),"in-out":$v(Gv),"out-in":Yv(Gv),"in-quad":_v,"out-quad":Wv(_v),"in-out-quad":$v(_v),"out-in-quad":Yv(_v),"in-cubic":Tv,"out-cubic":Wv(Tv),"in-out-cubic":$v(Tv),"out-in-cubic":Yv(Tv),"in-quart":Pv,"out-quart":Wv(Pv),"in-out-quart":$v(Pv),"out-in-quart":Yv(Pv),"in-quint":Cv,"out-quint":Wv(Cv),"in-out-quint":$v(Cv),"out-in-quint":Yv(Cv),"in-expo":Lv,"out-expo":Wv(Lv),"in-out-expo":$v(Lv),"out-in-expo":Yv(Lv),"in-sine":Nv,"out-sine":Wv(Nv),"in-out-sine":$v(Nv),"out-in-sine":Yv(Nv),"in-circ":jv,"out-circ":Wv(jv),"in-out-circ":$v(jv),"out-in-circ":Yv(jv),"in-back":Rv,"out-back":Wv(Rv),"in-out-back":$v(Rv),"out-in-back":Yv(Rv),"in-bounce":Iv,"out-bounce":Wv(Iv),"in-out-bounce":$v(Iv),"out-in-bounce":Yv(Iv),"in-elastic":Dv,"out-elastic":Wv(Dv),"in-out-elastic":$v(Dv),"out-in-elastic":Yv(Dv),spring:Bv,"spring-in":Bv,"spring-out":Wv(Bv),"spring-in-out":$v(Bv),"spring-out-in":Yv(Bv)},Vv=function(t){return t};function qv(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Uv="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Xv=new RegExp("cubic-bezier\\(".concat(Uv,",").concat(Uv,",").concat(Uv,",").concat(Uv,"\\)")),Zv=/steps\(\s*(\d+)\s*\)/,Kv=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Qv(t){var e=Xv.exec(t);if(e)return Av.apply(void 0,sl(e.slice(1).map(Number)));var n=Zv.exec(t);if(n)return qv(Number(n[1]),0);var r=Kv.exec(t);return r?qv(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):Hv[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Hv.linear}function Jv(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function tm(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,r,i){var a=i;return 0===t?1!==e&&(a+=n):a+=r/t,a}(a,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,a){var o=t===1/0?e%1:t%1;return 0!==o||2!==n||0===r||0===i&&0!==a||(o=1),o}(o,n.iterationStart,r,n.iterations,i,a),c=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,o),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function em(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(nm(i)){var a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Qv(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(a)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],a=0;a<i.length-1;a++){var o=a,s=a+1,c=i[o].computedOffset,l=i[s].computedOffset,u=c,f=l;0===a&&(u=-1/0,0===l&&(s=o)),a===i.length-2&&(f=1/0,1===c&&(o=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:r,interpolation:im(r,i[o].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,a=0===i?0:r/i;t.setAttribute(n.property,n.interpolation(a),!1,!1)}));else for(var n in r)nm(n)&&t.setAttribute(n,null)}}function nm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var rm=function(t,e,n){return function(r){var i=am(t,e,r);return R(i)?i:n(i)}};function im(t,e,n,r){var i=yd[t];if(i&&i.syntax&&i.int){var a=wg.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var o=a.parser,s=o?o(e,r):e,c=o?o(n,r):n,l=a.mixer(s,c,r);if(l){var u=rm.apply(void 0,sl(l));return function(t){return 0===t?e:1===t?n:u(t)}}}}return rm(!1,!0,(function(t){return t?n:e}))}function am(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,a=Math.max(r,i),o=[],s=0;s<a;s++)o.push(am(t[s<r?s:r-1],e[s<i?s:i-1],n));return o}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var om=function(){return il((function t(){nl(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Vv,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}),[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Qv(t),this._easing=t}}])}();function sm(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,a=0;a<i;a++){if(!e[a]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),e[a]=o}void 0!==r[a]&&null!==r[a]&&(e[a][n]=r[a])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in null!=e&&e.composite&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,a=0;a<n.length;a++){var o=n[a].offset;if(b(o))r=!1;else{if(o<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=o}}return n=n.filter((function(t){return Number(t.offset)>=0&&Number(t.offset)<=1})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,a=Number(n[0].computedOffset),o=1;o<r;o++){var s=n[o].computedOffset;if(!b(s)&&!b(a)){for(var c=1;c<o-i;c++)n[i+c].computedOffset=a+(Number(s)-a)*c/(o-i);i=o,a=Number(s)}}}(),n}var cm="backwards|forwards|both|none".split("|"),lm="reverse|alternate|alternate-reverse".split("|");function um(t,e){return function(t,e){var n=new om;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===cm.indexOf(t[e]))return;if("direction"===e&&-1===lm.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var fm=function(){return il((function t(e,n,r){var i=this;nl(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=um(r,!1),this.timing.effect=this,this.timing.activeDuration=Jv(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=sm(n,this.timing),this.interpolations=em(this.normalizedKeyframes,this.timing,this.target);var a=wg.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}),[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=tm(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=sm(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))}}])}();function hm(t,e){return Number(t.id)-Number(e.id)}var dm=function(){return il((function t(e){var n=this;nl(this,t),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(hm),n.animations=n.tick(t,!0,n.animations)[0],e.forEach((function(e){e[1](t)})),n.applyPendingEffects()},this.document=e}),[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new fm(t,e,n),i=new bv(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(hm),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))}},{key:"tick",value:function(t,e,n){var r,i,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var o=[],s=[],c=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(o.push(n.effect),n.unmarkTarget()),n._needsTick&&(a.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,o),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]}}])}();function pm(t){return new gm([t],null,t,t.ownerDocument)}wg.EasingFunction=Qv,wg.AnimationTimeline=dm;class gm{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],a=[],o=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new gm(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new gm(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new gm([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,a]=Array.isArray(r)?r:[r,null],o=e(i,t);o.__data__=i,null!==a&&(o.__fromElements__=a),this._parent.appendChild(o),n.push(o)}return new gm(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new gm(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new gm([i],null,this._parent,this._document);const a="string"==typeof e?this.createElement(e):e();return a.id=t,n&&(a.className=n),r.appendChild(a),new gm([a],null,this._parent,this._document)}data(t,e=t=>t,n=()=>null){const r=[],i=[],a=new Set(this._elements),o=[],s=new Set,c=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),l=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),u=Xn(this._elements,(t=>n(t.__data__)));for(let f=0;f<t.length;f++){const h=t[f],d=e(h,f),p=n(h,f);if(c.has(d)){const t=c.get(d);t.__data__=h,t.__facet__=!1,i.push(t),a.delete(t),c.delete(d)}else if(l.has(d)){const t=l.get(d);t.__data__=h,t.__facet__=!0,i.push(t),l.delete(d)}else if(u.has(d)){const t=u.get(d);o.push([h,t]);for(const e of t)a.delete(e);u.delete(d)}else if(c.has(p)){const t=c.get(p);t.__toData__?t.__toData__.push(h):t.__toData__=[h],s.add(t),a.delete(t)}else r.push(h)}const f=[new gm([],r,this._parent,this._document),new gm(i,null,this._parent,this._document),new gm(a,null,this._parent,this._document),new gm([],o,this._parent,this._document),new gm(s,null,this._parent,this._document)];return new gm(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new gm(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=gm.registry[t];return e?new e:Er(`Unknown node type: ${t}`)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){const a=t(this._enter),o=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return o.merge(a).merge(s).merge(c).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(e){const n=Array.isArray(e)?e:[e];Promise.all(n.map((t=>t.finished))).then((()=>{this._elements[t].remove()}))}else{this._elements[t].remove()}}return new gm([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,a){void 0!==e&&(a[t]=n(r,i,a))}))}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,a){void 0!==e&&(a.style[t]=n(r,i,a))}))}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each((function(t,r,i){n[r]=e(t,r,i)}))}on(t,e){return this.each((function(n,r,i){i.addEventListener(t,e)})),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function vm(t,e,n){return Math.max(e,Math.min(t,n))}function mm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function ym(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function bm(t,e,n,r,i){const a=bs(vs(r,e))+Math.PI,o=bs(vs(r,n))+Math.PI;return t.arc(r[0],r[1],i,a,o,o-a<0),t}function xm(t,e,n,r="y",i="between",a=!1){const o="y"===r||!0===r?n:e,s=((t,e)=>"y"===t||!0===t?e?180:90:e?90:0)(r,a),c=Dr(o),[l,u]=Yn(c,(t=>o[t])),f=new so({domain:[l,u],range:[0,100]}),h=t=>R(o[t])&&!Number.isNaN(o[t])?f.map(o[t]):0,d={between:e=>`${t[e]} ${h(e)}%`,start:e=>0===e?`${t[e]} ${h(e)}%`:`${t[e-1]} ${h(e)}%, ${t[e]} ${h(e)}%`,end:e=>e===t.length-1?`${t[e]} ${h(e)}%`:`${t[e]} ${h(e)}%, ${t[e+1]} ${h(e)}%`};return`linear-gradient(${s}deg, ${c.sort(((t,e)=>h(t)-h(e))).map(d[i]||d.between).join(",")})`}function km(t){const[e,n,r,i]=t;return[i,e,n,r]}function wm(t,e,n){const[r,i,,a]=Gc(t)?km(e):e,[o,s]=n,c=t.getCenter(),l=xs(vs(r,c)),u=xs(vs(i,c)),f=u===l&&o!==s?u+2*Math.PI:u;return{startAngle:l,endAngle:f-l>=0?f:2*Math.PI+f,innerRadius:ys(a,c),outerRadius:ys(r,c)}}function Mm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Om(t,e){if(!Wc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Em(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,a,o=0]]=t;return[(e+i)/2,(n+a)/2,(r+o)/2]}function Sm(t,e,n,r,i={}){const{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:c=a,insetRight:l=a,insetBottom:u=a,radiusBottomLeft:f=o,radiusBottomRight:h=o,radiusTopLeft:d=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:v=1/0,minHeight:m=-1/0}=i,y=Ce(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Wc(r)&&!Yc(r)){const n=!!Gc(r),[i,,a]=n?km(e):e,[o,b]=i,[x,k]=vs(a,i),w=(x>0?o:o+x)+s,M=(k>0?b:b+k)+c,O=Math.abs(x)-(s+l),E=Math.abs(k)-(c+u),S=n?vm(O,m,1/0):vm(O,g,v),A=n?vm(E,g,v):vm(E,m,1/0),_=n?w:w-(S-O)/2,T=n?M-(A-E)/2:M-(A-E);return pm(t.createElement("rect",{})).style("x",_).style("y",T).style("width",S).style("height",A).style("radius",[d,p,h,f]).call(ym,y).node()}const{y:b,y1:x}=n,k=r.getCenter(),w=wm(r,e,[b,x]),M=oc().cornerRadius(o).padAngle(a*Math.PI/180);return pm(t.createElement("path",{})).style("d",M(w)).style("transform",`translate(${k[0]}, ${k[1]})`).style("radius",o).style("inset",a).call(ym,y).node()}gm.registry={g:zg,rect:Qg,circle:Ig,path:qg,text:tv,ellipse:Fg,image:$g,line:Hg,polygon:Xg,polyline:Kg,html:Wg};const Am=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:a=!0}=t,o=Ce(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=Ce(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:v=g,radiusTopRight:m=g,radiusBottomRight:y=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:k=x,innerRadiusTopRight:w=x,innerRadiusBottomRight:M=x,innerRadiusBottomLeft:O=x,lineWidth:E=("stroke"===n||p?d:0),inset:S=0,insetLeft:A=S,insetRight:_=S,insetBottom:T=S,insetTop:P=S,minWidth:C,maxWidth:L,minHeight:N}=o,j=Ce(o,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,D=[i?v:k,i?m:w,a?y:M,a?b:O],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Gc(s)&&B.push(B.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map(((t,e)=>[t,D[e]])))),{inset:S,insetLeft:A,insetRight:_,insetBottom:T,insetTop:P,minWidth:C,maxWidth:L,minHeight:N});return pm(Sm(c,e,r,s,F)).call(ym,h).style("fill","transparent").style(n,R).style(Mm(t),I).style("lineWidth",E).style("stroke",void 0===p?R:p).call(ym,j).node()}};Am.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _m=(t,e)=>Am(Object.assign({colorAttribute:"fill"},t),e);_m.props=Object.assign(Object.assign({},Am.props),{defaultMarker:"square"});const Tm=(t,e)=>Am(Object.assign({colorAttribute:"stroke"},t),e);function Pm(t,e,n){const[r,i,a,o]=t;if(Gc(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:a[0],a[1]],o]}return[r,[i[0],e?e[0][1]:i[1]],[a[0],e?e[3][1]:a[1]],o]}Tm.props=Object.assign(Object.assign({},Am.props),{defaultMarker:"hollowSquare"});const Cm=(t,e)=>{const{adjustPoints:n=Pm}=t,r=Ce(t,["adjustPoints"]),{coordinate:i,document:a}=e;return(t,e,o,s)=>{const{index:c}=e,{color:l}=o,u=Ce(o,["color"]),f=s[c+1],h=n(t,f,i),d=!!Gc(i),[p,g,v,m]=d?km(h):h,{color:y=l,opacity:b}=e,x=hc().curve(Ac)([p,g,v,m]);return pm(a.createElement("path",{})).call(ym,u).style("d",x).style("fill",y).style("fillOpacity",b).call(ym,r).node()}};function Lm(t,e,n){const[r,i,a,o]=t;if(Gc(n)){return[r,[e?e[0][0]:(i[0]+a[0])/2,i[1]],[e?e[3][0]:(i[0]+a[0])/2,a[1]],o]}return[r,[i[0],e?e[0][1]:(i[1]+a[1])/2],[a[0],e?e[3][1]:(i[1]+a[1])/2],o]}Cm.props={defaultMarker:"square"};const Nm=(t,e)=>Cm(Object.assign({adjustPoints:Lm},t),e);function jm(t){const e="function"==typeof t?t:t.render;return class extends Bg{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Nm.props={defaultMarker:"square"};const Rm=jm((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,a=t.ownerDocument;pm(t).maybeAppend("line",(()=>a.createElement("path",{}))).style("d",e).call(ym,r),pm(t).maybeAppend("line1",(()=>a.createElement("path",{}))).style("d",n).call(ym,i)}));const Im=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:a=t=>!Number.isNaN(t)&&null!=t,connect:o=!1}=t,s=Ce(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=Ce(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:v,seriesX:m,seriesY:y}=e,b=Om(c,e),x=Gc(c),k=r&&v?xm(v,m,y,r,i,x):p,w=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),k&&{stroke:k}),g&&{lineWidth:g}),b&&{transform:b}),s);let M;if(Wc(c)){const t=c.getCenter();M=e=>mc(hc().curve(pc)).angle(((n,r)=>xs(vs(e[r],t)))).radius(((n,r)=>ys(e[r],t))).defined((([t,e])=>a(t)&&a(e))).curve(n)(e)}else M=hc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>a(t)&&a(e))).curve(n);const[O,E]=function(t,e){const n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,a),S=Tr(w,"connect"),A=!!E.length;if(!A||o&&!Object.keys(S).length)return pm(l.createElement("path",{})).style("d",M(O)||[]).call(ym,w).node();if(A&&!o)return pm(l.createElement("path",{})).style("d",M(t)).call(ym,w).node();return pm(new Rm).style("style1",Object.assign(Object.assign({},w),S)).style("style2",w).style("d1",(_=E,_.map(M).join(","))).style("d2",M(t)).node();var _}};Im.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dm=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Wc(n)?Ac:lc;return Im(Object.assign({curve:i},t),e)(...r)}};Dm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"line"});const Bm=(t,e)=>{const n=Ce(t,[]),{coordinate:r}=e;return(...t)=>{const i=Wc(r)?Ec:Gc(r)?Ic:Rc;return Im(Object.assign({curve:i},n),e)(...t)}};Bm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"smooth"});const Fm=(t,e)=>Im(Object.assign({curve:zc},t),e);Fm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"hv"});const zm=(t,e)=>Im(Object.assign({curve:Fc},t),e);zm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"vh"});const Gm=(t,e)=>Im(Object.assign({curve:Bc},t),e);function Wm(t,e,n,r,i){const a=bs(vs(n,e)),o=a+Math.PI/2,s=[r/2*Math.cos(o),r/2*Math.sin(o)],c=[i/2*Math.cos(o),i/2*Math.sin(o)],l=[i/2*Math.cos(a),i/2*Math.sin(a)],u=[r/2*Math.cos(a),r/2*Math.sin(a)],f=ms(e,s),h=ms(n,c),d=ms(h,l),p=ms(n,l),g=vs(p,c),v=vs(n,c),m=vs(e,s),y=vs(m,u),b=vs(e,u),x=vs(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...v,i/2),t.lineTo(...m),t.arcTo(...y,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}Gm.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"hvh"});const $m=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:a,color:o}=r,{color:s}=i,c=Ce(i,["color"]),l=Qs();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=a[t],o=a[t+1];[...n,...r].every(Ar)&&Wm(l,n,r,i,o)}return pm(n.createElement("path",{})).call(ym,c).style("fill",o||s).style("d",l.toString()).call(ym,t).node()}};$m.props=Object.assign(Object.assign({},Im.props),{defaultMarker:"line"});const Ym=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];Ym.style=["fill"];const Hm=Ym.bind(void 0);Hm.style=["stroke","lineWidth"];const Vm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Vm.style=["fill"];const qm=Vm.bind(void 0);qm.style=["fill"];const Um=Vm.bind(void 0);Um.style=["stroke","lineWidth"];const Xm=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};Xm.style=["fill"];const Zm=Xm.bind(void 0);Zm.style=["stroke","lineWidth"];const Km=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};Km.style=["fill"];const Qm=Km.bind(void 0);Qm.style=["stroke","lineWidth"];const Jm=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};Jm.style=["fill"];const ty=Jm.bind(void 0);ty.style=["stroke","lineWidth"];const ey=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};ey.style=["fill"];const ny=ey.bind(void 0);ny.style=["stroke","lineWidth"];const ry=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};ry.style=["fill"];const iy=ry.bind(void 0);iy.style=["stroke","lineWidth"];const ay=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];ay.style=["stroke","lineWidth"];const oy=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];oy.style=["stroke","lineWidth"];const sy=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];sy.style=["stroke","lineWidth"];const cy=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];cy.style=["stroke","lineWidth"];const ly=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];ly.style=["stroke","lineWidth"];const uy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];uy.style=["stroke","lineWidth"];const fy=uy.bind(void 0);fy.style=["stroke","lineWidth"];const hy=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];hy.style=["stroke","lineWidth"];const dy=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];dy.style=["stroke","lineWidth"];const py=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];py.style=["stroke","lineWidth"];const gy=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];gy.style=["stroke","lineWidth"];const vy=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];vy.style=["stroke","lineWidth"];const my=new Map([["bowtie",ry],["cross",oy],["dash",fy],["diamond",Xm],["dot",uy],["hexagon",ey],["hollowBowtie",iy],["hollowDiamond",Zm],["hollowHexagon",ny],["hollowPoint",Hm],["hollowSquare",Um],["hollowTriangle",Qm],["hollowTriangleDown",ty],["hv",dy],["hvh",gy],["hyphen",ly],["line",ay],["plus",cy],["point",Ym],["rect",qm],["smooth",hy],["square",Vm],["tick",sy],["triangleDown",Jm],["triangle",Km],["vh",py],["vhv",vy]]);function yy(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||Vc(r)){const[[t,n],[r,i]]=e,a=Math.abs((r-t)/2),o=Math.abs((i-n)/2);return Math.max(0,(a+o)/2)}return i}const by=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,a=Ce(t,["colorAttribute","symbol","mode"]),o=my.get(r)||my.get("point"),{coordinate:s,document:c}=e;return(e,r,l)=>{const{lineWidth:u,color:f}=l,h=a.stroke?u||1:u,{color:d=f,transform:p,opacity:g}=r,[v,m]=Em(e),y=yy(i,e,r,s)||a.r||l.r;return pm(c.createElement("path",{})).call(ym,l).style("fill","transparent").style("d",o(v,m,y)).style("lineWidth",h).style("transform",p).style("transformOrigin",`${v-y} ${m-y}`).style("stroke",d).style(Mm(t),g).style(n,d).call(ym,a).node()}};by.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);xy.props=Object.assign({defaultMarker:"hollowBowtie"},by.props);const ky=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);ky.props=Object.assign({defaultMarker:"hollowDiamond"},by.props);const wy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);wy.props=Object.assign({defaultMarker:"hollowHexagon"},by.props);const My=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);My.props=Object.assign({defaultMarker:"hollowPoint"},by.props);const Oy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Oy.props=Object.assign({defaultMarker:"hollowSquare"},by.props);const Ey=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Ey.props=Object.assign({defaultMarker:"hollowTriangle"},by.props);const Sy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Sy.props=Object.assign({defaultMarker:"hollowTriangleDown"},by.props);const Ay=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=Ce(t,["colorAttribute","mode"]),{coordinate:a,document:o}=e;return(e,s,c)=>{const{lineWidth:l,color:u}=c,f=i.stroke?l||1:l,{color:h=u,transform:d,opacity:p}=s,[g,v]=Em(e),m=yy(r,e,s,a)||i.r||c.r;return pm(o.createElement("circle",{})).call(ym,c).style("fill","transparent").style("cx",g).style("cy",v).style("r",m).style("lineWidth",f).style("transform",d).style("transformOrigin",`${g} ${v}`).style("stroke",h).style(Mm(t),p).style(n,h).call(ym,i).node()}},_y=(t,e)=>Ay(Object.assign({colorAttribute:"fill"},t),e);_y.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const Ty=(t,e)=>Ay(Object.assign({colorAttribute:"stroke"},t),e);Ty.props=Object.assign({defaultMarker:"hollowPoint"},_y.props);const Py=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Py.props=Object.assign({defaultMarker:"bowtie"},by.props);const Cy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Cy.props=Object.assign({defaultMarker:"cross"},by.props);const Ly=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Ly.props=Object.assign({defaultMarker:"diamond"},by.props);const Ny=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Ny.props=Object.assign({defaultMarker:"hexagon"},by.props);const jy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);jy.props=Object.assign({defaultMarker:"hyphen"},by.props);const Ry=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Ry.props=Object.assign({defaultMarker:"line"},by.props);const Iy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Iy.props=Object.assign({defaultMarker:"plus"},by.props);const Dy=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);Dy.props=Object.assign({defaultMarker:"point"},by.props);const By=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);By.props=Object.assign({defaultMarker:"square"},by.props);const Fy=(t,e)=>by(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Fy.props=Object.assign({defaultMarker:"tick"},by.props);const zy=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);zy.props=Object.assign({defaultMarker:"triangle"},by.props);const Gy=(t,e)=>by(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);Gy.props=Object.assign({defaultMarker:"triangleDown"},by.props);const Wy=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Ce(t,["arrow","arrowSize"]),{document:a}=e;return(t,e,o)=>{const{defaultColor:s}=o,c=Ce(o,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=Qs();if(d.moveTo(...f),d.lineTo(...h),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*ys(t,e):r,a=Math.PI/6,o=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-o-a,c=o-a;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,h,{arrowSize:r});d.moveTo(...t),d.lineTo(...h),d.lineTo(...e)}return pm(a.createElement("path",{})).call(ym,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(ym,i).node()}};function $y(t,e){e(t),t.children&&t.children.forEach((function(t){t&&$y(t,e)}))}function Yy(t){Vy(t,!0)}function Hy(t){Vy(t,!1)}function Vy(t,e){var n=e?"visible":"hidden";$y(t,(function(t){t.attr("visibility",n)}))}Wy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var qy=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,Ie([],Re(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(Hp.INSERTED,(function(){Hy(r)})),r}return Te(e,t),e}(zg);function Uy(t){var e=t.appendChild(new qy({class:"offscreen"}));return Hy(e),e}var Xy=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Ce(e,["style"]);return t.call(this,Pe({style:Pe({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return Te(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Uy(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(tv);function Zy(t){return t*Math.PI/180}function Ky(t){return Number((180*t/Math.PI).toPrecision(5))}var Qy=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();function Jy(t,e){return y(t)?t.apply(void 0,Ie([],Re(e),!1)):t}var tb,eb,nb,rb,ib=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=Re(t,2),r=e[0],i=e[1],a=n(i);return[r,{name:a,class:".".concat(a),id:"#".concat(a),toString:function(){return a}}]})));return Object.assign(r,{prefix:n}),r},ab=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var a=Re(i,2),o=a[0],s=a[1],c=t;Object.prototype.hasOwnProperty.call(e,o)&&(s?A(s)?(A(t[o])||(c[o]={}),n<r?ab(t[o],s,n+1,r):c[o]=e[o]):x(s)?(c[o]=[],c[o]=c[o].concat(s)):c[o]=s:c[o]=s)}))},ob=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)ab(t,e[r]);return t},sb=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},cb=(eb=function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return tb||(tb=wg.offscreenCanvasCreator.getOrCreateContext(void 0)),tb.font=[a,o,i,"".concat(n,"px"),r].join(" "),tb.measureText(t).width},nb=function(t,e){return[t,Object.values(e||lb(t)).join()].join("")},void 0===(rb=4096)&&(rb=128),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=nb?nb.apply(this,t):t[0];U.has(eb)||U.set(eb,function(t){var e,n,r,i=t||1;function a(t,a){++e>i&&(r=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}(rb));var r=U.get(eb);if(r.has(n))return r.get(n);var i=eb.apply(this,t);return r.set(n,i),i}),lb=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,a=t.style.fontSize;return{fontSize:a="object"==typeof a?a.value:a,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function ub(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function fb(t,e){var n=ub(t);n&&n.attr(e)}function hb(t,e,n){void 0===n&&(n="..."),fb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function db(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var a=n[0];return[a.clientX,a.clientY]}return r&&i?[r,i]:[0,0]}function pb(t){return"function"==typeof t?t():L(t)||R(t)?new Xy({style:{text:String(t)}}):t}function gb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function vb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}function mb(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var a=new Array(r),o=new Array(n),s=0;for(s=0;s<r;++s)a[s]=mb(t[s],e[s]);for(;s<n;++s)o[s]=e[s];for(s=0;s<r;++s)o[s]=a[s](i);return o}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach((function(e){var i=Re(e,2),a=i[0],o=i[1];a in t?n[a]=mb(t[a],o):r[a]=o})),function(t){return Object.entries(n).forEach((function(e){var n=Re(e,2),i=n[0],a=n[1];return r[i]=a(t)})),r}}(t,e):function(e){return t}}function yb(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,a=0;a<t.length;a++){var o=t[a],s=o.x,c=o.y,l=Re([s+o.width,c+o.height],2),u=l[0],f=l[1];s<e&&(e=s),c<n&&(n=c),u>r&&(r=u),f>i&&(i=f)}return new Qy(e,n,r-e,i-n)}var bb=function(t,e,n){var r=t.width,i=t.height,a=n.flexDirection,o=void 0===a?"row":a,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===o,h="row"===o||"column"===o,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=Re([0,0],2),g=p[0],v=p[1],m=e.map((function(t){var e,n=t.width,r=t.height,i=Re([g,v],2),a=i[0],o=i[1];return e=Re([g+n*d[0],v+r*d[1]],2),g=e[0],v=e[1],new Qy(a,o,n,r)})),y=yb(m),b={"flex-start":0,"flex-end":f?r-y.width:i-y.height,center:f?(r-y.width)/2:(i-y.height)/2},x=m.map((function(t){var e=t.x,n=t.y,r=Qy.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));yb(x);var k=function(t){var e=Re(f?["height",i]:["width",r],2),n=e[0],a=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return a-t[n];case"center":return a/2-t[n]/2}},w=x.map((function(t){var e=t.x,n=t.y,r=Qy.fromRect(t);return r.x=f?e:e+k(r),r.y=f?n+k(r):n,r})),M=w.map((function(e){var n,r,i=Qy.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return M},xb=function(t,e,n){return[]};function kb(t,e){return[t[0]*e,t[1]*e]}function wb(t,e){return[t[0]+e[0],t[1]+e[1]]}function Mb(t,e){return[t[0]-e[0],t[1]-e[1]]}function Ob(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Eb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Sb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Ab(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function _b(t,e){return+t.toPrecision(e)}function Tb(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function Pb(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],a=0,o=t.length;a<o;a+=2)i.push([t[a],t[a+1]]);var s,c,l,u=function(t,e,n,r){var i,a,o,s,c,l,u=[],f=!!r,h=[1/0,1/0],d=[-1/0,-1/0];if(f){h=(i=Re(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=Ob(h,m=t[p]),d=Eb(d,m)}p=0;for(var v=t.length;p<v;p+=1){var m=t[p];if(0!==p||n)if(p!==v-1||n){a=t[[p?p-1:v-1,p-1][n?0:1]];var y=[0,0];y=kb(y=Mb(o=t[n?(p+1)%v:p+1],a),e);var b=Sb(m,a),x=Sb(m,o),k=b+x;0!==k&&(b/=k,x/=k);var w=kb(y,-b),M=kb(y,x);c=wb(m,w),s=Ob(s=wb(m,M),Eb(o,m)),s=Eb(s,Ob(o,m)),c=Ob(c=wb(m,w=kb(w=Mb(s,m),-b/x)),Eb(a,m)),s=wb(m,M=kb(M=Mb(m,c=Eb(c,Ob(a,m))),x/b)),f&&(c=Ob(c=Eb(c,h),d),s=Ob(s=Eb(s,h),d)),u.push(l),u.push(c),l=s}else c=m,u.push(l),u.push(c);else l=m}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,h=[];for(a=0;a<f-1;a+=1)s=u[2*a],c=u[2*a+1],l=i[a+1],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]]);return r&&(s=u[f],c=u[f+1],l=Re(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var Cb=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function Lb(t){return Cb.includes(t)}function Nb(t){var e={};for(var n in t)Lb(n)&&(e[n]=t[n]);return e}function jb(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,a=r.height,o=e/Math.max(i,a);return n&&(t.style.transform="scale(".concat(o,")")),o}var Rb=function(){function t(t,n,r,i,a,o,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===a&&(a=[null,null,null,null,null]),void 0===o&&(o=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=a[0],this._update=a[1],this._exit=a[2],this._merge=a[3],this._split=a[4],this._transitions=o,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var a=0;a<this._data.length;a++){var o=this._data[a],s=Re(Array.isArray(o)?o:[o,null],2),c=s[0],l=s[1];(f=r(c,a)).__data__=c,null!==l&&(f.__fromElements__=l),this._parent.appendChild(f),i.push(f)}return new n(i,null,this._parent,this._document)}for(a=0;a<this._elements.length;a++){var u=this._elements[a],f=r(c=u.__data__,a);u.appendChild(f),i.push(f)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=De(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),a=De(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return a.attr("className",i),a},t.prototype.maybeAppendByName=function(t,n){var i=De(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,a;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var o=[],s=[],c=new Set(this._elements),l=[],u=new Set,f=new Map(this._elements.map((function(t,n){return[e(t.__data__,n),t]}))),h=new Map(this._facetElements.map((function(t,n){return[e(t.__data__,n),t]}))),d=function(t,e){var n=new Map;return t.forEach((function(t){var r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)})),n}(this._elements,(function(t){return r(t.__data__)})),p=0;p<t.length;p++){var g=t[p],v=e(g,p),m=r(g,p);if(f.has(v))(k=f.get(v)).__data__=g,k.__facet__=!1,s.push(k),c.delete(k),f.delete(v);else if(h.has(v)){(k=h.get(v)).__data__=g,k.__facet__=!0,s.push(k),h.delete(v)}else if(d.has(v)){var y=d.get(v);l.push([g,y]);try{for(var b=(i=void 0,je(y)),x=b.next();!x.done;x=b.next()){var k=x.value;c.delete(k)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}d.delete(v)}else if(f.has(m)){(k=f.get(m)).__toData__?k.__toData__.push(g):k.__toData__=[g],u.add(k),c.delete(k)}else o.push(g)}var w=[new n([],o,this._parent,this._document),new n(s,null,this._parent,this._document),new n(c,null,this._parent,this._document),new n([],l,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,w)},t.prototype.merge=function(t){var e=Ie(Ie([],Re(this._elements),!1),Re(t._elements),!1),r=Ie(Ie([],Re(this._transitions),!1),Re(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var a=t(this._enter),o=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return o.merge(a).merge(s).merge(c).merge(l)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then((function(){return n.remove()})):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each((function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))}))},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each((function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))}))},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each((function(n,r){var i=this;Object.entries(t).forEach((function(t){var a=Re(t,2),o=a[0],s=a[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(o,c.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,r){e[r]=t.call(this,n,r)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,Ie([this._parent,this],Re(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter((function(t){return!!t}))},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var a="string"==typeof e?this.createElement(e):e();return r.appendChild(a),new n([a],null,this._parent,this._document)},t.registry={g:zg,rect:Qg,circle:Ig,path:qg,text:Xy,ellipse:Fg,image:$g,line:Hg,polygon:Xg,polyline:Kg,html:Wg},t}();function Ib(t){return new Rb([t],null,t,t.ownerDocument)}function Db(t){if(R(t))return[t,t,t,t];if(x(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function Bb(t){var e=t.getLocalBounds(),n=Re([e.min,e.max],2),r=Re(n[0],2),i=r[0],a=r[1],o=Re(n[1],2),s=o[0],c=o[1];return{x:i,y:a,width:s-i,height:c-a,left:i,bottom:c,top:a,right:s}}function Fb(t,e){var n=Re(t,2),r=n[0],i=n[1],a=Re(e,2),o=a[0],s=a[1];return r!==o&&i===s}function zb(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Gb(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",a=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(a):a}var Wb=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function $b(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=Re(t,2),a=i[0],o=i[1];if("className"===a||"class"===a);else if(Wb(a,"show")&&Wb(Gb(a,"show"),e)!==n)a===function(t,e){return"".concat(e).concat(zb(t))}(e,"show")?r[a]=o:r[a.replace(new RegExp(zb(e)),"")]=o;else if(!Wb(a,"show")&&Wb(a,e)!==n){var s=Gb(a,e);"filter"===s&&"function"==typeof o||(r[s]=o)}})),r}function Yb(t,e){return Object.entries(t).reduce((function(t,n){var r=Re(n,2),i=r[0],a=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=a:t["".concat(e).concat(zb(i))]=a,t}),{})}function Hb(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach((function(t){var a=Re(t,2),o=a[0],s=a[1];e.includes(o)||(-1!==n.indexOf(o)?i[o]=s:r[o]=s)})),[r,i]}function Vb(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,(function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,a=r.height,o=Re([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:a):t})),2);return[o[0],o[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}var qb=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,Ie([],Re(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)):t.innerHTML=""};function Ub(){Vy(this,"hidden"!==this.attributes.visibility)}var Xb=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,ob({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return Te(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Uy(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&Ub.call(this)},e.prototype.update=function(t,e){var n;return this.attr(ob({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){return Ce(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(Bg),Zb=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},Kb=Zb,Qb=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Jb=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},tx=Jb;var ex=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function nx(t){var e=function(t){var e="default";if(k(t)&&t instanceof Image)e="image";else if(y(t))e="symbol";else if(L(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var rx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Te(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,a=t.y,o=void 0===a?0:a,s=this.getSubShapeStyle(t),c=s.symbol,l=s.size,u=void 0===l?16:l,f=Ce(s,["symbol","size"]),h=nx(c);gb(!!h,Ib(n),(function(t){t.maybeAppendByClassName("marker",h).attr("className","marker ".concat(h,"-marker")).call((function(t){if("image"===h){var n=2*u;t.styles({img:c,width:n,height:n,x:i-u,y:o-u})}else{n=u/2;var r=y(c)?c:e.getSymbol(c);t.styles(Pe({d:null==r?void 0:r(i,o,n)},f))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(Xb);rx.registerSymbol("cross",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]})),rx.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),rx.registerSymbol("line",Qb),rx.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),rx.registerSymbol("tick",(function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]})),rx.registerSymbol("circle",Zb),rx.registerSymbol("point",Kb),rx.registerSymbol("bowtie",(function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]})),rx.registerSymbol("hexagon",(function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]})),rx.registerSymbol("square",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]})),rx.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),rx.registerSymbol("triangle",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]})),rx.registerSymbol("triangle-down",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]})),rx.registerSymbol("line",Qb),rx.registerSymbol("dot",Jb),rx.registerSymbol("dash",tx),rx.registerSymbol("smooth",(function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]})),rx.registerSymbol("hv",(function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})),rx.registerSymbol("vh",(function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})),rx.registerSymbol("hvh",(function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})),rx.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));var ix=function(t){function e(e){var n=this,r=e.style,i=Ce(e,["style"]);return(n=t.call(this,K({},{type:"column"},Pe({style:r},i)))||this).columnsGroup=new zg({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return Te(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,r=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(r,")"),Ib(this.columnsGroup).selectAll(".column").data(e.flat()).join((function(t){return t.append("rect").attr("className","column").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.update=function(t){this.attr(ob({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Rg),ax=function(t){function e(e){var n=this,r=e.style,i=Ce(e,["style"]);return(n=t.call(this,K({},{type:"lines"},Pe({style:r},i)))||this).linesGroup=n.appendChild(new zg),n.areasGroup=n.appendChild(new zg),n.render(),n}return Te(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,r=t.x,i=t.y;this.style.transform="translate(".concat(r,", ").concat(i,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(ob({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Ib(this.linesGroup).selectAll(".line").data(t).join((function(t){return t.append("path").attr("className","line").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.renderAreas=function(t){Ib(this.linesGroup).selectAll(".area").data(t).join((function(t){return t.append("path").attr("className","area").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.style(t)}))}),(function(t){return t.remove()}))},e}(Rg);function ox(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return Ie([e===n?"M":"L"],Re(t),!1)}));return e?r.reverse():r}function sx(t,e){if(void 0===e&&(e=!1),t.length<=2)return ox(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];tt(a,n.slice(-2))||n.push.apply(n,Ie([],Re(a),!1))}var o=Pb(n,!1);return e?o.unshift(Ie(["M"],Re(t[r-1]),!1)):o.unshift(Ie(["M"],Re(t[0]),!1)),o}function cx(t,e,n){var r=V(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function lx(t){return 0===t.length?[0,0]:[P(B(t,(function(t){return P(t)||0}))),T(D(t,(function(t){return T(t)||0})))]}function ux(t){for(var e=V(t),n=e[0].length,r=Re([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],a=r[1],o=0;o<e.length;o+=1)for(var s=e[o],c=0;c<n;c+=1)s[c]>=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=a[c],a[c]=s[c]);return e}var fx=function(t){function e(e){return t.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Te(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=V(t);return R(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?ux(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=Re(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var a=$b(this.attributes,"area"),o=$b(this.attributes,"line"),s=this.containerShape.width,c=this.data;if(0===c[0].length)return{lines:[],areas:[]};var l=this.scales,u=function(t,e){var n,r=e.x,i=e.y,a=Re(i.getOptions().range||[0,0],2),o=a[0],s=a[1];return s>o&&(n=Re([o,s],2),s=n[0],o=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),j(i.map(t),s,o)]}))}))}(c,{type:"line",x:l.x,y:l.y}),f=[];if(a){var h=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var a=t[i],o=sx(a),s=void 0;if(0===i)s=cx(o,e,n);else{var c=sx(t[i-1],!0),l=a[0];c[0][0]="L",s=Ie(Ie(Ie([],Re(o),!1),Re(c),!1),[Ie(["M"],Re(l),!1),["Z"]],!1)}r.push(s)}return r}(u,s,h):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var a=ox(t[i]),o=void 0;if(0===i)o=cx(a,e,n);else{var s=ox(t[i-1],!0);s[0][0]="L",o=Ie(Ie(Ie([],Re(a),!1),Re(s),!1),[["Z"]],!1)}r.push(o)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return cx(e?sx(t):ox(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return Pe({stroke:t.getColor(n),d:i?sx(e):ox(e)},o)})),areas:f.map((function(e,n){return Pe({d:e,fill:t.getColor(n)},a)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=$b(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,a=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var o=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=ux(s));var c=this.createScales(s),l=c.x,u=c.y,f=Re(lx(s),2),h=f[0],d=f[1],p=new so({domain:[0,d-(h>0?0:h)],range:[0,o*a]}),g=l.getBandWidth(),v=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,a){var o=g/s.length;return Pe(Pe({fill:t.getColor(i)},e),r?{x:l.map(a),y:u.map(n),width:g,height:p.map(v[i][a])}:{x:l.map(a)+o*i,y:n>=0?u.map(n):u.map(0),width:o,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Ib(n).select(r):Ib(n).append(i)).attr("className","container").node();var a=t.type,o=t.x,s=t.y,c="spark".concat(a),l=Pe({x:o,y:s},"line"===a?this.linesStyle:this.columnsStyle);Ib(e).selectAll(".spark").data([a]).join((function(t){return t.append((function(t){return"line"===t?new ax({className:c,style:l}):new ix({className:c,style:l})})).attr("className","spark ".concat(c))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return x(e)?e[t%e.length]:y(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,a=r.scale,o=r.range,s=void 0===o?[]:o,c=r.spacing,l=this.containerShape,u=l.width,f=l.height,h=Re(lx(t),2),d=h[0],p=h[1],g=new so({domain:[null!==(e=s[0])&&void 0!==e?e:d,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-a)]});return"line"===i?{type:i,x:new so({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new $a({domain:t[0].map((function(t,e){return e})),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:g}},e.tag="sparkline",e}(Xb);function hx(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=Re(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,Pe(Pe({},t[e]),n)]:[e,n]})))}function dx(t,e){t?t.finished.then(e):e()}function px(t,e){"update"in t?t.update(e):t.attr(e)}function gx(t,e,n){return 0===e.length?null:n?t.animate(e,n):(px(t,{style:e.slice(-1)[0]}),null)}function vx(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=Re(e,2),a=n[0],o=n[1];if(!b(o)){var s=t.style[a]||t.parsedStyle[a]||0;s!==o&&(r[a]=s,i[a]=o)}})),n?gx(t,[r,i],Pe({fill:"both"},n)):(px(t,i),null)}function mx(t,e){return t.style.opacity||(t.style.opacity=1),vx(t,{opacity:0},e)}var yx={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},bx={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},xx={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},kx=ib({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),wx=ib({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Mx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Te(e,t),e.prototype.render=function(t,e){var n=t.x,r=t.y,i=t.size,a=void 0===i?10:i,o=t.radius,s=void 0===o?a/4:o,c=t.orientation,l=Ce(t,["x","y","size","radius","orientation"]),u=a,f=2.4*u,h=Ib(e).maybeAppendByClassName(wx.iconRect,"rect").styles(Pe(Pe({},l),{width:u,height:f,radius:s,x:n-u/2,y:r-f/2,transformOrigin:"center"})),d=n+1/3*u-u/2,p=n+2/3*u-u/2,g=r+1/4*f-f/2,v=r+3/4*f-f/2;h.maybeAppendByClassName("".concat(wx.iconLine,"-1"),"line").styles(Pe({x1:d,x2:d,y1:g,y2:v},l)),h.maybeAppendByClassName("".concat(wx.iconLine,"-2"),"line").styles(Pe({x1:p,x2:p,y1:g,y2:v},l)),"vertical"===c&&(h.node().style.transform="rotate(90)")},e}(Xb),Ox=function(t){function e(e){return t.call(this,e,xx)||this}return Te(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,a=n.showLabel,o=$b(this.attributes,"label"),s=o.x,c=void 0===s?0:s,l=o.y,u=void 0===l?0:l,f=o.transform,h=o.transformOrigin,d=Re(Hb(Ce(o,["x","y","transform","transformOrigin"]),[]),2),p=d[0],g=d[1],v=Ib(t).maybeAppendByClassName(wx.labelGroup,"g").styles(g),m=Pe(Pe({},bx),p),y=m.text,b=Ce(m,["text"]);gb(!!a,v,(function(t){e.label=t.maybeAppendByClassName(wx.label,"text").styles(Pe(Pe({},b),{x:r+c,y:i+u,transform:f,transformOrigin:h,text:"".concat(y)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,a=e.type,o=Pe(Pe({x:n,y:r,orientation:i},yx),$b(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new Mx({style:o})}:s;Ib(t).maybeAppendByClassName(wx.iconGroup,"g").selectAll(wx.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(a)}).attr("className",wx.icon.name)}),(function(t){return t.update(o)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(Xb),Ex=function(t){function e(e){var n=t.call(this,e,Pe(Pe(Pe({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},Yb(xx,"handle")),Yb(yx,"handleIcon")),Yb(bx,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(db(e));var r=n.availableSpace,i=r.x,a=r.y,o=n.getBBox(),s=o.x,c=o.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,a])-n.getOrientVal([+s,+c])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,a=e.type;t.stopPropagation();var o=n.getOrientVal(db(t)),s=o-n.prevPos;if(s){var c=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(c);break;case"end":r&&n.setValuesOffset(0,c);break;case"selection":r&&n.setValuesOffset(c,c);break;case"track":if(!i)return;n.selectionWidth+=c,"range"===a?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=o}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,a="range"===i?t:t[1],o="range"===i?n.getValues():n.getValues()[1],s=new Rp("valuechange",{detail:{oldValue:a,value:o}});n.dispatchEvent(s),null==r||r(o)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return Te(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=$b(this.attributes,"sparkline");return Pe(Pe({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=Re(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=Re(Db(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],a=this.shape;return{x:i,y:e,width:a.width-(i+n),height:a.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(kx.selection.class).each((function(n,r){vx(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&vx(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&vx(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=$b(this.attributes,"track");this.trackShape=Ib(t).maybeAppendByClassName(kx.track,"rect").styles(Pe(Pe({x:n,y:r},this.shape),i))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.brushable;this.brushArea=Ib(t).maybeAppendByClassName(kx.brushArea,"rect").styles(Pe({x:n,y:r,fill:"transparent",cursor:i?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,r=n.x,i=n.y;gb("horizontal"===n.orientation,Ib(t).maybeAppendByClassName(kx.sparklineGroup,"g"),(function(t){var n=Pe(Pe({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(kx.sparkline,(function(){return new fx({style:n})})).update(n)}))},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,a=r?"range"===i?["start","end"]:["end"]:[],o=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(kx.handle.class).data(a.map((function(t){return{type:t}})),(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new Ox({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(kx.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");o[n]=this,this.addEventListener("pointerdown",o.onDragStart(e))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(o.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");o[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.type,a=e.selectionType;this.foregroundGroup=Ib(t).maybeAppendByClassName(kx.foreground,"g");var o=$b(this.attributes,"selection"),s=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===a?"grab":"invert"===a?"crosshair":"default"})).styles(Pe(Pe({},o),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(kx.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:Pe({},t),index:e,show:"select"===a?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",kx.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=Ib(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),c.onDragStart("selection")(t)})),c.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),c.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),c.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(function(){n.attr("cursor","grabbing")})),this.addEventListener("pointerup",(function(){n.attr("cursor","pointer")})),this.addEventListener("pointerover",(function(){n.attr("cursor","pointer")}))):this.on("pointerdown",c.onDragStart("track"))}))}),(function(t){return t.call(s)}),(function(t){return t.remove()})),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=Re(this.range,2),i=r[0],a=r[1],o=Re(this.getValues().map((function(t){return _b(t,e)})),2),s=o[0],c=o[1],l=Re(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return _b(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,j(f,i,a)];u>f&&(u=(n=Re([f,u],2))[0],f=n[1]);var h=f-u;return h>a-i?[i,a]:u<i?s===i&&c===f?[i,f]:[i,h+i]:f>a?c===a&&s===u?[u,a]:[a-h,a]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=Re(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,a=i.x,o=i.y,s=i.width,c=i.height;return this.getOrientVal([[{y:o,height:c,x:a,width:n*s},{y:o,height:c,x:n*s+a,width:(r-n)*s},{y:o,height:c,x:r*s,width:(1-r)*s}],[{x:a,width:s,y:o,height:n*c},{x:a,width:s,y:n*c+o,height:(r-n)*c},{x:a,width:s,y:r*c,height:(1-r)*c}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,a=n.width,o=n.height,s=Re(this.clampValues(),2),c=s[0],l=s[1],u="start"===t?-e:e,f=("start"===t?c:l)*this.getOrientVal([a,o])+u;return{x:r+this.getOrientVal([f,a/2]),y:i+this.getOrientVal([o/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,a=n.formatter,o=n.autoFitLabel,s=$b(this.attributes,"handle"),c=$b(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=a("start"===t?f[0]:f[1]),d=new Xy({style:Pe(Pe(Pe({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,v=p.height;if(d.destroy(),!o){if("value"===r)return{text:h,x:0,y:-v-l};var m=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-m:m,e}var y=0,b=0,x=this.availableSpace,k=x.width,w=x.height,M=this.calcSelectionArea()[1],O=M.x,E=M.y,S=M.width,A=M.height,_=l+u;if("horizontal"===i){var T=_+g/2;if("start"===t)y=O-_-g>0?-T:T;else y=k-O-S-_>g?T:-T}else{var P=v+_;b="start"===t?E-u>v?-P:_:w-(E+A)-u>v?P:-_}return{x:y,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=$b(this.attributes,"handleLabel");return Pe(Pe(Pe({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=$b(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Pe({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.showLabel,a=e.showLabelOnInteraction,o=e.orientation,s=this.calcHandlePosition(t),c=s.x,l=s.y,u=this.calcHandleText(t),f=i;return!i&&a&&(f=!!this.target),Pe(Pe(Pe({},Yb(this.getHandleIconStyle(),"icon")),Yb(Pe(Pe({},this.getHandleLabelStyle(t)),u),"label")),{transform:"translate(".concat(c+n,", ").concat(l+r,")"),orientation:o,showLabel:f,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=Re(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=this.attributes.type,i=Re(this.getValues(),2),a=[i[0]+("range"===r?t:0),i[1]+e].sort();n?this.setValues(a):this.innerSetValues(a,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,(function(t){t.stopPropagation(),r.dispatchEvent(new Rp(n,{detail:t}))}))},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r,!0)}},e.tag="slider",e}(Xb),Sx=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new Rp("scroll",r)),n.dispatchEvent(new Rp("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=Re(n.getLocalPosition(),2),r=e[0],i=e[1],a=Re(n.padding,4),o=a[0],s=a[3],c=n.getOrientVal([r+s,i+o]),l=(n.getOrientVal(db(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Rp("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Rp("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Rp("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Rp("trackMouseleave",{detail:t.detail}))},n}return Te(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Db(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=Re(this.range,2),n=e[0],r=e[1];return j(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=Re(this.padding,4),r=n[0],i=n[1],a=n[2],o=n[3],s=Re(this.getOrientVal([[e,t],[t,e]]),2);return{x:o,y:r,width:+s[0]-(o+i),height:+s[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,a=r.height;return n||this.getOrientVal([a,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=Re(this.range,2),i=r[0],a=t*(r[1]-i-n);return[a,a+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,a=e.trackSize,o=e.padding,s=e.slidable,c=$b(this.attributes,"track"),l=$b(this.attributes,"thumb"),u=Pe(Pe({x:n,y:r,brushable:!1,orientation:i,padding:o,selectionRadius:this.thumbRadius,showHandle:!1,slidable:s,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:a,values:this.getValues()},Yb(c,"track")),Yb(l,"selection"));this.slider=Ib(t).maybeAppendByClassName("scrollbar",(function(){return new Ex({style:u})})).update(u).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=Re(this.range,2),i=r[0],a=r[1];this.slider.setValues(this.getValues(j(t,i,a)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",(function(e){e.stopPropagation(),t.onTrackClick(e.detail)})),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(Xb),Ax={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new qg({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};K({},Ax,{style:{type:"arc"}}),K({},Ax,{style:{}});var _x=ib({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"),Tx=ib({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Px(t){return t.reduce((function(t,e,n){return t.push(Ie([0===n?"M":"L"],Re(e),!1)),t}),[])}function Cx(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,a=e.center;if("line"===i)return Px(t);if(!a)return[];var o=Sb(t[0],a),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(Ie(["M"],Re(e),!1)):t.push(Ie(["A",o,o,0,0,s],Re(e),!1)),t}),[])}(t,e,n):Px(t)}function Lx(t,e,n){var r=n.type,i=n.connect,a=n.center,o=n.closed?[["Z"]]:[],s=Re([Cx(t,n),Cx(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=Re([t[0],e.slice(-1)[0]],2),f=u[0],h=u[1],d=function(t,e){return[c,t,l,e,o].flat()};if("line"===i||"surround"===r)return d([Ie(["L"],Re(h),!1)],[Ie(["L"],Re(f),!1)]);if(!a)throw new Error("Arc grid need to specified center");var p=Re([Sb(h,a),Sb(f,a)],2),g=p[0],v=p[1];return d([Ie(["A",g,g,0,0,1],Re(h),!1),Ie(["L"],Re(h),!1)],[Ie(["A",v,v,0,0,0],Re(f),!1),Ie(["L"],Re(f),!1)])}var Nx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Te(e,t),e.prototype.render=function(t,e){var n=Ce(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=Re(e,1)[0];return Pe(Pe({},t),{points:Ie(Ie([],Re(e),!1),[n],!1)})})):n}(t),i=Ib(e).maybeAppendByClassName(Tx.lineGroup,"g"),a=Ib(e).maybeAppendByClassName(Tx.regionGroup,"g"),o=function(t,e,n,r){var i=n.animate,a=n.isBillboard,o=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),d:Cx(t.points,n)}}));return t.selectAll(Tx.line.class).data(o,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Jy(Nb(Pe({d:t.d},r)),[t,e,o]);this.attr(Pe({class:Tx.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},n))}))}),(function(t){return t.transition((function(t,e){return vx(this,Jy(Nb(Pe({d:t.d},r)),[t,e,o]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=mx(this,i.exit);return dx(e,(function(){return t.remove()})),e}))})).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,a=n.areaFill;if(e.length<2||!a||!i)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=function(t){return o[t%o.length]},c=[],l=0;l<e.length-1;l++){var u=Re([e[l].points,e[l+1].points],2),f=Lx(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(Tx.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=Jy(t,[t,e,c]);this.attr(n)})).attr("className",Tx.region.name)}),(function(t){return t.transition((function(t,e){return vx(this,Jy(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=mx(this,r.exit);return dx(e,(function(){return t.remove()})),e}))})).transitions()}(a,r,t);return Ie(Ie([],Re(o),!1),Re(s),!1)},e}(Xb);function jx(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=Re(t,2);return[n[0],Jy(n[1],e)]})))}function Rx(t,e){return e&&y(e)?t.filter(e):t}function Ix(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Dx(t,e){if("linear"===e.type){var n=Re(e.startPos,2),r=n[0],i=n[1],a=Re(e.endPos,2),o=Re([a[0]-r,a[1]-i],2);return Ab([o[0],o[1]])}var s=Zy(Ix(t,e));return[-Math.sin(s),Math.cos(s)]}function Bx(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Dx(t,n),"positive"!==e)}function Fx(t,e){return Bx(t,e.labelDirection,e)}function zx(t,e){return"linear"===e.type?function(t,e){var n=Re(e.startPos,2),r=n[0],i=n[1],a=Re(e.endPos,2),o=Re([a[0]-r,a[1]-i],2);return[r+o[0]*t,i+o[1]*t]}(t,e):function(t,e){var n=e.radius,r=Re(e.center,2),i=r[0],a=r[1],o=Zy(Ix(t,e));return[i+n*Math.cos(o),a+n*Math.sin(o)]}(t,e)}function Gx(t){return 0===Dx(0,t)[1]}function Wx(t){return 0===Dx(0,t)[0]}function $x(t,e){return e-t==360}function Yx(t,e,n,r,i){var a=e-t,o=Re([i,i],2),s=o[0],c=o[1],l=Re([Zy(t),Zy(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=Re(h(u),2),p=d[0],g=d[1],v=Re(h(f),2),m=v[0],y=v[1];if($x(t,e)){var b=Re(h((f+u)/2),2);return[["M",p,g],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,m,y]]}var x=a>180?1:0,k=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(k,",").concat(m,",").concat(y)}function Hx(t,e,n,r){var i=e.startAngle,a=e.endAngle,o=e.center,s=e.radius;return t.selectAll(_x.line.class).data([{d:Yx.apply(void 0,Ie(Ie([i,a],Re(o),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",_x.line.name).styles(e).styles({d:function(t){return t.d}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,a=void 0===i?0:i,o=mb(e,n),s=Math.ceil(+a/16),c=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:o(e/(n.length-1))}}));return t.animate(c,Pe({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,a=e.radius;return Ie(Ie([n,r],Re(i),!1),[a],!1)}(this),Ie(Ie([i,a],Re(o),!1),[s],!1),r.update);if(e){var n=function(){var e=et(t.attributes,"__keyframe_data__");t.style.d=Yx.apply(void 0,Ie([],Re(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Vx(t){var e=Re(t,2),n=Re(e[0],2),r=n[0],i=n[1],a=Re(e[1],2);return{x1:r,y1:i,x2:a[0],y2:a[1]}}function qx(t,e,n,r){var i=e.showTrunc,a=e.startPos,o=e.endPos,s=e.truncRange,c=e.lineExtension,l=Re([a,o],2),u=Re(l[0],2),f=u[0],h=u[1],d=Re(l[1],2),p=d[0],g=d[1],v=Re(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=Re([t,e,n],3),i=Re(r[0],2),a=i[0],o=i[1],s=Re(r[1],2),c=s[0],l=s[1],u=Re(r[2],2),f=u[0],h=u[1],d=Re([c-a,l-o],2),p=d[0],g=d[1],v=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),m=Re([-f/v,h/v],2),y=m[0],b=m[1];return[y*p,y*g,b*p,b*g]}(a,o,c):new Array(4).fill(0),4),m=v[0],y=v[1],b=v[2],x=v[3],k=function(e){return t.selectAll(_x.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(_x.line.name," ").concat(t.className)})).styles(n).transition((function(t){return vx(this,Vx(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return vx(this,Vx(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return k([{line:[[f+m,h+y],[p+b,g+x]],className:_x.line.name}]);var w=Re(s,2),M=w[0],O=w[1],E=p-f,S=g-h,A=Re([f+E*M,h+S*M],2),_=A[0],T=A[1],P=Re([f+E*O,h+S*O],2),C=P[0],L=P[1];return k([{line:[[f+m,h+y],[_,T]],className:_x.lineFirst.name},{line:[[C,L],[p+b,g+x]],className:_x.lineSecond.name}])}function Ux(t,e,n){var r,i=e.type,a=$b(e,"line");return r="linear"===i?qx(t,e,Tb(a,"arrow"),n):Hx(t,e,Tb(a,"arrow"),n),function(t,e,n,r){var i,a=n.showArrow,o=n.showTrunc,s=n.lineArrow,c=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select(_x.line.class):o?t.select(_x.lineSecond.class):t.select(_x.line.class),!a||!s||"arc"===n.type&&$x(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=pb(s);f.attr(r),jb(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,a),r}function Xx(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Zx(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,a=Re(zx(i,e),2),o=a[0],s=a[1],c=Re(kb(function(t,e){return Bx(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[o,s],[o+c[0],s+c[1]]]}}))}function Kx(t,e,n,r){var i=$b(n,"grid"),a=i.type,o=i.areaFill,s=Xx(n),c=Rx(e,n.gridFilter),l="segment"===a?Zx(c,n):function(t,e){var n=e.gridControlAngles,r=Xx(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=Re(r,2),a=i[0],o=i[1];return t.map((function(t,r){var i=Re(zx(t.value,e),2),s=i[0],c=i[1],l=Re([s-a,c-o],2),u=l[0],f=l[1],h=[];return n.forEach((function(t){var e=Zy(t),n=Re([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+a,c=u*i+f*r+o;h.push([s,c])})),{points:h,id:r}}))}(c,n),u=Pe(Pe({},i),{center:s,areaFill:y(o)?c.map((function(t,e){return Jy(o,[t,e,c])})):o,animate:r,data:l});return t.selectAll(_x.grid.class).data([1]).join((function(t){return t.append((function(){return new Nx({style:u})})).attr("className",_x.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var Qx=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,a=r.y1,o=r.x2,s=r.y2,c=Math.cos(t),l=Math.sin(t),u=e-e*c+n*l,f=n-e*l-n*c;return[[c*i-l*s+u,l*i+c*s+f],[c*o-l*s+u,l*o+c*s+f],[c*i-l*a+u,l*i+c*a+f],[c*o-l*a+u,l*o+c*a+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function Jx(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=Re(r.min,2),a=i[0],o=i[1],s=Re(r.max,2),c=s[0],l=s[1],u=t.getBBox(),f=u.width,h=u.height,d=0,p=0,g=a,v=o,m=ub(t);if(m){h-=1.5;var y=m.style.textAlign,b=m.style.textBaseline;"center"===y?g=(a+c)/2:"right"!==y&&"end"!==y||(g=c),"middle"===b?v=(o+l)/2:"bottom"===b&&(v=l)}var x=Re(Db(e),4),k=x[0],w=void 0===k?0:k,M=x[1],O=void 0===M?0:M,E=x[2],S=void 0===E?w:E,A=x[3],_=new Qx((d+=a)-(void 0===A?O:A),(p+=o)-w,d+f+O,p+h+S);return t.setEulerAngles(n),_.rotatedPoints(Zy(n),g,v)}function tk(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function ek(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function nk(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,a,o,s,c,l=[e,[9999,e[1]]],u=0,f=0;do{var h=[t[f],t[(f+1)%n]];if(i=l,a=void 0,o=void 0,s=void 0,c=void 0,a=ek((r=h)[0],r[1],i[0]),o=ek(r[0],r[1],i[1]),s=ek(i[0],i[1],r[0]),c=ek(i[0],i[1],r[1]),a!==o&&s!==c||0===a&&tk(r,i[0])||0===o&&tk(r,i[1])||0===s&&tk(i,r[0])||0===c&&tk(i,r[1])){if(0===ek(h[0],e,h[1]))return tk(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function rk(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return function(t,e){var n=Re(t,4),r=n[0],i=n[1],a=n[2],o=n[3],s=Re(e,4),c=s[0],l=s[1],u=a-r,f=o-i,h=s[2]-c,d=s[3]-l,p=u*d-h*f;if(0===p)return!1;var g=p>0,v=r-c,m=i-l,y=u*m-f*v;if(y<0===g)return!1;var b=h*m-d*v;return b<0!==g&&y>p!==g&&b>p!==g}(e,t)}))}function ik(t,e,n){var r,i,a=e.crossPadding,o=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var a=t.center,o=t.radius,s=Re(a,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-o-u,h=o+u,d=Re(Db(e),4),p=d[0],g=d[1],v=d[2],m=d[3];return new Qx(c+f-m,l+f-p,c+h+g,l+h+v)}var y=Re(t.startPos,2),b=y[0],x=y[1],k=Re(t.endPos,2),w=k[0],M=k[1],O=Re(Wx(t)?[-e,0,e,0]:[0,e,0,-e],4),E=O[0],S=O[1],A=O[2],_=O[3],T=kb(Fx(0,t),i),P=new Qx(b,x,w,M);return P.x1+=_,P.y1+=E,P.x2+=S+T[0],P.y2+=A+T[1],P}(e,a),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;return nk([[r,a],[i,a],[i,o],[r,o]],Jx(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,a=Jx(t,n).flat(1),o=Jx(e,n).flat(1),s=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var c=je(s),l=c.next();!l.done;l=c.next())if(rk(o,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,Db(n))};try{for(var f=je(t),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)?!s||u(s,d)?s=d:(o.add(s),o.add(d)):o.add(d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(o)}function ak(t,e){return void 0===e&&(e={}),b(t)?0:"number"==typeof t?t:Math.floor(cb(t,e))}var ok=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Hy(t),!1)}))};var sk=new Map([["hide",function(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||2===i&&a&&o)){var s,c,l,u=ok,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),g=Math.min.apply(Math,Ie([1],Re(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(Gx(n)||Wx(n))){var v=Bb(t[0]).left,m=Bb(t[i-1]).right,y=Math.abs(m-v)||1;h=Math.max(Math.floor(i*g/y),h)}for(a&&(s=d.splice(0,1)[0]),o&&(c=d.splice(-1,1)[0],d.reverse()),f(d);h<t.length&&ik((l=c?Ie(Ie([c],Re(p),!1),[s],!1):Ie([s],Re(p),!1),l.filter(sb)),n,null==e?void 0:e.margin).length;){if(c&&!s&&h%2==0)d.splice(0,1).forEach(r.hide);else if(c&&s){d.splice(0,1).forEach(r.hide)}p=u(f(d),{seq:h}),h++}}}],["rotate",function(t,e,n,r){var i,a,o=e.optionalAngles,s=void 0===o?[0,45,90]:o,c=e.margin,l=e.recoverWhenFailed,u=void 0===l||l,f=t.map((function(t){return t.getLocalEulerAngles()})),h=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)}))};try{for(var d=je(s),p=d.next();!p.done;p=d.next()){if(h(p.value),ik(t,n,c).length<1)return}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}u&&h(f)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1)){var i=e.suffix,a=void 0===i?"...":i,o=e.minLength,s=e.maxLength,c=void 0===s?1/0:s,l=e.step,u=void 0===l?" ":l,f=e.margin,h=void 0===f?[0,0,0,0]:f,d=lb(r.getTextShape(t[0])),p=ak(u,d),g=o?ak(o,d):p,v=ak(c,d);(b(v)||v===1/0)&&(v=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));var m=t.slice();Re(h,4);for(var y=function(e){if(m.forEach((function(t){r.ellipsis(r.getTextShape(t),e,a)})),(m=ik(t,n,h)).length<1)return{value:void 0}},x=v;x>g+p;x-=p){var k=y(x);if("object"==typeof k)return k.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,a=void 0===i?50:i,o=e.maxLines,s=void 0===o?3:o,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,Ie([],Re(h),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Gx(t)?"negative"===n?"bottom":"top":"middle"}(n),g=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,a,i,p)}))};if(!(d>s)){for(var v=d;v<=s;v++)if(g(v),ik(t,n,f).length<1)return;l&&g(h)}}]]);function ck(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*function(t){return"positive"===t?-1:1}(e)}),1)}function lk(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function uk(t,e){var n=Re(t,2),r=n[0],i=n[1],a=Re(e,2),o=a[0],s=a[1],c=Re([r*o+i*s,r*s-i*o],2),l=c[0],u=c[1];return Math.atan2(u,l)}function fk(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var a=Fx(t.value,n),o=Dx(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return vb(e,-90,90)||(e+=180),e}(Ky("perpendicular"===i?uk([1,0],a):uk([o[0]<0?-1:1,0],o)))}function hk(t,e,n){var r=n.type,i=n.labelAlign,a=Fx(t,n),o=lk(e),s=lk(Ky(uk([1,0],a))),c="center",l="middle";return"linear"===r?[90,270].includes(s)&&0===o?(c="center",l=1===a[1]?"top":"bottom"):s%180||![90,270].includes(o)?0===s?(vb(o,0,90,!1,!0)||vb(o,0,90)||vb(o,270,360))&&(c="start"):90===s?vb(o,0,90,!1,!0)?c="start":(vb(o,90,180)||vb(o,270,360))&&(c="end"):270===s?vb(o,0,90,!1,!0)?c="end":(vb(o,90,180)||vb(o,270,360))&&(c="start"):180===s&&(90===o?c="start":(vb(o,0,90)||vb(o,270,360))&&(c="end")):c="center":"parallel"===i?l=vb(s,0,180,!0)?"top":"bottom":"horizontal"===i?vb(s,90,270,!1)?c="end":(vb(s,270,360,!1)||vb(s,0,90))&&(c="start"):"perpendicular"===i&&(c=vb(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function dk(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=Jy(s,[t,c,e]),u=Re([Fx(t.value,n),ck(o,a)],2),f=Re(wb(kb(u[0],l+(1===u[1]?Jy(r?i:0,[t,c,e]):0)),zx(t.value,n)),2);return{x:f[0],y:f[1]}}function pk(t,e){"text"===t.nodeName&&t.attr(e)}function gk(t){!function(t,e,n){var r=e.labelOverlap,i=void 0===r?[]:r;i.length&&i.forEach((function(r){var i=r.type,a=sk.get(i);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some((function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((function(t){return t.querySelector("text")})).length>1)})(t,e,i)&&(null==a||a(t,r,e,n))}))}(this.node().childNodes,t,{hide:Hy,show:Yy,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=hk(e.__data__.value,t,n),i=e.querySelector(_x.labelItem.class);i&&pk(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&hb(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),fb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function vk(t,e,n,r,i){var a=n.indexOf(e),o=Ib(t).append(function(t,e,n,r){var i=r.labelFormatter;return y(i)?function(){return pb(Jy(i,[t,e,n,Fx(t.value,r)]))}:function(){return pb(t.label||"")}}(e,a,n,i)).attr("className",_x.labelItem.name).node(),s=Re(Hb(jx(r,[e,a,n])),2),c=s[0],l=s[1],u=l.transform,f=Ce(l,["transform"]);Vb(o,u);var h=fk(e,o,i);return o.getLocalEulerAngles()||o.setLocalEulerAngles(h),pk(o,Pe(Pe({},hk(e.value,h,i)),c)),t.attr(f),o}function mk(t,e,n,r){var i=Rx(e,n.labelFilter),a=$b(n,"label");return t.selectAll(_x.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",_x.label.name).transition((function(t){vk(this,t,e,a,n);var r=dk(t,e,n),i=r.x,o=r.y;return this.style.transform="translate(".concat(i,", ").concat(o,")"),null})).call((function(){gk.call(t,n)}))}),(function(i){return i.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&Hy(t),e.isVisible()&&Yy(e)};if(!n)return i(),[null];var a=n.duration,o=void 0===a?0:a,s=n.delay,c=void 0===s?0:s,l=Math.ceil(+o/2),u=+o/4,f=Re(t.getGeometryBounds().center,2),h=f[0],d=f[1],p=Re(e.getGeometryBounds().center,2),g=Re([(h+p[0])/2-h,(d+p[1])/2-d],2),v=g[0],m=g[1],y=t.style.opacity,b=void 0===y?1:y,x=e.style.opacity,k=void 0===x?1:x,w=t.style.transform||"",M=e.style.transform||"",O=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(w)},{opacity:0,transform:"translate(".concat(v,", ").concat(m,") ").concat(w)}],Pe(Pe({fill:"both"},n),{duration:c+l+u})),E=e.animate([{opacity:0,transform:"translate(".concat(-v,", ").concat(-m,") ").concat(M),offset:.01},{opacity:k,transform:"translate(0, 0) ".concat(M)}],Pe(Pe({fill:"both"},n),{duration:l+u,delay:c+l-u}));return dx(E,i),[O,E]}(this.querySelector(_x.labelItem.class),vk(this,t,e,a,n),r.update),o=dk(t,e,n),s=o.x,c=o.y,l=vx(this,{transform:"translate(".concat(s,", ").concat(c,")")},r.update);return Ie(Ie([],Re(i),!1),[l],!1)})).call((function(e){var r,i,a=et(e,"_transitions").flat().filter(sb);i=function(){gk.call(t,n)},0===(r=a).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=mx(this.childNodes[0],r.exit);return dx(e,(function(){return Ib(t).remove()})),e}))})).transitions()}function yk(t,e){return Bx(t,e.tickDirection,e)}function bk(t,e,n,r,i){var a=Re(function(t,e){var n=Re(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,Jy(i.tickLength,[t,e,n])),2),o=Re(a[0],2),s=o[0],c=o[1],l=Re(a[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function xk(t,e,n,r,i,a){var o=function(t,e,n,r,i){var a=i.tickFormatter,o=yk(e.value,i),s="line";return y(a)&&(s=function(){return Jy(a,[e,n,r,o])}),t.append(s).attr("className",_x.tickItem.name)}(Ib(this),t,e,n,r);!function(t,e,n,r,i,a,o){var s=yk(t.value,a),c=bk(t,e,n,s,a),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=Re(Hb(jx(o,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(Pe({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,o,this,r,i);var s=Re(zx(t.value,r),2),c=s[0],l=s[1];return vx(this,{transform:"translate(".concat(c,", ").concat(l,")")},a)}var kk=ib({text:"text"},"title");function wk(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function Mk(t,e){var n=Object.entries(e).reduce((function(e,n){var r=Re(n,2),i=r[0],a=r[1];return t.node().attr(i)||(e[i]=a),e}),{});t.styles(n)}var Ok=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return Te(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,a=t.inset,o=this.querySelector(kk.text.class);if(!o)return new Qy(0,0,+e,+n);var s=o.getBBox(),c=s.width,l=s.height,u=Re(Db(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=Re([0,0,+e,+n],4),v=g[0],m=g[1],y=g[2],b=g[3],x=wk(r);if(x.includes("i"))return new Qy(v,m,y,b);x.forEach((function(t,r){var i,a,o,s;"t"===t&&(i=Re(0===r?[l+d,+n-l-d]:[0,+n],2),m=i[0],b=i[1]),"r"===t&&(a=Re([+e-c-p],1),y=a[0]),"b"===t&&(o=Re([+n-l-f],1),b=o[0]),"l"===t&&(s=Re(0===r?[c+h,+e-c-h]:[0,+e],2),v=s[0],y=s[1])}));var k=Re(Db(a),4),w=k[0],M=k[1],O=k[2],E=k[3],S=Re([E+M,w+O],2),A=S[0],_=S[1];return new Qy(v+E,m+w,y-A,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Qy(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Ce(t,["width","height","position","spacing"]),i=Re(Hb(r),1)[0],a=function(t){var e,n,r,i,a=t,o=a.width,s=a.height,c=a.position,l=Re([+o/2,+s/2],2),u=Re([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=wk(c);return g.includes("l")&&(f=(e=Re([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=Re([+o,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=Re([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=Re([+s,"bottom"],2))[0],p=i[1]),{x:f,y:h,textAlign:d,textBaseline:p}}(t),o=a.x,s=a.y,c=a.textAlign,l=a.textBaseline;gb(!!r.text,Ib(e),(function(t){n.title=t.maybeAppendByClassName(kk.text,"text").styles(i).call(Mk,{x:o,y:s,textAlign:c,textBaseline:l}).node()}))},e}(Xb);function Ek(t,e,n,r,i){var a=Re(Hb($b(r,"title")),2),o=a[0],s=a[1],c=s.transform,l=s.transformOrigin,u=Ce(s,["transform","transformOrigin"]);e.styles(u);var f=c||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),o.direction,o.position);t.styles(Pe(Pe({},o),{transformOrigin:l})),Vb(t.node(),f);var h=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,a=n.titleSpacing,o=wk(i),s=t.node().getLocalBounds(),c=Re(s.min,2),l=c[0],u=c[1],f=Re(s.halfExtents,2),h=f[0],d=f[1],p=Re(e.node().getLocalBounds().halfExtents,2),g=p[0],v=p[1],m=Re([l+h,u+d],2),y=m[0],b=m[1],x=Re(Db(a),4),k=x[0],w=x[1],M=x[2],O=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var E=n.startPos,S=n.endPos,A=Re("start"===i?[E,S]:[S,E],2),_=A[0],T=A[1],P=Re(kb(Ab([-T[0]+_[0],-T[1]+_[1]]),k),2),C=P[0],L=P[1];return{x:_[0]+C,y:_[1]+L}}return o.includes("t")&&(b-=d+v+k),o.includes("r")&&(y+=h+g+w),o.includes("l")&&(y-=h+g+O),o.includes("b")&&(b+=d+v+M),{x:y,y:b}}(Ib(n._offscreen||n.querySelector(_x.mainGroup.class)),e,r),d=h.x,p=h.y;return vx(e.node(),{transform:"translate(".concat(d,", ").concat(p,")")},i)}function Sk(t,e,n,r){var i=t.showLine,a=t.showTick,o=t.showLabel,s=gb(i,e.maybeAppendByClassName(_x.lineGroup,"g"),(function(e){return Ux(e,t,r)}))||[],c=gb(a,e.maybeAppendByClassName(_x.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Rx(e,n.tickFilter),a=$b(n,"tick");return t.selectAll(_x.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",_x.tick.name).transition((function(t,e){return xk.call(this,t,e,i,n,a,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),xk.call(this,t,e,i,n,a,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=mx(this.childNodes[0],r.exit);return dx(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=gb(o,e.maybeAppendByClassName(_x.labelGroup,"g"),(function(e){return mk(e,n,t,r)}))||[];return Ie(Ie(Ie([],Re(s),!1),Re(c),!1),Re(l),!1).filter((function(t){return!!t}))}var Ak=function(t){function e(e){return t.call(this,e,Ax)||this}return Te(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,a=t.data,o=t.animate,s=t.showTitle,c=t.showGrid,l=t.dataThreshold,u=t.truncRange,f=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(a,l).filter((function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])})),h=hx(void 0===n?o:n),d=gb(c,Ib(e).maybeAppendByClassName(_x.gridGroup,"g"),(function(e){return Kx(e,f,t,h)}))||[],p=Ib(e).maybeAppendByClassName(_x.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Sk(t,Ib(this.offscreenGroup),f,hx(!1));var g=Sk(t,Ib(p.node()),f,h),v=gb(s,Ib(e).maybeAppendByClassName(_x.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(_x.title.class).data([{title:i}].filter((function(t){return!!t.title})),(function(t,e){return t.title})).join((function(a){return a.append((function(){return pb(i)})).attr("className",_x.title.name).transition((function(){return Ek(Ib(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return Ek(Ib(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,h)}))||[];return Ie(Ie(Ie([],Re(d),!1),Re(g),!1),Re(v),!1).flat().filter((function(t){return!!t}))},e}(Xb),_k=ib({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),Tk=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:ex(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new zg({class:_k.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new zg({class:_k.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Te(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return j(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=Re(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(this.pageViews.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,Ie([],Re(t),!1))})),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,a=void 0===i?e:i,o=r.pageHeight;return{pageWidth:a,pageHeight:void 0===o?n:o}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,a=this.pageShape,o=a.pageWidth,s=a.pageHeight;return new Qy(n,r,o+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,a=r.playState,o=r.playWindow,s=r.pageViews;if("idle"!==a||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=Re(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=gx(o,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return dx(f,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:j(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:j(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(_k.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?Yy(e):Hy(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,a=i.orientation,o=i.controllerPadding,s=r.getBBox().width,c=Re("horizontal"===a?[-180,0]:[-90,90],2),l=c[0],u=c[1];e.setLocalEulerAngles(l),n.setLocalEulerAngles(u);var f=e.getBBox(),h=f.width,d=f.height,p=n.getBBox(),g=p.width,v=p.height,m=Math.max(h,s,g),y="horizontal"===a?{offset:[[0,0],[h/2+o,0],[h+s+2*o,0]],textAlign:"start"}:{offset:[[m/2,-d-o],[m/2,0],[m/2,v+o]],textAlign:"center"},b=Re(y.offset,3),x=Re(b[0],2),k=x[0],w=x[1],M=Re(b[1],2),O=M[0],E=M[1],S=Re(b[2],2),A=S[0],_=S[1],T=y.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(k,w),r.setLocalPosition(O,E),n.setLocalPosition(A,_)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(_k.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,a=r.pageHeight,o=t<e?-1:1;return"horizontal"===n?[o*i,0]:[0,o*a]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=Re(this.getFollowingPageDiff(t),2),i=r[0],a=r[1];n[t].setLocalPosition(i,a)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,i=r.pageWidth,a=r.pageHeight,o=this.pageViews.length>=2,s=t.maybeAppendByClassName(_k.controller,"g");if(Vy(s.node(),o),o){var c=$b(this.attributes,"button"),l=$b(this.attributes,"pageNum"),u=Re(Hb(c),2),f=u[0],h=u[1],d=f.size,p=Ce(f,["size"]),g=!s.select(_k.prevBtnGroup.class).node(),v=s.maybeAppendByClassName(_k.prevBtnGroup,"g").styles(h);this.prevBtnGroup=v.node();var m=v.maybeAppendByClassName(_k.prevBtn,"path"),y=s.maybeAppendByClassName(_k.nextBtnGroup,"g").styles(h);this.nextBtnGroup=y.node(),[m,y.maybeAppendByClassName(_k.nextBtn,"path")].forEach((function(t){t.styles(Pe(Pe({},p),{transformOrigin:"center"})),jb(t.node(),d,!0)}));var b=s.maybeAppendByClassName(_k.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(_k.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(i+n,a/2),g&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i;this.attr("transform","translate(".concat(r,", ").concat(a,")"));var o=Ib(e);this.renderClipPath(o),this.renderController(o),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=q((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(Hp.INSERTED,e),this.playWindow.addEventListener(Hp.REMOVED,e)},e}(Xb);function Pk(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}rx.registerSymbol("hiddenHandle",(function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]})),rx.registerSymbol("verticalHandle",(function(t,e,n){var r=1.4*n,i=n/2,a=n/6,o=t+.4*r;return[["M",t,e],["L",o,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",o,e-i],["Z"],["M",o,e+a],["L",t+r-2,e+a],["M",o,e-a],["L",t+r-2,e-a]]})),rx.registerSymbol("horizontalHandle",(function(t,e,n){var r=1.4*n,i=n/2,a=n/6,o=e+.4*r;return[["M",t,e],["L",t-i,o],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,o],["Z"],["M",t-a,o],["L",t-a,e+r-2],["M",t+a,o],["L",t+a,e+r-2]]}));var Ck=ib({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var Lk=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Ig({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Te(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,r=t.node().getBBox(),i=r.width,a=r.height,o=e.node().getBBox(),s=o.width,c=o.height;return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,a,c)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=Re(Db(t),2),n=e[0],r=e[1],i=this.showValue?r:0,a=n+i;return[n/a,i/a]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,a=i.markerWidth,o=i.height,s=this.actualSpace,c=s.labelWidth,l=s.valueWidth,u=Re(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=Re(this.span,2);c=(t=Re([p[0]*d,p[1]*d],2))[0],l=t[1]}return{width:a+c+l+f+h,height:o,markerWidth:a,labelWidth:c,valueWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=Re(Db(t),2),n=e[0],r=e[1];return this.showValue?[n,r]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,a=t.height,o=Re(this.spacing,2),s=o[0];return{height:a,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+s,e+n+s+o[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(Ck.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,a=e.markerLineWidth,o=void 0===a?t.lineWidth:a,s=e.markerStroke,c=void 0===s?t.stroke:s,l=+(i||o||(c?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,h=u.height;return(1-l/Math.max(f,h))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=$b(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Ck.markerGroup,"g").style("zIndex",0),gb(!!n,this.markerGroup,(function(){var t,i=e.markerGroup.node(),a=null===(t=i.childNodes)||void 0===t?void 0:t[0],o="string"==typeof n?new rx({style:{symbol:n},className:Ck.marker.name}):n();a?o.nodeName===a.nodeName?a instanceof rx?a.update(Pe(Pe({},r),{symbol:n})):(!function(t,e){var n,r,i=e.attributes;try{for(var a=je(Object.entries(i)),o=a.next();!o.done;o=a.next()){var s=Re(o.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}(a,o),Ib(a).styles(r)):(a.remove(),Ib(o).attr("className",Ck.marker.name).styles(r),i.appendChild(o)):(o instanceof rx||Ib(o).attr("className",Ck.marker.name).styles(r),i.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=jb(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")}))},e.prototype.renderLabel=function(t){var e=$b(this.attributes,"label"),n=e.text,r=Ce(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Ck.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Ck.label,(function(){return pb(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=$b(this.attributes,"value"),r=n.text,i=Ce(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Ck.valueGroup,"g").style("zIndex",0),gb(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(Ck.value,(function(){return pb(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=$b(this.attributes,"background");this.background=t.maybeAppendByClassName(Ck.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Ck.background,"rect").styles(Pe({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=Re(t.position,3),a=i[0],o=i[1],s=i[2],c=r/2;this.markerGroup.styles({transform:"translate(".concat(a,", ").concat(c,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(o,", ").concat(c,")")}),hb(this.labelGroup.select(Ck.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),hb(this.valueGroup.select(Ck.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Ib(e),r=t.x,i=void 0===r?0:r,a=t.y,o=void 0===a?0:a;n.styles({transform:"translate(".concat(i,", ").concat(o,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(Xb),Nk=ib({page:"item-page",navigator:"navigator",item:"item"},"items"),jk=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Rk=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:at,mouseenter:at,mouseleave:at})||this;return n.navigatorShape=[0,0],n}return Te(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=$b(this.attributes,"item"),i=e.map((function(t,i){var a=t.id,o=void 0===a?i:a,s=t.label,c=t.value;return{id:"".concat(o),index:i,style:Pe({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=Re(n,2);return[r[0],Jy(r[1],[t,i,e])]}))))}}));return i},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,a=e.colPadding,o=Re(this.navigatorShape,1)[0],s=Re(this.grid,2),c=s[0],l=s[1],u=l*c,f=0;return this.pageViews.children.map((function(e,s){var h,d,p=Math.floor(s/u),g=s%u,v=t.ifHorizontal(l,c),m=[Math.floor(g/v),g%v];"vertical"===n&&m.reverse();var y=Re(m,2),b=y[0],x=y[1],k=(r-o-(l-1)*a)/l,w=e.getBBox().height,M=Re([0,0],2),O=M[0],E=M[1];return"horizontal"===n?(O=(h=Re([f,b*(w+i)],2))[0],E=h[1],f=x===l-1?0:f+k+a):(O=(d=Re([x*(k+a),f],2))[0],E=d[1],f=b===c-1?0:f+w+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:k,height:w,x:O,y:E}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,a=Re(this.navigatorShape,1)[0],o=Re(this.grid,2),s=o[0],c=o[1],l=Re([e-a,n],2),u=l[0],f=l[1],h=Re([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],v=h[3],m=h[4],y=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,a,o,l,h=t.getBBox(),k=h.width,w=h.height,M=0===b?0:i,O=b+M+k;return O<=u&&jk(m,(function(t){return t<c}))?(n=Re([b+M,x,O],3),d=n[0],p=n[1],b=n[2],{width:k,height:w,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(a=Re([y+1,0,0,x+w+r],4),y=a[0],m=a[1],b=a[2],(x=a[3])+w<=f&&jk(y,(function(t){return t<s}))?(o=Re([b,x,k],3),d=o[0],p=o[1],b=o[2],{width:k,height:w,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(l=Re([0,0,k,0,g+1,0,0,0],8),d=l[0],p=l[1],b=l[2],x=l[3],g=l[4],v=l[5],y=l[6],m=l[7],{width:k,height:w,x:d,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Pk(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Nk.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Nk.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var a=this.dispatchCustomEvent.bind(this);Ib(t).selectAll(Nk.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Lk({style:e})})).attr("className",Nk.item.name).on("click",(function(){null==n||n(this),a("itemClick",{item:this})})).on("pointerenter",(function(){null==r||r(this),a("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),a("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,a=Re(this.navigatorShape,2),o=a[0],s=a[1];this.navigator.update("grid"===n?{pageWidth:r-o,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=Re(t,2);return{page:e[0],layouts:e[1]}})),i=Ie([],Re(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new zg({className:Nk.page.name}));e.forEach((function(t){var e=t.x,n=t.y,a=t.index,o=t.width,s=t.height,c=i[a];r.appendChild(c),function(t,e,n){var r=t,i=L(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(k(r[t])||(r[t]=R(i[e+1])?[]:{}),r=r[t]):r[t]=n}))}(c,"__layout__",t),c.update({x:e,y:n,width:o,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=$b(this.attributes,"nav"),r=ob({orientation:e},n),i=this;return t.selectAll(Nk.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Tk({style:r})})).attr("className",Nk.navigator.name).each((function(){i.navigator=this}))}),(function(t){return t.each((function(){this.update(r)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(Ib(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Rp(t,{detail:e});this.dispatchEvent(n)},e}(Xb),Ik=ib({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Dk={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},Bk=function(t){function e(e){return t.call(this,e,Dk)||this}return Te(e,t),e.prototype.render=function(t,e){var n=Ib(e).maybeAppendByClassName(Ik.markerGroup,"g");this.renderMarker(n);var r=Ib(e).maybeAppendByClassName(Ik.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,a=void 0===i?Pk(r,"horizontalHandle","verticalHandle"):i;gb(!!a,t,(function(t){var n=$b(e.attributes,"marker"),r=Pe({symbol:a},n);e.marker=t.maybeAppendByClassName(Ik.marker,(function(){return new rx({style:r})})).update(r)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,a=n.spacing,o=void 0===a?0:a,s=n.formatter;gb(r,t,(function(t){var n,r=$b(e.attributes,"label"),a=r.text,c=Ce(r,["text"]),l=(null===(n=t.select(Ik.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=Re(Pk(i,[0,(void 0===h?0:h)+o,"center","top"],[f+o,0,"start","middle"]),4),p=d[0],g=d[1],v=d[2],m=d[3];t.maybeAppendByClassName(Ik.label,"text").styles(Pe(Pe({},c),{x:p,y:g,text:s(a).toString(),textAlign:v,textBaseline:m}))}))},e}(Xb),Fk={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},zk=ob({},Fk,{}),Gk=ob({},Fk,Yb(Dk,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),Wk=ib({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),$k=function(t){function e(e){return t.call(this,e,zk)||this}return Te(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,a=r.titleText,o=Re(Hb($b(this.attributes,"title")),2),s=o[0],c=o[1];this.titleGroup=t.maybeAppendByClassName(Wk.titleGroup,"g").styles(c);var l=Pe(Pe({width:e,height:n},s),{text:i?a:""});this.title=this.titleGroup.maybeAppendByClassName(Wk.title,(function(){return new Ok({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,a=e.height,o=Re(Hb($b(this.attributes,"title",!0)),2),s=o[0],c=o[1],l=Pe(Pe({},s),{width:i,height:a,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Wk.itemsGroup,"g").styles(Pe(Pe({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Wk.items.class).data(["items"]).join((function(t){return t.append((function(){return new Rk({style:l})})).attr("className",Wk.items.name).each((function(){u.items=Ib(this)}))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new Qy(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,a=n.inset,o=n.text,s=t.getBBox(),c=e.getBBox(),l=wk(r),u=Re(Db(o?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=Re(Db(a),4),v=g[0],m=g[1],y=g[2],b=g[3],x=Re([p+h,f+d],2),k=x[0],w=x[1],M=Re([b+m,v+y],2),O=M[0],E=M[1];if("l"===l[0])return new Qy(s.x,s.y,c.width+s.width+k+O,Math.max(c.height+E,s.height));if("t"===l[0])return new Qy(s.x,s.y,Math.max(c.width+O,s.width),c.height+s.height+w+E);var S=Re([e.attributes.width||c.width,e.attributes.height||c.height],2),A=S[0],_=S[1];return new Qy(c.x,c.y,A+s.width+k+O,_+s.height+w+E)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,r=n.width,i=n.height,a=n.x,o=void 0===a?0:a,s=n.y,c=void 0===s?0:s,l=Ib(e);e.style.transform="translate(".concat(o,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(Xb),Yk={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},Hk=ib({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Vk=function(t){function e(e){var n=t.call(this,e,Yk)||this;return n.point=[0,0],n.group=n.appendChild(new zg({})),n.isMutationObserved=!0,n}return Te(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=Re(Db(t.padding),4),r=n[0],i=n[1],a=n[2],o=n[3],s=this.label.node().getLocalBounds(),c=s.min,l=s.max,u=new Qy(c[0]-o,c[1]-r,l[0]+i-c[0]+o,l[1]+a-c[1]+r),f=this.getPath(e,u),h=$b(this.attributes,"background");this.background=Ib(this.group).maybeAppendByClassName(Hk.background,"path").styles(Pe(Pe({},h),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=Re(Hb($b(this.attributes,"label")),2),i=r[0],a=r[1],o=Ce(i,["text"]);(this.label=Ib(this.group).maybeAppendByClassName(Hk.labelGroup,"g").styles(a),n)&&this.label.maybeAppendByClassName(Hk.label,(function(){return pb(e(n))})).style("text",e(n).toString()).selectAll("text").styles(o)},e.prototype.adjustLayout=function(){var t=Re(this.point,2),e=t[0],n=t[1],r=this.attributes,i=r.x,a=r.y;this.group.attr("transform","translate(".concat(i-e,", ").concat(a-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,a=e.width,o=e.height,s=[["M",r+n,i],["L",r+a-n,i],["A",n,n,0,0,1,r+a,i+n],["L",r+a,i+o-n],["A",n,n,0,0,1,r+a-n,i+o],["L",r+n,i+o],["A",n,n,0,0,1,r,i+o-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],c={top:4,right:6,bottom:0,left:2}[t],l=this.createCorner([s[c].slice(-2),s[c+1].slice(-2)]);return s.splice.apply(s,Ie([c+1,1],Re(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Fb.apply(void 0,Ie([],Re(t),!1)),r=Re(t,2),i=Re(r[0],2),a=i[0],o=i[1],s=Re(r[1],2),c=s[0],l=s[1],u=Re(n?[c-a,[a,c]]:[l-o,[o,l]],2),f=u[0],h=Re(u[1],2),d=h[0],p=h[1],g=f/2,v=e*(f/Math.abs(f)),m=v/2,y=v*Math.sqrt(3)/2*.8,b=Re([d,d+g-m,d+g,d+g+m,p],5),x=b[0],k=b[1],w=b[2],M=b[3],O=b[4];return n?(this.point=[w,o-y],[["L",x,o],["L",k,o],["L",w,o-y],["L",M,o],["L",O,o]]):(this.point=[a+y,w],[["L",a,x],["L",a,k],["L",a+y,w],["L",a,M],["L",a,O]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?Hy(this):Yy(this)},e.prototype.bindEvents=function(){this.label.on(Hp.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Xb);function qk(t,e){var n=Re(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var Uk=ib({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Xk(t){var e=t.orientation,n=t.size,r=t.length;return Pk(e,[r,n],[n,r])}function Zk(t){var e=t.type,n=Re(Xk(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function Kk(t){return Zk(t)}function Qk(t){var e,n=t.orientation,r=t.color,i=t.block,a=t.partition;if(y(r)){e=new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))}))}else e=r;var o=e.length,s=e.map((function(t){return dh(t).toString()}));return o?1===o?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce((function(e,n,a){var o=r[a%r.length];return e+" ".concat(t[a],":").concat(o).concat(a<i-1?" ".concat(t[a+1],":").concat(o):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(a,s,n):s.reduce((function(t,e,n){return t+" ".concat(n/(o-1),":").concat(e)}),"l(".concat(Pk(n,"0","270"),")")):""}function Jk(t){var e=t.orientation,n=t.range;if(!n)return[];var r=Re(Xk(t),2),i=r[0],a=r[1],o=Re(n,2),s=o[0],c=o[1],l=Pk(e,s*i,0),u=Pk(e,0,s*a),f=Pk(e,c*i,i),h=Pk(e,a,c*a);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var tw=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return Te(e,t),e.prototype.render=function(t,e){!function(t,e){var n=$b(e,"track");t.maybeAppendByClassName(Uk.track,"path").styles(Pe({d:Zk(e)},n))}(Ib(e).maybeAppendByClassName(Uk.trackGroup,"g"),t),function(t,e){var n=$b(e,"selection"),r=Qk(e),i=t.maybeAppendByClassName(Uk.selection,"path").styles(Pe({d:Kk(e),fill:r},n)),a=i.maybeAppendByClassName(Uk.clipPath,"path").styles({d:Jk(e)}).node();i.style("clipPath",a)}(Ib(e).maybeAppendByClassName(Uk.selectionGroup,"g"),t)},e}(Xb);var ew=function(t){function e(e){var n=t.call(this,e,Gk)||this;return n.eventToOffsetScale=new so({}),n.innerRibbonScale=new so({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var a=n.getValueByCanvasPoint(t);if(i){var o=qk(r.map((function(t){return t.value})),a).range,s=n.getRealSelection(o);n.showIndicator((o[0]+o[1])/2,"".concat(s[0],"-").concat(s[1])),n.dispatchIndicated(a,o)}else{var c=n.getTickValue(a);n.showIndicator(c,"".concat(n.getRealValue(c))),n.dispatchIndicated(c)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=Re(n.selection,2),i=r[0],a=r[1],o=n.getTickValue(n.getValueByCanvasPoint(t)),s=o-n.prevValue;"start"===e?i!==o&&n.updateSelection(o,a):"end"===e?a!==o&&n.updateSelection(i,o):"ribbon"===e&&0!==s&&(n.prevValue=o,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="pointer",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return Te(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new Qy(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Ib(e));var i=this.availableSpace,a=i.x,o=i.y,s=Ib(e).maybeAppendByClassName(Wk.contentGroup,"g").styles({transform:"translate(".concat(a,", ").concat(o,")")});gb(!!r,s.maybeAppendByClassName(Wk.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Wk.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Wk.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(c),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:function(t){return{min:Math.min.apply(Math,Ie([],Re(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,Ie([],Re(t.map((function(t){return t.value}))),!1))}}(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=Re(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=Re(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Pk(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,a=e.height,o=$b(this.attributes,"title"),s=Pe(Pe({},o),{width:i,height:a,text:r}),c=this;t.selectAll(Wk.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new Ok({style:s})})).attr("className",Wk.title.name).each((function(){c.title=this}))}),(function(t){return t.update(s)}),(function(t){return t.each((function(){c.title=void 0})).remove()}))},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new Qy(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new Qy(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(_x.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new Qy(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,a=i.width,o=i.height;return{width:a,height:o,size:this.ifHorizontal(o,a)+r+this.labelFixedSpacing,length:this.ifHorizontal(a,o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,a=r.height,o=this.labelShape,s=o.size,c=o.length,l=Re(this.ifHorizontal([a,i],[i,a]),2),u=l[0],f=l[1],h=e?this.handleShape:{size:0,length:0},d=h.size,p=h.length,g=this.handleOffsetRatio,v=0,m=this.labelPosition;v=n||(["bottom","right"].includes(m)?Math.min(u-s,(u-d)/g):u*(1-g)>d?Math.max(u-s,0):Math.max((u-s-d)/g,0));var y=Math.max(p,c),b=f-y,x=Re(this.ifHorizontal([b,v],[v,b]),2),k=x[0],w=x[1],M=["top","left"].includes(m)?s:0,O=Re(this.ifHorizontal([y/2,M],[M,y/2]),2),E=O[0],S=O[1];return new Qy(E,S,k,w)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,o=e.block,s=$b(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,h=f.x,d=f.y,p=this.ribbonShape,g=p.length,v=p.size,m=ob({transform:"translate(".concat(h,", ").concat(d,")"),length:g,size:v,type:r,orientation:i,color:a,block:o,partition:n.map((function(t){return(t.value-l)/(u-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(Wk.ribbon,(function(){return new tw({style:m})})).update(m)},e.prototype.getHandleClassName=function(t){return"".concat(Wk.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=$b(this.attributes,"handle"),i=Re(this.selection,2),a=i[0],o=i[1],s=Pe(Pe({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?Bk:Ox,u=this;this.handlesGroup.selectAll(Wk.handle.class).data(e?[{value:a,type:"start"},{value:o,type:"end"}]:[],(function(t){return t.type})).join((function(t){return t.append((function(){return new l({style:s})})).attr("className",(function(t){var e=t.type;return"".concat(Wk.handle," ").concat(u.getHandleClassName(e))})).each((function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");u[r]=this,this.addEventListener("pointerdown",u.onDragStart(e))}))}),(function(t){return t.update(s).each((function(t){var e=t.value;this.update({labelText:e})}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");u[n]=void 0})).remove()}))},e.prototype.adjustHandles=function(){var t=Re(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Qy(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,a=r.height,o=Re([Math.max(e,i),Math.max(n,a)],2),s=o[0],c=o[1];return this.cacheHandleBBox=new Qy(0,0,s,c),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=Re(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,a=r.y,o=this.ribbonShape.size,s=this.getOffset(e),c=Re(this.ifHorizontal([i+s,a+o*this.handleOffsetRatio],[i+o*this.handleOffsetRatio,a+s]),2),l=c[0],u=c[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({transform:"translate(".concat(l,", ").concat(u,")"),formatter:n})},e.prototype.renderIndicator=function(t){var e=$b(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Wk.indicator,(function(){return new Vk({})})).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce((function(e,n,r,i){var a,o,s=null!==(a=null==n?void 0:n.id)&&void 0!==a?a:r.toString();if(e.push(Pe(Pe({},n),{id:s,index:r,type:"value",label:null!==(o=null==n?void 0:n.label)&&void 0!==o?o:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var c=i[r+1],l=Re([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(Pe(Pe({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(h)}))}return e}),[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=Re(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,a=e.labelFormatter,o=$b(this.attributes,"tick"),s=$b(this.attributes,"label"),c=s.align,l=ob(Pe({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Yb(o,"tick"),Yb(s,"label"),{data:this.labelData}),u={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter((function(t){return"value"!==t.type}))))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===c&&(!i||i(t,t.index,n.filter((function(t){return t.type===c}))))},labelFormatter:a},f=Pe(Pe(Pe({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Wk.label,(function(){return new Ak({style:f})})).node(),this.label.update(f,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,a=this.ribbonShape.size,o=this.labelPosition,s=this.labelFixedSpacing,c=Re([0,0,0],3),l=c[0],u=c[1],f=c[2],h=null!=i?i:a;return e?(f=h,u=s,"positive"===n?"right"===o?(l=h,f=h):"bottom"===o&&(l=f):"negative"===n&&("top"===o||"left"===o)&&(l=a)):"positive"===n?"right"===o?u=h:"bottom"===o&&(l=a+s,u=r):"negative"===n&&("left"===o||"top"===o)&&(u=r),{offset:l,spacing:u,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,a=this.labelAxisStyle,o=a.offset,s=a.spacing,c=a.tickLength,l=Re(this.ifHorizontal([[e,n+o],[e+r,n+o]],[[e+o,n+i],[e+o,n]]),2),u=l[0],f=l[1];this.label.update({startPos:u,endPos:f,tickLength:c,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,a=this.ribbonBBox,o=a.x,s=a.y,c=j(t,r,i),l=this.getOffset(c),u=this.ifHorizontal([l+o,s],[o,l+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),Yy(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Hy(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=Re(this.selection,2),a=i[0],o=i[1],s=Re([t,e],2),c=s[0],l=s[1];n&&(c+=a,l+=o);var u=this.range;r=Re(function(t,e,n){var r,i=Re(t,2),a=i[0],o=i[1],s=Re(e,2),c=s[0],l=s[1],u=Re(n,2),f=u[0],h=u[1],d=Re([c,l],2),p=d[0],g=d[1],v=g-p;return p>g&&(p=(r=Re([g,p],2))[0],g=r[1]),v>o-a?[a,o]:p<a?f===a&&h===g?[a,g]:[a,v+a]:g>o?h===o&&f===p?[p,o]:[o-v,o]:[p,g]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return Y(e)?_b(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?qk(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=Re(this.ribbon.node().getPosition(),2),a=i[0],o=i[1],s=this.ifHorizontal(a,o),c=this.ifHorizontal.apply(this,Ie([],Re(db(t)),!1))-s;return j(this.getOffset(c,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,a=this.ribbonShape.length,o=this.eventToOffsetScale;return o.update({domain:[r,i],range:[0,a]}),e?o.invert(t):o.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=Re(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new Rp("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal((function(){return{value:t,range:e}}),(function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}})),a=new Rp("indicate",{detail:i});this.dispatchEvent(a)},e}(Xb);function nw(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var rw={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function iw(t){var e;void 0===t&&(t="");var n=nw(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=Pe({flex:1},rw),e[".".concat(n.VALUE)]=Pe({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},rw),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var aw=function(t){function e(e){var n,r,i=this,a=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,o=nw(a);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(o.CONTAINER,'"></div>'),title:'<div class="'.concat(o.TITLE,'"></div>'),item:'<li class="'.concat(o.LIST_ITEM,'" data-index={index}>\n <span class="').concat(o.NAME,'">\n <span class="').concat(o.MARKER,'" style="background:{color}"></span>\n <span class="').concat(o.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(o.VALUE,'" title="{value}">{value}</span>\n </li>')},style:iw(a)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return Te(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,i=void 0===r?"":r,a=t.color,o=void 0===a?"black":a,s=t.index,c=Ce(t,["name","color","index"]),l=Pe({name:i,color:o,index:null!=s?s:e},c);return wn(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}(n.item,l))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=wn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:qb(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,a=n.enterable,o=n.style,s=n.content,c=nw(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=a?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,qb(f,u);var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach((function(e){var n=Re(e,2),r=n[0],i=n[1];Ie([t],Re(t.querySelectorAll(r)),!1).filter((function(t){return t.matches(r)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(i).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(l,o)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},o=this.elementSize,s=o.width,c=o.height,l=[-s/2,-c/2];return i.forEach((function(t){var e=Re(l,2),n=e[0],i=e[1],o=Re(a[t],2),u=o[0],f=o[1];l=[n+(s/2+r[0])*u,i+(c/2+r[1])*f]})),l},e.prototype.setOffsetPosition=function(t){var e=Re(t,2),n=e[0],r=e[1],i=this.attributes,a=i.x,o=void 0===a?0:a,s=i.y,c=void 0===s?0:s,l=i.container,u=l.x,f=l.y;this.element.style.left="".concat(+o+u+n,"px"),this.element.style.top="".concat(+c+f+r,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestamp<e||(this.timestamp=n,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var e=Re(t,2),n=e[0],r=e[1],i=this.attributes,a=i.x,o=i.y,s=i.bounding,c=i.position;if(!s)return[n,r];var l=this.element,u=l.offsetWidth,f=l.offsetHeight,h=Re([+a+n,+o+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,m=s.y,y={left:d<v,right:d+u>v+s.width,top:p<m,bottom:p+f>m+s.height},b=[];c.split("-").forEach((function(t){y[t]?b.push(g[t]):b.push(t)}));var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,a=n.width,o=n.height;return new Qy(r,i,a,o).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout((function(){e.element.style.transition=n}),10)},e.tag="tooltip",e}(Xb),ow=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[Hp.BOUNDS_CHANGED,Hp.INSERTED,Hp.REMOVED],n.$margin=Db(0),n.$padding=Db(0);var r=e.style||{},i=r.margin,a=void 0===i?0:i,o=r.padding,s=void 0===o?0:o;return n.margin=a,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return Te(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Db(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Db(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,a=t.width,o=t.height,s=Re(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new Qy(n-f,i-c,a+f+l,o+c+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=Re(this.$padding,4),i=r[0],a=r[1],o=r[2],s=r[3],c=Re(this.$margin,4),l=c[0],u=c[3];return new Qy(s+u,i+l,e-s-a,n-i-o)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some((function(t){return!t.isConnected})))try{var t=this.attributes,e=t.x,n=t.y;this.style.transform="translate(".concat(e,", ").concat(n,")");var r=function(t,e,n){if(0===e.length)return[];var r={flex:bb,grid:xb},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map((function(t){return t.getBBox()})),this.attributes);this.children.forEach((function(t,e){var n=r[e],i=n.x,a=n.y;t.style.transform="translate(".concat(i,", ").concat(a,")")}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target&&(e.target.isMutationObserved=!0,t.layout())}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(zg);function sw(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let a=0,o=0;return e>0&&(a=e),r<0&&(a=r),n>0&&(o=n),i<0&&(o=i),[a,o]}const cw=jm((t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:a,labelTransform:o,labelTransformOrigin:s,x:c,y:l,x0:u=c,y0:f=l,text:h,background:d,connector:p,startMarker:g,endMarker:v,coordCenter:m,innerHTML:y}=e,b=Ce(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if(t.style.transform=`translate(${c}, ${l})`,[c,l,u,f].some((t=>!R(t))))return void t.children.forEach((t=>t.remove()));const x=Tr(b,"background"),{padding:k}=x,w=Ce(x,["padding"]),M=Tr(b,"connector"),{points:O=[]}=M,E=Ce(M,["points"]);let S;S=y?pm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",y).call(ym,Object.assign({transform:o,transformOrigin:s},b)).node():pm(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(ym,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},b)).node();const A=pm(t).maybeAppend("background","rect").style("zIndex",-1).call(ym,function(t,e=[]){const[n=0,r=0,i=n,a=r]=e,o=t.parentNode,s=o.getEulerAngles();o.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[h,d]=l;return o.setEulerAngles(s),{x:u-a,y:f-n,width:2*h+a+r,height:2*d+n+i}}(S,k)).call(ym,d?w:{}).node(),_=function(t,e,n,r,i=!0,a=!0){const o=t=>hc()(t);if(!e[0]&&!e[1])return o([sw(t),e]);if(!n.length)return o([[0,0],e]);const[s,c]=n,l=[...c],u=[...s];if(c[0]!==s[0]){const t=i?-4:4;l[1]=c[1],a&&!i&&(l[0]=Math.max(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),a||i||(l[0]=Math.max(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),!a&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t))),a&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t)))}return o([c,l,u,s,e])}(A,[+u-+c,+f-+l],O,0,+u<m[0],+f<m[1]),T=g&&new rx({id:"startMarker",style:Object.assign({x:0,y:0},Tr(b,"startMarker"))}),P=v&&new rx({id:"endMarker",style:Object.assign({x:0,y:0},Tr(b,"endMarker"))});pm(t).maybeAppend("connector","path").style("zIndex",0).style("d",_).style("markerStart",T).style("markerEnd",P).call(ym,p?E:{})})),lw=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:a,text:o="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(o),stroke:a,fill:a,fontSize:s},[[f,h]]=e;return pm(new cw).style("x",f).style("y",h).call(ym,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(ym,u).call(ym,t).node()}};lw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const uw=jm((t=>{const e=Ce(t.attributes,["class","x","y","transform"]),n=Tr(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",a,o],["Z"]]}(r/2),a=pm(t).maybeAppend("marker",(()=>new rx({}))).call((t=>t.node().update(Object.assign({symbol:i},n)))).node(),[o,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(a);pm(t).maybeAppend("text","text").style("x",o).style("y",s).call(ym,e)})),fw=(t,e)=>{const n=Ce(t,[]);return(t,e,r)=>{const{color:i}=r,a=Ce(r,["color"]),{color:o=i,text:s=""}=e,c={text:String(s),stroke:o,fill:o},[[l,u]]=t;return pm(new uw).call(ym,a).style("transform",`translate(${l},${u})`).call(ym,c).call(ym,n).node()}};fw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hw=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:a,text:o="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(o),stroke:a,fill:a,fontSize:s,textAlign:"center",textBaseline:"middle"},[[f,h]]=e;return pm(new tv).style("x",f).style("y",h).call(ym,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(ym,u).call(ym,t).node()}};hw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dw=jm((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,a=t.ownerDocument;pm(t).maybeAppend("connect-path",(()=>a.createElement("path",{}))).style("d",n).call(ym,i),pm(t).maybeAppend("area-path",(()=>a.createElement("path",{}))).style("d",e).call(ym,r)})),pw=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=t=>!Number.isNaN(t)&&null!=t,connect:a=!1}=t,o=Ce(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(t,e,l)=>{const{color:u}=l,{color:f=u,seriesColor:h,seriesX:d,seriesY:p}=e,g=Gc(s),v=Om(s,e),m=r&&h?xm(h,d,p,r,void 0,g):f,y=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:m,fill:m}),v&&{transform:v}),o),[b,x]=function(t,e){const n=[],r=[],i=[];let a=!1,o=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))a=!0;else{if(n.push(l),r.push(u),a&&o){a=!1;const[t,e]=o;i.push([t,l,e,u])}o=[l,u]}}return[n.concat(r),i]}(t,i),k=Tr(y,"connect"),w=!!x.length,M=t=>pm(c.createElement("path",{})).style("d",t||"").call(ym,y).node();if(Wc(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),a=t.slice(t.length/2);return function(){var t=dc().curve(pc),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return mc(n())},delete t.lineX0,t.lineEndAngle=function(){return mc(r())},delete t.lineX1,t.lineInnerRadius=function(){return mc(i())},delete t.lineY0,t.lineOuterRadius=function(){return mc(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(vc(t)):e()._curve},t}().angle(((t,n)=>xs(vs(r[n],e)))).outerRadius(((t,n)=>ys(r[n],e))).innerRadius(((t,n)=>ys(a[n],e))).defined(((t,e)=>[...r[e],...a[e]].every(i))).curve(n)(a)};return!w||a&&!Object.keys(k).length?M(e(b)):w&&!a?M(e(t)):pm(new dw).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},k),o)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?dc().y(((t,n)=>e[n][1])).x1(((t,n)=>e[n][0])).x0(((t,e)=>r[e][0])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e):dc().x(((t,n)=>e[n][0])).y1(((t,n)=>e[n][1])).y0(((t,e)=>r[e][1])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e)};return!w||a&&!Object.keys(k).length?M(e(b)):w&&!a?M(e(t)):pm(new dw).style("areaStyle",y).style("connectStyle",Object.assign(Object.assign({},k),o)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};pw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gw=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Wc(n)?Ac:lc;return pw(Object.assign({curve:i},t),e)(...r)}};gw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"square"});const vw=(t,e)=>{const n=Ce(t,[]),{coordinate:r}=e;return(...t)=>{const i=Wc(r)?Ec:Gc(r)?Ic:Rc;return pw(Object.assign({curve:i},n),e)(...t)}};vw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"smooth"});const mw=(t,e)=>(...n)=>pw(Object.assign({curve:Bc},t),e)(...n);mw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"hvh"});const yw=(t,e)=>(...n)=>pw(Object.assign({curve:Fc},t),e)(...n);yw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"vh"});const bw=(t,e)=>(...n)=>pw(Object.assign({curve:zc},t),e)(...n);bw.props=Object.assign(Object.assign({},pw.props),{defaultMarker:"hv"});const xw=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Wy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};xw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kw=(t,e)=>{const n=Ce(t,[]),{document:r}=e;return(t,e,i)=>{const{color:a}=i,o=Ce(i,["color"]),{color:s=a,transform:c}=e,[l,u]=t,f=Qs();return f.moveTo(l[0],l[1]),f.bezierCurveTo(l[0]/2+u[0]/2,l[1],l[0]/2+u[0]/2,u[1],u[0],u[1]),pm(r.createElement("path",{})).call(ym,o).style("d",f.toString()).style("stroke",s).style("transform",c).call(ym,n).node()}};function ww(t,e,n,r){const i=Qs();if(Wc(n)){const a=n.getCenter(),o=ys(t,a),s=(ys(e,a)-o)*r+o;return i.moveTo(t[0],t[1]),bm(i,t,e,a,s),i.lineTo(e[0],e[1]),i}return Gc(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}kw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Mw=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Ce(t,["cornerRatio"]),{coordinate:i,document:a}=e;return(t,e,o)=>{const{defaultColor:s}=o,c=Ce(o,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=ww(f,h,i,n);return pm(a.createElement("path",{})).call(ym,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(ym,r).node()}};Mw.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ow=(t,e)=>{const n=Ce(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:o}=a,s=Ce(a,["color"]),{color:c=o,transform:l}=e,[u,f]=t,h=Qs();if(h.moveTo(u[0],u[1]),Wc(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{bm(h,u,f,Ms(u,f),ys(u,f)/2)}return pm(i.createElement("path",{})).call(ym,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(ym,n).node()}};function Ew(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function Sw(t={}){return[...Ew(t),{name:"title",scale:"identity"}]}function Aw(){return[{type:ni,channel:"color"},{type:gi,channel:["x","y"]}]}function _w(){return[{type:ni,channel:"x"},{type:gi,channel:["y"]}]}function Tw(t={}){return Ew(t)}function Pw(){return[{type:si}]}function Cw(t,e){return t.getBandWidth(t.invert(e))}function Lw(t,e,n={}){const{x:r,y:i,series:a}=e,{x:o,y:s,series:c}=t,{style:{bandOffset:l=(c?0:.5),bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,h=!!(null==o?void 0:o.getBandWidth),d=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return h||d?(t,e)=>{const n=h?Cw(o,r[e]):0,l=d?Cw(s,i[e]):0,g=p&&a?(Cw(c,a[e])/2+ +a[e])*n:0,[v,m]=t;return[v+u*n+g,m+f*l]}:t=>t}function Nw(t){return parseFloat(t)/100}function jw(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions();return[t,Array.from(t,(t=>{const e=i[t],n=a[t];return[["string"==typeof e?Nw(e)*o:+e,"string"==typeof n?Nw(n)*s:+n]]}))]}Ow.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Rw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o}=a,s=Ce(a,["color"]),{color:c=o,src:l="",size:u=32,transform:f=""}=i;let{width:h=u,height:d=u}=t;const[[p,g]]=e,[v,m]=n.getSize();h="string"==typeof h?Nw(h)*v:h,d="string"==typeof d?Nw(d)*m:d;const y=p-Number(h)/2,b=g-Number(d)/2;return pm(r.createElement("image",{})).call(ym,s).style("x",y).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(ym,t).style("width",h).style("height",d).node()}};function Iw(t,e){const n=Qs();if(Wc(e)){const r=e.getCenter(),i=[...t,t[0]],a=i.map((t=>ys(t,r)));return i.forEach(((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const o=a[i],s=t[i-1],c=a[i-1];void 0!==c&&Math.abs(o-c)<1e-10?bm(n,s,e,r,o):n.lineTo(e[0],e[1])})),n.closePath(),n}return function(t,e){return e.forEach(((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1]))),t.closePath(),t}(n,t)}Rw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o}=a,s=Ce(a,["color"]),{color:c=o,transform:l}=i,u=Iw(e,n);return pm(r.createElement("path",{})).call(ym,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(ym,t).node()}};function Bw(t,e){const[n,r,i,a]=t,o=Qs();if(Wc(e)){const t=e.getCenter(),s=ys(t,n);return o.moveTo(n[0],n[1]),o.quadraticCurveTo(t[0],t[1],i[0],i[1]),bm(o,i,a,t,s),o.quadraticCurveTo(t[0],t[1],r[0],r[1]),bm(o,r,n,t,s),o.closePath(),o}return o.moveTo(n[0],n[1]),o.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(n[0],n[1]),o.closePath(),o}Dw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Fw=(t,e)=>{const n=Ce(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:o}=a,s=Ce(a,["color"]),{color:c=o,transform:l}=e,u=Bw(t,r);return pm(i.createElement("path",{})).call(ym,s).style("d",u.toString()).style("fill",c||o).style("stroke",c||o).style("transform",l).call(ym,n).node()}};function zw(t,e){const n=Qs();if(Wc(e)){const r=e.getCenter(),[i,a]=r,o=bs(vs(t[0],r)),s=bs(vs(t[1],r)),c=ys(r,t[2]),l=ys(r,t[3]),u=ys(r,t[8]),f=ys(r,t[10]),h=ys(r,t[11]);n.moveTo(...t[0]),n.arc(i,a,c,o,s),n.arc(i,a,c,s,o,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,a,l,o,s),n.lineTo(...t[6]),n.arc(i,a,f,s,o,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,a,u,o,s),n.arc(i,a,u,s,o,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,a,h,o,s),n.arc(i,a,h,s,o,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}Fw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=a,f=Ce(a,["color","fill","stroke"]),h=zw(e,n);return pm(r.createElement("path",{})).call(ym,f).style("d",h.toString()).style("stroke",u).style("fill",o||l).style("transform",s).call(ym,t).node()}};function Ww(t,e,n=4){const r=Qs();if(!Wc(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[a,o]=i,s=ys(i,t[3]),c=ys(i,t[8]),l=ys(i,t[10]),u=bs(vs(t[2],i)),f=Math.asin(n/c),h=u-f,d=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(h)*s+a,Math.sin(h)*s+o),r.arc(a,o,s,h,d),r.lineTo(Math.cos(d)*l+a,Math.sin(d)*l+o),r.arc(a,o,l,d,h,!0),r.lineTo(Math.cos(h)*s+a,Math.sin(h)*s+o),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(h+d)/2;return r.moveTo(Math.cos(p)*(c+n/2)+a,Math.sin(p)*(c+n/2)+o),r.arc(Math.cos(p)*c+a,Math.sin(p)*c+o,n/2,p,2*Math.PI+p),r.closePath(),r}Gw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $w=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:o,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=a,f=Ce(a,["color","fill","stroke"]),h=Ww(e,n,4);return pm(r.createElement("path",{})).call(ym,f).style("d",h.toString()).style("stroke",u).style("fill",o||l).style("transform",s).call(ym,t).node()}};$w.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Yw=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Ce(t,["arrow","arrowSize"]),{coordinate:a,document:o}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Ce(s,["color","lineWidth"]),{color:f=c,size:h=l}=e,d=n?function(t,e,n){return t.createElement("path",{style:Object.assign({d:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,transformOrigin:"center"},n)})}(o,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},Tr(i,"arrow"))):null,p=function(t,e){if(!Wc(e))return hc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return oc()({startAngle:0,endAngle:2*Math.PI,outerRadius:ys(t[0],n),innerRadius:ys(t[1],n)})}(t,a),g=function(t,e){if(!Wc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(a,e.transform);return pm(o.createElement("path",{})).call(ym,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(ym,i).node()}};function Hw(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Yw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Vw=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:a,endMarker:o=!0}=t,s=Ce(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=Ce(n,["color","connectLength1"]),{color:h,transform:d}=e,p=function(t,e,n,r,i=0){const[[a,o],[s,c]]=e;if(Gc(t)){const t=a+n,e=t+i;return[[t,o],[e,o],[e,c],[s+r,c]]}const l=o-n,u=l-i;return[[a,l],[a,u],[s,u],[s,c-r]]}(c,t,r,i,null!=a?a:u),g=Tr(Object.assign(Object.assign({},s),n),"endMarker");return pm(new qg).call(ym,f).style("d",function(t){return hc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",o?new rx({className:"marker",style:Object.assign(Object.assign({},g),{symbol:Hw})}):null).call(ym,s).node()}};function qw(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function Uw(t,e,n,r){const{bounds:i}=n,[[a,o],[s,c]]=i,l=s-a,u=c-o,f=t=>{const{x:e,y:r}=t,i=Lr(n.x,l),s=Lr(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+a,y:(s||r)+o})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAlign:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function Xw(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s}=n,c=r.getCenter(),l=wm(r,e,[i,a]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=Kw(p,o,s),v=(()=>{const[n,r]=e,i=u+.5*(f-u),[a,o]="inside"===t?Zw(c,p,i):Ms(n,r);return{x:a,y:o}})();return Object.assign(Object.assign({},v),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function Zw(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Kw(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Qw(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=wm(r,e,[i,a]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:Kw(p,o,s)},{innerRadius:v,outerRadius:m}=u,y=v+(m-v)*c+l,[b,x]=Zw(d,p,y);return Object.assign({x:b,y:x},g)}function Jw(t){return void 0===t?null:t}function tM(t,e,n,r){const{bounds:i}=n,[a]=i;return{x:Jw(a[0]),y:Jw(a[1])}}function eM(t,e,n,r){const{bounds:i}=n;if(1===i.length)return tM(0,0,n);return($c(r)?Xw:qc(r)?Qw:Uw)(t,e,n,r)}function nM(t,e,n){const r=wm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:a}=r;return i+(a-i)}function rM(t,e,n){const r=wm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:a}=r;return(i+a)/2}function iM(t,e,n,r){const{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:c=o,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),h=rM(e,n,r),d=Math.sin(h)>0?1:-1,p=Kw(h,i,a),g={textAlign:d>0||$c(r)?"start":"end",textBaseline:"middle",rotate:p},v=nM(e,n,r),m=v+(s?c:o),[[y,b],[x,k],[w,M]]=function(t,e,n,r,i){const[a,o]=Zw(t,e,n),[s,c]=Zw(t,e,r);return[[a,o],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,v,m,s?l:0),O=s?+u*d:0,E=w+O,S={connector:s,connectorPoints:[[x-E,k-M],[w-E,M-M]]};return Object.assign(Object.assign({x0:y,y0:b,x:w+O,y:M},g),S)}function aM(t,e={}){const{labelHeight:n=14,height:r}=e,i=tr(t,(t=>t.y)),a=i.length,o=new Array(a);for(let t=0;t<a;t++){const e=i[t],{y:r}=e;o[t]={y:r,y1:r+n,labels:[r]}}let s=!0;for(;s;){s=!1;for(let t=o.length-1;t>0;t--){const e=o[t],n=o[t-1];if(n.y1>e.y){s=!0,n.labels.push(...e.labels),o.splice(t,1),n.y1+=e.y1-e.y;const i=n.y1-n.y;n.y1=Math.max(Math.min(n.y1,r),i),n.y=n.y1-i}}}let c=0;for(const t of o){const{y:e,labels:r}=t;let a=e-n;for(const t of r){const e=i[c++],r=a+n-t;e.connectorPoints[0][1]-=r,e.y=a+n,a+=n}}}function oM(t,e){const n=tr(t,(t=>t.y)),{height:r,labelHeight:i=14}=e,a=Math.ceil(r/i);if(n.length<=a)return aM(n,e);const o=[];for(let t=0;t<n.length;t++)t<n.length-a?(n[t].opacity=0,n[t].connector=!1):o.push(n[t]);aM(o,e)}Vw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sM=new WeakMap;var cM=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,a=e.slice(0,i),o=e.slice(i);let s=dr(a,((t,e)=>Math.abs(t[1]-o[e][1])));s=Math.max(Math.min(s,i-2),1);const c=t=>[a[t][0],(a[t][1]+o[t][1])/2],l=c(s),u=c(s-1),f=bs(vs(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:eM,bottomLeft:eM,bottomRight:eM,inside:eM,left:eM,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?tM(0,0,n):($c(r)?Xw:qc(r)?iM:Uw)(t,e,n,r)},right:eM,spider:function(t,e,n,r,i,a){if(!qc(r))return{};if(sM.has(e))return sM.get(e);const o=a.map((t=>function(t,e,n){const{connectorLength:r,connectorLength2:i,connectorDistance:a}=e,o=Ce(iM(0,t,e,n),[]),s=n.getCenter(),c=nM(t,e,n),l=rM(t,e,n),u=c+r+i,f=Math.sin(l)>0?1:-1,h=s[0]+(u+ +a)*f,{x:d}=o,p=h-d;return o.x+=p,o.connectorPoints[0][0]-=p,o}(t,n,r))),{width:s,height:c}=r.getOptions(),l=o.filter((t=>t.x<s/2)),u=o.filter((t=>t.x>=s/2)),f=Object.assign(Object.assign({},i),{height:c});return oM(l,f),oM(u,f),o.forEach(((t,e)=>sM.set(a[e],t))),sM.get(e)},surround:function(t,e,n,r){if(!qc(r))return{};const{connectorLength:i,connectorLength2:a,connectorDistance:o}=n,s=Ce(iM(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(qc(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find((t=>"polar"===t[0]));if(r)return Math.max(e,n)/2*r[4]}return 0}(r),h=f+i,d=xs([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,v]=Zw(u,d,h);return s.x=g+(a+o)*p,s.y=v,s},top:eM,topLeft:eM,topRight:eM});function lM(t,e,n,r,i,a){const{position:o}=e,{render:s}=i,c=function(t,e){return void 0!==t?t:qc(e)?"inside":Gc(e)?"right":"top"}(o,n),l=r[s?"htmlLabel":"inside"===c?"innerLabel":"label"],u=Object.assign({},l,e),f=cM[qw(c)];if(!f)throw new Error(`Unknown position: ${c}`);return Object.assign(Object.assign({},l),f(c,t,u,n,i,a))}const uM=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,a,o,s)=>{const{text:c,x:l,y:u,transform:f="",transformOrigin:h,className:d=""}=a,p=Ce(a,["text","x","y","transform","transformOrigin","className"]),g=lM(e,a,n,r,t,s),{rotate:v=0,transform:m=""}=g,y=Ce(g,["rotate","transform"]);return pm(new cw).call(ym,y).style("text",`${c}`).style("className",`${d} g2-label`).style("innerHTML",i?i(c,a.datum,a.index):void 0).style("labelTransform",`${m} rotate(${+v}) ${f}`.trim()).style("labelTransformOrigin",h).style("coordCenter",n.getCenter()).call(ym,p).node()}};uM.props={defaultMarker:"point"};const fM=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Ce(t,["arrow","colorAttribute"]),{coordinate:a,document:o}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Ce(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=a.getSize();return pm(o.createElement("path",{})).call(ym,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(ym,i).node()}};fM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hM=(t,e)=>fM(Object.assign({colorAttribute:"fill"},t),e);hM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dM=(t,e)=>fM(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);dM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pM=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:a}=r,{color:o}=i,s=Ce(i,["color"]),{color:c=o}=r,[l,...u]=e,f=Qs();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),pm(n.createElement("path",{})).call(ym,s).style("d",f.toString()).style("stroke",c||o).style("fill",c||o).style("fillOpacity",.4).style("transform",a).call(ym,t).node()}};function gM(t){var e,n,r,i=t||1;function a(t,a){++e>i&&(r=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}function vM(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}pM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},gM(3);const mM=function(t,e=(...t)=>`${t[0]}`,n=16){const r=gM(n);return(...n)=>{const i=e(...n);let a=r.get(i);return r.has(i)?r.get(i):(a=t(...n),r.set(i,a),a)}}(((t,e,n)=>{const r=vM(n,2*t,2*t),i=r.getContext("2d"),a=t,o=t;if(1===e)i.beginPath(),i.arc(a,o,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(a,o,t*e,a,o,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));function yM(t,e,n,r,i,a,o){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},a);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=vM(o,t,e).getContext("2d"),l=function(t,e){const n=vM(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map((t=>{const[e,n]=t.split(":");return[+e,n]})):t}(t).forEach((([t,e])=>{r.addColorStop(t,e)})),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,o);c.clearRect(0,0,t,e),function(t,e,n,r,i,a){const{blur:o}=i;let s=r.length;for(;s--;){const{x:i,y:c,value:l,radius:u}=r[s],f=Math.min(l,n),h=i-u,d=c-u,p=mM(u,1-o,a),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,h,d)}}(c,n,r,i,s,o);const u=function(t,e,n,r,i){const{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:c}=i,l=e,u=n,f=t.getImageData(0,0,l,u),h=f.data,d=h.length;for(let t=3;t<d;t+=4){const e=h[t],n=4*e;if(!n)continue;const i=o||Math.max(0,Math.min(s,Math.max(a,e)));h[t-3]=r[n],h[t-2]=r[n+1],h[t-1]=r[n+2],h[t]=c?r[n+3]:i}return f}(c,t,e,l,s),f=vM(o,t,e).getContext("2d");return f.putImageData(u,0,0),f}const bM=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:a,blur:o,useGradientOpacity:s}=t,c=Ce(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(t,e,h)=>{const{transform:d}=e,[p,g]=l.getSize(),v=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),m=pr(t,(t=>t[2])),y=hr(t,(t=>t[2])),b=p&&g?yM(p,g,m,y,v,function(t,e){return Object.keys(t).reduce(((n,r)=>{const i=t[r];return e(i,r)||(n[r]=i),n}),{})}({gradient:n,opacity:r,minOpacity:a,maxOpacity:i,blur:o,useGradientOpacity:s},(t=>void 0===t)),u):{canvas:null};return pm(f.createElement("image",{})).call(ym,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas.toDataURL()).style("transform",d).call(ym,c).node()}};bM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xM=(t,e)=>{const{render:n}=t,r=Ce(t,["render"]);return t=>{const[[i,a]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:a}),e)}};function kM(t,e){return t.getBandWidth(t.invert(e))}xM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const wM={rect:_m,hollow:Tm,funnel:Cm,pyramid:Nm},MM=()=>(t,e,n,r)=>{const{x:i,y:a,y1:o,series:s,size:c}=n,l=e.x,u=e.series,[f]=r.getSize(),h=c?c.map((t=>+t/f)):null,d=c?(t,e,n)=>{const r=t+e/2,i=h[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,(t=>{const e=kM(l,i[t]),n=e*(u?kM(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[h,p]=d(f,n,t),g=+a[t],v=+o[t];return[[h,g],[p,g],[p,v],[h,v]].map((t=>r.map(t)))}));return[t,p]};MM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:wM,channels:[...Sw({shapes:Object.keys(wM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Pw(),{type:Cn},{type:ri}],postInference:[..._w()],interaction:{shareTooltip:!0}};const OM={rect:_m,hollow:Tm},EM=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n,c=Array.from(t,(t=>[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,c]};EM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:OM,channels:[...Sw({shapes:Object.keys(OM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw(),{type:Cn}],postInference:[..._w()],interaction:{shareTooltip:!0}};const SM={line:Dm,smooth:Bm,hv:Fm,vh:zm,hvh:Gm,trail:$m},AM=(t,e,n,r)=>{var i,a;const{series:o,x:s,y:c}=n,{x:l,y:u}=e;if(void 0===s||void 0===c)throw new Error("Missing encode for x or y channel.");const f=o?Array.from(Xn(t,(t=>o[t])).values()):[t],h=f.map((t=>t[0])).filter((t=>void 0!==t)),d=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,p=((null===(a=null==u?void 0:u.getBandWidth)||void 0===a?void 0:a.call(u))||0)/2,g=Array.from(f,(t=>t.map((t=>r.map([+s[t]+d,+c[t]+p])))));return[h,g,f]},_M=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),a=[];for(let t=0;t<n.length;t+=2)a.push([n[t],n[t+1]]);return a}))]},TM=()=>(t,e,n,r)=>(Hc(r)?_M:AM)(t,e,n,r);TM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:SM,channels:[...Sw({shapes:Object.keys(SM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Pw(),{type:xi},{type:ci}],postInference:[..._w(),{type:ni,channel:"color"},{type:gi,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const PM={hollow:My,hollowDiamond:ky,hollowHexagon:wy,hollowSquare:Oy,hollowTriangleDown:Sy,hollowTriangle:Ey,hollowBowtie:xy,hollowCircle:Ty,point:Dy,plus:Iy,diamond:Ly,square:By,triangle:zy,hexagon:Ny,cross:Cy,bowtie:Py,hyphen:jy,line:Ry,tick:Fy,triangleDown:Gy,circle:_y},CM=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s,y1:c,size:l,dx:u,dy:f}=r,[h,d]=i.getSize(),p=Lw(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+a[t]+ +s[t])/2:+a[t])+e,(c?(+o[t]+ +c[t])/2:+o[t])+n]};return[e,l?Array.from(e,(t=>{const[e,n]=g(t),r=+l[t],a=r/h,o=r/d,s=[e-a,n-o],c=[e+a,n+o];return[i.map(p(s,t)),i.map(p(c,t))]})):Array.from(e,(t=>[i.map(p(g(t),t))]))]};CM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:PM,channels:[...Sw({shapes:Object.keys(PM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Pw(),{type:ri},{type:ii}],postInference:[{type:oi},...Aw()]};const LM={text:lw,badge:fw,tag:hw},NM=t=>{const{cartesian:e=!1}=t;return e?jw:(e,n,r,i)=>{const{x:a,y:o}=r,s=Lw(n,r,t),c=Array.from(e,(t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]}));return[e,c]}};NM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:LM,channels:[...Sw({shapes:Object.keys(LM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...Pw(),{type:bi},{type:mi}],postInference:[...Aw()]};const jM={cell:_m,hollow:Tm},RM=()=>(t,e,n,r)=>{const{x:i,y:a}=n,o=e.x,s=e.y,c=Array.from(t,(t=>{const e=o.getBandWidth(o.invert(+i[t])),n=s.getBandWidth(s.invert(+a[t])),c=+i[t],l=+a[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map((t=>r.map(t)))}));return[t,c]};RM.props={defaultShape:"cell",defaultLabelShape:"label",shape:jM,composite:!1,channels:[...Sw({shapes:Object.keys(jM)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Pw(),{type:ri},{type:ii},{type:vi}],postInference:[...Aw()]};const IM={area:gw,smooth:vw,hvh:mw,vh:yw,hv:bw},DM=()=>(t,e,n,r)=>{var i,a;const{x:o,y:s,y1:c,series:l}=n,{x:u,y:f}=e,h=l?Array.from(Xn(t,(t=>l[t])).values()):[t],d=h.map((t=>t[0])).filter((t=>void 0!==t)),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(a=null==f?void 0:f.getBandWidth)||void 0===a?void 0:a.call(f))||0)/2;return[d,Array.from(h,(t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const a=t[i];n[i]=r.map([+o[a]+p,+s[a]+g]),n[e+i]=r.map([+o[a]+p,+c[a]+g])}return n})),h]};DM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:IM,channels:[...Sw({shapes:Object.keys(IM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Pw(),{type:ci},{type:Cn},{type:vi}],postInference:[..._w()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const BM={link:xw,arc:Ow,smooth:kw,vhv:Mw},FM=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s=a,y1:c=o}=r,l=Lw(n,r,t),u=e.map((t=>[i.map(l([+a[t],+o[t]],t)),i.map(l([+s[t],+c[t]],t))]));return[e,u]};FM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:BM,channels:[...Sw({shapes:Object.keys(BM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw(),{type:fi},{type:hi}],postInference:[...Aw()]};const zM={image:Rw},GM=t=>{const{cartesian:e}=t;return e?jw:(e,n,r,i)=>{const{x:a,y:o}=r,s=Lw(n,r,t),c=Array.from(e,(t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]}));return[e,c]}};GM.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:zM,channels:[...Sw({shapes:Object.keys(zM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Pw(),{type:bi},{type:mi}],postInference:[...Aw()]};const WM={polygon:Dw,ribbon:Fw},$M=()=>(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("x"))).map((([,t])=>t)),a=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),o=t.map((t=>{const e=[];for(let n=0;n<i.length;n++){const o=i[n][t];if(void 0===o)break;const s=a[n][t];e.push(r.map([+o,+s]))}return e}));return[t,o]};$M.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:WM,channels:[...Sw({shapes:Object.keys(WM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw()],postInference:[...Aw()]};const YM={box:Gw,violin:$w},HM=()=>(t,e,n,r)=>{const{x:i,y:a,y1:o,y2:s,y3:c,y4:l,series:u}=n,f=e.x,h=e.series,d=Array.from(t,(t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(h?h.getBandWidth(h.invert(+(null==u?void 0:u[t]))):1),d=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+d+n/2,[g,v,m,y,b]=[+a[t],+o[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,y],[p-n/2,y],[p+n/2,y],[p+n/2,v],[p-n/2,v],[p-n/2,m],[p+n/2,m],[p,v],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,d]};HM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:YM,channels:[...Sw({shapes:Object.keys(YM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Pw(),{type:ri}],postInference:[..._w()],interaction:{shareTooltip:!0}};const VM={vector:Wy},qM=()=>(t,e,n,r)=>{const{x:i,y:a,size:o,rotate:s}=n,[c,l]=r.getSize(),u=t.map((t=>{const e=+s[t]/180*Math.PI,n=+o[t],u=n/l,f=n/c*Math.cos(e),h=-u*Math.sin(e);return[r.map([+i[t]-f/2,+a[t]-h/2]),r.map([+i[t]+f/2,+a[t]+h/2])]}));return[t,u]};qM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:VM,channels:[...Sw({shapes:Object.keys(VM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Pw()],postInference:[...Aw()]};const UM={line:Yw},XM=t=>(e,n,r,i)=>{const{y:a}=r,o=Lw(n,r,K({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[0,a[t]],[1,a[t]]].map((e=>i.map(o(e,t))))));return[e,s]};XM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:UM,channels:[...Tw({shapes:Object.keys(UM)}),{name:"y",required:!0}],preInference:[...Pw(),{type:li}],postInference:[]};const ZM={line:Yw},KM=t=>(e,n,r,i)=>{const{x:a}=r,o=Lw(n,r,K({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[a[t],1],[a[t],0]].map((e=>i.map(o(e,t))))));return[e,s]};KM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:ZM,channels:[...Tw({shapes:Object.keys(ZM)}),{name:"x",required:!0}],preInference:[...Pw(),{type:ui}],postInference:[]};const QM={connector:Vw},JM=(...t)=>FM(...t);function tO(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:a}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+n]}}function eO(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,a)=>{const o=tO("x",e,i,r.x),s=tO("y",n,i,r.y),c=Array.from(t,(t=>{const[e,n]=o(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map((t=>a.map(t)))}));return[t,c]}}JM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:QM,channels:[...Tw({shapes:Object.keys(QM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw()],postInference:[]};const nO={range:_m},rO=()=>eO();rO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:nO,channels:[...Tw({shapes:Object.keys(nO)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw()],postInference:[]};const iO={range:_m},aO=()=>eO({extendY:!0});aO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:iO,channels:[...Tw({shapes:Object.keys(iO)}),{name:"x",required:!0}],preInference:[...Pw(),{type:di}],postInference:[]};const oO={range:_m},sO=()=>eO({extendX:!0});sO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:oO,channels:[...Tw({shapes:Object.keys(oO)}),{name:"y",required:!0}],preInference:[...Pw(),{type:pi}],postInference:[]};const cO={path:hM,hollow:dM},lO=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function uO(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function fO(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=dO)):void 0===e&&(e=hO);for(var n,r,i,a,o,s=new vO(t),c=[s];n=c.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;a>=0;--a)c.push(r=i[a]=new vO(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(gO)}function hO(t){return t.children}function dO(t){return Array.isArray(t)?t[1]:null}function pO(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function gO(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function vO(t){this.data=t,this.depth=this.height=0,this.parent=null}function mO(t){return null==t?null:yO(t)}function yO(t){if("function"!=typeof t)throw new Error;return t}function bO(){return 0}function xO(t){return function(){return t}}function kO(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function wO(t,e,n,r,i){for(var a,o=t.children,s=-1,c=o.length,l=t.value&&(r-e)/t.value;++s<c;)(a=o[s]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*l}lO.props={defaultShape:"path",defaultLabelShape:"label",shape:cO,composite:!1,channels:[...Sw({shapes:Object.keys(cO)}),{name:"d",scale:"identity"}],preInference:[...Pw()],postInference:[]},vO.prototype=fO.prototype={constructor:vO,count:function(){return this.eachAfter(uO)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,a=this,o=[a],s=[],c=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++c,this);return this},eachBefore:function(t,e){for(var n,r,i=this,a=[i],o=-1;i=a.pop();)if(t.call(e,i,++o,this),n=i.children)for(r=n.length-1;r>=0;--r)a.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return fO(this).eachBefore(pO)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)a.push(e[n])}while(a.length)}};var MO={depth:-1},OO={},EO={};function SO(t){return t.id}function AO(t){return t.parentId}function _O(){var t,e=SO,n=AO;function r(r){var i,a,o,s,c,l,u,f,h=Array.from(r),d=e,p=n,g=new Map;if(null!=t){const e=h.map(((e,n)=>function(t){t=`${t}`;let e=t.length;PO(t,e-1)&&!PO(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(TO),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(TO(t)),h.push(EO));d=(t,n)=>e[n],p=(t,e)=>n[e]}for(o=0,i=h.length;o<i;++o)a=h[o],l=h[o]=new vO(a),null!=(u=d(a,o,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?OO:l)),null!=(u=p(a,o,r))&&(u+="")&&(l.parent=u);for(o=0;o<i;++o)if(u=(l=h[o]).parent){if(!(c=g.get(u)))throw new Error("missing: "+u);if(c===OO)throw new Error("ambiguous: "+u);c.children?c.children.push(l):c.children=[l],l.parent=c}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===EO&&1===s.children.length;)s=s.children[0],--i;for(let t=h.length-1;t>=0&&(l=h[t]).data===EO;--t)l.data=null}if(s.parent=MO,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(gO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=mO(t),r):e},r.parentId=function(t){return arguments.length?(n=mO(t),r):n},r.path=function(e){return arguments.length?(t=mO(e),r):t},r}function TO(t){let e=t.length;if(e<2)return"";for(;--e>1&&!PO(t,e););return t.slice(0,e)}function PO(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function CO(t,e,n,r,i){for(var a,o=t.children,s=-1,c=o.length,l=t.value&&(i-n)/t.value;++s<c;)(a=o[s]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*l}var LO=(1+Math.sqrt(5))/2;function NO(t,e,n,r,i,a){for(var o,s,c,l,u,f,h,d,p,g,v,m=[],y=e.children,b=0,x=0,k=y.length,w=e.value;b<k;){c=i-n,l=a-r;do{u=y[x++].value}while(!u&&x<k);for(f=h=u,v=u*u*(g=Math.max(l/c,c/l)/(w*t)),p=Math.max(h/v,v/f);x<k;++x){if(u+=s=y[x].value,s<f&&(f=s),s>h&&(h=s),v=u*u*g,(d=Math.max(h/v,v/f))>p){u-=s;break}p=d}m.push(o={value:u,dice:c<l,children:y.slice(b,x)}),o.dice?wO(o,n,r,i,w?r+=l*u/w:a):CO(o,n,r,w?n+=c*u/w:i,a),w-=u,b=x}return m}var jO=function t(e){function n(t,n,r,i,a){NO(e,t,n,r,i,a)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(LO);function RO(t,e,n,r,i){var a,o,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=o=a=0;a<c;++a)l[a+1]=o+=s[a].value;!function t(e,n,r,i,a,o,c){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=c)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;d<p;){var g=d+p>>>1;l[g]<h?d=g+1:p=g}h-l[d-1]<l[d]-h&&e+1<d&&--d;var v=l[d]-f,m=r-v;if(o-i>c-a){var y=r?(i*m+o*v)/r:o;t(e,d,v,i,a,y,c),t(d,n,m,y,a,o,c)}else{var b=r?(a*m+c*v)/r:c;t(e,d,v,i,a,o,b),t(d,n,m,i,b,o,c)}}(0,c,t.value,e,n,r,i)}function IO(t,e,n,r,i){(1&t.depth?CO:wO)(t,e,n,r,i)}var DO=function t(e){function n(t,n,r,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,c,l,u,f=-1,h=o.length,d=t.value;++f<h;){for(c=(s=o[f]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?wO(s,n,r,i,d?r+=(a-r)*s.value/d:a):CO(s,n,r,d?n+=(i-n)*s.value/d:i,a),d-=s.value}else t._squarify=o=NO(e,t,n,r,i,a),o.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(LO);function BO(t,e=[t.data.name]){t.id=t.id||t.data.name,t.path=e,t.children&&t.children.forEach((n=>{n.id=`${t.id}/${n.data.name}`,n.path=[...e,n.data.name],BO(n,n.path)}))}function FO(t){const e=et(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{FO(t)}))}function zO(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:RO,treemapDice:wO,treemapSlice:CO,treemapSliceDice:IO,treemapSquarify:jO,treemapResquarify:DO},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),a=function(t,e){return Array.isArray(t)?"function"==typeof e?_O().path(e)(t):_O()(t):fO(t)}(t,e.path);x(t)?FO(a):BO(a),r?a.sum((t=>e.ignoreParentValue&&t.children?0:function(t){return"function"==typeof t?t:e=>e[t]}(r)(t))).sort(e.sort):a.count(),function(){var t=jO,e=!1,n=1,r=1,i=[0],a=bO,o=bO,s=bO,c=bO,l=bO;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(kO),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,h=e.y1-n;f<r&&(r=f=(r+f)/2),h<u&&(u=h=(u+h)/2),e.x0=r,e.y0=u,e.x1=f,e.y1=h,e.children&&(n=i[e.depth+1]=a(e)/2,r+=l(e)-n,u+=o(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(h-=c(e)-n)<u&&(u=h=(u+h)/2),t(e,r,u,f,h))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],r=+t[1],u):[n,r]},u.tile=function(e){return arguments.length?(t=yO(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:xO(+t),u):a},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:xO(+t),u):o},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:xO(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:xO(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:xO(+t),u):l},u}().tile(i).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(a);const o=a.descendants().map((t=>Object.assign(t,{id:t.id.replace(/^\//,""),x:[t.x0,t.x1],y:[t.y0,t.y1]}))),s=o.filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer);return[s,o]}const GO=t=>{const{cartesian:e}=t;return e?jw:(e,n,r,i)=>{const{x:a,y:o}=r,s=Lw(n,r,t),c=Array.from(e,(t=>{const e=[+a[t],+o[t]];return[i.map(s(e,t))]}));return[e,c]}};GO.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:xM},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pw(),{type:bi},{type:mi},{type:yi}]};const WO=(t,e)=>Ne(void 0,void 0,void 0,(function*(){const{width:n,height:r}=e,{data:i,encode:a={},scale:o,style:s={},layout:c={}}=t,l=Ce(t,["data","encode","scale","style","layout"]),u=function(t,e){const{text:n="text",value:r="value"}=e;return t.map((t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]})))}(i,a);return K({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size",shape:"tag"},scale:{x:{range:[0,1]},y:{range:[0,1]}},style:{fontFamily:t=>t.fontFamily}},Object.assign(Object.assign({data:{value:u,transform:[Object.assign({type:"wordCloud",size:[n,r]},c)]},encode:a,scale:o,style:s},l),{axis:!1}))}));WO.props={};const $O={density:pM},YO=()=>(t,e,n,r)=>{const{x:i,series:a}=n,o=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),s=Object.entries(n).filter((([t])=>t.startsWith("size"))).map((([,t])=>t));if(void 0===i||void 0===o||void 0===s)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,(e=>{const n=c.getBandWidth(c.invert(+i[e])),u=n*(l?l.getBandWidth(l.invert(+(null==a?void 0:a[e]))):1),f=(+(null==a?void 0:a[e])||0)*n,h=+i[e]+f+u/2;return[...o.map(((n,r)=>[h+ +s[r][e]/t.length,+o[r][e]])),...o.map(((n,r)=>[h-+s[r][e]/t.length,+o[r][e]])).reverse()].map((t=>r.map(t)))}));return[t,u]};YO.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:$O,channels:[...Sw({shapes:Object.keys($O)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...Pw(),{type:Cn},{type:ri}],postInference:[..._w()],interaction:{shareTooltip:!0}};const HO={heatmap:bM},VO=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n;return[[0],[Array.from(t,(t=>{const e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]}))]]};VO.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:HO,channels:[...Sw({shapes:Object.keys(HO)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Pw(),{type:ri},{type:ii}],postInference:[...Aw()]};const qO=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];qO.props={};const UO=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];UO.props={};const XO=t=>new $a(t);XO.props={};const ZO=t=>new so(t);ZO.props={};const KO=t=>new za(t);KO.props={};const QO=t=>new no(t);QO.props={};const JO=t=>new co(t);JO.props={};const tE=t=>new Lo(t);tE.props={};const eE=t=>new go(t);eE.props={};const nE=t=>new uo(t);nE.props={};const rE=t=>new ho(t);rE.props={};const iE=t=>new yo(t);iE.props={};const aE=t=>new vo(t);aE.props={};const oE=t=>new fo(t);oE.props={};const sE=t=>new Ro(t);sE.props={};const cE=t=>new Ha(t);function lE({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:a,padding2:o,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:h,category10:d,category20:p,sizeDefault:g=1,padding:v="auto",margin:m=16}){return{padding:v,margin:m,size:g,color:t,category10:d,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,lineCap:"round"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,lineWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,lineWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:h,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:a,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom",titleTransform:"translate(0, 8)"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransform:"rotate(-90) translate(0, -8)",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[a,a],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:a,colPadding:o,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{".g2-tooltip":{"font-family":"sans-serif"}}}}}cE.props={};const uE=lE({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),fE=t=>K({},uE,t);fE.props={};const hE=t=>K({},fE(),{category10:"category10",category20:"category20"},t);hE.props={};const dE=lE({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),pE=t=>K({},dE,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{".g2-tooltip":{background:"#1f1f1f",opacity:.95},".g2-tooltip-title":{color:"#A6A6A6"},".g2-tooltip-list-item-name-label":{color:"#A6A6A6"},".g2-tooltip-list-item-value":{color:"#A6A6A6"}}}},t),gE=t=>Object.assign({},pE(),{category10:"category10",category20:"category20"},t);gE.props={};const vE=lE({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),mE=t=>K({},vE,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);function yE(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}mE.props={};var bE,xE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function kE(t){if(!(e=xE.exec(t)))throw new Error("invalid format: "+t);var e;return new wE({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function wE(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function ME(t,e){var n=yE(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}kE.prototype=wE.prototype,wE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var OE={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ME(100*t,e),r:ME,s:function(t,e){var n=yE(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(bE=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+yE(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function EE(t){return t}var SE,AE,_E=Array.prototype.map,TE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function PE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?EE:(e=_E.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?EE:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(_E.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=kE(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,v=t.precision,m=t.trim,y=t.type;"n"===y?(g=!0,y="g"):OE[y]||(void 0===v&&(v=12),m=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===h?a:/[%p]/.test(y)?c:"",k=OE[y],w=/[defgprs%]/.test(y);function M(t){var i,a,c,h=b,M=x;if("c"===y)M=k(t)+M,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:k(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:l:"-"===f||"("===f?"":f)+h,M=("s"===y?TE[8+bE/3]:"")+M+(O&&"("===f?")":""),w)for(i=-1,a=t.length;++i<a;)if(48>(c=t.charCodeAt(i))||c>57){M=(46===c?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var E=h.length+t.length+M.length,S=E<p?new Array(p-E+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-M.length:1/0),S=""),n){case"<":t=h+t+M+S;break;case"=":t=h+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+h+t+M+S.slice(E);break;default:t=S+h+t+M}return s(t)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=kE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=yE(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),a=TE[8+r/3];return function(t){return n(i*t)+a}}}}function CE(t,e,n){return t.querySelector(e)?pm(t).select(e):pm(t).append(n)}function LE(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function NE(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","flex-start","center"],right:["column","flex-start","center"],center:["column","center","center"]};return t in a&&([n,r,i]=a[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}SE=PE({thousands:",",grouping:[3],currency:["$",""]}),AE=SE.format;class jE extends ow{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class RE extends jE{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function IE(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function DE(t){return"vertical"===t||t===-Math.PI/2}function BE(t,e,n){const{bbox:r}=t,{position:i="top",size:a,length:o}=e,s=["top","bottom","center"].includes(i),[c,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,h=a||u||c,d=o||f||l,p=s?"horizontal":"vertical",[g,v]=s?[d,h]:[h,d];return{orientation:p,width:g,height:v,size:h,length:d}}function FE(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Ce(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${W(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}function zE(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function GE(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function WE(t,e,n,r,i,a,o,s){var c;void 0===n&&void 0===a||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),a&&{tickMethod:a}));const l=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=Yn(e,(t=>+t)),{tickCount:a}=t.getOptions();return n(r,i,a)}(t,e,a),u=i?l.filter(i):l,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),h=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,d=function(t,e){if(Wc(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:a,insetBottom:o,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[a,o,i]:[s,c,r],h=new so({domain:[0,1],range:[l/f,1-u/f]});return t=>h.map(t)}(o,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!Vc(e))return i;const a="bottom"===t?[i,1]:[0,i],o=e.map(a);if("bottom"===t){const t=o[0];return new so({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=o[1];return new so({domain:[0,r],range:[0,1]}).map(t)}return i}}(o,s),g=t=>["left","right"].includes(t);return Wc(s)||Gc(s)?u.map(((e,n,r)=>{var i,a;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=d(t.map(e)+c);return{value:$c(s)&&"center"===o||Gc(s)&&(null===(a=t.getTicks)||void 0===a?void 0:a.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(o)||Gc(s)&&g(o)?1-l:l,label:f(h(mm(e),n,r)),id:String(n)}})):u.map(((e,n,r)=>{var i;const a=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(d(t.map(e)+a));return{value:g(o)?1-s:s,label:f(h(mm(e),n,r)),id:String(n)}}))}function $E(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:a}=e,o=[],s=(t,e)=>{e&&o.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},a),o}function YE(t,e,n){return!function(t){return Wc(t)&&Gc(t)}(e)&&!Hc(e)&&(void 0===t?!!n.getTicks:t)}function HE(t,e,n,r,i,a){const o=function(t,e,n,r,i){const a=n.axis,o=["top","right","bottom","left"].includes(i)?n[`axis${Or(i)}`]:n.axisLinear,s=t.getOptions().name,c=n[`axis${W(s)}`]||{};return Object.assign({},a,o,c)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},o),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:DE(a)?10:0,tick:"center"!==r&&void 0}):o}const VE=t=>e=>{const{labelFormatter:n,labelFilter:r=()=>!0}=e;return i=>{var a;const{scales:[o]}=i,s=(null===(a=o.getTicks)||void 0===a?void 0:a.call(o))||o.getOptions().domain,c="string"==typeof n?AE(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:(t,e,n)=>r(s[e],e,s),scale:o});return t(l)(i)}},qE=VE((t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:a,actualPosition:o,position:s,size:c,style:l={},title:u,tickCount:f,tickFilter:h,tickMethod:d,transform:p,indexBBox:g}=t,v=Ce(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:i,value:m,coordinate:y,theme:b})=>{const{bbox:x}=m,[k]=i,{domain:w,xScale:M}=k.getOptions(),O=HE(k,0,b,e,s,a),E=Object.assign(Object.assign(Object.assign({},O),l),v),S=function(t,e,n="xy"){const[r,i,a]=GE(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?a:r:t.includes("bottom")||t.includes("top")?i:a}(o||s,y,t.plane),A=function(t,e,n,r,i){const{x:a,y:o,width:s,height:c}=n;if("bottom"===t)return{startPos:[a,o],endPos:[a+s,o]};if("left"===t)return{startPos:[a+s,o+c],endPos:[a+s,o]};if("right"===t)return{startPos:[a,o+c],endPos:[a,o]};if("top"===t)return{startPos:[a,o+c],endPos:[a+s,o+c]};if("center"===t){if("vertical"===e)return{startPos:[a,o],endPos:[a,o+c]};if("horizontal"===e)return{startPos:[a,o],endPos:[a+s,o]};if("number"==typeof e){const[t,n]=r.getCenter(),[l,u]=Uc(r),[f,h]=Xc(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),v=l*d,m=u*d,[y,b]=[t+a-p,n+o-g],[x,k]=[Math.cos(e),Math.sin(e)],w=[y+m*x,b+m*k],M=[y+v*x,b+v*k],O=()=>{const{domain:t}=i.getOptions();return t.length},E=Wc(r)&&i?O():3;return{startPos:w,endPos:M,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[y,b],gridControlAngles:new Array(E).fill(0).map(((t,e,n)=>(h-f)/E*e))}}}return{}}(s,a,x,y,M),_=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(y),T=WE(k,w,f,r,h,d,s,y),P=g?T.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):T,C=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},E),{type:"linear",data:P,crossSize:c,titleText:LE(u),labelOverlap:$E(p,E),grid:YE(E.grid,y,k),gridLength:S,line:!0,indexBBox:g}),E.line?null:{lineOpacity:0}),A),_),n),L=C.labelOverlap.find((t=>"hide"===t.type));return L&&(C.crossSize=!1),new Ak({className:"axis",style:FE(C)})}})),UE=VE((t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:a,tickFilter:o,tickCount:s,tickMethod:c,important:l={},style:u={},indexBBox:f,title:h,grid:d=!1}=t,p=Ce(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:u}=e,{domain:g}=t.getOptions(),v=WE(t,g,s,a,o,c,r,n),m=f?v.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):v,[y,b]=Uc(n),x=function(t,e,n,r,i){const{x:a,y:o,width:s,height:c}=e,l=[a+s/2,o+c/2],u=Math.min(s,c)/2,[f,h]=Xc(i),[d,p]=GE(i),g={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,u,y,b,n),{axis:k,axisArc:w={}}=i,M=FE(K({},k,w,x,Object.assign(Object.assign({type:"arc",data:m,titleText:LE(h),grid:d},p),l)));return new Ak({style:rt(M,["transform"])})}}));qE.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},UE.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const XE=t=>(...e)=>{const n=qE(Object.assign({},{crossPadding:50},t))(...e);return zE(n,t),n};XE.props=Object.assign(Object.assign({},qE.props),{defaultPosition:"bottom"});const ZE=t=>(...e)=>{const n=qE(Object.assign({},{crossPadding:10},t))(...e);return zE(n,t),n};function KE(t,e,n,r){const{radar:i}=t,[a]=r,o=a.getOptions().name,[s,c]=Xc(n),{axisRadar:l={}}=e;return Object.assign(Object.assign({},l),{grid:"position"===o,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map(((t,e)=>(c-s)/i.count*e))})}ZE.props=Object.assign(Object.assign({},qE.props),{defaultPosition:"left"});const QE=t=>{const{important:e={}}=t,n=Ce(t,["important"]);return r=>{const{theme:i,coordinate:a,scales:o}=r;return qE(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},KE(t,i,a,o)),e)}))(r)}};function JE(t,e){const{scales:n,library:r,markState:i}=e,[a,o]=function(t,e){const n=IE(t,"shape"),r=IE(t,"color"),i=n?n.clone():null,a=[];for(const[t,n]of e){const e=t.type,o=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map(((e,r)=>{var a;return i?i.map(e||"point"):(null===(a=null==t?void 0:t.style)||void 0===a?void 0:a.shape)||n.defaultShape||"point"}));"string"==typeof e&&a.push([e,o])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const{range:o}=n.getOptions();return a.map((([t,e])=>{let n=0;for(let t=0;t<a.length;t++){const r=o[t%o.length];e[t]===r&&n++}return[n/e.length,[t,e]]})).sort(((t,e)=>e[0]-t[0]))[0][1]}(n,i),{itemMarker:s,itemMarkerSize:c}=t,l=(t,e)=>{var n,i,o;const s=(null===(o=null===(i=null===(n=r[`mark.${a}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===o?void 0:o.props.defaultMarker)||N(t.split(".")),l="function"==typeof c?c(e):c;return()=>function(t,e){var{d:n,fill:r,lineWidth:i,path:a,stroke:o,color:s}=e,c=Ce(e,["d","fill","lineWidth","path","stroke","color"]);const l=my.get(t)||my.get("point");return(...t)=>new qg({style:Object.assign(Object.assign({},c),{d:l(...t),stroke:l.style.includes("stroke")?s||o:"",fill:l.style.includes("fill")?s||r:"",lineWidth:l.style.includes("lineWidth")?i||i||2:0})})}(s,{color:e.color})(0,0,l)},u=t=>`${o[t]}`;return IE(n,"shape")&&!s?(t,e)=>l(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?l(n,t):n}:(t,e)=>l(s||u(e),t)}function tS(t){const e=IE(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function eS(t,e){const{labelFormatter:n=t=>`${t}`}=t,{scales:r,theme:i}=e,a=function(t,e){const n=IE(t,"size");return n instanceof no?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),o={itemMarker:JE(Object.assign(Object.assign({},t),{itemMarkerSize:a}),e),itemMarkerSize:a,itemMarkerOpacity:tS(r)},s="string"==typeof n?AE(n):n,c=IE(r,"color"),l=function(t){return t.find((t=>t.getOptions().domain.length>0)).getOptions().domain}(r),u=c?t=>c.map(t):()=>e.theme.color;return Object.assign(Object.assign({},o),{data:l.map((t=>({id:t,label:s(t),color:u(t)})))})}QE.props=Object.assign(Object.assign({},qE.props),{defaultPosition:"center"});const nS=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,cols:c,itemMarker:l}=t,u=Ce(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:f}=u;return e=>{const{value:r,theme:i}=e,{bbox:o}=r,{width:l,height:h}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:a}=BE(t,e,n);return{width:i,height:a}}(r,t,nS),d=NE(a,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(a)?"vertical":"horizontal",width:l,height:h,layout:void 0!==c?"grid":"flex"},void 0!==c&&{gridCol:c}),void 0!==f&&{gridRow:f}),{titleText:LE(s)}),eS(t,e)),{legendCategory:g={}}=i,v=FE(Object.assign({},g,p,u)),m=new RE({style:Object.assign(Object.assign({x:o.x,y:o.y,width:o.width,height:o.height},d),{subOptions:v})});return m.appendChild(new $k({className:"legend-category",style:v})),m}};function rS(t,e,n,r,i){const a=e.thresholds,o=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...a,r].map(o)})}function iS(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],Fr(e)];return[n,r]}function aS(t,e,n,r,i,a){const{length:o}=t,s=n||r,c=i.color?a.legendContinuous.ribbonFill||"black":a.color,l=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[dh(e).toString()]})),r}(s,c),[u,f]=iS(l),[h,d]=iS([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Ha))));return Object.assign(Object.assign({},t),{domain:[h,d],data:l.getTicks().map((t=>({value:t}))),color:new Array(Math.floor(o)).fill(0).map(((t,e)=>{const n=(f-u)/(o-1)*e+u,i=l.map(n)||c,a=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,((t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${a})`))}))})}function oS(t,e,n,r,i,a){const o=IE(t,"color"),s=function(t,e,n){const{size:r}=e,i=BE(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(o instanceof ho){const{range:t}=o.getOptions(),[e,n]=iS(o);return o instanceof vo||o instanceof yo?rS(s,o,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map(((t,e)=>({value:e,label:t})));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,o,t)}return aS(s,o,IE(t,"size"),IE(t,"opacity"),e,a)}nS.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const sS=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,style:c,crossPadding:l,padding:u}=t,f=Ce(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:o,scale:l})=>{const{bbox:u}=i,{x:h,y:d,width:p,height:g}=u,v=NE(a,n),{legendContinuous:m={}}=o,y=FE(Object.assign({},m,Object.assign(Object.assign({titleText:LE(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>AE(e)(t.label):e},oS(r,l,i,t,sS,o)),c),f)),b=new jE({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},v),{subOptions:y})});return b.appendChild(new ew({className:"legend-continuous",style:y})),b}};sS.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const cS=t=>(...e)=>sS(Object.assign({},{block:!0},t))(...e);cS.props=Object.assign(Object.assign({},sS.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const lS=t=>e=>{const{scales:n}=e,r=IE(n,"size");return sS(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};lS.props=Object.assign(Object.assign({},sS.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const uS=t=>lS(Object.assign({},{block:!0},t));function fS(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}uS.props=Object.assign(Object.assign({},sS.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const hS=(dS={render(t,e){const{width:n,title:r,subtitle:i,spacing:a=2,align:o="left",x:s,y:c}=t,l=Ce(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=Tr(l,"title"),f=Tr(l,"subtitle"),h=CE(e,".title","text").attr("className","title").call(ym,Object.assign(Object.assign(Object.assign({},fS(0,0,n,o)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();CE(e,".sub-title","text").attr("className","sub-title").call((t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},fS(0,h.max[1]+a,n,o)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends Bg{constructor(t){super(t),this.descriptor=dS}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(K({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var dS;const pS=t=>({value:e,theme:n})=>{const{x:r,y:i,width:a,height:o}=e.bbox;return new hS({style:K({},n.title,Object.assign({x:r,y:i,width:a,height:o},t))})};function gS(t){return!!t.getBandWidth}function vS(t,e,n){if(!gS(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),a=n?-1:0,o=t.getStep(),s=n?r:r.map((t=>t+o)),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(Fn(s,e)+a,0,i.length-1);return i[c]}function mS(t,e,n){if(!e)return t.getOptions().domain;if(!gS(t)){const r=tr(e);if(!n)return r;const[i]=r,{range:a}=t.getOptions(),[o,s]=a,c=o>s?-1:1;return[i,t.invert(t.map(i)+c*n)]}const{domain:r}=t.getOptions(),i=e[0],a=r.indexOf(i);if(n){const t=a+Math.round(r.length*n);return r.slice(a,t)}const o=e[e.length-1],s=r.indexOf(o);return r.slice(a,s+1)}function yS(t,e,n,r,i,a){const{x:o,y:s}=i,c=(t,e)=>{const[n,r]=a.invert(t);return[vS(o,n,e),vS(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[mS(o,[l[0],u[0]]),mS(s,[l[1],u[1]])]}function bS(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}pS.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const xS=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:a}=t,o=Ce(t,["orientation","labelFormatter","size","style","position"]);return r=>{var s;const{scales:[c],value:l,theme:u,coordinate:f}=r,{bbox:h}=l,{width:d,height:p}=h,{slider:g={}}=u,v=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),m="string"==typeof n?AE(n):n,y="horizontal"===e,b=Gc(f)&&y,{trackSize:x=g.trackSize}=i,[k,w]=function(t,e,n){const{x:r,y:i,width:a,height:o}=t;return"left"===e?[r+a-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+o-n]:void 0}(h,a,x);return new Ex({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:k,y:w,trackLength:y?d:p,orientation:e,formatter:t=>(m||v)(vS(c,b?1-t:t,!0)),sparklineData:kS(t,r)},i),o))})}};function kS(t,e){const{markState:n}=e;return x(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter((([t])=>"line"===t.type||"area"===t.type)).filter((([t])=>t.slider)).map((([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}}));if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce(((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t)),{});return Object.values(r)}(n,["y","series"])}xS.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const wS=t=>xS(Object.assign(Object.assign({},t),{orientation:"horizontal"}));wS.props=Object.assign(Object.assign({},xS.props),{defaultPosition:"bottom"});const MS=t=>xS(Object.assign(Object.assign({},t),{orientation:"vertical"}));MS.props=Object.assign(Object.assign({},xS.props),{defaultPosition:"left"});const OS=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Ce(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:a})=>{const{bbox:o}=n,{x:s,y:c,width:l,height:u}=o,{scrollbar:f={}}=a,{ratio:h,range:d}=t.getOptions(),p="horizontal"===e?l:u,g=p/h,[v,m]=d,y=m>v?0:1;return new Sx({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:y}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};OS.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const ES=t=>OS(Object.assign(Object.assign({},t),{orientation:"horizontal"}));ES.props=Object.assign(Object.assign({},OS.props),{defaultPosition:"bottom"});const SS=t=>OS(Object.assign(Object.assign({},t),{orientation:"vertical"}));SS.props=Object.assign(Object.assign({},OS.props),{defaultPosition:"left"});const AS=t=>()=>new zg;AS.props={};const _S=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a.style,[u,f]=Gc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return a.animate(h,Object.assign(Object.assign({},i),t))}},TS=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a.style,[u,f]=Gc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(h,Object.assign(Object.assign({},i),t))}},PS=(t,e)=>{const n=1e-4,{coordinate:r}=e;return nv({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:_f.NUMBER}),(e,i,a)=>{const[o]=e;return Wc(r)?(e=>{const{__data__:i,style:o}=e,{radius:s=0,inset:c=0,fillOpacity:l=1,strokeOpacity:u=1,opacity:f=1}=o,{points:h,y:d,y1:p}=i,g=wm(r,h,[d,p]),{innerRadius:v,outerRadius:m}=g,y=oc().cornerRadius(s).padAngle(c*Math.PI/180),b=new qg({}),x=t=>(b.attr({d:y(t)}),Hh(b)),k=[{scaleInYRadius:v+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:v+n,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.01},{scaleInYRadius:m,fillOpacity:l,strokeOpacity:u,opacity:f}],w=e.animate(k,Object.assign(Object.assign({},a),t));return w.onframe=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:Number(e.style.scaleInYRadius)}))},w.onfinish=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:m}))},w})(o):(e=>{const{style:n}=e,{transform:i="",fillOpacity:o=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=Gc(r)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],f=[{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c,offset:.01},{transform:`${i} scale(1, 1)`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c}];return e.animate(f,Object.assign(Object.assign({},a),t))})(o)}},CS=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[a]=e,{transform:o="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a.style,[u,f]=Gc(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{transform:`${o} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${o} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(h,Object.assign(Object.assign({},i),t))}},LS=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:a,strokeOpacity:o,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};LS.props={};const NS=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,c=[{fillOpacity:a,strokeOpacity:o,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};NS.props={};const jS={opacity:1,strokeOpacity:1,fillOpacity:1,lineWidth:0,x:0,y:0,cx:0,cy:0,r:0,rx:0,ry:0,width:0,height:0},RS={[Du.CIRCLE]:["cx","cy","r"],[Du.ELLIPSE]:["cx","cy","rx","ry"],[Du.RECT]:["x","y","width","height"],[Du.IMAGE]:["x","y","width","height"],[Du.LINE]:["x1","y1","x2","y2"],[Du.POLYLINE]:["points"],[Du.POLYGON]:["points"]};function IS(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=jS[i])}return r}const DS=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function BS(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[a,o]=n;return[r,i,a-r,o-i]}function FS(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function zS(t,e){const[n,r,i,a]=BS(t),o=a/i,s=Math.ceil(Math.sqrt(e/o)),c=[],l=a/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,a=r+u*l;c.push(FS([t,a,e,l]))}f-=t,u+=1}return c}function GS(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function WS(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function $S(t){const e=Hh(t);if(e&&!function(t){return!WS(t,"m")||!WS(t,"M")}(e))return e}function YS(t){const{nodeName:e}=t;if("path"===e){const e=et(t,"attributes");return e.markerEnd||e.markerStart}return!1}function HS(t,e,n,r){const{nodeName:i}=e,{nodeName:a}=n,o=$S(e),s=$S(n),c=i===a&&"path"!==i,l=void 0===o||void 0===s,u=YS(e)||YS(n);if(c||l||u)return function(t,e,n){let{transform:r}=t.style;const{transform:i}=e.style;GS(e,t);let a=DS;if(t.nodeName===Du.GROUP){const[n,i,a,o]=BS(t),[s,c,l,u]=BS(e);r=`translate(${n-s}, ${i-c}) scale(${a/l}, ${o/u})`}else a=a.concat(RS[t.nodeName]||[]);const o=[Object.assign({transform:null!=r?r:"none"},IS(t,a,!0)),Object.assign({transform:null!=i?i:"none"},IS(e,a,!0))];return e.animate(o,n)}(e,n,r);const f=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new qg({style:Object.assign(Object.assign({},IS(t,DS)),{d:e})});return GS(r,t),r}(t,o),h=[Object.assign({},IS(e,DS)),Object.assign({},IS(n,DS))];if(o!==s){h[0].d=o,h[1].d=s;const t=f.animate(h,r);return t.onfinish=()=>{const t=f.style.d;Sr(f,n),f.style.d=t,f.style.transform="none"},f.style.transform="none",t}return null}const VS=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:zS}(t.split),a=Object.assign(Object.assign({},r),t),{length:o}=e,{length:s}=n;if(1===o&&1===s||o>1&&s>1){const[t]=e,[r]=n;return HS(t,t,r,a)}if(1===o&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map(((e,r)=>HS(e,new qg({style:Object.assign({d:i[r]},IS(t,DS))}),e,n)))}(t,n,a,i)}if(o>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:a,strokeOpacity:o,opacity:s}],l=e.animate(c,n),u=t.map(((t,r)=>HS(t,t,new qg({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,a,i)}return null};VS.props={};const qS=(t,e)=>{const n=1e-4;nv({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:_f.NUMBER});const{coordinate:r}=e;return(i,a,o)=>{const[s]=i;if(!Wc(r))return _S(t,e)(i,a,o);const{__data__:c,style:l}=s,{radius:u=0,inset:f=0,fillOpacity:h=1,strokeOpacity:d=1,opacity:p=1}=l,{points:g,y:v,y1:m}=c,y=oc().cornerRadius(u).padAngle(f*Math.PI/180),b=wm(r,g,[v,m]),{startAngle:x,endAngle:k}=b,w=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:h,strokeOpacity:d,opacity:p,offset:.01},{waveInArcAngle:k,fillOpacity:h,strokeOpacity:d,opacity:p}],M=s.animate(w,Object.assign(Object.assign({},o),t));return M.onframe=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.d=y(Object.assign(Object.assign({},b),{endAngle:k}))},M}};qS.props={};const US=t=>(e,n,r)=>{const[i]=e,{transform:a="",fillOpacity:o=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c,offset:.01},{transform:`${a} scale(1)`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c}];return i.animate(u,Object.assign(Object.assign({},r),t))},XS=t=>(e,n,r)=>{const[i]=e,{transform:a="",fillOpacity:o=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${a} scale(1)`.trimStart(),transformOrigin:l},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:o,strokeOpacity:s,opacity:c,offset:.99},{transform:`${a} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},ZS=t=>(e,n,r)=>{var i,a;const[o]=e,s=(null===(a=(i=o).getTotalLength)||void 0===a?void 0:a.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return o.animate(c,Object.assign(Object.assign({},r),t))};ZS.props={};const KS=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:c}=a.getLocalBounds(),l=2*c[0],u=2*c[1],f=new qg({style:{d:`M${o},${s}L${o+l},${s}L${o+l},${s+u}L${o},${s+u}Z`}});a.appendChild(f),a.style.clipPath=f;return _S(t,e)([f],r,i)};KS.props={};const QS=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:c}=a.getLocalBounds(),l=2*c[0],u=2*c[1],f=new qg({style:{d:`M${o},${s}L${o+l},${s}L${o+l},${s+u}L${o},${s+u}Z`}});a.appendChild(f),a.style.clipPath=f;return PS(t,e)([f],r,i)};QS.props={};const JS="main-layer",tA="label-layer",eA="element",nA="view",rA="plot",iA="component",aA="label",oA="area";
11
11
  /*!
12
12
  * @antv/g-plugin-canvas-path-generator
13
13
  * @description A G plugin of path generator with Canvas2D API
14
- * @version 2.1.9
15
- * @date 11/27/2024, 2:17:06 PM
14
+ * @version 2.1.15
15
+ * @date 1/17/2025, 2:06:42 PM
16
16
  * @author AntVis
17
17
  * @docs https://g.antv.antgroup.com/
18
18
  */
19
- function sA(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc(r,a,o,0,2*Math.PI,!1)}function cA(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,a,o,s,0,0,2*Math.PI,!1);else{var c=o>s?o:s,l=o>s?1:o/s,u=o>s?s/o:1;t.save(),t.scale(l,u),t.arc(r,a,c,0,2*Math.PI)}}function lA(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=0,d=0,p=0,g=0,v=0;c&&Pg(c)&&u&&(n=o-i,r=s-a,v=Math.atan2(r,n),h=Math.cos(v)*(u||0),d=Math.sin(v)*(u||0)),l&&Pg(l)&&f&&(n=i-o,r=a-s,v=Math.atan2(r,n),p=Math.cos(v)*(f||0),g=Math.sin(v)*(f||0)),t.moveTo(i+h,a+d),t.lineTo(o+p,s+g)}function uA(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,c=e.d,l=c.absolutePath,u=c.segments,f=0,h=0,d=0,p=0,g=0;if(i&&Pg(i)&&o){var v=dl(i.parentNode.getStartTangent(),2),m=v[0],y=v[1];n=m[0]-y[0],r=m[1]-y[1],g=Math.atan2(r,n),f=Math.cos(g)*(o||0),h=Math.sin(g)*(o||0)}if(a&&Pg(a)&&s){var b=dl(a.parentNode.getEndTangent(),2),x=b[0],k=b[1];n=x[0]-k[0],r=x[1]-k[1],g=Math.atan2(r,n),d=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var w=0;w<l.length;w++){var M=l[w],O=M[0],E=l[w+1],S=0===w&&(0!==f||0!==h),A=(w===l.length-1||E&&("M"===E[0]||"Z"===E[0]))&&0!==d&&0!==p,_=dl(S?[f,h]:[0,0],2),T=_[0],P=_[1],C=dl(A?[d,p]:[0,0],2),L=C[0],N=C[1];switch(O){case"M":t.moveTo(M[1]+T,M[2]+P);break;case"L":t.lineTo(M[1]+L,M[2]+N);break;case"Q":t.quadraticCurveTo(M[1],M[2],M[3]+L,M[4]+N);break;case"C":t.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+L,M[6]+N);break;case"A":var j=u[w].arcParams,R=j.cx,I=j.cy,D=j.rx,B=j.ry,F=j.startAngle,z=j.endAngle,G=j.xRotation,W=j.sweepFlag;if(t.ellipse)t.ellipse(R,I,D,B,G,F,z,!!(1-W));else{var $=D>B?D:B,Y=D>B?1:D/B,H=D>B?B/D:1;t.translate(R,I),t.rotate(G),t.scale(Y,H),t.arc(0,0,$,F,z,!!(1-W)),t.scale(1/Y,1/H),t.rotate(-G),t.translate(-R,-I)}A&&t.lineTo(M[6]+d,M[7]+p);break;case"Z":t.closePath()}}}function fA(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,v=0,m=0,y=0;i&&Pg(i)&&o&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&Pg(a)&&s&&(n=c[l-1][0]-c[0][0],r=c[l-1][1]-c[0][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+(p||v),f+(g||m));for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h,d)}function hA(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,v=0,m=0,y=0;i&&Pg(i)&&o&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&Pg(a)&&s&&(n=c[l-2][0]-c[l-1][0],r=c[l-2][1]-c[l-1][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+p,f+g);for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h+v,d+m)}function dA(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,a=void 0===i?0:i,o=e.radius,s=e.width,c=e.height,l=s,u=c;if(o&&o.some((function(t){return 0!==t}))){var f=s>0?1:-1,h=c>0?1:-1,d=f+h===0,p=dl(o.map((function(t){return N(t,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))})),4),g=p[0],v=p[1],m=p[2],y=p[3];t.moveTo(f*g+r,a),t.lineTo(l-f*v+r,a),0!==v&&t.arc(l-f*v+r,h*v+a,v,-h*Math.PI/2,f>0?0:Math.PI,d),t.lineTo(l+r,u-h*m+a),0!==m&&t.arc(l-f*m+r,u-h*m+a,m,f>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,d),t.lineTo(f*y+r,u+a),0!==y&&t.arc(f*y+r,u-h*y+a,y,h>0?Math.PI/2:-Math.PI/2,f>0?Math.PI:0,d),t.lineTo(r,h*g+a),0!==g&&t.arc(f*g+r,h*g+a,g,f>0?Math.PI:0,h>0?1.5*Math.PI:Math.PI/2,d)}else t.rect(r,a,l,u)}var pA=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).name="canvas-path-generator",t}return hl(e,t),rl(e,[{key:"init",value:function(){var t,e=(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(t={},Iu.CIRCLE,sA),Iu.ELLIPSE,cA),Iu.RECT,dA),Iu.LINE,lA),Iu.POLYLINE,hA),Iu.POLYGON,fA),Iu.PATH,uA),Iu.TEXT,void 0),Iu.GROUP,void 0),Iu.IMAGE,void 0),Qc(Qc(Qc(t,Iu.HTML,void 0),Iu.MESH,void 0),Iu.FRAGMENT,void 0));this.context.pathGeneratorFactory=e}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(Bu),gA=Ut(),vA=Ut(),mA=Ut(),yA=ft(),bA=function(){function t(){var e=this;el(this,t),this.isHit=function(t,n,r,i){var a=e.context.pointInPathPickerFactory[t.nodeName];if(a){var o=yt(yA,r),s=se(vA,Jt(mA,n[0],n[1],0),o);if(a(t,new Zu(s[0],s[1]),i,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var r=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),i=e.context.pathGeneratorFactory[t.nodeName];return i&&(r.beginPath(),i(r,t.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return rl(t,[{key:"apply",value:function(e,n){var r,i=this,a=e.renderingService,o=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=o.root)||void 0===r?void 0:r.ownerDocument;a.hooks.pick.tapPromise(t.tag,function(){var t=Cu(Tu().mark((function t(e){return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",i.pick(s,e));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),a.hooks.pickSync.tap(t.tag,(function(t){return i.pick(s,t)}))}},{key:"pick",value:function(t,e){var n,r=e.topmost,i=e.position,a=i.x,o=i.y,s=Jt(gA,a,o,0),c=[],l=Lu(t.elementsFromBBox(s[0],s[1],s[0],s[1]));try{for(l.s();!(n=l.n()).done;){var u=n.value,f=u.getWorldTransform();if(this.isHit(u,s,f,!1)){var h=Wd(u);if(h){var d=h.parsedStyle.clipPath;if(this.isHit(d,s,d.getWorldTransform(),!0)){if(r)return e.picked=[u],e;c.push(u)}}else{if(r)return e.picked=[u],e;c.push(u)}}}}catch(t){l.e(t)}finally{l.f()}return e.picked=c,e}}])}();
19
+ function sA(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc(r,a,o,0,2*Math.PI,!1)}function cA(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,a,o,s,0,0,2*Math.PI,!1);else{var c=o>s?o:s,l=o>s?1:o/s,u=o>s?s/o:1;t.save(),t.scale(l,u),t.arc(r,a,c,0,2*Math.PI)}}function lA(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=0,d=0,p=0,g=0,v=0;c&&Pg(c)&&u&&(n=o-i,r=s-a,v=Math.atan2(r,n),h=Math.cos(v)*(u||0),d=Math.sin(v)*(u||0)),l&&Pg(l)&&f&&(n=i-o,r=a-s,v=Math.atan2(r,n),p=Math.cos(v)*(f||0),g=Math.sin(v)*(f||0)),t.moveTo(i+h,a+d),t.lineTo(o+p,s+g)}function uA(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,c=e.d,l=c.absolutePath,u=c.segments,f=0,h=0,d=0,p=0,g=0;if(i&&Pg(i)&&o){var v=pl(i.parentNode.getStartTangent(),2),m=v[0],y=v[1];n=m[0]-y[0],r=m[1]-y[1],g=Math.atan2(r,n),f=Math.cos(g)*(o||0),h=Math.sin(g)*(o||0)}if(a&&Pg(a)&&s){var b=pl(a.parentNode.getEndTangent(),2),x=b[0],k=b[1];n=x[0]-k[0],r=x[1]-k[1],g=Math.atan2(r,n),d=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var w=0;w<l.length;w++){var M=l[w],O=M[0],E=l[w+1],S=0===w&&(0!==f||0!==h),A=(w===l.length-1||E&&("M"===E[0]||"Z"===E[0]))&&0!==d&&0!==p,_=pl(S?[f,h]:[0,0],2),T=_[0],P=_[1],C=pl(A?[d,p]:[0,0],2),L=C[0],N=C[1];switch(O){case"M":t.moveTo(M[1]+T,M[2]+P);break;case"L":t.lineTo(M[1]+L,M[2]+N);break;case"Q":t.quadraticCurveTo(M[1],M[2],M[3]+L,M[4]+N);break;case"C":t.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+L,M[6]+N);break;case"A":var j=u[w].arcParams,R=j.cx,I=j.cy,D=j.rx,B=j.ry,F=j.startAngle,z=j.endAngle,G=j.xRotation,W=j.sweepFlag;if(t.ellipse)t.ellipse(R,I,D,B,G,F,z,!!(1-W));else{var $=D>B?D:B,Y=D>B?1:D/B,H=D>B?B/D:1;t.translate(R,I),t.rotate(G),t.scale(Y,H),t.arc(0,0,$,F,z,!!(1-W)),t.scale(1/Y,1/H),t.rotate(-G),t.translate(-R,-I)}A&&t.lineTo(M[6]+d,M[7]+p);break;case"Z":t.closePath()}}}function fA(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,v=0,m=0,y=0;i&&Pg(i)&&o&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&Pg(a)&&s&&(n=c[l-1][0]-c[0][0],r=c[l-1][1]-c[0][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+(p||v),f+(g||m));for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h,d)}function hA(t,e){var n,r,i=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,v=0,m=0,y=0;i&&Pg(i)&&o&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&Pg(a)&&s&&(n=c[l-2][0]-c[l-1][0],r=c[l-2][1]-c[l-1][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+p,f+g);for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h+v,d+m)}function dA(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,a=void 0===i?0:i,o=e.radius,s=e.width,c=e.height,l=s,u=c;if(o&&o.some((function(t){return 0!==t}))){var f=s>0?1:-1,h=c>0?1:-1,d=f+h===0,p=pl(o.map((function(t){return j(t,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))})),4),g=p[0],v=p[1],m=p[2],y=p[3];t.moveTo(f*g+r,a),t.lineTo(l-f*v+r,a),0!==v&&t.arc(l-f*v+r,h*v+a,v,-h*Math.PI/2,f>0?0:Math.PI,d),t.lineTo(l+r,u-h*m+a),0!==m&&t.arc(l-f*m+r,u-h*m+a,m,f>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,d),t.lineTo(f*y+r,u+a),0!==y&&t.arc(f*y+r,u-h*y+a,y,h>0?Math.PI/2:-Math.PI/2,f>0?Math.PI:0,d),t.lineTo(r,h*g+a),0!==g&&t.arc(f*g+r,h*g+a,g,f>0?Math.PI:0,h>0?1.5*Math.PI:Math.PI/2,d)}else t.rect(r,a,l,u)}var pA=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).name="canvas-path-generator",t}return dl(e,t),il(e,[{key:"init",value:function(){var t,e=(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(t={},Du.CIRCLE,sA),Du.ELLIPSE,cA),Du.RECT,dA),Du.LINE,lA),Du.POLYLINE,hA),Du.POLYGON,fA),Du.PATH,uA),Du.TEXT,void 0),Du.GROUP,void 0),Du.IMAGE,void 0),Jc(Jc(Jc(t,Du.HTML,void 0),Du.MESH,void 0),Du.FRAGMENT,void 0));this.context.pathGeneratorFactory=e}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(Fu),gA=Xt(),vA=Xt(),mA=Xt(),yA=ht(),bA=function(){function t(){var e=this;nl(this,t),this.isHit=function(t,n,r,i){var a=e.context.pointInPathPickerFactory[t.nodeName];if(a){var o=bt(yA,r),s=ce(vA,te(mA,n[0],n[1],0),o);if(a(t,new Ku(s[0],s[1]),i,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var r=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),i=e.context.pathGeneratorFactory[t.nodeName];return i&&(r.beginPath(),i(r,t.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return il(t,[{key:"apply",value:function(e,n){var r,i=this,a=e.renderingService,o=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=o.root)||void 0===r?void 0:r.ownerDocument;a.hooks.pick.tapPromise(t.tag,function(){var t=Lu(Pu().mark((function t(e){return Pu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",i.pick(s,e));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),a.hooks.pickSync.tap(t.tag,(function(t){return i.pick(s,t)}))}},{key:"pick",value:function(t,e){var n,r=e.topmost,i=e.position,a=i.x,o=i.y,s=te(gA,a,o,0),c=[],l=Nu(t.elementsFromBBox(s[0],s[1],s[0],s[1]));try{for(l.s();!(n=l.n()).done;){var u=n.value,f=u.getWorldTransform();if(this.isHit(u,s,f,!1)){var h=Wd(u);if(h){var d=h.parsedStyle.clipPath;if(this.isHit(d,s,d.getWorldTransform(),!0)){if(r)return e.picked=[u],e;c.push(u)}}else{if(r)return e.picked=[u],e;c.push(u)}}}}catch(t){l.e(t)}finally{l.f()}return e.picked=c,e}}])}();
20
20
  /*!
21
21
  * @antv/g-plugin-canvas-picker
22
22
  * @description A G plugin for picking in canvas
23
- * @version 2.1.11
24
- * @date 11/27/2024, 2:19:07 PM
23
+ * @version 2.1.17
24
+ * @date 1/17/2025, 2:08:48 PM
25
25
  * @author AntVis
26
26
  * @docs https://g.antv.antgroup.com/
27
- */function xA(t,e,n){var r=t.parsedStyle,i=r.cx,a=void 0===i?0:i,o=r.cy,s=void 0===o?0:o,c=r.r,l=r.fill,u=r.stroke,f=r.lineWidth,h=void 0===f?1:f,d=r.increasedLineWidthForHitTesting,p=void 0===d?0:d,g=r.pointerEvents,v=void 0===g?"auto":g,m=(h+p)/2,y=fu(a,s,e.x,e.y),b=dl(qd(v,l,u),2),x=b[0],k=b[1];return x&&k||n?y<=c+m:x?y<=c:!!k&&(y>=c-m&&y<=c+m)}function kA(t,e,n,r){return t/(n*n)+e/(r*r)}function wA(t,e,n){var r=t.parsedStyle,i=r.cx,a=void 0===i?0:i,o=r.cy,s=void 0===o?0:o,c=r.rx,l=r.ry,u=r.fill,f=r.stroke,h=r.lineWidth,d=void 0===h?1:h,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,v=r.pointerEvents,m=void 0===v?"auto":v,y=e.x,b=e.y,x=dl(qd(m,u,f),2),k=x[0],w=x[1],M=(d+g)/2,O=(y-a)*(y-a),E=(b-s)*(b-s);return k&&w||n?kA(O,E,c+M,l+M)<=1:k?kA(O,E,c,l)<=1:!!w&&(kA(O,E,c-M,l-M)>=1&&kA(O,E,c+M,l+M)<=1)}function MA(t,e,n,r,i,a){return i>=t&&i<=t+n&&a>=e&&a<=e+r}function OA(t,e,n,r,i,a,o,s){var c=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return fu(l.x,l.y,o,s)<=a/2}function EA(t,e,n,r,i,a,o){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return a>=s-f&&a<=c+f&&o>=l-f&&o<=u+f&&bu(t,e,n,r,a,o)<=i/2}function SA(t,e,n,r,i){var a=t.length;if(a<2)return!1;for(var o=0;o<a-1;o++){if(EA(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[a-1];if(EA(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}bA.tag="CanvasPicker";function AA(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function _A(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function TA(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=t[a],s=t[(a+1)%i];if(_A(o,s,[e,n]))return!0;AA(o[1]-n)>0!=AA(s[1]-n)>0&&AA(e-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function PA(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=TA(t[i],e,n))break}return r}function CA(t,e,n){var r=t.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2,c=r.lineWidth,l=void 0===c?1:c,u=r.increasedLineWidthForHitTesting,f=void 0===u?0:u,h=r.pointerEvents;return!(!dl(qd(void 0===h?"auto":h,r.fill,r.stroke),2)[1]&&!n||!l)&&EA(i,a,o,s,l+f,e.x,e.y)}function LA(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,c=void 0===s?1:s,l=o.increasedLineWidthForHitTesting,u=void 0===l?0:l,f=o.stroke,h=o.fill,d=o.d,p=o.pointerEvents,g=void 0===p?"auto":p,v=d.segments,m=d.hasArc,y=d.polylines,b=d.polygons,x=dl(qd(g,(null==b?void 0:b.length)&&h,f),2),k=x[0],w=x[1],M=Lh(t),O=!1;return k||n?O=m?r(t,e):PA(b,e.x,e.y)||PA(y,e.x,e.y):((w||n)&&(O=function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,h=c.box;if(!h||MA(h.x-o,h.y-o,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(a=EA(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(a=_u(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=Mu(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=nn(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,p=f,g=0;g<d.length;g+=6){var v=Mu(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i);if(p=[d[g+4],d[g+5]],a=v<=e/2)return!0}}}return a}(v,c+u,e.x,e.y,M)),O)}function NA(t,e,n){var r=t.parsedStyle,i=r.stroke,a=r.fill,o=r.lineWidth,s=void 0===o?1:o,c=r.increasedLineWidthForHitTesting,l=void 0===c?0:c,u=r.points,f=r.pointerEvents,h=dl(qd(void 0===f?"auto":f,a,i),2),d=h[0],p=!1;return(h[1]||n)&&(p=SA(u.points,s+l,e.x,e.y,!0)),p||!d&&!n||(p=TA(u.points,e.x,e.y)),p}function jA(t,e,n){var r=t.parsedStyle,i=r.lineWidth,a=void 0===i?1:i,o=r.increasedLineWidthForHitTesting,s=void 0===o?0:o,c=r.points,l=r.pointerEvents;return!(!dl(qd(void 0===l?"auto":l,r.fill,r.stroke),2)[1]&&!n||!a)&&SA(c.points,a+s,e.x,e.y,!1)}function RA(t,e,n,r,i){var a=t.parsedStyle,o=a.radius,s=a.fill,c=a.stroke,l=a.lineWidth,u=void 0===l?1:l,f=a.increasedLineWidthForHitTesting,h=void 0===f?0:f,d=a.x,p=void 0===d?0:d,g=a.y,v=void 0===g?0:g,m=a.width,y=a.height,b=a.pointerEvents,x=dl(qd(void 0===b?"auto":b,s,c),2),k=x[0],w=x[1],M=u+h;if(o&&o.some((function(t){return 0!==t}))){var O=!1;return(w||n)&&(O=function(t,e,n,r,i,a,o,s){var c=dl(i,4),l=c[0],u=c[1],f=c[2],h=c[3];return EA(t+l,e,t+n-u,e,a,o,s)||EA(t+n,e+u,t+n,e+r-f,a,o,s)||EA(t+n-f,e+r,t+h,e+r,a,o,s)||EA(t,e+r-h,t,e+l,a,o,s)||OA(t+n-u,e+u,u,Math.PI,Math.PI,a,o,s)||OA(t+n-f,e+r-f,f,0,Math.PI,a,o,s)||OA(t+h,e+r-h,h,Math.PI,Math.PI,a,o,s)||OA(t+l,e+l,l,Math.PI,Math.PI,a,o,s)}(p,v,m,y,o.map((function(t){return N(t,0,Math.min(Math.abs(m)/2,Math.abs(y)/2))})),M,e.x,e.y)),O||!k&&!n||(O=r(t,e)),O}var E=M/2;return k&&w||n?MA(p-E,v-E,m+E,y+E,e.x,e.y):k?MA(p,v,m,y,e.x,e.y):!!w&&function(t,e,n,r,i,a,o){var s=i/2;return MA(t-s,e-s,n,i,a,o)||MA(t+n-s,e-s,i,r,a,o)||MA(t+s,e+r-s,n,i,a,o)||MA(t-s,e+s,i,r,a,o)}(p,v,m,y,M,e.x,e.y)}function IA(t,e,n,r,i,a){var o=t.parsedStyle,s=o.pointerEvents,c=void 0===s?"auto":s,l=o.x,u=void 0===l?0:l,f=o.y,h=void 0===f?0:f,d=o.width,p=o.height;if("non-transparent-pixel"===c){var g=i.config.offscreenCanvas,v=a.offscreenCanvasCreator.getOrCreateCanvas(g),m=a.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});return v.width=d,v.height=p,i.defaultStyleRendererFactory[Iu.IMAGE].render(m,tl(tl({},t.parsedStyle),{},{x:0,y:0}),t,void 0,void 0,void 0),m.getImageData(e.x-u,e.y-h,1,1).data.every((function(t){return 0!==t}))}return!0}function DA(t,e,n,r){var i=t.getGeometryBounds();return e.x>=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var BA=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).name="canvas-picker",t}return hl(e,t),rl(e,[{key:"init",value:function(){var t,e=(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(t={},Iu.CIRCLE,xA),Iu.ELLIPSE,wA),Iu.RECT,RA),Iu.LINE,CA),Iu.POLYLINE,jA),Iu.POLYGON,NA),Iu.PATH,LA),Iu.TEXT,DA),Iu.GROUP,null),Iu.IMAGE,IA),Qc(Qc(t,Iu.HTML,null),Iu.MESH,null));this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new bA)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(Bu);function FA(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var zA=0;function GA(t){return"__private_"+zA+++"_"+t}
27
+ */function xA(t,e,n){var r=t.parsedStyle,i=r.cx,a=void 0===i?0:i,o=r.cy,s=void 0===o?0:o,c=r.r,l=r.fill,u=r.stroke,f=r.lineWidth,h=void 0===f?1:f,d=r.increasedLineWidthForHitTesting,p=void 0===d?0:d,g=r.pointerEvents,v=void 0===g?"auto":g,m=(h+p)/2,y=hu(a,s,e.x,e.y),b=pl(qd(v,l,u),2),x=b[0],k=b[1];return x&&k||n?y<=c+m:x?y<=c:!!k&&(y>=c-m&&y<=c+m)}function kA(t,e,n,r){return t/(n*n)+e/(r*r)}function wA(t,e,n){var r=t.parsedStyle,i=r.cx,a=void 0===i?0:i,o=r.cy,s=void 0===o?0:o,c=r.rx,l=r.ry,u=r.fill,f=r.stroke,h=r.lineWidth,d=void 0===h?1:h,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,v=r.pointerEvents,m=void 0===v?"auto":v,y=e.x,b=e.y,x=pl(qd(m,u,f),2),k=x[0],w=x[1],M=(d+g)/2,O=(y-a)*(y-a),E=(b-s)*(b-s);return k&&w||n?kA(O,E,c+M,l+M)<=1:k?kA(O,E,c,l)<=1:!!w&&(kA(O,E,c-M,l-M)>=1&&kA(O,E,c+M,l+M)<=1)}function MA(t,e,n,r,i,a){return i>=t&&i<=t+n&&a>=e&&a<=e+r}function OA(t,e,n,r,i,a,o,s){var c=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return hu(l.x,l.y,o,s)<=a/2}function EA(t,e,n,r,i,a,o){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return a>=s-f&&a<=c+f&&o>=l-f&&o<=u+f&&xu(t,e,n,r,a,o)<=i/2}function SA(t,e,n,r,i){var a=t.length;if(a<2)return!1;for(var o=0;o<a-1;o++){if(EA(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[a-1];if(EA(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}bA.tag="CanvasPicker";function AA(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function _A(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function TA(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=t[a],s=t[(a+1)%i];if(_A(o,s,[e,n]))return!0;AA(o[1]-n)>0!=AA(s[1]-n)>0&&AA(e-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function PA(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=TA(t[i],e,n))break}return r}function CA(t,e,n){var r=t.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2,c=r.lineWidth,l=void 0===c?1:c,u=r.increasedLineWidthForHitTesting,f=void 0===u?0:u,h=r.pointerEvents;return!(!pl(qd(void 0===h?"auto":h,r.fill,r.stroke),2)[1]&&!n||!l)&&EA(i,a,o,s,l+f,e.x,e.y)}function LA(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,c=void 0===s?1:s,l=o.increasedLineWidthForHitTesting,u=void 0===l?0:l,f=o.stroke,h=o.fill,d=o.d,p=o.pointerEvents,g=void 0===p?"auto":p,v=d.segments,m=d.hasArc,y=d.polylines,b=d.polygons,x=pl(qd(g,(null==b?void 0:b.length)&&h,f),2),k=x[0],w=x[1],M=Nh(t),O=!1;return k||n?O=m?r(t,e):PA(b,e.x,e.y)||PA(y,e.x,e.y):((w||n)&&(O=function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,h=c.box;if(!h||MA(h.x-o,h.y-o,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(a=EA(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(a=Tu(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=Ou(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=rn(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,p=f,g=0;g<d.length;g+=6){var v=Ou(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i);if(p=[d[g+4],d[g+5]],a=v<=e/2)return!0}}}return a}(v,c+u,e.x,e.y,M)),O)}function NA(t,e,n){var r=t.parsedStyle,i=r.stroke,a=r.fill,o=r.lineWidth,s=void 0===o?1:o,c=r.increasedLineWidthForHitTesting,l=void 0===c?0:c,u=r.points,f=r.pointerEvents,h=pl(qd(void 0===f?"auto":f,a,i),2),d=h[0],p=!1;return(h[1]||n)&&(p=SA(u.points,s+l,e.x,e.y,!0)),p||!d&&!n||(p=TA(u.points,e.x,e.y)),p}function jA(t,e,n){var r=t.parsedStyle,i=r.lineWidth,a=void 0===i?1:i,o=r.increasedLineWidthForHitTesting,s=void 0===o?0:o,c=r.points,l=r.pointerEvents;return!(!pl(qd(void 0===l?"auto":l,r.fill,r.stroke),2)[1]&&!n||!a)&&SA(c.points,a+s,e.x,e.y,!1)}function RA(t,e,n,r,i){var a=t.parsedStyle,o=a.radius,s=a.fill,c=a.stroke,l=a.lineWidth,u=void 0===l?1:l,f=a.increasedLineWidthForHitTesting,h=void 0===f?0:f,d=a.x,p=void 0===d?0:d,g=a.y,v=void 0===g?0:g,m=a.width,y=a.height,b=a.pointerEvents,x=pl(qd(void 0===b?"auto":b,s,c),2),k=x[0],w=x[1],M=u+h;if(o&&o.some((function(t){return 0!==t}))){var O=!1;return(w||n)&&(O=function(t,e,n,r,i,a,o,s){var c=pl(i,4),l=c[0],u=c[1],f=c[2],h=c[3];return EA(t+l,e,t+n-u,e,a,o,s)||EA(t+n,e+u,t+n,e+r-f,a,o,s)||EA(t+n-f,e+r,t+h,e+r,a,o,s)||EA(t,e+r-h,t,e+l,a,o,s)||OA(t+n-u,e+u,u,Math.PI,Math.PI,a,o,s)||OA(t+n-f,e+r-f,f,0,Math.PI,a,o,s)||OA(t+h,e+r-h,h,Math.PI,Math.PI,a,o,s)||OA(t+l,e+l,l,Math.PI,Math.PI,a,o,s)}(p,v,m,y,o.map((function(t){return j(t,0,Math.min(Math.abs(m)/2,Math.abs(y)/2))})),M,e.x,e.y)),O||!k&&!n||(O=r(t,e)),O}var E=M/2;return k&&w||n?MA(p-E,v-E,m+E,y+E,e.x,e.y):k?MA(p,v,m,y,e.x,e.y):!!w&&function(t,e,n,r,i,a,o){var s=i/2;return MA(t-s,e-s,n,i,a,o)||MA(t+n-s,e-s,i,r,a,o)||MA(t+s,e+r-s,n,i,a,o)||MA(t-s,e+s,i,r,a,o)}(p,v,m,y,M,e.x,e.y)}function IA(t,e,n,r,i,a){var o=t.parsedStyle,s=o.pointerEvents,c=void 0===s?"auto":s,l=o.x,u=void 0===l?0:l,f=o.y,h=void 0===f?0:f,d=o.width,p=o.height;if("non-transparent-pixel"===c){var g=i.config.offscreenCanvas,v=a.offscreenCanvasCreator.getOrCreateCanvas(g),m=a.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});return v.width=d,v.height=p,i.defaultStyleRendererFactory[Du.IMAGE].render(m,el(el({},t.parsedStyle),{},{x:0,y:0}),t,void 0,void 0,void 0),m.getImageData(e.x-u,e.y-h,1,1).data.every((function(t){return 0!==t}))}return!0}function DA(t,e,n,r){var i=t.getGeometryBounds();return e.x>=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var BA=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).name="canvas-picker",t}return dl(e,t),il(e,[{key:"init",value:function(){var t,e=(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(t={},Du.CIRCLE,xA),Du.ELLIPSE,wA),Du.RECT,RA),Du.LINE,CA),Du.POLYLINE,jA),Du.POLYGON,NA),Du.PATH,LA),Du.TEXT,DA),Du.GROUP,null),Du.IMAGE,IA),Jc(Jc(t,Du.HTML,null),Du.MESH,null));this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new bA)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(Fu);function FA(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var zA=0;function GA(t){return"__private_"+zA+++"_"+t}
28
28
  /*!
29
29
  * @antv/g-plugin-image-loader
30
30
  * @description A G plugin for loading image
31
- * @version 2.1.11
32
- * @date 11/27/2024, 2:17:32 PM
31
+ * @version 2.1.17
32
+ * @date 1/17/2025, 2:07:09 PM
33
33
  * @author AntVis
34
34
  * @docs https://g.antv.antgroup.com/
35
- */var WA=function(){return rl((function t(){el(this,t),this.cacheStore=new Map}),[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e)||(n.counter.add(e),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=tl(tl({},r.value),e),r.counter.has(n)||(r.counter.add(n),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e),n.counter.size<=0&&this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach((function(n){e.release(n,t)}))}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),$A=[],YA=[],HA=function(){function t(){el(this,t)}return rl(t,null,[{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;$A.length<=0&&YA.length<=0||(YA.forEach((function(t){return t()})),YA=$A.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame((function(){t.executeTask(e)})))}},{key:"sliceImage",value:function(e,n,r,i){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,c=e.naturalHeight||e.height,l=n-a,u=r-a,f=Math.ceil(s/l),h=Math.ceil(c/u),d={tileSize:[n,r],gridSize:[h,f],tiles:Array(h).fill(null).map((function(){return Array(f).fill(null)}))},p=function(t){for(var a=function(a){$A.push((function(){var f=a*l,h=t*u,p=[Math.min(n,s-f),Math.min(r,c-h)],g=p[0],v=p[1],m=o.createCanvas();m.width=n,m.height=r,m.getContext("2d").drawImage(e,f,h,g,v,0,0,g,v),d.tiles[t][a]={x:f,y:h,tileX:a,tileY:t,data:m},i()}))},h=0;h<f;h++)a(h)},g=0;g<h;g++)p(g);return t.stop(),t.executeTask(),d}}])}();HA.TASK_NUM_PER_FRAME=10;var VA=new WA;VA.onRefAdded=function(t){var e=this;t.addEventListener(Hp.DESTROY,(function(){e.releaseRef(t)}),{once:!0})};var qA=function(){return rl((function t(e,n){el(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n}),[{key:"getImageSync",value:function(t,e,n){var r=C(t)?t:t.src;if(VA.has(r)){var i=VA.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then((function(t){null==n||n(t)})).catch((function(){})),null}},{key:"getOrCreateImage",value:function(t,e){var n=C(t)?t:t.src;if(!C(t)&&!VA.has(n)){var r={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:UA(t)};VA.put(n,r,e)}if(VA.has(n)){var i=VA.get(n,e);return i.img.complete?Promise.resolve(i):new Promise((function(t,e){i.img.addEventListener("load",(function(){i.size=[i.img.naturalWidth||i.img.width,i.img.naturalHeight||i.img.height],i.tileSize=UA(i.img),t(i)})),i.img.addEventListener("error",(function(t){e(t)}))}))}var a=this.context.config.createImage;return new Promise((function(t,r){var i;if(a?i=a(n):Fd&&(i=new window.Image),i){var o={img:i,size:[0,0],tileSize:UA(i)};VA.put(n,o,e),i.onload=function(){o.size=[i.naturalWidth||i.width,i.naturalHeight||i.height],o.tileSize=UA(o.img),t(o)},i.onerror=function(t){r(t)},i.crossOrigin="Anonymous",i.src=n}}))}},{key:"createDownSampledImage",value:(e=Cu(Tu().mark((function t(e,n){var r,i,a,o,s,c,l,u,f,h,d,p,g,v;return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getOrCreateImage(e,n);case 2:if(void 0===(r=t.sent).downSamplingRate){t.next=5;break}return t.abrupt("return",r);case 5:if(i=this.context.config.enableLargeImageOptimization,o=(a="boolean"==typeof i?{}:i).maxDownSampledImageSize,s=void 0===o?2048:o,c=a.downSamplingRateThreshold,l=void 0===c?.5:c,u=this.runtime.globalThis.createImageBitmap,f=dl(r.size,2),h=f[0],d=f[1],p=r.img,g=Math.min((s+s)/(h+d),Math.max(.01,Math.min(l,.5))),v=tl(tl({},r),{},{downSamplingRate:g}),VA.update(r.img.src,v,n),!u){t.next=25;break}return t.prev=14,t.next=17,u(r.img,{resizeWidth:h*g,resizeHeight:d*g});case 17:p=t.sent,t.next=23;break;case 20:t.prev=20,t.t0=t.catch(14),g=1;case 23:t.next=26;break;case 25:g=1;case 26:return v=tl(tl({},this.getImageSync(e,n)),{},{downSampled:p,downSamplingRate:g}),VA.update(r.img.src,v,n),t.abrupt("return",v);case 29:case"end":return t.stop()}}),t,this,[[14,20]])}))),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=Cu(Tu().mark((function t(e,n,r,i){var a,o,s,c,l;return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getOrCreateImage(e,i);case 2:return a=t.sent,o=i.ownerDocument.defaultView,s=o.requestAnimationFrame,c=o.cancelAnimationFrame,HA.api={requestAnimationFrame:s,cancelAnimationFrame:c,createCanvas:function(){return zp.createCanvas()}},l=tl(tl({},a),HA.sliceImage(a.img,a.tileSize[0],a.tileSize[0],r)),VA.update(a.img.src,l,i),t.abrupt("return",l);case 8:case"end":return t.stop()}}),t,this)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){VA.release(C(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){VA.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,r,i,a,o){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var c,l=e.image,u=e.repetition,f=e.transform,h=!1;if(C(l)){var d=this.getImageSync(l,t,o);c=null==d?void 0:d.img}else r?(c=r,h=!0):c=l;var p,g=c&&n.createPattern(c,u);g&&(p=f?yp(nd(f),new Rg({})):vt(ft()),h&&wt(p,p,[1/i,1/i,1]),g.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12]+a[0],f:p[13]+a[1]}));return s&&g&&(this.patternCache[s]=g),g}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,a=t.min,o=t.width,s=t.height,c=t.angle,l=t.cx,u=t.cy,f=t.size;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(r===zf.LinearGradient){var d=function(t,e,n,r){var i=af(r.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*s/2,y1:t[1]+o-Math.sin(i)*s/2,x2:t[0]+a+Math.cos(i)*s/2,y2:t[1]+o+Math.sin(i)*s/2}}(a,o,s,c),p=d.x1,g=d.y1,v=d.x2,m=d.y2;h=e.createLinearGradient(p,g,v,m)}else if(r===zf.RadialGradient){var y=function(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===Tf.kPercentage&&(o=r.value/100*e),i.unit===Tf.kPercentage&&(s=i.value/100*n);var c=Math.max(cn([0,0],[o,s]),cn([0,n],[o,s]),cn([e,n],[o,s]),cn([e,0],[o,s]));return a&&(a instanceof Yf?c=a.value:a instanceof Wf&&("closest-side"===a.value?c=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?c=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(c=Math.min(cn([0,0],[o,s]),cn([0,n],[o,s]),cn([e,n],[o,s]),cn([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:c}}(a,o,s,l,u,f),b=y.x,x=y.y,k=y.r;h=e.createRadialGradient(b,x,0,b,x,k)}return h&&(i.forEach((function(t){var e,n=t.offset,r=t.color;n.unit===Tf.kPercentage&&(null===(e=h)||void 0===e||e.addColorStop(n.value/100,r.toString()))})),this.gradientCache[n]=h),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.type,n=t.min,r=t.width,i=t.height,a=t.steps,o=t.angle,s=t.cx,c=t.cy,l=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(r,"-").concat(i,"-").concat(a.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return C(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function UA(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,r=256;return[256,512].forEach((function(t){Math.ceil(n/t)*Math.ceil(e/t)<1e3&&(r=t)})),[r,r]}qA.isSupportTile=!!zp.createCanvas();var XA=function(){function t(){el(this,t)}return rl(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,a=r.root.ownerDocument.defaultView,o=function(t,e,n){var r=t.parsedStyle,i=r.width,a=r.height;i&&!a?t.setAttribute("height",n/e*i):!i&&a&&t.setAttribute("width",e/n*a)},s=function(t){var e=t.target,r=e.nodeName,a=e.attributes;if(r===Iu.IMAGE){var s=a.src,c=a.keepAspectRatio;i.getImageSync(s,e,(function(t){var r=t.img,i=r.width,a=r.height;c&&o(e,i,a),e.renderable.dirty=!0,n.dirtify()}))}},c=function(t){var e=t.target,r=t.attrName,a=t.prevValue,s=t.newValue;e.nodeName===Iu.IMAGE&&"src"===r&&(a!==s&&i.releaseImage(a,e),C(s)&&i.getOrCreateImage(s,e).then((function(t){var r=t.img,i=r.width,a=r.height;e.attributes.keepAspectRatio&&o(e,i,a),e.renderable.dirty=!0,n.dirtify()})).catch((function(){})))};n.hooks.init.tap(t.tag,(function(){a.addEventListener(Hp.MOUNTED,s),a.addEventListener(Hp.ATTR_MODIFIED,c)})),n.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(Hp.MOUNTED,s),a.removeEventListener(Hp.ATTR_MODIFIED,c)}))}}])}();XA.tag="LoadImage";var ZA=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).name="image-loader",t}return hl(e,t),rl(e,[{key:"init",value:function(t){this.context.imagePool=new qA(this.context,t),this.addRenderingPlugin(new XA)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Bu),KA=GA("renderState"),QA=function(){function t(e){el(this,t),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,KA,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=ft(),this.dprMatrix=ft(),this.tmpMat4=ft(),this.vec3a=Ut(),this.vec3b=Ut(),this.vec3c=Ut(),this.vec3d=Ut(),this.canvasRendererPluginOptions=e}return rl(t,[{key:"apply",value:function(e,n){var r=this;this.context=e;var i=this.context,a=i.config,o=i.camera,s=i.renderingService,c=i.renderingContext,l=i.rBushRoot,u=i.pathGeneratorFactory,f=a.renderer.getConfig().enableRenderingOptimization;a.renderer.getConfig().enableDirtyCheck=!1,a.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=l,this.pathGeneratorFactory=u;var h=e.contextService,d=c.root.ownerDocument.defaultView,p=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},g=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};s.hooks.init.tap(t.tag,(function(){d.addEventListener(Hp.UNMOUNTED,p),d.addEventListener(Hp.CULLED,g);var t=h.getDPR(),e=a.width,n=a.height,i=h.getContext();r.clearRect(i,0,0,e*t,n*t,a.background)})),s.hooks.destroy.tap(t.tag,(function(){d.removeEventListener(Hp.UNMOUNTED,p),d.removeEventListener(Hp.CULLED,g),r.renderQueue=[],r.removedRBushNodeAABBs=[],FA(r,KA)[KA]={restoreStack:[],prevObject:null,currentContext:null}})),s.hooks.beginFrame.tap(t.tag,(function(){var t,e=h.getContext(),n=h.getDPR(),i=a.width,o=a.height,c=r.canvasRendererPluginOptions,l=c.dirtyObjectNumThreshold,u=c.dirtyObjectRatioThreshold,f=s.getStats(),p=f.total,g=f.rendered,v=g/p;r.clearFullScreen=r.clearFullScreenLastFrame||!(null!==(t=d.context.renderingPlugins[1])&&void 0!==t&&t.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||g>l&&v>u,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,i*n,o*n,a.background))}));var v=function(t,e){for(var i=[t];i.length>0;){var a=i.pop();a.isVisible()&&!a.isCulled()&&(f?r.renderDisplayObjectOptimized(a,e,r.context,FA(r,KA)[KA],n):r.renderDisplayObject(a,e,r.context,FA(r,KA)[KA],n));for(var o=a.sortable.sorted||a.childNodes,s=o.length-1;s>=0;s--)i.push(o[s])}};s.hooks.endFrame.tap(t.tag,(function(){if(0!==c.root.childNodes.length){f=a.renderer.getConfig().enableRenderingOptimization,FA(r,KA)[KA]={restoreStack:[],prevObject:null,currentContext:FA(r,KA)[KA].currentContext},FA(r,KA)[KA].currentContext.clear(),r.clearFullScreenLastFrame=!1;var t=h.getContext(),e=h.getDPR();if(St(r.dprMatrix,[e,e,1]),xt(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)f?(t.save(),v(c.root,t),t.restore()):v(c.root,t),r.removedRBushNodeAABBs=[];else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(ol(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,a=new Vu;return a.setMinMax([e,n,0],[r,i,0]),a})))));if(r.removedRBushNodeAABBs=[],Vu.isEmpty(i))return void(r.renderQueue=[]);var s=r.convertAABB2Rect(i),l=s.x,u=s.y,p=s.width,g=s.height,m=se(r.vec3a,[l,u,0],r.vpMatrix),y=se(r.vec3b,[l+p,u,0],r.vpMatrix),b=se(r.vec3c,[l,u+g,0],r.vpMatrix),x=se(r.vec3d,[l+p,u+g,0],r.vpMatrix),k=Math.min(m[0],y[0],x[0],b[0]),w=Math.min(m[1],y[1],x[1],b[1]),M=Math.max(m[0],y[0],x[0],b[0]),O=Math.max(m[1],y[1],x[1],b[1]),E=Math.floor(k),S=Math.floor(w),A=Math.ceil(M-k),_=Math.ceil(O-w);t.save(),r.clearRect(t,E,S,A,_,a.background),t.beginPath(),t.rect(E,S,A,_),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),a.renderer.getConfig().enableDirtyRectangleRenderingDebug&&d.dispatchEvent(new Rp(lv.DIRTY_RECTANGLE,{dirtyRect:{x:E,y:S,width:A,height:_}})),r.searchDirtyObjects(i).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,FA(r,KA)[KA],n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}FA(r,KA)[KA].restoreStack.forEach((function(){t.restore()})),FA(r,KA)[KA].restoreStack=[]}else r.clearFullScreenLastFrame=!0})),s.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))}},{key:"clearRect",value:function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,r,i){var a=t.nodeName,o=!1,s=this.context.styleRendererFactory[a],c=this.pathGeneratorFactory[a],l=t.parsedStyle.clipPath;if(l){(!r.prevObject||!Yt(l.getWorldTransform(),r.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,l),r.prevObject=null);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),o=!0,e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}if(s){(!r.prevObject||!Yt(t.getWorldTransform(),r.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var f=!r.prevObject;if(!f){var h=r.prevObject.nodeName;f=a===Iu.TEXT?h!==Iu.TEXT:a===Iu.IMAGE?h!==Iu.IMAGE:h===Iu.TEXT||h===Iu.IMAGE}s.applyStyleToContext(e,t,f,r),r.prevObject=t}c&&(e.beginPath(),c(e,t.parsedStyle),a!==Iu.LINE&&a!==Iu.PATH&&a!==Iu.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,FA(this,KA)[KA],this,i),o&&e.restore(),t.renderable.dirty=!1}},{key:"renderDisplayObject",value:function(t,e,n,r,i){var a=t.nodeName,o=r.restoreStack[r.restoreStack.length-1];!o||t.compareDocumentPosition(o)&Bp.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.restoreStack.pop());var s=this.context.styleRendererFactory[a],c=this.pathGeneratorFactory[a],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.restoreStack.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),a!==Iu.LINE&&a!==Iu.PATH&&a!==Iu.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,a=n.opacity,o=n.lineDash,s=n.lineDashOffset;o&&t.setLineDash(o),y(s)||(t.lineDashOffset=s),y(a)||(t.globalAlpha*=a),y(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),y(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}}},{key:"mergeDirtyAABBs",value:function(t){var e=new Vu;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e}},{key:"searchDirtyObjects",value:function(t){var e=dl(t.getMin(),2),n=e[0],r=e[1],i=dl(t.getMax(),2),a=i[0],o=i[1];return this.rBush.search({minX:n,minY:r,maxX:a,maxY:o}).map((function(t){return t.displayObject}))}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Vu);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(dt(this.tmpMat4,e.getLocalTransform()),xt(this.tmpMat4,n,this.tmpMat4),xt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(dt(this.tmpMat4,e.getWorldTransform()),xt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new Vu,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){t.add(e)})),t}}])}();
35
+ */var WA=function(){return il((function t(){nl(this,t),this.cacheStore=new Map}),[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e)||(n.counter.add(e),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=el(el({},r.value),e),r.counter.has(n)||(r.counter.add(n),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e),n.counter.size<=0&&this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach((function(n){e.release(n,t)}))}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),$A=[],YA=[],HA=function(){function t(){nl(this,t)}return il(t,null,[{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;$A.length<=0&&YA.length<=0||(YA.forEach((function(t){return t()})),YA=$A.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame((function(){t.executeTask(e)})))}},{key:"sliceImage",value:function(e,n,r,i){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,c=e.naturalHeight||e.height,l=n-a,u=r-a,f=Math.ceil(s/l),h=Math.ceil(c/u),d={tileSize:[n,r],gridSize:[h,f],tiles:Array(h).fill(null).map((function(){return Array(f).fill(null)}))},p=function(t){for(var a=function(a){$A.push((function(){var f=a*l,h=t*u,p=[Math.min(n,s-f),Math.min(r,c-h)],g=p[0],v=p[1],m=o.createCanvas();m.width=n,m.height=r,m.getContext("2d").drawImage(e,f,h,g,v,0,0,g,v),d.tiles[t][a]={x:f,y:h,tileX:a,tileY:t,data:m},i()}))},h=0;h<f;h++)a(h)},g=0;g<h;g++)p(g);return t.stop(),t.executeTask(),d}}])}();HA.TASK_NUM_PER_FRAME=10;var VA=new WA;VA.onRefAdded=function(t){var e=this;t.addEventListener(Hp.DESTROY,(function(){e.releaseRef(t)}),{once:!0})};var qA=function(){return il((function t(e,n){nl(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n}),[{key:"getImageSync",value:function(t,e,n){var r=L(t)?t:t.src;if(VA.has(r)){var i=VA.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then((function(t){null==n||n(t)})).catch((function(){})),null}},{key:"getOrCreateImage",value:function(t,e){var n=this,r=L(t)?t:t.src;if(!L(t)&&!VA.has(r)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:UA(t)};VA.put(r,i,e)}if(VA.has(r)){var a=VA.get(r,e);return a.img.complete?Promise.resolve(a):new Promise((function(t,e){a.img.addEventListener("load",(function(){a.size=[a.img.naturalWidth||a.img.width,a.img.naturalHeight||a.img.height],a.tileSize=UA(a.img),t(a)})),a.img.addEventListener("error",(function(t){e(t)}))}))}return new Promise((function(t,i){var a=n.context.config.createImage();if(a){var o={img:a,size:[0,0],tileSize:UA(a)};VA.put(r,o,e),a.onload=function(){o.size=[a.naturalWidth||a.width,a.naturalHeight||a.height],o.tileSize=UA(o.img),t(o)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=r}}))}},{key:"createDownSampledImage",value:(e=Lu(Pu().mark((function t(e,n){var r,i,a,o,s,c,l,u,f,h,d,p,g,v;return Pu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getOrCreateImage(e,n);case 2:if(void 0===(r=t.sent).downSamplingRate){t.next=5;break}return t.abrupt("return",r);case 5:if(i=this.context.config.enableLargeImageOptimization,o=(a="boolean"==typeof i?{}:i).maxDownSampledImageSize,s=void 0===o?2048:o,c=a.downSamplingRateThreshold,l=void 0===c?.5:c,u=this.runtime.globalThis.createImageBitmap,f=pl(r.size,2),h=f[0],d=f[1],p=r.img,g=Math.min((s+s)/(h+d),Math.max(.01,Math.min(l,.5))),v=el(el({},r),{},{downSamplingRate:g}),VA.update(r.img.src,v,n),!u){t.next=25;break}return t.prev=14,t.next=17,u(r.img,{resizeWidth:h*g,resizeHeight:d*g});case 17:p=t.sent,t.next=23;break;case 20:t.prev=20,t.t0=t.catch(14),g=1;case 23:t.next=26;break;case 25:g=1;case 26:return v=el(el({},this.getImageSync(e,n)),{},{downSampled:p,downSamplingRate:g}),VA.update(r.img.src,v,n),t.abrupt("return",v);case 29:case"end":return t.stop()}}),t,this,[[14,20]])}))),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=Lu(Pu().mark((function t(e,n,r,i){var a,o,s,c,l;return Pu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getOrCreateImage(e,i);case 2:return a=t.sent,o=i.ownerDocument.defaultView,s=o.requestAnimationFrame,c=o.cancelAnimationFrame,HA.api={requestAnimationFrame:s,cancelAnimationFrame:c,createCanvas:function(){return zp.createCanvas()}},l=el(el({},a),HA.sliceImage(a.img,a.tileSize[0],a.tileSize[0],r)),VA.update(a.img.src,l,i),t.abrupt("return",l);case 8:case"end":return t.stop()}}),t,this)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){VA.release(L(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){VA.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,r,i,a,o){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var c,l=e.image,u=e.repetition,f=e.transform,h=!1;if(L(l)){var d=this.getImageSync(l,t,o);c=null==d?void 0:d.img}else r?(c=r,h=!0):c=l;var p,g=c&&n.createPattern(c,u);g&&(p=f?yp(rd(f),new Rg({})):mt(ht()),h&&Mt(p,p,[1/i,1/i,1]),g.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12]+a[0],f:p[13]+a[1]}));return s&&g&&(this.patternCache[s]=g),g}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,a=t.min,o=t.width,s=t.height,c=t.angle,l=t.cx,u=t.cy,f=t.size;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(r===Gf.LinearGradient){var d=function(t,e,n,r){var i=of(r.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*s/2,y1:t[1]+o-Math.sin(i)*s/2,x2:t[0]+a+Math.cos(i)*s/2,y2:t[1]+o+Math.sin(i)*s/2}}(a,o,s,c),p=d.x1,g=d.y1,v=d.x2,m=d.y2;h=e.createLinearGradient(p,g,v,m)}else if(r===Gf.RadialGradient){var y=function(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===Pf.kPercentage&&(o=r.value/100*e),i.unit===Pf.kPercentage&&(s=i.value/100*n);var c=Math.max(ln([0,0],[o,s]),ln([0,n],[o,s]),ln([e,n],[o,s]),ln([e,0],[o,s]));return a&&(a instanceof Hf?c=a.value:a instanceof $f&&("closest-side"===a.value?c=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?c=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(c=Math.min(ln([0,0],[o,s]),ln([0,n],[o,s]),ln([e,n],[o,s]),ln([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:c}}(a,o,s,l,u,f),b=y.x,x=y.y,k=y.r;h=e.createRadialGradient(b,x,0,b,x,k)}return h&&(i.forEach((function(t){var e,n=t.offset,r=t.color;n.unit===Pf.kPercentage&&(null===(e=h)||void 0===e||e.addColorStop(n.value/100,r.toString()))})),this.gradientCache[n]=h),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.type,n=t.min,r=t.width,i=t.height,a=t.steps,o=t.angle,s=t.cx,c=t.cy,l=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(r,"-").concat(i,"-").concat(a.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return L(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function UA(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,r=256;return[256,512].forEach((function(t){Math.ceil(n/t)*Math.ceil(e/t)<1e3&&(r=t)})),[r,r]}qA.isSupportTile=!!zp.createCanvas();var XA=function(){function t(){nl(this,t)}return il(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,a=r.root.ownerDocument.defaultView,o=function(t,e,n){var r=t.parsedStyle,i=r.width,a=r.height;i&&!a?t.setAttribute("height",n/e*i):!i&&a&&t.setAttribute("width",e/n*a)},s=function(t){var e=t.target,r=e.nodeName,a=e.attributes;if(r===Du.IMAGE){var s=a.src,c=a.keepAspectRatio;i.getImageSync(s,e,(function(t){var r=t.img,i=r.width,a=r.height;c&&o(e,i,a),e.renderable.dirty=!0,n.dirtify()}))}},c=function(t){var e=t.target,r=t.attrName,a=t.prevValue,s=t.newValue;e.nodeName===Du.IMAGE&&"src"===r&&(a!==s&&i.releaseImage(a,e),L(s)&&i.getOrCreateImage(s,e).then((function(t){var r=t.img,i=r.width,a=r.height;e.attributes.keepAspectRatio&&o(e,i,a),e.renderable.dirty=!0,n.dirtify()})).catch((function(){})))};n.hooks.init.tap(t.tag,(function(){a.addEventListener(Hp.MOUNTED,s),a.addEventListener(Hp.ATTR_MODIFIED,c)})),n.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(Hp.MOUNTED,s),a.removeEventListener(Hp.ATTR_MODIFIED,c)}))}}])}();XA.tag="LoadImage";var ZA=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).name="image-loader",t}return dl(e,t),il(e,[{key:"init",value:function(t){this.context.imagePool=new qA(this.context,t),this.addRenderingPlugin(new XA)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Fu),KA=GA("renderState"),QA=function(){function t(e){nl(this,t),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,KA,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=ht(),this.dprMatrix=ht(),this.tmpMat4=ht(),this.vec3a=Xt(),this.vec3b=Xt(),this.vec3c=Xt(),this.vec3d=Xt(),this.canvasRendererPluginOptions=e}return il(t,[{key:"apply",value:function(e,n){var r=this;this.context=e;var i=this.context,a=i.config,o=i.camera,s=i.renderingService,c=i.renderingContext,l=i.rBushRoot,u=i.pathGeneratorFactory,f=a.renderer.getConfig().enableRenderingOptimization;a.renderer.getConfig().enableDirtyCheck=!1,a.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=l,this.pathGeneratorFactory=u;var h=e.contextService,d=c.root.ownerDocument.defaultView,p=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},g=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};s.hooks.init.tap(t.tag,(function(){d.addEventListener(Hp.UNMOUNTED,p),d.addEventListener(Hp.CULLED,g);var t=h.getDPR(),e=a.width,n=a.height,i=h.getContext();r.clearRect(i,0,0,e*t,n*t,a.background)})),s.hooks.destroy.tap(t.tag,(function(){d.removeEventListener(Hp.UNMOUNTED,p),d.removeEventListener(Hp.CULLED,g),r.renderQueue=[],r.removedRBushNodeAABBs=[],FA(r,KA)[KA]={restoreStack:[],prevObject:null,currentContext:null}})),s.hooks.beginFrame.tap(t.tag,(function(){var t,e=h.getContext(),n=h.getDPR(),i=a.width,o=a.height,c=r.canvasRendererPluginOptions,l=c.dirtyObjectNumThreshold,u=c.dirtyObjectRatioThreshold,f=s.getStats(),p=f.total,g=f.rendered,v=g/p;r.clearFullScreen=r.clearFullScreenLastFrame||!(null!==(t=d.context.renderingPlugins[1])&&void 0!==t&&t.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||g>l&&v>u,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,i*n,o*n,a.background))}));var v=function(t,e){for(var i=[t];i.length>0;){var a=i.pop();a.isVisible()&&!a.isCulled()&&(f?r.renderDisplayObjectOptimized(a,e,r.context,FA(r,KA)[KA],n):r.renderDisplayObject(a,e,r.context,FA(r,KA)[KA],n));for(var o=a.sortable.sorted||a.childNodes,s=o.length-1;s>=0;s--)i.push(o[s])}};s.hooks.endFrame.tap(t.tag,(function(){if(0!==c.root.childNodes.length){f=a.renderer.getConfig().enableRenderingOptimization,FA(r,KA)[KA]={restoreStack:[],prevObject:null,currentContext:FA(r,KA)[KA].currentContext},FA(r,KA)[KA].currentContext.clear(),r.clearFullScreenLastFrame=!1;var t=h.getContext(),e=h.getDPR();if(At(r.dprMatrix,[e,e,1]),kt(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)f?(t.save(),v(c.root,t),t.restore()):v(c.root,t),r.removedRBushNodeAABBs=[];else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(sl(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,a=new qu;return a.setMinMax([e,n,0],[r,i,0]),a})))));if(r.removedRBushNodeAABBs=[],qu.isEmpty(i))return void(r.renderQueue=[]);var s=r.convertAABB2Rect(i),l=s.x,u=s.y,p=s.width,g=s.height,m=ce(r.vec3a,[l,u,0],r.vpMatrix),y=ce(r.vec3b,[l+p,u,0],r.vpMatrix),b=ce(r.vec3c,[l,u+g,0],r.vpMatrix),x=ce(r.vec3d,[l+p,u+g,0],r.vpMatrix),k=Math.min(m[0],y[0],x[0],b[0]),w=Math.min(m[1],y[1],x[1],b[1]),M=Math.max(m[0],y[0],x[0],b[0]),O=Math.max(m[1],y[1],x[1],b[1]),E=Math.floor(k),S=Math.floor(w),A=Math.ceil(M-k),_=Math.ceil(O-w);t.save(),r.clearRect(t,E,S,A,_,a.background),t.beginPath(),t.rect(E,S,A,_),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),a.renderer.getConfig().enableDirtyRectangleRenderingDebug&&d.dispatchEvent(new Rp(lv.DIRTY_RECTANGLE,{dirtyRect:{x:E,y:S,width:A,height:_}})),r.searchDirtyObjects(i).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,FA(r,KA)[KA],n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}FA(r,KA)[KA].restoreStack.forEach((function(){t.restore()})),FA(r,KA)[KA].restoreStack=[]}else r.clearFullScreenLastFrame=!0})),s.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))}},{key:"clearRect",value:function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,r,i){var a=t.nodeName,o=!1,s=this.context.styleRendererFactory[a],c=this.pathGeneratorFactory[a],l=t.parsedStyle.clipPath;if(l){(!r.prevObject||!Ht(l.getWorldTransform(),r.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,l),r.prevObject=null);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),o=!0,e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}if(s){(!r.prevObject||!Ht(t.getWorldTransform(),r.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var f=!r.prevObject;if(!f){var h=r.prevObject.nodeName;f=a===Du.TEXT?h!==Du.TEXT:a===Du.IMAGE?h!==Du.IMAGE:h===Du.TEXT||h===Du.IMAGE}s.applyStyleToContext(e,t,f,r),r.prevObject=t}c&&(e.beginPath(),c(e,t.parsedStyle),a!==Du.LINE&&a!==Du.PATH&&a!==Du.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,FA(this,KA)[KA],this,i),o&&e.restore(),t.renderable.dirty=!1}},{key:"renderDisplayObject",value:function(t,e,n,r,i){var a=t.nodeName,o=r.restoreStack[r.restoreStack.length-1];!o||t.compareDocumentPosition(o)&Bp.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.restoreStack.pop());var s=this.context.styleRendererFactory[a],c=this.pathGeneratorFactory[a],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.restoreStack.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),a!==Du.LINE&&a!==Du.PATH&&a!==Du.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,a=n.opacity,o=n.lineDash,s=n.lineDashOffset;o&&t.setLineDash(o),b(s)||(t.lineDashOffset=s),b(a)||(t.globalAlpha*=a),b(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),b(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}}},{key:"mergeDirtyAABBs",value:function(t){var e=new qu;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e}},{key:"searchDirtyObjects",value:function(t){var e=pl(t.getMin(),2),n=e[0],r=e[1],i=pl(t.getMax(),2),a=i[0],o=i[1];return this.rBush.search({minX:n,minY:r,maxX:a,maxY:o}).map((function(t){return t.displayObject}))}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new qu);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(pt(this.tmpMat4,e.getLocalTransform()),kt(this.tmpMat4,n,this.tmpMat4),kt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(pt(this.tmpMat4,e.getWorldTransform()),kt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new qu,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){t.add(e)})),t}}])}();
36
36
  /*!
37
37
  * @antv/g-plugin-canvas-renderer
38
38
  * @description A G plugin of renderer implementation with Canvas2D API
39
- * @version 2.2.11
40
- * @date 11/27/2024, 2:18:17 PM
39
+ * @version 2.2.17
40
+ * @date 1/17/2025, 2:07:56 PM
41
41
  * @author AntVis
42
42
  * @docs https://g.antv.antgroup.com/
43
- */function JA(t,e,n,r,i,a,o){var s,c;if("rect"===t.image.nodeName){var l=t.image.parsedStyle,u=l.width,f=l.height;c=r.contextService.getDPR();var h=r.config.offscreenCanvas;(s=a.offscreenCanvasCreator.getOrCreateCanvas(h)).width=u*c,s.height=f*c;var d=a.offscreenCanvasCreator.getOrCreateContext(h),p={restoreStack:[],prevObject:null,currentContext:new Map};t.image.forEach((function(t){i.renderDisplayObject(t,d,r,p,a)})),p.restoreStack.forEach((function(){d.restore()}))}return o.getOrCreatePatternSync(e,t,n,s,c,e.getGeometryBounds().min,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))}function t_(t,e,n,r){var i;if(t.type===zf.LinearGradient||t.type===zf.RadialGradient){var a=e.getGeometryBounds(),o=a&&2*a.halfExtents[0]||1,s=a&&2*a.halfExtents[1]||1,c=a&&a.min||[0,0];i=r.getOrCreateGradient(tl(tl({type:t.type},t.value),{},{min:c,width:o,height:s}),n)}return i}QA.tag="CanvasRenderer";var e_=["shadowBlur","shadowOffsetX","shadowOffsetY"],n_=["lineCap","lineJoin","miterLimit"],r_={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},i_={};function a_(t,e,n,r){var i=r.has(e)?r.get(e):r_[e];return i!==n&&("lineDash"===e?t.setLineDash(n):t[e]=n,r.set(e,n)),i}var o_=function(){return rl((function t(e){el(this,t),this.imagePool=e}),[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,n,r,i,a){}},{key:"applyCommonStyleToContext",value:function(t,e,n,r){var i=n?i_:r.prevObject.parsedStyle,a=e.parsedStyle;(n||a.opacity!==i.opacity)&&a_(t,"globalAlpha",y(a.opacity)?r_.globalAlpha:a.opacity,r.currentContext),(n||a.blend!==i.blend)&&a_(t,"globalCompositeOperation",y(a.blend)?r_.globalCompositeOperation:a.blend,r.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,n,r){var i=n?i_:r.prevObject.parsedStyle,a=e.parsedStyle,o=a.lineWidth,s=void 0===o?r_.lineWidth:o,c=a.fill&&!a.fill.isNone;if(a.stroke&&!a.stroke.isNone&&s>0){if(n||e.attributes.stroke!==r.prevObject.attributes.stroke)a_(t,"strokeStyle",y(a.stroke)||Array.isArray(a.stroke)||a.stroke.isNone?r_.strokeStyle:e.attributes.stroke,r.currentContext);(n||a.lineWidth!==i.lineWidth)&&a_(t,"lineWidth",y(a.lineWidth)?r_.lineWidth:a.lineWidth,r.currentContext),(n||a.lineDash!==i.lineDash)&&a_(t,"lineDash",a.lineDash||r_.lineDash,r.currentContext),(n||a.lineDashOffset!==i.lineDashOffset)&&a_(t,"lineDashOffset",y(a.lineDashOffset)?r_.lineDashOffset:a.lineDashOffset,r.currentContext);for(var l=0;l<n_.length;l++){var u=n_[l];(n||a[u]!==i[u])&&a_(t,u,y(a[u])?r_[u]:a[u],r.currentContext)}}c&&(n||e.attributes.fill!==r.prevObject.attributes.fill)&&a_(t,"fillStyle",y(a.fill)||Array.isArray(a.fill)||a.fill.isNone?r_.fillStyle:e.attributes.fill,r.currentContext)}},{key:"applyStyleToContext",value:function(t,e,n,r){var i=e.nodeName;this.applyCommonStyleToContext(t,e,n,r),i===Iu.IMAGE||this.applyStrokeFillStyleToContext(t,e,n,r)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,n,r){var i=e.parsedStyle;if(n){a_(t,"shadowColor",i.shadowColor.toString(),r.currentContext);for(var a=0;a<e_.length;a++){var o=e_[a];a_(t,o,i[o]||r_[o],r.currentContext)}}i.filter&&i.filter.length&&a_(t,"filter",e.attributes.filter,r.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e){a_(t,"shadowColor",r_.shadowColor,r.currentContext);for(var a=0;a<e_.length;a++){var o=e_[a];a_(t,o,r_[o],r.currentContext)}}if(n)if(e&&i){var s=t.filter;!y(s)&&s.indexOf("drop-shadow")>-1&&a_(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||r_.filter,r.currentContext)}else a_(t,"filter",r_.filter,r.currentContext)}},{key:"fillToContext",value:function(t,e,n,r,i){var a=this,o=e.parsedStyle,s=o.fill,c=o.fillRule,l=null;if(Array.isArray(s)&&s.length>0)s.forEach((function(r){var i,o=a_(t,"fillStyle",t_(r,e,t,a.imagePool),n.currentContext);l=null!==(i=l)&&void 0!==i?i:o,c?t.fill(c):t.fill()}));else{if(uh(s)){var u=JA(s,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);u&&(t.fillStyle=u,l=!0)}c?t.fill(c):t.fill()}null!==l&&a_(t,"fillStyle",l,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,r,i){var a=this,o=e.parsedStyle.stroke,s=null;if(Array.isArray(o)&&o.length>0)o.forEach((function(r){var i,o=a_(t,"strokeStyle",t_(r,e,t,a.imagePool),n.currentContext);s=null!==(i=s)&&void 0!==i?i:o,t.stroke()}));else{if(uh(o)){var c=JA(o,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);if(c){var l,u=a_(t,"strokeStyle",c,n.currentContext);s=null!==(l=s)&&void 0!==l?l:u}}t.stroke()}null!==s&&a_(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,r,i){var a,o=e.nodeName,s=e.parsedStyle,c=s.opacity,l=void 0===c?r_.globalAlpha:c,u=s.fillOpacity,f=void 0===u?r_.fillOpacity:u,h=s.strokeOpacity,d=void 0===h?r_.strokeOpacity:h,p=s.lineWidth,g=void 0===p?r_.lineWidth:p,v=s.fill&&!s.fill.isNone,m=s.stroke&&!s.stroke.isNone&&g>0;if(v||m){var b=!y(s.shadowColor)&&s.shadowBlur>0,x="inner"===s.shadowType,k=0===(null===(a=s.fill)||void 0===a?void 0:a.alpha),w=!(!s.filter||!s.filter.length),M=b&&m&&(o===Iu.PATH||o===Iu.LINE||o===Iu.POLYLINE||k||x),O=null;if(v)M||this.applyShadowAndFilterStyleToContext(t,e,b,n),O=a_(t,"globalAlpha",l*f,n.currentContext),this.fillToContext(t,e,n,r,i),M||this.clearShadowAndFilterStyleForContext(t,b,w,n);if(m){var E=!1,S=a_(t,"globalAlpha",l*d,n.currentContext);if(O=v?O:S,M&&(this.applyShadowAndFilterStyleToContext(t,e,b,n),E=!0,x)){var A=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,r,i),t.globalCompositeOperation=A,this.clearShadowAndFilterStyleForContext(t,b,w,n,!0)}this.strokeToContext(t,e,n,r,i),E&&this.clearShadowAndFilterStyleForContext(t,b,w,n)}null!==O&&a_(t,"globalAlpha",O,n.currentContext)}}}])}(),s_=function(t){function e(){return el(this,e),ul(this,e,arguments)}return hl(e,t),rl(e,[{key:"render",value:function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,c=e.opacity,l=void 0===c?1:c,u=e.fillOpacity,f=void 0===u?1:u,h=e.stroke,d=e.strokeOpacity,p=void 0===d?1:d,g=e.lineWidth,v=void 0===g?1:g,m=e.lineCap,b=e.lineJoin,x=e.shadowType,k=e.shadowColor,w=e.shadowBlur,M=e.filter,O=e.miterLimit,E=o&&!o.isNone,S=h&&!h.isNone&&v>0,A=0===(null==o?void 0:o.alpha),_=!(!M||!M.length),T=!y(k)&&w>0,P=n.nodeName,C="inner"===x,L=S&&T&&(P===Iu.PATH||P===Iu.LINE||P===Iu.POLYLINE||A||C);E&&(t.globalAlpha=l*f,L||c_(n,t,T),l_(t,n,o,s,r,i,a,this.imagePool),L||this.clearShadowAndFilter(t,_,T)),S&&(t.globalAlpha=l*p,t.lineWidth=v,y(O)||(t.miterLimit=O),y(m)||(t.lineCap=m),y(b)||(t.lineJoin=b),L&&(C&&(t.globalCompositeOperation="source-atop"),c_(n,t,!0),C&&(u_(t,n,h,r,i,a,this.imagePool),t.globalCompositeOperation=r_.globalCompositeOperation,this.clearShadowAndFilter(t,_,!0))),u_(t,n,h,r,i,a,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!y(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(o_);function c_(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}function l_(t,e,n,r,i,a,o,s){var c=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach((function(n){t.fillStyle=t_(n,e,t,s),c||(r?t.fill(r):t.fill())})):(uh(n)&&(t.fillStyle=JA(n,e,t,i,a,o,s)),c||(r?t.fill(r):t.fill()))}function u_(t,e,n,r,i,a,o){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach((function(n){t.strokeStyle=t_(n,e,t,o),s||t.stroke()})):(uh(n)&&(t.strokeStyle=JA(n,e,t,r,i,a,o)),s||t.stroke())}var f_=function(t){function e(){return el(this,e),ul(this,e,arguments)}return hl(e,t),rl(e,[{key:"renderDownSampled",value:function(t,e,n,r){var i=r.src,a=r.imageCache;a.downSampled?t.drawImage(a.downSampled,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3])):this.imagePool.createDownSampledImage(i,n).then((function(t){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()})).catch((function(){}))}},{key:"renderTile",value:function(t,e,n,r){var i=r.src,a=r.imageCache,o=r.imageRect,s=r.drawRect,c=a.size,l=t.getTransform(),u=l.a,f=l.b,h=l.c,d=l.d,p=l.e,g=l.f;if(t.resetTransform(),null!=a&&a.gridSize){for(var v=[c[0]/o[2],c[1]/o[3]],m=[a.tileSize[0]/v[0],a.tileSize[1]/v[1]],y=[Math.floor((s[0]-o[0])/m[0]),Math.ceil((s[0]+s[2]-o[0])/m[0])],b=y[0],x=y[1],k=[Math.floor((s[1]-o[1])/m[1]),Math.ceil((s[1]+s[3]-o[1])/m[1])],w=k[1],M=k[0];M<=w;M++)for(var O=b;O<=x;O++){var E=a.tiles[M][O];if(E){var S=[Math.floor(o[0]+E.tileX*m[0]),Math.floor(o[1]+E.tileY*m[1]),Math.ceil(m[0]),Math.ceil(m[1])];t.drawImage(E.data,S[0],S[1],S[2],S[3])}}t.setTransform(u,f,h,d,p,g)}else this.imagePool.createImageTiles(i,[],(function(){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()}),n).catch((function(){}))}},{key:"render",value:function(t,n,r){var i=n.x,a=void 0===i?0:i,o=n.y,s=void 0===o?0:o,c=n.width,l=n.height,u=n.src,f=n.shadowColor,h=n.shadowBlur,d=this.imagePool.getImageSync(u,r),p=null==d?void 0:d.img,g=c,v=l;if(p){var m,b,x,k,w,M,O,E,S,A,_,T,P,C,L;g||(g=p.width),v||(v=p.height),c_(r,t,!y(f)&&h>0);try{var N=r.ownerDocument.defaultView.getContextService().getDomElement(),j=N.width,R=N.height,I=t.getTransform(),D=I.a,B=I.b,F=function(t,e){var n=se(Ut(),[t[0],t[1],0],e),r=se(Ut(),[t[0]+t[2],t[1],0],e),i=se(Ut(),[t[0],t[1]+t[3],0],e),a=se(Ut(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],r[0],i[0],a[0]),Math.min(n[1],r[1],i[1],a[1]),Math.max(n[0],r[0],i[0],a[0])-Math.min(n[0],r[0],i[0],a[0]),Math.max(n[1],r[1],i[1],a[1])-Math.min(n[1],r[1],i[1],a[1])]}([a,s,g,v],pt(D,I.c,0,0,B,I.d,0,0,0,0,1,0,I.e,I.f,0,1)),z=(m=F,b=dl([0,0,j,R],4),x=b[0],k=b[1],w=b[2],M=b[3],O=dl(m,4),E=O[0],S=O[1],A=O[2],_=O[3],T=Math.max(x,E),P=Math.max(k,S),C=Math.min(x+w,E+A),L=Math.min(k+M,S+_),C<=T||L<=P?null:[T,P,C-T,L-P]);if(!z)return;if(!r.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,r,{image:p,drawRect:[a,s,g,v]});if(F[2]/d.size[0]<(d.downSamplingRate||.5))return void this.renderDownSampled(t,n,r,{src:u,imageCache:d,drawRect:[a,s,g,v]});if(!qA.isSupportTile)return void e.renderFull(t,n,r,{image:p,drawRect:[a,s,g,v]});this.renderTile(t,n,r,{src:u,imageCache:d,imageRect:F,drawRect:z})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,r){t.drawImage(r.image,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3]))}}])}(s_),h_=function(t){function e(){return el(this,e),ul(this,e,arguments)}return hl(e,t),rl(e,[{key:"render",value:function(t,e,n,r,i,a){n.getBounds();var o=e.lineWidth,s=void 0===o?1:o,c=e.textAlign,l=void 0===c?"start":c,u=e.textBaseline,f=void 0===u?"alphabetic":u,h=e.lineJoin,d=void 0===h?"miter":h,p=e.miterLimit,g=void 0===p?10:p,v=e.letterSpacing,m=void 0===v?0:v,b=e.stroke,x=e.fill,k=e.fillRule,w=e.fillOpacity,M=void 0===w?1:w,O=e.strokeOpacity,E=void 0===O?1:O,S=e.opacity,A=void 0===S?1:S,_=e.metrics,T=e.x,P=void 0===T?0:T,C=e.y,L=void 0===C?0:C,N=e.dx,j=e.dy,R=e.shadowColor,I=e.shadowBlur,D=_.font,B=_.lines,F=_.height,z=_.lineHeight,G=_.lineMetrics;t.font=D,t.lineWidth=s,t.textAlign="middle"===l?"center":l;var W=f;"alphabetic"===W&&(W="bottom"),t.lineJoin=d,y(g)||(t.miterLimit=g);var $=L;"middle"===f?$+=-F/2-z/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?$+=-F:"top"!==f&&"hanging"!==f||($+=-z);var Y=P+(N||0);$+=j||0,1===B.length&&("bottom"===W?(W="middle",$-=.5*F):"top"===W&&(W="middle",$+=.5*F)),t.textBaseline=W,c_(n,t,!y(R)&&I>0);for(var H=0;H<B.length;H++){var V=s/2+Y;$+=z,y(b)||b.isNone||!s||this.drawLetterSpacing(t,n,B[H],G[H],l,V,$,m,x,k,M,b,E,A,!0,r,i,a),y(x)||this.drawLetterSpacing(t,n,B[H],G[H],l,V,$,m,x,k,M,b,E,A,!1,r,i,a)}}},{key:"drawLetterSpacing",value:function(t,e,n,r,i,a,o,s,c,l,u,f,h,d,p,g,v,m){if(0!==s){var y=t.textAlign;t.textAlign="left";var b=a;"center"===i||"middle"===i?b=a-r.width/2:"right"!==i&&"end"!==i||(b=a-r.width);for(var x=Array.from(n),k=t.measureText(n).width,w=0,M=0;M<x.length;++M){var O=x[M];p?this.strokeText(t,e,O,b,o,f,h,g,v,m):this.fillText(t,e,O,b,o,c,l,u,d,g,v,m),b+=k-(w=t.measureText(n.substring(M+1)).width)+s,k=w}t.textAlign=y}else p?this.strokeText(t,e,n,a,o,f,h,g,v,m):this.fillText(t,e,n,a,o,c,l,u,d,g,v,m)}},{key:"fillText",value:function(t,e,n,r,i,a,o,s,c,l,u,f){var h;l_(t,e,a,o,l,u,f,this.imagePool,!0);var d=!y(s)&&1!==s;d&&(h=t.globalAlpha,t.globalAlpha=s*c),t.fillText(n,r,i),d&&(t.globalAlpha=h)}},{key:"strokeText",value:function(t,e,n,r,i,a,o,s,c,l){var u;u_(t,e,a,s,c,l,this.imagePool,!0);var f=!y(o)&&1!==o;f&&(u=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,r,i),f&&(t.globalAlpha=u)}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e,e.ownerDocument.defaultView.context,r,i)}}])}(s_),d_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return el(this,e),(t=ul(this,e)).name="canvas-renderer",t.options=n,t}return hl(e,t),rl(e,[{key:"init",value:function(){var t,e=tl({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new s_(n),i=(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(t={},Iu.CIRCLE,r),Iu.ELLIPSE,r),Iu.RECT,r),Iu.IMAGE,new f_(n)),Iu.TEXT,new h_(n)),Iu.LINE,r),Iu.POLYLINE,r),Iu.POLYGON,r),Iu.PATH,r),Iu.GROUP,void 0),Qc(Qc(Qc(t,Iu.HTML,void 0),Iu.MESH,void 0),Iu.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new QA(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(Bu),p_=function(){function t(){el(this,t)}return rl(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,a=e.renderingContext,o=e.config;this.context=e;var s=a.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},h=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),o.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",h,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0),n.globalThis.removeEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",h,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),o.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))}}])}();p_.tag="DOMInteraction";var g_=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).name="dom-interaction",t}return hl(e,t),rl(e,[{key:"init",value:function(){this.addRenderingPlugin(new p_)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Bu),v_=function(){function t(){el(this,t),this.displayObjectHTMLElementMap=new WeakMap}return rl(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,a=e.renderingContext,o=e.renderingService;this.context=e;var s=a.root.ownerDocument.defaultView,c=s.context.eventService.nativeHTMLMap,l=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},u=function(t){var e=t.target;if(e.nodeName===Iu.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),l(e,n),c.set(n,e)}},f=function(t){var e=t.target;if(e.nodeName===Iu.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},h=function(t){var e=t.target;if(e.nodeName===Iu.HTML){var n=t.attrName;r.updateAttribute(n,e)}},d=function(t){var e=t.target;(e.nodeName===Iu.FRAGMENT?e.childNodes:[e]).forEach((function(t){if(t.nodeName===Iu.HTML){var e=r.getOrCreateEl(t);l(t,e)}}))},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.parentElement.style.width="".concat(e||0,"px"),r.$camera.parentElement.style.height="".concat(n||0,"px")}};o.hooks.init.tap(t.tag,(function(){s.addEventListener(lv.RESIZE,p),s.addEventListener(Hp.MOUNTED,u),s.addEventListener(Hp.UNMOUNTED,f),s.addEventListener(Hp.ATTR_MODIFIED,h),s.addEventListener(Hp.BOUNDS_CHANGED,d)})),o.hooks.endFrame.tap(t.tag,(function(){r.$camera&&a.renderReasons.has(Gp.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),o.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(lv.RESIZE,p),s.removeEventListener(Hp.MOUNTED,u),s.removeEventListener(Hp.UNMOUNTED,f),s.removeEventListener(Hp.ATTR_MODIFIED,h),s.removeEventListener(Hp.BOUNDS_CHANGED,d)}))}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,a=this.context.contextService.getDomElement(),o=a.parentNode;if(o){var s="g-canvas-camera",c=o.querySelector("#".concat(s));if(!c){var l=(n||document).createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",l.style.position="absolute",l.style.left="0px",l.style.top="0px",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px");var u=(n||document).createElement("div");c=u,u.id=s,u.style.position="absolute",u.style.left="".concat(a.offsetLeft||0,"px"),u.style.top="".concat(a.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),u.style.pointerEvents="none",u.style.width="100%",u.style.height="100%",l.appendChild(u),o.appendChild(l)}return c}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;C(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var a=e.parsedStyle.width;n.style.width=j(a)?"".concat(a,"px"):a.toString();break;case"height":var o=e.parsedStyle.height;n.style.height=j(o)?"".concat(o,"px"):o.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents,u=void 0===l?"auto":l;n.style.pointerEvents=u;break;case"opacity":var f=e.parsedStyle.opacity;n.style.opacity="".concat(f);break;case"fill":var h=e.parsedStyle.fill,d="";fh(h)?d=h.isNone?"transparent":e.getAttribute("fill"):Array.isArray(h)&&(d=e.getAttribute("fill")),n.style.background=d;break;case"stroke":var p=e.parsedStyle.stroke,g="";fh(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)&&(g=e.getAttribute("stroke")),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var v=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(v||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:y(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();
43
+ */function JA(t,e,n,r,i,a,o){var s,c;if("rect"===t.image.nodeName){var l=t.image.parsedStyle,u=l.width,f=l.height;c=r.contextService.getDPR();var h=r.config.offscreenCanvas;(s=a.offscreenCanvasCreator.getOrCreateCanvas(h)).width=u*c,s.height=f*c;var d=a.offscreenCanvasCreator.getOrCreateContext(h),p={restoreStack:[],prevObject:null,currentContext:new Map};t.image.forEach((function(t){i.renderDisplayObject(t,d,r,p,a)})),p.restoreStack.forEach((function(){d.restore()}))}return o.getOrCreatePatternSync(e,t,n,s,c,e.getGeometryBounds().min,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))}function t_(t,e,n,r){var i;if(t.type===Gf.LinearGradient||t.type===Gf.RadialGradient){var a=e.getGeometryBounds(),o=a&&2*a.halfExtents[0]||1,s=a&&2*a.halfExtents[1]||1,c=a&&a.min||[0,0];i=r.getOrCreateGradient(el(el({type:t.type},t.value),{},{min:c,width:o,height:s}),n)}return i}QA.tag="CanvasRenderer";var e_=["shadowBlur","shadowOffsetX","shadowOffsetY"],n_=["lineCap","lineJoin","miterLimit"],r_={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},i_={};function a_(t,e,n,r){var i=r.has(e)?r.get(e):r_[e];return i!==n&&("lineDash"===e?t.setLineDash(n):t[e]=n,r.set(e,n)),i}var o_=function(){return il((function t(e){nl(this,t),this.imagePool=e}),[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,n,r,i,a){}},{key:"applyCommonStyleToContext",value:function(t,e,n,r){var i=n?i_:r.prevObject.parsedStyle,a=e.parsedStyle;(n||a.opacity!==i.opacity)&&a_(t,"globalAlpha",b(a.opacity)?r_.globalAlpha:a.opacity,r.currentContext),(n||a.blend!==i.blend)&&a_(t,"globalCompositeOperation",b(a.blend)?r_.globalCompositeOperation:a.blend,r.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,n,r){var i=n?i_:r.prevObject.parsedStyle,a=e.parsedStyle,o=a.lineWidth,s=void 0===o?r_.lineWidth:o,c=a.fill&&!a.fill.isNone;if(a.stroke&&!a.stroke.isNone&&s>0){if(n||e.attributes.stroke!==r.prevObject.attributes.stroke)a_(t,"strokeStyle",b(a.stroke)||Array.isArray(a.stroke)||a.stroke.isNone?r_.strokeStyle:e.attributes.stroke,r.currentContext);(n||a.lineWidth!==i.lineWidth)&&a_(t,"lineWidth",b(a.lineWidth)?r_.lineWidth:a.lineWidth,r.currentContext),(n||a.lineDash!==i.lineDash)&&a_(t,"lineDash",a.lineDash||r_.lineDash,r.currentContext),(n||a.lineDashOffset!==i.lineDashOffset)&&a_(t,"lineDashOffset",b(a.lineDashOffset)?r_.lineDashOffset:a.lineDashOffset,r.currentContext);for(var l=0;l<n_.length;l++){var u=n_[l];(n||a[u]!==i[u])&&a_(t,u,b(a[u])?r_[u]:a[u],r.currentContext)}}c&&(n||e.attributes.fill!==r.prevObject.attributes.fill)&&a_(t,"fillStyle",b(a.fill)||Array.isArray(a.fill)||a.fill.isNone?r_.fillStyle:e.attributes.fill,r.currentContext)}},{key:"applyStyleToContext",value:function(t,e,n,r){var i=e.nodeName;this.applyCommonStyleToContext(t,e,n,r),i===Du.IMAGE||this.applyStrokeFillStyleToContext(t,e,n,r)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,n,r){var i=e.parsedStyle;if(n){a_(t,"shadowColor",i.shadowColor.toString(),r.currentContext);for(var a=0;a<e_.length;a++){var o=e_[a];a_(t,o,i[o]||r_[o],r.currentContext)}}i.filter&&i.filter.length&&a_(t,"filter",e.attributes.filter,r.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e){a_(t,"shadowColor",r_.shadowColor,r.currentContext);for(var a=0;a<e_.length;a++){var o=e_[a];a_(t,o,r_[o],r.currentContext)}}if(n)if(e&&i){var s=t.filter;!b(s)&&s.indexOf("drop-shadow")>-1&&a_(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||r_.filter,r.currentContext)}else a_(t,"filter",r_.filter,r.currentContext)}},{key:"fillToContext",value:function(t,e,n,r,i){var a=this,o=e.parsedStyle,s=o.fill,c=o.fillRule,l=null;if(Array.isArray(s)&&s.length>0)s.forEach((function(r){var i=a_(t,"fillStyle",t_(r,e,t,a.imagePool),n.currentContext);l=null!=l?l:i,c?t.fill(c):t.fill()}));else{if(fh(s)){var u=JA(s,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);u&&(t.fillStyle=u,l=!0)}c?t.fill(c):t.fill()}null!==l&&a_(t,"fillStyle",l,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,r,i){var a=this,o=e.parsedStyle.stroke,s=null;if(Array.isArray(o)&&o.length>0)o.forEach((function(r){var i=a_(t,"strokeStyle",t_(r,e,t,a.imagePool),n.currentContext);s=null!=s?s:i,t.stroke()}));else{if(fh(o)){var c=JA(o,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);if(c){var l=a_(t,"strokeStyle",c,n.currentContext);s=null!=s?s:l}}t.stroke()}null!==s&&a_(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,r,i){var a,o=e.nodeName,s=e.parsedStyle,c=s.opacity,l=void 0===c?r_.globalAlpha:c,u=s.fillOpacity,f=void 0===u?r_.fillOpacity:u,h=s.strokeOpacity,d=void 0===h?r_.strokeOpacity:h,p=s.lineWidth,g=void 0===p?r_.lineWidth:p,v=s.fill&&!s.fill.isNone,m=s.stroke&&!s.stroke.isNone&&g>0;if(v||m){var y=!b(s.shadowColor)&&s.shadowBlur>0,x="inner"===s.shadowType,k=0===(null===(a=s.fill)||void 0===a?void 0:a.alpha),w=!(!s.filter||!s.filter.length),M=y&&m&&(o===Du.PATH||o===Du.LINE||o===Du.POLYLINE||k||x),O=null;if(v)M||this.applyShadowAndFilterStyleToContext(t,e,y,n),O=a_(t,"globalAlpha",l*f,n.currentContext),this.fillToContext(t,e,n,r,i),M||this.clearShadowAndFilterStyleForContext(t,y,w,n);if(m){var E=!1,S=a_(t,"globalAlpha",l*d,n.currentContext);if(O=v?O:S,M&&(this.applyShadowAndFilterStyleToContext(t,e,y,n),E=!0,x)){var A=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,r,i),t.globalCompositeOperation=A,this.clearShadowAndFilterStyleForContext(t,y,w,n,!0)}this.strokeToContext(t,e,n,r,i),E&&this.clearShadowAndFilterStyleForContext(t,y,w,n)}null!==O&&a_(t,"globalAlpha",O,n.currentContext)}}}])}(),s_=function(t){function e(){return nl(this,e),fl(this,e,arguments)}return dl(e,t),il(e,[{key:"render",value:function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,c=e.opacity,l=void 0===c?1:c,u=e.fillOpacity,f=void 0===u?1:u,h=e.stroke,d=e.strokeOpacity,p=void 0===d?1:d,g=e.lineWidth,v=void 0===g?1:g,m=e.lineCap,y=e.lineJoin,x=e.shadowType,k=e.shadowColor,w=e.shadowBlur,M=e.filter,O=e.miterLimit,E=o&&!o.isNone,S=h&&!h.isNone&&v>0,A=0===(null==o?void 0:o.alpha),_=!(!M||!M.length),T=!b(k)&&w>0,P=n.nodeName,C="inner"===x,L=S&&T&&(P===Du.PATH||P===Du.LINE||P===Du.POLYLINE||A||C);E&&(t.globalAlpha=l*f,L||c_(n,t,T),l_(t,n,o,s,r,i,a,this.imagePool),L||this.clearShadowAndFilter(t,_,T)),S&&(t.globalAlpha=l*p,t.lineWidth=v,b(O)||(t.miterLimit=O),b(m)||(t.lineCap=m),b(y)||(t.lineJoin=y),L&&(C&&(t.globalCompositeOperation="source-atop"),c_(n,t,!0),C&&(u_(t,n,h,r,i,a,this.imagePool),t.globalCompositeOperation=r_.globalCompositeOperation,this.clearShadowAndFilter(t,_,!0))),u_(t,n,h,r,i,a,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!b(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(o_);function c_(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}function l_(t,e,n,r,i,a,o,s){var c=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach((function(n){t.fillStyle=t_(n,e,t,s),c||(r?t.fill(r):t.fill())})):(fh(n)&&(t.fillStyle=JA(n,e,t,i,a,o,s)),c||(r?t.fill(r):t.fill()))}function u_(t,e,n,r,i,a,o){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach((function(n){t.strokeStyle=t_(n,e,t,o),s||t.stroke()})):(fh(n)&&(t.strokeStyle=JA(n,e,t,r,i,a,o)),s||t.stroke())}var f_=function(t){function e(){return nl(this,e),fl(this,e,arguments)}return dl(e,t),il(e,[{key:"renderDownSampled",value:function(t,e,n,r){var i=r.src,a=r.imageCache;a.downSampled?t.drawImage(a.downSampled,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3])):this.imagePool.createDownSampledImage(i,n).then((function(t){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()})).catch((function(){}))}},{key:"renderTile",value:function(t,e,n,r){var i=r.src,a=r.imageCache,o=r.imageRect,s=r.drawRect,c=a.size,l=t.getTransform(),u=l.a,f=l.b,h=l.c,d=l.d,p=l.e,g=l.f;if(t.resetTransform(),null!=a&&a.gridSize){for(var v=[c[0]/o[2],c[1]/o[3]],m=[a.tileSize[0]/v[0],a.tileSize[1]/v[1]],y=[Math.floor((s[0]-o[0])/m[0]),Math.ceil((s[0]+s[2]-o[0])/m[0])],b=y[0],x=y[1],k=[Math.floor((s[1]-o[1])/m[1]),Math.ceil((s[1]+s[3]-o[1])/m[1])],w=k[1],M=k[0];M<=w;M++)for(var O=b;O<=x;O++){var E=a.tiles[M][O];if(E){var S=[Math.floor(o[0]+E.tileX*m[0]),Math.floor(o[1]+E.tileY*m[1]),Math.ceil(m[0]),Math.ceil(m[1])];t.drawImage(E.data,S[0],S[1],S[2],S[3])}}t.setTransform(u,f,h,d,p,g)}else this.imagePool.createImageTiles(i,[],(function(){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()}),n).catch((function(){}))}},{key:"render",value:function(t,n,r){var i=n.x,a=void 0===i?0:i,o=n.y,s=void 0===o?0:o,c=n.width,l=n.height,u=n.src,f=n.shadowColor,h=n.shadowBlur,d=this.imagePool.getImageSync(u,r),p=null==d?void 0:d.img,g=c,v=l;if(p){var m,y,x,k,w,M,O,E,S,A,_,T,P,C,L;g||(g=p.width),v||(v=p.height),c_(r,t,!b(f)&&h>0);try{var N=r.ownerDocument.defaultView.getContextService().getDomElement(),j=N.width,R=N.height,I=t.getTransform(),D=I.a,B=I.b,F=function(t,e){var n=ce(Xt(),[t[0],t[1],0],e),r=ce(Xt(),[t[0]+t[2],t[1],0],e),i=ce(Xt(),[t[0],t[1]+t[3],0],e),a=ce(Xt(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],r[0],i[0],a[0]),Math.min(n[1],r[1],i[1],a[1]),Math.max(n[0],r[0],i[0],a[0])-Math.min(n[0],r[0],i[0],a[0]),Math.max(n[1],r[1],i[1],a[1])-Math.min(n[1],r[1],i[1],a[1])]}([a,s,g,v],gt(D,I.c,0,0,B,I.d,0,0,0,0,1,0,I.e,I.f,0,1)),z=(m=F,y=pl([0,0,j,R],4),x=y[0],k=y[1],w=y[2],M=y[3],O=pl(m,4),E=O[0],S=O[1],A=O[2],_=O[3],T=Math.max(x,E),P=Math.max(k,S),C=Math.min(x+w,E+A),L=Math.min(k+M,S+_),C<=T||L<=P?null:[T,P,C-T,L-P]);if(!z)return;if(!r.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,r,{image:p,drawRect:[a,s,g,v]});if(F[2]/d.size[0]<(d.downSamplingRate||.5))return void this.renderDownSampled(t,n,r,{src:u,imageCache:d,drawRect:[a,s,g,v]});if(!qA.isSupportTile)return void e.renderFull(t,n,r,{image:p,drawRect:[a,s,g,v]});this.renderTile(t,n,r,{src:u,imageCache:d,imageRect:F,drawRect:z})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,r){t.drawImage(r.image,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3]))}}])}(s_),h_=function(t){function e(){return nl(this,e),fl(this,e,arguments)}return dl(e,t),il(e,[{key:"render",value:function(t,e,n,r,i,a){n.getBounds();var o=e.lineWidth,s=void 0===o?1:o,c=e.textAlign,l=void 0===c?"start":c,u=e.textBaseline,f=void 0===u?"alphabetic":u,h=e.lineJoin,d=void 0===h?"miter":h,p=e.miterLimit,g=void 0===p?10:p,v=e.letterSpacing,m=void 0===v?0:v,y=e.stroke,x=e.fill,k=e.fillRule,w=e.fillOpacity,M=void 0===w?1:w,O=e.strokeOpacity,E=void 0===O?1:O,S=e.opacity,A=void 0===S?1:S,_=e.metrics,T=e.x,P=void 0===T?0:T,C=e.y,L=void 0===C?0:C,N=e.dx,j=e.dy,R=e.shadowColor,I=e.shadowBlur,D=_.font,B=_.lines,F=_.height,z=_.lineHeight,G=_.lineMetrics;t.font=D,t.lineWidth=s,t.textAlign="middle"===l?"center":l;var W=f;"alphabetic"===W&&(W="bottom"),t.lineJoin=d,b(g)||(t.miterLimit=g);var $=L;"middle"===f?$+=-F/2-z/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?$+=-F:"top"!==f&&"hanging"!==f||($+=-z);var Y=P+(N||0);$+=j||0,1===B.length&&("bottom"===W?(W="middle",$-=.5*F):"top"===W&&(W="middle",$+=.5*F)),t.textBaseline=W,c_(n,t,!b(R)&&I>0);for(var H=0;H<B.length;H++){var V=s/2+Y;$+=z,b(y)||y.isNone||!s||this.drawLetterSpacing(t,n,B[H],G[H],l,V,$,m,x,k,M,y,E,A,!0,r,i,a),b(x)||this.drawLetterSpacing(t,n,B[H],G[H],l,V,$,m,x,k,M,y,E,A,!1,r,i,a)}}},{key:"drawLetterSpacing",value:function(t,e,n,r,i,a,o,s,c,l,u,f,h,d,p,g,v,m){if(0!==s){var y=t.textAlign;t.textAlign="left";var b=a;"center"===i||"middle"===i?b=a-r.width/2:"right"!==i&&"end"!==i||(b=a-r.width);for(var x=Array.from(n),k=t.measureText(n).width,w=0,M=0;M<x.length;++M){var O=x[M];p?this.strokeText(t,e,O,b,o,f,h,g,v,m):this.fillText(t,e,O,b,o,c,l,u,d,g,v,m),b+=k-(w=t.measureText(n.substring(M+1)).width)+s,k=w}t.textAlign=y}else p?this.strokeText(t,e,n,a,o,f,h,g,v,m):this.fillText(t,e,n,a,o,c,l,u,d,g,v,m)}},{key:"fillText",value:function(t,e,n,r,i,a,o,s,c,l,u,f){var h;l_(t,e,a,o,l,u,f,this.imagePool,!0);var d=!b(s)&&1!==s;d&&(h=t.globalAlpha,t.globalAlpha=s*c),t.fillText(n,r,i),d&&(t.globalAlpha=h)}},{key:"strokeText",value:function(t,e,n,r,i,a,o,s,c,l){var u;u_(t,e,a,s,c,l,this.imagePool,!0);var f=!b(o)&&1!==o;f&&(u=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,r,i),f&&(t.globalAlpha=u)}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e,e.ownerDocument.defaultView.context,r,i)}}])}(s_),d_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nl(this,e),(t=fl(this,e)).name="canvas-renderer",t.options=n,t}return dl(e,t),il(e,[{key:"init",value:function(){var t,e=el({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new s_(n),i=(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(Jc(t={},Du.CIRCLE,r),Du.ELLIPSE,r),Du.RECT,r),Du.IMAGE,new f_(n)),Du.TEXT,new h_(n)),Du.LINE,r),Du.POLYLINE,r),Du.POLYGON,r),Du.PATH,r),Du.GROUP,void 0),Jc(Jc(Jc(t,Du.HTML,void 0),Du.MESH,void 0),Du.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new QA(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(Fu),p_=function(){function t(){nl(this,t)}return il(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,a=e.renderingContext,o=e.config;this.context=e;var s=a.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},h=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),o.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",h,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0),n.globalThis.removeEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",h,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),o.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))}}])}();p_.tag="DOMInteraction";var g_=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).name="dom-interaction",t}return dl(e,t),il(e,[{key:"init",value:function(){this.addRenderingPlugin(new p_)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Fu),v_=function(){function t(){nl(this,t),this.displayObjectHTMLElementMap=new WeakMap}return il(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,a=e.renderingContext,o=e.renderingService;this.context=e;var s=a.root.ownerDocument.defaultView,c=s.context.eventService.nativeHTMLMap,l=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},u=function(t){var e=t.target;if(e.nodeName===Du.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),l(e,n),c.set(n,e)}},f=function(t){var e=t.target;if(e.nodeName===Du.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},h=function(t){var e=t.target;if(e.nodeName===Du.HTML){var n=t.attrName;r.updateAttribute(n,e)}},d=function(t){var e=t.target;(e.nodeName===Du.FRAGMENT?e.childNodes:[e]).forEach((function(t){if(t.nodeName===Du.HTML){var e=r.getOrCreateEl(t);l(t,e)}}))},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.parentElement.style.width="".concat(e||0,"px"),r.$camera.parentElement.style.height="".concat(n||0,"px")}};o.hooks.init.tap(t.tag,(function(){s.addEventListener(lv.RESIZE,p),s.addEventListener(Hp.MOUNTED,u),s.addEventListener(Hp.UNMOUNTED,f),s.addEventListener(Hp.ATTR_MODIFIED,h),s.addEventListener(Hp.BOUNDS_CHANGED,d)})),o.hooks.endFrame.tap(t.tag,(function(){r.$camera&&a.renderReasons.has(Gp.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),o.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(lv.RESIZE,p),s.removeEventListener(Hp.MOUNTED,u),s.removeEventListener(Hp.UNMOUNTED,f),s.removeEventListener(Hp.ATTR_MODIFIED,h),s.removeEventListener(Hp.BOUNDS_CHANGED,d)}))}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,a=this.context.contextService.getDomElement(),o=a.parentNode;if(o){var s="g-canvas-camera",c=o.querySelector("#".concat(s));if(!c){var l=(n||document).createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",l.style.position="absolute",l.style.left="0px",l.style.top="0px",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px");var u=(n||document).createElement("div");c=u,u.id=s,u.style.position="absolute",u.style.left="".concat(a.offsetLeft||0,"px"),u.style.top="".concat(a.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),u.style.pointerEvents="none",u.style.width="100%",u.style.height="100%",l.appendChild(u),o.appendChild(l)}return c}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;L(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var a=e.parsedStyle.width;n.style.width=R(a)?"".concat(a,"px"):a.toString();break;case"height":var o=e.parsedStyle.height;n.style.height=R(o)?"".concat(o,"px"):o.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents,u=void 0===l?"auto":l;n.style.pointerEvents=u;break;case"opacity":var f=e.parsedStyle.opacity;n.style.opacity="".concat(f);break;case"fill":var h=e.parsedStyle.fill,d="";hh(h)?d=h.isNone?"transparent":e.getAttribute("fill"):Array.isArray(h)&&(d=e.getAttribute("fill")),n.style.background=d;break;case"stroke":var p=e.parsedStyle.stroke,g="";hh(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)&&(g=e.getAttribute("stroke")),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var v=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(v||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:b(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();
44
44
  /*!
45
45
  * @antv/g-plugin-html-renderer
46
46
  * @description A G plugin for rendering HTML
47
- * @version 2.1.14
48
- * @date 11/27/2024, 2:17:28 PM
47
+ * @version 2.1.20
48
+ * @date 1/17/2025, 2:07:05 PM
49
49
  * @author AntVis
50
50
  * @docs https://g.antv.antgroup.com/
51
- */v_.tag="HTMLRendering";var m_=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).name="html-renderer",t}return hl(e,t),rl(e,[{key:"init",value:function(){this.addRenderingPlugin(new v_)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Bu),y_=function(){return rl((function t(e){el(this,t),this.renderingContext=e.renderingContext,this.canvasConfig=e.config}),[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=C(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,e){var n=this.canvasConfig.devicePixelRatio||Fd&&window.devicePixelRatio||1;n=n>=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){Fd&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Gp.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=Cu(Tu().mark((function t(){var e,n,r,i=arguments;return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(e=i.length>0&&void 0!==i[0]?i[0]:{}).type,r=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 3:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),b_=function(t){function e(){var t;el(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=ul(this,e,[].concat(r))).name="canvas-context-register",t}return hl(e,t),rl(e,[{key:"init",value:function(){this.context.ContextService=y_}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(Bu),x_=function(t){function e(t){var n;return el(this,e),(n=ul(this,e,[t])).registerPlugin(new b_),n.registerPlugin(new ZA),n.registerPlugin(new pA),n.registerPlugin(new d_),n.registerPlugin(new g_),n.registerPlugin(new BA),n.registerPlugin(new m_),n}return hl(e,t),rl(e)}(Fu),k_=function(){function t(e){el(this,t),this.dragndropPluginOptions=e}return rl(t,[{key:"apply",value:function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,a=i.defaultView,o=function(t){var e=t.target,r=e===i,o=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(o){var s=!1,c=t.timeStamp,l=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],h=function(){var t=Cu(Tu().mark((function t(a){var h,d,p,g,v,m;return Tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=8;break}if(h=a.timeStamp-c,d=cn([a.clientX,a.clientY],l),!(h<=n.dragndropPluginOptions.dragstartTimeThreshold||d<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=5;break}return t.abrupt("return");case 5:a.type="dragstart",o.dispatchEvent(a),s=!0;case 8:if(a.type="drag",a.dx=a.clientX-f[0],a.dy=a.clientY-f[1],o.dispatchEvent(a),f=[a.clientX,a.clientY],r){t.next=21;break}return p="pointer"===n.dragndropPluginOptions.overlap?[a.canvasX,a.canvasY]:e.getBounds().center,t.next=17,i.elementsFromPoint(p[0],p[1]);case 17:g=t.sent,v=g[g.indexOf(e)+1],m=(null==v?void 0:v.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?i:null),u!==m&&(u&&(a.type="dragleave",a.target=u,u.dispatchEvent(a)),m&&(a.type="dragenter",a.target=m,m.dispatchEvent(a)),(u=m)&&(a.type="dragover",a.target=u,u.dispatchEvent(a)));case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();a.addEventListener("pointermove",h);var d=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",o.dispatchEvent(e),s=!1}a.removeEventListener("pointermove",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{once:!0})}};r.hooks.init.tap(t.tag,(function(){a.addEventListener("pointerdown",o)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener("pointerdown",o)}))}}])}();
51
+ */v_.tag="HTMLRendering";var m_=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).name="html-renderer",t}return dl(e,t),il(e,[{key:"init",value:function(){this.addRenderingPlugin(new v_)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Fu),y_=function(){return il((function t(e){nl(this,t),this.renderingContext=e.renderingContext,this.canvasConfig=e.config}),[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=L(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,e){var n=this.canvasConfig.devicePixelRatio;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){Fd&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Gp.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=Lu(Pu().mark((function t(){var e,n,r,i=arguments;return Pu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(e=i.length>0&&void 0!==i[0]?i[0]:{}).type,r=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 3:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),b_=function(t){function e(){var t;nl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=fl(this,e,[].concat(r))).name="canvas-context-register",t}return dl(e,t),il(e,[{key:"init",value:function(){this.context.ContextService=y_}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(Fu),x_=function(t){function e(t){var n;return nl(this,e),(n=fl(this,e,[t])).registerPlugin(new b_),n.registerPlugin(new ZA),n.registerPlugin(new pA),n.registerPlugin(new d_),n.registerPlugin(new g_),n.registerPlugin(new BA),n.registerPlugin(new m_),n}return dl(e,t),il(e)}(zu),k_=function(){function t(e){nl(this,t),this.dragndropPluginOptions=e}return il(t,[{key:"apply",value:function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,a=i.defaultView,o=function(t){var e=t.target,r=e===i,o=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(o){var s=!1,c=t.timeStamp,l=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],h=function(){var t=Lu(Pu().mark((function t(a){var h,d,p,g,v,m;return Pu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=8;break}if(h=a.timeStamp-c,d=ln([a.clientX,a.clientY],l),!(h<=n.dragndropPluginOptions.dragstartTimeThreshold||d<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=5;break}return t.abrupt("return");case 5:a.type="dragstart",o.dispatchEvent(a),s=!0;case 8:if(a.type="drag",a.dx=a.clientX-f[0],a.dy=a.clientY-f[1],o.dispatchEvent(a),f=[a.clientX,a.clientY],r){t.next=21;break}return p="pointer"===n.dragndropPluginOptions.overlap?[a.canvasX,a.canvasY]:e.getBounds().center,t.next=17,i.elementsFromPoint(p[0],p[1]);case 17:g=t.sent,v=g[g.indexOf(e)+1],m=(null==v?void 0:v.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?i:null),u!==m&&(u&&(a.type="dragleave",a.target=u,u.dispatchEvent(a)),m&&(a.type="dragenter",a.target=m,m.dispatchEvent(a)),(u=m)&&(a.type="dragover",a.target=u,u.dispatchEvent(a)));case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();a.addEventListener("pointermove",h);var d=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",o.dispatchEvent(e),s=!1}a.removeEventListener("pointermove",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{once:!0})}};r.hooks.init.tap(t.tag,(function(){a.addEventListener("pointerdown",o)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener("pointerdown",o)}))}}])}();
52
52
  /*!
53
53
  * @antv/g-canvas
54
54
  * @description A renderer implemented by Canvas 2D API
55
- * @version 2.0.32
56
- * @date 11/27/2024, 2:19:51 PM
55
+ * @version 2.0.38
56
+ * @date 1/17/2025, 2:09:35 PM
57
57
  * @author AntVis
58
58
  * @docs https://g.antv.antgroup.com/
59
- */k_.tag="Dragndrop";var w_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return el(this,e),(t=ul(this,e)).name="dragndrop",t.options=n,t}return hl(e,t),rl(e,[{key:"init",value:function(){this.addRenderingPlugin(new k_(tl({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(Bu),M_=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],a=this._events["*"]||[],o=function(r){for(var i=r.length,a=0;a<i;a++)if(r[a]){var o=r[a],s=o.callback;o.once&&(r.splice(a,1),0===r.length&&delete e._events[t],i--,a--),s.apply(e,n)}};o(i),o(a)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),O_=M_;const E_={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},S_=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var A_={}.toString,__=function(t,e){return A_.call(t)==="[object "+e+"]"},T_=function(t){return Array.isArray?Array.isArray(t):__(t,"Array")},P_=function(t){return"object"==typeof t&&null!==t},C_=function(t){if(!P_(t)||!__(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function L_(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var a=e[i];null!==a&&C_(a)?(C_(t[i])||(t[i]={}),n<r?L_(t[i],a,n+1,r):t[i]=e[i]):T_(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var N_=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)L_(t,e[r]);return t},j_=function(t){return t};function R_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce((function(t,e){return function(n){return e(t(n))}}),t):j_}function I_(t){return t instanceof Float32Array||t instanceof Array}var D_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},B_=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function F_(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var z_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},G_=function(t,e,n,r,i){var a,o,s=z_(t,2),c=s[0],l=s[1],u=lt();return o=[c,l],(a=u)[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=o[0],a[7]=o[1],a[8]=1,a},W_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},$_=function(t,e,n,r,i){var a=new oo({range:[e,e+r]}),o=new oo({range:[n,n+i]});return{transform:function(t){var e=W_(t,2),n=e[0],r=e[1];return[a.map(n),o.map(r)]},untransform:function(t){var e=W_(t,2),n=e[0],r=e[1];return[a.invert(n),o.invert(r)]}}},Y_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},H_=function(t,e,n,r,i){return(0,Y_(t,1)[0])(e,n,r,i)},V_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},q_=function(t,e,n,r,i){return V_(t,1)[0]},U_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},X_=function(t,e,n,r,i){var a=U_(t,4),o=a[0],s=a[1],c=a[2],l=a[3],u=new oo({range:[c,l]}),f=new oo({range:[o,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=U_(t,2),n=e[0],r=e[1],i=f.map(n),a=u.map(r);return[.5*(a*Math.cos(i)*d)+.5,.5*(a*Math.sin(i)*p)+.5]},untransform:function(t){var e=U_(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,a=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),l=F_(Math.atan2(a,i),o,s);return[f.invert(l),u.invert(c)]}}},Z_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},K_=function(t,e,n,r,i){return{transform:function(t){var e=Z_(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=Z_(t,2),n=e[0];return[e[1],n]}}},Q_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},J_=function(t,e,n,r,i){var a,o,s=Q_(t,2),c=s[0],l=s[1],u=lt();return o=[c,l],(a=u)[0]=o[0],a[1]=0,a[2]=0,a[3]=0,a[4]=o[1],a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},tT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},eT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},nT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return J_.apply(void 0,eT([[-1,-1]],tT(e),!1))},rT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return J_.apply(void 0,eT([[-1,1]],tT(e),!1))},iT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return J_.apply(void 0,eT([[1,-1]],tT(e),!1))},aT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},oT=function(t,e,n,r,i){var a=aT(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(lt(),a)},sT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},cT=function(t,e,n,r,i){var a=sT(t,4),o=a[0],s=a[1],c=a[2],l=(a[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new oo({range:[c,c+.99*l]}),h=new oo({range:[o,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=sT(t,2),n=e[0],r=e[1],i=h.map(n),a=f.map(r);return[.5*(Math.cos(i)*(u*i+a)*p)+.5,.5*(Math.sin(i)*(u*i+a)*g)+.5]},untransform:function(t){var e=sT(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,a=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),d=F_(Math.atan2(a,i)+Math.floor(c/l)*Math.PI*2,o,s),v=c-u*d;return[h.invert(d),f.invert(v)]}}},lT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},uT=function(t,e,n,r,i){var a=lT(t,4),o=a[0],s=a[1],c=a[2],l=a[3],u=new oo({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new so({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[o,s]}),i=0;i<n;i++){var a=t[i],c=r.map(i),l=u.map(a);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},fT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function hT(t){return 1/Math.tan(t)}var dT=function(t,e,n,r,i){var a=hT(fT(t,1)[0]);return{transform:function(t){var e=fT(t,2),n=e[0],r=e[1];return[n+r*a,r]},untransform:function(t){var e=fT(t,2),n=e[0],r=e[1];return[n-r*a,r]}}},pT=function(t,e,n,r,i){var a=hT(fT(t,1)[0]);return{transform:function(t){var e=fT(t,2),n=e[0];return[n,e[1]+n*a]},untransform:function(t){var e=fT(t,2),n=e[0];return[n,e[1]-n*a]}}},gT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function vT(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r,s=a?-1:1;return s*o*(n+1)/(n+o/((t-e)*s))+e}function mT(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r;return o/(o*(n+1)/(t-e)-n*(a?-1:1))+e}function yT(t,e,n){return n?new oo({range:[0,1],domain:[0,e]}).map(t):t}var bT=function(t,e,n,r,i){var a=gT(t,3),o=a[0],s=a[1],c=a[2],l=yT(o,r,void 0!==c&&c);return{transform:function(t){var e=gT(t,2),n=e[0],r=e[1];return[vT(n,l,s,0,1),r]},untransform:function(t){var e=gT(t,2),n=e[0],r=e[1];return[mT(n,l,s,0,1),r]}}},xT=function(t,e,n,r,i){var a=gT(t,3),o=a[0],s=a[1],c=a[2],l=yT(o,i,void 0!==c&&c);return{transform:function(t){var e=gT(t,2);return[e[0],vT(e[1],l,s,0,1)]},untransform:function(t){var e=gT(t,2);return[e[0],mT(e[1],l,s,0,1)]}}},kT=function(t,e,n,r,i){var a=gT(t,5),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=void 0!==u&&u,h=yT(o,r,f),d=yT(s,i,f);return{transform:function(t){var e=gT(t,2),n=e[0],r=e[1];return[vT(n,h,c,0,1),vT(r,d,l,0,1)]},untransform:function(t){var e=gT(t,2),n=e[0],r=e[1];return[mT(n,h,c,0,1),mT(r,d,l,0,1)]}}},wT=function(t,e,n,r,i){var a=gT(t,5),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=void 0!==u&&u,h=new oo({range:[0,r]}),d=new oo({range:[0,i]}),p=f?o:h.map(o),g=f?s:d.map(s);return{transform:function(t){var e=gT(t,2),n=e[0],r=e[1],i=h.map(n)-p,a=d.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>c)return[n,r];var s=vT(o,0,l,0,c),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]},untransform:function(t){var e=gT(t,2),n=e[0],r=e[1],i=h.map(n)-p,a=d.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>c)return[n,r];var s=mT(o,0,l,0,c),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]}}},MT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},OT=function(t,e,n,r,i,a,o){var s=new oo({range:[e,e+i]}),c=new oo({range:[n,n+a]}),l=new oo({range:[r,r+o]});return{transform:function(t){var e=MT(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=MT(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},ET=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},ST=function(t,e,n,r,i,a,o){var s=ET(t,3),c=s[0],l=s[1],u=s[2];return Et(ft(),[c,l,u])},AT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},_T=function(t,e,n,r,i,a,o){return{transform:function(t){var e=AT(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=AT(t,3),n=e[0];return[e[1],n,e[2]]}}},TT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},PT=function(t,e,n,r,i,a,o){var s=TT(t,3),c=s[0],l=s[1],u=s[2];return St(ft(),[c,l,u])},CT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},LT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},NT=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},jT=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:$_,translate:G_,custom:H_,matrix:q_,polar:X_,transpose:K_,scale:J_,"shear.x":dT,"shear.y":pT,reflect:nT,"reflect.x":rT,"reflect.y":iT,rotate:oT,helix:cT,parallel:uT,fisheye:kT,"fisheye.x":bT,"fisheye.y":xT,"fisheye.circular":wT},this.update(t)}return t.prototype.update=function(t){this.options=N_({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:LT(LT([],CT(n),!1),[LT([],CT(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?LT([],CT(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],a=t(i);n.push.apply(n,B_([],D_(a),!1))}return n}}(t):t)};try{for(var c=NT(r),l=c.next();!l.done;l=c.next()){var u=CT(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.width,y=p.height,b=d(LT([],CT(h),!1),g,v,m,y);if(I_(b))a.push(b);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(b)||j_,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return R_.apply(void 0,LT([],CT(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n,r,i=lt();return e&&t.reverse(),t.forEach((function(t){return ut(i,i,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*o-s*l,h=-u*a+s*c,d=l*a-o*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*o)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*a)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(o*n-r*a)*p)}(i,(n=i,(r=new ct(9))[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r)),function(t){var e=[t[0],t[1],1];return ce(e,e,i),[e[0],e[1]]}},t}(),RT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},IT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},DT=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},BT=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:OT,translate3D:ST,scale3D:PT,transpose3D:_T},this.update(t)}return t.prototype.update=function(t){this.options=N_({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:IT(IT([],RT(n),!1),[IT([],RT(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?IT([],RT(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],a=t(i);n.push.apply(n,B_([],D_(a),!1))}return n}}(t):t)};try{for(var c=DT(r),l=c.next();!l.done;l=c.next()){var u=RT(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.z,y=p.width,b=p.height,x=p.depth,k=d(IT([],RT(h),!1),g,v,m,y,b,x);if(I_(k))a.push(k);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(k)||j_,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return R_.apply(void 0,IT([],RT(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=ft();return e&&t.reverse(),t.forEach((function(t){return Ht(n,n,t)})),e&&yt(n,ht(n)),function(t){var e=[t[0],t[1],t[2],1];return ge(e,e,n),[e[0],e[1],e[2]]}},t}();function FT(t){return(e,...n)=>Z({},t(e,...n),e)}function zT(t){return(e,...n)=>Z({},e,t(e,...n))}function GT(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=Pe(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const WT=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:o}=t;return e.map((t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=Pe(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:GT(e,o),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:a})}))};WT.props={};const $T=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:a}=t,[o,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce(((t,e)=>t+e)),f=t[s]-i*(e.length-1),h=r.map((t=>f*(t/u))),d=[];let p=t[o]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:u}=r,f=Pe(r,["data"]),g=GT(u,a);d.push(Object.assign({[o]:p,[s]:h[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=h[n]+i}return d};$T.props={};const YT=()=>t=>{const{children:e}=t,n=Pe(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:a={},legend:o={},encode:s={},transform:c=[]}=n,l=Pe(n,["data","scale","axis","legend","encode","transform"]),u=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=Pe(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:GT(e,r),scale:Z({},i,n),encode:Z({},s,f),transform:[...c,...h],axis:!(!l||!a)&&Z({},a,l),legend:!(!u||!o)&&Z({},o,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};YT.props={};const HT=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:a,paddingRight:o,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,data:x,coordinate:k,theme:w,component:M,interaction:O,x:E,y:S,z:A,key:_,frame:T,labelTransform:P,parentKey:C,clip:L,viewStyle:N,title:j}=e,R=Pe(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:E,y:S,z:A,key:_,width:n,height:r,depth:i,padding:l,paddingLeft:a,paddingRight:o,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:w,coordinate:k,component:M,interaction:O,frame:T,labelTransform:P,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,parentKey:C,clip:L,style:N},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:j})]})]};HT.props={};class VT{constructor(t){this.$value=t}static of(t){return new VT(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const qT=FT((t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:a,y:o}=e,s=(t,e)=>{var a;if(void 0===t||!i)return{};const o=Un(n,(e=>e[t])),s=(null===(a=null==r?void 0:r[e])||void 0===a?void 0:a.domain)||Array.from(o.keys()),c=s.map((t=>o.has(t)?o.get(t).length:1));return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"top"}},void 0===a&&{paddingInner:0}),s(a,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"right"}},void 0===o&&{paddingInner:0}),s(o,"y"))}}})),UT=zT((t=>{const{data:e,scale:n,legend:r}=t,i=[t];let a,o,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:c={}}=t,{color:l}=n,{color:u}=r,{color:f}=c;void 0!==l&&(a=l),void 0!==u&&(o=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const c="string"==typeof a?a:"",[l,u]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===a)return[void 0];const i="function"==typeof a?a:t=>t[a],o=e.map(i);return o.some((t=>"number"==typeof t))?[$n(o)]:[Array.from(new Set(o)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=l?l:[]}},scale:{color:Z({},o,{domain:l,type:u})}},void 0===r&&{legend:{color:Z({title:c},s)}})})),XT=FT((()=>({animate:{enterType:"fadeIn"}}))),ZT=zT((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),KT=zT((()=>({type:"cell"}))),QT=zT((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,a=r?Array.from(new Set(e.map((t=>t[r])))):[],o=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(a.length&&o.length){const t=[];for(const e of a)for(const n of o)t.push({[r]:e,[i]:n});return t}return a.length?a.map((t=>({[r]:t}))):o.length?o.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),JT=zT(((t,e=tP,n=nP,r=rP,i={})=>{const{data:a,encode:o,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=a,{x:p,y:g}=o,{color:v}=c,{domain:m}=v;return{children:(t,a,o)=>{const{x:c,y:v}=a,{paddingLeft:y,paddingTop:b,marginLeft:x,marginTop:k}=o,{domain:w}=c.getOptions(),{domain:M}=v.getOptions(),O=Ir(t),E=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),v.invert(e)])),A=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),_=A.map((t=>d.filter(t))),T=f?fr(_,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:w.indexOf(t),columnValue:t,columnValuesLength:w.length,rowField:g,rowIndex:M.indexOf(e),rowValue:e,rowValuesLength:M.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return O.flatMap((t=>{const[e,a,o,s]=E[t],c=P[t],f=_[t];return C[t].map((v=>{var w,M,{scale:O,key:E,facet:S=!0,axis:A={},legend:_={}}=v,P=Pe(v,["scale","key","facet","axis","legend"]);const C=(null===(w=null==O?void 0:O.y)||void 0===w?void 0:w.guide)||A.y,L=(null===(M=null==O?void 0:O.x)||void 0===M?void 0:M.guide)||A.x,N={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:m}},I={x:iP(L,n)(c,j),y:iP(C,r)(c,j)};return Object.assign(Object.assign({key:`${E}-${t}`,data:j,margin:0,x:e+y+l+x,y:a+b+u+k,parentKey:h,width:o,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:Z(N,O,R),axis:Z({},A,I),legend:!1},P),i)}))}))}}}));function tP(t){const{points:e}=t;return ks(e)}function eP(t,e){return e.length?Z({title:!1,tick:null,label:null},t):Z({title:!1,tick:null,label:null,grid:null},t)}function nP(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:a,columnValuesLength:o}=e;if(r!==i-1)return eP(t,n);const s=a===o-1&&void 0,c=n.length?void 0:null;return Z({title:s,grid:c},t)}}function rP(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return eP(t,n);const a=0===r&&void 0,o=n.length?void 0:null;return Z({title:a,grid:o},t)}}function iP(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const aP=()=>t=>[VT.of(t).call(KT).call(UT).call(XT).call(qT).call(ZT).call(QT).call(JT).value()];aP.props={};const oP=FT((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),sP=zT((t=>{const{data:e,children:n,x:r=0,y:i=0,key:a}=t;return{children:(t,o,s)=>{const{x:c,y:l}=o,{paddingLeft:u,paddingTop:f,marginLeft:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),v=Ir(t),m=t.map((({points:t})=>ks(t))),y=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=y.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return v.flatMap((t=>{const[n,o,s,c]=m[t],[l,p]=y[t],g=b[t];return x[t].map((v=>{var m,y;const{scale:b,key:x,encode:k,axis:w,interaction:M}=v,O=Pe(v,["scale","key","encode","axis","interaction"]),E=null===(m=null==b?void 0:b.y)||void 0===m?void 0:m.guide,S={x:lP(null===(y=null==b?void 0:b.x)||void 0===y?void 0:y.guide)(g,e),y:uP(E)(g,e)};return Object.assign({data:e,parentKey:a,key:`${x}-${t}`,x:n+u+r+h,y:o+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:Z({x:{facet:!1},y:{facet:!1}},b),axis:Z({x:{tickCount:5},y:{tickCount:5}},w,S),legend:!1,encode:Z({},k,{x:l,y:p}),interaction:Z({},M,{legendFilter:!1})},O)}))}))}}})),cP=zT((t=>{const{encode:e}=t,n=Pe(t,["encode"]),{position:r=[],x:i=r,y:a=[...r].reverse()}=e,o=Pe(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[a].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},o),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[a].flat(1).length&&{y:{paddingInner:0}})})}));function lP(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return eP(t,n)}}function uP(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return eP(t,n)}}const fP=()=>t=>[VT.of(t).call(KT).call(UT).call(sP).call(cP).call(XT).call(ZT).call(oP).value()],hP=FT((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),dP=FT((t=>({coordinate:{type:"polar"}}))),pP=t=>{const{encode:e}=t,n=Pe(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function gP(t){return t=>null}function vP(t){const{points:e}=t,[n,r,i,a]=e,o=ms(n,a),s=gs(n,a),c=xs(s,gs(r,i)),l=1/Math.sin(c/2),u=o/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=bs(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const mP=()=>t=>[VT.of(t).call(KT).call(pP).call(UT).call(dP).call(QT).call(JT,vP,gP,gP,{frame:!1}).call(XT).call(ZT).call(hP).value()];function yP(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const bP=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:a="ease-in-out-sine"}=t,o=e.length;if(!Array.isArray(e)||0===o)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=Z({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,a)));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=yP(i,e,o);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};function xP(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:a}=n,{markState:o}=e,s=Array.from(o.keys()).find((t=>t.key===r));if(s)return a?a.map((t=>s.data[t])):s.data[i]}function kP(t,e,n,r=t=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:a}=i;if(!a)return;const{className:o}=a;if("plot"===o)return;const s=Sj(a,(t=>"element"===t.className));const c=function(t){return Sj(t,(t=>"component"===t.className))}(a),l=function(t){return Sj(t,(t=>"label"===t.className))}(a),u=s||c||l;if(!u)return;const{className:f,markType:h}=u,d=Object.assign(Object.assign({},i),{nativeEvent:!0});"element"===f?(d.data={data:xP(u,e)},n.emit(`element:${t}`,d),n.emit(`${h}:${t}`,d)):"label"===f?(d.data={data:u.attributes.datum},n.emit(`label:${t}`,d),n.emit(`${o}:${t}`,d)):(n.emit(`component:${t}`,d),n.emit(`${o}:${t}`,d))}}function wP(){return(t,e,n)=>{const{container:r,view:i}=t,a=kP(E_.CLICK,i,n,(t=>1===t.detail)),o=kP(E_.DBLCLICK,i,n,(t=>2===t.detail)),s=kP(E_.POINTER_TAP,i,n),c=kP(E_.POINTER_DOWN,i,n),l=kP(E_.POINTER_UP,i,n),u=kP(E_.POINTER_OVER,i,n),f=kP(E_.POINTER_OUT,i,n),h=kP(E_.POINTER_MOVE,i,n),d=kP(E_.POINTER_ENTER,i,n),p=kP(E_.POINTER_LEAVE,i,n),g=kP(E_.POINTER_UPOUTSIDE,i,n),v=kP(E_.DRAG_START,i,n),m=kP(E_.DRAG,i,n),y=kP(E_.DRAG_END,i,n),b=kP(E_.DRAG_ENTER,i,n),x=kP(E_.DRAG_LEAVE,i,n),k=kP(E_.DRAG_OVER,i,n),w=kP(E_.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",v),r.addEventListener("drag",m),r.addEventListener("dragend",y),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",k),r.addEventListener("drop",w),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",v),r.removeEventListener("drag",m),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",k),r.removeEventListener("drop",w)}}}function MP(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":QE,"component.axisLinear":qE,"component.axisArc":UE,"component.legendContinuousBlock":cS,"component.legendContinuousBlockSize":uS,"component.legendContinuousSize":lS,"interaction.event":wP,"composition.mark":HT,"composition.view":YT,"shape.label.label":uM}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Or(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Pe(t,["type"]);n||Or("Plot type is required!");const a=r(n);return null==a?void 0:a(i,e)},r]}function OP(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Or("Cannot find library document")}function EP(t,e){const{coordinate:n={},coordinates:r}=t,i=Pe(t,["coordinate","coordinates"]);if(r)return t;const{type:a,transform:o=[]}=n,s=Pe(n,["type","transform"]);if(!a)return Object.assign(Object.assign({},i),{coordinates:o});const[,c]=MP("coordinate",e),{transform:l=!1}=c(a).props||{};if(l)throw new Error(`Unknown coordinate: ${a}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:a},s),...o]})}function SP(t,e){return t.filter((t=>t.type===e))}function AP(t){return SP(t,"polar").length>0}function _P(t){return SP(t,"transpose").length%2==1}function TP(t){return SP(t,"theta").length>0}function PP(t){return SP(t,"radial").length>0}function CP(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}bP.props={},wP.props={reapplyWhenUpdate:!0};var LP=CP("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),NP=CP("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),jP=CP("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),RP=CP("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),IP=CP("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),DP=CP("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),BP=CP("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),FP=CP("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),zP=CP("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),GP=CP("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),WP=CP("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var $P=t=>()=>t;function YP(t,e){return function(n){return t+n*e}}function HP(t){return 1==(t=+t)?VP:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):$P(isNaN(e)?n:e)}}function VP(t,e){var n=e-t;return n?YP(t,n):$P(isNaN(t)?e:t)}!function t(e){var n=HP(e);function r(t,e){var r=n((t=zl(t)).r,(e=zl(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=VP(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);var qP,UP=(qP=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r<e-1?t[r+2]:2*a-i;return function(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}((n-r/e)*e,o,i,a,s)}},function(t){var e,n,r=t.length,i=new Array(r),a=new Array(r),o=new Array(r);for(e=0;e<r;++e)n=zl(t[e]),i[e]=n.r||0,a[e]=n.g||0,o[e]=n.b||0;return i=qP(i),a=qP(a),o=qP(o),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=o(t),n+""}});function XP(t){return function e(n){function r(e,r){var i=t((e=lu(e)).h,(r=lu(r)).h),a=VP(e.s,r.s),o=VP(e.l,r.l),s=VP(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}XP((function(t,e){var n=e-t;return n?YP(t,n>180||n<-180?n-360*Math.round(n/360):n):$P(isNaN(t)?e:t)}));var ZP=XP(VP),KP=t=>UP(t[t.length-1]),QP=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(CP),JP=KP(QP),tC=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(CP),eC=KP(tC),nC=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(CP),rC=KP(nC),iC=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(CP),aC=KP(iC),oC=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(CP),sC=KP(oC),cC=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(CP),lC=KP(cC),uC=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(CP),fC=KP(uC),hC=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(CP),dC=KP(hC),pC=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(CP),gC=KP(pC),vC=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(CP),mC=KP(vC),yC=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(CP),bC=KP(yC),xC=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(CP),kC=KP(xC),wC=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(CP),MC=KP(wC),OC=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(CP),EC=KP(OC),SC=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(CP),AC=KP(SC),_C=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(CP),TC=KP(_C),PC=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(CP),CC=KP(PC),LC=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(CP),NC=KP(LC),jC=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(CP),RC=KP(jC),IC=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(CP),DC=KP(IC),BC=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(CP),FC=KP(BC),zC=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(CP),GC=KP(zC),WC=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(CP),$C=KP(WC),YC=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(CP),HC=KP(YC),VC=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(CP),qC=KP(VC),UC=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(CP),XC=KP(UC),ZC=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(CP),KC=KP(ZC);var QC=ZP(lu(300,.5,0),lu(-240,.5,1)),JC=ZP(lu(-100,.75,.35),lu(80,1.5,.8)),tL=ZP(lu(260,.75,.35),lu(80,1.5,.8)),eL=lu();var nL=zl(),rL=Math.PI/3,iL=2*Math.PI/3;function aL(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var oL=aL(CP("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),sL=aL(CP("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),cL=aL(CP("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),lL=aL(CP("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),uL=Object.freeze({__proto__:null,schemeCategory10:LP,schemeAccent:NP,schemeDark2:jP,schemeObservable10:RP,schemePaired:IP,schemePastel1:DP,schemePastel2:BP,schemeSet1:FP,schemeSet2:zP,schemeSet3:GP,schemeTableau10:WP,interpolateBrBG:JP,schemeBrBG:QP,interpolatePRGn:eC,schemePRGn:tC,interpolatePiYG:rC,schemePiYG:nC,interpolatePuOr:aC,schemePuOr:iC,interpolateRdBu:sC,schemeRdBu:oC,interpolateRdGy:lC,schemeRdGy:cC,interpolateRdYlBu:fC,schemeRdYlBu:uC,interpolateRdYlGn:dC,schemeRdYlGn:hC,interpolateSpectral:gC,schemeSpectral:pC,interpolateBuGn:mC,schemeBuGn:vC,interpolateBuPu:bC,schemeBuPu:yC,interpolateGnBu:kC,schemeGnBu:xC,interpolateOrRd:MC,schemeOrRd:wC,interpolatePuBuGn:EC,schemePuBuGn:OC,interpolatePuBu:AC,schemePuBu:SC,interpolatePuRd:TC,schemePuRd:_C,interpolateRdPu:CC,schemeRdPu:PC,interpolateYlGnBu:NC,schemeYlGnBu:LC,interpolateYlGn:RC,schemeYlGn:jC,interpolateYlOrBr:DC,schemeYlOrBr:IC,interpolateYlOrRd:FC,schemeYlOrRd:BC,interpolateBlues:GC,schemeBlues:zC,interpolateGreens:$C,schemeGreens:WC,interpolateGreys:HC,schemeGreys:YC,interpolatePurples:qC,schemePurples:VC,interpolateReds:XC,schemeReds:UC,interpolateOranges:KC,schemeOranges:ZC,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:QC,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return eL.h=360*t-100,eL.s=1.5-1.5*e,eL.l=.8-.9*e,eL+""},interpolateWarm:JC,interpolateCool:tL,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,nL.r=255*(e=Math.sin(t))*e,nL.g=255*(e=Math.sin(t+rL))*e,nL.b=255*(e=Math.sin(t+iL))*e,nL+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:oL,interpolateMagma:sL,interpolateInferno:cL,interpolatePlasma:lL});function fL(t,e,n,r,i,a){const{guide:o={}}=n,s=function(t,e,n){const{type:r,domain:i,range:a,quantitative:o,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return AL(t,Lr)}(e))return"identity";if("string"==typeof a)return"linear";if((i||a||[]).length>2)return wL(t,s);if(void 0!==i)return EL([i])?wL(t,s):SL(e)?"time":ML(t,a,o);return EL(e)?wL(t,s):SL(e)?"time":ML(t,a,o)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return OL(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)Sr(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return OL(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Sr(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(yL({type:t}))return function(t,e,n){const r=t.map(Number),i=new oo({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return bL({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ta,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?TP(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:a=i,paddingOuter:o=i}=r;return Object.assign(Object.assign({},r),{paddingInner:a,paddingOuter:o,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=G(e),i=uL[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:xL(s,t,e,n,l,i,a),expectedDomain:c,guide:o,name:t,type:s})}function hL(t,e){const n={};for(const r of t){const{values:t,name:i}=r,a=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>a.map(t)))}}return n}function dL(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter((t=>t.startsWith(e))).map((t=>+(t.replace(e,"")||0))),a=fr(i)+1,o=`${e}${a}`;t[o]=r,r.getOptions().key=o}else t[e]=r}return t}function pL(t,e){const[n]=MP("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[kr,kr];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const a=t.filter((([t])=>"function"==typeof t)),o=t.filter((([t])=>"function"!=typeof t)),s=new Map(o);if(r.map=t=>{for(const[e,n]of a)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(o.map((([t,e])=>[e,t]))),l=new Map(a.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function gL(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));mL(e,"x"),mL(e,"y")}function vL(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function mL(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(yL)?$n(r):n.every(bL)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function yL(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function bL(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function xL(t,e,n,r,i,a,o){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=kL(n,r,i,a,o),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[Dr(e),Br(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=c?c:s,null!=l?l:u]}case"band":case"point":return[null!=c?c:"size"===e?5:0,null!=l?l:"size"===e?10:1];case"ordinal":return kL(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function kL(t,e,n,r,i){const[a]=MP("palette",i),{category10:o,category20:s}=r,c=function(t){return Array.from(new Set(t))}(n).length<=o.length?o:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return a({type:l})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=G(t),i=uL[`scheme${r}`],a=uL[`interpolate${r}`];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>a(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function wL(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function ML(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function OL(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,a]=t;return[null!=n?n:i,null!=r?r:a]}function EL(t){return AL(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function SL(t){return AL(t,(t=>t instanceof Date))}function AL(t,e){for(const n of t)if(n.some(e))return!0;return!1}const _L={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},TL={threshold:"threshold",quantize:"quantize",quantile:"quantile"},PL={ordinal:"ordinal",band:"band",point:"point"},CL={constant:"constant"};function LL(t,e,n){const{coordinates:r=[],title:i}=e,[,a]=MP("component",n),o=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=MP("component",n),{coordinates:i}=t;function a(t,e,n,a){const o=function(t,e,n=[]){return"x"===t?_P(n)?`${e}Y`:`${e}X`:"y"===t?_P(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!a||!o)return;const{props:s}=r(o),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:o,crossPadding:f},a),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[a("slider",r,t,e),a("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=a("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:o,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:o},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,a=n&&n.length>0,o=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&a&&o)||!(!["sequential"].includes(e)||!a||!o&&!i)||!(!["constant","identity"].includes(e)||!o)}(t)));return[...RL(n),...DL(n,e)]}(o,r);return l.forEach((([t,e])=>{const{props:n}=a(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,g=Z({},...e),{guide:v,field:m}=g,y=Array.isArray(v)?v:[v];for(const n of y){const[a,g]=zL(t,i,l,n,e,o,r);if(!a&&!g)continue;const v="left"===a||"right"===a,y=v?d[1]:d[0],b=v?p[1]:p[0],{size:x,order:k=f,length:w=h,padding:M=y,crossPadding:O=b}=n;s.push(Object.assign(Object.assign({title:m},n),{defaultSize:u,length:w,position:a,plane:c,orientation:g,padding:M,order:k,crossPadding:O,size:x,type:t,scales:e}))}})),s}function NL(t,e,n,r,i){const[a]=MP("component",r),{scaleInstances:o,scale:s,bbox:c}=t,l={bbox:c,library:r};return a(Pe(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function jL(t,e){const n=["left","right","bottom","top"],r=Xn(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=xr(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=fr(t,(t=>t.size)),r=fr(t,(t=>t.order)),i=fr(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function RL(t,e){const n=["shape","size","color","opacity"],r=t.filter((({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e))),i=r.filter((({type:t})=>"constant"===t)),a=Xn(r.filter((({type:t})=>"constant"!==t)),(t=>t.field?t.field:Symbol("independent"))).map((([t,e])=>[t,[...e,...i]])).filter((([,t])=>t.some((t=>"constant"!==t.type)))),o=new Map(a);if(0===o.size)return[];const s=t=>t.sort((([t],[e])=>t.localeCompare(e))),c=Array.from(o).map((([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...zr(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,IL(t)]))})));for(const{option:t,combination:e}of n)if(!t.every((t=>"constant"===t[1]))&&t.every((t=>"discrete"===t[1]||"constant"===t[1])))return["legendCategory",e];for(const[t,e]of S_)for(const{option:r,combination:i}of n)if(e.some((t=>J(s(t),s(r)))))return[t,i];return null})).filter(Sr);return c}function IL(t){const{type:e}=t;return"string"!=typeof e?null:e in _L?"continuous":e in PL?"discrete":e in TL?"distribution":e in CL?"constant":null}function DL(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return SP(t,"helix").length>0}(e)||TP(e))return null;if(_P(e)&&(AP(e)||PP(e)))return null;if(n.startsWith("x"))return AP(e)?["axisArc",[t]]:PP(e)?["axisLinear",[t]]:[_P(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return AP(e)?["axisLinear",[t]]:PP(e)?["axisArc",[t]]:[_P(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return SP(t,"radar").length>0}(e))return["axisRadar",[t]];if(!AP(e))return["axisY",[t]]}return null})).filter(Sr)}function BL(t){const e=SP(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=SP(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=o(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function FL(t,e,n,r,i){const{name:a}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(a);if(a===t.slice(-1)[0].name||null===e)return[null,null];const[n,o]=BL(i);return["center",(o-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return SP(t,"parallel").length>0}(i))return _P(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=BL(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:AP(i)||PP(i)?["center",null]:"axisX"===t&&function(t){return SP(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return SP(t,"reflectY").length>0}(i)?["top",null]:e}function zL(t,e,n,r,i,a,o){const[s]=BL(o),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?FL(t,c,i,a,o):"string"==typeof t&&t.startsWith("legend")&&AP(o)&&"center"===r.position?["center","vertical"]:c}function GL(t,e,n,r,i,a){const{type:o}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof o)return;const s=o;return(s.startsWith("axis")?VL:s.startsWith("group")?WL:s.startsWith("legendContinuous")?qL:"legendCategory"===s?UL:s.startsWith("slider")?HL:"title"===s?YL:s.startsWith("scrollbar")?$L:()=>{})(t,e,n,r,i,a)}function WL(t,e,n,r,i,a){const{children:o}=t,s=fr(o,(t=>t.crossPadding));o.forEach((t=>t.crossPadding=s)),o.forEach((t=>GL(t,e,n,r,i,a)));const c=fr(o,(t=>t.size));t.size=c,o.forEach((t=>t.size=c))}function $L(t,e,n,r,i,a){const{trackSize:o=6}=Z({},i.scrollbar,t);t.size=o}function YL(t,e,n,r,i,a){const o=Z({},i.title,t),{title:s,subtitle:c,spacing:l=0}=o,u=Pe(o,["title","subtitle","spacing"]);if(s){const e=tN(s,_r(u,"title"));t.size=e.height}if(c){const e=tN(c,_r(u,"subtitle"));t.size+=l+e.height}}function HL(t,e,n,r,i,a){const{trackSize:o,handleIconSize:s}=(()=>{const{slider:e}=i;return Z({},e,t)})(),c=Math.max(o,2.4*s);t.size=c}function VL(t,e,n,r,i,a){var o;t.transform=t.transform||[{type:"hide"}];const s="left"===r||"right"===r,c=QL(t,r,i),{tickLength:l=0,labelSpacing:u=0,titleSpacing:f=0,labelAutoRotate:h}=c,d=Pe(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),p=XL(t,a),g=ZL(d,p),v=l+u;if(g&&g.length){const r=fr(g,(t=>t.width)),i=fr(g,(t=>t.height));if(s)t.size=r+v;else{const{tickFilter:a,labelTransform:s}=t;!function(t,e,n,r,i){const a=xr(e,(t=>t.width));if(a>n)return!0;const o=t.clone();o.update({range:[0,n]});const s=JL(t,i),c=s.map((t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(o,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],h=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=h(n,e[t]);if(r<u||i>f)return!0;const a=c[t+1];if(a){const[n]=h(a,e[t+1]);if(i>n)return!0}}return!1}(p,g,e,n,a)||s||!1===h||null===h?(t.labelTransform=null!==(o=t.labelTransform)&&void 0!==o?o:"rotate(0)",t.size=i+v):(t.labelTransform="rotate(90)",t.size=r+v)}}else t.size=l;const m=KL(d);m&&(t.size+=s?f+m.width:f+m.height)}function qL(t,e,n,r,i,a){const o=(()=>{const{legendContinuous:e}=i;return Z({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=o,l=Pe(o,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=_r(l,"ribbon"),{size:h}=f,d=_r(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const v=ZL(l,XL(t,a));if(v){const e=u?"width":"height",n=fr(v,(t=>t[e]));t.size+=n+s}const m=KL(l);m&&(u?t.size=Math.max(t.size,m.width):t.size+=c+m.height)}function UL(t,e,n,r,i,a){const o=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,a]=Array.isArray(n)?[n,void 0]:[void 0,n];return Z({title:r},e,Object.assign(Object.assign({},t),{title:a}))})(),{itemSpacing:s,itemMarkerSize:c,titleSpacing:l,rowPadding:u,colPadding:f,maxCols:h=1/0,maxRows:d=1/0}=o,p=Pe(o,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:v}=t,m=t=>Math.min(t,d),y=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===v?e+(b?0:n[0]+n[1]):v,k=KL(p),w=ZL(p,XL(t,a),"itemLabel"),M=Math.max(w[0].height,c)+u,O=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,a=-1/0,o=-1/0;const s=k?k.height:0,c=x-s;for(const{width:t}of w){const s=O(t,f);e=Math.max(e,s),n+M>c?(r++,a=Math.max(a,i),o=Math.max(o,n),i=1,n=M):(n+=M,i++)}r<=1&&(a=i,o=n),t.size=e*y(r),t.length=o+s,Z(t,{cols:y(r),gridRow:a})})():"number"==typeof g?(()=>{const e=Math.ceil(w.length/g),n=fr(w,(t=>O(t.width)))*g;t.size=M*m(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of w){const i=O(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=M*m(e)-u,t.length=r})(),k&&(b?t.size=Math.max(t.size,k.width):t.size+=l+k.height)}function XL(t,e){const[n]=MP("scale",e),{scales:r,tickCount:i,tickMethod:a}=t,o=r.find((t=>"constant"!==t.type&&"identity"!==t.type));return void 0!==i&&(o.tickCount=i),void 0!==a&&(o.tickMethod=a),n(o)}function ZL(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=Pe(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=function(t,e,n){const r=JL(t,n),i=r.map((t=>"number"==typeof t?mm(t):t)),a=e?"string"==typeof e?AE(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(a)}(e,r,i),c=_r(o,n),l=s.map(((t,e)=>Object.fromEntries(Object.entries(c).map((([n,r])=>[n,"function"==typeof r?r(t,e):r]))))),u=s.map(((t,e)=>tN(t,l[e]))),f=l.some((t=>t.transform));if(!f){const e=s.map(((t,e)=>e));t.indexBBox=new Map(e.map((t=>[t,[s[t],u[t]]])))}return u}function KL(t){const{title:e}=t,n=Pe(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=_r(n,"title"),{direction:i,transform:a}=r,o=Array.isArray(e)?e.join(","):e;if("string"!=typeof o)return null;return tN(o,Object.assign(Object.assign({},r),{transform:a||("vertical"===i?"rotate(-90)":"")}))}function QL(t,e,n){const{title:r}=t,[i,a]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:o,[`axis${Mr(e)}`]:s}=n;return Z({title:i},o,s,Object.assign(Object.assign({},t),{title:a}))}function JL(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function tN(t,e){const n=function(t){return t instanceof Rg?t:new tv({style:{text:`${t}`}})}(t),r=Pe(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function eN(t,e,n,r){var i,a;const{width:o,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:v=h,margin:m=(null!==(a=n.margin)&&void 0!==a?a:0),marginLeft:y=m,marginBottom:b=m,marginTop:x=m,marginRight:k=m,padding:w=n.padding,paddingBottom:M=w,paddingLeft:O=w,paddingRight:E=w,paddingTop:S=w}=function(t,e,n,r){const{coordinates:i}=e;if(!AP(i)&&!PP(i))return e;const a=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===a.length)return e;const o=a.map((t=>QL(t,"axisArc"===t.type?"arc":"linear",n))),s=fr(o,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=a.flatMap(((t,e)=>ZL(o[e],XL(t,r)))).filter(Sr),l=fr(c,(t=>t.height))+s,u=a.flatMap(((t,e)=>KL(o[e]))).filter((t=>null!==t)),f=0===u.length?0:fr(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:v=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),A=(t,n,r,i,a)=>{const{marks:o}=e;if(0===o.length)return[i,a];if(t-i-a-.25*t>0)return[i,a];const s=.75*t;return["auto"===n?s*i/(i+a):i,"auto"===r?s*a/(i+a):a]},_=t=>"auto"===t?20:null!=t?t:20,T=_(S),P=_(M),C=nN(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:L,paddingRight:N}=C,j=o-y-k,[R,I]=A(j,O,E,L,N),D=j-R-I,B=nN(t,D,[R+y,I+k],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=B,G=s-b-x,[W,$]=A(G,M,S,z,F);return{width:o,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:v,innerWidth:D,innerHeight:G-W-$,paddingLeft:R,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:y,marginBottom:b,marginTop:x,marginRight:k,x:l,y:u,z:f}}function nN(t,e,n,r,i,a,o){const s=Un(t,(t=>t.position)),{padding:c=a.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${Mr(qw(t))}`,i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=fr(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(GL(r,e,n,t,a,o),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=dr(i,(t=>t.order)),v=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(v.length&&(v[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=jL(i,p?e+n[0]+n[1]:e);t.forEach(f);const a=t.reduce(((t,{size:e,crossPadding:n=12})=>t+e+n),0);d[r]=a}}return d}function rN({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:a,marginLeft:o,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:h,insetLeft:d,insetRight:p,insetTop:g}){const v=n+o,m=i+s,y=r+l,b=a+c,x=t-o-l,k=[v+d,m+g,f-d-p,u-g-h,"center",null,null];return{top:[v,0,f,m,"vertical",!0,Cn,o,x],right:[t-y,m,y,u,"horizontal",!1,Cn],bottom:[v,e-b,f,b,"vertical",!1,Cn,o,x],left:[0,m,v,u,"horizontal",!0,Cn],"top-left":[v,0,f,m,"vertical",!0,Cn],"top-right":[v,0,f,m,"vertical",!0,Cn],"bottom-left":[v,e-b,f,b,"vertical",!1,Cn],"bottom-right":[v,e-b,f,b,"vertical",!1,Cn],center:k,inner:k,outer:k}}function iN(t,e,n,r){const[i,a]=Fr(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return Yc(t)&&Gc(t)}(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Gc(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n):Yc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,a]=n,o=new Array(t.length).fill(0),s=e.map(o),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],o=c[e+1]-i;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,a]=n,o=new Array(t.length).fill(0),s=e.map(o),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],o=c[e+1]-r;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,a]=n,[o,s]=e.getCenter(),[c]=qc(e),l=c*(a/2),u=o-l,f=s-l;for(let e=0;e<t.length;e++){t[e].bbox={x:r+u,y:i+f,width:2*l,height:2*l}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,a,o]=n,[s]=qc(e),c=o/2*s/Math.sqrt(2),l=r+a/2,u=i+o/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(a,e,n)}function aN(t,e,n){const[r,i,a,o,s,c,l,u,f]=n,[h,d,p,g,v,m,y,b]="vertical"===s?["y",i,"x",r,"height",o,"width",a]:["x",r,"y",i,"width",a,"height",o];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),k=(t,e,n)=>void 0===n?e:x(t)?n:e,w=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+m:d;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:a}=r,{size:o}=r;r.bbox={[h]:c?n-o-i:n+i,[p]:w(a,g,u),[v]:o,[y]:k(a,b,f)},n+=(o+i)*(c?-1:1)}const M=t.filter((t=>"group"===t.type));for(const t of M){const{bbox:e,children:n}=t,r=e[y],i=r/n.length,a=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),o=n.map(((t,e)=>{const{length:r=i,padding:a=0}=t;return r+(e===n.length-1?0:a)})),s=r-xr(o),c="flex-start"===a?0:"center"===a?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[v]:e[v],[h]:e[h],[p]:r,[y]:o[t]-c},Z(i,{layout:{justifyContent:a}}),r+=o[t]}}}function oN(t,e,n){const{encode:r={},scale:i={},transform:a=[]}=e,o=Pe(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},o),{encode:r,scale:i,transform:a})]}function sN(t,e,n){return Le(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=MP("data",t),a=function(t){if(j(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=Pe(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:o=[]}=a,s=[Pe(a,["transform"]),...o].map((t=>i(t,n))),c=yield function(t){return t.reduce(((t,e)=>n=>Le(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),kr)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?Ir(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function cN(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function lN(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const a=Rr(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Sr(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:a})]}function uN(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Rr(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function fN(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:a}=n,o=function(t){const[e]=MP("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:yN(n)})}(a),s=Rr(r,(t=>o(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function hN(t,e,n){const{tooltip:r={}}=e;return Nr(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Lr(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function dN(t,e,n){const{data:r,encode:i,tooltip:a={}}=e;if(Nr(a))return[t,e];const o=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(Lr(e)){const{field:n,channel:a,color:o,name:s=n,valueFormatter:c=t=>t}=e,l="string"==typeof c?AE(c):c,u=a&&i[a],f=u&&i[a].field,h=s||f||a,d=[];for(const e of t){const t=n?r[e][n]:u?i[a].value[e]:null;d[e]={name:h,color:o,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const a of t){const t=e(r[a],a,r,i);Lr(t)?n[a]=t:n[a]={value:t}}return n}return e},{title:s,items:c=[]}=a,l=Pe(a,["title","items"]),u=Object.assign({title:o(s),items:Array.isArray(c)?c.map(o):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function pN(t,e,n){const{encode:r}=e,i=Pe(e,["encode"]);if(!r)return[t,e];const a=Object.entries(r),o=a.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,a=Pe(n,["value"]);for(let n=0;n<i.length;n++){const a=i[n];if(Array.isArray(a))for(let i=0;i<a.length;i++){const o=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];o[1][n]=a[i],r[i]=o}}return r.map((([t,e])=>[t,Object.assign({type:"column",value:e},a)]))})),s=Object.fromEntries([...a,...o]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function gN(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return Z(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map((t=>{const e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]})))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function vN(t,e,n){const{animate:r}=e;return r||void 0===r||Z(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function mN(t,e,n){return Le(this,void 0,void 0,(function*(){const[r,i]=yield function(t,e,n){return Le(this,void 0,void 0,(function*(){const{library:r}=n,[i]=MP("transform",r),{preInference:a=[],postInference:o=[]}=e,{transform:s=[]}=t,c=[oN,sN,cN,lN,uN,fN,pN,vN,gN,hN,...a.map(i),...s.map(i),...o.map(i),dN];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,n),{encode:a,scale:o,data:s,tooltip:c}=i;if(!1===Array.isArray(s))return null;const{channels:l}=e,u=Kn(Object.entries(a).filter((([,t])=>Sr(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=l.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),f=l.filter((t=>{const{name:e,required:n}=t;if(u.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:a,ordinal:s}=t;return u.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=o[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Pe(f,["independent","key","type"]),v="constant"===p,m=v?void 0:i;return{name:t,values:e,scaleKey:h||v?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:m},g),{quantitative:a,ordinal:s})}}))}));return[i,Object.assign(Object.assign({},e),{index:r,channels:f,tooltip:c})]}))}function yN(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function bN(t,e,n){var r;return Le(this,void 0,void 0,(function*(){const{library:i}=n,[a]=MP("composition",i),[o]=MP("interaction",i),s=new Set(Object.keys(i).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Sr)),c=new Set(Object.keys(i).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Sr)),l=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||c.has(e)?"mark":e},u=t=>"mark"===l(t),f=t=>"standardView"===l(t),h=t=>{const{type:e}=t;return"string"==typeof e&&!!c.has(e)},d=t=>{if(f(t))return[t];const e=l(t);return a({type:e,static:h(t)})(t)},p=[],g=new Map,v=new Map,m=[t],y=[];for(;m.length;){const t=m.shift();if(f(t)){const e=v.get(t),[r,a]=e?EN(e,t,i):yield wN(t,n);g.set(r,t),p.push(r);const o=a.flatMap(d).map((t=>EP(t,i)));if(m.push(...o),o.every(f)){const t=yield Promise.all(o.map((t=>MN(t,n))));gL(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];v.set(n,r)}}}else{const e=d(u(t)?t:yield zN(t,n));Array.isArray(e)?m.push(...e):"function"==typeof e&&y.push(e())}}n.emitter.emit(E_.BEFORE_PAINT);const x=new Map,k=new Map,w=[];e.selectAll(YN(nA)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",nA).attr("id",(t=>t.key)).call(xN).each((function(t,e,r){SN(t,pm(r),w,n),x.set(t,r)}))),(t=>t.call(xN).each((function(t,e,r){SN(t,pm(r),w,n),k.set(t,r)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const M=(t,e,r)=>Array.from(t.entries()).map((([i,a])=>{const o=r||new Map,s=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=MP("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),a=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,o=FN(e),s=o.map(i).filter(a).map((t=>t[0]));return(e,r,i)=>Le(this,void 0,void 0,(function*(){const a=[],[o,c]=yield wN(e,n);SN(o,t,a,n);for(const i of s.filter((t=>t!==r)))kN(i,t,e,o,n);for(const e of c)bN(e,t,n);return i(),{options:e,view:o}}))}(pm(a),s,n);return{view:i,container:a,options:s,setState:(t,e=t=>t)=>o.set(t,e),update:(n,r)=>Le(this,void 0,void 0,(function*(){const i=wr(Array.from(o.values()))(s);return yield c(i,n,(()=>{b(r)&&e(t,r,o)}))}))}})),O=(t=k,e,r)=>{var i;const a=M(t,O,r);for(const t of a){const{options:r,container:s}=t,c=s.nameInteraction;let l=FN(r);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=ON(t.view,r,s,o)(t,a,n.emitter);c.set(r,{destroy:e})}}}},E=M(x,O);for(const t of E){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of FN(e)){const[e,a]=i;if(a){const i=ON(t.view,e,a,o)(t,E,n.emitter);r.set(e,{destroy:i})}}}O();const{width:S,height:A}=t,_=[];for(const t of y){const r=new Promise((r=>Le(this,void 0,void 0,(function*(){for(const r of t){const t=Object.assign({width:S,height:A},r);yield bN(t,e,n)}r()}))));_.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach((t=>null==t?void 0:t.cancel())),n.animations=w,n.emitter.emit(E_.AFTER_PAINT);const T=w.filter(Sr).map(RN).map((t=>t.finished));return Promise.all([...T,..._])}))}function xN(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function kN(t,e,n,r,i){var a;const{library:o}=i,[s]=MP("interaction",o),c=e.node().nameInteraction,l=FN(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!l[1])return;const f=ON(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set(t,{destroy:d})}function wN(t,e){return Le(this,void 0,void 0,(function*(){const{library:n}=e,r=yield function(t,e){return Le(this,void 0,void 0,(function*(){const{library:n}=e,[r,i]=MP("mark",n),a=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Sr)),{marks:o}=t,s=[],c=[],l=[...o],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:a=r,paddingTop:o=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:v=d,insetBottom:m=d}=t,y=t=>"auto"===t?20:t;return{width:n-y(i)-y(a)-l-u-p-g,height:e-y(o)-y(s)-f-h-v-m}}(t),h={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield zN(t,e),{type:o=Or("G2Mark type is required."),key:u}=n;if(a.has(o))c.push(n);else{const{props:t={}}=i(o),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,h),a=Array.isArray(i)?i:[i];l.unshift(...a.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})}))}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,a=Pe(t,["coordinate","interaction","style","marks"]),o=i.map((t=>t.coordinate||{})),s=i.map((t=>t.interaction||{})),c=i.map((t=>t.viewStyle||{})),l=[...o,e].reduceRight(((t,e)=>Z(t,e)),{}),u=[n,...s].reduce(((t,e)=>Z(t,e)),{}),f=[...c,r].reduce(((t,e)=>Z(t,e)),{});return Object.assign(Object.assign({},a),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const a=EP(i,n);return EN(yield MN(a,e),a,n)}))}function MN(t,e){return Le(this,void 0,void 0,(function*(){const{library:n}=e,[r]=MP("theme",n),[,i]=MP("mark",n),{theme:a,marks:o,coordinates:s=[]}=t,c=r(BN(a)),l=new Map;for(const t of o){const{type:n}=t,{props:r={}}=i(n),a=yield mN(t,r,e);if(a){const[t,e]=a;l.set(t,e)}}const u=Un(Array.from(l.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of u.values()){const e=t.reduce(((t,{scale:e})=>Z(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],a=Array.from(new Set(i.map((t=>t.field)).filter(Sr))),o=Z({guide:{title:0===a.length?void 0:a},field:a[0]},e),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},fL(l,u,o,s,c,n)),{uid:Symbol("scale"),key:r});t.forEach((t=>t.scale=f))}return l}))}function ON(t,e,n,r){const i=t.theme,a="string"==typeof e&&i[e]||{};return r(Z(a,Object.assign({type:e},n)))}function EN(t,e,n){var r;const[i]=MP("mark",n),[a]=MP("theme",n),[o]=MP("labelTransform",n),{key:s,frame:c=!1,theme:l,clip:u,style:f={},labelTransform:h=[]}=e,d=a(BN(l)),p=Array.from(t.values()),g=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],a=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),o=new Map(a.map((t=>[t.name,t])));for(const t of r){const e=vL(t);for(const r of e){const e=o.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=Z({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:nt(t,i)});a.push(e)}}}return a}(p,e),v=function(t){return t.map((t=>{const e=Z(t,t.style);return delete e.style,e}))}(LL(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const a={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},o=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:o,name:"shape",type:"constant",domain:[],range:[a[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),m=eN(v,e,d,n),y=function(t,e,n){const[r]=MP("coordinate",n),{innerHeight:i,innerWidth:a,insetLeft:o,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?h:[...h,{type:"cartesian"}];var h;const d="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:o,y:s,width:a-o-c,height:i-l-s,transformations:f.flatMap(r)});return d?new BT(p):new jT(p)}(m,e,n),b=c?Z({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=Un(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m,height:y,width:b,depth:x}=n,k={xy:rN({width:b,height:y,paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m}),yz:rN({width:x,height:y,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:y,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:rN({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),a=k[r][i],[o,s]=Fr(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));o.length&&iN(o,e,a,i),s.length&&aN(n,0,a)}}(jL(v),y,m),function(t){const e=t.find((({type:t})=>"axisX"===t)),n=t.find((({type:t})=>"axisY"===t)),r=t.find((({type:t})=>"axisZ"===t));e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap((t=>{const{channels:e}=t;return e.map((({scale:t})=>[t.uid,pL(t,n)]))})));!function(t,e){const n=Array.from(t.values()).flatMap((t=>t.channels)),r=Kn(n,(t=>t.map((t=>e.get(t.scale.uid)))),(t=>t.name)).filter((([,t])=>t.some((t=>"function"==typeof t.getOptions().groupTransform))&&t.every((t=>t.getTicks)))).map((t=>t[1]));r.forEach((t=>{const e=t.map((t=>t.getOptions().groupTransform))[0];e(t)}))}(t,x);const k={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:a}=t,o=null!==(r=x.get(a))&&void 0!==r?r:pL(t,n);i.push(o),"y"===e&&o.update(Object.assign(Object.assign({},o.getOptions()),{xScale:k.x})),dL(k,{[e]:o})}t.scaleInstances=i}const w=[];for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:a,key:o}=e,{index:c,channels:l,tooltip:u}=n,f=Object.fromEntries(l.map((({name:t,scale:e})=>[t,e]))),h=Rr(f,(({uid:t})=>x.get(t)));dL(k,h);const d=hL(l,h),p=i(e),[g,v,b]=AN(p(c,h,d,y)),M=r||g.length,O=a?a(v,M,m):[],E=t=>{var e,n;return null===(n=null===(e=u.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},S=t=>u.items.map((e=>e[t])),A=g.map(((t,e)=>{const n=Object.assign({points:v[e],transform:O[e],index:t,markKey:o,viewKey:s},u&&{title:E(t),items:S(t)});for(const[r,i]of Object.entries(d))n[r]=i[t],b&&(n[`series${G(r)}`]=b[e].map((t=>i[t])));return b&&(n.seriesIndex=b[e]),b&&u&&(n.seriesItems=b[e].map((t=>S(t))),n.seriesTitle=b[e].map((t=>E(t)))),n}));n.data=A,n.index=g;const _=null==t?void 0:t(A,h,m);w.push(..._||[])}return[{layout:m,theme:d,coordinate:y,markState:t,key:s,clip:u,scale:k,style:b,components:v,labelTransform:wr(h.map(o))},w]}function SN(t,e,n,r){return Le(this,void 0,void 0,(function*(){const{library:i}=r,{components:a,theme:o,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:v,height:m}=s,y=Pe(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),k=b.map((t=>Tr(Object.assign({},o.view,f),t))),w=["a","margin","padding","inset"].map((t=>_r(y,t))),M=t=>t.style("x",(t=>_[t].x)).style("y",(t=>_[t].y)).style("width",(t=>_[t].width)).style("height",(t=>_[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(pm(n),k[t])}));let O=0,E=0,S=v,A=m;const _=x.map((t=>{const e=w[t],{left:n=0,top:r=0,bottom:i=0,right:a=0}=e;return O+=n,E+=r,S-=n+a,A-=r+i,{x:O,y:E,width:S,height:A}}));e.selectAll(YN(oA)).data(x.filter((t=>Sr(k[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",oA).style("zIndex",-2).call(M)),(t=>t.call(M)),(t=>t.remove()));const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:a}=i,{enter:o={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=o,{type:g,duration:v=300,delay:m=0}=c;for(const t of a){const{updateType:r=l,updateDuration:i=u,updateDelay:a=f,enterType:o=h,enterDuration:s=d,enterDelay:c=p,exitDuration:y=v,exitDelay:b=m,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+a),n=Math.min(n,a)),(void 0===x||x)&&(e=Math.max(e,y+b),n=Math.min(n,b)),(void 0===o||o)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of Xn(a,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(YN(iA)).data(a,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",iA).append((t=>NL(Z({animate:P,scale:d},t),l,o,i,c)))),(t=>t.transition((function(t,e,n){const{preserve:r=!1}=t;if(r)return;const a=NL(Z({animate:P,scale:d},t),l,o,i,c),{attributes:s}=a,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(Sr));const L=e.selectAll(YN(rA)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",rA).call(GN).call($N,Array.from(c.keys())).call(HN,h)),(t=>t.call($N,Array.from(c.keys())).call((t=>T?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{transform:a,width:o,height:s}=i.style,{paddingLeft:c,paddingTop:l,innerWidth:u,innerHeight:f,marginLeft:h,marginTop:d}=t,p=[{transform:a,width:o,height:s},{transform:`translate(${c+h}, ${l+d})`,width:u,height:f}];return i.animate(p,{delay:n,duration:r,fill:"both"})}))}(t,T):GN(t))).call(HN,h))).transitions();n.push(...L.flat());for(const[a,o]of c.entries()){const{data:s}=o,{key:c,class:l,type:u}=a,f=e.select(`#${c}`),h=CN(a,o,t,r),d=jN(a,o,t,i),p=IN(a,o,t,i),g=DN(a,o,t,i),v=TN(e,f,l,"element"),m=f.selectAll(YN(eA)).selectFacetAll(v).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",eA).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=Ar((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){PN(i,e,n);const a=h(t,r),o=p(t,[i],[a]);return null!==o||(i.nodeName===a.nodeName&&"g"!==a.nodeName?Er(i,a):(i.parentNode.replaceChild(a,i),a.className=eA,a.markType=u,a.__data__=i.__data__)),o})).attr("markType",u).attr("className",eA)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return g(t,[n])})).remove()),(t=>t.append(h).attr("className",eA).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new gm(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new gm([],n.__toData__,n.parentNode).append(h).attr("className",eA).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...m.flat())}!function(t,e,n,r,i){const[a]=MP("labelTransform",r),{markState:o,labelTransform:s}=t,c=e.select(YN(tA)).node(),l=new Map,u=new Map,f=Array.from(o.entries()).flatMap((([n,a])=>{const{labels:o=[],key:s}=n,c=function(t,e,n,r,i){const[a]=MP("shape",r),{data:o,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map((t=>t.points)),f=Rr(s,(t=>t.value)),{theme:h,coordinate:d}=n,p=Object.assign(Object.assign({},i),{document:OP(i),theme:h,coordinate:d});return t=>{const{index:e,points:n}=t,r=o[e],{formatter:i=t=>`${t}`,transform:s,style:c,render:d,selector:g,element:v}=t,m=Pe(t,["formatter","transform","style","render","selector","element"]),y=Rr(Object.assign(Object.assign({},m),c),(t=>_N(t,r,e,o,{channel:f,element:v}))),{shape:b=l,text:x}=y,k=Pe(y,["shape","text"]),w="string"==typeof i?AE(i):i,M=Object.assign(Object.assign({},k),{text:w(x,r,e,o),datum:r}),O=Object.assign({type:`label.${b}`,render:d},k);return a(O,p)(n,M,LN(h,"label",b,"label"),u)}}(n,a,t,r,i),f=e.select(`#${s}`).selectAll(YN(eA)).nodes().filter((t=>!t.__removed__));return o.flatMap(((t,e)=>{const n=Pe(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:a,key:o,index:s}=n.__data__,c=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:a}=r;return[i,a]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${o}-${e}`,bounds:c,index:s,points:a,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,o)=>Object.assign(Object.assign({},t),{key:`${i[o]}-${e}`,bounds:[a[o]],index:r,points:a,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,(t=>c(Object.assign(Object.assign({},t),{element:r})))),u.set(e,t)})),i}))}))})),h=pm(c).selectAll(YN(aA)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",aA)),(t=>t.each((function(t,e,n){Er(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=Un(h,(t=>u.get(t.__data__))),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of d){const{transform:n=[]}=t;wr(n.map(a))(e,v)}s&&s(h,v)}(t,e,0,i,r)}))}function AN([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const a=t[n],o=e[n];o.every((([t,e])=>Sr(t)&&Sr(e)))&&(r.push(a),i.push(o))}return[r,i]}function _N(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:Lr(e)&&void 0!==e[t]?e[t]:t}function TN(t,e,n,r){return t.node().parentElement.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r)))}function PN(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[a,o]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${a-s}, ${o-c})`),e.append(t)}function CN(t,e,n,r){const{library:i}=r,[a]=MP("shape",i),{data:o,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=Rr(s,(t=>t.value)),h=l.map((t=>t.points)),{theme:d,coordinate:p}=n,{type:g,style:v={}}=t,m=Object.assign(Object.assign({},r),{document:OP(r),coordinate:p,theme:d});return e=>{const{shape:n=c}=v,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=Pe(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},p),{index:l}),b=s?s.map((t=>o[t])):o[l],x=s||l,k=Rr(v,(t=>_N(t,b,x,o,{channel:f})));return(u[r]?u[r](k,m):a(Object.assign(Object.assign({},k),{type:WN(t,r)}),m))(i,y,LN(d,g,r,c),h)}}function LN(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,a=t[e]||{},o=a[n]||a[r];return Object.assign({color:i},o)}function NN(t,e,n,r,i){var a,o;const[,s]=MP("shape",i),[c]=MP("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${G(t)}Animation`,{[d]:p}=(null===(a=u[l])||void 0===a?void 0:a.props)||s(WN(e,l)).props,{[t]:g={}}=f,v=(null===(o=e.animate)||void 0===o?void 0:o[t])||{},m={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:a,[`${t}Duration`]:o,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},v);if(!l.type)return null;const u=c(l,m)(n,r,Z(g,{delay:a,duration:o,easing:s}));return Array.isArray(u)?u:[u]}}function jN(t,e,n,r){return NN("enter",t,e,n,r)}function RN(t){return t.finished.then((()=>{t.cancel()})),t}function IN(t,e,n,r){return NN("update",t,e,n,r)}function DN(t,e,n,r){return NN("exit",t,e,n,r)}function BN(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Pe(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function FN(t){const{interaction:e={}}=t;return Object.entries(Z({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function zN(t,e){return Le(this,void 0,void 0,(function*(){const{data:n}=t,r=Pe(t,["data"]);if(null==n)return t;const[,{data:i}]=yield sN(0,{data:n},e);return Object.assign({data:i},r)}))}function GN(t){t.style("transform",(t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function WN(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function $N(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(YN(JS)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",JS).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove()));t.select(YN(tA)).node()||t.append("g").attr("className",tA).style("zIndex",0)}function YN(...t){return t.map((t=>`.${t}`)).join("")}function HN(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:a,innerWidth:o,innerHeight:s}=t;return new Qg({style:{x:r+i,y:n+a,width:o,height:s}})}))}function VN(t){const{style:e,scale:n,type:r}=t,i={},a=tt(e,"columnWidthRatio");return a&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-a})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}function qN(t){const e=function(t){return function(...t){return e=>t.reduce(((t,e)=>e(t)),e)}(VN)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map((t=>qN(t)))),e}function UN(t){const e=Z({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),a=null===e?"0":`${e.key}-${i}`;t.key=a}const{children:e=[]}=t;if(Array.isArray(e))for(let a=0;a<e.length;a++){const o=Z({},e[a]);e[a]=o,n.set(o,t),r.set(o,a),i.push(o)}}return e}function XN(t,e){const n=new x_;return n.registerPlugin(new w_),new gv({width:t,height:e,container:document.createElement("div"),renderer:n})}function ZN(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,depth:o=0}=t,s=UN(qN(t)),{canvas:c=XN(i,a),emitter:l=new O_,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:h}=c.getConfig();f===i&&h===a||c.resize(i,a),l.emit(E_.BEFORE_RENDER);const d=pm(c.document.documentElement);return c.ready.then((()=>bN(Object.assign(Object.assign({},s),{width:i,height:a,depth:o}),d,e))).then((()=>{if(o){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-o/2)}c.requestAnimationFrame((()=>{c.requestAnimationFrame((()=>{l.emit(E_.AFTER_RENDER),null==n||n()}))}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function KN(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${nA}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}const QN={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function JN(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:QN[e]}function tj(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>tj(t,e,n,r)))}function ej(t){tj(t,"visibility","hidden",!0)}function nj(t){tj(t,"visibility","visible",!0)}function rj(t){return pm(t).selectAll(`.${eA}`).nodes().filter((t=>!t.__removed__))}function ij(t,e){return aj(t,e).flatMap((({container:t})=>rj(t)))}function aj(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function oj(t){return pm(t).select(`.${rA}`).node()}function sj(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new Vu;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function cj(t,e){const{offsetX:n,offsetY:r}=e,i=sj(t),{min:[a,o],max:[s,c]}=i;return n<a||n>s||(r<o||r>c)?null:[n-a,r-o]}function lj(t,e){const{offsetX:n,offsetY:r}=e,[i,a,o,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return[n,r,i,a]}(t);return[Math.min(o,Math.max(i,n))-i,Math.min(s,Math.max(a,r))-a]}function uj(t){return t=>t.__data__.color}function fj(t){return t=>t.__data__.x}function hj(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[pj(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(pj(i,r))[e]}}function dj(t,e=(t,e)=>t,n=(t,e,n)=>t.setAttribute(e,n)){const r="__states__",i="__ordinal__",a=a=>{const{[r]:o=[],[i]:s={}}=a,c=o.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(c).length){for(const[t,r]of Object.entries(c)){const i=JN(a,t),o=e(r,a);n(a,t,o),t in s||(s[t]=i)}a[i]=s}},o=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{o(t),t[r]=[...e],a(t)},removeState:(t,...e)=>{o(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}a(t)},hasState:(t,e)=>(o(t),-1!==t[r].indexOf(e))}}function pj(t,e){return`${t},${e}`}function gj(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[pj(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,a={}]=n,o=void 0===(s=a[e])||"object"==typeof s&&0===Object.keys(s).length?i:a[e];var s;for(const[e,n]of Object.entries(o)){const i=t[e],a=(t,e,a,o)=>{const s=pj(o.__data__.viewKey,o.__data__.markKey);return r!==s?null==i?void 0:i(t,e,a,o):"function"!=typeof n?n:n(t,e,a,o)};t[e]=a}return t}),{})}return r}function vj(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const a=n.get(i);return t(e?e(i):i,a,r,i)}}function mj(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=Pe(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const a=t=>t.__data__.points,o=(t,e)=>{const[,n,r]=t,[i,,,a]=e;return[n,i,a,r]};return[t=>{var e;if(t.length<=1)return;const r=Jn(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;t<r.length;t++){const s=Ks(),c=r[t-1],l=r[t],[u,f,h,d]=o(a(c),a(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...h),s.lineTo(...d),s.closePath();const p=Rr(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,v=Pe(p,["fill"]),m=new qg({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(m),c.link=m}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function yj(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Gc(n)){const{points:i}=t.__data__,[a,o]=zc(n)?km(i):i,s=n.getCenter(),c=gs(a,s),l=gs(o,s),u=ys(c)+xs(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return zc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function bj(t){var{document:e,background:n,scale:r,coordinate:i,valueof:a}=t,o=Pe(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,a=t.getStep(r)/2,o=a*n;return[i-a+o,i+a-o]},l=(t,n)=>{const{padding:a}=n,[o,s]=((t,e)=>{const{x:n}=r;if(!gS(n))return[0,1];const{__data__:i}=t,{x:a}=i,[o,s]=c(n,a,e);return[o,s]})(t,a),[l,u]=((t,e)=>{const{y:n}=r;if(!gS(n))return[0,1];const{__data__:i}=t,{y:a}=i,[o,s]=c(n,a,e);return[o,s]})(t,a),f=[[o,l],[s,l],[s,u],[o,u]].map((t=>i.map(t))),{__data__:h}=t,{y:d,y1:p}=h;return Sm(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,a=Pe(e,["transform","transformOrigin","stroke"]),o=Object.assign({transform:n,transformOrigin:r,stroke:i},a),s=t.cloneNode(!0);for(const[t,e]of Object.entries(o))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=Rr(o,(e=>a(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=Pe(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,lineWidth:h}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(gS)})()?l:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function xj(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function kj(t){xj(t,t.cursor)}function wj(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function Mj(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Oj(t,e=!1){const n=v(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function Ej(t){return t.querySelectorAll(".element")}function Sj(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function Aj(t,{elements:e,datum:n,groupKey:r=t=>t,link:i=!1,background:a=!1,delay:o=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Un(h,r),g=vj(h,n),[v,m]=mj(Object.assign({elements:h,valueof:g,link:i,coordinate:c},_r(u.active,"link"))),[y,b,x]=bj(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:a,valueof:g},_r(u.active,"background"))),k=Z(u,{active:Object.assign({},(null===(f=u.active)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.active.offset(...t),[,n]=t;return yj(h[n],e,c)}})}),{setState:w,removeState:M,hasState:O}=dj(k,g);let E;const S=t=>{const{target:e,nativeEvent:i=!0}=t;if(!d.has(e))return;E&&clearTimeout(E);const a=r(e),o=p.get(a),s=new Set(o);for(const t of h)s.has(t)?O(t,"active")||w(t,"active"):(w(t,"inactive"),m(t)),t!==e&&b(t);y(e),v(o),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:o.map(n)}})},A=(t=!0)=>{for(const t of h)M(t,"active","inactive"),b(t),m(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},_=t=>{const{target:e}=t;a&&!x(e)||(a||d.has(e))&&(o>0?(E&&clearTimeout(E),E=setTimeout((()=>{A(),E=null}),o)):A())},T=()=>{A()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",_),t.addEventListener("pointerleave",T);const P=t=>{const{nativeEvent:e}=t;e||A(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=wj(h,r,n);i&&S({target:i,nativeEvent:!1})};return l.on("element:highlight",C),l.on("element:unhighlight",P),()=>{t.removeEventListener("pointerover",S),t.removeEventListener("pointerout",_),t.removeEventListener("pointerleave",T),l.off("element:highlight",C),l.off("element:unhighlight",P);for(const t of h)b(t),m(t)}}function _j(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,a=Pe(t,["delay","createGroup","background","link"]);return(t,o,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:h}=l;return Aj(oj(c),Object.assign({elements:rj,datum:hj(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:gj(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},a))}}function Tj(t){return _j(Object.assign(Object.assign({},t),{createGroup:fj}))}function Pj(t){return _j(Object.assign(Object.assign({},t),{createGroup:uj}))}function Cj(t,{elements:e,datum:n,groupKey:r=t=>t,link:i=!1,single:a=!1,coordinate:o,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Un(h,r),g=vj(h,n),[v,m]=mj(Object.assign({link:i,elements:h,valueof:g,coordinate:o},_r(u.selected,"link"))),[y,b]=bj(Object.assign({document:t.ownerDocument,background:s,coordinate:o,scale:c,valueof:g},_r(u.selected,"background"))),x=Z(u,{selected:Object.assign({},(null===(f=u.selected)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.selected.offset(...t),[,n]=t;return yj(h[n],e,o)}})}),{setState:k,removeState:w,hasState:M}=dj(x,g),O=(t=!0)=>{for(const t of h)w(t,"selected","unselected"),m(t),b(t);t&&l.emit("element:unselect",{nativeEvent:!0})},E=t=>{const{target:e,nativeEvent:o=!0}=t;return d.has(e)?a?((t,e,i=!0)=>{if(M(e,"selected"))O();else{const a=r(e),o=p.get(a),s=new Set(o);for(const t of h)s.has(t)?k(t,"selected"):(k(t,"unselected"),m(t)),t!==e&&b(t);if(v(o),y(e),!i)return;l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...o.map(n)]}}))}})(t,e,o):((t,e,a=!0)=>{const o=r(e),s=p.get(o),c=new Set(s);if(M(e,"selected")){if(!h.some((t=>!c.has(t)&&M(t,"selected"))))return O();for(const t of s)k(t,"unselected"),m(t),b(t)}else{const t=s.some((t=>M(t,"selected")));for(const t of h)c.has(t)?k(t,"selected"):M(t,"selected")||k(t,"unselected");!t&&i&&v(s),y(e)}a&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:a,data:{data:h.filter((t=>M(t,"selected"))).map(n)}}))})(t,e,o):O()};t.addEventListener("click",E);const S=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=a?r.data.slice(0,1):r.data;for(const t of i){const e=wj(h,t,n);E({target:e,nativeEvent:!1})}},A=()=>{O(!1)};return l.on("element:select",S),l.on("element:unselect",A),()=>{for(const t of h)m(t);t.removeEventListener("click",E),l.off("element:select",S),l.off("element:unselect",A)}}function Lj(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=Pe(t,["createGroup","background","link"]);return(t,a,o)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return Cj(oj(s),Object.assign({elements:rj,datum:hj(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:gj(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:o},i))}}function Nj(t){return Lj(Object.assign(Object.assign({},t),{createGroup:fj}))}function jj(t){return Lj(Object.assign(Object.assign({},t),{createGroup:uj}))}function Rj(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,a=Pe(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:o,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=o,d=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:v=[]}=d,m=p.map(((t,e)=>e)),y=Jn(m.map((t=>g[t]))),b=oj(s),x=s.getElementsByClassName(eA),k=Un(s.getElementsByClassName(aA),(t=>t.__data__.key.split("-")[0])),w=new Hg({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},_r(a,"rule"))}),M=new tv({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},_r(a,"label"))});w.append(M),b.appendChild(w);const O=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return y[Fn(y,i)]},E=(t,e)=>{w.setAttribute("x1",t[0]),w.setAttribute("x2",t[0]),M.setAttribute("text",i(e))};let S;const A=rt((t=>{const e=cj(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,a=O(n,r,t);E(t,a);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,o=e[Nn((t=>g[+t])).center(e,a)],s=[0,i.map(1)],c=[0,i.map(p[o]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const h=k.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{Le(this,void 0,void 0,(function*(){const{x:e}=f,n=O(h,e,t);E(t,n),l("chartIndex",(t=>{const e=Z({},t),r=e.marks.find((t=>"line"===t.type)),i=fr(Zn(m,(t=>fr(t,(t=>+p[t]))/dr(t,(t=>+p[t]))),(t=>v[t])).values());Z(r,{scale:{y:{domain:[1/i,i]}}});const a=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);a.groupBy="color",a.basis=(t,e)=>e[t[Nn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");S=r.view}))})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{w.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function Ij({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:a,setState:o,container:s}=r,c=oj(s),l=rt((t=>{const e=cj(c,t);if(!e)return o("fisheye"),void a();o("fisheye",(t=>{const n=Z({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,a=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return a.focusX=r,a.focusY=i,a.visual=!0,n})),a()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function Dj(t,e){if(e)return"string"==typeof e?document.querySelector(e):e;return t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function Bj(t,e,n,r,i,a,o,s={},c=[10,10]){const l=new aw({className:"tooltip",style:{x:e,y:n,container:o,data:[],bounding:a,position:r,enterable:i,title:"",offset:c,template:{prefixCls:"g2-"},style:Z({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(l.HTMLTooltipElement),l}function Fj({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f,offset:h}){const d=Dj(t,u),p=Dj(t),g=o?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return{x:n,y:r,width:i-n,height:a-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,d),{tooltipElement:y=Bj(d,n,r,s,c,v,m,l,h)}=g,{items:b,title:x=""}=e;y.update(Object.assign({x:n,y:r,data:b,title:x,position:s,enterable:c,container:m},void 0!==i&&{content:i(a,{items:b,title:x})})),g.tooltipElement=y}function zj({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const a=Dj(t),o=e?a:t,{tooltipElement:s}=o;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),Uj(t),Xj(t),Zj(t)}function Gj({root:t,single:e}){const n=Dj(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),Uj(t),Xj(t),Zj(t)}function Wj(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function $j(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function Yj(t,e=t=>t){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function Hj(t,e,n,r=t.map((t=>t.__data__)),i={}){const a=t=>t instanceof Date?+t:t,o=Yj(r.map((t=>t.title)),a).filter(Sr),s=r.flatMap(((r,a)=>{const o=t[a],{items:s=[],title:c}=r,l=s.filter(Sr),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=$j(o)||i.color,name:a}=t,s=Pe(t,["color","name"]);const l=function(t,e){const{color:n,series:r,facet:i=!1}=t,{color:a,series:o}=e,s=t=>t&&t.invert&&!(t instanceof Wa)&&!(t instanceof Ya);if(s(r))return r.clone().invert(o);if(o&&r instanceof Wa&&r.invert(o)!==a&&!i)return r.invert(o);if(s(n)){const t=n.invert(a);return Array.isArray(t)?null:t}return null}(e,r),f=u?l||a:a||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(Wj);return Object.assign(Object.assign({},o.length>0&&{title:o.join(",")}),{items:Yj(s,(t=>`(${a(t.name)}, ${a(t.value)}, ${a(t.color)})`))})}function Vj(t,e,n,r){var{plotWidth:i,plotHeight:a,mainWidth:o,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:h,insetTop:d}=r,p=Pe(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map((e=>ms(e,t))),r=pr(n,(t=>t));return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+h+o/2,e=l+d+s/2;return[t,e,ms([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Ig({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,o]=u?[c+v[0],c+v[0],l,l+a]:[c,c+i,v[1]+l,v[1]+l],s=t.ruleX||((e,n,r,i)=>{const a=new Hg({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(a),a})(e,n,r,o);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=o,t.ruleX=s}}function qj(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=Pe(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),g=e.map((t=>t[1])),v=e.map((t=>t[0])),m=yr(g),y=yr(v),[b,x,k,w]=(()=>{if(u){const t=Math.min(a,o)/2,e=s+f+a/2,n=c+h+o/2,r=ys(gs([y,m],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,m+c,m+c]:[y+s,y+s,c,c+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new Hg({style:Object.assign({x1:b,x2:x,y1:k,y2:w},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=k,e.style.y2=w,t.ruleY=e}}function Uj(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function Xj(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function Zj(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function Kj(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function Qj(t,e){return void 0===t?e:t}function Jj(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function tR(t,e){var{elements:n,sort:r,filter:i,scale:a,coordinate:o,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:h,wait:d=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:m=0,body:y=!0,single:b=!0,position:x,enterable:k,mount:w,bounding:M,theme:O,offset:E,disableNative:S=!1,marker:A=!0,preserve:_=!1,style:T={},css:P={}}=e,C=Pe(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const L=n(t),N=zc(o),j=Gc(o),R=Z(T,C),{innerWidth:I,innerHeight:D,width:B,height:F,insetLeft:G,insetTop:W}=o.getOptions(),$=[],Y=[];for(const t of L){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?$.push(t):(r||i)&&Y.push(t)}const H=Y.length&&Y.every((t=>"interval"===t.markType))&&!Gc(o),V=t=>t.__data__.x,q=!!a.x.getBandWidth&&Y.length>0;$.sort(((t,e)=>{const n=N?0:1,r=t=>t.getBounds().min[n];return N?r(e)-r(t):r(t)-r(e)}));const U=t=>{const e=N?1:0,{min:n,max:r}=t.getLocalBounds();return Jn([n[e],r[e]])};H?L.sort(((t,e)=>V(t)-V(e))):Y.sort(((t,e)=>{const[n,r]=U(t),[i,a]=U(e),o=(n+r)/2,s=(i+a)/2;return N?s-o:o-s}));const X=new Map($.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[Jn(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:K}=a,Q=(null==K?void 0:K.getBandWidth)?K.getBandWidth()/2:0,J=t=>{const[e]=o.invert(t);return e-Q},tt=(t,e,n,r)=>{const{_x:i}=t,a=void 0!==i?K.map(i):J(e),o=r.filter(Sr),[s,c]=Jn([o[0],o[o.length-1]]);if(!q&&(a<s||a>c)&&!(s===c))return null;const l=Nn((t=>r[+t])).center;return n[l(n,a)]},et=H?(t,e)=>{const n=e[(0,Nn(V).center)(e,J(t))];return Un(e,V).get(V(n))}:(t,e)=>{const n=t[N?1:0],r=e.filter((t=>{const[e,r]=U(t);return n>=e&&n<=r}));if(!q||r.length>0)return r;const i=Nn((t=>{const[e,n]=U(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(Sr)},nt=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[z(t.replace("series","")),r]})))},it=rt((e=>{var n;const d=cj(t,e);if(!d)return;const p=sj(t),g=p.min[0],S=p.min[1],_=[d[0]-v,d[1]-m];if(!_)return;const T=et(_,Y),C=[],L=[];for(const t of $){const[n,r]=X.get(t),i=tt(e,_,n,r);if(null!==i){C.push(t);const e=nt(t,i),{x:n,y:r}=e,a=o.map([(n||0)+Q,r||0]);L.push([Object.assign(Object.assign({},e),{element:t}),a])}}const z=Array.from(new Set(L.map((t=>t[0].x)))),H=z[pr(z,(t=>Math.abs(t-J(_))))],V=L.filter((t=>t[0].x===H)),q=[...V.map((t=>t[0])),...T.map((t=>t.__data__))],U=[...C,...T],Z=Hj(U,a,f,q,O);if(r&&Z.items.sort(((t,e)=>r(t)-r(e))),i&&(Z.items=Z.items.filter(i)),0===U.length||Jj(Z))return void at(e);if(y&&Fj({root:t,data:Z,x:d[0]+g,y:d[1]+S,render:u,event:e,single:b,position:x,enterable:k,mount:w,bounding:M,css:P,offset:E}),s||c||l){const e=_r(R,"crosshairs"),n=Object.assign(Object.assign({},e),_r(R,"crosshairsX")),r=Object.assign(Object.assign({},e),_r(R,"crosshairsY")),i=V.map((t=>t[1]));c&&Vj(t,i,d,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:G,insetTop:W,startX:v,startY:m,transposed:N,polar:j})),l&&qj(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:G,insetTop:W,startX:v,startY:m,transposed:N,polar:j}))}if(A){const e=_r(R,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const{type:i=""}=n,a=e.filter((t=>{const[{x:e,y:n}]=t;return Sr(e)&&Sr(n)})).map((t=>{const[{color:e,element:a},o]=t,s=e||a.style.fill||a.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new Ig({className:"g2-tooltip-marker",style:Object.assign({cx:o[0],cy:o[1],fill:c,r:4,stroke:l,lineWidth:2},n)})}));for(const e of a)t.appendChild(e);t.markers=a}(t,{data:V,style:e,theme:O})}const K=null===(n=V[0])||void 0===n?void 0:n[0].x,rt=null!=K?K:J(_);h.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:vS(a.x,rt,!0)}}}))}),d,{leading:p,trailing:g}),at=e=>{zj({root:t,single:b,emitter:h,event:e})},ot=()=>{Gj({root:t,single:b})},st=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=Pe(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=a.x.map(u),[h,d]=o.map([f,.5]),p=t.getRenderBounds(),g=p.min[0],v=p.min[1];it(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:g+h,offsetY:void 0!==c?c:v+d,_x:u}))},ct=()=>{zj({root:t,single:b,emitter:h,nativeEvent:!1})},lt=()=>{ht(),ot()},ut=()=>{ft()},ft=()=>{S||(t.addEventListener("pointerenter",it),t.addEventListener("pointermove",it),t.addEventListener("pointerleave",(e=>{cj(t,e)||at(e)})))},ht=()=>{S||(t.removeEventListener("pointerenter",it),t.removeEventListener("pointermove",it),t.removeEventListener("pointerleave",at))};return ft(),h.on("tooltip:show",st),h.on("tooltip:hide",ct),h.on("tooltip:disable",lt),h.on("tooltip:enable",ut),()=>{ht(),h.off("tooltip:show",st),h.off("tooltip:hide",ct),h.off("tooltip:disable",lt),h.off("tooltip:enable",ut),_?zj({root:t,single:b,emitter:h,nativeEvent:!1}):ot()}}function eR(t,{elements:e,coordinate:n,scale:r,render:i,groupName:a,sort:o,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:v,view:m,mount:y,bounding:b,theme:x,offset:k,shared:w=!1,body:M=!0,disableNative:O=!1,preserve:E=!1,css:S={}}){var A,_;const T=e(t),P=Un(T,h),C=T.every((t=>"interval"===t.markType))&&!Gc(n),L=r.x,N=r.series,j=null!==(_=null===(A=null==L?void 0:L.getBandWidth)||void 0===A?void 0:A.call(L))&&void 0!==_?_:0,R=N?t=>{const e=Math.round(1/N.valueBandWidth);return t.__data__.x+t.__data__.series*j+j/(2*e)}:t=>t.__data__.x+j/2;C&&T.sort(((t,e)=>R(t)-R(e)));const I=t=>{const{target:e}=t;return Sj(e,(t=>!!t.classList&&t.classList.includes("element")))},D=C?e=>{const r=cj(t,e);if(!r)return;const[i]=n.invert(r),a=(0,Nn(R).center)(T,i),o=T[a];if(!w){const t=T.find((t=>t!==o&&R(t)===R(o)));if(t)return I(e)}return o}:I,B=rt((e=>{const n=D(e);if(!n)return void zj({root:t,single:d,emitter:c,event:e});const l=h(n),u=P.get(l);if(!u)return;const f=1!==u.length||w?Hj(u,r,a,void 0,x):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(Sr).map((e=>{var{color:n=$j(t)}=e,r=Pe(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(Wj);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(u[0]);if(o&&f.items.sort(((t,e)=>o(t)-o(e))),s&&(f.items=f.items.filter(s)),Jj(f))return void zj({root:t,single:d,emitter:c,event:e});const{offsetX:v,offsetY:O}=e;M&&Fj({root:t,data:f,x:v,y:O,render:i,event:e,single:d,position:p,enterable:g,mount:y,bounding:b,css:S,offset:k}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:xP(n,m)}}))}),l,{leading:u,trailing:f}),F=e=>{zj({root:t,single:d,emitter:c,event:e})},z=()=>{O||(t.addEventListener("pointermove",B),t.addEventListener("pointerleave",F))},G=()=>{O||(t.removeEventListener("pointermove",B),t.removeEventListener("pointerleave",F))},W=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:a}=i,o=wj(T,a,v);if(!o)return;const s=o.getBBox(),{x:c,y:l,width:u,height:f}=s,h=t.getBBox();B({target:o,offsetX:void 0!==n?n+h.x:c+u/2,offsetY:void 0!==r?r+h.y:l+f/2})},$=({nativeEvent:e}={})=>{e||zj({root:t,single:d,emitter:c,nativeEvent:!1})};return c.on("tooltip:show",W),c.on("tooltip:hide",$),c.on("tooltip:enable",(()=>{z()})),c.on("tooltip:disable",(()=>{G(),Gj({root:t,single:d})})),z(),()=>{G(),c.off("tooltip:show",W),c.off("tooltip:hide",$),E?zj({root:t,single:d,emitter:c,nativeEvent:!1}):Gj({root:t,single:d})}}function nR(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:a,name:o,item:s=()=>({}),facet:c=!1}=t,l=Pe(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,o,u)=>{const{container:f,view:h}=t,{scale:d,markState:p,coordinate:g,theme:v}=h,m=Kj(p,"seriesTooltip"),y=Kj(p,"crosshairs"),b=oj(f),x=Qj(a,m),k=Qj(n,y);if(x&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(p)&&!c)return tR(b,Object.assign(Object.assign({},l),{theme:v,elements:rj,scale:d,coordinate:g,crosshairs:k,crosshairsX:Qj(Qj(r,n),!1),crosshairsY:Qj(i,k),item:s,emitter:u}));if(x&&c){const e=o.filter((e=>e!==t&&e.options.parentKey===t.options.key)),a=ij(t,o),c=e[0].view.scale,f=b.getBounds(),h=f.min[0],d=f.min[1];return Object.assign(c,{facet:!0}),tR(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:v,elements:()=>a,scale:c,coordinate:g,crosshairs:Qj(n,y),crosshairsX:Qj(Qj(r,n),!1),crosshairsY:Qj(i,k),item:s,startX:h,startY:d,emitter:u}))}return eR(b,Object.assign(Object.assign({},l),{datum:hj(h),elements:rj,scale:d,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:h,theme:v,shared:e}))}}_j.props={reapplyWhenUpdate:!0},Tj.props={reapplyWhenUpdate:!0},Pj.props={reapplyWhenUpdate:!0},Lj.props={reapplyWhenUpdate:!0},Nj.props={reapplyWhenUpdate:!0},jj.props={reapplyWhenUpdate:!0},Rj.props={reapplyWhenUpdate:!0},nR.props={reapplyWhenUpdate:!0};const rR="legend-category";function iR(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function aR(t){return t.getElementsByClassName("legend-category-item-label")[0]}function oR(t){return t.getElementsByClassName("items-item")}function sR(t){return t.getElementsByClassName(rR)}function cR(t){return t.getElementsByClassName("legend-continuous")}function lR(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function uR(t,{legend:e,channel:n,value:r,ordinal:i,channels:a,allChannels:o,facet:s=!1}){return Le(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[],data:l=[]}=t,u=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),f=[...e];l.length&&f.splice(u+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const h=Object.fromEntries(a.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return Z({},t,Object.assign(Object.assign({transform:f,scale:h},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(o.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function fR(t,e){for(const n of t)uR(n,Object.assign(Object.assign({},e),{facet:!0}))}function hR(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),a=i.length>0,o=t=>lR(t).scales.map((t=>t.name)),s=[...sR(r),...cR(r)],c=s.flatMap(o),l=rt(a?fR:uR,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=lR(e).scales[0],f={legend:e,channel:s,channels:o(e),allChannels:c};return e.className===rR?function(t,{legends:e,marker:n,label:r,datum:i,filter:a,emitter:o,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,{unselected:h={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,d={unselected:_r(h,"marker")},p={unselected:_r(h,"label")},{setState:g,removeState:v}=dj(d,void 0),{setState:m,removeState:y}=dj(p,void 0),b=Array.from(e(t));let x=b.map(i);const k=()=>{for(const t of b){const e=i(t),a=n(t),o=r(t);x.includes(e)?(v(a,"unselected"),y(o,"unselected")):(g(a,"unselected"),m(o,"unselected"))}};for(const e of b){const n=()=>{xj(t,"pointer")},r=()=>{kj(t)},c=t=>Le(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),yield a(x),k();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?o.emit("legend:reset",{nativeEvent:c}):o.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const w=t=>Le(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield a(x),k())})),M=t=>Le(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield a(x),k())}));return o.on("legend:filter",w),o.on("legend:reset",M),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),o.off("legend:filter",w),o.off("legend:reset",M)}}(r,{legends:oR,marker:iR,label:aR,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(a?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const a=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",a),()=>{e.removeEventListener("valuechange",a)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(a?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function dR(){return(t,e,n)=>{const{container:r,view:i,options:a}=t,o=sR(r),s=rj(r),c=t=>lR(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=gj(a,["active","inactive"]),f=vj(s,hj(i)),h=[];for(const t of o){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=oR(t),a=l(r),o=Un(s,(t=>a.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:v}=dj(u,f),m={inactive:_r(p,"marker")},y={inactive:_r(p,"label")},{setState:b,removeState:x}=dj(m),{setState:k,removeState:w}=dj(y),M=t=>{for(const e of i){const n=iR(e),r=aR(e);e===t||null===t?(x(n,"inactive"),w(r,"inactive")):(b(n,"inactive"),k(r,"inactive"))}},O=(t,i)=>{const a=e(i),c=new Set(o.get(a));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");M(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:a}}))},E=new Map;for(const t of i){const e=e=>{O(e,t)};t.addEventListener("pointerover",e),E.set(t,e)}const S=t=>{for(const t of s)v(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:a}=t;if(n)return;const{channel:o,value:s}=a;if(o!==r)return;const c=i.find((t=>e(t)===s));c&&O({nativeEvent:!1},c)},_=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",_);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",_);for(const[t,e]of E)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function pR(t,e){const[n,r,i,a]=t,[o,s,c,l]=e;return!(o>i||c<n||s>a||l<r)}function gR(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function vR(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const mR=jm((t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,renders:s={},handleSize:c=10,document:l}=e,u=Pe(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===a||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=_r(Pr(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=Pe(d,["render"]),v=_r(u,"handleE"),{render:m=h}=v,y=Pe(v,["render"]),b=_r(Pr(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,k=Pe(b,["render"]),w=_r(u,"handleW"),{render:M=h}=w,O=Pe(w,["render"]),E=_r(u,"handleNW"),{render:S=h}=E,A=Pe(E,["render"]),_=_r(u,"handleNE"),{render:T=h}=_,P=Pe(_,["render"]),C=_r(u,"handleSE"),{render:L=h}=C,N=Pe(C,["render"]),j=_r(u,"handleSW"),{render:R=h}=j,I=Pe(j,["render"]),D=t=>()=>{const e=jm((e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,l);r.id=n,r.style.draggable=!0})(e,t)));return new e({})},B=pm(t).attr("className",o).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(vR,Object.assign(Object.assign({width:i,height:a},Pr(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(vR,g),B.maybeAppend("handle-e",D(m)).style("x",i-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(vR,y),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",a-f).style("width",i-c).style("height",c).style("fill","transparent").call(vR,k),B.maybeAppend("handle-w",D(M)).style("x",-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(vR,O),B.maybeAppend("handle-nw",D(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(vR,A),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(vR,P),B.maybeAppend("handle-se",D(L)).style("x",i-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(vR,N),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(vR,I)}));function yR(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:a=()=>{},brushupdated:o=()=>{},extent:s=gR(t),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=Pe(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,m=null,y=null,b=null,x=!1;const[k,w,M,O]=s;xj(t,"crosshair"),t.style.draggable=!0;const E=(t,e,n)=>{if(a(n),y&&y.remove(),b&&b.remove(),g=[t,e],l)return S();A()},S=()=>{b=new qg({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),y=new mR({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(y)},A=()=>{y=new mR({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(y)},_=(t=!0)=>{y&&y.remove(),b&&b.remove(),g=null,v=null,m=null,x=!1,y=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,a,o,u]=function(t,e,n,r,i){const[a,o,s,c]=i;return[Math.max(a,Math.min(t,n)),Math.max(o,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,a,o,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${k},${w}L${M},${w}L${M},${O}L${k},${O}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},L={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},N=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(L)).has(e)},R=t=>t===y.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=lj(t,e);if(!y||!N(n))return E(r,i,e),void(x=!0);N(n)&&(m=[r,i])},D=e=>{const{target:n}=e,r=lj(t,e);if(!g)return;if(!m)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-m[0],r=t[1]-m[1],i=e(n,g[0],v[0],k,M),a=e(r,g[1],v[1],w,O),o=[g[0]+i,g[1]+a],s=[v[0]+i,v[1]+a];T(o,s)})(r);const[i,a]=[r[0]-m[0],r[1]-m[1]],{id:o}=n;if(L[o]){const[t,e,n,r]=L[o].vector;return T([g[0]+i*t,g[1]+a*e],[v[0]+i*n,v[1]+a*r])}},B=e=>{if(m){m=null;const{x:t,y:n,width:r,height:i}=y.style;return g=[t,n],v=[t+r,n+i],void o(t,n,t+r,n+i,e)}v=lj(t,e);const[n,r,a,s]=T(g,v);x=!1,i(n,r,a,s,e)},F=t=>{const{target:e}=t;y&&!N(e)&&_()},z=e=>{const{target:n}=e;y&&N(n)&&!x?R(n)?xj(t,"move"):j(n)&&xj(t,L[n.id].cursor):xj(t,"crosshair")},G=()=>{xj(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",G),{mask:y,move(t,e,n,r,i=!0){y||E(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){y&&_(t)},destroy(){y&&_(!1),xj(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",G)}}}function bR(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function xR(t,e,n){return bR(t,e,n).map((t=>t.options))}function kR(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:h=t=>t,bboxOf:d=t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}},state:p={},emitter:g}=e,v=Pe(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),b=y.flatMap(n),x=vj(m,a),k=_r(v,"mask"),{setState:w,removeState:M}=dj(p,x),O=new Map,{width:E,height:S,x:A=0,y:_=0}=d(t),T=s||[0,0,E,S],P=()=>{for(const t of[...m,...b])M(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of y)null===(i=t.brush)||void 0===i||i.remove();const a=new Set;for(const i of m){const{min:o,max:s}=i.getLocalBounds(),[c,l]=o,[u,f]=s;pR([c,l,u,f],[t,e,n,r])?(w(i,"active"),a.add(h(i))):w(i,"inactive")}for(const t of b)a.has(h(t))?w(t,"active"):w(t,"inactive")},L=()=>{for(const t of m)M(t,"inactive");for(const t of O.values())t.remove();O.clear()},N=(e,n,r,i)=>{const a=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),O.set(t,e),e},o=new Qg({style:{x:e+A,y:n+_,width:r-e,height:i-n}});t.appendChild(o);for(const t of m){const e=O.get(t)||a(t);e.style.clipPath=o,w(t,"inactive"),w(e,"active")}},j=yR(t,Object.assign(Object.assign({},k),{extent:T,brushRegion:o,reverse:c,selectedHandles:r,brushended:t=>{const e=f?L:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const a=yS(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}});(f?N:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const a=yS(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushupdated:(t,e,n,r,i)=>{const a=yS(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,a,o]=function(t,e,n){const{x:r,y:i}=e,[a,o]=t,s=bS(a,r),c=bS(o,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);j.move(r,i,a,o,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function wR(t){var{facet:e,brushKey:n}=t,r=Pe(t,["facet","brushKey"]);return(t,i,a)=>{const{container:o,view:s,options:c}=t,l=oj(o),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],o=e.min[1],s=e.max[0],c=e.max[1];return kR(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>ij(t,i),datum:hj(aj(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,o,s,c],state:gj(aj(t,i).map((t=>t.options)),f),emitter:a,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=kR(l,Object.assign(Object.assign({elements:rj,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return bR(t,e,n).map((t=>oj(t.container)))}(t,i,n),datum:hj([s,...bR(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:gj([c,...xR(t,i,n)],f),emitter:a,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function MR(t,e,n,r,i){const[,a,,o]=i;return[t,a,n,o]}function OR(t){return wR(Object.assign(Object.assign({},t),{brushRegion:MR,selectedHandles:["handle-e","handle-w"]}))}function ER(t,e,n,r,i){const[a,,o]=i;return[a,e,o,r]}function SR(t){return wR(Object.assign(Object.assign({},t),{brushRegion:ER,selectedHandles:["handle-n","handle-s"]}))}const AR="axis-hot-area";function _R(t){return t.getElementsByClassName("axis")}function TR(t){return t.getElementsByClassName("axis-line")[0]}function PR(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function CR(t,e){var{cross:n,offsetX:r,offsetY:i}=e,a=Pe(e,["cross","offsetX","offsetY"]);const o=PR(t),s=TR(t),[c]=s.getLocalBounds().min,[l,u]=o.min,[f,h]=o.max,d=2*(f-l);return{brushRegion:ER,hotZone:new Qg({className:AR,style:Object.assign({width:n?d/2:d,transform:`translate(${(n?l:c-d/2).toFixed(2)}, ${u})`,height:h-u},a)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function LR(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,a=Pe(e,["offsetY","offsetX","cross"]);const o=PR(t),s=TR(t),[,c]=s.getLocalBounds().min,[l,u]=o.min,[f,h]=o.max,d=h-u;return{brushRegion:MR,hotZone:new Qg({className:AR,style:Object.assign({width:f-l,height:i?d:2*d,transform:`translate(${l}, ${i?u:c-d})`},a)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(h-n)]}}function NR(t){return(e,n,r)=>{const{container:i,view:a,options:o}=e,s=oj(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=a;return function(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:o,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:h}=e,d=Pe(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=vj(p,o),{setState:m,removeState:y}=dj(u,v),b=new Map,x=_r(d,"mask"),k=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,a])=>t>=e&&t<=r&&a>=n&&a<=i)))),w=g.map((t=>t.attributes.scale)),M=t=>t.length>2?[t[0],t[t.length-1]]:t,O=new Map,E=()=>{O.clear();for(let t=0;t<g.length;t++){const e=w[t],{domain:n}=e.getOptions();O.set(t,M(n))}};E();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);k(e)?(m(t,"active"),n.push(t)):m(t,"inactive")}O.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(O.values());const t=[];for(const[e,n]of O){const r=w[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)y(t,"active","inactive");E(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=w[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return M(mS(n,i))},T=g.some(a)&&g.some((t=>!a(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=a(e)?LR:CR,{hotZone:r,brushRegion:i,extent:o}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=yR(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,a,s){b.set(e,o(n,r,i,a)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},L=(t,e,n)=>{const[r,i]=t,o=N(r,e,n),s=N(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return a(n)?[o,-1/0,s,1/0]:[-1/0,o,1/0,s]},N=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),o=e.clone();return a(n)?o.update({range:[0,i]}):o.update({range:[r,0]}),o.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=w[t];r.move(...L(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:rj,axes:_R,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:hj(a),state:gj(o,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function jR(t){var{hideX:e=!0,hideY:n=!0}=t,r=Pe(t,["hideX","hideY"]);return(t,i,a)=>{const{container:o,view:s,options:c,update:l,setState:u}=t,f=oj(o);let h=!1,d=!1,p=s;const{scale:g,coordinate:v}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:a,reverse:o,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=_r(Pe(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=a||[0,0,d,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),m=yR(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:o,brushcreated:function(t,e,r,i,a){a.nativeEvent=!0,n(u(t,e,r,i),a),m.remove()}}));function y(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",y);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{m.destroy(),s.off("brush:filter",b),t.removeEventListener("click",y)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:a}=p;return yS(t,e,n,r,i,a)},filter:(t,r)=>Le(this,void 0,void 0,(function*(){if(d)return;d=!0;const[i,o]=t;u("brushFilter",(t=>{const{marks:r}=t,a=r.map((t=>Z({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:o,nice:!1}}})));return Object.assign(Object.assign({},c),{marks:a,clip:!0})})),a.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,o]}}));const s=yield l();p=s.view,d=!1,h=!0})),reset:t=>{if(d||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,o=r.getOptions().domain;a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,o]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:a,scale:g,coordinate:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function RR(t){return jR(Object.assign(Object.assign({hideX:!0},t),{brushRegion:MR}))}function IR(t){return jR(Object.assign(Object.assign({hideY:!0},t),{brushRegion:ER}))}function DR(t,e,n,r=!1,i="x",a="y"){const{marks:o}=t,s=o.map((t=>{var o,s;return Z({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(o=t[n])||void 0===o?void 0:o[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(s=t[n])||void 0===s?void 0:s[a])&&{[a]:{preserve:!0}}),animate:!1})}));return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function BR(t,e,n){const[r,i]=t,a=n?t=>1-t:t=>t;return mS(e,[vS(e,a(r),!0),vS(e,a(i),!1)])}function FR(t){return[t[0],t[t.length-1]]}function zR({initDomain:t={},className:e="slider",prefix:n="slider",setValue:r=(t,e)=>t.setValues(e),hasState:i=!1,wait:a=50,leading:o=!0,trailing:s=!1,getInitValues:c=t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n}}){return(l,u,f)=>{const{container:h,view:d,update:p,setState:g}=l,v=h.getElementsByClassName(e);if(!v.length)return()=>{};let m=!1;const{scale:y,coordinate:b,layout:x}=d,{paddingLeft:k,paddingTop:w,paddingBottom:M,paddingRight:O}=x,{x:E,y:S}=y,A=zc(b),_=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return A?[n,e]:[e,n]},T=new Map,P=new Set,C={x:t.x||E.getOptions().domain,y:t.y||S.getOptions().domain};for(const t of v){const{orientation:e}=t.attributes,[l,u]=_(e),h=`${n}${G(l)}:filter`,d="x"===l,{ratio:v}=E.getOptions(),{ratio:b}=S.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=FR(C.x),r=FR(C.y)]=e;return d?[mS(E,n,v),mS(S,r,b)]:[mS(S,r,b),mS(E,n,v)]}const{value:n}=t.detail;return[BR(n,y[l],A&&"horizontal"===e),C[u]]},L=rt((e=>Le(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(m&&!r)return;m=!0;const{nativeEvent:a=!0}=e,[o,s]=x(e);if(C[l]=o,C[u]=s,a){const t=d?o:s,n=d?s:o;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:a,data:{selection:[FR(t),FR(n)]}}))}g(t,(t=>Object.assign(Object.assign({},DR(t,{[l]:{domain:o,nice:!1}},n,i,l,u)),{paddingLeft:k,paddingTop:w,paddingBottom:M,paddingRight:O}))),yield p(),m=!1}))),a,{leading:o,trailing:s}),N=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:a}=i,[o,s]=a;t.dispatchEvent(new Rp("valuechange",{data:i,nativeEvent:!1}));const c=d?bS(o,E):bS(s,S);r(t,c)};f.on(h,N),t.addEventListener("valuechange",L),T.set(t,L),P.add([h,N]);const j=c(t);j&&t.dispatchEvent(new Rp("valuechange",{detail:{value:j},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of P)f.off(t,e)}}}const GR="g2-scrollbar";function WR(t={}){return(e,n,r)=>{const{view:i,container:a}=e;if(!a.getElementsByClassName(GR).length)return()=>{};const{scale:o}=i,{x:s,y:c}=o,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return zR(Object.assign(Object.assign({},t),{initDomain:l,className:GR,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0])return e}}))(e,n,r)}}function $R(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>{return`${n=t,n.replace(/([A-Z])/g,"-$1").toLowerCase()}:${e}`;var n})).join(";")}">${e}</${t}>`}const YR={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function HR(t){return"text"===t.nodeName&&!!t.isOverflowing()}function VR(t){var{offsetX:e=8,offsetY:n=8}=t,r=Pe(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[a,o]=i.getBounds().min,s=_r(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!HR(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-a,h=u+n-o;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new Wg({className:"poptip",style:{innerHTML:$R("div",d,Object.assign(Object.assign({},YR),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;HR(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}VR.props={reapplyWhenUpdate:!0};const qR={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function UR(t={}){const{originData:e=[],layout:n}=t,r=Pe(t,["originData","layout"]),i=Z({},qR,r),a=_r(i,"breadCrumb"),o=_r(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return pm(t).select(`.${rA}`).node()}(s),u=c.marks[0],{state:f}=u,h=new zg;l.appendChild(h);const d=(t,c)=>Le(this,void 0,void 0,(function*(){if(h.removeChildren(),c){let e="",n=a.y,r=0;const i=[],s=l.getBBox().width,c=t.map(((o,c)=>{e=`${e}${o}/`,i.push(o);const l=new tv({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:o,x:r,path:[...i],depth:c},a),{y:n})});h.appendChild(l),r+=l.getBBox().width;const u=new tv({style:Object.assign(Object.assign({x:r,text:" / "},a),{y:n})});return h.appendChild(u),r+=u.getBBox().width,r>s&&(n=h.getBBox().height+a.y,r=0,l.attr({x:r,y:n}),r+=l.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),c===ot(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===ot(c)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",(()=>{t.attr(o)})),t.addEventListener("mouseleave",(()=>{t.attr(n)})),t.addEventListener("click",(()=>{d(tt(t,["style","path"]),tt(t,["style","depth"]))}))}))}!function(t,e){[...sR(t),...cR(t)].forEach((t=>{e(t,(t=>t))}))}(s,i),i("treemapDrillDown",(r=>{const{marks:i}=r,a=t.join("/"),o=i.map((t=>{if("rect"!==t.type)return t;let r=e;if(c){const t=e.filter((t=>{const e=tt(t,["id"]);return e&&(e.match(`${a}/`)||a.match(e))})).map((t=>({value:0===t.height?tt(t,["value"]):void 0,name:tt(t,["id"])}))),{paddingLeft:i,paddingBottom:o,paddingRight:s}=n,l=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||h.getBBox().height+10)/(c+1),paddingLeft:i/(c+1),paddingBottom:o/(c+1),paddingRight:s/(c+1),path:t=>t.name,layer:t=>t.depth===c+1});r=zO(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(L(t))})),Z({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:o})})),yield r(void 0,["legendFilter"])})),p=t=>{const n=t.target;if("rect"!==tt(n,["markType"]))return;const r=tt(n,["__data__","key"]),i=A(e,(t=>t.id===r));tt(i,"height")&&d(tt(i,"path"),tt(i,"depth"))};l.addEventListener("click",p);const g=w(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{Ej(l).forEach((t=>{const n=tt(t,["style","cursor"]),r=A(e,(e=>e.id===tt(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=function(t,e){if(null===t||!S(t))return{};var n={};return k(e,(function(e){et.call(t,e)&&(n[e]=t[e])})),n}(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(Z(e,f.inactive))}))}}))};return v(),l.addEventListener("mousemove",v),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",v)}}}const XR={pointR:6,pointStrokeWidth:1,pointStroke:"#888",pointActiveStroke:"#f5f5f5",pathStroke:"#888",pathLineDash:[3,4],labelFontSize:12,labelFill:"#888",labelStroke:"#fff",labelLineWidth:1,labelY:-6,labelX:2},ZR="movePoint",KR=t=>{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},QR=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},JR=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},tI=(t,e,n,r)=>{const i=new qg({style:n}),a=new tv({style:r});return e.appendChild(a),t.appendChild(i),[i,a]},eI=(t,e)=>{if(!tt(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},nI=(t,e,n)=>{const r=Mj(t,e),i=Mj(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function rI(t={}){const{selection:e=[],precision:n=2}=t,r=Pe(t,["selection","precision"]),i=Object.assign(Object.assign({},XR),r||{}),a=_r(i,"path"),o=_r(i,"label"),s=_r(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=oj(u);let g,v=Ej(p),m=e;const{transform:y=[],type:b}=d,x=!!A(y,(({type:t})=>"transpose"===t)),k="polar"===b,w="theta"===b,M=!!A(v,(({markType:t})=>"area"===t));M&&(v=v.filter((({markType:t})=>"area"===t)));const O=new zg({style:{zIndex:2}});p.appendChild(O);const E=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:m}})},S=t=>{const e=t.target;m=[e.parentNode.childNodes.indexOf(e)],E(),T(e)},_=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;m=e;const r=tt(v,[null==m?void 0:m[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:v,seriesTitle:y,color:b,title:S,seriesX:_,y1:P}=d;if(x&&"interval"!==r)return;const{scale:C,coordinate:L}=(null==g?void 0:g.view)||f,{color:N,y:j,x:R}=C,I=L.getCenter();let D;O.removeChildren();const B=(t,e,n,r)=>Le(this,void 0,void 0,(function*(){return l("elementPointMove",(a=>{var o;const s=((null===(o=null==g?void 0:g.options)||void 0===o?void 0:o.marks)||h).map((a=>{if(!r.includes(a.type))return a;const{data:o,encode:s}=a,c=Object.keys(s).reduce(((r,i)=>{const a=s[i];return"x"===i&&(r[a]=t),"y"===i&&(r[a]=e),"color"===i&&(r[a]=n),r}),{}),l=((t,e,n)=>e.map((e=>{const r=["x","color"].reduce(((r,i)=>{const a=n[i];return a?e[a]===t[a]&&r:r}),!0);return r?Object.assign(Object.assign({},e),t):e})))(c,o,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),Z({},a,{data:l,animate:!1})}));return Object.assign(Object.assign({},a),{marks:s})})),yield c("elementPointMove")}));if(["line","area"].includes(r))v.forEach(((e,r)=>{const i=R.invert(_[r]);if(!i)return;const c=new Ig({name:ZR,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=tt(t,["__data__","seriesItems",e,"0","value"]),r=tt(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:a,transform:o}}=t.parentNode,s=A(o,(({type:t})=>"normalizeY"===t)),c=tt(a,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t})(t,r);c.addEventListener("mousedown",(f=>{const h=L.output([_[r],0]),d=null==y?void 0:y.length;u.attr("cursor","move"),m[1]!==r&&(m[1]=r,E()),JR(O.childNodes,m,s);const[p,x]=tI(O,c,a,o),w=t=>{const i=e[1]+t.clientY-D[1];if(M)if(k){const a=e[0]+t.clientX-D[0],[o,s]=nI(I,h,[a,i]),[,u]=L.output([1,j.output(0)]),[,f]=L.invert([o,u-(v[r+d][1]-s)]),g=(r+1)%d,m=Oj([v[(r-1+d)%d],[o,s],y[g]&&v[g]]);x.attr("text",l(j.invert(f)).toFixed(n)),p.attr("d",m),c.attr("cx",o),c.attr("cy",s)}else{const[,t]=L.output([1,j.output(0)]),[,a]=L.invert([e[0],t-(v[r+d][1]-i)]),o=Oj([v[r-1],[e[0],i],y[r+1]&&v[r+1]]);x.attr("text",l(j.invert(a)).toFixed(n)),p.attr("d",o),c.attr("cy",i)}else{const[,t]=L.invert([e[0],i]),a=Oj([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",a),c.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",w);const S=()=>Le(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",w),u.removeEventListener("mouseup",S),$(x.attr("text")))return;const e=Number(x.attr("text")),n=eI(N,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)}));u.addEventListener("mouseup",S)})),O.appendChild(c)})),JR(O.childNodes,m,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:w&&(e=v[0]);const i=(t=>{const e=tt(t,["__data__","y"]),n=tt(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:a},childNodes:o}=t.parentNode,s=A(a,(({type:t})=>"normalizeY"===t)),c=tt(i,["y","field"]),l=r[o.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t})(t),c=new Ig({name:ZR,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});c.addEventListener("mousedown",(s=>{u.attr("cursor","move");const l=eI(N,b),[f,h]=tI(O,c,a,o),d=t=>{if(x){const r=e[0]+t.clientX-D[0],[a]=L.output([j.output(0),j.output(0)]),[,o]=L.invert([a+(r-v[2][0]),e[1]]),s=Oj([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);h.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(w){const r=e[1]+t.clientY-D[1],a=e[0]+t.clientX-D[0],[o,s]=nI(I,[a,r],e),[l,u]=nI(I,[a,r],v[1]),d=L.invert([o,s])[1],p=P-d;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=Mj(t,e[1]),a=Mj(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]),r}(I,[[o,s],[l,u],v[2],v[3]],p>.5?1:0);h.attr("text",i(p,!0).toFixed(n)),f.attr("d",g),c.attr("cx",o),c.attr("cy",s)}else{const r=e[1]+t.clientY-D[1],[,a]=L.output([1,j.output(0)]),[,o]=L.invert([e[0],a-(v[2][1]-r)]),s=Oj([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);h.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>Le(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),$(h.attr("text")))return;const e=Number(h.attr("text"));g=yield B(S,e,l,[r]),h.remove(),f.remove(),T(t)}));u.addEventListener("mouseup",p)})),O.appendChild(c)}};v.forEach(((t,e)=>{m[0]===e&&T(t),t.addEventListener("click",S),t.addEventListener("mouseenter",KR),t.addEventListener("mouseleave",QR)}));const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===ZR||v.includes(e))||(m=[],E(),O.removeChildren())};return i.on("element-point:select",_),i.on("element-point:unselect",P),u.addEventListener("mousedown",P),()=>{O.remove(),i.off("element-point:select",_),i.off("element-point:unselect",P),u.removeEventListener("mousedown",P),v.forEach((t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",KR),t.removeEventListener("mouseleave",QR)}))}}}var iI={},aI={};function oI(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function sI(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function cI(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function lI(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+cI(-t,6):t>9999?"+"+cI(t,6):cI(t,4)}(t.getUTCFullYear())+"-"+cI(t.getUTCMonth()+1,2)+"-"+cI(t.getUTCDate(),2)+(i?"T"+cI(e,2)+":"+cI(n,2)+":"+cI(r,2)+"."+cI(i,3)+"Z":r?"T"+cI(e,2)+":"+cI(n,2)+":"+cI(r,2)+"Z":n||e?"T"+cI(e,2)+":"+cI(n,2)+"Z":"")}function uI(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,s=0,c=a<=0,l=!1;function u(){if(c)return aI;if(l)return l=!1,iI;var e,r,i=o;if(34===t.charCodeAt(i)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?c=!0:10===(r=t.charCodeAt(o++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(r=t.charCodeAt(e=o++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(o)&&++o;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(r=u())!==aI;){for(var f=[];r!==iI&&r!==aI;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return o(e[t])})).join(t)}))}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?lI(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=oI(t);return function(r,i){return e(n(r),i,t)}}(t,e):oI(t)}));return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=sI(e)),[n.map(o).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=sI(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function fI(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;hI&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const hI=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),dI=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Le(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return uI(r).parse(e,i?fI:kr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};dI.props={};const pI=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function gI(t){return null!=t&&!Number.isNaN(t)}pI.props={};const vI=t=>{const{callback:e=gI}=t;return t=>t.filter(e)};vI.props={};const mI=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};mI.props={};const yI=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};yI.props={};const bI=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};bI.props={};const xI=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r])),0)))};xI.props={};const kI=t=>{const{value:e}=t;return()=>e};kI.props={};const wI=t=>{const{callback:e=kr}=t;return t=>e(t)};wI.props={};const MI=t=>{const{callback:e=kr}=t;return t=>Array.isArray(t)?t.map(e):t};MI.props={};const OI=Math.PI/180,EI=2048;function SI(t){return t.text}function AI(){return"serif"}function _I(){return"normal"}function TI(t){return t.value}function PI(){return 90*~~(2*Math.random())}function CI(){return 1}function LI(){}function NI(t,e,n,r){if(e.sprite)return;const i=t.context,a=t.ratio;i.clearRect(0,0,2048/a,EI/a);let o=0,s=0,c=0;const l=n.length;for(--r;++r<l;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=i.measureText(e.text+"m").width*a,l=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*OI),r=Math.cos(e.rotate*OI),i=t*r,a=t*n,o=l*r,s=l*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else t=t+31>>5<<5;if(l>c&&(c=l),o+t>=2048&&(o=0,s+=c,c=0),s+l>=EI)break;i.translate((o+(t>>1))/a,(s+(l>>1))/a),e.rotate&&i.rotate(e.rotate*OI),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=o,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=t}const u=i.getImageData(0,0,2048/a,EI/a).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let a=e.y1-e.y0;for(let t=0;t<a*i;t++)f[t]=0;if(o=e.xoff,null==o)return;s=e.yoff;let c=0,l=-1;for(let n=0;n<a;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[2048*(s+n)+(o+e)<<2]?1<<31-e%32:0;f[t]|=r,c|=r}c?l=n:(e.y0++,a--,n--,s++)}e.y1=e.y0+l,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function jI(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,a=t.x-(i<<4),o=127&a,s=32-o,c=t.y1-t.y0;let l,u=(t.y+t.y0)*n+(a>>5);for(let t=0;t<c;t++){l=0;for(let n=0;n<=i;n++)if((l<<s|(n<i?(l=r[t*i+n])>>>o:0))&e[u+n])return!0;u+=n}return!1}function RI(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function II(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function DI(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function BI(){return document.createElement("canvas")}function FI(t){return"function"==typeof t?t:function(){return t}}const zI={archimedean:II,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function GI(){let t=[256,256],e=SI,n=AI,r=TI,i=_I,a=PI,o=CI,s=II,c=Math.random,l=LI,u=[],f=null,h=1/0,d=BI;const p=_I,g={};function v(e,n,r){const i=n.x,a=n.y,o=Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=s(t),u=c()<.5?1:-1;let f,h,d,p=-u;for(;(f=l(p+=u))&&(h=~~f[0],d=~~f[1],!(Math.min(Math.abs(h),Math.abs(d))>=o));)if(n.x=i+h,n.y=a+d,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1]||r&&jI(n,e,t[0])||r&&(v=r,!((g=n).x+g.x1>v[0].x&&g.x+g.x0<v[1].x&&g.y+g.y1>v[0].y&&g.y+g.y0<v[1].y)))){const r=n.sprite,i=n.width>>5,a=t[0]>>5,o=n.x-(i<<4),s=127&o,c=32-s,l=n.y1-n.y0;let u,f=(n.y+n.y0)*a+(o>>5);for(let t=0;t<l;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<c|(n<i?(u=r[t*i+n])>>>s:0);f+=a}return delete n.sprite,!0}var g,v;return!1}return g.start=function(){const[s,m]=t,y=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=EI/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(d()),b=g.board?g.board:DI((t[0]>>5)*t[1]),x=u.length,k=[],w=u.map((function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=a.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=o.call(this,t,s,c),t})).sort((function(t,e){return e.size-t.size}));let M=-1,O=g.board?[{x:0,y:0},{x:s,y:m}]:void 0;function E(){const e=Date.now();for(;Date.now()-e<h&&++M<x;){const e=w[M];e.x=s*(c()+.5)>>1,e.y=m*(c()+.5)>>1,NI(y,e,w,M),e.hasText&&v(b,e,O)&&(l.call(null,"word",{cloud:g,word:e}),k.push(e),O?g.hasImage||RI(O,e):O=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=k,g._bounds=O,M>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:k,bounds:O}))}return f&&clearInterval(f),f=setInterval(E,0),E(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const a=r>>5,o=DI((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const c=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=a*t+(e>>5),i=t*r+e<<2,s=c[i]>=250&&c[i+1]>=250&&c[i+2]>=250?1<<31-e%32:0;o[n]|=s}g.board=o,g.hasImage=!0},g.timeInterval=function(t){h=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=FI(t)},g.font=function(t){n=FI(t)},g.fontWeight=function(t){i=FI(t)},g.rotate=function(t){a=FI(t)},g.canvas=function(t){d=FI(t)},g.spiral=function(t){s=zI[t]||t},g.fontSize=function(t){r=FI(t)},g.padding=function(t){o=FI(t)},g.random=function(t){c=FI(t)},g.on=function(t){l=FI(t)},g}const WI={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function $I(t){return new Promise(((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}}))}const YI=(t,e)=>n=>Le(void 0,void 0,void 0,(function*(){const r=Object.assign({},WI,t,{canvas:e.createCanvas}),i=GI();var a,o;yield(a=i,o=r,{set(t,e,n){if(void 0===o[t])return this;const r=e?e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this},setAsync(t,e,n){return Le(this,void 0,void 0,(function*(){if(void 0===o[t])return this;const r=e?yield e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this}))}}).set("fontSize",(t=>{const e=n.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,a]=e;return a===i?()=>(r+n)/2:({value:t})=>(r-n)/(a-i)*(t-i)+n}return()=>t}(t,[dr(e),fr(e)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",$I,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:h,hasImage:d}=s,p=h.map((t=>{var{x:e,y:n,font:r}=t,i=Pe(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})})),[{x:g,y:v},{x:m,y:y}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:d?0:g,y:d?0:v}),Object.assign(Object.assign({},b),{x:d?c:m,y:d?l:y})),p}));function HI(t){return"string"==typeof t?e=>e[t]:t}YI.props={};const VI=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:a=NaN}=t,[o,s]=n,c=HI(s),l=HI(o),u=Zn(e,(([t])=>t),(t=>c(t)));return t=>t.map((t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:a,t)),{}))}))};VI.props={};const qI=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};qI.props={};var UI={exports:{}},XI={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(XI),function(t){var e=Math.log(2),n=t.exports,r=XI.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,a=r.isNumber(e.width)?e.width:2,o=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(o-1);return n&&(s-=2*a*l),i&&(c+=2*a*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var a=r.isNumber(e.size)?e.size:50,o=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:a,width:o,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(a-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<a;h++)f.push({x:c+h*u,y:0});var d=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,o),p=d[o],g=d[o-1]-d[o-2],v=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+o<0||e-o>=f.length)){var n=Math.max(e-o,0),i=e,a=Math.min(e+o,f.length-1),s=n-(e-o),l=e+o-a,h=d[-o-1+s]||0,m=d[-o-1+l]||0,y=p/(p-h-m);s>0&&(v+=y*(s-1)*g);var b=Math.max(0,e-o+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*y*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*y*g),r.inside(0,f.length-1,a+1)&&(f[a+1].y+=1*y*g)}}));var m=v,y=0,b=0;return f.forEach((function(t){y+=t.y,m+=y,t.y=m,b+=m})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(UI);var ZI=UI.exports;const KI=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:a,size:o=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(Un(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=ZI.create(t.map((t=>t[e])),{min:i,max:a,size:o,width:s}),r=n.map((t=>t.x)),u=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})}))}};KI.props={};const QI=()=>t=>(console.log("G2 data section:",t),t);QI.props={};const JI=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map((t=>t[e])),a=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const a=n*e+(1-e)*i;r.push(a),n=a}return r}(i,n);return t.map(((t,e)=>Object.assign(Object.assign({},t),{[r]:a[e]})))}};function tD(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function eD(t,e){const[n,r]=t,[i,a]=e;return n>=i[0]&&n<=a[0]&&r>=i[1]&&r<=a[1]}JI.props={};const nD=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{nj(t);const e=t.getLocalBounds(),r=n.some((t=>function(t,e){const[n,r]=t,[i,a]=e;return n[0]<a[0]&&r[0]>i[0]&&n[1]<a[1]&&r[1]>i[1]}(tD(e),tD(t.getLocalBounds()))));r?ej(t):n.push(t)})),t}};function rD([t,e],[n,r]){return r>t&&e>n}function iD(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function aD(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const oD=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[a,o]=iD(),[s,c]=iD(),[l,u]=iD(),[f,h]=iD();for(const e of t){const{min:t,max:n}=aD(e),[r,i]=t,[a,s]=n;o(e,i),c(e,i),u(e,s-i),h(e,[r,a])}for(let a=0;a<e;a++){t.sort(((t,e)=>Cn(s(t),s(e))));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let a,o=n+1;for(;(a=t[o])&&!rD(f(i),f(a));)o+=1;if(a){const t=s(i),n=l(i),o=s(a),u=o-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(a,o+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-a(e);return t}};function sD(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function cD(t,e,n){return.2126*sD(t)+.7152*sD(e)+.0722*sD(n)}function lD(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:a,g:o,b:s}=e,c=cD(n,r,i),l=cD(a,o,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function uD(t,e){const n=hr(e,(e=>lD(t,function(t){return"object"==typeof t?t:hh(t)}(e))));return e[n]}const fD=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;lD(t.parsedStyle.fill,r)<e&&t.attr("fill",uD(r,n))})),t)},hD=()=>t=>(t.forEach((t=>{nj(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(eD(n,e)&&eD(r,e))}(tD(t.getLocalBounds()),e);n&&ej(t)})),t),dD=()=>(t,{canvas:e,layout:n})=>(t.forEach((t=>{nj(t);const{max:e,min:r}=t.getRenderBounds(),[i,a]=e,[o,s]=r,c=((t,e)=>{const[[n,r],[i,a]]=e,[[o,s],[c,l]]=t;let u=0,f=0;return o<n?u=n-o:c>i&&(u=i-c),s<r?f=r-s:l>a&&(f=a-l),[u,f]})([[o,s],[i,a]],[[n.x,n.y],[n.x+n.width,n.y+n.height]]);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=c[0],t.style.connectorPoints[0][1]-=c[1]),t.style.x+=c[0],t.style.y+=c[1]})),t);function pD(){return{"data.fetch":dI,"data.inline":kI,"data.sortBy":xI,"data.sort":mI,"data.filter":vI,"data.pick":yI,"data.rename":bI,"data.fold":pI,"data.slice":qI,"data.custom":wI,"data.map":MI,"data.join":VI,"data.kde":KI,"data.log":QI,"data.wordCloud":YI,"data.ema":JI,"transform.stackY":Zr,"transform.binX":_s,"transform.bin":As,"transform.dodgeX":xi,"transform.jitter":Do,"transform.jitterX":Bo,"transform.jitterY":Fo,"transform.symmetryY":zo,"transform.diffY":Go,"transform.stackEnter":ki,"transform.normalizeY":wi,"transform.select":Vo,"transform.selectX":qo,"transform.selectY":Uo,"transform.groupX":os,"transform.groupY":ss,"transform.groupColor":cs,"transform.group":as,"transform.sortX":fs,"transform.sortY":ds,"transform.sortColor":hs,"transform.flexX":ps,"transform.pack":Os,"transform.sample":Ps,"transform.filter":Cs,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":i,"coordinate.theta":a,"coordinate.parallel":c,"coordinate.fisheye":l,"coordinate.radial":s,"coordinate.radar":u,"encode.constant":f,"encode.field":d,"encode.transform":h,"encode.column":p,"mark.interval":MM,"mark.rect":EM,"mark.line":TM,"mark.point":CM,"mark.text":NM,"mark.cell":RM,"mark.area":DM,"mark.link":FM,"mark.image":GM,"mark.polygon":$M,"mark.box":HM,"mark.vector":qM,"mark.lineX":KM,"mark.lineY":XM,"mark.connector":JM,"mark.range":rO,"mark.rangeX":aO,"mark.rangeY":sO,"mark.path":lO,"mark.shape":GO,"mark.density":YO,"mark.heatmap":VO,"mark.wordCloud":WO,"palette.category10":qO,"palette.category20":UO,"scale.linear":ZO,"scale.ordinal":KO,"scale.band":XO,"scale.identity":QO,"scale.point":JO,"scale.time":tE,"scale.log":eE,"scale.pow":nE,"scale.sqrt":oE,"scale.threshold":rE,"scale.quantile":iE,"scale.quantize":aE,"scale.sequential":sE,"scale.constant":cE,"theme.classic":hE,"theme.classicDark":gE,"theme.academy":mE,"theme.light":fE,"theme.dark":pE,"component.axisX":XE,"component.axisY":ZE,"component.legendCategory":nS,"component.legendContinuous":sS,"component.legends":AS,"component.title":pS,"component.sliderX":wS,"component.sliderY":MS,"component.scrollbarX":ES,"component.scrollbarY":SS,"animation.scaleInX":_S,"animation.scaleOutX":TS,"animation.scaleInY":PS,"animation.scaleOutY":CS,"animation.waveIn":qS,"animation.fadeIn":LS,"animation.fadeOut":NS,"animation.zoomIn":US,"animation.zoomOut":XS,"animation.pathIn":ZS,"animation.morphing":VS,"animation.growInX":KS,"animation.growInY":QS,"interaction.elementHighlight":_j,"interaction.elementHighlightByX":Tj,"interaction.elementHighlightByColor":Pj,"interaction.elementSelect":Lj,"interaction.elementSelectByX":Nj,"interaction.elementSelectByColor":jj,"interaction.fisheye":Ij,"interaction.chartIndex":Rj,"interaction.tooltip":nR,"interaction.legendFilter":hR,"interaction.legendHighlight":dR,"interaction.brushHighlight":wR,"interaction.brushXHighlight":OR,"interaction.brushYHighlight":SR,"interaction.brushAxisHighlight":NR,"interaction.brushFilter":jR,"interaction.brushXFilter":RR,"interaction.brushYFilter":IR,"interaction.sliderFilter":zR,"interaction.scrollbarFilter":WR,"interaction.poptip":VR,"interaction.treemapDrillDown":UR,"interaction.elementPointMove":rI,"composition.spaceLayer":WT,"composition.spaceFlex":$T,"composition.facetRect":aP,"composition.repeatMatrix":fP,"composition.facetCircle":mP,"composition.timingKeyframe":bP,"labelTransform.overlapHide":nD,"labelTransform.overlapDodgeY":oD,"labelTransform.overflowHide":hD,"labelTransform.contrastReverse":fD,"labelTransform.exceedAdjust":dD}}function gD(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const vD={};const mD=t=>t?parseInt(t):0;function yD(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class bD{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return yD(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return yD(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return yD(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const xD=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],kD="__remove__",wD="__callback__";function MD(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function OD(t,e){const{width:n,height:r,autoFit:i,depth:a=0}=t;let o=640,s=480;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||mD(e.width),r=t.clientHeight||mD(e.height);return{width:n-(mD(e.paddingLeft)+mD(e.paddingRight)),height:r-(mD(e.paddingTop)+mD(e.paddingBottom))}}(e);o=t||o,s=n||s}return o=n||o,s=r||s,{width:Math.max(j(o)?o:1,1),height:Math.max(j(s)?s:1,1),depth:a}}function ED(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of xD)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,MD(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===wD)e.children=t.value;else{const i=MD(t),{children:a=[]}=e;a.push(i),n.push(t),r.set(t,i),e.children=a}}return r.get(e)}function SD(t,e,n,r,i){const{type:a}=t,{type:o=n||a}=e;if(function(t,e){return"function"!=typeof t&&new Set(Object.keys(e)).has(t)}(o,i)){for(const n of xD)void 0!==t.attr(n)&&void 0===e[n]&&(e[n]=t.attr(n));return e}if(function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(o,r)){const t={type:"view"},n=Object.assign({},e);for(const e of xD)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function AD(t,e,n){if("function"==typeof t){const e=new bD;return e.value=t,e.type=wD,e}const{type:r,children:i}=t,a=Pe(t,["type","children"]),o=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new o;return s.value=a,s.type=r,s}function _D(t,e){const{type:n,children:r}=e,i=Pe(e,["type","children"]);t.type===n||void 0===n?jr(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function TD(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),a=AD(e,n,r);Array.isArray(t.children)&&t.push(a);const{children:o}=e;if(Array.isArray(o))for(const t of o)i.push([a,t]);else"function"==typeof o&&i.push([a,o])}}function PD(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function CD(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function LD(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function ND(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(Lr(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function jD(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function RD(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function ID(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?PD(e,n,r):"array"===t?CD(e,n,r):"object"===t?LD(e,n,r):"node"===t?jD(e,n,r):"container"===t?RD(e,n,r):"mix"===t&&ND(e,n)}return e}}function DD(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const BD={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},FD=Object.assign(Object.assign({},BD),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),zD=Object.assign(Object.assign({},BD),{labelTransform:{type:"array"}});let GD=class extends bD{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&nj(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&ej(t)}};GD=Ce([ID(zD)],GD);let WD=class extends bD{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};WD=Ce([ID(FD)],WD);const $D="G2_CHART_KEY";class YD extends GD{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:a,createCanvas:o}=t;super(Pe(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=V((()=>{this.forceFit()}),300),this._renderer=r||new x_,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[kD]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new O_,this._context={library:Object.assign(Object.assign({},a),vD),emitter:this._emitter,canvas:n,createCanvas:o},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._context.canvas.getConfig().supportsCSSTransform=!0,this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>ZN(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).catch(r).then((()=>this._renderTrailing())),e}options(t){if(0===arguments.length)return ED(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const a=[[null,t,SD(t,e,n,r,i)]];for(;a.length;){const[t,e,n]=a.shift();if(e)if(n){_D(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],o=r[i];a.push([e,o,n])}}else"function"==typeof t&&a.push([e,null,t])}else e.remove();else TD(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options();this.emit(E_.BEFORE_CLEAR),this._reset(),KN(0,this._context,!1),this.emit(E_.AFTER_CLEAR)}destroy(){this.options();this.emit(E_.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),KN(0,this._context,!0),this._container[kD]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(E_.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=OD(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(E_.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(E_.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(E_.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(E_.AFTER_CHANGE_SIZE)})),n}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends WD{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter((t=>t.startsWith("composition.")&&"composition.mark"!==t))];this._compositions=Object.fromEntries(n.map((t=>{const e=t.split(".").pop();let n=class extends GD{constructor(){super({},e)}};return n=Ce([ID(DD(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))ID(DD(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter((([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e)))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=$D}=t,{width:n,height:r,depth:i}=OD(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=OD(this.options(),this._container);this._plugins.push(new w_),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new gv({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const HD=gD(YD,Object.assign({},pD()));t.AREA_CLASS_NAME=oA,t.Academy=mE,t.Bin=As,t.BinX=_s,t.COMPONENT_CLASS_NAME=iA,t.Chart=HD,t.ChartEvent=E_,t.Classic=hE,t.ClassicDark=gE,t.Dark=pE,t.DiffY=Go,t.DodgeX=xi,t.ELEMENT_CLASS_NAME=eA,t.Filter=Cs,t.FlexX=ps,t.Group=as,t.GroupColor=cs,t.GroupX=os,t.GroupY=ss,t.Jitter=Do,t.JitterX=Bo,t.JitterY=Fo,t.LABEL_CLASS_NAME=aA,t.LABEL_LAYER_CLASS_NAME=tA,t.Light=fE,t.LinearAxis=qE,t.MAIN_LAYER_CLASS_NAME=JS,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=hi,t.MaybeDefaultY=di,t.MaybeFunctionAttribute=mi,t.MaybeGradient=bi,t.MaybeIdentityX=fi,t.MaybeIdentityY=ui,t.MaybeKey=oi,t.MaybeSeries=si,t.MaybeSize=ai,t.MaybeStackY=Qr,t.MaybeTitle=ei,t.MaybeTooltip=pi,t.MaybeTuple=yi,t.MaybeTupleX=li,t.MaybeTupleY=ci,t.MaybeVisualPosition=vi,t.MaybeZeroPadding=gi,t.MaybeZeroX=ni,t.MaybeZeroY=ri,t.MaybeZeroY1=Pn,t.MaybeZeroZ=ii,t.NormalizeY=wi,t.PLOT_CLASS_NAME=rA,t.Pack=Os,t.Runtime=YD,t.Sample=Ps,t.Select=Vo,t.SelectX=qo,t.SelectY=Uo,t.Selection=gm,t.SortColor=hs,t.SortX=fs,t.SortY=ds,t.StackEnter=ki,t.StackY=Zr,t.SymmetryY=zo,t.VIEW_CLASS_NAME=nA,t.corelib=pD,t.extend=gD,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,my.set(n,r)):Object.assign(vD,{[t]:e})},t.render=ZN,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:a=640,height:o=480}=t,s=UN(t),{group:c=new zg,emitter:l=new O_,library:u}=e;(null==c?void 0:c.parentElement)||Or("renderToMountedElement can't render chart to unmounted group.");const f=pm(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||(null===(i=null==c?void 0:c.ownerDocument)||void 0===i?void 0:i.defaultView),l.emit(E_.BEFORE_RENDER),bN(Object.assign(Object.assign({},s),{width:a,height:o}),f,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(E_.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=pm,Object.defineProperty(t,"__esModule",{value:!0})}));
59
+ */k_.tag="Dragndrop";var w_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nl(this,e),(t=fl(this,e)).name="dragndrop",t.options=n,t}return dl(e,t),il(e,[{key:"init",value:function(){this.addRenderingPlugin(new k_(el({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(Fu),M_=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],a=this._events["*"]||[],o=function(r){for(var i=r.length,a=0;a<i;a++)if(r[a]){var o=r[a],s=o.callback;o.once&&(r.splice(a,1),0===r.length&&delete e._events[t],i--,a--),s.apply(e,n)}};o(i),o(a)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),O_=M_;const E_={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},S_=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var A_={}.toString,__=function(t,e){return A_.call(t)==="[object "+e+"]"},T_=function(t){return Array.isArray?Array.isArray(t):__(t,"Array")},P_=function(t){return"object"==typeof t&&null!==t},C_=function(t){if(!P_(t)||!__(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function L_(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var a=e[i];null!==a&&C_(a)?(C_(t[i])||(t[i]={}),n<r?L_(t[i],a,n+1,r):t[i]=e[i]):T_(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var N_=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)L_(t,e[r]);return t},j_=function(t){return t};function R_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce((function(t,e){return function(n){return e(t(n))}}),t):j_}function I_(t){return t instanceof Float32Array||t instanceof Array}var D_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},B_=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function F_(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var z_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},G_=function(t,e,n,r,i){var a,o,s=z_(t,2),c=s[0],l=s[1],u=ut();return o=[c,l],(a=u)[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=o[0],a[7]=o[1],a[8]=1,a},W_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},$_=function(t,e,n,r,i){var a=new so({range:[e,e+r]}),o=new so({range:[n,n+i]});return{transform:function(t){var e=W_(t,2),n=e[0],r=e[1];return[a.map(n),o.map(r)]},untransform:function(t){var e=W_(t,2),n=e[0],r=e[1];return[a.invert(n),o.invert(r)]}}},Y_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},H_=function(t,e,n,r,i){return(0,Y_(t,1)[0])(e,n,r,i)},V_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},q_=function(t,e,n,r,i){return V_(t,1)[0]},U_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},X_=function(t,e,n,r,i){var a=U_(t,4),o=a[0],s=a[1],c=a[2],l=a[3],u=new so({range:[c,l]}),f=new so({range:[o,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=U_(t,2),n=e[0],r=e[1],i=f.map(n),a=u.map(r);return[.5*(a*Math.cos(i)*d)+.5,.5*(a*Math.sin(i)*p)+.5]},untransform:function(t){var e=U_(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,a=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),l=F_(Math.atan2(a,i),o,s);return[f.invert(l),u.invert(c)]}}},Z_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},K_=function(t,e,n,r,i){return{transform:function(t){var e=Z_(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=Z_(t,2),n=e[0];return[e[1],n]}}},Q_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},J_=function(t,e,n,r,i){var a,o,s=Q_(t,2),c=s[0],l=s[1],u=ut();return o=[c,l],(a=u)[0]=o[0],a[1]=0,a[2]=0,a[3]=0,a[4]=o[1],a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},tT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},eT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},nT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return J_.apply(void 0,eT([[-1,-1]],tT(e),!1))},rT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return J_.apply(void 0,eT([[-1,1]],tT(e),!1))},iT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return J_.apply(void 0,eT([[1,-1]],tT(e),!1))},aT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},oT=function(t,e,n,r,i){var a=aT(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(ut(),a)},sT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},cT=function(t,e,n,r,i){var a=sT(t,4),o=a[0],s=a[1],c=a[2],l=(a[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new so({range:[c,c+.99*l]}),h=new so({range:[o,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=sT(t,2),n=e[0],r=e[1],i=h.map(n),a=f.map(r);return[.5*(Math.cos(i)*(u*i+a)*p)+.5,.5*(Math.sin(i)*(u*i+a)*g)+.5]},untransform:function(t){var e=sT(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,a=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),d=F_(Math.atan2(a,i)+Math.floor(c/l)*Math.PI*2,o,s),v=c-u*d;return[h.invert(d),f.invert(v)]}}},lT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},uT=function(t,e,n,r,i){var a=lT(t,4),o=a[0],s=a[1],c=a[2],l=a[3],u=new so({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new co({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[o,s]}),i=0;i<n;i++){var a=t[i],c=r.map(i),l=u.map(a);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},fT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function hT(t){return 1/Math.tan(t)}var dT=function(t,e,n,r,i){var a=hT(fT(t,1)[0]);return{transform:function(t){var e=fT(t,2),n=e[0],r=e[1];return[n+r*a,r]},untransform:function(t){var e=fT(t,2),n=e[0],r=e[1];return[n-r*a,r]}}},pT=function(t,e,n,r,i){var a=hT(fT(t,1)[0]);return{transform:function(t){var e=fT(t,2),n=e[0];return[n,e[1]+n*a]},untransform:function(t){var e=fT(t,2),n=e[0];return[n,e[1]-n*a]}}},gT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function vT(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r,s=a?-1:1;return s*o*(n+1)/(n+o/((t-e)*s))+e}function mT(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r;return o/(o*(n+1)/(t-e)-n*(a?-1:1))+e}function yT(t,e,n){return n?new so({range:[0,1],domain:[0,e]}).map(t):t}var bT=function(t,e,n,r,i){var a=gT(t,3),o=a[0],s=a[1],c=a[2],l=yT(o,r,void 0!==c&&c);return{transform:function(t){var e=gT(t,2),n=e[0],r=e[1];return[vT(n,l,s,0,1),r]},untransform:function(t){var e=gT(t,2),n=e[0],r=e[1];return[mT(n,l,s,0,1),r]}}},xT=function(t,e,n,r,i){var a=gT(t,3),o=a[0],s=a[1],c=a[2],l=yT(o,i,void 0!==c&&c);return{transform:function(t){var e=gT(t,2);return[e[0],vT(e[1],l,s,0,1)]},untransform:function(t){var e=gT(t,2);return[e[0],mT(e[1],l,s,0,1)]}}},kT=function(t,e,n,r,i){var a=gT(t,5),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=void 0!==u&&u,h=yT(o,r,f),d=yT(s,i,f);return{transform:function(t){var e=gT(t,2),n=e[0],r=e[1];return[vT(n,h,c,0,1),vT(r,d,l,0,1)]},untransform:function(t){var e=gT(t,2),n=e[0],r=e[1];return[mT(n,h,c,0,1),mT(r,d,l,0,1)]}}},wT=function(t,e,n,r,i){var a=gT(t,5),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=void 0!==u&&u,h=new so({range:[0,r]}),d=new so({range:[0,i]}),p=f?o:h.map(o),g=f?s:d.map(s);return{transform:function(t){var e=gT(t,2),n=e[0],r=e[1],i=h.map(n)-p,a=d.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>c)return[n,r];var s=vT(o,0,l,0,c),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]},untransform:function(t){var e=gT(t,2),n=e[0],r=e[1],i=h.map(n)-p,a=d.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>c)return[n,r];var s=mT(o,0,l,0,c),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]}}},MT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},OT=function(t,e,n,r,i,a,o){var s=new so({range:[e,e+i]}),c=new so({range:[n,n+a]}),l=new so({range:[r,r+o]});return{transform:function(t){var e=MT(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=MT(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},ET=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},ST=function(t,e,n,r,i,a,o){var s=ET(t,3),c=s[0],l=s[1],u=s[2];return St(ht(),[c,l,u])},AT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},_T=function(t,e,n,r,i,a,o){return{transform:function(t){var e=AT(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=AT(t,3),n=e[0];return[e[1],n,e[2]]}}},TT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},PT=function(t,e,n,r,i,a,o){var s=TT(t,3),c=s[0],l=s[1],u=s[2];return At(ht(),[c,l,u])},CT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},LT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},NT=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},jT=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:$_,translate:G_,custom:H_,matrix:q_,polar:X_,transpose:K_,scale:J_,"shear.x":dT,"shear.y":pT,reflect:nT,"reflect.x":rT,"reflect.y":iT,rotate:oT,helix:cT,parallel:uT,fisheye:kT,"fisheye.x":bT,"fisheye.y":xT,"fisheye.circular":wT},this.update(t)}return t.prototype.update=function(t){this.options=N_({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:LT(LT([],CT(n),!1),[LT([],CT(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?LT([],CT(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],a=t(i);n.push.apply(n,B_([],D_(a),!1))}return n}}(t):t)};try{for(var c=NT(r),l=c.next();!l.done;l=c.next()){var u=CT(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.width,y=p.height,b=d(LT([],CT(h),!1),g,v,m,y);if(I_(b))a.push(b);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(b)||j_,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return R_.apply(void 0,LT([],CT(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n,r,i=ut();return e&&t.reverse(),t.forEach((function(t){return ft(i,i,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*o-s*l,h=-u*a+s*c,d=l*a-o*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*o)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*a)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(o*n-r*a)*p)}(i,(n=i,(r=new lt(9))[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r)),function(t){var e=[t[0],t[1],1];return le(e,e,i),[e[0],e[1]]}},t}(),RT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},IT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},DT=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},BT=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:OT,translate3D:ST,scale3D:PT,transpose3D:_T},this.update(t)}return t.prototype.update=function(t){this.options=N_({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:IT(IT([],RT(n),!1),[IT([],RT(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?IT([],RT(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],a=t(i);n.push.apply(n,B_([],D_(a),!1))}return n}}(t):t)};try{for(var c=DT(r),l=c.next();!l.done;l=c.next()){var u=RT(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.z,y=p.width,b=p.height,x=p.depth,k=d(IT([],RT(h),!1),g,v,m,y,b,x);if(I_(k))a.push(k);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(k)||j_,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return R_.apply(void 0,IT([],RT(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=ht();return e&&t.reverse(),t.forEach((function(t){return Vt(n,n,t)})),e&&bt(n,dt(n)),function(t){var e=[t[0],t[1],t[2],1];return ve(e,e,n),[e[0],e[1],e[2]]}},t}();function FT(t){return(e,...n)=>K({},t(e,...n),e)}function zT(t){return(e,...n)=>K({},e,t(e,...n))}function GT(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=Ce(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const WT=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:o}=t;return e.map((t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=Ce(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:GT(e,o),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:a})}))};WT.props={};const $T=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:a}=t,[o,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce(((t,e)=>t+e)),f=t[s]-i*(e.length-1),h=r.map((t=>f*(t/u))),d=[];let p=t[o]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:u}=r,f=Ce(r,["data"]),g=GT(u,a);d.push(Object.assign({[o]:p,[s]:h[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=h[n]+i}return d};$T.props={};const YT=()=>t=>{const{children:e}=t,n=Ce(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:a={},legend:o={},encode:s={},transform:c=[]}=n,l=Ce(n,["data","scale","axis","legend","encode","transform"]),u=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=Ce(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:GT(e,r),scale:K({},i,n),encode:K({},s,f),transform:[...c,...h],axis:!(!l||!a)&&K({},a,l),legend:!(!u||!o)&&K({},o,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};YT.props={};const HT=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:a,paddingRight:o,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,data:x,coordinate:k,theme:w,component:M,interaction:O,x:E,y:S,z:A,key:_,frame:T,labelTransform:P,parentKey:C,clip:L,viewStyle:N,title:j}=e,R=Ce(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:E,y:S,z:A,key:_,width:n,height:r,depth:i,padding:l,paddingLeft:a,paddingRight:o,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:w,coordinate:k,component:M,interaction:O,frame:T,labelTransform:P,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,parentKey:C,clip:L,style:N},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:j})]})]};HT.props={};class VT{constructor(t){this.$value=t}static of(t){return new VT(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const qT=FT((t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:a,y:o}=e,s=(t,e)=>{var a;if(void 0===t||!i)return{};const o=Xn(n,(e=>e[t])),s=(null===(a=null==r?void 0:r[e])||void 0===a?void 0:a.domain)||Array.from(o.keys()),c=s.map((t=>o.has(t)?o.get(t).length:1));return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"top"}},void 0===a&&{paddingInner:0}),s(a,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"right"}},void 0===o&&{paddingInner:0}),s(o,"y"))}}})),UT=zT((t=>{const{data:e,scale:n,legend:r}=t,i=[t];let a,o,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:c={}}=t,{color:l}=n,{color:u}=r,{color:f}=c;void 0!==l&&(a=l),void 0!==u&&(o=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const c="string"==typeof a?a:"",[l,u]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===a)return[void 0];const i="function"==typeof a?a:t=>t[a],o=e.map(i);return o.some((t=>"number"==typeof t))?[Yn(o)]:[Array.from(new Set(o)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=l?l:[]}},scale:{color:K({},o,{domain:l,type:u})}},void 0===r&&{legend:{color:K({title:c},s)}})})),XT=FT((()=>({animate:{enterType:"fadeIn"}}))),ZT=zT((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),KT=zT((()=>({type:"cell"}))),QT=zT((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,a=r?Array.from(new Set(e.map((t=>t[r])))):[],o=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(a.length&&o.length){const t=[];for(const e of a)for(const n of o)t.push({[r]:e,[i]:n});return t}return a.length?a.map((t=>({[r]:t}))):o.length?o.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),JT=zT(((t,e=tP,n=nP,r=rP,i={})=>{const{data:a,encode:o,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=a,{x:p,y:g}=o,{color:v}=c,{domain:m}=v;return{children:(t,a,o)=>{const{x:c,y:v}=a,{paddingLeft:y,paddingTop:b,marginLeft:x,marginTop:k}=o,{domain:w}=c.getOptions(),{domain:M}=v.getOptions(),O=Dr(t),E=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),v.invert(e)])),A=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),_=A.map((t=>d.filter(t))),T=f?hr(_,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:w.indexOf(t),columnValue:t,columnValuesLength:w.length,rowField:g,rowIndex:M.indexOf(e),rowValue:e,rowValuesLength:M.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return O.flatMap((t=>{const[e,a,o,s]=E[t],c=P[t],f=_[t];return C[t].map((v=>{var w,M,{scale:O,key:E,facet:S=!0,axis:A={},legend:_={}}=v,P=Ce(v,["scale","key","facet","axis","legend"]);const C=(null===(w=null==O?void 0:O.y)||void 0===w?void 0:w.guide)||A.y,L=(null===(M=null==O?void 0:O.x)||void 0===M?void 0:M.guide)||A.x,N={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:m}},I={x:iP(L,n)(c,j),y:iP(C,r)(c,j)};return Object.assign(Object.assign({key:`${E}-${t}`,data:j,margin:0,x:e+y+l+x,y:a+b+u+k,parentKey:h,width:o,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:K(N,O,R),axis:K({},A,I),legend:!1},P),i)}))}))}}}));function tP(t){const{points:e}=t;return ws(e)}function eP(t,e){return e.length?K({title:!1,tick:null,label:null},t):K({title:!1,tick:null,label:null,grid:null},t)}function nP(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:a,columnValuesLength:o}=e;if(r!==i-1)return eP(t,n);const s=a===o-1&&void 0,c=n.length?void 0:null;return K({title:s,grid:c},t)}}function rP(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return eP(t,n);const a=0===r&&void 0,o=n.length?void 0:null;return K({title:a,grid:o},t)}}function iP(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const aP=()=>t=>[VT.of(t).call(KT).call(UT).call(XT).call(qT).call(ZT).call(QT).call(JT).value()];aP.props={};const oP=FT((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),sP=zT((t=>{const{data:e,children:n,x:r=0,y:i=0,key:a}=t;return{children:(t,o,s)=>{const{x:c,y:l}=o,{paddingLeft:u,paddingTop:f,marginLeft:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),v=Dr(t),m=t.map((({points:t})=>ws(t))),y=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=y.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return v.flatMap((t=>{const[n,o,s,c]=m[t],[l,p]=y[t],g=b[t];return x[t].map((v=>{var m,y;const{scale:b,key:x,encode:k,axis:w,interaction:M}=v,O=Ce(v,["scale","key","encode","axis","interaction"]),E=null===(m=null==b?void 0:b.y)||void 0===m?void 0:m.guide,S={x:lP(null===(y=null==b?void 0:b.x)||void 0===y?void 0:y.guide)(g,e),y:uP(E)(g,e)};return Object.assign({data:e,parentKey:a,key:`${x}-${t}`,x:n+u+r+h,y:o+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:K({x:{facet:!1},y:{facet:!1}},b),axis:K({x:{tickCount:5},y:{tickCount:5}},w,S),legend:!1,encode:K({},k,{x:l,y:p}),interaction:K({},M,{legendFilter:!1})},O)}))}))}}})),cP=zT((t=>{const{encode:e}=t,n=Ce(t,["encode"]),{position:r=[],x:i=r,y:a=[...r].reverse()}=e,o=Ce(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[a].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},o),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[a].flat(1).length&&{y:{paddingInner:0}})})}));function lP(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return eP(t,n)}}function uP(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return eP(t,n)}}const fP=()=>t=>[VT.of(t).call(KT).call(UT).call(sP).call(cP).call(XT).call(ZT).call(oP).value()],hP=FT((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),dP=FT((t=>({coordinate:{type:"polar"}}))),pP=t=>{const{encode:e}=t,n=Ce(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function gP(t){return t=>null}function vP(t){const{points:e}=t,[n,r,i,a]=e,o=ys(n,a),s=vs(n,a),c=ks(s,vs(r,i)),l=1/Math.sin(c/2),u=o/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=xs(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const mP=()=>t=>[VT.of(t).call(KT).call(pP).call(UT).call(dP).call(QT).call(JT,vP,gP,gP,{frame:!1}).call(XT).call(ZT).call(hP).value()];function yP(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const bP=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:a="ease-in-out-sine"}=t,o=e.length;if(!Array.isArray(e)||0===o)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=K({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,a)));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=yP(i,e,o);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};function xP(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:a}=n,{markState:o}=e,s=Array.from(o.keys()).find((t=>t.key===r));if(s)return a?a.map((t=>s.data[t])):s.data[i]}function kP(t,e,n,r=t=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:a}=i;if(!a)return;const{className:o}=a;if("plot"===o)return;const s=Sj(a,(t=>"element"===t.className));const c=function(t){return Sj(t,(t=>"component"===t.className))}(a),l=function(t){return Sj(t,(t=>"label"===t.className))}(a),u=s||c||l;if(!u)return;const{className:f,markType:h}=u,d=Object.assign(Object.assign({},i),{nativeEvent:!0});"element"===f?(d.data={data:xP(u,e)},n.emit(`element:${t}`,d),n.emit(`${h}:${t}`,d)):"label"===f?(d.data={data:u.attributes.datum},n.emit(`label:${t}`,d),n.emit(`${o}:${t}`,d)):(n.emit(`component:${t}`,d),n.emit(`${o}:${t}`,d))}}function wP(){return(t,e,n)=>{const{container:r,view:i}=t,a=kP(E_.CLICK,i,n,(t=>1===t.detail)),o=kP(E_.DBLCLICK,i,n,(t=>2===t.detail)),s=kP(E_.POINTER_TAP,i,n),c=kP(E_.POINTER_DOWN,i,n),l=kP(E_.POINTER_UP,i,n),u=kP(E_.POINTER_OVER,i,n),f=kP(E_.POINTER_OUT,i,n),h=kP(E_.POINTER_MOVE,i,n),d=kP(E_.POINTER_ENTER,i,n),p=kP(E_.POINTER_LEAVE,i,n),g=kP(E_.POINTER_UPOUTSIDE,i,n),v=kP(E_.DRAG_START,i,n),m=kP(E_.DRAG,i,n),y=kP(E_.DRAG_END,i,n),b=kP(E_.DRAG_ENTER,i,n),x=kP(E_.DRAG_LEAVE,i,n),k=kP(E_.DRAG_OVER,i,n),w=kP(E_.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",v),r.addEventListener("drag",m),r.addEventListener("dragend",y),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",k),r.addEventListener("drop",w),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",v),r.removeEventListener("drag",m),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",k),r.removeEventListener("drop",w)}}}function MP(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":QE,"component.axisLinear":qE,"component.axisArc":UE,"component.legendContinuousBlock":cS,"component.legendContinuousBlockSize":uS,"component.legendContinuousSize":lS,"interaction.event":wP,"composition.mark":HT,"composition.view":YT,"shape.label.label":uM}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Er(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Ce(t,["type"]);n||Er("Plot type is required!");const a=r(n);return null==a?void 0:a(i,e)},r]}function OP(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Er("Cannot find library document")}function EP(t,e){const{coordinate:n={},coordinates:r}=t,i=Ce(t,["coordinate","coordinates"]);if(r)return t;const{type:a,transform:o=[]}=n,s=Ce(n,["type","transform"]);if(!a)return Object.assign(Object.assign({},i),{coordinates:o});const[,c]=MP("coordinate",e),{transform:l=!1}=c(a).props||{};if(l)throw new Error(`Unknown coordinate: ${a}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:a},s),...o]})}function SP(t,e){return t.filter((t=>t.type===e))}function AP(t){return SP(t,"polar").length>0}function _P(t){return SP(t,"transpose").length%2==1}function TP(t){return SP(t,"theta").length>0}function PP(t){return SP(t,"radial").length>0}function CP(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}bP.props={},wP.props={reapplyWhenUpdate:!0};var LP=CP("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),NP=CP("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),jP=CP("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),RP=CP("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),IP=CP("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),DP=CP("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),BP=CP("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),FP=CP("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),zP=CP("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),GP=CP("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),WP=CP("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var $P=t=>()=>t;function YP(t,e){return function(n){return t+n*e}}function HP(t){return 1==(t=+t)?VP:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):$P(isNaN(e)?n:e)}}function VP(t,e){var n=e-t;return n?YP(t,n):$P(isNaN(t)?e:t)}!function t(e){var n=HP(e);function r(t,e){var r=n((t=Gl(t)).r,(e=Gl(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=VP(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);var qP,UP=(qP=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r<e-1?t[r+2]:2*a-i;return function(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}((n-r/e)*e,o,i,a,s)}},function(t){var e,n,r=t.length,i=new Array(r),a=new Array(r),o=new Array(r);for(e=0;e<r;++e)n=Gl(t[e]),i[e]=n.r||0,a[e]=n.g||0,o[e]=n.b||0;return i=qP(i),a=qP(a),o=qP(o),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=o(t),n+""}});function XP(t){return function e(n){function r(e,r){var i=t((e=uu(e)).h,(r=uu(r)).h),a=VP(e.s,r.s),o=VP(e.l,r.l),s=VP(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}XP((function(t,e){var n=e-t;return n?YP(t,n>180||n<-180?n-360*Math.round(n/360):n):$P(isNaN(t)?e:t)}));var ZP=XP(VP),KP=t=>UP(t[t.length-1]),QP=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(CP),JP=KP(QP),tC=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(CP),eC=KP(tC),nC=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(CP),rC=KP(nC),iC=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(CP),aC=KP(iC),oC=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(CP),sC=KP(oC),cC=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(CP),lC=KP(cC),uC=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(CP),fC=KP(uC),hC=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(CP),dC=KP(hC),pC=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(CP),gC=KP(pC),vC=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(CP),mC=KP(vC),yC=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(CP),bC=KP(yC),xC=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(CP),kC=KP(xC),wC=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(CP),MC=KP(wC),OC=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(CP),EC=KP(OC),SC=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(CP),AC=KP(SC),_C=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(CP),TC=KP(_C),PC=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(CP),CC=KP(PC),LC=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(CP),NC=KP(LC),jC=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(CP),RC=KP(jC),IC=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(CP),DC=KP(IC),BC=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(CP),FC=KP(BC),zC=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(CP),GC=KP(zC),WC=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(CP),$C=KP(WC),YC=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(CP),HC=KP(YC),VC=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(CP),qC=KP(VC),UC=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(CP),XC=KP(UC),ZC=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(CP),KC=KP(ZC);var QC=ZP(uu(300,.5,0),uu(-240,.5,1)),JC=ZP(uu(-100,.75,.35),uu(80,1.5,.8)),tL=ZP(uu(260,.75,.35),uu(80,1.5,.8)),eL=uu();var nL=Gl(),rL=Math.PI/3,iL=2*Math.PI/3;function aL(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var oL=aL(CP("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),sL=aL(CP("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),cL=aL(CP("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),lL=aL(CP("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),uL=Object.freeze({__proto__:null,schemeCategory10:LP,schemeAccent:NP,schemeDark2:jP,schemeObservable10:RP,schemePaired:IP,schemePastel1:DP,schemePastel2:BP,schemeSet1:FP,schemeSet2:zP,schemeSet3:GP,schemeTableau10:WP,interpolateBrBG:JP,schemeBrBG:QP,interpolatePRGn:eC,schemePRGn:tC,interpolatePiYG:rC,schemePiYG:nC,interpolatePuOr:aC,schemePuOr:iC,interpolateRdBu:sC,schemeRdBu:oC,interpolateRdGy:lC,schemeRdGy:cC,interpolateRdYlBu:fC,schemeRdYlBu:uC,interpolateRdYlGn:dC,schemeRdYlGn:hC,interpolateSpectral:gC,schemeSpectral:pC,interpolateBuGn:mC,schemeBuGn:vC,interpolateBuPu:bC,schemeBuPu:yC,interpolateGnBu:kC,schemeGnBu:xC,interpolateOrRd:MC,schemeOrRd:wC,interpolatePuBuGn:EC,schemePuBuGn:OC,interpolatePuBu:AC,schemePuBu:SC,interpolatePuRd:TC,schemePuRd:_C,interpolateRdPu:CC,schemeRdPu:PC,interpolateYlGnBu:NC,schemeYlGnBu:LC,interpolateYlGn:RC,schemeYlGn:jC,interpolateYlOrBr:DC,schemeYlOrBr:IC,interpolateYlOrRd:FC,schemeYlOrRd:BC,interpolateBlues:GC,schemeBlues:zC,interpolateGreens:$C,schemeGreens:WC,interpolateGreys:HC,schemeGreys:YC,interpolatePurples:qC,schemePurples:VC,interpolateReds:XC,schemeReds:UC,interpolateOranges:KC,schemeOranges:ZC,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:QC,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return eL.h=360*t-100,eL.s=1.5-1.5*e,eL.l=.8-.9*e,eL+""},interpolateWarm:JC,interpolateCool:tL,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,nL.r=255*(e=Math.sin(t))*e,nL.g=255*(e=Math.sin(t+rL))*e,nL.b=255*(e=Math.sin(t+iL))*e,nL+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:oL,interpolateMagma:sL,interpolateInferno:cL,interpolatePlasma:lL});function fL(t,e,n,r,i,a){const{guide:o={}}=n,s=function(t,e,n){const{type:r,domain:i,range:a,quantitative:o,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return AL(t,Nr)}(e))return"identity";if("string"==typeof a)return"linear";if((i||a||[]).length>2)return wL(t,s);if(void 0!==i)return EL([i])?wL(t,s):SL(e)?"time":ML(t,a,o);return EL(e)?wL(t,s):SL(e)?"time":ML(t,a,o)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return OL(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)Ar(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return OL(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Ar(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(yL({type:t}))return function(t,e,n){const r=t.map(Number),i=new so({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return bL({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Pa,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?TP(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:a=i,paddingOuter:o=i}=r;return Object.assign(Object.assign({},r),{paddingInner:a,paddingOuter:o,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=W(e),i=uL[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:xL(s,t,e,n,l,i,a),expectedDomain:c,guide:o,name:t,type:s})}function hL(t,e){const n={};for(const r of t){const{values:t,name:i}=r,a=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>a.map(t)))}}return n}function dL(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter((t=>t.startsWith(e))).map((t=>+(t.replace(e,"")||0))),a=hr(i)+1,o=`${e}${a}`;t[o]=r,r.getOptions().key=o}else t[e]=r}return t}function pL(t,e){const[n]=MP("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[wr,wr];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const a=t.filter((([t])=>"function"==typeof t)),o=t.filter((([t])=>"function"!=typeof t)),s=new Map(o);if(r.map=t=>{for(const[e,n]of a)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(o.map((([t,e])=>[e,t]))),l=new Map(a.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function gL(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));mL(e,"x"),mL(e,"y")}function vL(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function mL(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(yL)?Yn(r):n.every(bL)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function yL(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function bL(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function xL(t,e,n,r,i,a,o){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=kL(n,r,i,a,o),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[Br(e),Fr(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=c?c:s,null!=l?l:u]}case"band":case"point":return[null!=c?c:"size"===e?5:0,null!=l?l:"size"===e?10:1];case"ordinal":return kL(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function kL(t,e,n,r,i){const[a]=MP("palette",i),{category10:o,category20:s}=r,c=function(t){return Array.from(new Set(t))}(n).length<=o.length?o:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return a({type:l})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=W(t),i=uL[`scheme${r}`],a=uL[`interpolate${r}`];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>a(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function wL(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function ML(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function OL(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,a]=t;return[null!=n?n:i,null!=r?r:a]}function EL(t){return AL(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function SL(t){return AL(t,(t=>t instanceof Date))}function AL(t,e){for(const n of t)if(n.some(e))return!0;return!1}const _L={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},TL={threshold:"threshold",quantize:"quantize",quantile:"quantile"},PL={ordinal:"ordinal",band:"band",point:"point"},CL={constant:"constant"};function LL(t,e,n){const{coordinates:r=[],title:i}=e,[,a]=MP("component",n),o=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=MP("component",n),{coordinates:i}=t;function a(t,e,n,a){const o=function(t,e,n=[]){return"x"===t?_P(n)?`${e}Y`:`${e}X`:"y"===t?_P(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!a||!o)return;const{props:s}=r(o),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:o,crossPadding:f},a),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[a("slider",r,t,e),a("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=a("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:o,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:o},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,a=n&&n.length>0,o=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&a&&o)||!(!["sequential"].includes(e)||!a||!o&&!i)||!(!["constant","identity"].includes(e)||!o)}(t)));return[...RL(n),...DL(n,e)]}(o,r);return l.forEach((([t,e])=>{const{props:n}=a(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,g=K({},...e),{guide:v,field:m}=g,y=Array.isArray(v)?v:[v];for(const n of y){const[a,g]=zL(t,i,l,n,e,o,r);if(!a&&!g)continue;const v="left"===a||"right"===a,y=v?d[1]:d[0],b=v?p[1]:p[0],{size:x,order:k=f,length:w=h,padding:M=y,crossPadding:O=b}=n;s.push(Object.assign(Object.assign({title:m},n),{defaultSize:u,length:w,position:a,plane:c,orientation:g,padding:M,order:k,crossPadding:O,size:x,type:t,scales:e}))}})),s}function NL(t,e,n,r,i){const[a]=MP("component",r),{scaleInstances:o,scale:s,bbox:c}=t,l={bbox:c,library:r};return a(Ce(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function jL(t,e){const n=["left","right","bottom","top"],r=Zn(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=kr(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=hr(t,(t=>t.size)),r=hr(t,(t=>t.order)),i=hr(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function RL(t,e){const n=["shape","size","color","opacity"],r=t.filter((({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e))),i=r.filter((({type:t})=>"constant"===t)),a=Zn(r.filter((({type:t})=>"constant"!==t)),(t=>t.field?t.field:Symbol("independent"))).map((([t,e])=>[t,[...e,...i]])).filter((([,t])=>t.some((t=>"constant"!==t.type)))),o=new Map(a);if(0===o.size)return[];const s=t=>t.sort((([t],[e])=>t.localeCompare(e))),c=Array.from(o).map((([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...Gr(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,IL(t)]))})));for(const{option:t,combination:e}of n)if(!t.every((t=>"constant"===t[1]))&&t.every((t=>"discrete"===t[1]||"constant"===t[1])))return["legendCategory",e];for(const[t,e]of S_)for(const{option:r,combination:i}of n)if(e.some((t=>tt(s(t),s(r)))))return[t,i];return null})).filter(Ar);return c}function IL(t){const{type:e}=t;return"string"!=typeof e?null:e in _L?"continuous":e in PL?"discrete":e in TL?"distribution":e in CL?"constant":null}function DL(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return SP(t,"helix").length>0}(e)||TP(e))return null;if(_P(e)&&(AP(e)||PP(e)))return null;if(n.startsWith("x"))return AP(e)?["axisArc",[t]]:PP(e)?["axisLinear",[t]]:[_P(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return AP(e)?["axisLinear",[t]]:PP(e)?["axisArc",[t]]:[_P(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return SP(t,"radar").length>0}(e))return["axisRadar",[t]];if(!AP(e))return["axisY",[t]]}return null})).filter(Ar)}function BL(t){const e=SP(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=SP(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=s(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function FL(t,e,n,r,i){const{name:a}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(a);if(a===t.slice(-1)[0].name||null===e)return[null,null];const[n,o]=BL(i);return["center",(o-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return SP(t,"parallel").length>0}(i))return _P(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=BL(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:AP(i)||PP(i)?["center",null]:"axisX"===t&&function(t){return SP(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return SP(t,"reflectY").length>0}(i)?["top",null]:e}function zL(t,e,n,r,i,a,o){const[s]=BL(o),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?FL(t,c,i,a,o):"string"==typeof t&&t.startsWith("legend")&&AP(o)&&"center"===r.position?["center","vertical"]:c}function GL(t,e,n,r,i,a){const{type:o}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof o)return;const s=o;return(s.startsWith("axis")?VL:s.startsWith("group")?WL:s.startsWith("legendContinuous")?qL:"legendCategory"===s?UL:s.startsWith("slider")?HL:"title"===s?YL:s.startsWith("scrollbar")?$L:()=>{})(t,e,n,r,i,a)}function WL(t,e,n,r,i,a){const{children:o}=t,s=hr(o,(t=>t.crossPadding));o.forEach((t=>t.crossPadding=s)),o.forEach((t=>GL(t,e,n,r,i,a)));const c=hr(o,(t=>t.size));t.size=c,o.forEach((t=>t.size=c))}function $L(t,e,n,r,i,a){const{trackSize:o=6}=K({},i.scrollbar,t);t.size=o}function YL(t,e,n,r,i,a){const o=K({},i.title,t),{title:s,subtitle:c,spacing:l=0}=o,u=Ce(o,["title","subtitle","spacing"]);if(s){const e=tN(s,Tr(u,"title"));t.size=e.height}if(c){const e=tN(c,Tr(u,"subtitle"));t.size+=l+e.height}}function HL(t,e,n,r,i,a){const{trackSize:o,handleIconSize:s}=(()=>{const{slider:e}=i;return K({},e,t)})(),c=Math.max(o,2.4*s);t.size=c}function VL(t,e,n,r,i,a){var o;t.transform=t.transform||[{type:"hide"}];const s="left"===r||"right"===r,c=QL(t,r,i),{tickLength:l=0,labelSpacing:u=0,titleSpacing:f=0,labelAutoRotate:h}=c,d=Ce(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),p=XL(t,a),g=ZL(d,p),v=l+u;if(g&&g.length){const r=hr(g,(t=>t.width)),i=hr(g,(t=>t.height));if(s)t.size=r+v;else{const{tickFilter:a,labelTransform:s}=t;!function(t,e,n,r,i){const a=kr(e,(t=>t.width));if(a>n)return!0;const o=t.clone();o.update({range:[0,n]});const s=JL(t,i),c=s.map((t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(o,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],h=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=h(n,e[t]);if(r<u||i>f)return!0;const a=c[t+1];if(a){const[n]=h(a,e[t+1]);if(i>n)return!0}}return!1}(p,g,e,n,a)||s||!1===h||null===h?(t.labelTransform=null!==(o=t.labelTransform)&&void 0!==o?o:"rotate(0)",t.size=i+v):(t.labelTransform="rotate(90)",t.size=r+v)}}else t.size=l;const m=KL(d);m&&(t.size+=s?f+m.width:f+m.height)}function qL(t,e,n,r,i,a){const o=(()=>{const{legendContinuous:e}=i;return K({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=o,l=Ce(o,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=Tr(l,"ribbon"),{size:h}=f,d=Tr(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const v=ZL(l,XL(t,a));if(v){const e=u?"width":"height",n=hr(v,(t=>t[e]));t.size+=n+s}const m=KL(l);m&&(u?t.size=Math.max(t.size,m.width):t.size+=c+m.height)}function UL(t,e,n,r,i,a){const o=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,a]=Array.isArray(n)?[n,void 0]:[void 0,n];return K({title:r},e,Object.assign(Object.assign({},t),{title:a}))})(),{itemSpacing:s,itemMarkerSize:c,titleSpacing:l,rowPadding:u,colPadding:f,maxCols:h=1/0,maxRows:d=1/0}=o,p=Ce(o,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:v}=t,m=t=>Math.min(t,d),y=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===v?e+(b?0:n[0]+n[1]):v,k=KL(p),w=ZL(p,XL(t,a),"itemLabel"),M=Math.max(w[0].height,c)+u,O=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,a=-1/0,o=-1/0;const s=k?k.height:0,c=x-s;for(const{width:t}of w){const s=O(t,f);e=Math.max(e,s),n+M>c?(r++,a=Math.max(a,i),o=Math.max(o,n),i=1,n=M):(n+=M,i++)}r<=1&&(a=i,o=n),t.size=e*y(r),t.length=o+s,K(t,{cols:y(r),gridRow:a})})():"number"==typeof g?(()=>{const e=Math.ceil(w.length/g),n=hr(w,(t=>O(t.width)))*g;t.size=M*m(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of w){const i=O(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=M*m(e)-u,t.length=r})(),k&&(b?t.size=Math.max(t.size,k.width):t.size+=l+k.height)}function XL(t,e){const[n]=MP("scale",e),{scales:r,tickCount:i,tickMethod:a}=t,o=r.find((t=>"constant"!==t.type&&"identity"!==t.type));return void 0!==i&&(o.tickCount=i),void 0!==a&&(o.tickMethod=a),n(o)}function ZL(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=Ce(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=function(t,e,n){const r=JL(t,n),i=r.map((t=>"number"==typeof t?mm(t):t)),a=e?"string"==typeof e?AE(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(a)}(e,r,i),c=Tr(o,n),l=s.map(((t,e)=>Object.fromEntries(Object.entries(c).map((([n,r])=>[n,"function"==typeof r?r(t,e):r]))))),u=s.map(((t,e)=>tN(t,l[e]))),f=l.some((t=>t.transform));if(!f){const e=s.map(((t,e)=>e));t.indexBBox=new Map(e.map((t=>[t,[s[t],u[t]]])))}return u}function KL(t){const{title:e}=t,n=Ce(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=Tr(n,"title"),{direction:i,transform:a}=r,o=Array.isArray(e)?e.join(","):e;if("string"!=typeof o)return null;return tN(o,Object.assign(Object.assign({},r),{transform:a||("vertical"===i?"rotate(-90)":"")}))}function QL(t,e,n){const{title:r}=t,[i,a]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:o,[`axis${Or(e)}`]:s}=n;return K({title:i},o,s,Object.assign(Object.assign({},t),{title:a}))}function JL(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function tN(t,e){const n=function(t){return t instanceof Rg?t:new tv({style:{text:`${t}`}})}(t),r=Ce(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function eN(t,e,n,r){var i,a;const{width:o,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:v=h,margin:m=(null!==(a=n.margin)&&void 0!==a?a:0),marginLeft:y=m,marginBottom:b=m,marginTop:x=m,marginRight:k=m,padding:w=n.padding,paddingBottom:M=w,paddingLeft:O=w,paddingRight:E=w,paddingTop:S=w}=function(t,e,n,r){const{coordinates:i}=e;if(!AP(i)&&!PP(i))return e;const a=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===a.length)return e;const o=a.map((t=>QL(t,"axisArc"===t.type?"arc":"linear",n))),s=hr(o,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=a.flatMap(((t,e)=>ZL(o[e],XL(t,r)))).filter(Ar),l=hr(c,(t=>t.height))+s,u=a.flatMap(((t,e)=>KL(o[e]))).filter((t=>null!==t)),f=0===u.length?0:hr(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:v=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),A=(t,n,r,i,a)=>{const{marks:o}=e;if(0===o.length)return[i,a];if(t-i-a-.25*t>0)return[i,a];const s=.75*t;return["auto"===n?s*i/(i+a):i,"auto"===r?s*a/(i+a):a]},_=t=>"auto"===t?20:null!=t?t:20,T=_(S),P=_(M),C=nN(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:L,paddingRight:N}=C,j=o-y-k,[R,I]=A(j,O,E,L,N),D=j-R-I,B=nN(t,D,[R+y,I+k],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=B,G=s-b-x,[W,$]=A(G,M,S,z,F);return{width:o,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:v,innerWidth:D,innerHeight:G-W-$,paddingLeft:R,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:y,marginBottom:b,marginTop:x,marginRight:k,x:l,y:u,z:f}}function nN(t,e,n,r,i,a,o){const s=Xn(t,(t=>t.position)),{padding:c=a.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${Or(qw(t))}`,i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=hr(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(GL(r,e,n,t,a,o),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=pr(i,(t=>t.order)),v=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(v.length&&(v[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=jL(i,p?e+n[0]+n[1]:e);t.forEach(f);const a=t.reduce(((t,{size:e,crossPadding:n=12})=>t+e+n),0);d[r]=a}}return d}function rN({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:a,marginLeft:o,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:h,insetLeft:d,insetRight:p,insetTop:g}){const v=n+o,m=i+s,y=r+l,b=a+c,x=t-o-l,k=[v+d,m+g,f-d-p,u-g-h,"center",null,null];return{top:[v,0,f,m,"vertical",!0,Ln,o,x],right:[t-y,m,y,u,"horizontal",!1,Ln],bottom:[v,e-b,f,b,"vertical",!1,Ln,o,x],left:[0,m,v,u,"horizontal",!0,Ln],"top-left":[v,0,f,m,"vertical",!0,Ln],"top-right":[v,0,f,m,"vertical",!0,Ln],"bottom-left":[v,e-b,f,b,"vertical",!1,Ln],"bottom-right":[v,e-b,f,b,"vertical",!1,Ln],center:k,inner:k,outer:k}}function iN(t,e,n,r){const[i,a]=zr(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return Hc(t)&&Wc(t)}(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Wc(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n):Hc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,a]=n,o=new Array(t.length).fill(0),s=e.map(o),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],o=c[e+1]-i;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,a]=n,o=new Array(t.length).fill(0),s=e.map(o),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],o=c[e+1]-r;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,a]=n,[o,s]=e.getCenter(),[c]=Uc(e),l=c*(a/2),u=o-l,f=s-l;for(let e=0;e<t.length;e++){t[e].bbox={x:r+u,y:i+f,width:2*l,height:2*l}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,a,o]=n,[s]=Uc(e),c=o/2*s/Math.sqrt(2),l=r+a/2,u=i+o/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(a,e,n)}function aN(t,e,n){const[r,i,a,o,s,c,l,u,f]=n,[h,d,p,g,v,m,y,b]="vertical"===s?["y",i,"x",r,"height",o,"width",a]:["x",r,"y",i,"width",a,"height",o];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),k=(t,e,n)=>void 0===n?e:x(t)?n:e,w=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+m:d;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:a}=r,{size:o}=r;r.bbox={[h]:c?n-o-i:n+i,[p]:w(a,g,u),[v]:o,[y]:k(a,b,f)},n+=(o+i)*(c?-1:1)}const M=t.filter((t=>"group"===t.type));for(const t of M){const{bbox:e,children:n}=t,r=e[y],i=r/n.length,a=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),o=n.map(((t,e)=>{const{length:r=i,padding:a=0}=t;return r+(e===n.length-1?0:a)})),s=r-kr(o),c="flex-start"===a?0:"center"===a?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[v]:e[v],[h]:e[h],[p]:r,[y]:o[t]-c},K(i,{layout:{justifyContent:a}}),r+=o[t]}}}function oN(t,e,n){const{encode:r={},scale:i={},transform:a=[]}=e,o=Ce(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},o),{encode:r,scale:i,transform:a})]}function sN(t,e,n){return Ne(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=MP("data",t),a=function(t){if(R(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=Ce(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:o=[]}=a,s=[Ce(a,["transform"]),...o].map((t=>i(t,n))),c=yield function(t){return t.reduce(((t,e)=>n=>Ne(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),wr)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?Dr(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function cN(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function lN(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const a=Ir(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Ar(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:a})]}function uN(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Ir(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function fN(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:a}=n,o=function(t){const[e]=MP("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:yN(n)})}(a),s=Ir(r,(t=>o(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function hN(t,e,n){const{tooltip:r={}}=e;return jr(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Nr(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function dN(t,e,n){const{data:r,encode:i,tooltip:a={}}=e;if(jr(a))return[t,e];const o=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(Nr(e)){const{field:n,channel:a,color:o,name:s=n,valueFormatter:c=t=>t}=e,l="string"==typeof c?AE(c):c,u=a&&i[a],f=u&&i[a].field,h=s||f||a,d=[];for(const e of t){const t=n?r[e][n]:u?i[a].value[e]:null;d[e]={name:h,color:o,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const a of t){const t=e(r[a],a,r,i);Nr(t)?n[a]=t:n[a]={value:t}}return n}return e},{title:s,items:c=[]}=a,l=Ce(a,["title","items"]),u=Object.assign({title:o(s),items:Array.isArray(c)?c.map(o):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function pN(t,e,n){const{encode:r}=e,i=Ce(e,["encode"]);if(!r)return[t,e];const a=Object.entries(r),o=a.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,a=Ce(n,["value"]);for(let n=0;n<i.length;n++){const a=i[n];if(Array.isArray(a))for(let i=0;i<a.length;i++){const o=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];o[1][n]=a[i],r[i]=o}}return r.map((([t,e])=>[t,Object.assign({type:"column",value:e},a)]))})),s=Object.fromEntries([...a,...o]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function gN(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return K(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map((t=>{const e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]})))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function vN(t,e,n){const{animate:r}=e;return r||void 0===r||K(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function mN(t,e,n){return Ne(this,void 0,void 0,(function*(){const[r,i]=yield function(t,e,n){return Ne(this,void 0,void 0,(function*(){const{library:r}=n,[i]=MP("transform",r),{preInference:a=[],postInference:o=[]}=e,{transform:s=[]}=t,c=[oN,sN,cN,lN,uN,fN,pN,vN,gN,hN,...a.map(i),...s.map(i),...o.map(i),dN];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,n),{encode:a,scale:o,data:s,tooltip:c}=i;if(!1===Array.isArray(s))return null;const{channels:l}=e,u=Qn(Object.entries(a).filter((([,t])=>Ar(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=l.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),f=l.filter((t=>{const{name:e,required:n}=t;if(u.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:a,ordinal:s}=t;return u.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=o[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Ce(f,["independent","key","type"]),v="constant"===p,m=v?void 0:i;return{name:t,values:e,scaleKey:h||v?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:m},g),{quantitative:a,ordinal:s})}}))}));return[i,Object.assign(Object.assign({},e),{index:r,channels:f,tooltip:c})]}))}function yN(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function bN(t,e,n){var r;return Ne(this,void 0,void 0,(function*(){const{library:i}=n,[a]=MP("composition",i),[o]=MP("interaction",i),s=new Set(Object.keys(i).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Ar)),c=new Set(Object.keys(i).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Ar)),l=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||c.has(e)?"mark":e},u=t=>"mark"===l(t),f=t=>"standardView"===l(t),h=t=>{const{type:e}=t;return"string"==typeof e&&!!c.has(e)},d=t=>{if(f(t))return[t];const e=l(t);return a({type:e,static:h(t)})(t)},p=[],g=new Map,v=new Map,m=[t],y=[];for(;m.length;){const t=m.shift();if(f(t)){const e=v.get(t),[r,a]=e?EN(e,t,i):yield wN(t,n);g.set(r,t),p.push(r);const o=a.flatMap(d).map((t=>EP(t,i)));if(m.push(...o),o.every(f)){const t=yield Promise.all(o.map((t=>MN(t,n))));gL(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];v.set(n,r)}}}else{const e=d(u(t)?t:yield zN(t,n));Array.isArray(e)?m.push(...e):"function"==typeof e&&y.push(e())}}n.emitter.emit(E_.BEFORE_PAINT);const b=new Map,k=new Map,w=[];e.selectAll(YN(nA)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",nA).attr("id",(t=>t.key)).call(xN).each((function(t,e,r){SN(t,pm(r),w,n),b.set(t,r)}))),(t=>t.call(xN).each((function(t,e,r){SN(t,pm(r),w,n),k.set(t,r)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const M=(t,e,r)=>Array.from(t.entries()).map((([i,a])=>{const o=r||new Map,s=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=MP("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),a=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,o=FN(e),s=o.map(i).filter(a).map((t=>t[0]));return(e,r,i)=>Ne(this,void 0,void 0,(function*(){const a=[],[o,c]=yield wN(e,n);SN(o,t,a,n);for(const i of s.filter((t=>t!==r)))kN(i,t,e,o,n);for(const e of c)bN(e,t,n);return i(),{options:e,view:o}}))}(pm(a),s,n);return{view:i,container:a,options:s,setState:(t,e=t=>t)=>o.set(t,e),update:(n,r)=>Ne(this,void 0,void 0,(function*(){const i=Mr(Array.from(o.values()))(s);return yield c(i,n,(()=>{x(r)&&e(t,r,o)}))}))}})),O=(t=k,e,r)=>{var i;const a=M(t,O,r);for(const t of a){const{options:r,container:s}=t,c=s.nameInteraction;let l=FN(r);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=ON(t.view,r,s,o)(t,a,n.emitter);c.set(r,{destroy:e})}}}},E=M(b,O);for(const t of E){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of FN(e)){const[e,a]=i;if(a){const i=ON(t.view,e,a,o)(t,E,n.emitter);r.set(e,{destroy:i})}}}O();const{width:S,height:A}=t,_=[];for(const t of y){const r=new Promise((r=>Ne(this,void 0,void 0,(function*(){for(const r of t){const t=Object.assign({width:S,height:A},r);yield bN(t,e,n)}r()}))));_.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach((t=>null==t?void 0:t.cancel())),n.animations=w,n.emitter.emit(E_.AFTER_PAINT);const T=w.filter(Ar).map(RN).map((t=>t.finished));return Promise.all([...T,..._])}))}function xN(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function kN(t,e,n,r,i){var a;const{library:o}=i,[s]=MP("interaction",o),c=e.node().nameInteraction,l=FN(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!l[1])return;const f=ON(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set(t,{destroy:d})}function wN(t,e){return Ne(this,void 0,void 0,(function*(){const{library:n}=e,r=yield function(t,e){return Ne(this,void 0,void 0,(function*(){const{library:n}=e,[r,i]=MP("mark",n),a=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Ar)),{marks:o}=t,s=[],c=[],l=[...o],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:a=r,paddingTop:o=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:v=d,insetBottom:m=d}=t,y=t=>"auto"===t?20:t;return{width:n-y(i)-y(a)-l-u-p-g,height:e-y(o)-y(s)-f-h-v-m}}(t),h={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield zN(t,e),{type:o=Er("G2Mark type is required."),key:u}=n;if(a.has(o))c.push(n);else{const{props:t={}}=i(o),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,h),a=Array.isArray(i)?i:[i];l.unshift(...a.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})}))}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,a=Ce(t,["coordinate","interaction","style","marks"]),o=i.map((t=>t.coordinate||{})),s=i.map((t=>t.interaction||{})),c=i.map((t=>t.viewStyle||{})),l=[...o,e].reduceRight(((t,e)=>K(t,e)),{}),u=[n,...s].reduce(((t,e)=>K(t,e)),{}),f=[...c,r].reduce(((t,e)=>K(t,e)),{});return Object.assign(Object.assign({},a),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const a=EP(i,n);return EN(yield MN(a,e),a,n)}))}function MN(t,e){return Ne(this,void 0,void 0,(function*(){const{library:n}=e,[r]=MP("theme",n),[,i]=MP("mark",n),{theme:a,marks:o,coordinates:s=[]}=t,c=r(BN(a)),l=new Map;for(const t of o){const{type:n}=t,{props:r={}}=i(n),a=yield mN(t,r,e);if(a){const[t,e]=a;l.set(t,e)}}const u=Xn(Array.from(l.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of u.values()){const e=t.reduce(((t,{scale:e})=>K(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],a=Array.from(new Set(i.map((t=>t.field)).filter(Ar))),o=K({guide:{title:0===a.length?void 0:a},field:a[0]},e),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},fL(l,u,o,s,c,n)),{uid:Symbol("scale"),key:r});t.forEach((t=>t.scale=f))}return l}))}function ON(t,e,n,r){const i=t.theme,a="string"==typeof e&&i[e]||{};return r(K(a,Object.assign({type:e},n)))}function EN(t,e,n){var r;const[i]=MP("mark",n),[a]=MP("theme",n),[o]=MP("labelTransform",n),{key:s,frame:c=!1,theme:l,clip:u,style:f={},labelTransform:h=[]}=e,d=a(BN(l)),p=Array.from(t.values()),g=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],a=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),o=new Map(a.map((t=>[t.name,t])));for(const t of r){const e=vL(t);for(const r of e){const e=o.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=K({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:rt(t,i)});a.push(e)}}}return a}(p,e),v=function(t){return t.map((t=>{const e=K(t,t.style);return delete e.style,e}))}(LL(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const a={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},o=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:o,name:"shape",type:"constant",domain:[],range:[a[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),m=eN(v,e,d,n),y=function(t,e,n){const[r]=MP("coordinate",n),{innerHeight:i,innerWidth:a,insetLeft:o,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?h:[...h,{type:"cartesian"}];var h;const d="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:o,y:s,width:a-o-c,height:i-l-s,transformations:f.flatMap(r)});return d?new BT(p):new jT(p)}(m,e,n),b=c?K({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=Xn(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m,height:y,width:b,depth:x}=n,k={xy:rN({width:b,height:y,paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m}),yz:rN({width:x,height:y,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:y,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:rN({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),a=k[r][i],[o,s]=zr(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));o.length&&iN(o,e,a,i),s.length&&aN(n,0,a)}}(jL(v),y,m),function(t){const e=t.find((({type:t})=>"axisX"===t)),n=t.find((({type:t})=>"axisY"===t)),r=t.find((({type:t})=>"axisZ"===t));e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap((t=>{const{channels:e}=t;return e.map((({scale:t})=>[t.uid,pL(t,n)]))})));!function(t,e){const n=Array.from(t.values()).flatMap((t=>t.channels)),r=Qn(n,(t=>t.map((t=>e.get(t.scale.uid)))),(t=>t.name)).filter((([,t])=>t.some((t=>"function"==typeof t.getOptions().groupTransform))&&t.every((t=>t.getTicks)))).map((t=>t[1]));r.forEach((t=>{const e=t.map((t=>t.getOptions().groupTransform))[0];e(t)}))}(t,x);const k={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:a}=t,o=null!==(r=x.get(a))&&void 0!==r?r:pL(t,n);i.push(o),"y"===e&&o.update(Object.assign(Object.assign({},o.getOptions()),{xScale:k.x})),dL(k,{[e]:o})}t.scaleInstances=i}const w=[];for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:a,key:o}=e,{index:c,channels:l,tooltip:u}=n,f=Object.fromEntries(l.map((({name:t,scale:e})=>[t,e]))),h=Ir(f,(({uid:t})=>x.get(t)));dL(k,h);const d=hL(l,h),p=i(e),[g,v,b]=AN(p(c,h,d,y)),M=r||g.length,O=a?a(v,M,m):[],E=t=>{var e,n;return null===(n=null===(e=u.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},S=t=>u.items.map((e=>e[t])),A=g.map(((t,e)=>{const n=Object.assign({points:v[e],transform:O[e],index:t,markKey:o,viewKey:s},u&&{title:E(t),items:S(t)});for(const[r,i]of Object.entries(d))n[r]=i[t],b&&(n[`series${W(r)}`]=b[e].map((t=>i[t])));return b&&(n.seriesIndex=b[e]),b&&u&&(n.seriesItems=b[e].map((t=>S(t))),n.seriesTitle=b[e].map((t=>E(t)))),n}));n.data=A,n.index=g;const _=null==t?void 0:t(A,h,m);w.push(..._||[])}return[{layout:m,theme:d,coordinate:y,markState:t,key:s,clip:u,scale:k,style:b,components:v,labelTransform:Mr(h.map(o))},w]}function SN(t,e,n,r){return Ne(this,void 0,void 0,(function*(){const{library:i}=r,{components:a,theme:o,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:v,height:m}=s,y=Ce(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),k=b.map((t=>Pr(Object.assign({},o.view,f),t))),w=["a","margin","padding","inset"].map((t=>Tr(y,t))),M=t=>t.style("x",(t=>_[t].x)).style("y",(t=>_[t].y)).style("width",(t=>_[t].width)).style("height",(t=>_[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(pm(n),k[t])}));let O=0,E=0,S=v,A=m;const _=x.map((t=>{const e=w[t],{left:n=0,top:r=0,bottom:i=0,right:a=0}=e;return O+=n,E+=r,S-=n+a,A-=r+i,{x:O,y:E,width:S,height:A}}));e.selectAll(YN(oA)).data(x.filter((t=>Ar(k[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",oA).style("zIndex",-2).call(M)),(t=>t.call(M)),(t=>t.remove()));const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:a}=i,{enter:o={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=o,{type:g,duration:v=300,delay:m=0}=c;for(const t of a){const{updateType:r=l,updateDuration:i=u,updateDelay:a=f,enterType:o=h,enterDuration:s=d,enterDelay:c=p,exitDuration:y=v,exitDelay:b=m,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+a),n=Math.min(n,a)),(void 0===x||x)&&(e=Math.max(e,y+b),n=Math.min(n,b)),(void 0===o||o)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of Zn(a,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(YN(iA)).data(a,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",iA).append((t=>NL(K({animate:P,scale:d},t),l,o,i,c)))),(t=>t.transition((function(t,e,n){const{preserve:r=!1}=t;if(r)return;const a=NL(K({animate:P,scale:d},t),l,o,i,c),{attributes:s}=a,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(Ar));const L=e.selectAll(YN(rA)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",rA).call(GN).call($N,Array.from(c.keys())).call(HN,h)),(t=>t.call($N,Array.from(c.keys())).call((t=>T?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{transform:a,width:o,height:s}=i.style,{paddingLeft:c,paddingTop:l,innerWidth:u,innerHeight:f,marginLeft:h,marginTop:d}=t,p=[{transform:a,width:o,height:s},{transform:`translate(${c+h}, ${l+d})`,width:u,height:f}];return i.animate(p,{delay:n,duration:r,fill:"both"})}))}(t,T):GN(t))).call(HN,h))).transitions();n.push(...L.flat());for(const[a,o]of c.entries()){const{data:s}=o,{key:c,class:l,type:u}=a,f=e.select(`#${c}`),h=CN(a,o,t,r),d=jN(a,o,t,i),p=IN(a,o,t,i),g=DN(a,o,t,i),v=TN(e,f,l,"element"),m=f.selectAll(YN(eA)).selectFacetAll(v).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",eA).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=_r((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){PN(i,e,n);const a=h(t,r),o=p(t,[i],[a]);return null!==o||(i.nodeName===a.nodeName&&"g"!==a.nodeName?Sr(i,a):(i.parentNode.replaceChild(a,i),a.className=eA,a.markType=u,a.__data__=i.__data__)),o})).attr("markType",u).attr("className",eA)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return g(t,[n])})).remove()),(t=>t.append(h).attr("className",eA).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new gm(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new gm([],n.__toData__,n.parentNode).append(h).attr("className",eA).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...m.flat())}!function(t,e,n,r,i){const[a]=MP("labelTransform",r),{markState:o,labelTransform:s}=t,c=e.select(YN(tA)).node(),l=new Map,u=new Map,f=Array.from(o.entries()).flatMap((([n,a])=>{const{labels:o=[],key:s}=n,c=function(t,e,n,r,i){const[a]=MP("shape",r),{data:o,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map((t=>t.points)),f=Ir(s,(t=>t.value)),{theme:h,coordinate:d}=n,p=Object.assign(Object.assign({},i),{document:OP(i),theme:h,coordinate:d});return t=>{const{index:e,points:n}=t,r=o[e],{formatter:i=t=>`${t}`,transform:s,style:c,render:d,selector:g,element:v}=t,m=Ce(t,["formatter","transform","style","render","selector","element"]),y=Ir(Object.assign(Object.assign({},m),c),(t=>_N(t,r,e,o,{channel:f,element:v}))),{shape:b=l,text:x}=y,k=Ce(y,["shape","text"]),w="string"==typeof i?AE(i):i,M=Object.assign(Object.assign({},k),{text:w(x,r,e,o),datum:r}),O=Object.assign({type:`label.${b}`,render:d},k);return a(O,p)(n,M,LN(h,"label",b,"label"),u)}}(n,a,t,r,i),f=e.select(`#${s}`).selectAll(YN(eA)).nodes().filter((t=>!t.__removed__));return o.flatMap(((t,e)=>{const n=Ce(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:a,key:o,index:s}=n.__data__,c=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:a}=r;return[i,a]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${o}-${e}`,bounds:c,index:s,points:a,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,o)=>Object.assign(Object.assign({},t),{key:`${i[o]}-${e}`,bounds:[a[o]],index:r,points:a,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,(t=>c(Object.assign(Object.assign({},t),{element:r})))),u.set(e,t)})),i}))}))})),h=pm(c).selectAll(YN(aA)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",aA)),(t=>t.each((function(t,e,n){Sr(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=Xn(h,(t=>u.get(t.__data__))),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of d){const{transform:n=[]}=t;Mr(n.map(a))(e,v)}s&&s(h,v)}(t,e,0,i,r)}))}function AN([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const a=t[n],o=e[n];o.every((([t,e])=>Ar(t)&&Ar(e)))&&(r.push(a),i.push(o))}return[r,i]}function _N(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:Nr(e)&&void 0!==e[t]?e[t]:t}function TN(t,e,n,r){return t.node().parentElement.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r)))}function PN(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[a,o]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${a-s}, ${o-c})`),e.append(t)}function CN(t,e,n,r){const{library:i}=r,[a]=MP("shape",i),{data:o,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=Ir(s,(t=>t.value)),h=l.map((t=>t.points)),{theme:d,coordinate:p}=n,{type:g,style:v={}}=t,m=Object.assign(Object.assign({},r),{document:OP(r),coordinate:p,theme:d});return e=>{const{shape:n=c}=v,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=Ce(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},p),{index:l}),b=s?s.map((t=>o[t])):o[l],x=s||l,k=Ir(v,(t=>_N(t,b,x,o,{channel:f})));return(u[r]?u[r](k,m):a(Object.assign(Object.assign({},k),{type:WN(t,r)}),m))(i,y,LN(d,g,r,c),h)}}function LN(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,a=t[e]||{},o=a[n]||a[r];return Object.assign({color:i},o)}function NN(t,e,n,r,i){var a,o;const[,s]=MP("shape",i),[c]=MP("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${W(t)}Animation`,{[d]:p}=(null===(a=u[l])||void 0===a?void 0:a.props)||s(WN(e,l)).props,{[t]:g={}}=f,v=(null===(o=e.animate)||void 0===o?void 0:o[t])||{},m={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:a,[`${t}Duration`]:o,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},v);if(!l.type)return null;const u=c(l,m)(n,r,K(g,{delay:a,duration:o,easing:s}));return Array.isArray(u)?u:[u]}}function jN(t,e,n,r){return NN("enter",t,e,n,r)}function RN(t){return t.finished.then((()=>{t.cancel()})),t}function IN(t,e,n,r){return NN("update",t,e,n,r)}function DN(t,e,n,r){return NN("exit",t,e,n,r)}function BN(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Ce(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function FN(t){const{interaction:e={}}=t;return Object.entries(K({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function zN(t,e){return Ne(this,void 0,void 0,(function*(){const{data:n}=t,r=Ce(t,["data"]);if(null==n)return t;const[,{data:i}]=yield sN(0,{data:n},e);return Object.assign({data:i},r)}))}function GN(t){t.style("transform",(t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function WN(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function $N(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(YN(JS)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",JS).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove()));t.select(YN(tA)).node()||t.append("g").attr("className",tA).style("zIndex",0)}function YN(...t){return t.map((t=>`.${t}`)).join("")}function HN(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:a,innerWidth:o,innerHeight:s}=t;return new Qg({style:{x:r+i,y:n+a,width:o,height:s}})}))}function VN(t){const{style:e,scale:n,type:r}=t,i={},a=et(e,"columnWidthRatio");return a&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-a})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}function qN(t){const e=function(t){return function(...t){return e=>t.reduce(((t,e)=>e(t)),e)}(VN)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map((t=>qN(t)))),e}function UN(t){const e=K({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),a=null===e?"0":`${e.key}-${i}`;t.key=a}const{children:e=[]}=t;if(Array.isArray(e))for(let a=0;a<e.length;a++){const o=K({},e[a]);e[a]=o,n.set(o,t),r.set(o,a),i.push(o)}}return e}function XN(t,e){const n=new x_;return n.registerPlugin(new w_),new gv({width:t,height:e,container:document.createElement("div"),renderer:n})}function ZN(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,depth:o=0}=t,s=UN(qN(t)),{canvas:c=XN(i,a),emitter:l=new O_,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:h}=c.getConfig();f===i&&h===a||c.resize(i,a),l.emit(E_.BEFORE_RENDER);const d=pm(c.document.documentElement);return c.ready.then((()=>bN(Object.assign(Object.assign({},s),{width:i,height:a,depth:o}),d,e))).then((()=>{if(o){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-o/2)}c.requestAnimationFrame((()=>{c.requestAnimationFrame((()=>{l.emit(E_.AFTER_RENDER),null==n||n()}))}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function KN(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${nA}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}const QN={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function JN(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:QN[e]}function tj(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>tj(t,e,n,r)))}function ej(t){tj(t,"visibility","hidden",!0)}function nj(t){tj(t,"visibility","visible",!0)}function rj(t){return pm(t).selectAll(`.${eA}`).nodes().filter((t=>!t.__removed__))}function ij(t,e){return aj(t,e).flatMap((({container:t})=>rj(t)))}function aj(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function oj(t){return pm(t).select(`.${rA}`).node()}function sj(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new qu;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function cj(t,e){const{offsetX:n,offsetY:r}=e,i=sj(t),{min:[a,o],max:[s,c]}=i;return n<a||n>s||(r<o||r>c)?null:[n-a,r-o]}function lj(t,e){const{offsetX:n,offsetY:r}=e,[i,a,o,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return[n,r,i,a]}(t);return[Math.min(o,Math.max(i,n))-i,Math.min(s,Math.max(a,r))-a]}function uj(t){return t=>t.__data__.color}function fj(t){return t=>t.__data__.x}function hj(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[pj(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(pj(i,r))[e]}}function dj(t,e=(t,e)=>t,n=(t,e,n)=>t.setAttribute(e,n)){const r="__states__",i="__ordinal__",a=a=>{const{[r]:o=[],[i]:s={}}=a,c=o.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(c).length){for(const[t,r]of Object.entries(c)){const i=JN(a,t),o=e(r,a);n(a,t,o),t in s||(s[t]=i)}a[i]=s}},o=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{o(t),t[r]=[...e],a(t)},removeState:(t,...e)=>{o(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}a(t)},hasState:(t,e)=>(o(t),-1!==t[r].indexOf(e))}}function pj(t,e){return`${t},${e}`}function gj(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[pj(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,a={}]=n,o=void 0===(s=a[e])||"object"==typeof s&&0===Object.keys(s).length?i:a[e];var s;for(const[e,n]of Object.entries(o)){const i=t[e],a=(t,e,a,o)=>{const s=pj(o.__data__.viewKey,o.__data__.markKey);return r!==s?null==i?void 0:i(t,e,a,o):"function"!=typeof n?n:n(t,e,a,o)};t[e]=a}return t}),{})}return r}function vj(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const a=n.get(i);return t(e?e(i):i,a,r,i)}}function mj(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=Ce(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const a=t=>t.__data__.points,o=(t,e)=>{const[,n,r]=t,[i,,,a]=e;return[n,i,a,r]};return[t=>{var e;if(t.length<=1)return;const r=tr(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;t<r.length;t++){const s=Qs(),c=r[t-1],l=r[t],[u,f,h,d]=o(a(c),a(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...h),s.lineTo(...d),s.closePath();const p=Ir(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,v=Ce(p,["fill"]),m=new qg({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(m),c.link=m}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function yj(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Wc(n)){const{points:i}=t.__data__,[a,o]=Gc(n)?km(i):i,s=n.getCenter(),c=vs(a,s),l=vs(o,s),u=bs(c)+ks(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Gc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function bj(t){var{document:e,background:n,scale:r,coordinate:i,valueof:a}=t,o=Ce(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,a=t.getStep(r)/2,o=a*n;return[i-a+o,i+a-o]},l=(t,n)=>{const{padding:a}=n,[o,s]=((t,e)=>{const{x:n}=r;if(!gS(n))return[0,1];const{__data__:i}=t,{x:a}=i,[o,s]=c(n,a,e);return[o,s]})(t,a),[l,u]=((t,e)=>{const{y:n}=r;if(!gS(n))return[0,1];const{__data__:i}=t,{y:a}=i,[o,s]=c(n,a,e);return[o,s]})(t,a),f=[[o,l],[s,l],[s,u],[o,u]].map((t=>i.map(t))),{__data__:h}=t,{y:d,y1:p}=h;return Sm(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,a=Ce(e,["transform","transformOrigin","stroke"]),o=Object.assign({transform:n,transformOrigin:r,stroke:i},a),s=t.cloneNode(!0);for(const[t,e]of Object.entries(o))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=Ir(o,(e=>a(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=Ce(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,lineWidth:h}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(gS)})()?l:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function xj(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function kj(t){xj(t,t.cursor)}function wj(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function Mj(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Oj(t,e=!1){const n=m(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function Ej(t){return t.querySelectorAll(".element")}function Sj(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function Aj(t,{elements:e,datum:n,groupKey:r=t=>t,link:i=!1,background:a=!1,delay:o=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Xn(h,r),g=vj(h,n),[v,m]=mj(Object.assign({elements:h,valueof:g,link:i,coordinate:c},Tr(u.active,"link"))),[y,b,x]=bj(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:a,valueof:g},Tr(u.active,"background"))),k=K(u,{active:Object.assign({},(null===(f=u.active)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.active.offset(...t),[,n]=t;return yj(h[n],e,c)}})}),{setState:w,removeState:M,hasState:O}=dj(k,g);let E;const S=t=>{const{target:e,nativeEvent:i=!0}=t;if(!d.has(e))return;E&&clearTimeout(E);const a=r(e),o=p.get(a),s=new Set(o);for(const t of h)s.has(t)?O(t,"active")||w(t,"active"):(w(t,"inactive"),m(t)),t!==e&&b(t);y(e),v(o),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:o.map(n)}})},A=(t=!0)=>{for(const t of h)M(t,"active","inactive"),b(t),m(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},_=t=>{const{target:e}=t;a&&!x(e)||(a||d.has(e))&&(o>0?(E&&clearTimeout(E),E=setTimeout((()=>{A(),E=null}),o)):A())},T=()=>{A()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",_),t.addEventListener("pointerleave",T);const P=t=>{const{nativeEvent:e}=t;e||A(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=wj(h,r,n);i&&S({target:i,nativeEvent:!1})};return l.on("element:highlight",C),l.on("element:unhighlight",P),()=>{t.removeEventListener("pointerover",S),t.removeEventListener("pointerout",_),t.removeEventListener("pointerleave",T),l.off("element:highlight",C),l.off("element:unhighlight",P);for(const t of h)b(t),m(t)}}function _j(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,a=Ce(t,["delay","createGroup","background","link"]);return(t,o,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:h}=l;return Aj(oj(c),Object.assign({elements:rj,datum:hj(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:gj(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},a))}}function Tj(t){return _j(Object.assign(Object.assign({},t),{createGroup:fj}))}function Pj(t){return _j(Object.assign(Object.assign({},t),{createGroup:uj}))}function Cj(t,{elements:e,datum:n,groupKey:r=t=>t,link:i=!1,single:a=!1,coordinate:o,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Xn(h,r),g=vj(h,n),[v,m]=mj(Object.assign({link:i,elements:h,valueof:g,coordinate:o},Tr(u.selected,"link"))),[y,b]=bj(Object.assign({document:t.ownerDocument,background:s,coordinate:o,scale:c,valueof:g},Tr(u.selected,"background"))),x=K(u,{selected:Object.assign({},(null===(f=u.selected)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.selected.offset(...t),[,n]=t;return yj(h[n],e,o)}})}),{setState:k,removeState:w,hasState:M}=dj(x,g),O=(t=!0)=>{for(const t of h)w(t,"selected","unselected"),m(t),b(t);t&&l.emit("element:unselect",{nativeEvent:!0})},E=t=>{const{target:e,nativeEvent:o=!0}=t;return d.has(e)?a?((t,e,i=!0)=>{if(M(e,"selected"))O();else{const a=r(e),o=p.get(a),s=new Set(o);for(const t of h)s.has(t)?k(t,"selected"):(k(t,"unselected"),m(t)),t!==e&&b(t);if(v(o),y(e),!i)return;l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...o.map(n)]}}))}})(t,e,o):((t,e,a=!0)=>{const o=r(e),s=p.get(o),c=new Set(s);if(M(e,"selected")){if(!h.some((t=>!c.has(t)&&M(t,"selected"))))return O();for(const t of s)k(t,"unselected"),m(t),b(t)}else{const t=s.some((t=>M(t,"selected")));for(const t of h)c.has(t)?k(t,"selected"):M(t,"selected")||k(t,"unselected");!t&&i&&v(s),y(e)}a&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:a,data:{data:h.filter((t=>M(t,"selected"))).map(n)}}))})(t,e,o):O()};t.addEventListener("click",E);const S=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=a?r.data.slice(0,1):r.data;for(const t of i){const e=wj(h,t,n);E({target:e,nativeEvent:!1})}},A=()=>{O(!1)};return l.on("element:select",S),l.on("element:unselect",A),()=>{for(const t of h)m(t);t.removeEventListener("click",E),l.off("element:select",S),l.off("element:unselect",A)}}function Lj(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=Ce(t,["createGroup","background","link"]);return(t,a,o)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return Cj(oj(s),Object.assign({elements:rj,datum:hj(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:gj(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:o},i))}}function Nj(t){return Lj(Object.assign(Object.assign({},t),{createGroup:fj}))}function jj(t){return Lj(Object.assign(Object.assign({},t),{createGroup:uj}))}function Rj(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,a=Ce(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:o,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=o,d=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:v=[]}=d,m=p.map(((t,e)=>e)),y=tr(m.map((t=>g[t]))),b=oj(s),x=s.getElementsByClassName(eA),k=Xn(s.getElementsByClassName(aA),(t=>t.__data__.key.split("-")[0])),w=new Hg({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},Tr(a,"rule"))}),M=new tv({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},Tr(a,"label"))});w.append(M),b.appendChild(w);const O=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return y[zn(y,i)]},E=(t,e)=>{w.setAttribute("x1",t[0]),w.setAttribute("x2",t[0]),M.setAttribute("text",i(e))};let S;const A=it((t=>{const e=cj(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,a=O(n,r,t);E(t,a);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,o=e[jn((t=>g[+t])).center(e,a)],s=[0,i.map(1)],c=[0,i.map(p[o]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const h=k.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{Ne(this,void 0,void 0,(function*(){const{x:e}=f,n=O(h,e,t);E(t,n),l("chartIndex",(t=>{const e=K({},t),r=e.marks.find((t=>"line"===t.type)),i=hr(Kn(m,(t=>hr(t,(t=>+p[t]))/pr(t,(t=>+p[t]))),(t=>v[t])).values());K(r,{scale:{y:{domain:[1/i,i]}}});const a=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);a.groupBy="color",a.basis=(t,e)=>e[t[jn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");S=r.view}))})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{w.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function Ij({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:a,setState:o,container:s}=r,c=oj(s),l=it((t=>{const e=cj(c,t);if(!e)return o("fisheye"),void a();o("fisheye",(t=>{const n=K({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,a=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return a.focusX=r,a.focusY=i,a.visual=!0,n})),a()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function Dj(t,e){if(e)return"string"==typeof e?document.querySelector(e):e;return t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function Bj(t,e,n,r,i,a,o,s={},c=[10,10]){const l=new aw({className:"tooltip",style:{x:e,y:n,container:o,data:[],bounding:a,position:r,enterable:i,title:"",offset:c,template:{prefixCls:"g2-"},style:K({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(l.HTMLTooltipElement),l}function Fj({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f,offset:h}){const d=Dj(t,u),p=Dj(t),g=o?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return{x:n,y:r,width:i-n,height:a-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,d),{tooltipElement:y=Bj(d,n,r,s,c,v,m,l,h)}=g,{items:b,title:x=""}=e;y.update(Object.assign({x:n,y:r,data:b,title:x,position:s,enterable:c,container:m},void 0!==i&&{content:i(a,{items:b,title:x})})),g.tooltipElement=y}function zj({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const a=Dj(t),o=e?a:t,{tooltipElement:s}=o;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),Uj(t),Xj(t),Zj(t)}function Gj({root:t,single:e}){const n=Dj(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),Uj(t),Xj(t),Zj(t)}function Wj(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function $j(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function Yj(t,e=t=>t){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function Hj(t,e,n,r=t.map((t=>t.__data__)),i={}){const a=t=>t instanceof Date?+t:t,o=Yj(r.map((t=>t.title)),a).filter(Ar),s=r.flatMap(((r,a)=>{const o=t[a],{items:s=[],title:c}=r,l=s.filter(Ar),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=$j(o)||i.color,name:a}=t,s=Ce(t,["color","name"]);const l=function(t,e){const{color:n,series:r,facet:i=!1}=t,{color:a,series:o}=e,s=t=>t&&t.invert&&!(t instanceof $a)&&!(t instanceof Ha);if(s(r))return r.clone().invert(o);if(o&&r instanceof $a&&r.invert(o)!==a&&!i)return r.invert(o);if(s(n)){const t=n.invert(a);return Array.isArray(t)?null:t}return null}(e,r),f=u?l||a:a||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(Wj);return Object.assign(Object.assign({},o.length>0&&{title:o.join(",")}),{items:Yj(s,(t=>`(${a(t.name)}, ${a(t.value)}, ${a(t.color)})`))})}function Vj(t,e,n,r){var{plotWidth:i,plotHeight:a,mainWidth:o,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:h,insetTop:d}=r,p=Ce(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map((e=>ys(e,t))),r=gr(n,(t=>t));return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+h+o/2,e=l+d+s/2;return[t,e,ys([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Ig({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,o]=u?[c+v[0],c+v[0],l,l+a]:[c,c+i,v[1]+l,v[1]+l],s=t.ruleX||((e,n,r,i)=>{const a=new Hg({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(a),a})(e,n,r,o);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=o,t.ruleX=s}}function qj(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=Ce(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),g=e.map((t=>t[1])),v=e.map((t=>t[0])),m=br(g),y=br(v),[b,x,k,w]=(()=>{if(u){const t=Math.min(a,o)/2,e=s+f+a/2,n=c+h+o/2,r=bs(vs([y,m],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,m+c,m+c]:[y+s,y+s,c,c+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new Hg({style:Object.assign({x1:b,x2:x,y1:k,y2:w},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=k,e.style.y2=w,t.ruleY=e}}function Uj(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function Xj(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function Zj(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function Kj(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function Qj(t,e){return void 0===t?e:t}function Jj(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function tR(t,e){var{elements:n,sort:r,filter:i,scale:a,coordinate:o,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:h,wait:d=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:m=0,body:y=!0,single:b=!0,position:x,enterable:k,mount:w,bounding:M,theme:O,offset:E,disableNative:S=!1,marker:A=!0,preserve:_=!1,style:T={},css:P={}}=e,C=Ce(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const L=n(t),N=Gc(o),j=Wc(o),R=K(T,C),{innerWidth:I,innerHeight:D,width:B,height:F,insetLeft:z,insetTop:W}=o.getOptions(),$=[],Y=[];for(const t of L){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?$.push(t):(r||i)&&Y.push(t)}const H=Y.length&&Y.every((t=>"interval"===t.markType))&&!Wc(o),V=t=>t.__data__.x,q=!!a.x.getBandWidth&&Y.length>0;$.sort(((t,e)=>{const n=N?0:1,r=t=>t.getBounds().min[n];return N?r(e)-r(t):r(t)-r(e)}));const U=t=>{const e=N?1:0,{min:n,max:r}=t.getLocalBounds();return tr([n[e],r[e]])};H?L.sort(((t,e)=>V(t)-V(e))):Y.sort(((t,e)=>{const[n,r]=U(t),[i,a]=U(e),o=(n+r)/2,s=(i+a)/2;return N?s-o:o-s}));const X=new Map($.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[tr(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:Z}=a,Q=(null==Z?void 0:Z.getBandWidth)?Z.getBandWidth()/2:0,J=t=>{const[e]=o.invert(t);return e-Q},tt=(t,e,n,r)=>{const{_x:i}=t,a=void 0!==i?Z.map(i):J(e),o=r.filter(Ar),[s,c]=tr([o[0],o[o.length-1]]);if(!q&&(a<s||a>c)&&!(s===c))return null;const l=jn((t=>r[+t])).center;return n[l(n,a)]},et=H?(t,e)=>{const n=e[(0,jn(V).center)(e,J(t))];return Xn(e,V).get(V(n))}:(t,e)=>{const n=t[N?1:0],r=e.filter((t=>{const[e,r]=U(t);return n>=e&&n<=r}));if(!q||r.length>0)return r;const i=jn((t=>{const[e,n]=U(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(Ar)},nt=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[G(t.replace("series","")),r]})))},rt=it((e=>{var n;const d=cj(t,e);if(!d)return;const p=sj(t),g=p.min[0],S=p.min[1],_=[d[0]-v,d[1]-m];if(!_)return;const T=et(_,Y),C=[],L=[];for(const t of $){const[n,r]=X.get(t),i=tt(e,_,n,r);if(null!==i){C.push(t);const e=nt(t,i),{x:n,y:r}=e,a=o.map([(n||0)+Q,r||0]);L.push([Object.assign(Object.assign({},e),{element:t}),a])}}const G=Array.from(new Set(L.map((t=>t[0].x)))),H=G[gr(G,(t=>Math.abs(t-J(_))))],V=L.filter((t=>t[0].x===H)),q=[...V.map((t=>t[0])),...T.map((t=>t.__data__))],U=[...C,...T],Z=Hj(U,a,f,q,O);if(r&&Z.items.sort(((t,e)=>r(t)-r(e))),i&&(Z.items=Z.items.filter(i)),0===U.length||Jj(Z))return void at(e);if(y&&Fj({root:t,data:Z,x:d[0]+g,y:d[1]+S,render:u,event:e,single:b,position:x,enterable:k,mount:w,bounding:M,css:P,offset:E}),s||c||l){const e=Tr(R,"crosshairs"),n=Object.assign(Object.assign({},e),Tr(R,"crosshairsX")),r=Object.assign(Object.assign({},e),Tr(R,"crosshairsY")),i=V.map((t=>t[1]));c&&Vj(t,i,d,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:W,startX:v,startY:m,transposed:N,polar:j})),l&&qj(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:W,startX:v,startY:m,transposed:N,polar:j}))}if(A){const e=Tr(R,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const{type:i=""}=n,a=e.filter((t=>{const[{x:e,y:n}]=t;return Ar(e)&&Ar(n)})).map((t=>{const[{color:e,element:a},o]=t,s=e||a.style.fill||a.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new Ig({className:"g2-tooltip-marker",style:Object.assign({cx:o[0],cy:o[1],fill:c,r:4,stroke:l,lineWidth:2},n)})}));for(const e of a)t.appendChild(e);t.markers=a}(t,{data:V,style:e,theme:O})}const K=null===(n=V[0])||void 0===n?void 0:n[0].x,rt=null!=K?K:J(_);h.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},Z),{data:{x:vS(a.x,rt,!0)}})}))}),d,{leading:p,trailing:g}),at=e=>{zj({root:t,single:b,emitter:h,event:e})},ot=()=>{Gj({root:t,single:b})},st=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=Ce(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=a.x.map(u),[h,d]=o.map([f,.5]),p=t.getRenderBounds(),g=p.min[0],v=p.min[1];rt(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:g+h,offsetY:void 0!==c?c:v+d,_x:u}))},ct=()=>{zj({root:t,single:b,emitter:h,nativeEvent:!1})},lt=()=>{ht(),ot()},ut=()=>{ft()},ft=()=>{S||(t.addEventListener("pointerenter",rt),t.addEventListener("pointermove",rt),t.addEventListener("pointerleave",(e=>{cj(t,e)||at(e)})))},ht=()=>{S||(t.removeEventListener("pointerenter",rt),t.removeEventListener("pointermove",rt),t.removeEventListener("pointerleave",at))};return ft(),h.on("tooltip:show",st),h.on("tooltip:hide",ct),h.on("tooltip:disable",lt),h.on("tooltip:enable",ut),()=>{ht(),h.off("tooltip:show",st),h.off("tooltip:hide",ct),h.off("tooltip:disable",lt),h.off("tooltip:enable",ut),_?zj({root:t,single:b,emitter:h,nativeEvent:!1}):ot()}}function eR(t,{elements:e,coordinate:n,scale:r,render:i,groupName:a,sort:o,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:v,view:m,mount:y,bounding:b,theme:x,offset:k,shared:w=!1,body:M=!0,disableNative:O=!1,preserve:E=!1,css:S={}}){var A,_;const T=e(t),P=Xn(T,h),C=T.every((t=>"interval"===t.markType))&&!Wc(n),L=r.x,N=r.series,j=null!==(_=null===(A=null==L?void 0:L.getBandWidth)||void 0===A?void 0:A.call(L))&&void 0!==_?_:0,R=N?t=>{const e=Math.round(1/N.valueBandWidth);return t.__data__.x+t.__data__.series*j+j/(2*e)}:t=>t.__data__.x+j/2;C&&T.sort(((t,e)=>R(t)-R(e)));const I=t=>{const{target:e}=t;return Sj(e,(t=>!!t.classList&&t.classList.includes("element")))},D=C?e=>{const r=cj(t,e);if(!r)return;const[i]=n.invert(r),a=(0,jn(R).center)(T,i),o=T[a];if(!w){const t=T.find((t=>t!==o&&R(t)===R(o)));if(t)return I(e)}return o}:I,B=it((e=>{const n=D(e);if(!n)return void zj({root:t,single:d,emitter:c,event:e});const l=h(n),u=P.get(l);if(!u)return;const f=1!==u.length||w?Hj(u,r,a,void 0,x):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(Ar).map((e=>{var{color:n=$j(t)}=e,r=Ce(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(Wj);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(u[0]);if(o&&f.items.sort(((t,e)=>o(t)-o(e))),s&&(f.items=f.items.filter(s)),Jj(f))return void zj({root:t,single:d,emitter:c,event:e});const{offsetX:v,offsetY:O}=e;M&&Fj({root:t,data:f,x:v,y:O,render:i,event:e,single:d,position:p,enterable:g,mount:y,bounding:b,css:S,offset:k}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},f),{data:xP(n,m)})}))}),l,{leading:u,trailing:f}),F=e=>{zj({root:t,single:d,emitter:c,event:e})},z=()=>{O||(t.addEventListener("pointermove",B),t.addEventListener("pointerleave",F))},G=()=>{O||(t.removeEventListener("pointermove",B),t.removeEventListener("pointerleave",F))},W=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:a}=i,o=wj(T,a,v);if(!o)return;const s=o.getBBox(),{x:c,y:l,width:u,height:f}=s,h=t.getBBox();B({target:o,offsetX:void 0!==n?n+h.x:c+u/2,offsetY:void 0!==r?r+h.y:l+f/2})},$=({nativeEvent:e}={})=>{e||zj({root:t,single:d,emitter:c,nativeEvent:!1})};return c.on("tooltip:show",W),c.on("tooltip:hide",$),c.on("tooltip:enable",(()=>{z()})),c.on("tooltip:disable",(()=>{G(),Gj({root:t,single:d})})),z(),()=>{G(),c.off("tooltip:show",W),c.off("tooltip:hide",$),E?zj({root:t,single:d,emitter:c,nativeEvent:!1}):Gj({root:t,single:d})}}function nR(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:a,name:o,item:s=()=>({}),facet:c=!1}=t,l=Ce(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,o,u)=>{const{container:f,view:h}=t,{scale:d,markState:p,coordinate:g,theme:v}=h,m=Kj(p,"seriesTooltip"),y=Kj(p,"crosshairs"),b=oj(f),x=Qj(a,m),k=Qj(n,y);if(x&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(p)&&!c)return tR(b,Object.assign(Object.assign({},l),{theme:v,elements:rj,scale:d,coordinate:g,crosshairs:k,crosshairsX:Qj(Qj(r,n),!1),crosshairsY:Qj(i,k),item:s,emitter:u}));if(x&&c){const e=o.filter((e=>e!==t&&e.options.parentKey===t.options.key)),a=ij(t,o),c=e[0].view.scale,f=b.getBounds(),h=f.min[0],d=f.min[1];return Object.assign(c,{facet:!0}),tR(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:v,elements:()=>a,scale:c,coordinate:g,crosshairs:Qj(n,y),crosshairsX:Qj(Qj(r,n),!1),crosshairsY:Qj(i,k),item:s,startX:h,startY:d,emitter:u}))}return eR(b,Object.assign(Object.assign({},l),{datum:hj(h),elements:rj,scale:d,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:h,theme:v,shared:e}))}}_j.props={reapplyWhenUpdate:!0},Tj.props={reapplyWhenUpdate:!0},Pj.props={reapplyWhenUpdate:!0},Lj.props={reapplyWhenUpdate:!0},Nj.props={reapplyWhenUpdate:!0},jj.props={reapplyWhenUpdate:!0},Rj.props={reapplyWhenUpdate:!0},nR.props={reapplyWhenUpdate:!0};const rR="legend-category";function iR(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function aR(t){return t.getElementsByClassName("legend-category-item-label")[0]}function oR(t){return t.getElementsByClassName("items-item")}function sR(t){return t.getElementsByClassName(rR)}function cR(t){return t.getElementsByClassName("legend-continuous")}function lR(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function uR(t,{legend:e,channel:n,value:r,ordinal:i,channels:a,allChannels:o,facet:s=!1}){return Ne(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[],data:l=[]}=t,u=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),f=[...e];l.length&&f.splice(u+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const h=Object.fromEntries(a.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return K({},t,Object.assign(Object.assign({transform:f,scale:h},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(o.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function fR(t,e){for(const n of t)uR(n,Object.assign(Object.assign({},e),{facet:!0}))}function hR(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),a=i.length>0,o=t=>lR(t).scales.map((t=>t.name)),s=[...sR(r),...cR(r)],c=s.flatMap(o),l=it(a?fR:uR,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=lR(e).scales[0],f={legend:e,channel:s,channels:o(e),allChannels:c};return e.className===rR?function(t,{legends:e,marker:n,label:r,datum:i,filter:a,emitter:o,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,{unselected:h={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,d={unselected:Tr(h,"marker")},p={unselected:Tr(h,"label")},{setState:g,removeState:v}=dj(d,void 0),{setState:m,removeState:y}=dj(p,void 0),b=Array.from(e(t));let x=b.map(i);const k=()=>{for(const t of b){const e=i(t),a=n(t),o=r(t);x.includes(e)?(v(a,"unselected"),y(o,"unselected")):(g(a,"unselected"),m(o,"unselected"))}};for(const e of b){const n=()=>{xj(t,"pointer")},r=()=>{kj(t)},c=t=>Ne(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),yield a(x),k();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?o.emit("legend:reset",{nativeEvent:c}):o.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const w=t=>Ne(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield a(x),k())})),M=t=>Ne(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield a(x),k())}));return o.on("legend:filter",w),o.on("legend:reset",M),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),o.off("legend:filter",w),o.off("legend:reset",M)}}(r,{legends:oR,marker:iR,label:aR,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(a?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const a=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",a),()=>{e.removeEventListener("valuechange",a)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(a?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function dR(){return(t,e,n)=>{const{container:r,view:i,options:a}=t,o=sR(r),s=rj(r),c=t=>lR(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=gj(a,["active","inactive"]),f=vj(s,hj(i)),h=[];for(const t of o){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=oR(t),a=l(r),o=Xn(s,(t=>a.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:v}=dj(u,f),m={inactive:Tr(p,"marker")},y={inactive:Tr(p,"label")},{setState:b,removeState:x}=dj(m),{setState:k,removeState:w}=dj(y),M=t=>{for(const e of i){const n=iR(e),r=aR(e);e===t||null===t?(x(n,"inactive"),w(r,"inactive")):(b(n,"inactive"),k(r,"inactive"))}},O=(t,i)=>{const a=e(i),c=new Set(o.get(a));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");M(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:a}}))},E=new Map;for(const t of i){const e=e=>{O(e,t)};t.addEventListener("pointerover",e),E.set(t,e)}const S=t=>{for(const t of s)v(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:a}=t;if(n)return;const{channel:o,value:s}=a;if(o!==r)return;const c=i.find((t=>e(t)===s));c&&O({nativeEvent:!1},c)},_=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",_);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",_);for(const[t,e]of E)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function pR(t,e){const[n,r,i,a]=t,[o,s,c,l]=e;return!(o>i||c<n||s>a||l<r)}function gR(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function vR(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const mR=jm((t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,renders:s={},handleSize:c=10,document:l}=e,u=Ce(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===a||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=Tr(Cr(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=Ce(d,["render"]),v=Tr(u,"handleE"),{render:m=h}=v,y=Ce(v,["render"]),b=Tr(Cr(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,k=Ce(b,["render"]),w=Tr(u,"handleW"),{render:M=h}=w,O=Ce(w,["render"]),E=Tr(u,"handleNW"),{render:S=h}=E,A=Ce(E,["render"]),_=Tr(u,"handleNE"),{render:T=h}=_,P=Ce(_,["render"]),C=Tr(u,"handleSE"),{render:L=h}=C,N=Ce(C,["render"]),j=Tr(u,"handleSW"),{render:R=h}=j,I=Ce(j,["render"]),D=t=>()=>{const e=jm((e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,l);r.id=n,r.style.draggable=!0})(e,t)));return new e({})},B=pm(t).attr("className",o).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(vR,Object.assign(Object.assign({width:i,height:a},Cr(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(vR,g),B.maybeAppend("handle-e",D(m)).style("x",i-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(vR,y),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",a-f).style("width",i-c).style("height",c).style("fill","transparent").call(vR,k),B.maybeAppend("handle-w",D(M)).style("x",-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(vR,O),B.maybeAppend("handle-nw",D(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(vR,A),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(vR,P),B.maybeAppend("handle-se",D(L)).style("x",i-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(vR,N),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(vR,I)}));function yR(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:a=()=>{},brushupdated:o=()=>{},extent:s=gR(t),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=Ce(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,m=null,y=null,b=null,x=!1;const[k,w,M,O]=s;xj(t,"crosshair"),t.style.draggable=!0;const E=(t,e,n)=>{if(a(n),y&&y.remove(),b&&b.remove(),g=[t,e],l)return S();A()},S=()=>{b=new qg({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),y=new mR({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(y)},A=()=>{y=new mR({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(y)},_=(t=!0)=>{y&&y.remove(),b&&b.remove(),g=null,v=null,m=null,x=!1,y=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,a,o,u]=function(t,e,n,r,i){const[a,o,s,c]=i;return[Math.max(a,Math.min(t,n)),Math.max(o,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,a,o,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${k},${w}L${M},${w}L${M},${O}L${k},${O}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},L={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},N=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(L)).has(e)},R=t=>t===y.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=lj(t,e);if(!y||!N(n))return E(r,i,e),void(x=!0);N(n)&&(m=[r,i])},D=e=>{const{target:n}=e,r=lj(t,e);if(!g)return;if(!m)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-m[0],r=t[1]-m[1],i=e(n,g[0],v[0],k,M),a=e(r,g[1],v[1],w,O),o=[g[0]+i,g[1]+a],s=[v[0]+i,v[1]+a];T(o,s)})(r);const[i,a]=[r[0]-m[0],r[1]-m[1]],{id:o}=n;if(L[o]){const[t,e,n,r]=L[o].vector;return T([g[0]+i*t,g[1]+a*e],[v[0]+i*n,v[1]+a*r])}},B=e=>{if(m){m=null;const{x:t,y:n,width:r,height:i}=y.style;return g=[t,n],v=[t+r,n+i],void o(t,n,t+r,n+i,e)}v=lj(t,e);const[n,r,a,s]=T(g,v);x=!1,i(n,r,a,s,e)},F=t=>{const{target:e}=t;y&&!N(e)&&_()},z=e=>{const{target:n}=e;y&&N(n)&&!x?R(n)?xj(t,"move"):j(n)&&xj(t,L[n.id].cursor):xj(t,"crosshair")},G=()=>{xj(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",G),{mask:y,move(t,e,n,r,i=!0){y||E(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){y&&_(t)},destroy(){y&&_(!1),xj(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",G)}}}function bR(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function xR(t,e,n){return bR(t,e,n).map((t=>t.options))}function kR(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:h=t=>t,bboxOf:d=t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}},state:p={},emitter:g}=e,v=Ce(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),b=y.flatMap(n),x=vj(m,a),k=Tr(v,"mask"),{setState:w,removeState:M}=dj(p,x),O=new Map,{width:E,height:S,x:A=0,y:_=0}=d(t),T=s||[0,0,E,S],P=()=>{for(const t of[...m,...b])M(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of y)null===(i=t.brush)||void 0===i||i.remove();const a=new Set;for(const i of m){const{min:o,max:s}=i.getLocalBounds(),[c,l]=o,[u,f]=s;pR([c,l,u,f],[t,e,n,r])?(w(i,"active"),a.add(h(i))):w(i,"inactive")}for(const t of b)a.has(h(t))?w(t,"active"):w(t,"inactive")},L=()=>{for(const t of m)M(t,"inactive");for(const t of O.values())t.remove();O.clear()},N=(e,n,r,i)=>{const a=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),O.set(t,e),e},o=new Qg({style:{x:e+A,y:n+_,width:r-e,height:i-n}});t.appendChild(o);for(const t of m){const e=O.get(t)||a(t);e.style.clipPath=o,w(t,"inactive"),w(e,"active")}},j=yR(t,Object.assign(Object.assign({},k),{extent:T,brushRegion:o,reverse:c,selectedHandles:r,brushended:t=>{const e=f?L:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const a=yS(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}});(f?N:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const a=yS(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushupdated:(t,e,n,r,i)=>{const a=yS(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,a,o]=function(t,e,n){const{x:r,y:i}=e,[a,o]=t,s=bS(a,r),c=bS(o,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);j.move(r,i,a,o,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function wR(t){var{facet:e,brushKey:n}=t,r=Ce(t,["facet","brushKey"]);return(t,i,a)=>{const{container:o,view:s,options:c}=t,l=oj(o),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],o=e.min[1],s=e.max[0],c=e.max[1];return kR(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>ij(t,i),datum:hj(aj(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,o,s,c],state:gj(aj(t,i).map((t=>t.options)),f),emitter:a,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=kR(l,Object.assign(Object.assign({elements:rj,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return bR(t,e,n).map((t=>oj(t.container)))}(t,i,n),datum:hj([s,...bR(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:gj([c,...xR(t,i,n)],f),emitter:a,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function MR(t,e,n,r,i){const[,a,,o]=i;return[t,a,n,o]}function OR(t){return wR(Object.assign(Object.assign({},t),{brushRegion:MR,selectedHandles:["handle-e","handle-w"]}))}function ER(t,e,n,r,i){const[a,,o]=i;return[a,e,o,r]}function SR(t){return wR(Object.assign(Object.assign({},t),{brushRegion:ER,selectedHandles:["handle-n","handle-s"]}))}const AR="axis-hot-area";function _R(t){return t.getElementsByClassName("axis")}function TR(t){return t.getElementsByClassName("axis-line")[0]}function PR(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function CR(t,e){var{cross:n,offsetX:r,offsetY:i}=e,a=Ce(e,["cross","offsetX","offsetY"]);const o=PR(t),s=TR(t),[c]=s.getLocalBounds().min,[l,u]=o.min,[f,h]=o.max,d=2*(f-l);return{brushRegion:ER,hotZone:new Qg({className:AR,style:Object.assign({width:n?d/2:d,transform:`translate(${(n?l:c-d/2).toFixed(2)}, ${u})`,height:h-u},a)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function LR(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,a=Ce(e,["offsetY","offsetX","cross"]);const o=PR(t),s=TR(t),[,c]=s.getLocalBounds().min,[l,u]=o.min,[f,h]=o.max,d=h-u;return{brushRegion:MR,hotZone:new Qg({className:AR,style:Object.assign({width:f-l,height:i?d:2*d,transform:`translate(${l}, ${i?u:c-d})`},a)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(h-n)]}}function NR(t){return(e,n,r)=>{const{container:i,view:a,options:o}=e,s=oj(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=a;return function(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:o,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:h}=e,d=Ce(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=vj(p,o),{setState:m,removeState:y}=dj(u,v),b=new Map,x=Tr(d,"mask"),k=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,a])=>t>=e&&t<=r&&a>=n&&a<=i)))),w=g.map((t=>t.attributes.scale)),M=t=>t.length>2?[t[0],t[t.length-1]]:t,O=new Map,E=()=>{O.clear();for(let t=0;t<g.length;t++){const e=w[t],{domain:n}=e.getOptions();O.set(t,M(n))}};E();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);k(e)?(m(t,"active"),n.push(t)):m(t,"inactive")}O.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(O.values());const t=[];for(const[e,n]of O){const r=w[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)y(t,"active","inactive");E(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=w[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return M(mS(n,i))},T=g.some(a)&&g.some((t=>!a(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=a(e)?LR:CR,{hotZone:r,brushRegion:i,extent:o}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=yR(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,a,s){b.set(e,o(n,r,i,a)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},L=(t,e,n)=>{const[r,i]=t,o=N(r,e,n),s=N(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return a(n)?[o,-1/0,s,1/0]:[-1/0,o,1/0,s]},N=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),o=e.clone();return a(n)?o.update({range:[0,i]}):o.update({range:[r,0]}),o.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=w[t];r.move(...L(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:rj,axes:_R,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:hj(a),state:gj(o,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function jR(t){var{hideX:e=!0,hideY:n=!0}=t,r=Ce(t,["hideX","hideY"]);return(t,i,a)=>{const{container:o,view:s,options:c,update:l,setState:u}=t,f=oj(o);let h=!1,d=!1,p=s;const{scale:g,coordinate:v}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:a,reverse:o,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=Tr(Ce(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=a||[0,0,d,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),m=yR(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:o,brushcreated:function(t,e,r,i,a){a.nativeEvent=!0,n(u(t,e,r,i),a),m.remove()}}));function y(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",y);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{m.destroy(),s.off("brush:filter",b),t.removeEventListener("click",y)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:a}=p;return yS(t,e,n,r,i,a)},filter:(t,r)=>Ne(this,void 0,void 0,(function*(){if(d)return;d=!0;const[i,o]=t;u("brushFilter",(t=>{const{marks:r}=t,a=r.map((t=>K({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:o,nice:!1}}})));return Object.assign(Object.assign({},c),{marks:a,clip:!0})})),a.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,o]}}));const s=yield l();p=s.view,d=!1,h=!0})),reset:t=>{if(d||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,o=r.getOptions().domain;a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,o]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:a,scale:g,coordinate:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function RR(t){return jR(Object.assign(Object.assign({hideX:!0},t),{brushRegion:MR}))}function IR(t){return jR(Object.assign(Object.assign({hideY:!0},t),{brushRegion:ER}))}function DR(t,e,n,r=!1,i="x",a="y"){const{marks:o}=t,s=o.map((t=>{var o,s;return K({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(o=t[n])||void 0===o?void 0:o[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(s=t[n])||void 0===s?void 0:s[a])&&{[a]:{preserve:!0}}),animate:!1})}));return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function BR(t,e,n){const[r,i]=t,a=n?t=>1-t:t=>t;return mS(e,[vS(e,a(r),!0),vS(e,a(i),!1)])}function FR(t){return[t[0],t[t.length-1]]}function zR({initDomain:t={},className:e="slider",prefix:n="slider",setValue:r=(t,e)=>t.setValues(e),hasState:i=!1,wait:a=50,leading:o=!0,trailing:s=!1,getInitValues:c=t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n}}){return(l,u,f)=>{const{container:h,view:d,update:p,setState:g}=l,v=h.getElementsByClassName(e);if(!v.length)return()=>{};let m=!1;const{scale:y,coordinate:b,layout:x}=d,{paddingLeft:k,paddingTop:w,paddingBottom:M,paddingRight:O}=x,{x:E,y:S}=y,A=Gc(b),_=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return A?[n,e]:[e,n]},T=new Map,P=new Set,C={x:t.x||E.getOptions().domain,y:t.y||S.getOptions().domain};for(const t of v){const{orientation:e}=t.attributes,[l,u]=_(e),h=`${n}${W(l)}:filter`,d="x"===l,{ratio:v}=E.getOptions(),{ratio:b}=S.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=FR(C.x),r=FR(C.y)]=e;return d?[mS(E,n,v),mS(S,r,b)]:[mS(S,r,b),mS(E,n,v)]}const{value:n}=t.detail;return[BR(n,y[l],A&&"horizontal"===e),C[u]]},L=it((e=>Ne(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(m&&!r)return;m=!0;const{nativeEvent:a=!0}=e,[o,s]=x(e);if(C[l]=o,C[u]=s,a){const t=d?o:s,n=d?s:o;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:a,data:{selection:[FR(t),FR(n)]}}))}g(t,(t=>Object.assign(Object.assign({},DR(t,{[l]:{domain:o,nice:!1}},n,i,l,u)),{paddingLeft:k,paddingTop:w,paddingBottom:M,paddingRight:O}))),yield p(),m=!1}))),a,{leading:o,trailing:s}),N=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:a}=i,[o,s]=a;t.dispatchEvent(new Rp("valuechange",{data:i,nativeEvent:!1}));const c=d?bS(o,E):bS(s,S);r(t,c)};f.on(h,N),t.addEventListener("valuechange",L),T.set(t,L),P.add([h,N]);const j=c(t);j&&t.dispatchEvent(new Rp("valuechange",{detail:{value:j},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of P)f.off(t,e)}}}const GR="g2-scrollbar";function WR(t={}){return(e,n,r)=>{const{view:i,container:a}=e;if(!a.getElementsByClassName(GR).length)return()=>{};const{scale:o}=i,{x:s,y:c}=o,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return zR(Object.assign(Object.assign({},t),{initDomain:l,className:GR,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0])return e}}))(e,n,r)}}function $R(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>{return`${n=t,n.replace(/([A-Z])/g,"-$1").toLowerCase()}:${e}`;var n})).join(";")}">${e}</${t}>`}const YR={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function HR(t){return"text"===t.nodeName&&!!t.isOverflowing()}function VR(t){var{offsetX:e=8,offsetY:n=8}=t,r=Ce(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[a,o]=i.getBounds().min,s=Tr(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!HR(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-a,h=u+n-o;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new Wg({className:"poptip",style:{innerHTML:$R("div",d,Object.assign(Object.assign({},YR),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;HR(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}VR.props={reapplyWhenUpdate:!0};const qR={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function UR(t={}){const{originData:e=[],layout:n}=t,r=Ce(t,["originData","layout"]),i=K({},qR,r),a=Tr(i,"breadCrumb"),o=Tr(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return pm(t).select(`.${rA}`).node()}(s),u=c.marks[0],{state:f}=u,h=new zg;l.appendChild(h);const d=(t,c)=>Ne(this,void 0,void 0,(function*(){if(h.removeChildren(),c){let e="",n=a.y,r=0;const i=[],s=l.getBBox().width,c=t.map(((o,c)=>{e=`${e}${o}/`,i.push(o);const l=new tv({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:o,x:r,path:[...i],depth:c},a),{y:n})});h.appendChild(l),r+=l.getBBox().width;const u=new tv({style:Object.assign(Object.assign({x:r,text:" / "},a),{y:n})});return h.appendChild(u),r+=u.getBBox().width,r>s&&(n=h.getBBox().height+a.y,r=0,l.attr({x:r,y:n}),r+=l.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),c===st(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===st(c)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",(()=>{t.attr(o)})),t.addEventListener("mouseleave",(()=>{t.attr(n)})),t.addEventListener("click",(()=>{d(et(t,["style","path"]),et(t,["style","depth"]))}))}))}!function(t,e){[...sR(t),...cR(t)].forEach((t=>{e(t,(t=>t))}))}(s,i),i("treemapDrillDown",(r=>{const{marks:i}=r,a=t.join("/"),o=i.map((t=>{if("rect"!==t.type)return t;let r=e;if(c){const t=e.filter((t=>{const e=et(t,["id"]);return e&&(e.match(`${a}/`)||a.match(e))})).map((t=>({value:0===t.height?et(t,["value"]):void 0,name:et(t,["id"])}))),{paddingLeft:i,paddingBottom:o,paddingRight:s}=n,l=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||h.getBBox().height+10)/(c+1),paddingLeft:i/(c+1),paddingBottom:o/(c+1),paddingRight:s/(c+1),path:t=>t.name,layer:t=>t.depth===c+1});r=zO(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(N(t))})),K({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:o})})),yield r(void 0,["legendFilter"])})),p=t=>{const n=t.target;if("rect"!==et(n,["markType"]))return;const r=et(n,["__data__","key"]),i=_(e,(t=>t.id===r));et(i,"height")&&d(et(i,"path"),et(i,"depth"))};l.addEventListener("click",p);const g=M(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{Ej(l).forEach((t=>{const n=et(t,["style","cursor"]),r=_(e,(e=>e.id===et(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=function(t,e){if(null===t||!A(t))return{};var n={};return w(e,(function(e){nt.call(t,e)&&(n[e]=t[e])})),n}(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(K(e,f.inactive))}))}}))};return v(),l.addEventListener("mousemove",v),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",v)}}}const XR={pointR:6,pointStrokeWidth:1,pointStroke:"#888",pointActiveStroke:"#f5f5f5",pathStroke:"#888",pathLineDash:[3,4],labelFontSize:12,labelFill:"#888",labelStroke:"#fff",labelLineWidth:1,labelY:-6,labelX:2},ZR="movePoint",KR=t=>{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},QR=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},JR=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},tI=(t,e,n,r)=>{const i=new qg({style:n}),a=new tv({style:r});return e.appendChild(a),t.appendChild(i),[i,a]},eI=(t,e)=>{if(!et(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},nI=(t,e,n)=>{const r=Mj(t,e),i=Mj(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function rI(t={}){const{selection:e=[],precision:n=2}=t,r=Ce(t,["selection","precision"]),i=Object.assign(Object.assign({},XR),r||{}),a=Tr(i,"path"),o=Tr(i,"label"),s=Tr(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=oj(u);let g,v=Ej(p),m=e;const{transform:y=[],type:b}=d,x=!!_(y,(({type:t})=>"transpose"===t)),k="polar"===b,w="theta"===b,M=!!_(v,(({markType:t})=>"area"===t));M&&(v=v.filter((({markType:t})=>"area"===t)));const O=new zg({style:{zIndex:2}});p.appendChild(O);const E=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:m}})},S=t=>{const e=t.target;m=[e.parentNode.childNodes.indexOf(e)],E(),T(e)},A=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;m=e;const r=et(v,[null==m?void 0:m[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:v,seriesTitle:y,color:b,title:S,seriesX:A,y1:P}=d;if(x&&"interval"!==r)return;const{scale:C,coordinate:L}=(null==g?void 0:g.view)||f,{color:N,y:j,x:R}=C,I=L.getCenter();let D;O.removeChildren();const B=(t,e,n,r)=>Ne(this,void 0,void 0,(function*(){return l("elementPointMove",(a=>{var o;const s=((null===(o=null==g?void 0:g.options)||void 0===o?void 0:o.marks)||h).map((a=>{if(!r.includes(a.type))return a;const{data:o,encode:s}=a,c=Object.keys(s).reduce(((r,i)=>{const a=s[i];return"x"===i&&(r[a]=t),"y"===i&&(r[a]=e),"color"===i&&(r[a]=n),r}),{}),l=((t,e,n)=>e.map((e=>{const r=["x","color"].reduce(((r,i)=>{const a=n[i];return a?e[a]===t[a]&&r:r}),!0);return r?Object.assign(Object.assign({},e),t):e})))(c,o,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),K({},a,{data:l,animate:!1})}));return Object.assign(Object.assign({},a),{marks:s})})),yield c("elementPointMove")}));if(["line","area"].includes(r))v.forEach(((e,r)=>{const i=R.invert(A[r]);if(!i)return;const c=new Ig({name:ZR,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=et(t,["__data__","seriesItems",e,"0","value"]),r=et(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:a,transform:o}}=t.parentNode,s=_(o,(({type:t})=>"normalizeY"===t)),c=et(a,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t})(t,r);c.addEventListener("mousedown",(f=>{const h=L.output([A[r],0]),d=null==y?void 0:y.length;u.attr("cursor","move"),m[1]!==r&&(m[1]=r,E()),JR(O.childNodes,m,s);const[p,x]=tI(O,c,a,o),w=t=>{const i=e[1]+t.clientY-D[1];if(M)if(k){const a=e[0]+t.clientX-D[0],[o,s]=nI(I,h,[a,i]),[,u]=L.output([1,j.output(0)]),[,f]=L.invert([o,u-(v[r+d][1]-s)]),g=(r+1)%d,m=Oj([v[(r-1+d)%d],[o,s],y[g]&&v[g]]);x.attr("text",l(j.invert(f)).toFixed(n)),p.attr("d",m),c.attr("cx",o),c.attr("cy",s)}else{const[,t]=L.output([1,j.output(0)]),[,a]=L.invert([e[0],t-(v[r+d][1]-i)]),o=Oj([v[r-1],[e[0],i],y[r+1]&&v[r+1]]);x.attr("text",l(j.invert(a)).toFixed(n)),p.attr("d",o),c.attr("cy",i)}else{const[,t]=L.invert([e[0],i]),a=Oj([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",a),c.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",w);const S=()=>Ne(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",w),u.removeEventListener("mouseup",S),Y(x.attr("text")))return;const e=Number(x.attr("text")),n=eI(N,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)}));u.addEventListener("mouseup",S)})),O.appendChild(c)})),JR(O.childNodes,m,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:w&&(e=v[0]);const i=(t=>{const e=et(t,["__data__","y"]),n=et(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:a},childNodes:o}=t.parentNode,s=_(a,(({type:t})=>"normalizeY"===t)),c=et(i,["y","field"]),l=r[o.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t})(t),c=new Ig({name:ZR,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});c.addEventListener("mousedown",(s=>{u.attr("cursor","move");const l=eI(N,b),[f,h]=tI(O,c,a,o),d=t=>{if(x){const r=e[0]+t.clientX-D[0],[a]=L.output([j.output(0),j.output(0)]),[,o]=L.invert([a+(r-v[2][0]),e[1]]),s=Oj([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);h.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(w){const r=e[1]+t.clientY-D[1],a=e[0]+t.clientX-D[0],[o,s]=nI(I,[a,r],e),[l,u]=nI(I,[a,r],v[1]),d=L.invert([o,s])[1],p=P-d;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=Mj(t,e[1]),a=Mj(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]),r}(I,[[o,s],[l,u],v[2],v[3]],p>.5?1:0);h.attr("text",i(p,!0).toFixed(n)),f.attr("d",g),c.attr("cx",o),c.attr("cy",s)}else{const r=e[1]+t.clientY-D[1],[,a]=L.output([1,j.output(0)]),[,o]=L.invert([e[0],a-(v[2][1]-r)]),s=Oj([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);h.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>Ne(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),Y(h.attr("text")))return;const e=Number(h.attr("text"));g=yield B(S,e,l,[r]),h.remove(),f.remove(),T(t)}));u.addEventListener("mouseup",p)})),O.appendChild(c)}};v.forEach(((t,e)=>{m[0]===e&&T(t),t.addEventListener("click",S),t.addEventListener("mouseenter",KR),t.addEventListener("mouseleave",QR)}));const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===ZR||v.includes(e))||(m=[],E(),O.removeChildren())};return i.on("element-point:select",A),i.on("element-point:unselect",P),u.addEventListener("mousedown",P),()=>{O.remove(),i.off("element-point:select",A),i.off("element-point:unselect",P),u.removeEventListener("mousedown",P),v.forEach((t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",KR),t.removeEventListener("mouseleave",QR)}))}}}var iI={},aI={};function oI(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function sI(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function cI(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function lI(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+cI(-t,6):t>9999?"+"+cI(t,6):cI(t,4)}(t.getUTCFullYear())+"-"+cI(t.getUTCMonth()+1,2)+"-"+cI(t.getUTCDate(),2)+(i?"T"+cI(e,2)+":"+cI(n,2)+":"+cI(r,2)+"."+cI(i,3)+"Z":r?"T"+cI(e,2)+":"+cI(n,2)+":"+cI(r,2)+"Z":n||e?"T"+cI(e,2)+":"+cI(n,2)+"Z":"")}function uI(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,s=0,c=a<=0,l=!1;function u(){if(c)return aI;if(l)return l=!1,iI;var e,r,i=o;if(34===t.charCodeAt(i)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?c=!0:10===(r=t.charCodeAt(o++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(r=t.charCodeAt(e=o++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(o)&&++o;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(r=u())!==aI;){for(var f=[];r!==iI&&r!==aI;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return o(e[t])})).join(t)}))}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?lI(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=oI(t);return function(r,i){return e(n(r),i,t)}}(t,e):oI(t)}));return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=sI(e)),[n.map(o).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=sI(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function fI(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;hI&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const hI=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),dI=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Ne(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return uI(r).parse(e,i?fI:wr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};dI.props={};const pI=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function gI(t){return null!=t&&!Number.isNaN(t)}pI.props={};const vI=t=>{const{callback:e=gI}=t;return t=>t.filter(e)};vI.props={};const mI=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};mI.props={};const yI=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};yI.props={};const bI=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};bI.props={};const xI=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r])),0)))};xI.props={};const kI=t=>{const{value:e}=t;return()=>e};kI.props={};const wI=t=>{const{callback:e=wr}=t;return t=>e(t)};wI.props={};const MI=t=>{const{callback:e=wr}=t;return t=>Array.isArray(t)?t.map(e):t};MI.props={};const OI=Math.PI/180,EI=2048;function SI(t){return t.text}function AI(){return"serif"}function _I(){return"normal"}function TI(t){return t.value}function PI(){return 90*~~(2*Math.random())}function CI(){return 1}function LI(){}function NI(t,e,n,r){if(e.sprite)return;const i=t.context,a=t.ratio;i.clearRect(0,0,2048/a,EI/a);let o=0,s=0,c=0;const l=n.length;for(--r;++r<l;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=i.measureText(e.text+"m").width*a,l=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*OI),r=Math.cos(e.rotate*OI),i=t*r,a=t*n,o=l*r,s=l*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else t=t+31>>5<<5;if(l>c&&(c=l),o+t>=2048&&(o=0,s+=c,c=0),s+l>=EI)break;i.translate((o+(t>>1))/a,(s+(l>>1))/a),e.rotate&&i.rotate(e.rotate*OI),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=o,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=t}const u=i.getImageData(0,0,2048/a,EI/a).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let a=e.y1-e.y0;for(let t=0;t<a*i;t++)f[t]=0;if(o=e.xoff,null==o)return;s=e.yoff;let c=0,l=-1;for(let n=0;n<a;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[2048*(s+n)+(o+e)<<2]?1<<31-e%32:0;f[t]|=r,c|=r}c?l=n:(e.y0++,a--,n--,s++)}e.y1=e.y0+l,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function jI(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,a=t.x-(i<<4),o=127&a,s=32-o,c=t.y1-t.y0;let l,u=(t.y+t.y0)*n+(a>>5);for(let t=0;t<c;t++){l=0;for(let n=0;n<=i;n++)if((l<<s|(n<i?(l=r[t*i+n])>>>o:0))&e[u+n])return!0;u+=n}return!1}function RI(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function II(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function DI(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function BI(){return document.createElement("canvas")}function FI(t){return"function"==typeof t?t:function(){return t}}const zI={archimedean:II,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function GI(){let t=[256,256],e=SI,n=AI,r=TI,i=_I,a=PI,o=CI,s=II,c=Math.random,l=LI,u=[],f=null,h=1/0,d=BI;const p=_I,g={};function v(e,n,r){const i=n.x,a=n.y,o=Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=s(t),u=c()<.5?1:-1;let f,h,d,p=-u;for(;(f=l(p+=u))&&(h=~~f[0],d=~~f[1],!(Math.min(Math.abs(h),Math.abs(d))>=o));)if(n.x=i+h,n.y=a+d,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1]||r&&jI(n,e,t[0])||r&&(v=r,!((g=n).x+g.x1>v[0].x&&g.x+g.x0<v[1].x&&g.y+g.y1>v[0].y&&g.y+g.y0<v[1].y)))){const r=n.sprite,i=n.width>>5,a=t[0]>>5,o=n.x-(i<<4),s=127&o,c=32-s,l=n.y1-n.y0;let u,f=(n.y+n.y0)*a+(o>>5);for(let t=0;t<l;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<c|(n<i?(u=r[t*i+n])>>>s:0);f+=a}return delete n.sprite,!0}var g,v;return!1}return g.start=function(){const[s,m]=t,y=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=EI/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(d()),b=g.board?g.board:DI((t[0]>>5)*t[1]),x=u.length,k=[],w=u.map((function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=a.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=o.call(this,t,s,c),t})).sort((function(t,e){return e.size-t.size}));let M=-1,O=g.board?[{x:0,y:0},{x:s,y:m}]:void 0;function E(){const e=Date.now();for(;Date.now()-e<h&&++M<x;){const e=w[M];e.x=s*(c()+.5)>>1,e.y=m*(c()+.5)>>1,NI(y,e,w,M),e.hasText&&v(b,e,O)&&(l.call(null,"word",{cloud:g,word:e}),k.push(e),O?g.hasImage||RI(O,e):O=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=k,g._bounds=O,M>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:k,bounds:O}))}return f&&clearInterval(f),f=setInterval(E,0),E(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const a=r>>5,o=DI((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const c=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=a*t+(e>>5),i=t*r+e<<2,s=c[i]>=250&&c[i+1]>=250&&c[i+2]>=250?1<<31-e%32:0;o[n]|=s}g.board=o,g.hasImage=!0},g.timeInterval=function(t){h=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=FI(t)},g.font=function(t){n=FI(t)},g.fontWeight=function(t){i=FI(t)},g.rotate=function(t){a=FI(t)},g.canvas=function(t){d=FI(t)},g.spiral=function(t){s=zI[t]||t},g.fontSize=function(t){r=FI(t)},g.padding=function(t){o=FI(t)},g.random=function(t){c=FI(t)},g.on=function(t){l=FI(t)},g}const WI={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function $I(t){return new Promise(((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}}))}const YI=(t,e)=>n=>Ne(void 0,void 0,void 0,(function*(){const r=Object.assign({},WI,t,{canvas:e.createCanvas}),i=GI();var a,o;yield(a=i,o=r,{set(t,e,n){if(void 0===o[t])return this;const r=e?e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this},setAsync(t,e,n){return Ne(this,void 0,void 0,(function*(){if(void 0===o[t])return this;const r=e?yield e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this}))}}).set("fontSize",(t=>{const e=n.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,a]=e;return a===i?()=>(r+n)/2:({value:t})=>(r-n)/(a-i)*(t-i)+n}return()=>t}(t,[pr(e),hr(e)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",$I,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:h,hasImage:d}=s,p=h.map((t=>{var{x:e,y:n,font:r}=t,i=Ce(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})})),[{x:g,y:v},{x:m,y:y}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:d?0:g,y:d?0:v}),Object.assign(Object.assign({},b),{x:d?c:m,y:d?l:y})),p}));function HI(t){return"string"==typeof t?e=>e[t]:t}YI.props={};const VI=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:a=NaN}=t,[o,s]=n,c=HI(s),l=HI(o),u=Kn(e,(([t])=>t),(t=>c(t)));return t=>t.map((t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:a,t)),{}))}))};VI.props={};const qI=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};qI.props={};var UI={exports:{}},XI={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(XI),function(t){var e=Math.log(2),n=t.exports,r=XI.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,a=r.isNumber(e.width)?e.width:2,o=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(o-1);return n&&(s-=2*a*l),i&&(c+=2*a*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var a=r.isNumber(e.size)?e.size:50,o=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:a,width:o,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(a-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<a;h++)f.push({x:c+h*u,y:0});var d=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,o),p=d[o],g=d[o-1]-d[o-2],v=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+o<0||e-o>=f.length)){var n=Math.max(e-o,0),i=e,a=Math.min(e+o,f.length-1),s=n-(e-o),l=e+o-a,h=d[-o-1+s]||0,m=d[-o-1+l]||0,y=p/(p-h-m);s>0&&(v+=y*(s-1)*g);var b=Math.max(0,e-o+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*y*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*y*g),r.inside(0,f.length-1,a+1)&&(f[a+1].y+=1*y*g)}}));var m=v,y=0,b=0;return f.forEach((function(t){y+=t.y,m+=y,t.y=m,b+=m})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(UI);var ZI=UI.exports;const KI=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:a,size:o=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(Xn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=ZI.create(t.map((t=>t[e])),{min:i,max:a,size:o,width:s}),r=n.map((t=>t.x)),u=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})}))}};KI.props={};const QI=()=>t=>(console.log("G2 data section:",t),t);QI.props={};const JI=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map((t=>t[e])),a=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const a=n*e+(1-e)*i;r.push(a),n=a}return r}(i,n);return t.map(((t,e)=>Object.assign(Object.assign({},t),{[r]:a[e]})))}};JI.props={};function tD(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function eD(t,e,n=.01){const[r,i]=t,[a,o]=e;return r>=a[0]-n&&r<=o[0]+n&&i>=a[1]-n&&i<=o[1]+n}const nD=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{nj(t);const e=t.getLocalBounds(),r=n.some((t=>function(t,e){const[n,r]=t,[i,a]=e;return n[0]<a[0]&&r[0]>i[0]&&n[1]<a[1]&&r[1]>i[1]}(tD(e),tD(t.getLocalBounds()))));r?ej(t):n.push(t)})),t}};function rD([t,e],[n,r]){return r>t&&e>n}function iD(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function aD(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const oD=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[a,o]=iD(),[s,c]=iD(),[l,u]=iD(),[f,h]=iD();for(const e of t){const{min:t,max:n}=aD(e),[r,i]=t,[a,s]=n;o(e,i),c(e,i),u(e,s-i),h(e,[r,a])}for(let a=0;a<e;a++){t.sort(((t,e)=>Ln(s(t),s(e))));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let a,o=n+1;for(;(a=t[o])&&!rD(f(i),f(a));)o+=1;if(a){const t=s(i),n=l(i),o=s(a),u=o-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(a,o+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-a(e);return t}};function sD(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function cD(t,e,n){return.2126*sD(t)+.7152*sD(e)+.0722*sD(n)}function lD(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:a,g:o,b:s}=e,c=cD(n,r,i),l=cD(a,o,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function uD(t,e){const n=dr(e,(e=>lD(t,function(t){return"object"==typeof t?t:dh(t)}(e))));return e[n]}const fD=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;lD(t.parsedStyle.fill,r)<e&&t.attr("fill",uD(r,n))})),t)},hD=()=>t=>(t.forEach((t=>{nj(t);const e=t.attr("bounds"),n=function(t,e,n=.01){const[r,i]=t;return!(eD(r,e,n)&&eD(i,e,n))}(tD(t.getLocalBounds()),e);n&&ej(t)})),t),dD=()=>(t,{canvas:e,layout:n})=>(t.forEach((t=>{nj(t);const{max:e,min:r}=t.getRenderBounds(),[i,a]=e,[o,s]=r,c=((t,e)=>{const[[n,r],[i,a]]=e,[[o,s],[c,l]]=t;let u=0,f=0;return o<n?u=n-o:c>i&&(u=i-c),s<r?f=r-s:l>a&&(f=a-l),[u,f]})([[o,s],[i,a]],[[n.x,n.y],[n.x+n.width,n.y+n.height]]);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=c[0],t.style.connectorPoints[0][1]-=c[1]),t.style.x+=c[0],t.style.y+=c[1]})),t);function pD(){return{"data.fetch":dI,"data.inline":kI,"data.sortBy":xI,"data.sort":mI,"data.filter":vI,"data.pick":yI,"data.rename":bI,"data.fold":pI,"data.slice":qI,"data.custom":wI,"data.map":MI,"data.join":VI,"data.kde":KI,"data.log":QI,"data.wordCloud":YI,"data.ema":JI,"transform.stackY":Kr,"transform.binX":Ts,"transform.bin":_s,"transform.dodgeX":ki,"transform.jitter":Bo,"transform.jitterX":Fo,"transform.jitterY":zo,"transform.symmetryY":Go,"transform.diffY":Wo,"transform.stackEnter":wi,"transform.normalizeY":Mi,"transform.select":qo,"transform.selectX":Uo,"transform.selectY":Xo,"transform.groupX":ss,"transform.groupY":cs,"transform.groupColor":ls,"transform.group":os,"transform.sortX":hs,"transform.sortY":ps,"transform.sortColor":ds,"transform.flexX":gs,"transform.pack":Es,"transform.sample":Cs,"transform.filter":Ls,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":a,"coordinate.theta":o,"coordinate.parallel":l,"coordinate.fisheye":u,"coordinate.radial":c,"coordinate.radar":f,"coordinate.helix":i,"encode.constant":h,"encode.field":p,"encode.transform":d,"encode.column":g,"mark.interval":MM,"mark.rect":EM,"mark.line":TM,"mark.point":CM,"mark.text":NM,"mark.cell":RM,"mark.area":DM,"mark.link":FM,"mark.image":GM,"mark.polygon":$M,"mark.box":HM,"mark.vector":qM,"mark.lineX":KM,"mark.lineY":XM,"mark.connector":JM,"mark.range":rO,"mark.rangeX":aO,"mark.rangeY":sO,"mark.path":lO,"mark.shape":GO,"mark.density":YO,"mark.heatmap":VO,"mark.wordCloud":WO,"palette.category10":qO,"palette.category20":UO,"scale.linear":ZO,"scale.ordinal":KO,"scale.band":XO,"scale.identity":QO,"scale.point":JO,"scale.time":tE,"scale.log":eE,"scale.pow":nE,"scale.sqrt":oE,"scale.threshold":rE,"scale.quantile":iE,"scale.quantize":aE,"scale.sequential":sE,"scale.constant":cE,"theme.classic":hE,"theme.classicDark":gE,"theme.academy":mE,"theme.light":fE,"theme.dark":pE,"component.axisX":XE,"component.axisY":ZE,"component.legendCategory":nS,"component.legendContinuous":sS,"component.legends":AS,"component.title":pS,"component.sliderX":wS,"component.sliderY":MS,"component.scrollbarX":ES,"component.scrollbarY":SS,"animation.scaleInX":_S,"animation.scaleOutX":TS,"animation.scaleInY":PS,"animation.scaleOutY":CS,"animation.waveIn":qS,"animation.fadeIn":LS,"animation.fadeOut":NS,"animation.zoomIn":US,"animation.zoomOut":XS,"animation.pathIn":ZS,"animation.morphing":VS,"animation.growInX":KS,"animation.growInY":QS,"interaction.elementHighlight":_j,"interaction.elementHighlightByX":Tj,"interaction.elementHighlightByColor":Pj,"interaction.elementSelect":Lj,"interaction.elementSelectByX":Nj,"interaction.elementSelectByColor":jj,"interaction.fisheye":Ij,"interaction.chartIndex":Rj,"interaction.tooltip":nR,"interaction.legendFilter":hR,"interaction.legendHighlight":dR,"interaction.brushHighlight":wR,"interaction.brushXHighlight":OR,"interaction.brushYHighlight":SR,"interaction.brushAxisHighlight":NR,"interaction.brushFilter":jR,"interaction.brushXFilter":RR,"interaction.brushYFilter":IR,"interaction.sliderFilter":zR,"interaction.scrollbarFilter":WR,"interaction.poptip":VR,"interaction.treemapDrillDown":UR,"interaction.elementPointMove":rI,"composition.spaceLayer":WT,"composition.spaceFlex":$T,"composition.facetRect":aP,"composition.repeatMatrix":fP,"composition.facetCircle":mP,"composition.timingKeyframe":bP,"labelTransform.overlapHide":nD,"labelTransform.overlapDodgeY":oD,"labelTransform.overflowHide":hD,"labelTransform.contrastReverse":fD,"labelTransform.exceedAdjust":dD}}function gD(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const vD={};const mD=t=>t?parseInt(t):0;function yD(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class bD{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return yD(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return yD(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return yD(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const xD=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],kD="__remove__",wD="__callback__";function MD(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function OD(t,e){const{width:n,height:r,autoFit:i,depth:a=0}=t;let o=640,s=480;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||mD(e.width),r=t.clientHeight||mD(e.height);return{width:n-(mD(e.paddingLeft)+mD(e.paddingRight)),height:r-(mD(e.paddingTop)+mD(e.paddingBottom))}}(e);o=t||o,s=n||s}return o=n||o,s=r||s,{width:Math.max(R(o)?o:1,1),height:Math.max(R(s)?s:1,1),depth:a}}function ED(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of xD)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,MD(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===wD)e.children=t.value;else{const i=MD(t),{children:a=[]}=e;a.push(i),n.push(t),r.set(t,i),e.children=a}}return r.get(e)}function SD(t,e,n,r,i){const{type:a}=t,{type:o=n||a}=e;if(function(t,e){return"function"!=typeof t&&new Set(Object.keys(e)).has(t)}(o,i)){for(const n of xD)void 0!==t.attr(n)&&void 0===e[n]&&(e[n]=t.attr(n));return e}if(function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(o,r)){const t={type:"view"},n=Object.assign({},e);for(const e of xD)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function AD(t,e,n){if("function"==typeof t){const e=new bD;return e.value=t,e.type=wD,e}const{type:r,children:i}=t,a=Ce(t,["type","children"]),o=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new o;return s.value=a,s.type=r,s}function _D(t,e){const{type:n,children:r}=e,i=Ce(e,["type","children"]);t.type===n||void 0===n?Rr(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function TD(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),a=AD(e,n,r);Array.isArray(t.children)&&t.push(a);const{children:o}=e;if(Array.isArray(o))for(const t of o)i.push([a,t]);else"function"==typeof o&&i.push([a,o])}}function PD(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function CD(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function LD(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function ND(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(Nr(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function jD(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function RD(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function ID(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?PD(e,n,r):"array"===t?CD(e,n,r):"object"===t?LD(e,n,r):"node"===t?jD(e,n,r):"container"===t?RD(e,n,r):"mix"===t&&ND(e,n)}return e}}function DD(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const BD={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},FD=Object.assign(Object.assign({},BD),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),zD=Object.assign(Object.assign({},BD),{labelTransform:{type:"array"}});let GD=class extends bD{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&nj(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&ej(t)}};GD=Le([ID(zD)],GD);let WD=class extends bD{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};WD=Le([ID(FD)],WD);const $D="G2_CHART_KEY";class YD extends GD{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:a,createCanvas:o}=t;super(Ce(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=q((()=>{this.forceFit()}),300),this._renderer=r||new x_,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[kD]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new O_,this._context={library:Object.assign(Object.assign({},a),vD),emitter:this._emitter,canvas:n,createCanvas:o},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>ZN(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).catch(r).then((()=>this._renderTrailing())),e}options(t){if(0===arguments.length)return ED(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const a=[[null,t,SD(t,e,n,r,i)]];for(;a.length;){const[t,e,n]=a.shift();if(e)if(n){_D(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],o=r[i];a.push([e,o,n])}}else"function"==typeof t&&a.push([e,null,t])}else e.remove();else TD(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options();this.emit(E_.BEFORE_CLEAR),this._reset(),KN(0,this._context,!1),this.emit(E_.AFTER_CLEAR)}destroy(){this.options();this.emit(E_.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),KN(0,this._context,!0),this._container[kD]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(E_.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=OD(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(E_.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(E_.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(E_.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(E_.AFTER_CHANGE_SIZE)})),n}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends WD{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter((t=>t.startsWith("composition.")&&"composition.mark"!==t))];this._compositions=Object.fromEntries(n.map((t=>{const e=t.split(".").pop();let n=class extends GD{constructor(){super({},e)}};return n=Le([ID(DD(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))ID(DD(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter((([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e)))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=$D}=t,{width:n,height:r,depth:i}=OD(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=OD(this.options(),this._container);this._plugins.push(new w_),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new gv({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const HD=gD(YD,Object.assign({},pD()));t.AREA_CLASS_NAME=oA,t.Academy=mE,t.Bin=_s,t.BinX=Ts,t.COMPONENT_CLASS_NAME=iA,t.Chart=HD,t.ChartEvent=E_,t.Classic=hE,t.ClassicDark=gE,t.Dark=pE,t.DiffY=Wo,t.DodgeX=ki,t.ELEMENT_CLASS_NAME=eA,t.Filter=Ls,t.FlexX=gs,t.Group=os,t.GroupColor=ls,t.GroupX=ss,t.GroupY=cs,t.Jitter=Bo,t.JitterX=Fo,t.JitterY=zo,t.LABEL_CLASS_NAME=aA,t.LABEL_LAYER_CLASS_NAME=tA,t.Light=fE,t.LinearAxis=qE,t.MAIN_LAYER_CLASS_NAME=JS,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=di,t.MaybeDefaultY=pi,t.MaybeFunctionAttribute=yi,t.MaybeGradient=xi,t.MaybeIdentityX=hi,t.MaybeIdentityY=fi,t.MaybeKey=si,t.MaybeSeries=ci,t.MaybeSize=oi,t.MaybeStackY=Jr,t.MaybeTitle=ni,t.MaybeTooltip=gi,t.MaybeTuple=bi,t.MaybeTupleX=ui,t.MaybeTupleY=li,t.MaybeVisualPosition=mi,t.MaybeZeroPadding=vi,t.MaybeZeroX=ri,t.MaybeZeroY=ii,t.MaybeZeroY1=Cn,t.MaybeZeroZ=ai,t.NormalizeY=Mi,t.PLOT_CLASS_NAME=rA,t.Pack=Es,t.Runtime=YD,t.Sample=Cs,t.Select=qo,t.SelectX=Uo,t.SelectY=Xo,t.Selection=gm,t.SortColor=ds,t.SortX=hs,t.SortY=ps,t.StackEnter=wi,t.StackY=Kr,t.SymmetryY=Go,t.VIEW_CLASS_NAME=nA,t.corelib=pD,t.extend=gD,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,my.set(n,r)):Object.assign(vD,{[t]:e})},t.render=ZN,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:a=640,height:o=480}=t,s=UN(t),{group:c=new zg,emitter:l=new O_,library:u}=e;(null==c?void 0:c.parentElement)||Er("renderToMountedElement can't render chart to unmounted group.");const f=pm(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||(null===(i=null==c?void 0:c.ownerDocument)||void 0===i?void 0:i.defaultView),l.emit(E_.BEFORE_RENDER),bN(Object.assign(Object.assign({},s),{width:a,height:o}),f,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(E_.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=pm,Object.defineProperty(t,"__esModule",{value:!0})}));