@hybridcore/ui 1.5.89 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/dist/{AccordionDetails-DhriPVPP.js → AccordionSummary-DgAwVTk8.js} +81 -82
  2. package/dist/{Add-CMz4N2zT.js → Add-DJLrrVHm.js} +52 -51
  3. package/dist/AnimatedTheme-jnasw6rT.js +11305 -0
  4. package/dist/AxisRenderer-DTyLLA6c.js +3579 -0
  5. package/dist/AxisRendererY-C_ItLPNV.js +445 -0
  6. package/dist/Box-p6OtTUEo.js +30 -0
  7. package/dist/Bullet-DVczI2TD.js +41 -0
  8. package/dist/Button-CcsPEIDh.js +35 -0
  9. package/dist/{Button-eqWvpDuh.js → Button-CvE2gnly.js} +138 -124
  10. package/dist/{ButtonBase-DsX-jMQJ.js → ButtonBase-2bPw77UP.js} +5 -5
  11. package/dist/{CardContent-DsYqqPeJ.js → CardContent-CSHh-ZlM.js} +4 -4
  12. package/dist/CategoryAxis-CwnfaGc8.js +458 -0
  13. package/dist/{Checkbox-CrU2hpWB.js → Checkbox-CWRMFTBp.js} +12 -11
  14. package/dist/Circle-Cy5s-pVc.js +27 -0
  15. package/dist/ColorSet-C7vpNXhM.js +2957 -0
  16. package/dist/{ColumnSeries-BTcqshjB.js → ColumnSeries-CjgdJ2QL.js} +129 -126
  17. package/dist/DataProcessor-CHDO51q4.js +83 -0
  18. package/dist/DateAxis-YX3QNIB-.js +569 -0
  19. package/dist/{Delete-86TO0fMo.js → Delete-CW0UZv1m.js} +1 -1
  20. package/dist/{DialogContent-CqTojymQ.js → DialogContent-B3nbEbuv.js} +10 -11
  21. package/dist/FormControl-BLbrq4C7.js +1636 -0
  22. package/dist/{FormControlLabel-BrdX4R71.js → FormControlLabel-C8SPv14J.js} +8 -8
  23. package/dist/Hierarchy-Bihj0S61.js +925 -0
  24. package/dist/{IconButton-DJ-31-Fd.js → IconButton-CHwRQF-g.js} +20 -19
  25. package/dist/IconPlus-yPkff_Vj.js +19 -0
  26. package/dist/{InputAdornment-B7qEA4kN.js → InputAdornment-DLxWUE6H.js} +6 -6
  27. package/dist/Legend-Dp_MKfS4.js +178 -0
  28. package/dist/LineSeries-Uiv5o56b.js +472 -0
  29. package/dist/{List-DOD5kSk3.js → List-tqElle9C.js} +4 -4
  30. package/dist/{ListItem-r8PbsvCz.js → ListItem-CfjsIg4B.js} +9 -8
  31. package/dist/{MenuItem-C6qlUyV3.js → MenuItem-xZx_w7zA.js} +14 -13
  32. package/dist/{Modal-CkcFEpHa.js → Modal-DhPpOoGB.js} +292 -277
  33. package/dist/{Paper-CjqLScHA.js → Paper-2B03OBmZ.js} +47 -41
  34. package/dist/PieSeries-B2fW3z0s.js +693 -0
  35. package/dist/RoundedRectangle-CWLi2PXn.js +34 -0
  36. package/dist/Scrollbar-D86MJyr2.js +171 -0
  37. package/dist/{Select-t3ewnSdf.js → Select-BgYwkZgI.js} +2066 -1633
  38. package/dist/Slice-B19rbYDZ.js +261 -0
  39. package/dist/{Source-BESIjd9X.js → Source-BSZST_GH.js} +2472 -2445
  40. package/dist/{Text-Cl1H4b0h.js → Text-ChJRuaD8.js} +398 -397
  41. package/dist/{TextField-BQ8a50fA.js → TextField-1yCesIbH.js} +23 -25
  42. package/dist/Tick-2bcLyHpF.js +162 -0
  43. package/dist/{Typography-D1t7XuLN.js → Typography-CxbneZy_.js} +11 -11
  44. package/dist/Vector-BmuhQO4p.js +3606 -0
  45. package/dist/Vector-DfTqQEln.js +1735 -0
  46. package/dist/WKT-2wsDT-nq.js +2310 -0
  47. package/dist/XYCursor-C8WktvKM.js +362 -0
  48. package/dist/ZoomableContainer-DYyqwaMb.js +220 -0
  49. package/dist/_commonjsHelpers-BVfed4GL.js +28 -0
  50. package/dist/capitalize-ciszXJ7R.js +9 -0
  51. package/dist/components/access/helpers.js +1 -1
  52. package/dist/components/access/index.js +1 -1
  53. package/dist/components/card/index.js +6 -6
  54. package/dist/components/card/styled.js +1 -1
  55. package/dist/components/charts/_common/utils.js +20 -0
  56. package/dist/components/charts/candlestick/logic.js +170 -140
  57. package/dist/components/charts/chart-wrapper/helpers.js +27 -0
  58. package/dist/components/charts/chart-wrapper/index.js +44 -0
  59. package/dist/components/charts/chart-wrapper/logic.js +47 -0
  60. package/dist/components/charts/chart-wrapper/styled.js +44 -0
  61. package/dist/components/charts/column-line-mix/index.js +10 -0
  62. package/dist/components/charts/column-line-mix/logic.js +162 -0
  63. package/dist/components/charts/column-line-mix/styled.js +12 -0
  64. package/dist/components/charts/drill-down-treemap/index.js +10 -0
  65. package/dist/components/charts/drill-down-treemap/logic.js +391 -0
  66. package/dist/components/charts/drill-down-treemap/styled.js +12 -0
  67. package/dist/components/charts/drill-down-voronoi-treemap/index.js +10 -0
  68. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +1527 -0
  69. package/dist/components/charts/drill-down-voronoi-treemap/styled.js +12 -0
  70. package/dist/components/charts/heatmap/index.js +10 -0
  71. package/dist/components/charts/heatmap/logic.js +361 -0
  72. package/dist/components/charts/heatmap/styled.js +12 -0
  73. package/dist/components/charts/highlighting-line-data/logic.js +89 -256
  74. package/dist/components/charts/line/index.js +10 -0
  75. package/dist/components/charts/line/logic.js +148 -0
  76. package/dist/components/charts/line/styled.js +12 -0
  77. package/dist/components/charts/logaritmic-scale/index.js +10 -0
  78. package/dist/components/charts/logaritmic-scale/logic.js +119 -0
  79. package/dist/components/charts/logaritmic-scale/styled.js +12 -0
  80. package/dist/components/charts/multiple-value-axes/index.js +10 -0
  81. package/dist/components/charts/multiple-value-axes/logic.js +191 -0
  82. package/dist/components/charts/multiple-value-axes/styled.js +12 -0
  83. package/dist/components/charts/nested-pie/index.js +10 -0
  84. package/dist/components/charts/nested-pie/logic.js +110 -0
  85. package/dist/components/charts/nested-pie/styled.js +12 -0
  86. package/dist/components/charts/packed-circles/index.js +10 -0
  87. package/dist/components/charts/packed-circles/logic.js +423 -0
  88. package/dist/components/charts/packed-circles/styled.js +12 -0
  89. package/dist/components/charts/pie-chart/index.js +10 -0
  90. package/dist/components/charts/pie-chart/logic.js +70 -0
  91. package/dist/components/charts/pie-chart/styled.js +12 -0
  92. package/dist/components/charts/stacked-area-radar/index.js +10 -0
  93. package/dist/components/charts/stacked-area-radar/logic.js +868 -0
  94. package/dist/components/charts/stacked-area-radar/styled.js +12 -0
  95. package/dist/components/charts/stacked-column-chart/index.js +10 -0
  96. package/dist/components/charts/stacked-column-chart/logic.js +148 -0
  97. package/dist/components/charts/stacked-column-chart/styled.js +12 -0
  98. package/dist/components/charts/xy-chart/index.js +10 -0
  99. package/dist/components/charts/xy-chart/logic.js +170 -0
  100. package/dist/components/charts/xy-chart/styled.js +12 -0
  101. package/dist/components/collapsible-card/index.js +58 -32
  102. package/dist/components/collapsible-card/logic.js +20 -0
  103. package/dist/components/collapsible-card/styled.js +52 -0
  104. package/dist/components/confirm/dialog.js +3 -3
  105. package/dist/components/confirm/index.js +1 -1
  106. package/dist/components/container/index.js +7 -7
  107. package/dist/components/context-menu/index.js +153 -253
  108. package/dist/components/data-map/components/controls/index.js +12 -0
  109. package/dist/components/data-map/components/controls/styled.js +34 -0
  110. package/dist/components/data-map/index.js +51 -0
  111. package/dist/components/data-map/logic.js +108 -0
  112. package/dist/components/data-map/styled.js +32 -0
  113. package/dist/components/data-security-selectors/security-level/index.js +5 -5
  114. package/dist/components/date-picker-with-custom-range/index.js +9 -0
  115. package/dist/components/date-picker-with-custom-range/logic.js +66 -0
  116. package/dist/components/date-picker-with-custom-range/styled.js +43 -0
  117. package/dist/components/divider/index.js +18 -0
  118. package/dist/components/divider/logic.js +13 -0
  119. package/dist/components/divider/styled.js +14 -0
  120. package/dist/components/geometry-picker/coordinate/index.js +1 -1
  121. package/dist/components/geometry-picker/edit/index.js +1 -1
  122. package/dist/components/geometry-picker/geometry/index.js +1 -1
  123. package/dist/components/geometry-picker/index.js +7 -8
  124. package/dist/components/geometry-picker/kml/index.js +1 -1
  125. package/dist/components/geometry-picker/map/index.js +1 -1
  126. package/dist/components/geometry-picker/map/logic.js +65 -62
  127. package/dist/components/geometry-picker/map/style.js +1 -1
  128. package/dist/components/heat-map/components/controls/index.js +12 -0
  129. package/dist/components/heat-map/components/controls/styled.js +34 -0
  130. package/dist/components/heat-map/components/legend/index.js +26 -0
  131. package/dist/components/heat-map/components/legend/styled.js +14 -0
  132. package/dist/components/heat-map/index.js +37 -0
  133. package/dist/components/heat-map/logic.js +1945 -0
  134. package/dist/components/heat-map/styled.js +32 -0
  135. package/dist/components/icon-button/index.js +22 -15
  136. package/dist/components/icon-button/logic.js +15 -0
  137. package/dist/components/icon-button/styled.js +22 -10
  138. package/dist/components/instance-form/components/composite-list/index.js +1 -1
  139. package/dist/components/instance-form/components/composite-matrix/components/json-editor/index.js +8 -7
  140. package/dist/components/instance-form/components/variable/index.js +8 -8
  141. package/dist/components/instance-form/components/variables/index.js +1 -1
  142. package/dist/components/instance-hierarchy-table/styled.js +1 -1
  143. package/dist/components/instance-variable-list/index.js +34 -29
  144. package/dist/components/instance-variable-list/styled.js +21 -21
  145. package/dist/components/instance-variable-list/variable.js +44 -74
  146. package/dist/components/linear-indicator/index.js +10 -67
  147. package/dist/components/linear-indicator/logic.js +47 -0
  148. package/dist/components/linear-indicator/styled.js +39 -40
  149. package/dist/components/map/helpers/kml.js +1 -1
  150. package/dist/components/map/helpers/mapbox.js +14 -14
  151. package/dist/components/map/helpers/ol.js +23 -19
  152. package/dist/components/map/helpers/wkt.js +26 -1314
  153. package/dist/components/map/index.js +1 -1
  154. package/dist/components/map/logic.js +113 -101
  155. package/dist/components/map/styled.js +39 -31
  156. package/dist/components/metric-card/MetricChart.js +50 -498
  157. package/dist/components/metric-card/index.js +94 -115
  158. package/dist/components/metric-card/logic.js +70 -131
  159. package/dist/components/object-profile-card/components/avatar/index.js +44 -0
  160. package/dist/components/object-profile-card/components/avatar/logic.js +19 -0
  161. package/dist/components/object-profile-card/components/avatar/styled.js +41 -0
  162. package/dist/components/object-profile-card/index.js +90 -0
  163. package/dist/components/object-profile-card/logic.js +33 -0
  164. package/dist/components/object-profile-card/styled.js +48 -0
  165. package/dist/components/paginated-list/index.js +93 -89
  166. package/dist/components/paginated-list/logic.js +51 -40
  167. package/dist/components/paginated-list/styled.js +25 -21
  168. package/dist/components/property-mapping/index.js +2 -2
  169. package/dist/components/prr-map/components/controls/index.js +12 -0
  170. package/dist/components/prr-map/components/controls/styled.js +34 -0
  171. package/dist/components/prr-map/components/legend/index.js +36 -0
  172. package/dist/components/prr-map/components/legend/styled.js +21 -0
  173. package/dist/components/prr-map/index.js +38 -0
  174. package/dist/components/prr-map/logic.js +104 -0
  175. package/dist/components/prr-map/styled.js +32 -0
  176. package/dist/components/range-selector/components/composite-list-range/index.js +1 -1
  177. package/dist/components/range-selector/components/date-range/index.js +4282 -7
  178. package/dist/components/range-selector/index.js +1 -1
  179. package/dist/components/raster-grid-map/components/controls/index.js +12 -0
  180. package/dist/components/raster-grid-map/components/controls/styled.js +34 -0
  181. package/dist/components/raster-grid-map/components/legend/index.js +14 -0
  182. package/dist/components/raster-grid-map/components/legend/styled.js +21 -0
  183. package/dist/components/raster-grid-map/helpers.js +190 -0
  184. package/dist/components/raster-grid-map/index.js +38 -0
  185. package/dist/components/raster-grid-map/logic.js +172 -0
  186. package/dist/components/raster-grid-map/styled.js +32 -0
  187. package/dist/components/search-input/index.js +62 -140
  188. package/dist/components/search-input/logic.js +43 -0
  189. package/dist/components/search-input/styled.js +33 -0
  190. package/dist/components/simple-pivot-table/index.js +66 -0
  191. package/dist/components/simple-pivot-table/logic.js +51 -0
  192. package/dist/components/simple-pivot-table/styled.js +45 -0
  193. package/dist/components/static-text/index.js +18 -0
  194. package/dist/components/static-text/logic.js +13 -0
  195. package/dist/components/static-text/styled.js +45 -0
  196. package/dist/components/tabs/index.js +56 -2160
  197. package/dist/components/tabs/logic.js +36 -0
  198. package/dist/components/tabs/styled.js +94 -16
  199. package/dist/components/tabs/tab-panel.js +11 -10
  200. package/dist/components/template-filters/components/tab-panel/index.js +1 -1
  201. package/dist/components/template-form/components/property-list/index.js +7 -7
  202. package/dist/components/template-form/components/property-list/property-list-columns.js +3 -3
  203. package/dist/components/template-form/components/property-list/property-list-form.js +9 -9
  204. package/dist/components/template-form/components/recognition-property-list/index.js +6 -6
  205. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +2 -2
  206. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +7 -7
  207. package/dist/components/template-form/index.js +5 -5
  208. package/dist/components/template-property-filters/property.js +5 -5
  209. package/dist/components/timeline/index.js +61 -0
  210. package/dist/components/timeline/logic.js +40 -0
  211. package/dist/components/timeline/styled.js +48 -0
  212. package/dist/components/tree-select/index.js +5 -5
  213. package/dist/components/treeview-filter/item-label/index.js +3 -3
  214. package/dist/constant-BiOGvlZc.js +21 -0
  215. package/dist/createReactComponent-C7L-DMHj.js +60 -0
  216. package/dist/{createSvgIcon-DLPYMuH1.js → createSvgIcon-BjpIhJ30.js} +30 -32
  217. package/dist/{createSvgIcon-OuwzpcaC.js → createSvgIcon-DrtgaibK.js} +5 -5
  218. package/dist/{createTheme-CNnKNxwL.js → createTheme-DYxDnE9u.js} +226 -285
  219. package/dist/{dialog-BE4D6swf.js → dialog-DcwXug9J.js} +6 -6
  220. package/dist/{helpers-DaCoWmi2.js → helpers-B4UL9NMD.js} +3 -3
  221. package/dist/index-BMS1Otro.js +183 -0
  222. package/dist/index-C__OZmYy.js +663 -0
  223. package/dist/{index-CGNxsLVm.js → index-CcdvNlgr.js} +7 -7
  224. package/dist/{index-JrtqxUdI.js → index-kCJ_Zvl8.js} +5 -5
  225. package/dist/index-syTc6m_V.js +1934 -0
  226. package/dist/index.es-CHNMhaMi.js +2067 -0
  227. package/dist/index.esm-BLLrbTzY.js +318 -0
  228. package/dist/{listItemTextClasses-CNjn41Of.js → listItemTextClasses-C3lndiXO.js} +2 -2
  229. package/dist/main.d.ts +1226 -358
  230. package/dist/main.js +141 -443
  231. package/dist/{has-DNclCIDV.js → math-Bvt2Ubuz.js} +220 -222
  232. package/dist/ol-yOE-NV0X.js +7465 -0
  233. package/dist/path-CNVruS--.js +84 -0
  234. package/dist/{property-list-form-C5hcK2y2.js → property-list-form-zZQfpR0X.js} +13 -13
  235. package/dist/styled-eZwjUruw.js +12 -0
  236. package/dist/useId-B4-oF9Mq.js +34 -0
  237. package/dist/useMobilePicker-BLg3Blg8.js +7589 -0
  238. package/dist/useThemeProps-BzzHcQyd.js +58 -0
  239. package/dist/{utils-CsOZUsQj.js → utils-BDNynJcd.js} +2 -2
  240. package/package.json +42 -9
  241. package/dist/AxisRendererY-kADUad00.js +0 -18370
  242. package/dist/Box-B1AVyJ_s.js +0 -71
  243. package/dist/DateAxis-CMum47iz.js +0 -924
  244. package/dist/Input-CoIrGZAh.js +0 -326
  245. package/dist/InputLabel-CBuAYyuT.js +0 -1367
  246. package/dist/LineSeries-CfcpoYla.js +0 -549
  247. package/dist/OutlinedInput-B-iZoc9l.js +0 -450
  248. package/dist/Tabs-Cn42Z5QI.js +0 -789
  249. package/dist/components/collapsible-card/style.js +0 -49
  250. package/dist/components/profile-card/index.js +0 -80
  251. package/dist/components/profile-card/logic.js +0 -33
  252. package/dist/components/profile-card/styled.js +0 -43
  253. package/dist/components/tabs/appleTabs.style.js +0 -55
  254. package/dist/createStyled-BGx1I94c.js +0 -352
  255. package/dist/createTheme-CyC5HawC.js +0 -879
  256. package/dist/exactProp-cjT0t_Pt.js +0 -36
  257. package/dist/extendSxProp-FEpqY5_S.js +0 -30
  258. package/dist/index-DMSHuq6l.js +0 -688
  259. package/dist/index-SpeaLUQD.js +0 -10963
  260. package/dist/ol-lGwSyEIV.js +0 -15050
  261. package/dist/ownerDocument-CUrv0DIK.js +0 -6
  262. package/dist/ownerWindow-niciwP7I.js +0 -7
  263. package/dist/styled-B8ugzvji.js +0 -12
  264. package/dist/useId-BHG98T5I.js +0 -26
  265. package/dist/useTheme-C15Eq8KG.js +0 -18
  266. package/dist/useTheme-D-uii9iX.js +0 -10
  267. package/dist/useThemeProps-DRP1dikX.js +0 -95
@@ -0,0 +1,1527 @@
1
+ import { G as Zt, k as ve, l as de, R as xe, a as we, A as me } from "../../../AnimatedTheme-jnasw6rT.js";
2
+ import { useThemeProps as ye, useTheme as be } from "@mui/material";
3
+ import Ce from "dayjs";
4
+ import Ae from "lodash";
5
+ import { useId as Pe, useRef as ze, useEffect as _e } from "react";
6
+ import { colorSetFromPalette as De } from "../_common/utils.js";
7
+ import { e as Kt, z as ht, m as Ee, a as lt, c as Ht, b as Vt } from "../../../ColorSet-C7vpNXhM.js";
8
+ import { Z as Te } from "../../../ZoomableContainer-DYyqwaMb.js";
9
+ import { H as Jt } from "../../../Hierarchy-Bihj0S61.js";
10
+ import { c as K, g as ke, a as Ne } from "../../../_commonjsHelpers-BVfed4GL.js";
11
+ class pt extends Zt {
12
+ constructor() {
13
+ super(...arguments), Object.defineProperty(this, "morphAnimation", {
14
+ enumerable: !0,
15
+ configurable: !0,
16
+ writable: !0,
17
+ value: void 0
18
+ });
19
+ }
20
+ _beforeChanged() {
21
+ if (super._beforeChanged(), this.isDirty("coordinates")) {
22
+ const e = [], n = this.get("coordinates");
23
+ n && Kt(n, (r) => {
24
+ e.push({ x: r[0], y: r[1] });
25
+ }), this.set("points", e);
26
+ }
27
+ if (this.isPrivateDirty("points") && (this._clear = !0), this.isDirty("points")) {
28
+ this._clear = !0;
29
+ const e = this.get("points"), n = this._prevSettings.points;
30
+ if (n) {
31
+ if (e) {
32
+ let h = ht(e), i = ht(n), s = h.length, c = i.length;
33
+ if (s > c) {
34
+ let a = ht(h);
35
+ for (let l = 0; l < s; l++) {
36
+ let g = Math.floor(l / s * c);
37
+ a[l] = { x: i[g].x, y: i[g].y };
38
+ }
39
+ i = a;
40
+ } else if (c > s) {
41
+ let a = ht(i);
42
+ for (let l = 0; l < c; l++) {
43
+ let g = Math.floor(l / c * s);
44
+ a[l] = { x: h[g].x, y: h[g].y };
45
+ }
46
+ h = a;
47
+ }
48
+ this.setPrivateRaw("previousPoints", i), this.setPrivateRaw("points", h), this.morphAnimation = this.animatePrivate({ key: "morphProgress", from: 0, to: 1, duration: this.get("animationDuration", 0), easing: this.get("animationEasing") }), this._root.events.once("frameended", () => {
49
+ this._markDirtyPrivateKey("morphProgress");
50
+ });
51
+ }
52
+ } else
53
+ this.setPrivateRaw("previousPoints", e), this.setPrivateRaw("points", e);
54
+ let r = 1 / 0, o = -1 / 0, u = 1 / 0, f = -1 / 0;
55
+ if (e)
56
+ for (let h = 1, i = e.length; h < i; h++) {
57
+ const s = e[h];
58
+ r = Math.min(r, s.x), o = Math.max(o, s.x), u = Math.min(u, s.y), f = Math.max(f, s.y);
59
+ }
60
+ this.setPrivate("minX", r), this.setPrivate("maxX", o), this.setPrivate("minY", u), this.setPrivate("maxY", u);
61
+ }
62
+ this.isPrivateDirty("morphProgress") && (this._clear = !0);
63
+ }
64
+ _changed() {
65
+ super._changed(), this._clear && this._draw();
66
+ }
67
+ _draw() {
68
+ const e = this.getPrivate("previousPoints"), n = this.getPrivate("points"), r = this.getPrivate("morphProgress", 1);
69
+ if (n && e) {
70
+ const o = n[0], u = e[0];
71
+ o && this._display.moveTo(u.x + (o.x - u.x) * r, u.y + (o.y - u.y) * r);
72
+ for (let f = 1, h = n.length; f < h; f++) {
73
+ const i = n[f], s = e[f];
74
+ this._display.lineTo(s.x + (i.x - s.x) * r, s.y + (i.y - s.y) * r);
75
+ }
76
+ this._display.closePath();
77
+ }
78
+ }
79
+ _updateSize() {
80
+ this.markDirty(), this._clear = !0;
81
+ }
82
+ }
83
+ Object.defineProperty(pt, "className", {
84
+ enumerable: !0,
85
+ configurable: !0,
86
+ writable: !0,
87
+ value: "Polygon"
88
+ });
89
+ Object.defineProperty(pt, "classNames", {
90
+ enumerable: !0,
91
+ configurable: !0,
92
+ writable: !0,
93
+ value: Zt.classNames.concat([pt.className])
94
+ });
95
+ function ft(t) {
96
+ for (var e = -1, n = t.length, r, o = t[n - 1], u = 0; ++e < n; )
97
+ r = o, o = t[e], u += r[1] * o[0] - r[0] * o[1];
98
+ return u / 2;
99
+ }
100
+ function Ie(t) {
101
+ for (var e = -1, n = t.length, r = 0, o = 0, u, f = t[n - 1], h, i = 0; ++e < n; )
102
+ u = f, f = t[e], i += h = u[0] * f[1] - f[0] * u[1], r += (u[0] + f[0]) * h, o += (u[1] + f[1]) * h;
103
+ return i *= 3, [r / i, o / i];
104
+ }
105
+ function Me(t, e, n) {
106
+ return (e[0] - t[0]) * (n[1] - t[1]) - (e[1] - t[1]) * (n[0] - t[0]);
107
+ }
108
+ function Oe(t, e) {
109
+ return t[0] - e[0] || t[1] - e[1];
110
+ }
111
+ function Xt(t) {
112
+ const e = t.length, n = [0, 1];
113
+ let r = 2, o;
114
+ for (o = 2; o < e; ++o) {
115
+ for (; r > 1 && Me(t[n[r - 2]], t[n[r - 1]], t[o]) <= 0; ) --r;
116
+ n[r++] = o;
117
+ }
118
+ return n.slice(0, r);
119
+ }
120
+ function Fe(t) {
121
+ if ((n = t.length) < 3) return null;
122
+ var e, n, r = new Array(n), o = new Array(n);
123
+ for (e = 0; e < n; ++e) r[e] = [+t[e][0], +t[e][1], e];
124
+ for (r.sort(Oe), e = 0; e < n; ++e) o[e] = [r[e][0], -r[e][1]];
125
+ var u = Xt(r), f = Xt(o), h = f[0] === u[0], i = f[f.length - 1] === u[u.length - 1], s = [];
126
+ for (e = u.length - 1; e >= 0; --e) s.push(t[r[u[e]][2]]);
127
+ for (e = +h; e < f.length - i; ++e) s.push(t[r[f[e]][2]]);
128
+ return s;
129
+ }
130
+ function Qt(t, e) {
131
+ for (var n = t.length, r = t[n - 1], o = e[0], u = e[1], f = r[0], h = r[1], i, s, c = !1, a = 0; a < n; ++a)
132
+ r = t[a], i = r[0], s = r[1], s > u != h > u && o < (f - i) * (u - s) / (h - s) + i && (c = !c), f = i, h = s;
133
+ return c;
134
+ }
135
+ function We(t) {
136
+ for (var e = -1, n = t.length, r = t[n - 1], o, u, f = r[0], h = r[1], i = 0; ++e < n; )
137
+ o = f, u = h, r = t[e], f = r[0], h = r[1], o -= f, u -= h, i += Math.hypot(o, u);
138
+ return i;
139
+ }
140
+ var nt = 0, ot = 0, rt = 0, te = 1e3, vt, st, dt = 0, Z = 0, wt = 0, at = typeof performance == "object" && performance.now ? performance : Date, ee = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
141
+ setTimeout(t, 17);
142
+ };
143
+ function ne() {
144
+ return Z || (ee(Re), Z = at.now() + wt);
145
+ }
146
+ function Re() {
147
+ Z = 0;
148
+ }
149
+ function Ct() {
150
+ this._call = this._time = this._next = null;
151
+ }
152
+ Ct.prototype = ie.prototype = {
153
+ constructor: Ct,
154
+ restart: function(t, e, n) {
155
+ if (typeof t != "function") throw new TypeError("callback is not a function");
156
+ n = (n == null ? ne() : +n) + (e == null ? 0 : +e), !this._next && st !== this && (st ? st._next = this : vt = this, st = this), this._call = t, this._time = n, At();
157
+ },
158
+ stop: function() {
159
+ this._call && (this._call = null, this._time = 1 / 0, At());
160
+ }
161
+ };
162
+ function ie(t, e, n) {
163
+ var r = new Ct();
164
+ return r.restart(t, e, n), r;
165
+ }
166
+ function Le() {
167
+ ne(), ++nt;
168
+ for (var t = vt, e; t; )
169
+ (e = Z - t._time) >= 0 && t._call.call(null, e), t = t._next;
170
+ --nt;
171
+ }
172
+ function jt() {
173
+ Z = (dt = at.now()) + wt, nt = ot = 0;
174
+ try {
175
+ Le();
176
+ } finally {
177
+ nt = 0, Ve(), Z = 0;
178
+ }
179
+ }
180
+ function He() {
181
+ var t = at.now(), e = t - dt;
182
+ e > te && (wt -= e, dt = t);
183
+ }
184
+ function Ve() {
185
+ for (var t, e = vt, n, r = 1 / 0; e; )
186
+ e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : vt = n);
187
+ st = t, At(r);
188
+ }
189
+ function At(t) {
190
+ if (!nt) {
191
+ ot && (ot = clearTimeout(ot));
192
+ var e = t - Z;
193
+ e > 24 ? (t < 1 / 0 && (ot = setTimeout(jt, t - at.now() - wt)), rt && (rt = clearInterval(rt))) : (rt || (dt = at.now(), rt = setInterval(He, te)), nt = 1, ee(jt));
194
+ }
195
+ }
196
+ var Xe = { value: () => {
197
+ } };
198
+ function re() {
199
+ for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) {
200
+ if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r);
201
+ n[r] = [];
202
+ }
203
+ return new ct(n);
204
+ }
205
+ function ct(t) {
206
+ this._ = t;
207
+ }
208
+ function je(t, e) {
209
+ return t.trim().split(/^|\s+/).map(function(n) {
210
+ var r = "", o = n.indexOf(".");
211
+ if (o >= 0 && (r = n.slice(o + 1), n = n.slice(0, o)), n && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n);
212
+ return { type: n, name: r };
213
+ });
214
+ }
215
+ ct.prototype = re.prototype = {
216
+ constructor: ct,
217
+ on: function(t, e) {
218
+ var n = this._, r = je(t + "", n), o, u = -1, f = r.length;
219
+ if (arguments.length < 2) {
220
+ for (; ++u < f; ) if ((o = (t = r[u]).type) && (o = Se(n[o], t.name))) return o;
221
+ return;
222
+ }
223
+ if (e != null && typeof e != "function") throw new Error("invalid callback: " + e);
224
+ for (; ++u < f; )
225
+ if (o = (t = r[u]).type) n[o] = St(n[o], t.name, e);
226
+ else if (e == null) for (o in n) n[o] = St(n[o], t.name, null);
227
+ return this;
228
+ },
229
+ copy: function() {
230
+ var t = {}, e = this._;
231
+ for (var n in e) t[n] = e[n].slice();
232
+ return new ct(t);
233
+ },
234
+ call: function(t, e) {
235
+ if ((o = arguments.length - 2) > 0) for (var n = new Array(o), r = 0, o, u; r < o; ++r) n[r] = arguments[r + 2];
236
+ if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
237
+ for (u = this._[t], r = 0, o = u.length; r < o; ++r) u[r].value.apply(e, n);
238
+ },
239
+ apply: function(t, e, n) {
240
+ if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
241
+ for (var r = this._[t], o = 0, u = r.length; o < u; ++o) r[o].value.apply(e, n);
242
+ }
243
+ };
244
+ function Se(t, e) {
245
+ for (var n = 0, r = t.length, o; n < r; ++n)
246
+ if ((o = t[n]).name === e)
247
+ return o.value;
248
+ }
249
+ function St(t, e, n) {
250
+ for (var r = 0, o = t.length; r < o; ++r)
251
+ if (t[r].name === e) {
252
+ t[r] = Xe, t = t.slice(0, r).concat(t.slice(r + 1));
253
+ break;
254
+ }
255
+ return n != null && t.push({ name: e, value: n }), t;
256
+ }
257
+ function Gt(t, e) {
258
+ let n, r;
259
+ for (const o of t)
260
+ o != null && (n === void 0 ? o >= o && (n = r = o) : (n > o && (n = o), r < o && (r = o)));
261
+ return [n, r];
262
+ }
263
+ var U = 1e-10;
264
+ function gt(t) {
265
+ return t <= U && t >= -U;
266
+ }
267
+ function it(t, e) {
268
+ return t.x * e.x + t.y * e.y + t.z * e.z;
269
+ }
270
+ function qt(t, e) {
271
+ return gt(t.x * e.y - t.y * e.x) && gt(t.y * e.z - t.z * e.y) && gt(t.z * e.x - t.x * e.z);
272
+ }
273
+ function Ge(t) {
274
+ var e, n, r, o, u, f, h, i;
275
+ if (r = t[t.length - 2], o = t[t.length - 1], u = t[0], f = ut(r, o), h = ut(o, u), n = yt(f, h), e = Math.sign(n), r = o, o = u, u = t[1], f = h, h = ut(o, u), n = yt(f, h), Math.sign(n) === e) {
276
+ for (i = 2; i < t.length - 1; i++)
277
+ if (r = o, o = u, u = t[i], f = h, h = ut(o, u), n = yt(f, h), Math.sign(n) !== e)
278
+ return;
279
+ return e;
280
+ }
281
+ }
282
+ function ut(t, e) {
283
+ return [e[0] - t[0], e[1] - t[1]];
284
+ }
285
+ function yt(t, e) {
286
+ return t[0] * e[1] - t[1] * e[0];
287
+ }
288
+ function qe(t, e) {
289
+ this.face = t, this.vert = e, this.nextf = null, this.prevf = null, this.nextv = null, this.prevv = null;
290
+ }
291
+ function $(t) {
292
+ this.forFace = t, this.head = null;
293
+ }
294
+ $.prototype.add = function(t) {
295
+ this.head === null ? this.head = t : this.forFace ? (this.head.prevv = t, t.nextv = this.head, this.head = t) : (this.head.prevf = t, t.nextf = this.head, this.head = t);
296
+ };
297
+ $.prototype.isEmpty = function() {
298
+ return this.head === null;
299
+ };
300
+ $.prototype.fill = function(t) {
301
+ if (!this.forFace) {
302
+ var e = this.head;
303
+ do
304
+ t.push(e.face), e.face.marked = !0, e = e.nextf;
305
+ while (e !== null);
306
+ }
307
+ };
308
+ $.prototype.removeAll = function() {
309
+ if (this.forFace) {
310
+ var t = this.head;
311
+ do
312
+ t.prevf === null ? t.nextf === null ? t.vert.conflicts.head = null : (t.nextf.prevf = null, t.vert.conflicts.head = t.nextf) : (t.nextf != null && (t.nextf.prevf = t.prevf), t.prevf.nextf = t.nextf), t = t.nextv, t != null && (t.prevv = null);
313
+ while (t != null);
314
+ } else {
315
+ var t = this.head;
316
+ do
317
+ t.prevv == null ? t.nextv == null ? t.face.conflicts.head = null : (t.nextv.prevv = null, t.face.conflicts.head = t.nextv) : (t.nextv != null && (t.nextv.prevv = t.prevv), t.prevv.nextv = t.nextv), t = t.nextf, t != null && (t.prevf = null);
318
+ while (t != null);
319
+ }
320
+ };
321
+ $.prototype.getVertices = function() {
322
+ for (var t = [], e = this.head; e !== null; )
323
+ t.push(e.vert), e = e.nextv;
324
+ return t;
325
+ };
326
+ function G(t, e, n, r, o, u) {
327
+ this.x = t, this.y = e, this.weight = U, this.index = 0, this.conflicts = new $(!1), this.neighbours = null, this.nonClippedPolygon = null, this.polygon = null, this.originalObject = null, this.isDummy = !1, o !== void 0 && (this.originalObject = o), u != null && (this.isDummy = u), r != null && (this.weight = r), n != null ? this.z = n : this.z = this.projectZ(this.x, this.y, this.weight);
328
+ }
329
+ G.prototype.projectZ = function(t, e, n) {
330
+ return t * t + e * e - n;
331
+ };
332
+ G.prototype.setWeight = function(t) {
333
+ this.weight = t, this.z = this.projectZ(this.x, this.y, this.weight);
334
+ };
335
+ G.prototype.subtract = function(t) {
336
+ return new G(t.x - this.x, t.y - this.y, t.z - this.z);
337
+ };
338
+ G.prototype.crossproduct = function(t) {
339
+ return new G(this.y * t.z - this.z * t.y, this.z * t.x - this.x * t.z, this.x * t.y - this.y * t.x);
340
+ };
341
+ G.prototype.equals = function(t) {
342
+ return this.x === t.x && this.y === t.y && this.z === t.z;
343
+ };
344
+ function Pt(t) {
345
+ var e = t.verts[0], n = t.verts[1], r = t.verts[2];
346
+ this.a = e.y * (n.z - r.z) + n.y * (r.z - e.z) + r.y * (e.z - n.z), this.b = e.z * (n.x - r.x) + n.z * (r.x - e.x) + r.z * (e.x - n.x), this.c = e.x * (n.y - r.y) + n.x * (r.y - e.y) + r.x * (e.y - n.y), this.d = -1 * (e.x * (n.y * r.z - r.y * n.z) + n.x * (r.y * e.z - e.y * r.z) + r.x * (e.y * n.z - n.y * e.z));
347
+ }
348
+ Pt.prototype.getNormZPlane = function() {
349
+ return [
350
+ -1 * (this.a / this.c),
351
+ -1 * (this.b / this.c),
352
+ -1 * (this.d / this.c)
353
+ ];
354
+ };
355
+ Pt.prototype.getDualPointMappedToPlane = function() {
356
+ var t = this.getNormZPlane(), e = new Ye(t[0] / 2, t[1] / 2);
357
+ return e;
358
+ };
359
+ function Ye(t, e) {
360
+ this.x = t, this.y = e;
361
+ }
362
+ function zt(t, e, n) {
363
+ this.x = t, this.y = e, this.z = n;
364
+ }
365
+ zt.prototype.negate = function() {
366
+ this.x *= -1, this.y *= -1, this.z *= -1;
367
+ };
368
+ zt.prototype.normalize = function() {
369
+ var t = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
370
+ t > 0 && (this.x /= t, this.y /= t, this.z /= t);
371
+ };
372
+ function et(t, e, n) {
373
+ this.next = null, this.prev = null, this.twin = null, this.orig = t, this.dest = e, this.iFace = n;
374
+ }
375
+ et.prototype.isHorizon = function() {
376
+ return this.twin !== null && !this.iFace.marked && this.twin.iFace.marked;
377
+ };
378
+ et.prototype.findHorizon = function(t) {
379
+ if (this.isHorizon()) {
380
+ if (t.length > 0 && this === t[0])
381
+ return;
382
+ t.push(this), this.next.findHorizon(t);
383
+ } else
384
+ this.twin !== null && this.twin.next.findHorizon(t);
385
+ };
386
+ et.prototype.isEqual = function(t, e) {
387
+ return this.orig.equals(t) && this.dest.equals(e) || this.orig.equals(e) && this.dest.equals(t);
388
+ };
389
+ function B(t) {
390
+ this.message = t, this.stack = new Error().stack;
391
+ }
392
+ B.prototype.name = "d3WeightedVoronoiError";
393
+ B.prototype = new Error();
394
+ function H(t, e, n, r) {
395
+ this.conflicts = new $(!0), this.verts = [t, e, n], this.marked = !1;
396
+ var o = t.subtract(e).crossproduct(e.subtract(n));
397
+ this.normal = new zt(-o.x, -o.y, -o.z), this.normal.normalize(), this.createEdges(), this.dualPoint = null, r != null && this.orient(r);
398
+ }
399
+ H.prototype.getDualPoint = function() {
400
+ if (this.dualPoint == null) {
401
+ var t = new Pt(this);
402
+ this.dualPoint = t.getDualPointMappedToPlane();
403
+ }
404
+ return this.dualPoint;
405
+ };
406
+ H.prototype.isVisibleFromBelow = function() {
407
+ return this.normal.z < -14259414393190911e-25;
408
+ };
409
+ H.prototype.createEdges = function() {
410
+ this.edges = [], this.edges[0] = new et(this.verts[0], this.verts[1], this), this.edges[1] = new et(this.verts[1], this.verts[2], this), this.edges[2] = new et(this.verts[2], this.verts[0], this), this.edges[0].next = this.edges[1], this.edges[0].prev = this.edges[2], this.edges[1].next = this.edges[2], this.edges[1].prev = this.edges[0], this.edges[2].next = this.edges[0], this.edges[2].prev = this.edges[1];
411
+ };
412
+ H.prototype.orient = function(t) {
413
+ if (!(it(this.normal, t) < it(this.normal, this.verts[0]))) {
414
+ var e = this.verts[1];
415
+ this.verts[1] = this.verts[2], this.verts[2] = e, this.normal.negate(), this.createEdges();
416
+ }
417
+ };
418
+ H.prototype.getEdge = function(t, e) {
419
+ for (var n = 0; n < 3; n++)
420
+ if (this.edges[n].isEqual(t, e))
421
+ return this.edges[n];
422
+ return null;
423
+ };
424
+ H.prototype.link = function(t, e, n) {
425
+ if (t instanceof H) {
426
+ var r = t.getEdge(e, n);
427
+ if (r === null)
428
+ throw new B("when linking, twin is null");
429
+ var o = this.getEdge(e, n);
430
+ if (o === null)
431
+ throw new B("when linking, twin is null");
432
+ r.twin = o, o.twin = r;
433
+ } else {
434
+ var r = t, o = this.getEdge(r.orig, r.dest);
435
+ r.twin = o, o.twin = r;
436
+ }
437
+ };
438
+ H.prototype.conflict = function(t) {
439
+ return it(this.normal, t) > it(this.normal, this.verts[0]) + U;
440
+ };
441
+ H.prototype.getHorizon = function() {
442
+ for (var t = 0; t < 3; t++)
443
+ if (this.edges[t].twin !== null && this.edges[t].twin.isHorizon())
444
+ return this.edges[t];
445
+ return null;
446
+ };
447
+ H.prototype.removeConflict = function() {
448
+ this.conflicts.removeAll();
449
+ };
450
+ function q() {
451
+ this.points = [], this.facets = [], this.created = [], this.horizon = [], this.visible = [], this.current = 0;
452
+ }
453
+ q.prototype.init = function(t, e) {
454
+ this.points = [];
455
+ for (var n = 0; n < e.length; n++)
456
+ this.points[n] = new G(e[n].x, e[n].y, e[n].z, null, e[n], !1);
457
+ this.points = this.points.concat(t);
458
+ };
459
+ q.prototype.permutate = function() {
460
+ for (var t = this.points.length, e = t - 1; e > 0; e--) {
461
+ var n = Math.floor(Math.random() * e), r = this.points[n];
462
+ r.index = e;
463
+ var o = this.points[e];
464
+ o.index = n, this.points.splice(n, 1, o), this.points.splice(e, 1, r);
465
+ }
466
+ };
467
+ q.prototype.prep = function() {
468
+ if (this.points.length <= 3)
469
+ throw new B("Less than 4 points");
470
+ for (var t = 0; t < this.points.length; t++)
471
+ this.points[t].index = t;
472
+ var e, n, r, o, u, f, h, i;
473
+ e = this.points[0], n = this.points[1], r = o = null;
474
+ for (var t = 2; t < this.points.length; t++)
475
+ if (!(qt(e, this.points[t]) && qt(n, this.points[t]))) {
476
+ r = this.points[t], r.index = 2, this.points[2].index = t, this.points.splice(t, 1, this.points[2]), this.points.splice(2, 1, r);
477
+ break;
478
+ }
479
+ if (r === null)
480
+ throw new B("Not enough non-planar Points (v2 is null)");
481
+ i = new H(e, n, r);
482
+ for (var t = 3; t < this.points.length; t++)
483
+ if (!gt(it(i.normal, i.verts[0]) - it(i.normal, this.points[t]))) {
484
+ o = this.points[t], o.index = 3, this.points[3].index = t, this.points.splice(t, 1, this.points[3]), this.points.splice(3, 1, o);
485
+ break;
486
+ }
487
+ if (o === null)
488
+ throw new B("Not enough non-planar Points (v3 is null)");
489
+ i.orient(o), u = new H(e, r, o, n), f = new H(e, n, o, r), h = new H(n, r, o, e), this.addFacet(i), this.addFacet(u), this.addFacet(f), this.addFacet(h), i.link(u, e, r), i.link(f, e, n), i.link(h, n, r), u.link(f, e, o), u.link(h, r, o), f.link(h, o, n), this.current = 4;
490
+ for (var s, t = this.current; t < this.points.length; t++)
491
+ s = this.points[t], i.conflict(s) && this.addConflict(i, s), u.conflict(s) && this.addConflict(u, s), f.conflict(s) && this.addConflict(f, s), h.conflict(s) && this.addConflict(h, s);
492
+ }, // IN: Faces old1 old2 and fn
493
+ q.prototype.addConflicts = function(t, e, n) {
494
+ var r = t.conflicts.getVertices(), o = e.conflicts.getVertices(), u = [], f, h, i, s;
495
+ for (i = s = 0; i < r.length || s < o.length; )
496
+ i < r.length && s < o.length ? (f = r[i], h = o[s], f.index === h.index ? (u.push(f), i++, s++) : f.index > h.index ? (u.push(f), i++) : (u.push(h), s++)) : i < r.length ? u.push(r[i++]) : u.push(o[s++]);
497
+ for (var i = u.length - 1; i >= 0; i--)
498
+ f = u[i], n.conflict(f) && this.addConflict(n, f);
499
+ };
500
+ q.prototype.addConflict = function(t, e) {
501
+ var n = new qe(t, e);
502
+ t.conflicts.add(n), e.conflicts.add(n);
503
+ };
504
+ q.prototype.removeConflict = function(t) {
505
+ t.removeConflict();
506
+ var e = t.index;
507
+ if (t.index = -1, e === this.facets.length - 1) {
508
+ this.facets.splice(this.facets.length - 1, 1);
509
+ return;
510
+ }
511
+ if (!(e >= this.facets.length || e < 0)) {
512
+ var n = this.facets.splice(this.facets.length - 1, 1);
513
+ n[0].index = e, this.facets.splice(e, 1, n[0]);
514
+ }
515
+ };
516
+ q.prototype.addFacet = function(t) {
517
+ t.index = this.facets.length, this.facets.push(t);
518
+ };
519
+ q.prototype.compute = function() {
520
+ for (this.prep(); this.current < this.points.length; ) {
521
+ var t = this.points[this.current];
522
+ if (t.conflicts.isEmpty()) {
523
+ this.current++;
524
+ continue;
525
+ }
526
+ this.created = [], this.horizon = [], this.visible = [], t.conflicts.fill(this.visible);
527
+ for (var e, n = 0; n < this.visible.length; n++)
528
+ if (e = this.visible[n].getHorizon(), e !== null) {
529
+ e.findHorizon(this.horizon);
530
+ break;
531
+ }
532
+ for (var r = null, o = null, u = 0; u < this.horizon.length; u++) {
533
+ var f = this.horizon[u], h = new H(t, f.orig, f.dest, f.twin.next.dest);
534
+ h.conflicts = new $(!0), this.addFacet(h), this.created.push(h), this.addConflicts(f.iFace, f.twin.iFace, h), h.link(f), r !== null && h.link(r, t, f.orig), r = h, o === null && (o = h);
535
+ }
536
+ if (o !== null && r !== null && r.link(o, t, this.horizon[0].orig), this.created.length != 0) {
537
+ for (var i = 0; i < this.visible.length; i++)
538
+ this.removeConflict(this.visible[i]);
539
+ this.current++, this.created = [];
540
+ }
541
+ }
542
+ return this.facets;
543
+ };
544
+ q.prototype.clear = function() {
545
+ this.points = [], this.facets = [], this.created = [], this.horizon = [], this.visible = [], this.current = 0;
546
+ };
547
+ function Ue(t, e) {
548
+ for (var n, r = Ut(e), o = -1, u = t.length - Ut(t), f, h, i = t[u - 1], s, c, a, l; ++o < u; ) {
549
+ for (n = e.slice(), e.length = 0, s = t[o], c = n[(h = n.length - r) - 1], f = -1; ++f < h; )
550
+ a = n[f], bt(a, i, s) ? (bt(c, i, s) || (l = Yt(c, a, i, s), isFinite(l[0]) && e.push(l)), e.push(a)) : bt(c, i, s) && (l = Yt(c, a, i, s), isFinite(l[0]) && e.push(l)), c = a;
551
+ r && e.push(e[0]), i = s;
552
+ }
553
+ return e;
554
+ }
555
+ function bt(t, e, n) {
556
+ return (n[0] - e[0]) * (t[1] - e[1]) < (n[1] - e[1]) * (t[0] - e[0]);
557
+ }
558
+ function Yt(t, e, n, r) {
559
+ var o = t[0], u = n[0], f = e[0] - o, h = r[0] - u, i = t[1], s = n[1], c = e[1] - i, a = r[1] - s, l = (h * (i - s) - a * (o - u)) / (a * f - h * c);
560
+ return [o + l * f, i + l * c];
561
+ }
562
+ function Ut(t) {
563
+ var e = t[0], n = t[t.length - 1];
564
+ return !(e[0] - n[0] || e[1] - n[1]);
565
+ }
566
+ function $e(t) {
567
+ var e = [], n = t, r = t.dest, o = r.originalObject, u = [];
568
+ do {
569
+ n = n.twin.prev;
570
+ var f = n.orig.originalObject;
571
+ f.isDummy || u.push(f);
572
+ var h = n.iFace;
573
+ h.isVisibleFromBelow() && e.push(h);
574
+ } while (n !== t);
575
+ return o.neighbours = u, e;
576
+ }
577
+ function Be(t, e, n) {
578
+ var r = new q();
579
+ r.clear(), r.init(e, t);
580
+ for (var o = r.compute(t), u = [], f = [], h = o.length, i = 0; i < h; i++) {
581
+ var s = o[i];
582
+ if (s.isVisibleFromBelow())
583
+ for (var c = 0; c < 3; c++) {
584
+ var a = s.edges[c], l = a.dest, g = l.originalObject;
585
+ if (!f[l.index]) {
586
+ if (f[l.index] = !0, g.isDummy)
587
+ continue;
588
+ for (var v = $e(a), p = [], y = null, C = null, m = 1, k = 1, x = 0; x < v.length; x++) {
589
+ var w = v[x].getDualPoint(), A = w.x, b = w.y;
590
+ y !== null && (m = y - A, k = C - b, m < 0 && (m = -m), k < 0 && (k = -k)), (m > U || k > U) && (p.push([A, b]), y = A, C = b);
591
+ }
592
+ if (g.nonClippedPolygon = p.reverse(), !g.isDummy && We(g.nonClippedPolygon) > 0) {
593
+ var D = Ue(n, g.nonClippedPolygon);
594
+ g.polygon = D, D.site = g, D.length > 0 && u.push(D);
595
+ }
596
+ }
597
+ }
598
+ }
599
+ return u;
600
+ }
601
+ function Ze() {
602
+ var t = function(i) {
603
+ return i.x;
604
+ }, e = function(i) {
605
+ return i.y;
606
+ }, n = function(i) {
607
+ return i.weight;
608
+ }, r = [
609
+ [0, 0],
610
+ [0, 1],
611
+ [1, 1],
612
+ [1, 0]
613
+ ], o = [
614
+ [0, 0],
615
+ [1, 1]
616
+ ], u = [1, 1];
617
+ function f(i) {
618
+ var s;
619
+ return s = i.map(function(c) {
620
+ return new G(t(c), e(c), null, n(c), c, !1);
621
+ }), Be(s, h(), r);
622
+ }
623
+ f.x = function(i) {
624
+ return arguments.length ? (t = i, f) : t;
625
+ }, f.y = function(i) {
626
+ return arguments.length ? (e = i, f) : e;
627
+ }, f.weight = function(i) {
628
+ return arguments.length ? (n = i, f) : n;
629
+ }, f.clip = function(i) {
630
+ var s, c, a;
631
+ return arguments.length ? (c = Gt(
632
+ i.map(function(l) {
633
+ return l[0];
634
+ })
635
+ ), a = Gt(
636
+ i.map(function(l) {
637
+ return l[1];
638
+ })
639
+ ), s = Ge(i), s === void 0 ? r = Fe(i) : s === 1 ? r = i.reverse() : r = i, o = [
640
+ [c[0], a[0]],
641
+ [c[1], a[1]]
642
+ ], u = [c[1] - c[0], a[1] - a[0]], f) : r;
643
+ }, f.extent = function(i) {
644
+ return arguments.length ? (r = [i[0], [i[0][0], i[1][1]], i[1], [i[1][0], i[0][1]]], o = i, u = [i[1][0] - i[0][0], i[1][1] - i[0][1]], f) : o;
645
+ }, f.size = function(i) {
646
+ return arguments.length ? (r = [
647
+ [0, 0],
648
+ [0, i[1]],
649
+ [i[0], i[1]],
650
+ [i[0], 0]
651
+ ], o = [[0, 0], i], u = i, f) : u;
652
+ };
653
+ function h() {
654
+ var i, s, c, a, l, g, v, p, y, C, m = [], k = [];
655
+ i = o[0][0], s = o[1][0], c = o[0][1], a = o[1][1], l = s - i, g = a - c, v = i - l, p = s + l, y = c - g, C = a + g, m[0] = [v, y], m[1] = [v, C], m[2] = [p, C], m[3] = [p, y];
656
+ for (var x = 0; x < 4; x++)
657
+ k.push(
658
+ new G(
659
+ m[x][0],
660
+ m[x][1],
661
+ null,
662
+ U,
663
+ new G(m[x][0], m[x][1], null, U, null, !0),
664
+ !0
665
+ )
666
+ );
667
+ return k;
668
+ }
669
+ return f;
670
+ }
671
+ function J() {
672
+ this.growthChangesLength = oe, this.totalAvailableArea = NaN, this.lastAreaError = NaN, this.lastGrowth = NaN, this.growthChanges = [], this.growthChangeWeights = _t(this.growthChangesLength), this.growthChangeWeightsSum = Dt(this.growthChangeWeights);
673
+ }
674
+ var oe = 10;
675
+ function Ke(t, e) {
676
+ return t >= e ? 1 : -1;
677
+ }
678
+ function _t(t) {
679
+ for (var e = 3, n = 1, r = 1, o = e, u = [], f = 0; f < t; f++)
680
+ u.push(o), o -= n, o < r && (o = r);
681
+ return u;
682
+ }
683
+ function Dt(t) {
684
+ for (var e = 0, n = 0; n < t.length; n++)
685
+ e += t[n];
686
+ return e;
687
+ }
688
+ J.prototype.reset = function() {
689
+ return this.lastAreaError = NaN, this.lastGrowth = NaN, this.growthChanges = [], this.growthChangesLength = oe, this.growthChangeWeights = _t(this.growthChangesLength), this.growthChangeWeightsSum = Dt(this.growthChangeWeights), this.totalAvailableArea = NaN, this;
690
+ };
691
+ J.prototype.clear = function() {
692
+ return this.lastAreaError = NaN, this.lastGrowth = NaN, this.growthChanges = [], this;
693
+ };
694
+ J.prototype.length = function(t) {
695
+ return arguments.length ? (parseInt(t) > 0 ? (this.growthChangesLength = Math.floor(parseInt(t)), this.growthChangeWeights = _t(this.growthChangesLength), this.growthChangeWeightsSum = Dt(this.growthChangeWeights)) : console.warn("FlickeringMitigation.length() accepts only positive integers; unable to handle " + t), this) : this.growthChangesLength;
696
+ };
697
+ J.prototype.totalArea = function(t) {
698
+ return arguments.length ? (parseFloat(t) > 0 ? this.totalAvailableArea = parseFloat(t) : console.warn("FlickeringMitigation.totalArea() accepts only positive numbers; unable to handle " + t), this) : this.totalAvailableArea;
699
+ };
700
+ J.prototype.add = function(t) {
701
+ var e, n;
702
+ return e = this.lastAreaError, this.lastAreaError = t, isNaN(e) || (n = this.lastGrowth, this.lastGrowth = Ke(this.lastAreaError, e)), isNaN(n) || this.growthChanges.unshift(this.lastGrowth != n), this.growthChanges.length > this.growthChangesLength && this.growthChanges.pop(), this;
703
+ };
704
+ J.prototype.ratio = function() {
705
+ var t = 0, e;
706
+ if (this.growthChanges.length < this.growthChangesLength || this.lastAreaError > this.totalAvailableArea / 10)
707
+ return 0;
708
+ for (var n = 0; n < this.growthChangesLength; n++)
709
+ this.growthChanges[n] && (t += this.growthChangeWeights[n]);
710
+ return e = t / this.growthChangeWeightsSum, e;
711
+ };
712
+ function Je() {
713
+ var t, e, n, r, o, u, f, h;
714
+ function i(c, a, l, g) {
715
+ var v = !1, p, y;
716
+ for (t !== g.clip() && (t = g.clip(), e = g.extent(), v = !0), v && s(), p = n + f * g.prng()(), y = o + h * g.prng()(); !Qt(t, [p, y]); )
717
+ p = n + f * g.prng()(), y = o + h * g.prng()();
718
+ return [p, y];
719
+ }
720
+ function s() {
721
+ n = e[0][0], r = e[1][0], o = e[0][1], u = e[1][1], f = r - n, h = u - o;
722
+ }
723
+ return i;
724
+ }
725
+ function Qe() {
726
+ var t, e, n, r, o;
727
+ function u(h, i, s, c) {
728
+ var a = !1;
729
+ return t !== c.clip() && (t = c.clip(), a |= !0), e !== s && (e = s, a |= !0), a && f(), o;
730
+ }
731
+ function f() {
732
+ n = e.length, r = ft(t), o = r / n / 2;
733
+ }
734
+ return u;
735
+ }
736
+ function tt(t) {
737
+ this.message = t, this.stack = new Error().stack;
738
+ }
739
+ tt.prototype.name = "d3VoronoiMapError";
740
+ tt.prototype = new Error();
741
+ function $t(t) {
742
+ var e = 0.01, n = 50, r = 0.01, o = Math.random, u = Je(), f = Qe(), h = 1e-10, i = function(d) {
743
+ return d.weight;
744
+ }, s = e, c = n, a = r, l = o, g = u, v = f, p = Ze(), y = new J(), C = !0, m, k, x, w, A, b, D, F, P, R = ie(Ft), V = re("tick", "end");
745
+ const X = 1, j = 1e3;
746
+ var S;
747
+ function Y(d) {
748
+ return Math.pow(d, 2);
749
+ }
750
+ function Ot(d, I) {
751
+ return Y(I.x - d.x) + Y(I.y - d.y);
752
+ }
753
+ P = {
754
+ tick: Wt,
755
+ restart: function() {
756
+ return R.restart(Ft), P;
757
+ },
758
+ stop: function() {
759
+ return R.stop(), P;
760
+ },
761
+ weight: function(d) {
762
+ return arguments.length ? (i = d, C = !0, P) : i;
763
+ },
764
+ convergenceRatio: function(d) {
765
+ return arguments.length ? (s = d, C = !0, P) : s;
766
+ },
767
+ maxIterationCount: function(d) {
768
+ return arguments.length ? (c = d, P) : c;
769
+ },
770
+ minWeightRatio: function(d) {
771
+ return arguments.length ? (a = d, C = !0, P) : a;
772
+ },
773
+ clip: function(d) {
774
+ return arguments.length ? (p.clip(d), C = !0, P) : p.clip();
775
+ },
776
+ extent: function(d) {
777
+ return arguments.length ? (p.extent(d), C = !0, P) : p.extent();
778
+ },
779
+ size: function(d) {
780
+ return arguments.length ? (p.size(d), C = !0, P) : p.size();
781
+ },
782
+ prng: function(d) {
783
+ return arguments.length ? (l = d, C = !0, P) : l;
784
+ },
785
+ initialPosition: function(d) {
786
+ return arguments.length ? (g = d, C = !0, P) : g;
787
+ },
788
+ initialWeight: function(d) {
789
+ return arguments.length ? (v = d, C = !0, P) : v;
790
+ },
791
+ state: function() {
792
+ return C && Rt(), {
793
+ ended: F,
794
+ iterationCount: w,
795
+ convergenceRatio: b / k,
796
+ polygons: A
797
+ };
798
+ },
799
+ on: function(d, I) {
800
+ return arguments.length === 1 ? V.on(d) : (V.on(d, I), P);
801
+ }
802
+ };
803
+ function Ft() {
804
+ Wt(), V.call("tick", P), F && (R.stop(), V.call("end", P));
805
+ }
806
+ function Wt() {
807
+ F || (C && Rt(), A = le(A, y.ratio()), w++, b = ge(A), y.add(b), D = b < x, F = D || w >= c);
808
+ }
809
+ function Rt() {
810
+ pe(), m = t.length, k = Math.abs(ft(p.clip())), x = s * k, y.clear().totalArea(k), w = 0, D = !1, A = ae(t, P), F = !1, C = !1;
811
+ }
812
+ function ae(d, I) {
813
+ var N = d.reduce(function(T, M) {
814
+ return Math.max(T, i(M));
815
+ }, -1 / 0), _ = N * a, z, E;
816
+ return z = d.map(function(T, M, O) {
817
+ return {
818
+ index: M,
819
+ weight: Math.max(i(T), _),
820
+ initialPosition: g(T, M, O, I),
821
+ initialWeight: v(T, M, O, I),
822
+ originalData: T
823
+ };
824
+ }), E = he(z, I), S(E), p(E);
825
+ }
826
+ function he(d, I) {
827
+ var N = d.reduce(function(z, E) {
828
+ return z += E.weight;
829
+ }, 0), _;
830
+ return d.map(function(z, E, T) {
831
+ return _ = z.initialPosition, Qt(p.clip(), _) || (_ = u(z, E, T, I)), {
832
+ index: z.index,
833
+ targetedArea: k * z.weight / N,
834
+ data: z,
835
+ x: _[0],
836
+ y: _[1],
837
+ weight: z.initialWeight
838
+ // ArlindNocaj/Voronoi-Treemap-Library uses an epsilonesque initial weight; using heavier initial weights allows faster weight adjustements, hence faster stabilization
839
+ };
840
+ });
841
+ }
842
+ function le(d, I) {
843
+ var N;
844
+ if (ue(d, I), N = d.map(function(_) {
845
+ return _.site.originalObject;
846
+ }), d = p(N), d.length < m)
847
+ throw new tt("at least 1 site has no area, which is not supposed to arise");
848
+ if (fe(d, I), N = d.map(function(_) {
849
+ return _.site.originalObject;
850
+ }), d = p(N), d.length < m)
851
+ throw new tt("at least 1 site has no area, which is not supposed to arise");
852
+ return d;
853
+ }
854
+ function ue(d, I) {
855
+ var N = [], _ = 0.5, z, E, T, M, O, W, L;
856
+ z = _ * I, E = 1 - z;
857
+ for (var mt = 0; mt < m; mt++)
858
+ T = d[mt], M = T.site.originalObject, O = Ie(T), W = O[0] - M.x, L = O[1] - M.y, W *= E, L *= E, M.x += W, M.y += L, N.push(M);
859
+ S(N);
860
+ }
861
+ function fe(d, I) {
862
+ var N = [], _ = 0.1, z, E, T, M, O, W;
863
+ z = _ * I;
864
+ for (var L = 0; L < m; L++)
865
+ E = d[L], T = E.site.originalObject, M = ft(E), O = T.targetedArea / M, O = Math.max(O, 1 - _ + z), O = Math.min(O, 1 + _ - z), W = T.weight * O, W = Math.max(W, h), T.weight = W, N.push(T);
866
+ S(N);
867
+ }
868
+ function Lt(d) {
869
+ var I = 0, N, _, z, E, T, M, O;
870
+ do {
871
+ if (I > j)
872
+ throw new tt("handleOverweighted0 is looping too much");
873
+ N = !1;
874
+ for (var W = 0; W < m; W++) {
875
+ _ = d[W];
876
+ for (var L = W + 1; L < m; L++)
877
+ if (z = d[L], _.weight > z.weight ? (E = _, T = z) : (E = z, T = _), M = Ot(_, z), M < E.weight - T.weight) {
878
+ O = M + T.weight / 2, O = Math.max(O, h), E.weight = O, N = !0, I++;
879
+ break;
880
+ }
881
+ if (N)
882
+ break;
883
+ }
884
+ } while (N);
885
+ }
886
+ function ce(d) {
887
+ var I = 0, N, _, z, E, T, M, O;
888
+ do {
889
+ if (I > j)
890
+ throw new tt("handleOverweighted1 is looping too much");
891
+ N = !1;
892
+ for (var W = 0; W < m; W++) {
893
+ _ = d[W];
894
+ for (var L = W + 1; L < m; L++)
895
+ if (z = d[L], _.weight > z.weight ? (E = _, T = z) : (E = z, T = _), M = Ot(_, z), M < E.weight - T.weight) {
896
+ O = E.weight - T.weight - M, T.weight += O + h, N = !0, I++;
897
+ break;
898
+ }
899
+ if (N)
900
+ break;
901
+ }
902
+ } while (N);
903
+ }
904
+ function ge(d) {
905
+ for (var I = 0, N, _, z, E = 0; E < m; E++)
906
+ N = d[E], _ = N.site.originalObject, z = ft(N), I += Math.abs(_.targetedArea - z);
907
+ return I;
908
+ }
909
+ function pe() {
910
+ switch (X) {
911
+ case 0:
912
+ S = Lt;
913
+ break;
914
+ case 1:
915
+ S = ce;
916
+ break;
917
+ default:
918
+ console.error("unknown 'handleOverweighted' variant; using variant #1"), S = Lt;
919
+ }
920
+ }
921
+ return P;
922
+ }
923
+ function tn() {
924
+ var t = 0.01, e = 50, n = 0.01, r = Math.random, o = [
925
+ [0, 0],
926
+ [0, 1],
927
+ [1, 1],
928
+ [1, 0]
929
+ ], u = [
930
+ [0, 0],
931
+ [1, 1]
932
+ ], f = [1, 1], h = t, i = e, s = n, c = r, a = [
933
+ {
934
+ weight: 1
935
+ },
936
+ {
937
+ weight: 1
938
+ }
939
+ ], l = $t(a).stop();
940
+ function g(p) {
941
+ v(o, p);
942
+ }
943
+ g.convergenceRatio = function(p) {
944
+ return arguments.length ? (h = p, g) : h;
945
+ }, g.maxIterationCount = function(p) {
946
+ return arguments.length ? (i = p, g) : i;
947
+ }, g.minWeightRatio = function(p) {
948
+ return arguments.length ? (s = p, g) : s;
949
+ }, g.clip = function(p) {
950
+ return arguments.length ? (l.clip(p), o = l.clip(), u = l.extent(), f = l.size(), g) : o;
951
+ }, g.extent = function(p) {
952
+ return arguments.length ? (l.extent(p), o = l.clip(), u = l.extent(), f = l.size(), g) : u;
953
+ }, g.size = function(p) {
954
+ return arguments.length ? (l.size(p), o = l.clip(), u = l.extent(), f = l.size(), g) : f;
955
+ }, g.prng = function(p) {
956
+ return arguments.length ? (c = p, g) : c;
957
+ };
958
+ function v(p, y) {
959
+ var C;
960
+ if (y.polygon = p, y.height != 0) {
961
+ C = $t(y.children).clip(p).weight(function(k) {
962
+ return k.value;
963
+ }).convergenceRatio(h).maxIterationCount(i).minWeightRatio(s).prng(c).stop();
964
+ for (var m = C.state(); !m.ended; )
965
+ C.tick(), m = C.state();
966
+ m.polygons.forEach(function(k) {
967
+ v(k, k.site.originalObject.data.originalData);
968
+ });
969
+ }
970
+ }
971
+ return g;
972
+ }
973
+ var Et = { exports: {} };
974
+ Et.exports;
975
+ (function(t) {
976
+ (function(e, n, r) {
977
+ function o(i) {
978
+ var s = this, c = h();
979
+ s.next = function() {
980
+ var a = 2091639 * s.s0 + s.c * 23283064365386963e-26;
981
+ return s.s0 = s.s1, s.s1 = s.s2, s.s2 = a - (s.c = a | 0);
982
+ }, s.c = 1, s.s0 = c(" "), s.s1 = c(" "), s.s2 = c(" "), s.s0 -= c(i), s.s0 < 0 && (s.s0 += 1), s.s1 -= c(i), s.s1 < 0 && (s.s1 += 1), s.s2 -= c(i), s.s2 < 0 && (s.s2 += 1), c = null;
983
+ }
984
+ function u(i, s) {
985
+ return s.c = i.c, s.s0 = i.s0, s.s1 = i.s1, s.s2 = i.s2, s;
986
+ }
987
+ function f(i, s) {
988
+ var c = new o(i), a = s && s.state, l = c.next;
989
+ return l.int32 = function() {
990
+ return c.next() * 4294967296 | 0;
991
+ }, l.double = function() {
992
+ return l() + (l() * 2097152 | 0) * 11102230246251565e-32;
993
+ }, l.quick = l, a && (typeof a == "object" && u(a, c), l.state = function() {
994
+ return u(c, {});
995
+ }), l;
996
+ }
997
+ function h() {
998
+ var i = 4022871197, s = function(c) {
999
+ c = String(c);
1000
+ for (var a = 0; a < c.length; a++) {
1001
+ i += c.charCodeAt(a);
1002
+ var l = 0.02519603282416938 * i;
1003
+ i = l >>> 0, l -= i, l *= i, i = l >>> 0, l -= i, i += l * 4294967296;
1004
+ }
1005
+ return (i >>> 0) * 23283064365386963e-26;
1006
+ };
1007
+ return s;
1008
+ }
1009
+ n && n.exports ? n.exports = f : this.alea = f;
1010
+ })(
1011
+ K,
1012
+ t
1013
+ );
1014
+ })(Et);
1015
+ var en = Et.exports, Tt = { exports: {} };
1016
+ Tt.exports;
1017
+ (function(t) {
1018
+ (function(e, n, r) {
1019
+ function o(h) {
1020
+ var i = this, s = "";
1021
+ i.x = 0, i.y = 0, i.z = 0, i.w = 0, i.next = function() {
1022
+ var a = i.x ^ i.x << 11;
1023
+ return i.x = i.y, i.y = i.z, i.z = i.w, i.w ^= i.w >>> 19 ^ a ^ a >>> 8;
1024
+ }, h === (h | 0) ? i.x = h : s += h;
1025
+ for (var c = 0; c < s.length + 64; c++)
1026
+ i.x ^= s.charCodeAt(c) | 0, i.next();
1027
+ }
1028
+ function u(h, i) {
1029
+ return i.x = h.x, i.y = h.y, i.z = h.z, i.w = h.w, i;
1030
+ }
1031
+ function f(h, i) {
1032
+ var s = new o(h), c = i && i.state, a = function() {
1033
+ return (s.next() >>> 0) / 4294967296;
1034
+ };
1035
+ return a.double = function() {
1036
+ do
1037
+ var l = s.next() >>> 11, g = (s.next() >>> 0) / 4294967296, v = (l + g) / (1 << 21);
1038
+ while (v === 0);
1039
+ return v;
1040
+ }, a.int32 = s.next, a.quick = a, c && (typeof c == "object" && u(c, s), a.state = function() {
1041
+ return u(s, {});
1042
+ }), a;
1043
+ }
1044
+ n && n.exports ? n.exports = f : this.xor128 = f;
1045
+ })(
1046
+ K,
1047
+ t
1048
+ );
1049
+ })(Tt);
1050
+ var nn = Tt.exports, kt = { exports: {} };
1051
+ kt.exports;
1052
+ (function(t) {
1053
+ (function(e, n, r) {
1054
+ function o(h) {
1055
+ var i = this, s = "";
1056
+ i.next = function() {
1057
+ var a = i.x ^ i.x >>> 2;
1058
+ return i.x = i.y, i.y = i.z, i.z = i.w, i.w = i.v, (i.d = i.d + 362437 | 0) + (i.v = i.v ^ i.v << 4 ^ (a ^ a << 1)) | 0;
1059
+ }, i.x = 0, i.y = 0, i.z = 0, i.w = 0, i.v = 0, h === (h | 0) ? i.x = h : s += h;
1060
+ for (var c = 0; c < s.length + 64; c++)
1061
+ i.x ^= s.charCodeAt(c) | 0, c == s.length && (i.d = i.x << 10 ^ i.x >>> 4), i.next();
1062
+ }
1063
+ function u(h, i) {
1064
+ return i.x = h.x, i.y = h.y, i.z = h.z, i.w = h.w, i.v = h.v, i.d = h.d, i;
1065
+ }
1066
+ function f(h, i) {
1067
+ var s = new o(h), c = i && i.state, a = function() {
1068
+ return (s.next() >>> 0) / 4294967296;
1069
+ };
1070
+ return a.double = function() {
1071
+ do
1072
+ var l = s.next() >>> 11, g = (s.next() >>> 0) / 4294967296, v = (l + g) / (1 << 21);
1073
+ while (v === 0);
1074
+ return v;
1075
+ }, a.int32 = s.next, a.quick = a, c && (typeof c == "object" && u(c, s), a.state = function() {
1076
+ return u(s, {});
1077
+ }), a;
1078
+ }
1079
+ n && n.exports ? n.exports = f : this.xorwow = f;
1080
+ })(
1081
+ K,
1082
+ t
1083
+ );
1084
+ })(kt);
1085
+ var rn = kt.exports, Nt = { exports: {} };
1086
+ Nt.exports;
1087
+ (function(t) {
1088
+ (function(e, n, r) {
1089
+ function o(h) {
1090
+ var i = this;
1091
+ i.next = function() {
1092
+ var c = i.x, a = i.i, l, g;
1093
+ return l = c[a], l ^= l >>> 7, g = l ^ l << 24, l = c[a + 1 & 7], g ^= l ^ l >>> 10, l = c[a + 3 & 7], g ^= l ^ l >>> 3, l = c[a + 4 & 7], g ^= l ^ l << 7, l = c[a + 7 & 7], l = l ^ l << 13, g ^= l ^ l << 9, c[a] = g, i.i = a + 1 & 7, g;
1094
+ };
1095
+ function s(c, a) {
1096
+ var l, g = [];
1097
+ if (a === (a | 0))
1098
+ g[0] = a;
1099
+ else
1100
+ for (a = "" + a, l = 0; l < a.length; ++l)
1101
+ g[l & 7] = g[l & 7] << 15 ^ a.charCodeAt(l) + g[l + 1 & 7] << 13;
1102
+ for (; g.length < 8; ) g.push(0);
1103
+ for (l = 0; l < 8 && g[l] === 0; ++l) ;
1104
+ for (l == 8 ? g[7] = -1 : g[l], c.x = g, c.i = 0, l = 256; l > 0; --l)
1105
+ c.next();
1106
+ }
1107
+ s(i, h);
1108
+ }
1109
+ function u(h, i) {
1110
+ return i.x = h.x.slice(), i.i = h.i, i;
1111
+ }
1112
+ function f(h, i) {
1113
+ h == null && (h = +/* @__PURE__ */ new Date());
1114
+ var s = new o(h), c = i && i.state, a = function() {
1115
+ return (s.next() >>> 0) / 4294967296;
1116
+ };
1117
+ return a.double = function() {
1118
+ do
1119
+ var l = s.next() >>> 11, g = (s.next() >>> 0) / 4294967296, v = (l + g) / (1 << 21);
1120
+ while (v === 0);
1121
+ return v;
1122
+ }, a.int32 = s.next, a.quick = a, c && (c.x && u(c, s), a.state = function() {
1123
+ return u(s, {});
1124
+ }), a;
1125
+ }
1126
+ n && n.exports ? n.exports = f : this.xorshift7 = f;
1127
+ })(
1128
+ K,
1129
+ t
1130
+ );
1131
+ })(Nt);
1132
+ var on = Nt.exports, It = { exports: {} };
1133
+ It.exports;
1134
+ (function(t) {
1135
+ (function(e, n, r) {
1136
+ function o(h) {
1137
+ var i = this;
1138
+ i.next = function() {
1139
+ var c = i.w, a = i.X, l = i.i, g, v;
1140
+ return i.w = c = c + 1640531527 | 0, v = a[l + 34 & 127], g = a[l = l + 1 & 127], v ^= v << 13, g ^= g << 17, v ^= v >>> 15, g ^= g >>> 12, v = a[l] = v ^ g, i.i = l, v + (c ^ c >>> 16) | 0;
1141
+ };
1142
+ function s(c, a) {
1143
+ var l, g, v, p, y, C = [], m = 128;
1144
+ for (a === (a | 0) ? (g = a, a = null) : (a = a + "\0", g = 0, m = Math.max(m, a.length)), v = 0, p = -32; p < m; ++p)
1145
+ a && (g ^= a.charCodeAt((p + 32) % a.length)), p === 0 && (y = g), g ^= g << 10, g ^= g >>> 15, g ^= g << 4, g ^= g >>> 13, p >= 0 && (y = y + 1640531527 | 0, l = C[p & 127] ^= g + y, v = l == 0 ? v + 1 : 0);
1146
+ for (v >= 128 && (C[(a && a.length || 0) & 127] = -1), v = 127, p = 4 * 128; p > 0; --p)
1147
+ g = C[v + 34 & 127], l = C[v = v + 1 & 127], g ^= g << 13, l ^= l << 17, g ^= g >>> 15, l ^= l >>> 12, C[v] = g ^ l;
1148
+ c.w = y, c.X = C, c.i = v;
1149
+ }
1150
+ s(i, h);
1151
+ }
1152
+ function u(h, i) {
1153
+ return i.i = h.i, i.w = h.w, i.X = h.X.slice(), i;
1154
+ }
1155
+ function f(h, i) {
1156
+ h == null && (h = +/* @__PURE__ */ new Date());
1157
+ var s = new o(h), c = i && i.state, a = function() {
1158
+ return (s.next() >>> 0) / 4294967296;
1159
+ };
1160
+ return a.double = function() {
1161
+ do
1162
+ var l = s.next() >>> 11, g = (s.next() >>> 0) / 4294967296, v = (l + g) / (1 << 21);
1163
+ while (v === 0);
1164
+ return v;
1165
+ }, a.int32 = s.next, a.quick = a, c && (c.X && u(c, s), a.state = function() {
1166
+ return u(s, {});
1167
+ }), a;
1168
+ }
1169
+ n && n.exports ? n.exports = f : this.xor4096 = f;
1170
+ })(
1171
+ K,
1172
+ // window object or global
1173
+ t
1174
+ );
1175
+ })(It);
1176
+ var sn = It.exports, Mt = { exports: {} };
1177
+ Mt.exports;
1178
+ (function(t) {
1179
+ (function(e, n, r) {
1180
+ function o(h) {
1181
+ var i = this, s = "";
1182
+ i.next = function() {
1183
+ var a = i.b, l = i.c, g = i.d, v = i.a;
1184
+ return a = a << 25 ^ a >>> 7 ^ l, l = l - g | 0, g = g << 24 ^ g >>> 8 ^ v, v = v - a | 0, i.b = a = a << 20 ^ a >>> 12 ^ l, i.c = l = l - g | 0, i.d = g << 16 ^ l >>> 16 ^ v, i.a = v - a | 0;
1185
+ }, i.a = 0, i.b = 0, i.c = -1640531527, i.d = 1367130551, h === Math.floor(h) ? (i.a = h / 4294967296 | 0, i.b = h | 0) : s += h;
1186
+ for (var c = 0; c < s.length + 20; c++)
1187
+ i.b ^= s.charCodeAt(c) | 0, i.next();
1188
+ }
1189
+ function u(h, i) {
1190
+ return i.a = h.a, i.b = h.b, i.c = h.c, i.d = h.d, i;
1191
+ }
1192
+ function f(h, i) {
1193
+ var s = new o(h), c = i && i.state, a = function() {
1194
+ return (s.next() >>> 0) / 4294967296;
1195
+ };
1196
+ return a.double = function() {
1197
+ do
1198
+ var l = s.next() >>> 11, g = (s.next() >>> 0) / 4294967296, v = (l + g) / (1 << 21);
1199
+ while (v === 0);
1200
+ return v;
1201
+ }, a.int32 = s.next, a.quick = a, c && (typeof c == "object" && u(c, s), a.state = function() {
1202
+ return u(s, {});
1203
+ }), a;
1204
+ }
1205
+ n && n.exports ? n.exports = f : this.tychei = f;
1206
+ })(
1207
+ K,
1208
+ t
1209
+ );
1210
+ })(Mt);
1211
+ var an = Mt.exports, se = { exports: {} };
1212
+ const hn = {}, ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1213
+ __proto__: null,
1214
+ default: hn
1215
+ }, Symbol.toStringTag, { value: "Module" })), un = /* @__PURE__ */ ke(ln);
1216
+ (function(t) {
1217
+ (function(e, n, r) {
1218
+ var o = 256, u = 6, f = 52, h = "random", i = r.pow(o, u), s = r.pow(2, f), c = s * 2, a = o - 1, l;
1219
+ function g(x, w, A) {
1220
+ var b = [];
1221
+ w = w == !0 ? { entropy: !0 } : w || {};
1222
+ var D = C(y(
1223
+ w.entropy ? [x, k(n)] : x ?? m(),
1224
+ 3
1225
+ ), b), F = new v(b), P = function() {
1226
+ for (var R = F.g(u), V = i, X = 0; R < s; )
1227
+ R = (R + X) * o, V *= o, X = F.g(1);
1228
+ for (; R >= c; )
1229
+ R /= 2, V /= 2, X >>>= 1;
1230
+ return (R + X) / V;
1231
+ };
1232
+ return P.int32 = function() {
1233
+ return F.g(4) | 0;
1234
+ }, P.quick = function() {
1235
+ return F.g(4) / 4294967296;
1236
+ }, P.double = P, C(k(F.S), n), (w.pass || A || function(R, V, X, j) {
1237
+ return j && (j.S && p(j, F), R.state = function() {
1238
+ return p(F, {});
1239
+ }), X ? (r[h] = R, V) : R;
1240
+ })(
1241
+ P,
1242
+ D,
1243
+ "global" in w ? w.global : this == r,
1244
+ w.state
1245
+ );
1246
+ }
1247
+ function v(x) {
1248
+ var w, A = x.length, b = this, D = 0, F = b.i = b.j = 0, P = b.S = [];
1249
+ for (A || (x = [A++]); D < o; )
1250
+ P[D] = D++;
1251
+ for (D = 0; D < o; D++)
1252
+ P[D] = P[F = a & F + x[D % A] + (w = P[D])], P[F] = w;
1253
+ (b.g = function(R) {
1254
+ for (var V, X = 0, j = b.i, S = b.j, Y = b.S; R--; )
1255
+ V = Y[j = a & j + 1], X = X * o + Y[a & (Y[j] = Y[S = a & S + V]) + (Y[S] = V)];
1256
+ return b.i = j, b.j = S, X;
1257
+ })(o);
1258
+ }
1259
+ function p(x, w) {
1260
+ return w.i = x.i, w.j = x.j, w.S = x.S.slice(), w;
1261
+ }
1262
+ function y(x, w) {
1263
+ var A = [], b = typeof x, D;
1264
+ if (w && b == "object")
1265
+ for (D in x)
1266
+ try {
1267
+ A.push(y(x[D], w - 1));
1268
+ } catch {
1269
+ }
1270
+ return A.length ? A : b == "string" ? x : x + "\0";
1271
+ }
1272
+ function C(x, w) {
1273
+ for (var A = x + "", b, D = 0; D < A.length; )
1274
+ w[a & D] = a & (b ^= w[a & D] * 19) + A.charCodeAt(D++);
1275
+ return k(w);
1276
+ }
1277
+ function m() {
1278
+ try {
1279
+ var x;
1280
+ return l && (x = l.randomBytes) ? x = x(o) : (x = new Uint8Array(o), (e.crypto || e.msCrypto).getRandomValues(x)), k(x);
1281
+ } catch {
1282
+ var w = e.navigator, A = w && w.plugins;
1283
+ return [+/* @__PURE__ */ new Date(), e, A, e.screen, k(n)];
1284
+ }
1285
+ }
1286
+ function k(x) {
1287
+ return String.fromCharCode.apply(0, x);
1288
+ }
1289
+ if (C(r.random(), n), t.exports) {
1290
+ t.exports = g;
1291
+ try {
1292
+ l = un;
1293
+ } catch {
1294
+ }
1295
+ } else
1296
+ r["seed" + h] = g;
1297
+ })(
1298
+ // global: `self` in browsers (including strict mode and web workers),
1299
+ // otherwise `this` in Node and other environments
1300
+ typeof self < "u" ? self : K,
1301
+ [],
1302
+ // pool: entropy pool starts empty
1303
+ Math
1304
+ // math: package containing random, pow, and seedrandom
1305
+ );
1306
+ })(se);
1307
+ var fn = se.exports, cn = en, gn = nn, pn = rn, vn = on, dn = sn, xn = an, Q = fn;
1308
+ Q.alea = cn;
1309
+ Q.xor128 = gn;
1310
+ Q.xorwow = pn;
1311
+ Q.xorshift7 = vn;
1312
+ Q.xor4096 = dn;
1313
+ Q.tychei = xn;
1314
+ var wn = Q;
1315
+ const Bt = /* @__PURE__ */ Ne(wn);
1316
+ class xt extends Jt {
1317
+ constructor() {
1318
+ super(...arguments), Object.defineProperty(this, "_tag", {
1319
+ enumerable: !0,
1320
+ configurable: !0,
1321
+ writable: !0,
1322
+ value: "voronoitreemap"
1323
+ }), Object.defineProperty(this, "polygons", {
1324
+ enumerable: !0,
1325
+ configurable: !0,
1326
+ writable: !0,
1327
+ value: this.addDisposer(new ve(de.new({}), () => pt._new(this._root, {
1328
+ themeTags: Ee(this.polygons.template.get("themeTags", []), [this._tag, "shape"])
1329
+ }, [this.polygons.template])))
1330
+ }), Object.defineProperty(this, "voronoi", {
1331
+ enumerable: !0,
1332
+ configurable: !0,
1333
+ writable: !0,
1334
+ value: tn()
1335
+ });
1336
+ }
1337
+ _afterNew() {
1338
+ this.nodesContainer.setAll({
1339
+ x: lt,
1340
+ y: lt,
1341
+ centerX: lt,
1342
+ centerY: lt
1343
+ }), this.nodes.template.setPrivate("trustBounds", !0), super._afterNew();
1344
+ }
1345
+ _prepareChildren() {
1346
+ super._prepareChildren();
1347
+ const e = this.innerWidth() / 2, n = this.innerHeight() / 2;
1348
+ let r = this._rootNode;
1349
+ const o = this.get("selectedDataItem");
1350
+ o && (r = o.get("d3HierarchyNode")), this.voronoi.convergenceRatio(this.get("convergenceRatio", 5e-3)), this.voronoi.maxIterationCount(this.get("maxIterationCount", 100)), this.voronoi.minWeightRatio(this.get("minWeightRatio", 5e-3)), this.isDirty("type") && this.get("type") == "polygon" && (this.voronoi.clip(this.getCirclePolygon(1)), this._updateVisuals()), this._sizeDirty && this.get("type") == "rectangle" && (this.voronoi.prng(Bt("X")), this.voronoi.clip([[-e, -n], [-e, n], [e, n], [e, -n]])(r), this._updateVisuals()), (this._valuesDirty || this.isDirty("selectedDataItem")) && r && (this.voronoi.prng(Bt("X")), this.voronoi(r), this._updateVisuals());
1351
+ }
1352
+ _updateNode(e) {
1353
+ const n = e.get("d3HierarchyNode").polygon, r = e.get("polygon");
1354
+ if (n && r) {
1355
+ let o = [], u = 1;
1356
+ this.get("type") == "polygon" && (u = Math.min(this.innerWidth(), this.innerHeight()) / 2);
1357
+ let f = 1 / 0, h = -1 / 0;
1358
+ for (let a = 0, l = n.length; a < l; a++) {
1359
+ const g = n[a];
1360
+ let v = g[0] * u, p = g[1] * u;
1361
+ o.push([v, p]), f = Math.min(f, v), h = Math.max(h, v);
1362
+ }
1363
+ r.set("coordinates", o);
1364
+ const i = e.get("fill"), s = e.get("fillPattern");
1365
+ r._setDefault("fill", i), r._setDefault("fillPattern", s);
1366
+ const c = e.get("label");
1367
+ if (c) {
1368
+ const a = n.site;
1369
+ a && c.setAll({
1370
+ x: a.x * u,
1371
+ y: a.y * u,
1372
+ maxWidth: Math.abs(h - f)
1373
+ });
1374
+ }
1375
+ }
1376
+ }
1377
+ _handleSingle(e) {
1378
+ const n = e.get("parent");
1379
+ if (n) {
1380
+ const r = n.get("children");
1381
+ r && Kt(r, (o) => {
1382
+ o != e && (this.disableDataItem(o), o.get("node").hide());
1383
+ }), this._handleSingle(n);
1384
+ }
1385
+ }
1386
+ /**
1387
+ * @ignore
1388
+ */
1389
+ makeNode(e) {
1390
+ const n = super.makeNode(e);
1391
+ return this._makeNode(e, n), n;
1392
+ }
1393
+ _makeNode(e, n) {
1394
+ const r = n.children.moveValue(this.polygons.make(), 0);
1395
+ n.setPrivate("tooltipTarget", r), e.setRaw("polygon", r), r._setDataItem(e);
1396
+ }
1397
+ getCirclePolygon(e) {
1398
+ const n = this.get("cornerCount", 120), r = Math.PI * 2 / n, o = [];
1399
+ for (let u = 0; u < n; u++) {
1400
+ let f = u * r;
1401
+ o.push([e * Math.cos(f), e * Math.sin(f)]);
1402
+ }
1403
+ return o;
1404
+ }
1405
+ }
1406
+ Object.defineProperty(xt, "className", {
1407
+ enumerable: !0,
1408
+ configurable: !0,
1409
+ writable: !0,
1410
+ value: "VoronoiTreemap"
1411
+ });
1412
+ Object.defineProperty(xt, "classNames", {
1413
+ enumerable: !0,
1414
+ configurable: !0,
1415
+ writable: !0,
1416
+ value: Jt.classNames.concat([xt.className])
1417
+ });
1418
+ const Tn = (t) => {
1419
+ const e = ye({
1420
+ props: t,
1421
+ name: "HCDrillDownVoronoiTreemap"
1422
+ }), {
1423
+ dimensions: n,
1424
+ values: r,
1425
+ data: o,
1426
+ initDelay: u = 0,
1427
+ colors: f,
1428
+ sx: h,
1429
+ ...i
1430
+ } = e, s = be(), a = `hc-drill-down-voronoi-treemap-${Pe().replace(/:/g, "")}`, l = ze(null);
1431
+ _e(() => {
1432
+ let v;
1433
+ return v = setTimeout(() => {
1434
+ if (n.length < 2) {
1435
+ console.error("DrillDownVoronoiTreemap requires at least 2 dimensions");
1436
+ return;
1437
+ }
1438
+ if (r.length < 1) {
1439
+ console.error("DrillDownVoronoiTreemap requires at least 1 value");
1440
+ return;
1441
+ }
1442
+ const p = xe.new(a);
1443
+ l.current = p;
1444
+ const y = we.new(p);
1445
+ y.rule("Polygon", ["hierarchy", "node", "shape", "depth0"]).setAll({ strokeOpacity: 0, fillOpacity: 0 }), y.rule("Polygon", ["hierarchy", "node", "shape", "depth1"]).setAll({
1446
+ strokeWidth: 5,
1447
+ fillOpacity: 1,
1448
+ stroke: Ht(0)
1449
+ }), y.rule("Polygon", ["hierarchy", "node", "shape", "depth2"]).setAll({
1450
+ fillOpacity: 0,
1451
+ strokeWidth: 1,
1452
+ stroke: Ht(0)
1453
+ }), y.rule("HierarchyNode", ["last"]).setAll({ cursorOverStyle: "pointer" }), y.rule("Label", ["node"]).setAll({ fontSize: 11, minScale: 0.7 }), y.rule("Label", ["node", "depth0"]).setAll({ forceHidden: !0 }), y.rule("Label", ["node", "depth1"]).setAll({ forceHidden: !0 }), p.setThemes([me.new(p), y]);
1454
+ const m = p.container.children.push(
1455
+ Te.new(p, {
1456
+ width: Vt,
1457
+ height: Vt,
1458
+ wheelable: !0,
1459
+ pinchZoom: !0
1460
+ })
1461
+ ).contents.children.push(
1462
+ xt.new(p, {
1463
+ paddingLeft: 5,
1464
+ paddingRight: 5,
1465
+ paddingTop: 5,
1466
+ paddingBottom: 5,
1467
+ singleBranchOnly: !0,
1468
+ downDepth: 2,
1469
+ upDepth: 0,
1470
+ initialDepth: 2,
1471
+ valueField: r[0].dataFieldName,
1472
+ categoryField: "name",
1473
+ childDataField: "children",
1474
+ idField: "name",
1475
+ type: "polygon",
1476
+ cornerCount: 120
1477
+ })
1478
+ );
1479
+ m.set("colors", De(p, f)), m.labels.template.adapters.add("x", function(x, w) {
1480
+ const A = w.dataItem;
1481
+ if (A) {
1482
+ const b = A.get("polygon");
1483
+ if (b) {
1484
+ const D = b.getPrivate("minX", 0), F = b.getPrivate("maxX", 0), P = A.dataContext;
1485
+ P && (F - D < 50 ? w.set("text", P.id) : w.set("text", P.name));
1486
+ }
1487
+ }
1488
+ return x;
1489
+ }), m.nodes.template.events.on("click", function(x) {
1490
+ const w = x.target.dataItem;
1491
+ w && (w.get("children") || m.selectDataItem(w.get("parent")));
1492
+ });
1493
+ const k = (x, w, A) => {
1494
+ if (x === "date") {
1495
+ let b = "YYYY";
1496
+ return w.includes("month") ? b = "MMM YYYY" : w.includes("day") && (b = "DD MMM YYYY"), Ce(A).format(b);
1497
+ }
1498
+ return A;
1499
+ };
1500
+ if (n.length > 1) {
1501
+ const x = Ae.groupBy(o, n[0].value), w = [];
1502
+ Object.keys(x).forEach((A) => {
1503
+ w.push({
1504
+ name: k(n[0].type, n[0].value, A),
1505
+ children: x[A].map((b) => ({
1506
+ name: k(
1507
+ n[1].type,
1508
+ n[1].value,
1509
+ b[n[1].value]
1510
+ ),
1511
+ [r[0].dataFieldName]: b[r[0].dataFieldName]
1512
+ }))
1513
+ });
1514
+ }), m.data.setAll([{ children: w }]);
1515
+ }
1516
+ m.set("selectedDataItem", m.dataItems[0]), m.appear(1e3, 100);
1517
+ }, u), () => {
1518
+ var p;
1519
+ v && clearTimeout(v), (p = l.current) == null || p.dispose(), l.current = null;
1520
+ };
1521
+ }, [o, n, r, s.palette.mode, f]);
1522
+ const g = { ...e };
1523
+ return { chartId: a, ownerState: g, sx: h, other: i };
1524
+ };
1525
+ export {
1526
+ Tn as useDrillDownVoronoiTreemapLogic
1527
+ };