@orangelogic/design-system 2.69.0 → 2.70.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 (220) hide show
  1. package/library/chunks/AxisLabelRadial.BTpA5dYy.js +11 -0
  2. package/library/chunks/BaseColumnSeries.hIO71GLG.js +304 -0
  3. package/library/chunks/CandlestickSeries.w9C0GR9v.js +362 -0
  4. package/library/chunks/Circle.tOnnO-F-.js +17 -0
  5. package/library/chunks/ColumnSeries.Ckz75x1M.js +54 -0
  6. package/library/chunks/EditableAxisLabel.CCMTJT7K.js +445 -0
  7. package/library/chunks/EditableLabel.DPmicdjK.js +119 -0
  8. package/library/chunks/Gradient.BrDBLm8v.js +40 -0
  9. package/library/chunks/LinearGradient.CxfXxvMw.js +37 -0
  10. package/library/chunks/MonotoneXTension.CJMEHHj3.js +139 -0
  11. package/library/chunks/Picture.BNASYM-P.js +49 -0
  12. package/library/chunks/Polygon.Dr-GV2hn.js +70 -0
  13. package/library/chunks/ProgressPie.4mPA6xqm.js +234 -0
  14. package/library/chunks/RadialLabel.HfsGiN4x.js +88 -0
  15. package/library/chunks/Scrollbar.Bgg-RhjP.js +118 -0
  16. package/library/chunks/Slice.Dm56LTKj.js +120 -0
  17. package/library/chunks/Slider.FKJwoPq2.js +19 -0
  18. package/library/chunks/SpriteResizer.-qJDgug8.js +446 -0
  19. package/library/chunks/Triangle.BECgi7mc.js +21 -0
  20. package/library/chunks/ZoomTools.cgwuIB0e.js +199 -0
  21. package/library/chunks/___vite-browser-external_commonjs-proxy.C2tf3HsQ.js +8 -0
  22. package/library/chunks/{_baseUniq.Df-fLIBx.js → _baseUniq.BUihBa8c.js} +56 -53
  23. package/library/chunks/{_commonjsHelpers.ByX85dGu.js → _commonjsHelpers.DQNKXVTB.js} +2 -2
  24. package/library/chunks/accessors.BHk36ecy.js +11 -0
  25. package/library/chunks/am-chart.oZVBmpnn.js +18435 -0
  26. package/library/chunks/{animation.DfUHRQry.js → animation.DU8t6mrk.js} +1 -1
  27. package/library/chunks/{button.SoX-7UYy.js → button.CAAJPQFu.js} +3 -3
  28. package/library/chunks/{capitalize.WSkCXkNE.js → capitalize.CNStXZBq.js} +1 -1
  29. package/library/chunks/cardinal.BCA_LB0u.js +64 -0
  30. package/library/chunks/{color-swatch-group.Dx1fbSJx.js → color-swatch-group.CKHyWM8K.js} +6 -6
  31. package/library/chunks/{color-swatch.B7XXHxx1.js → color-swatch.BkpPCXd6.js} +2 -2
  32. package/library/chunks/colorPicker.C4w_vDjh.js +527 -0
  33. package/library/chunks/{confirm-popover.327ATuQH.js → confirm-popover.ZD74yDWw.js} +3 -3
  34. package/library/chunks/{content-builder.Bxi6k2LA.js → content-builder.B4Tqoc6M.js} +40 -34
  35. package/library/chunks/{cropper.BraEEykE.js → cropper.CQB3_qqG.js} +6937 -6935
  36. package/library/chunks/{dialog.eN3RUbwx.js → dialog.qSV5AjOE.js} +2 -2
  37. package/library/chunks/{dom.CZrJ64Dm.js → dom.BQVKDNd8.js} +1 -1
  38. package/library/chunks/{dot-pagination.Bek4w4zz.js → dot-pagination.BN_0ljfc.js} +2 -2
  39. package/library/chunks/exporting.BdjsEGF8.js +1407 -0
  40. package/library/chunks/{file-on-demand.BiC4cymk.js → file-on-demand.CXE4zf0J.js} +448 -386
  41. package/library/chunks/flow.D0FqdfOy.js +1594 -0
  42. package/library/chunks/{folder-select.DVEFgexx.js → folder-select.CPALQK22.js} +4 -4
  43. package/library/chunks/{form.CO12-VK0.js → form.DgwYWi0O.js} +1 -1
  44. package/library/chunks/gantt.DfUM7Gvb.js +2459 -0
  45. package/library/chunks/{header.Da5yvwdy.js → header.DXZ_5gLY.js} +2 -2
  46. package/library/chunks/hierarchy.5kfBCoGt.js +3561 -0
  47. package/library/chunks/{hub-connection.CfARlehM.js → hub-connection.Ot2odiCz.js} +1 -1
  48. package/library/chunks/{i18n.BMRLOAZR.js → i18n.C0iakJkV.js} +19 -11
  49. package/library/chunks/{iframe.BJizUE1A.js → iframe.BlzVfeBc.js} +2 -2
  50. package/library/chunks/{image.bndP5q2c.js → image.B3WjaCXP.js} +2 -2
  51. package/library/chunks/index.BkoLctE9.js +533 -0
  52. package/library/chunks/index.CZJTjkLp.js +142 -0
  53. package/library/chunks/{index.Bhnf0N8Q.js → index.CmVKj_wl.js} +7 -7
  54. package/library/chunks/index.DU0XUO4k.js +176 -0
  55. package/library/chunks/index.DcjJFMlq.js +1520 -0
  56. package/library/chunks/isObjectLike.z36Fu426.js +34 -0
  57. package/library/chunks/{isSymbol.huJ_Cvxt.js → isSymbol.L0C2ND_U.js} +1 -1
  58. package/library/chunks/json.BjaT7cyo.js +119 -0
  59. package/library/chunks/{list-editor.Du1h2Ms0.js → list-editor.CIAAFPco.js} +251 -222
  60. package/library/chunks/map.DbgNAGxD.js +3037 -0
  61. package/library/chunks/markerjs2.esm.B_9kjmye.js +1912 -0
  62. package/library/chunks/{option.Ce_wlnZj.js → option.ByVbmxUQ.js} +2 -2
  63. package/library/chunks/{pagination.DXu-mFAk.js → pagination.DPQn2fKX.js} +4 -4
  64. package/library/chunks/pdfmake.Bs7cMDH0.js +41224 -0
  65. package/library/chunks/percent.DO4FjAdu.js +902 -0
  66. package/library/chunks/{purify.es.BGaRrCfO.js → purify.es.BIuh5IAZ.js} +115 -115
  67. package/library/chunks/radar.Dd5fJVMg.js +789 -0
  68. package/library/chunks/{responsive.DgQTIrna.js → responsive.DL-wBD4P.js} +1 -1
  69. package/library/chunks/sliceGrouper.DA3aeuJ-.js +93 -0
  70. package/library/chunks/stock.BfI5MUyK.js +12684 -0
  71. package/library/chunks/{string.Cp_XNbnV.js → string.B_rEG27K.js} +1 -1
  72. package/library/chunks/{tab-group.B2pW__9H.js → tab-group.1h51o_Ly.js} +4 -4
  73. package/library/chunks/{table.5eWm9FfN.js → table.wVHv1Xze.js} +348 -327
  74. package/library/chunks/timeline.BxMLjB5J.js +837 -0
  75. package/library/chunks/timer.B39XOBYL.js +123 -0
  76. package/library/chunks/{toString.CRT5zqEU.js → toString.CL_lYXbK.js} +3 -3
  77. package/library/chunks/transform.BuqENXeT.js +50 -0
  78. package/library/chunks/{tree.Zls5YZ8z.js → tree.Bx0IGsWm.js} +2 -2
  79. package/library/chunks/venn.CxFupTb9.js +966 -0
  80. package/library/chunks/vfs_fonts.VJpdcrR6.js +9 -0
  81. package/library/chunks/watch.BCJD77bD.js +547 -0
  82. package/library/chunks/wc.ThQubbN2.js +255 -0
  83. package/library/chunks/xlsx.v-qkA-dg.js +25118 -0
  84. package/library/chunks/xy.q6e68du3.js +333 -0
  85. package/library/components/alert.js +2 -2
  86. package/library/components/am-chart.d.ts +3 -0
  87. package/library/components/am-chart.js +11 -0
  88. package/library/components/animated-image.js +1 -1
  89. package/library/components/animation.js +2 -2
  90. package/library/components/array-line-clamp.js +1 -1
  91. package/library/components/asset-link-format.js +7 -7
  92. package/library/components/atoms.js +166 -162
  93. package/library/components/avatar.js +1 -1
  94. package/library/components/border-input-group.js +1 -1
  95. package/library/components/breadcrumb-item.js +1 -1
  96. package/library/components/breadcrumb.js +1 -1
  97. package/library/components/button.js +4 -4
  98. package/library/components/checkbox.js +2 -2
  99. package/library/components/color-picker.js +4 -4
  100. package/library/components/color-swatch-group.js +7 -7
  101. package/library/components/color-swatch.js +3 -3
  102. package/library/components/confirm-popover.js +4 -4
  103. package/library/components/copy-button.js +2 -2
  104. package/library/components/corner-position-input-group.js +2 -2
  105. package/library/components/cropper.js +1 -1
  106. package/library/components/details.js +3 -2
  107. package/library/components/dialog.js +3 -3
  108. package/library/components/divider.js +1 -1
  109. package/library/components/dot-pagination.js +3 -3
  110. package/library/components/drawer.js +3 -3
  111. package/library/components/dropdown.js +2 -2
  112. package/library/components/dynamic-select.js +32 -30
  113. package/library/components/e-chart.d.ts +3 -0
  114. package/library/components/e-chart.js +47908 -0
  115. package/library/components/element-clamp.js +3 -3
  116. package/library/components/file-on-demand.js +10 -10
  117. package/library/components/folder-select.js +4 -4
  118. package/library/components/format-bytes.js +1 -1
  119. package/library/components/format-date.js +1 -1
  120. package/library/components/format-number.js +1 -1
  121. package/library/components/format-time.js +2 -2
  122. package/library/components/grid-item.js +1 -1
  123. package/library/components/header.js +3 -3
  124. package/library/components/hub-connection.js +2 -2
  125. package/library/components/icon-button.js +1 -1
  126. package/library/components/icon.js +1 -1
  127. package/library/components/iframe.js +3 -3
  128. package/library/components/image-comparer.js +2 -2
  129. package/library/components/image.js +3 -3
  130. package/library/components/include.js +1 -1
  131. package/library/components/input.js +3 -3
  132. package/library/components/line-clamp.js +1 -1
  133. package/library/components/list-editor.js +11 -8
  134. package/library/components/markdown.js +2 -2
  135. package/library/components/masonry.js +2 -2
  136. package/library/components/menu-item.js +2 -2
  137. package/library/components/menu.js +1 -1
  138. package/library/components/molecules.js +5 -5
  139. package/library/components/mutation-observer.js +1 -1
  140. package/library/components/option.js +3 -3
  141. package/library/components/organisms.js +2 -2
  142. package/library/components/pagination.js +5 -5
  143. package/library/components/popup.js +1 -1
  144. package/library/components/position-picker.js +1 -1
  145. package/library/components/progress-bar.js +1 -1
  146. package/library/components/progress-ring.js +1 -1
  147. package/library/components/qr-code.js +1 -1
  148. package/library/components/radio-button.js +1 -1
  149. package/library/components/radio-card.js +1 -1
  150. package/library/components/radio-group.js +2 -2
  151. package/library/components/radio.js +1 -1
  152. package/library/components/range.js +3 -3
  153. package/library/components/rating.js +2 -2
  154. package/library/components/relative-time.js +1 -1
  155. package/library/components/resize-observer.js +1 -1
  156. package/library/components/select.js +4 -4
  157. package/library/components/share-option-list.js +3 -3
  158. package/library/components/sidebar.js +1 -1
  159. package/library/components/size-input-group.js +2 -2
  160. package/library/components/spinner.js +1 -1
  161. package/library/components/split-panel.js +2 -2
  162. package/library/components/stepper.js +1 -1
  163. package/library/components/switch.js +2 -2
  164. package/library/components/tab-group.js +5 -5
  165. package/library/components/tab-panel.js +1 -1
  166. package/library/components/tab.js +2 -2
  167. package/library/components/table.js +5 -5
  168. package/library/components/tag.js +1 -1
  169. package/library/components/textarea.js +2 -2
  170. package/library/components/timecode.js +2 -2
  171. package/library/components/tooltip.js +2 -2
  172. package/library/components/tree-item.js +3 -3
  173. package/library/components/tree.js +3 -3
  174. package/library/components/typeface.js +2 -2
  175. package/library/components/types.js +27684 -27970
  176. package/library/components/video.js +1107 -1110
  177. package/library/package.json +1 -1
  178. package/library/packages/atoms/src/components/am-chart/am-chart.d.ts +45 -0
  179. package/library/packages/atoms/src/components/am-chart/am-chart.styles.d.ts +2 -0
  180. package/library/packages/atoms/src/components/am-chart/am-chart.utils.d.ts +23 -0
  181. package/library/packages/atoms/src/components/e-chart/e-chart-controller.d.ts +30 -0
  182. package/library/packages/atoms/src/components/e-chart/e-chart.d.ts +38 -0
  183. package/library/packages/atoms/src/components/e-chart/e-chart.styles.d.ts +2 -0
  184. package/library/packages/atoms/src/components/table/table.d.ts +21 -0
  185. package/library/packages/atoms/src/components/table/tabulator-tables/core/Tabulator.d.ts +1 -0
  186. package/library/packages/atoms/src/components/table/tabulator-tables/core/tools/DataLoader.d.ts +3 -1
  187. package/library/packages/atoms/src/index.d.ts +2 -0
  188. package/library/packages/events/src/cx-chart-plan-change.d.ts +10 -0
  189. package/library/packages/events/src/cx-dashboard-filter-change.d.ts +6 -0
  190. package/library/packages/events/src/cx-dashboard-table-load-more.d.ts +9 -0
  191. package/library/packages/events/src/cx-e-chart-drill-down.d.ts +16 -0
  192. package/library/packages/events/src/events.d.ts +4 -0
  193. package/library/packages/molecules/src/index.d.ts +1 -0
  194. package/library/packages/molecules/src/list-editor/list-editor.d.ts +7 -0
  195. package/library/packages/molecules/src/stat-card/stat-card.d.ts +81 -0
  196. package/library/packages/molecules/src/stat-card/stat-card.styles.d.ts +2 -0
  197. package/library/packages/molecules/src/storybook/storybook.d.ts +1 -0
  198. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +1 -1
  199. package/library/packages/organisms/src/content-builder/components/chart-plan-builder/chart-plan-builder.d.ts +88 -0
  200. package/library/packages/organisms/src/content-builder/components/chart-plan-builder/chart-plan-builder.styles.d.ts +2 -0
  201. package/library/packages/organisms/src/content-builder/components/chart-plan-builder/chart-plan-schema.d.ts +100 -0
  202. package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -2
  203. package/library/packages/organisms/src/dashboard-filter/dashboard-filter.d.ts +83 -0
  204. package/library/packages/organisms/src/dashboard-filter/dashboard-filter.styles.d.ts +2 -0
  205. package/library/packages/organisms/src/dashboard-table/dashboard-table.d.ts +45 -0
  206. package/library/packages/organisms/src/dashboard-table/dashboard-table.styles.d.ts +2 -0
  207. package/library/packages/organisms/src/index.d.ts +3 -0
  208. package/library/packages/services/src/api/endpoints.d.ts +3 -0
  209. package/library/packages/types/src/am-chart.d.ts +22 -0
  210. package/library/packages/types/src/content-builder.d.ts +1 -0
  211. package/library/packages/types/src/stat-card.d.ts +19 -0
  212. package/library/packages/types/src/table.d.ts +4 -0
  213. package/library/packages/utils/src/custom-element/i18n.d.ts +8 -0
  214. package/library/react-web-component.d.ts +280 -4
  215. package/library/utils.js +8 -8
  216. package/package.json +1 -1
  217. package/library/chunks/_baseRest.ClTMQtN1.js +0 -67
  218. package/library/chunks/identity.ByMq8VxU.js +0 -6
  219. package/library/chunks/isObjectLike.D3cpZO39.js +0 -81
  220. package/library/chunks/watch.q1sEjPWL.js +0 -501
@@ -0,0 +1,3037 @@
1
+ import { J as Wi, e as N, a4 as fi, b4 as En, bc as Nn, ap as ri, G as we, P as Rn, a as gt, L as Ji, T as Vi, D as In, F as pi, I as gi, am as Se, aF as Hi, k as zn, bd as Bn, aZ as Ft, be as kn, m as jn, w as Yn, f as Xn, ax as di, y as mi, z as Ee, t as yi, bf as $n, aj as Gn, K as Zn, bg as xe, a2 as An, C as _i, az as On, b as Fn, bh as bn } from "./am-chart.oZVBmpnn.js";
2
+ import { g as Wn, a as Jn } from "./_commonjsHelpers.DQNKXVTB.js";
3
+ import { i as Vn } from "./index.DU0XUO4k.js";
4
+ import { a as qi } from "./ZoomTools.cgwuIB0e.js";
5
+ class b {
6
+ constructor() {
7
+ this._partials = new Float64Array(32), this._n = 0;
8
+ }
9
+ add(t) {
10
+ const e = this._partials;
11
+ let i = 0;
12
+ for (let o = 0; o < this._n && o < 32; o++) {
13
+ const s = e[o], r = t + s, a = Math.abs(t) < Math.abs(s) ? t - (r - s) : s - (r - t);
14
+ a && (e[i++] = a), t = r;
15
+ }
16
+ return e[i] = t, this._n = i + 1, this;
17
+ }
18
+ valueOf() {
19
+ const t = this._partials;
20
+ let e = this._n, i, o, s, r = 0;
21
+ if (e > 0) {
22
+ for (r = t[--e]; e > 0 && (i = r, o = t[--e], r = i + o, s = o - (r - i), !s); )
23
+ ;
24
+ e > 0 && (s < 0 && t[e - 1] < 0 || s > 0 && t[e - 1] > 0) && (o = s * 2, i = r + o, o == i - r && (r = i));
25
+ }
26
+ return r;
27
+ }
28
+ }
29
+ function* Hn(n) {
30
+ for (const t of n)
31
+ yield* t;
32
+ }
33
+ function Ui(n) {
34
+ return Array.from(Hn(n));
35
+ }
36
+ function xt(n, t, e) {
37
+ n = +n, t = +t, e = (o = arguments.length) < 2 ? (t = n, n = 0, 1) : o < 3 ? 1 : +e;
38
+ for (var i = -1, o = Math.max(0, Math.ceil((t - n) / e)) | 0, s = new Array(o); ++i < o; )
39
+ s[i] = n + i * e;
40
+ return s;
41
+ }
42
+ var E = 1e-6, Ne = 1e-12, z = Math.PI, Q = z / 2, ee = z / 4, H = z * 2, Z = 180 / z, L = z / 180, k = Math.abs, Qi = Math.atan, ot = Math.atan2, T = Math.cos, bt = Math.ceil, qn = Math.exp, Re = Math.hypot, Un = Math.log, C = Math.sin, Qn = Math.sign || function(n) {
43
+ return n > 0 ? 1 : n < 0 ? -1 : 0;
44
+ }, st = Math.sqrt, Kn = Math.tan;
45
+ function to(n) {
46
+ return n > 1 ? 0 : n < -1 ? z : Math.acos(n);
47
+ }
48
+ function _t(n) {
49
+ return n > 1 ? Q : n < -1 ? -Q : Math.asin(n);
50
+ }
51
+ function vi(n) {
52
+ return (n = C(n / 2)) * n;
53
+ }
54
+ function $() {
55
+ }
56
+ function ie(n, t) {
57
+ n && Di.hasOwnProperty(n.type) && Di[n.type](n, t);
58
+ }
59
+ var Pi = {
60
+ Feature: function(n, t) {
61
+ ie(n.geometry, t);
62
+ },
63
+ FeatureCollection: function(n, t) {
64
+ for (var e = n.features, i = -1, o = e.length; ++i < o; ) ie(e[i].geometry, t);
65
+ }
66
+ }, Di = {
67
+ Sphere: function(n, t) {
68
+ t.sphere();
69
+ },
70
+ Point: function(n, t) {
71
+ n = n.coordinates, t.point(n[0], n[1], n[2]);
72
+ },
73
+ MultiPoint: function(n, t) {
74
+ for (var e = n.coordinates, i = -1, o = e.length; ++i < o; ) n = e[i], t.point(n[0], n[1], n[2]);
75
+ },
76
+ LineString: function(n, t) {
77
+ Ie(n.coordinates, t, 0);
78
+ },
79
+ MultiLineString: function(n, t) {
80
+ for (var e = n.coordinates, i = -1, o = e.length; ++i < o; ) Ie(e[i], t, 0);
81
+ },
82
+ Polygon: function(n, t) {
83
+ wi(n.coordinates, t);
84
+ },
85
+ MultiPolygon: function(n, t) {
86
+ for (var e = n.coordinates, i = -1, o = e.length; ++i < o; ) wi(e[i], t);
87
+ },
88
+ GeometryCollection: function(n, t) {
89
+ for (var e = n.geometries, i = -1, o = e.length; ++i < o; ) ie(e[i], t);
90
+ }
91
+ };
92
+ function Ie(n, t, e) {
93
+ var i = -1, o = n.length - e, s;
94
+ for (t.lineStart(); ++i < o; ) s = n[i], t.point(s[0], s[1], s[2]);
95
+ t.lineEnd();
96
+ }
97
+ function wi(n, t) {
98
+ var e = -1, i = n.length;
99
+ for (t.polygonStart(); ++e < i; ) Ie(n[e], t, 1);
100
+ t.polygonEnd();
101
+ }
102
+ function rt(n, t) {
103
+ n && Pi.hasOwnProperty(n.type) ? Pi[n.type](n, t) : ie(n, t);
104
+ }
105
+ var ne = new b(), oe = new b(), Ki, tn, ze, Be, ke, ut = {
106
+ point: $,
107
+ lineStart: $,
108
+ lineEnd: $,
109
+ polygonStart: function() {
110
+ ne = new b(), ut.lineStart = eo, ut.lineEnd = io;
111
+ },
112
+ polygonEnd: function() {
113
+ var n = +ne;
114
+ oe.add(n < 0 ? H + n : n), this.lineStart = this.lineEnd = this.point = $;
115
+ },
116
+ sphere: function() {
117
+ oe.add(H);
118
+ }
119
+ };
120
+ function eo() {
121
+ ut.point = no;
122
+ }
123
+ function io() {
124
+ en(Ki, tn);
125
+ }
126
+ function no(n, t) {
127
+ ut.point = en, Ki = n, tn = t, n *= L, t *= L, ze = n, Be = T(t = t / 2 + ee), ke = C(t);
128
+ }
129
+ function en(n, t) {
130
+ n *= L, t *= L, t = t / 2 + ee;
131
+ var e = n - ze, i = e >= 0 ? 1 : -1, o = i * e, s = T(t), r = C(t), a = ke * r, u = Be * s + a * T(o), h = a * i * C(o);
132
+ ne.add(ot(h, u)), ze = n, Be = s, ke = r;
133
+ }
134
+ function oo(n) {
135
+ return oe = new b(), rt(n, ut), oe * 2;
136
+ }
137
+ function se(n) {
138
+ return [ot(n[1], n[0]), _t(n[2])];
139
+ }
140
+ function Dt(n) {
141
+ var t = n[0], e = n[1], i = T(e);
142
+ return [i * T(t), i * C(t), C(e)];
143
+ }
144
+ function Wt(n, t) {
145
+ return n[0] * t[0] + n[1] * t[1] + n[2] * t[2];
146
+ }
147
+ function Mt(n, t) {
148
+ return [n[1] * t[2] - n[2] * t[1], n[2] * t[0] - n[0] * t[2], n[0] * t[1] - n[1] * t[0]];
149
+ }
150
+ function Ce(n, t) {
151
+ n[0] += t[0], n[1] += t[1], n[2] += t[2];
152
+ }
153
+ function Jt(n, t) {
154
+ return [n[0] * t, n[1] * t, n[2] * t];
155
+ }
156
+ function re(n) {
157
+ var t = st(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]);
158
+ n[0] /= t, n[1] /= t, n[2] /= t;
159
+ }
160
+ var X, U, G, tt, Pt, nn, on, Lt, Yt, yt, dt, ft = {
161
+ point: je,
162
+ lineStart: Si,
163
+ lineEnd: xi,
164
+ polygonStart: function() {
165
+ ft.point = rn, ft.lineStart = so, ft.lineEnd = ro, Yt = new b(), ut.polygonStart();
166
+ },
167
+ polygonEnd: function() {
168
+ ut.polygonEnd(), ft.point = je, ft.lineStart = Si, ft.lineEnd = xi, ne < 0 ? (X = -(G = 180), U = -(tt = 90)) : Yt > E ? tt = 90 : Yt < -E && (U = -90), dt[0] = X, dt[1] = G;
169
+ },
170
+ sphere: function() {
171
+ X = -(G = 180), U = -(tt = 90);
172
+ }
173
+ };
174
+ function je(n, t) {
175
+ yt.push(dt = [X = n, G = n]), t < U && (U = t), t > tt && (tt = t);
176
+ }
177
+ function sn(n, t) {
178
+ var e = Dt([n * L, t * L]);
179
+ if (Lt) {
180
+ var i = Mt(Lt, e), o = [i[1], -i[0], 0], s = Mt(o, i);
181
+ re(s), s = se(s);
182
+ var r = n - Pt, a = r > 0 ? 1 : -1, u = s[0] * Z * a, h, l = k(r) > 180;
183
+ l ^ (a * Pt < u && u < a * n) ? (h = s[1] * Z, h > tt && (tt = h)) : (u = (u + 360) % 360 - 180, l ^ (a * Pt < u && u < a * n) ? (h = -s[1] * Z, h < U && (U = h)) : (t < U && (U = t), t > tt && (tt = t))), l ? n < Pt ? K(X, n) > K(X, G) && (G = n) : K(n, G) > K(X, G) && (X = n) : G >= X ? (n < X && (X = n), n > G && (G = n)) : n > Pt ? K(X, n) > K(X, G) && (G = n) : K(n, G) > K(X, G) && (X = n);
184
+ } else
185
+ yt.push(dt = [X = n, G = n]);
186
+ t < U && (U = t), t > tt && (tt = t), Lt = e, Pt = n;
187
+ }
188
+ function Si() {
189
+ ft.point = sn;
190
+ }
191
+ function xi() {
192
+ dt[0] = X, dt[1] = G, ft.point = je, Lt = null;
193
+ }
194
+ function rn(n, t) {
195
+ if (Lt) {
196
+ var e = n - Pt;
197
+ Yt.add(k(e) > 180 ? e + (e > 0 ? 360 : -360) : e);
198
+ } else
199
+ nn = n, on = t;
200
+ ut.point(n, t), sn(n, t);
201
+ }
202
+ function so() {
203
+ ut.lineStart();
204
+ }
205
+ function ro() {
206
+ rn(nn, on), ut.lineEnd(), k(Yt) > E && (X = -(G = 180)), dt[0] = X, dt[1] = G, Lt = null;
207
+ }
208
+ function K(n, t) {
209
+ return (t -= n) < 0 ? t + 360 : t;
210
+ }
211
+ function ao(n, t) {
212
+ return n[0] - t[0];
213
+ }
214
+ function Ci(n, t) {
215
+ return n[0] <= n[1] ? n[0] <= t && t <= n[1] : t < n[0] || n[1] < t;
216
+ }
217
+ function lo(n) {
218
+ var t, e, i, o, s, r, a;
219
+ if (tt = G = -(X = U = 1 / 0), yt = [], rt(n, ft), e = yt.length) {
220
+ for (yt.sort(ao), t = 1, i = yt[0], s = [i]; t < e; ++t)
221
+ o = yt[t], Ci(i, o[0]) || Ci(i, o[1]) ? (K(i[0], o[1]) > K(i[0], i[1]) && (i[1] = o[1]), K(o[0], i[1]) > K(i[0], i[1]) && (i[0] = o[0])) : s.push(i = o);
222
+ for (r = -1 / 0, e = s.length - 1, t = 0, i = s[e]; t <= e; i = o, ++t)
223
+ o = s[t], (a = K(i[1], o[0])) > r && (r = a, X = o[0], G = i[1]);
224
+ }
225
+ return yt = dt = null, X === 1 / 0 || U === 1 / 0 ? [[NaN, NaN], [NaN, NaN]] : [[X, U], [G, tt]];
226
+ }
227
+ var Rt, ae, le, ue, he, ce, fe, pe, Ye, Xe, $e, an, ln, W, J, V, nt = {
228
+ sphere: $,
229
+ point: ai,
230
+ lineStart: Li,
231
+ lineEnd: Mi,
232
+ polygonStart: function() {
233
+ nt.lineStart = co, nt.lineEnd = fo;
234
+ },
235
+ polygonEnd: function() {
236
+ nt.lineStart = Li, nt.lineEnd = Mi;
237
+ }
238
+ };
239
+ function ai(n, t) {
240
+ n *= L, t *= L;
241
+ var e = T(t);
242
+ At(e * T(n), e * C(n), C(t));
243
+ }
244
+ function At(n, t, e) {
245
+ ++Rt, le += (n - le) / Rt, ue += (t - ue) / Rt, he += (e - he) / Rt;
246
+ }
247
+ function Li() {
248
+ nt.point = uo;
249
+ }
250
+ function uo(n, t) {
251
+ n *= L, t *= L;
252
+ var e = T(t);
253
+ W = e * T(n), J = e * C(n), V = C(t), nt.point = ho, At(W, J, V);
254
+ }
255
+ function ho(n, t) {
256
+ n *= L, t *= L;
257
+ var e = T(t), i = e * T(n), o = e * C(n), s = C(t), r = ot(st((r = J * s - V * o) * r + (r = V * i - W * s) * r + (r = W * o - J * i) * r), W * i + J * o + V * s);
258
+ ae += r, ce += r * (W + (W = i)), fe += r * (J + (J = o)), pe += r * (V + (V = s)), At(W, J, V);
259
+ }
260
+ function Mi() {
261
+ nt.point = ai;
262
+ }
263
+ function co() {
264
+ nt.point = po;
265
+ }
266
+ function fo() {
267
+ un(an, ln), nt.point = ai;
268
+ }
269
+ function po(n, t) {
270
+ an = n, ln = t, n *= L, t *= L, nt.point = un;
271
+ var e = T(t);
272
+ W = e * T(n), J = e * C(n), V = C(t), At(W, J, V);
273
+ }
274
+ function un(n, t) {
275
+ n *= L, t *= L;
276
+ var e = T(t), i = e * T(n), o = e * C(n), s = C(t), r = J * s - V * o, a = V * i - W * s, u = W * o - J * i, h = Re(r, a, u), l = _t(h), c = h && -l / h;
277
+ Ye.add(c * r), Xe.add(c * a), $e.add(c * u), ae += l, ce += l * (W + (W = i)), fe += l * (J + (J = o)), pe += l * (V + (V = s)), At(W, J, V);
278
+ }
279
+ function go(n) {
280
+ Rt = ae = le = ue = he = ce = fe = pe = 0, Ye = new b(), Xe = new b(), $e = new b(), rt(n, nt);
281
+ var t = +Ye, e = +Xe, i = +$e, o = Re(t, e, i);
282
+ return o < Ne && (t = ce, e = fe, i = pe, ae < E && (t = le, e = ue, i = he), o = Re(t, e, i), o < Ne) ? [NaN, NaN] : [ot(e, t) * Z, _t(i / o) * Z];
283
+ }
284
+ function Ge(n, t) {
285
+ function e(i, o) {
286
+ return i = n(i, o), t(i[0], i[1]);
287
+ }
288
+ return n.invert && t.invert && (e.invert = function(i, o) {
289
+ return i = t.invert(i, o), i && n.invert(i[0], i[1]);
290
+ }), e;
291
+ }
292
+ function Ze(n, t) {
293
+ return k(n) > z && (n -= Math.round(n / H) * H), [n, t];
294
+ }
295
+ Ze.invert = Ze;
296
+ function hn(n, t, e) {
297
+ return (n %= H) ? t || e ? Ge(Ei(n), Ni(t, e)) : Ei(n) : t || e ? Ni(t, e) : Ze;
298
+ }
299
+ function Ti(n) {
300
+ return function(t, e) {
301
+ return t += n, k(t) > z && (t -= Math.round(t / H) * H), [t, e];
302
+ };
303
+ }
304
+ function Ei(n) {
305
+ var t = Ti(n);
306
+ return t.invert = Ti(-n), t;
307
+ }
308
+ function Ni(n, t) {
309
+ var e = T(n), i = C(n), o = T(t), s = C(t);
310
+ function r(a, u) {
311
+ var h = T(u), l = T(a) * h, c = C(a) * h, f = C(u), p = f * e + l * i;
312
+ return [
313
+ ot(c * o - p * s, l * e - f * i),
314
+ _t(p * o + c * s)
315
+ ];
316
+ }
317
+ return r.invert = function(a, u) {
318
+ var h = T(u), l = T(a) * h, c = C(a) * h, f = C(u), p = f * o - c * s;
319
+ return [
320
+ ot(c * o + f * s, l * e + p * i),
321
+ _t(p * e - l * i)
322
+ ];
323
+ }, r;
324
+ }
325
+ function mo(n) {
326
+ n = hn(n[0] * L, n[1] * L, n.length > 2 ? n[2] * L : 0);
327
+ function t(e) {
328
+ return e = n(e[0] * L, e[1] * L), e[0] *= Z, e[1] *= Z, e;
329
+ }
330
+ return t.invert = function(e) {
331
+ return e = n.invert(e[0] * L, e[1] * L), e[0] *= Z, e[1] *= Z, e;
332
+ }, t;
333
+ }
334
+ function yo(n, t, e, i, o, s) {
335
+ if (e) {
336
+ var r = T(t), a = C(t), u = i * e;
337
+ o == null ? (o = t + i * H, s = t - u / 2) : (o = Ri(r, o), s = Ri(r, s), (i > 0 ? o < s : o > s) && (o += i * H));
338
+ for (var h, l = o; i > 0 ? l > s : l < s; l -= u)
339
+ h = se([r, -a * T(l), -a * C(l)]), n.point(h[0], h[1]);
340
+ }
341
+ }
342
+ function Ri(n, t) {
343
+ t = Dt(t), t[0] -= n, re(t);
344
+ var e = to(-t[1]);
345
+ return ((-t[2] < 0 ? -e : e) + H - E) % H;
346
+ }
347
+ function cn() {
348
+ var n = [], t;
349
+ return {
350
+ point: function(e, i, o) {
351
+ t.push([e, i, o]);
352
+ },
353
+ lineStart: function() {
354
+ n.push(t = []);
355
+ },
356
+ lineEnd: $,
357
+ rejoin: function() {
358
+ n.length > 1 && n.push(n.pop().concat(n.shift()));
359
+ },
360
+ result: function() {
361
+ var e = n;
362
+ return n = [], t = null, e;
363
+ }
364
+ };
365
+ }
366
+ function Ut(n, t) {
367
+ return k(n[0] - t[0]) < E && k(n[1] - t[1]) < E;
368
+ }
369
+ function Vt(n, t, e, i) {
370
+ this.x = n, this.z = t, this.o = e, this.e = i, this.v = !1, this.n = this.p = null;
371
+ }
372
+ function fn(n, t, e, i, o) {
373
+ var s = [], r = [], a, u;
374
+ if (n.forEach(function(g) {
375
+ if (!((d = g.length - 1) <= 0)) {
376
+ var d, m = g[0], y = g[d], P;
377
+ if (Ut(m, y)) {
378
+ if (!m[2] && !y[2]) {
379
+ for (o.lineStart(), a = 0; a < d; ++a) o.point((m = g[a])[0], m[1]);
380
+ o.lineEnd();
381
+ return;
382
+ }
383
+ y[0] += 2 * E;
384
+ }
385
+ s.push(P = new Vt(m, g, null, !0)), r.push(P.o = new Vt(m, null, P, !1)), s.push(P = new Vt(y, g, null, !1)), r.push(P.o = new Vt(y, null, P, !0));
386
+ }
387
+ }), !!s.length) {
388
+ for (r.sort(t), Ii(s), Ii(r), a = 0, u = r.length; a < u; ++a)
389
+ r[a].e = e = !e;
390
+ for (var h = s[0], l, c; ; ) {
391
+ for (var f = h, p = !0; f.v; ) if ((f = f.n) === h) return;
392
+ l = f.z, o.lineStart();
393
+ do {
394
+ if (f.v = f.o.v = !0, f.e) {
395
+ if (p)
396
+ for (a = 0, u = l.length; a < u; ++a) o.point((c = l[a])[0], c[1]);
397
+ else
398
+ i(f.x, f.n.x, 1, o);
399
+ f = f.n;
400
+ } else {
401
+ if (p)
402
+ for (l = f.p.z, a = l.length - 1; a >= 0; --a) o.point((c = l[a])[0], c[1]);
403
+ else
404
+ i(f.x, f.p.x, -1, o);
405
+ f = f.p;
406
+ }
407
+ f = f.o, l = f.z, p = !p;
408
+ } while (!f.v);
409
+ o.lineEnd();
410
+ }
411
+ }
412
+ }
413
+ function Ii(n) {
414
+ if (t = n.length) {
415
+ for (var t, e = 0, i = n[0], o; ++e < t; )
416
+ i.n = o = n[e], o.p = i, i = o;
417
+ i.n = o = n[0], o.p = i;
418
+ }
419
+ }
420
+ function Le(n) {
421
+ return k(n[0]) <= z ? n[0] : Qn(n[0]) * ((k(n[0]) + z) % H - z);
422
+ }
423
+ function _o(n, t) {
424
+ var e = Le(t), i = t[1], o = C(i), s = [C(e), -T(e), 0], r = 0, a = 0, u = new b();
425
+ o === 1 ? i = Q + E : o === -1 && (i = -Q - E);
426
+ for (var h = 0, l = n.length; h < l; ++h)
427
+ if (f = (c = n[h]).length)
428
+ for (var c, f, p = c[f - 1], g = Le(p), d = p[1] / 2 + ee, m = C(d), y = T(d), P = 0; P < f; ++P, g = D, m = x, y = B, p = _) {
429
+ var _ = c[P], D = Le(_), w = _[1] / 2 + ee, x = C(w), B = T(w), M = D - g, I = M >= 0 ? 1 : -1, j = I * M, S = j > z, F = m * x;
430
+ if (u.add(ot(F * I * C(j), y * B + F * T(j))), r += S ? M + I * H : M, S ^ g >= e ^ D >= e) {
431
+ var A = Mt(Dt(p), Dt(_));
432
+ re(A);
433
+ var Y = Mt(s, A);
434
+ re(Y);
435
+ var v = (S ^ M >= 0 ? -1 : 1) * _t(Y[2]);
436
+ (i > v || i === v && (A[0] || A[1])) && (a += S ^ M >= 0 ? 1 : -1);
437
+ }
438
+ }
439
+ return (r < -E || r < E && u < -Ne) ^ a & 1;
440
+ }
441
+ function pn(n, t, e, i) {
442
+ return function(o) {
443
+ var s = t(o), r = cn(), a = t(r), u = !1, h, l, c, f = {
444
+ point: p,
445
+ lineStart: d,
446
+ lineEnd: m,
447
+ polygonStart: function() {
448
+ f.point = y, f.lineStart = P, f.lineEnd = _, l = [], h = [];
449
+ },
450
+ polygonEnd: function() {
451
+ f.point = p, f.lineStart = d, f.lineEnd = m, l = Ui(l);
452
+ var D = _o(h, i);
453
+ l.length ? (u || (o.polygonStart(), u = !0), fn(l, Po, D, e, o)) : D && (u || (o.polygonStart(), u = !0), o.lineStart(), e(null, null, 1, o), o.lineEnd()), u && (o.polygonEnd(), u = !1), l = h = null;
454
+ },
455
+ sphere: function() {
456
+ o.polygonStart(), o.lineStart(), e(null, null, 1, o), o.lineEnd(), o.polygonEnd();
457
+ }
458
+ };
459
+ function p(D, w) {
460
+ n(D, w) && o.point(D, w);
461
+ }
462
+ function g(D, w) {
463
+ s.point(D, w);
464
+ }
465
+ function d() {
466
+ f.point = g, s.lineStart();
467
+ }
468
+ function m() {
469
+ f.point = p, s.lineEnd();
470
+ }
471
+ function y(D, w) {
472
+ c.push([D, w]), a.point(D, w);
473
+ }
474
+ function P() {
475
+ a.lineStart(), c = [];
476
+ }
477
+ function _() {
478
+ y(c[0][0], c[0][1]), a.lineEnd();
479
+ var D = a.clean(), w = r.result(), x, B = w.length, M, I, j;
480
+ if (c.pop(), h.push(c), c = null, !!B) {
481
+ if (D & 1) {
482
+ if (I = w[0], (M = I.length - 1) > 0) {
483
+ for (u || (o.polygonStart(), u = !0), o.lineStart(), x = 0; x < M; ++x) o.point((j = I[x])[0], j[1]);
484
+ o.lineEnd();
485
+ }
486
+ return;
487
+ }
488
+ B > 1 && D & 2 && w.push(w.pop().concat(w.shift())), l.push(w.filter(vo));
489
+ }
490
+ }
491
+ return f;
492
+ };
493
+ }
494
+ function vo(n) {
495
+ return n.length > 1;
496
+ }
497
+ function Po(n, t) {
498
+ return ((n = n.x)[0] < 0 ? n[1] - Q - E : Q - n[1]) - ((t = t.x)[0] < 0 ? t[1] - Q - E : Q - t[1]);
499
+ }
500
+ const zi = pn(
501
+ function() {
502
+ return !0;
503
+ },
504
+ Do,
505
+ So,
506
+ [-z, -Q]
507
+ );
508
+ function Do(n) {
509
+ var t = NaN, e = NaN, i = NaN, o;
510
+ return {
511
+ lineStart: function() {
512
+ n.lineStart(), o = 1;
513
+ },
514
+ point: function(s, r) {
515
+ var a = s > 0 ? z : -z, u = k(s - t);
516
+ k(u - z) < E ? (n.point(t, e = (e + r) / 2 > 0 ? Q : -Q), n.point(i, e), n.lineEnd(), n.lineStart(), n.point(a, e), n.point(s, e), o = 0) : i !== a && u >= z && (k(t - i) < E && (t -= i * E), k(s - a) < E && (s -= a * E), e = wo(t, e, s, r), n.point(i, e), n.lineEnd(), n.lineStart(), n.point(a, e), o = 0), n.point(t = s, e = r), i = a;
517
+ },
518
+ lineEnd: function() {
519
+ n.lineEnd(), t = e = NaN;
520
+ },
521
+ clean: function() {
522
+ return 2 - o;
523
+ }
524
+ };
525
+ }
526
+ function wo(n, t, e, i) {
527
+ var o, s, r = C(n - e);
528
+ return k(r) > E ? Qi((C(t) * (s = T(i)) * C(e) - C(i) * (o = T(t)) * C(n)) / (o * s * r)) : (t + i) / 2;
529
+ }
530
+ function So(n, t, e, i) {
531
+ var o;
532
+ if (n == null)
533
+ o = e * Q, i.point(-z, o), i.point(0, o), i.point(z, o), i.point(z, 0), i.point(z, -o), i.point(0, -o), i.point(-z, -o), i.point(-z, 0), i.point(-z, o);
534
+ else if (k(n[0] - t[0]) > E) {
535
+ var s = n[0] < t[0] ? z : -z;
536
+ o = e * s / 2, i.point(-s, o), i.point(0, o), i.point(s, o);
537
+ } else
538
+ i.point(t[0], t[1]);
539
+ }
540
+ function xo(n) {
541
+ var t = T(n), e = 2 * L, i = t > 0, o = k(t) > E;
542
+ function s(l, c, f, p) {
543
+ yo(p, n, e, f, l, c);
544
+ }
545
+ function r(l, c) {
546
+ return T(l) * T(c) > t;
547
+ }
548
+ function a(l) {
549
+ var c, f, p, g, d;
550
+ return {
551
+ lineStart: function() {
552
+ g = p = !1, d = 1;
553
+ },
554
+ point: function(m, y) {
555
+ var P = [m, y], _, D = r(m, y), w = i ? D ? 0 : h(m, y) : D ? h(m + (m < 0 ? z : -z), y) : 0;
556
+ if (!c && (g = p = D) && l.lineStart(), D !== p && (_ = u(c, P), (!_ || Ut(c, _) || Ut(P, _)) && (P[2] = 1)), D !== p)
557
+ d = 0, D ? (l.lineStart(), _ = u(P, c), l.point(_[0], _[1])) : (_ = u(c, P), l.point(_[0], _[1], 2), l.lineEnd()), c = _;
558
+ else if (o && c && i ^ D) {
559
+ var x;
560
+ !(w & f) && (x = u(P, c, !0)) && (d = 0, i ? (l.lineStart(), l.point(x[0][0], x[0][1]), l.point(x[1][0], x[1][1]), l.lineEnd()) : (l.point(x[1][0], x[1][1]), l.lineEnd(), l.lineStart(), l.point(x[0][0], x[0][1], 3)));
561
+ }
562
+ D && (!c || !Ut(c, P)) && l.point(P[0], P[1]), c = P, p = D, f = w;
563
+ },
564
+ lineEnd: function() {
565
+ p && l.lineEnd(), c = null;
566
+ },
567
+ // Rejoin first and last segments if there were intersections and the first
568
+ // and last points were visible.
569
+ clean: function() {
570
+ return d | (g && p) << 1;
571
+ }
572
+ };
573
+ }
574
+ function u(l, c, f) {
575
+ var p = Dt(l), g = Dt(c), d = [1, 0, 0], m = Mt(p, g), y = Wt(m, m), P = m[0], _ = y - P * P;
576
+ if (!_) return !f && l;
577
+ var D = t * y / _, w = -t * P / _, x = Mt(d, m), B = Jt(d, D), M = Jt(m, w);
578
+ Ce(B, M);
579
+ var I = x, j = Wt(B, I), S = Wt(I, I), F = j * j - S * (Wt(B, B) - 1);
580
+ if (!(F < 0)) {
581
+ var A = st(F), Y = Jt(I, (-j - A) / S);
582
+ if (Ce(Y, B), Y = se(Y), !f) return Y;
583
+ var v = l[0], R = c[0], O = l[1], q = c[1], et;
584
+ R < v && (et = v, v = R, R = et);
585
+ var Nt = R - v, ht = k(Nt - z) < E, vt = ht || Nt < E;
586
+ if (!ht && q < O && (et = O, O = q, q = et), vt ? ht ? O + q > 0 ^ Y[1] < (k(Y[0] - v) < E ? O : q) : O <= Y[1] && Y[1] <= q : Nt > z ^ (v <= Y[0] && Y[0] <= R)) {
587
+ var ct = Jt(I, (-j + A) / S);
588
+ return Ce(ct, B), [Y, se(ct)];
589
+ }
590
+ }
591
+ }
592
+ function h(l, c) {
593
+ var f = i ? n : z - n, p = 0;
594
+ return l < -f ? p |= 1 : l > f && (p |= 2), c < -f ? p |= 4 : c > f && (p |= 8), p;
595
+ }
596
+ return pn(r, a, s, i ? [0, -n] : [-z, n - z]);
597
+ }
598
+ function Co(n, t, e, i, o, s) {
599
+ var r = n[0], a = n[1], u = t[0], h = t[1], l = 0, c = 1, f = u - r, p = h - a, g;
600
+ if (g = e - r, !(!f && g > 0)) {
601
+ if (g /= f, f < 0) {
602
+ if (g < l) return;
603
+ g < c && (c = g);
604
+ } else if (f > 0) {
605
+ if (g > c) return;
606
+ g > l && (l = g);
607
+ }
608
+ if (g = o - r, !(!f && g < 0)) {
609
+ if (g /= f, f < 0) {
610
+ if (g > c) return;
611
+ g > l && (l = g);
612
+ } else if (f > 0) {
613
+ if (g < l) return;
614
+ g < c && (c = g);
615
+ }
616
+ if (g = i - a, !(!p && g > 0)) {
617
+ if (g /= p, p < 0) {
618
+ if (g < l) return;
619
+ g < c && (c = g);
620
+ } else if (p > 0) {
621
+ if (g > c) return;
622
+ g > l && (l = g);
623
+ }
624
+ if (g = s - a, !(!p && g < 0)) {
625
+ if (g /= p, p < 0) {
626
+ if (g > c) return;
627
+ g > l && (l = g);
628
+ } else if (p > 0) {
629
+ if (g < l) return;
630
+ g < c && (c = g);
631
+ }
632
+ return l > 0 && (n[0] = r + l * f, n[1] = a + l * p), c < 1 && (t[0] = r + c * f, t[1] = a + c * p), !0;
633
+ }
634
+ }
635
+ }
636
+ }
637
+ }
638
+ var It = 1e9, Ht = -It;
639
+ function Lo(n, t, e, i) {
640
+ function o(h, l) {
641
+ return n <= h && h <= e && t <= l && l <= i;
642
+ }
643
+ function s(h, l, c, f) {
644
+ var p = 0, g = 0;
645
+ if (h == null || (p = r(h, c)) !== (g = r(l, c)) || u(h, l) < 0 ^ c > 0)
646
+ do
647
+ f.point(p === 0 || p === 3 ? n : e, p > 1 ? i : t);
648
+ while ((p = (p + c + 4) % 4) !== g);
649
+ else
650
+ f.point(l[0], l[1]);
651
+ }
652
+ function r(h, l) {
653
+ return k(h[0] - n) < E ? l > 0 ? 0 : 3 : k(h[0] - e) < E ? l > 0 ? 2 : 1 : k(h[1] - t) < E ? l > 0 ? 1 : 0 : l > 0 ? 3 : 2;
654
+ }
655
+ function a(h, l) {
656
+ return u(h.x, l.x);
657
+ }
658
+ function u(h, l) {
659
+ var c = r(h, 1), f = r(l, 1);
660
+ return c !== f ? c - f : c === 0 ? l[1] - h[1] : c === 1 ? h[0] - l[0] : c === 2 ? h[1] - l[1] : l[0] - h[0];
661
+ }
662
+ return function(h) {
663
+ var l = h, c = cn(), f, p, g, d, m, y, P, _, D, w, x, B = {
664
+ point: M,
665
+ lineStart: F,
666
+ lineEnd: A,
667
+ polygonStart: j,
668
+ polygonEnd: S
669
+ };
670
+ function M(v, R) {
671
+ o(v, R) && l.point(v, R);
672
+ }
673
+ function I() {
674
+ for (var v = 0, R = 0, O = p.length; R < O; ++R)
675
+ for (var q = p[R], et = 1, Nt = q.length, ht = q[0], vt, ct, Ot = ht[0], St = ht[1]; et < Nt; ++et)
676
+ vt = Ot, ct = St, ht = q[et], Ot = ht[0], St = ht[1], ct <= i ? St > i && (Ot - vt) * (i - ct) > (St - ct) * (n - vt) && ++v : St <= i && (Ot - vt) * (i - ct) < (St - ct) * (n - vt) && --v;
677
+ return v;
678
+ }
679
+ function j() {
680
+ l = c, f = [], p = [], x = !0;
681
+ }
682
+ function S() {
683
+ var v = I(), R = x && v, O = (f = Ui(f)).length;
684
+ (R || O) && (h.polygonStart(), R && (h.lineStart(), s(null, null, 1, h), h.lineEnd()), O && fn(f, a, v, s, h), h.polygonEnd()), l = h, f = p = g = null;
685
+ }
686
+ function F() {
687
+ B.point = Y, p && p.push(g = []), w = !0, D = !1, P = _ = NaN;
688
+ }
689
+ function A() {
690
+ f && (Y(d, m), y && D && c.rejoin(), f.push(c.result())), B.point = M, D && l.lineEnd();
691
+ }
692
+ function Y(v, R) {
693
+ var O = o(v, R);
694
+ if (p && g.push([v, R]), w)
695
+ d = v, m = R, y = O, w = !1, O && (l.lineStart(), l.point(v, R));
696
+ else if (O && D) l.point(v, R);
697
+ else {
698
+ var q = [P = Math.max(Ht, Math.min(It, P)), _ = Math.max(Ht, Math.min(It, _))], et = [v = Math.max(Ht, Math.min(It, v)), R = Math.max(Ht, Math.min(It, R))];
699
+ Co(q, et, n, t, e, i) ? (D || (l.lineStart(), l.point(q[0], q[1])), l.point(et[0], et[1]), O || l.lineEnd(), x = !1) : O && (l.lineStart(), l.point(v, R), x = !1);
700
+ }
701
+ P = v, _ = R, D = O;
702
+ }
703
+ return B;
704
+ };
705
+ }
706
+ var Ae, Oe, Qt, Kt, Tt = {
707
+ sphere: $,
708
+ point: $,
709
+ lineStart: Mo,
710
+ lineEnd: $,
711
+ polygonStart: $,
712
+ polygonEnd: $
713
+ };
714
+ function Mo() {
715
+ Tt.point = Eo, Tt.lineEnd = To;
716
+ }
717
+ function To() {
718
+ Tt.point = Tt.lineEnd = $;
719
+ }
720
+ function Eo(n, t) {
721
+ n *= L, t *= L, Oe = n, Qt = C(t), Kt = T(t), Tt.point = No;
722
+ }
723
+ function No(n, t) {
724
+ n *= L, t *= L;
725
+ var e = C(t), i = T(t), o = k(n - Oe), s = T(o), r = C(o), a = i * r, u = Kt * e - Qt * i * s, h = Qt * e + Kt * i * s;
726
+ Ae.add(ot(st(a * a + u * u), h)), Oe = n, Qt = e, Kt = i;
727
+ }
728
+ function gn(n) {
729
+ return Ae = new b(), rt(n, Tt), +Ae;
730
+ }
731
+ var Fe = [null, null], Ro = { type: "LineString", coordinates: Fe };
732
+ function Io(n, t) {
733
+ return Fe[0] = n, Fe[1] = t, gn(Ro);
734
+ }
735
+ function Bi(n, t, e) {
736
+ var i = xt(n, t - E, e).concat(t);
737
+ return function(o) {
738
+ return i.map(function(s) {
739
+ return [o, s];
740
+ });
741
+ };
742
+ }
743
+ function ki(n, t, e) {
744
+ var i = xt(n, t - E, e).concat(t);
745
+ return function(o) {
746
+ return i.map(function(s) {
747
+ return [s, o];
748
+ });
749
+ };
750
+ }
751
+ function zo() {
752
+ var n, t, e, i, o, s, r, a, u = 10, h = u, l = 90, c = 360, f, p, g, d, m = 2.5;
753
+ function y() {
754
+ return { type: "MultiLineString", coordinates: P() };
755
+ }
756
+ function P() {
757
+ return xt(bt(i / l) * l, e, l).map(g).concat(xt(bt(a / c) * c, r, c).map(d)).concat(xt(bt(t / u) * u, n, u).filter(function(_) {
758
+ return k(_ % l) > E;
759
+ }).map(f)).concat(xt(bt(s / h) * h, o, h).filter(function(_) {
760
+ return k(_ % c) > E;
761
+ }).map(p));
762
+ }
763
+ return y.lines = function() {
764
+ return P().map(function(_) {
765
+ return { type: "LineString", coordinates: _ };
766
+ });
767
+ }, y.outline = function() {
768
+ return {
769
+ type: "Polygon",
770
+ coordinates: [
771
+ g(i).concat(
772
+ d(r).slice(1),
773
+ g(e).reverse().slice(1),
774
+ d(a).reverse().slice(1)
775
+ )
776
+ ]
777
+ };
778
+ }, y.extent = function(_) {
779
+ return arguments.length ? y.extentMajor(_).extentMinor(_) : y.extentMinor();
780
+ }, y.extentMajor = function(_) {
781
+ return arguments.length ? (i = +_[0][0], e = +_[1][0], a = +_[0][1], r = +_[1][1], i > e && (_ = i, i = e, e = _), a > r && (_ = a, a = r, r = _), y.precision(m)) : [[i, a], [e, r]];
782
+ }, y.extentMinor = function(_) {
783
+ return arguments.length ? (t = +_[0][0], n = +_[1][0], s = +_[0][1], o = +_[1][1], t > n && (_ = t, t = n, n = _), s > o && (_ = s, s = o, o = _), y.precision(m)) : [[t, s], [n, o]];
784
+ }, y.step = function(_) {
785
+ return arguments.length ? y.stepMajor(_).stepMinor(_) : y.stepMinor();
786
+ }, y.stepMajor = function(_) {
787
+ return arguments.length ? (l = +_[0], c = +_[1], y) : [l, c];
788
+ }, y.stepMinor = function(_) {
789
+ return arguments.length ? (u = +_[0], h = +_[1], y) : [u, h];
790
+ }, y.precision = function(_) {
791
+ return arguments.length ? (m = +_, f = Bi(s, o, 90), p = ki(t, n, m), g = Bi(a, r, 90), d = ki(i, e, m), y) : m;
792
+ }, y.extentMajor([[-180, -90 + E], [180, 90 - E]]).extentMinor([[-180, -80 - E], [180, 80 + E]]);
793
+ }
794
+ function Bo(n, t) {
795
+ var e = n[0] * L, i = n[1] * L, o = t[0] * L, s = t[1] * L, r = T(i), a = C(i), u = T(s), h = C(s), l = r * T(e), c = r * C(e), f = u * T(o), p = u * C(o), g = 2 * _t(st(vi(s - i) + r * u * vi(o - e))), d = C(g), m = g ? function(y) {
796
+ var P = C(y *= g) / d, _ = C(g - y) / d, D = _ * l + P * f, w = _ * c + P * p, x = _ * a + P * h;
797
+ return [
798
+ ot(w, D) * Z,
799
+ ot(x, st(D * D + w * w)) * Z
800
+ ];
801
+ } : function() {
802
+ return [e * Z, i * Z];
803
+ };
804
+ return m.distance = g, m;
805
+ }
806
+ const be = (n) => n;
807
+ var Me = new b(), We = new b(), dn, mn, Je, Ve, pt = {
808
+ point: $,
809
+ lineStart: $,
810
+ lineEnd: $,
811
+ polygonStart: function() {
812
+ pt.lineStart = ko, pt.lineEnd = Yo;
813
+ },
814
+ polygonEnd: function() {
815
+ pt.lineStart = pt.lineEnd = pt.point = $, Me.add(k(We)), We = new b();
816
+ },
817
+ result: function() {
818
+ var n = Me / 2;
819
+ return Me = new b(), n;
820
+ }
821
+ };
822
+ function ko() {
823
+ pt.point = jo;
824
+ }
825
+ function jo(n, t) {
826
+ pt.point = yn, dn = Je = n, mn = Ve = t;
827
+ }
828
+ function yn(n, t) {
829
+ We.add(Ve * n - Je * t), Je = n, Ve = t;
830
+ }
831
+ function Yo() {
832
+ yn(dn, mn);
833
+ }
834
+ var Et = 1 / 0, ge = Et, Xt = -Et, de = Xt, me = {
835
+ point: Xo,
836
+ lineStart: $,
837
+ lineEnd: $,
838
+ polygonStart: $,
839
+ polygonEnd: $,
840
+ result: function() {
841
+ var n = [[Et, ge], [Xt, de]];
842
+ return Xt = de = -(ge = Et = 1 / 0), n;
843
+ }
844
+ };
845
+ function Xo(n, t) {
846
+ n < Et && (Et = n), n > Xt && (Xt = n), t < ge && (ge = t), t > de && (de = t);
847
+ }
848
+ var He = 0, qe = 0, zt = 0, ye = 0, _e = 0, Ct = 0, Ue = 0, Qe = 0, Bt = 0, _n, vn, at, lt, it = {
849
+ point: wt,
850
+ lineStart: ji,
851
+ lineEnd: Yi,
852
+ polygonStart: function() {
853
+ it.lineStart = Zo, it.lineEnd = Ao;
854
+ },
855
+ polygonEnd: function() {
856
+ it.point = wt, it.lineStart = ji, it.lineEnd = Yi;
857
+ },
858
+ result: function() {
859
+ var n = Bt ? [Ue / Bt, Qe / Bt] : Ct ? [ye / Ct, _e / Ct] : zt ? [He / zt, qe / zt] : [NaN, NaN];
860
+ return He = qe = zt = ye = _e = Ct = Ue = Qe = Bt = 0, n;
861
+ }
862
+ };
863
+ function wt(n, t) {
864
+ He += n, qe += t, ++zt;
865
+ }
866
+ function ji() {
867
+ it.point = $o;
868
+ }
869
+ function $o(n, t) {
870
+ it.point = Go, wt(at = n, lt = t);
871
+ }
872
+ function Go(n, t) {
873
+ var e = n - at, i = t - lt, o = st(e * e + i * i);
874
+ ye += o * (at + n) / 2, _e += o * (lt + t) / 2, Ct += o, wt(at = n, lt = t);
875
+ }
876
+ function Yi() {
877
+ it.point = wt;
878
+ }
879
+ function Zo() {
880
+ it.point = Oo;
881
+ }
882
+ function Ao() {
883
+ Pn(_n, vn);
884
+ }
885
+ function Oo(n, t) {
886
+ it.point = Pn, wt(_n = at = n, vn = lt = t);
887
+ }
888
+ function Pn(n, t) {
889
+ var e = n - at, i = t - lt, o = st(e * e + i * i);
890
+ ye += o * (at + n) / 2, _e += o * (lt + t) / 2, Ct += o, o = lt * n - at * t, Ue += o * (at + n), Qe += o * (lt + t), Bt += o * 3, wt(at = n, lt = t);
891
+ }
892
+ function Dn(n) {
893
+ this._context = n;
894
+ }
895
+ Dn.prototype = {
896
+ _radius: 4.5,
897
+ pointRadius: function(n) {
898
+ return this._radius = n, this;
899
+ },
900
+ polygonStart: function() {
901
+ this._line = 0;
902
+ },
903
+ polygonEnd: function() {
904
+ this._line = NaN;
905
+ },
906
+ lineStart: function() {
907
+ this._point = 0;
908
+ },
909
+ lineEnd: function() {
910
+ this._line === 0 && this._context.closePath(), this._point = NaN;
911
+ },
912
+ point: function(n, t) {
913
+ switch (this._point) {
914
+ case 0: {
915
+ this._context.moveTo(n, t), this._point = 1;
916
+ break;
917
+ }
918
+ case 1: {
919
+ this._context.lineTo(n, t);
920
+ break;
921
+ }
922
+ default: {
923
+ this._context.moveTo(n + this._radius, t), this._context.arc(n, t, this._radius, 0, H);
924
+ break;
925
+ }
926
+ }
927
+ },
928
+ result: $
929
+ };
930
+ var Ke = new b(), Te, wn, Sn, kt, jt, $t = {
931
+ point: $,
932
+ lineStart: function() {
933
+ $t.point = Fo;
934
+ },
935
+ lineEnd: function() {
936
+ Te && xn(wn, Sn), $t.point = $;
937
+ },
938
+ polygonStart: function() {
939
+ Te = !0;
940
+ },
941
+ polygonEnd: function() {
942
+ Te = null;
943
+ },
944
+ result: function() {
945
+ var n = +Ke;
946
+ return Ke = new b(), n;
947
+ }
948
+ };
949
+ function Fo(n, t) {
950
+ $t.point = xn, wn = kt = n, Sn = jt = t;
951
+ }
952
+ function xn(n, t) {
953
+ kt -= n, jt -= t, Ke.add(st(kt * kt + jt * jt)), kt = n, jt = t;
954
+ }
955
+ let Xi, ve, $i, Gi;
956
+ class Zi {
957
+ constructor(t) {
958
+ this._append = t == null ? Cn : bo(t), this._radius = 4.5, this._ = "";
959
+ }
960
+ pointRadius(t) {
961
+ return this._radius = +t, this;
962
+ }
963
+ polygonStart() {
964
+ this._line = 0;
965
+ }
966
+ polygonEnd() {
967
+ this._line = NaN;
968
+ }
969
+ lineStart() {
970
+ this._point = 0;
971
+ }
972
+ lineEnd() {
973
+ this._line === 0 && (this._ += "Z"), this._point = NaN;
974
+ }
975
+ point(t, e) {
976
+ switch (this._point) {
977
+ case 0: {
978
+ this._append`M${t},${e}`, this._point = 1;
979
+ break;
980
+ }
981
+ case 1: {
982
+ this._append`L${t},${e}`;
983
+ break;
984
+ }
985
+ default: {
986
+ if (this._append`M${t},${e}`, this._radius !== $i || this._append !== ve) {
987
+ const i = this._radius, o = this._;
988
+ this._ = "", this._append`m0,${i}a${i},${i} 0 1,1 0,${-2 * i}a${i},${i} 0 1,1 0,${2 * i}z`, $i = i, ve = this._append, Gi = this._, this._ = o;
989
+ }
990
+ this._ += Gi;
991
+ break;
992
+ }
993
+ }
994
+ }
995
+ result() {
996
+ const t = this._;
997
+ return this._ = "", t.length ? t : null;
998
+ }
999
+ }
1000
+ function Cn(n) {
1001
+ let t = 1;
1002
+ this._ += n[0];
1003
+ for (const e = n.length; t < e; ++t)
1004
+ this._ += arguments[t] + n[t];
1005
+ }
1006
+ function bo(n) {
1007
+ const t = Math.floor(n);
1008
+ if (!(t >= 0)) throw new RangeError(`invalid digits: ${n}`);
1009
+ if (t > 15) return Cn;
1010
+ if (t !== Xi) {
1011
+ const e = 10 ** t;
1012
+ Xi = t, ve = function(o) {
1013
+ let s = 1;
1014
+ this._ += o[0];
1015
+ for (const r = o.length; s < r; ++s)
1016
+ this._ += Math.round(arguments[s] * e) / e + o[s];
1017
+ };
1018
+ }
1019
+ return ve;
1020
+ }
1021
+ function Wo(n, t) {
1022
+ let e = 3, i = 4.5, o, s;
1023
+ function r(a) {
1024
+ return a && (typeof i == "function" && s.pointRadius(+i.apply(this, arguments)), rt(a, o(s))), s.result();
1025
+ }
1026
+ return r.area = function(a) {
1027
+ return rt(a, o(pt)), pt.result();
1028
+ }, r.measure = function(a) {
1029
+ return rt(a, o($t)), $t.result();
1030
+ }, r.bounds = function(a) {
1031
+ return rt(a, o(me)), me.result();
1032
+ }, r.centroid = function(a) {
1033
+ return rt(a, o(it)), it.result();
1034
+ }, r.projection = function(a) {
1035
+ return arguments.length ? (o = a == null ? (n = null, be) : (n = a).stream, r) : n;
1036
+ }, r.context = function(a) {
1037
+ return arguments.length ? (s = a == null ? (t = null, new Zi(e)) : new Dn(t = a), typeof i != "function" && s.pointRadius(i), r) : t;
1038
+ }, r.pointRadius = function(a) {
1039
+ return arguments.length ? (i = typeof a == "function" ? a : (s.pointRadius(+a), +a), r) : i;
1040
+ }, r.digits = function(a) {
1041
+ if (!arguments.length) return e;
1042
+ if (a == null) e = null;
1043
+ else {
1044
+ const u = Math.floor(a);
1045
+ if (!(u >= 0)) throw new RangeError(`invalid digits: ${a}`);
1046
+ e = u;
1047
+ }
1048
+ return t === null && (s = new Zi(e)), r;
1049
+ }, r.projection(n).digits(e).context(t);
1050
+ }
1051
+ function li(n) {
1052
+ return function(t) {
1053
+ var e = new ti();
1054
+ for (var i in n) e[i] = n[i];
1055
+ return e.stream = t, e;
1056
+ };
1057
+ }
1058
+ function ti() {
1059
+ }
1060
+ ti.prototype = {
1061
+ constructor: ti,
1062
+ point: function(n, t) {
1063
+ this.stream.point(n, t);
1064
+ },
1065
+ sphere: function() {
1066
+ this.stream.sphere();
1067
+ },
1068
+ lineStart: function() {
1069
+ this.stream.lineStart();
1070
+ },
1071
+ lineEnd: function() {
1072
+ this.stream.lineEnd();
1073
+ },
1074
+ polygonStart: function() {
1075
+ this.stream.polygonStart();
1076
+ },
1077
+ polygonEnd: function() {
1078
+ this.stream.polygonEnd();
1079
+ }
1080
+ };
1081
+ function ui(n, t, e) {
1082
+ var i = n.clipExtent && n.clipExtent();
1083
+ return n.scale(150).translate([0, 0]), i != null && n.clipExtent(null), rt(e, n.stream(me)), t(me.result()), i != null && n.clipExtent(i), n;
1084
+ }
1085
+ function Ln(n, t, e) {
1086
+ return ui(n, function(i) {
1087
+ var o = t[1][0] - t[0][0], s = t[1][1] - t[0][1], r = Math.min(o / (i[1][0] - i[0][0]), s / (i[1][1] - i[0][1])), a = +t[0][0] + (o - r * (i[1][0] + i[0][0])) / 2, u = +t[0][1] + (s - r * (i[1][1] + i[0][1])) / 2;
1088
+ n.scale(150 * r).translate([a, u]);
1089
+ }, e);
1090
+ }
1091
+ function Jo(n, t, e) {
1092
+ return Ln(n, [[0, 0], t], e);
1093
+ }
1094
+ function Vo(n, t, e) {
1095
+ return ui(n, function(i) {
1096
+ var o = +t, s = o / (i[1][0] - i[0][0]), r = (o - s * (i[1][0] + i[0][0])) / 2, a = -s * i[0][1];
1097
+ n.scale(150 * s).translate([r, a]);
1098
+ }, e);
1099
+ }
1100
+ function Ho(n, t, e) {
1101
+ return ui(n, function(i) {
1102
+ var o = +t, s = o / (i[1][1] - i[0][1]), r = -s * i[0][0], a = (o - s * (i[1][1] + i[0][1])) / 2;
1103
+ n.scale(150 * s).translate([r, a]);
1104
+ }, e);
1105
+ }
1106
+ var Ai = 16, qo = T(30 * L);
1107
+ function Oi(n, t) {
1108
+ return +t ? Qo(n, t) : Uo(n);
1109
+ }
1110
+ function Uo(n) {
1111
+ return li({
1112
+ point: function(t, e) {
1113
+ t = n(t, e), this.stream.point(t[0], t[1]);
1114
+ }
1115
+ });
1116
+ }
1117
+ function Qo(n, t) {
1118
+ function e(i, o, s, r, a, u, h, l, c, f, p, g, d, m) {
1119
+ var y = h - i, P = l - o, _ = y * y + P * P;
1120
+ if (_ > 4 * t && d--) {
1121
+ var D = r + f, w = a + p, x = u + g, B = st(D * D + w * w + x * x), M = _t(x /= B), I = k(k(x) - 1) < E || k(s - c) < E ? (s + c) / 2 : ot(w, D), j = n(I, M), S = j[0], F = j[1], A = S - i, Y = F - o, v = P * A - y * Y;
1122
+ (v * v / _ > t || k((y * A + P * Y) / _ - 0.5) > 0.3 || r * f + a * p + u * g < qo) && (e(i, o, s, r, a, u, S, F, I, D /= B, w /= B, x, d, m), m.point(S, F), e(S, F, I, D, w, x, h, l, c, f, p, g, d, m));
1123
+ }
1124
+ }
1125
+ return function(i) {
1126
+ var o, s, r, a, u, h, l, c, f, p, g, d, m = {
1127
+ point: y,
1128
+ lineStart: P,
1129
+ lineEnd: D,
1130
+ polygonStart: function() {
1131
+ i.polygonStart(), m.lineStart = w;
1132
+ },
1133
+ polygonEnd: function() {
1134
+ i.polygonEnd(), m.lineStart = P;
1135
+ }
1136
+ };
1137
+ function y(M, I) {
1138
+ M = n(M, I), i.point(M[0], M[1]);
1139
+ }
1140
+ function P() {
1141
+ c = NaN, m.point = _, i.lineStart();
1142
+ }
1143
+ function _(M, I) {
1144
+ var j = Dt([M, I]), S = n(M, I);
1145
+ e(c, f, l, p, g, d, c = S[0], f = S[1], l = M, p = j[0], g = j[1], d = j[2], Ai, i), i.point(c, f);
1146
+ }
1147
+ function D() {
1148
+ m.point = y, i.lineEnd();
1149
+ }
1150
+ function w() {
1151
+ P(), m.point = x, m.lineEnd = B;
1152
+ }
1153
+ function x(M, I) {
1154
+ _(o = M, I), s = c, r = f, a = p, u = g, h = d, m.point = _;
1155
+ }
1156
+ function B() {
1157
+ e(c, f, l, p, g, d, s, r, o, a, u, h, Ai, i), m.lineEnd = D, D();
1158
+ }
1159
+ return m;
1160
+ };
1161
+ }
1162
+ var Ko = li({
1163
+ point: function(n, t) {
1164
+ this.stream.point(n * L, t * L);
1165
+ }
1166
+ });
1167
+ function ts(n) {
1168
+ return li({
1169
+ point: function(t, e) {
1170
+ var i = n(t, e);
1171
+ return this.stream.point(i[0], i[1]);
1172
+ }
1173
+ });
1174
+ }
1175
+ function es(n, t, e, i, o) {
1176
+ function s(r, a) {
1177
+ return r *= i, a *= o, [t + n * r, e - n * a];
1178
+ }
1179
+ return s.invert = function(r, a) {
1180
+ return [(r - t) / n * i, (e - a) / n * o];
1181
+ }, s;
1182
+ }
1183
+ function Fi(n, t, e, i, o, s) {
1184
+ if (!s) return es(n, t, e, i, o);
1185
+ var r = T(s), a = C(s), u = r * n, h = a * n, l = r / n, c = a / n, f = (a * e - r * t) / n, p = (a * t + r * e) / n;
1186
+ function g(d, m) {
1187
+ return d *= i, m *= o, [u * d - h * m + t, e - h * d - u * m];
1188
+ }
1189
+ return g.invert = function(d, m) {
1190
+ return [i * (l * d - c * m + f), o * (p - c * d - l * m)];
1191
+ }, g;
1192
+ }
1193
+ function Mn(n) {
1194
+ return Tn(function() {
1195
+ return n;
1196
+ })();
1197
+ }
1198
+ function Tn(n) {
1199
+ var t, e = 150, i = 480, o = 250, s = 0, r = 0, a = 0, u = 0, h = 0, l, c = 0, f = 1, p = 1, g = null, d = zi, m = null, y, P, _, D = be, w = 0.5, x, B, M, I, j;
1200
+ function S(v) {
1201
+ return M(v[0] * L, v[1] * L);
1202
+ }
1203
+ function F(v) {
1204
+ return v = M.invert(v[0], v[1]), v && [v[0] * Z, v[1] * Z];
1205
+ }
1206
+ S.stream = function(v) {
1207
+ return I && j === v ? I : I = Ko(ts(l)(d(x(D(j = v)))));
1208
+ }, S.preclip = function(v) {
1209
+ return arguments.length ? (d = v, g = void 0, Y()) : d;
1210
+ }, S.postclip = function(v) {
1211
+ return arguments.length ? (D = v, m = y = P = _ = null, Y()) : D;
1212
+ }, S.clipAngle = function(v) {
1213
+ return arguments.length ? (d = +v ? xo(g = v * L) : (g = null, zi), Y()) : g * Z;
1214
+ }, S.clipExtent = function(v) {
1215
+ return arguments.length ? (D = v == null ? (m = y = P = _ = null, be) : Lo(m = +v[0][0], y = +v[0][1], P = +v[1][0], _ = +v[1][1]), Y()) : m == null ? null : [[m, y], [P, _]];
1216
+ }, S.scale = function(v) {
1217
+ return arguments.length ? (e = +v, A()) : e;
1218
+ }, S.translate = function(v) {
1219
+ return arguments.length ? (i = +v[0], o = +v[1], A()) : [i, o];
1220
+ }, S.center = function(v) {
1221
+ return arguments.length ? (s = v[0] % 360 * L, r = v[1] % 360 * L, A()) : [s * Z, r * Z];
1222
+ }, S.rotate = function(v) {
1223
+ return arguments.length ? (a = v[0] % 360 * L, u = v[1] % 360 * L, h = v.length > 2 ? v[2] % 360 * L : 0, A()) : [a * Z, u * Z, h * Z];
1224
+ }, S.angle = function(v) {
1225
+ return arguments.length ? (c = v % 360 * L, A()) : c * Z;
1226
+ }, S.reflectX = function(v) {
1227
+ return arguments.length ? (f = v ? -1 : 1, A()) : f < 0;
1228
+ }, S.reflectY = function(v) {
1229
+ return arguments.length ? (p = v ? -1 : 1, A()) : p < 0;
1230
+ }, S.precision = function(v) {
1231
+ return arguments.length ? (x = Oi(B, w = v * v), Y()) : st(w);
1232
+ }, S.fitExtent = function(v, R) {
1233
+ return Ln(S, v, R);
1234
+ }, S.fitSize = function(v, R) {
1235
+ return Jo(S, v, R);
1236
+ }, S.fitWidth = function(v, R) {
1237
+ return Vo(S, v, R);
1238
+ }, S.fitHeight = function(v, R) {
1239
+ return Ho(S, v, R);
1240
+ };
1241
+ function A() {
1242
+ var v = Fi(e, 0, 0, f, p, c).apply(null, t(s, r)), R = Fi(e, i - v[0], o - v[1], f, p, c);
1243
+ return l = hn(a, u, h), B = Ge(t, R), M = Ge(l, B), x = Oi(B, w), Y();
1244
+ }
1245
+ function Y() {
1246
+ return I = j = null, S;
1247
+ }
1248
+ return function() {
1249
+ return t = n.apply(this, arguments), S.invert = t.invert && F, A();
1250
+ };
1251
+ }
1252
+ function hi(n, t) {
1253
+ return [n, Un(Kn((Q + t) / 2))];
1254
+ }
1255
+ hi.invert = function(n, t) {
1256
+ return [n, 2 * Qi(qn(t)) - Q];
1257
+ };
1258
+ function is() {
1259
+ return ns(hi).scale(961 / H);
1260
+ }
1261
+ function ns(n) {
1262
+ var t = Mn(n), e = t.center, i = t.scale, o = t.translate, s = t.clipExtent, r = null, a, u, h;
1263
+ t.scale = function(c) {
1264
+ return arguments.length ? (i(c), l()) : i();
1265
+ }, t.translate = function(c) {
1266
+ return arguments.length ? (o(c), l()) : o();
1267
+ }, t.center = function(c) {
1268
+ return arguments.length ? (e(c), l()) : e();
1269
+ }, t.clipExtent = function(c) {
1270
+ return arguments.length ? (c == null ? r = a = u = h = null : (r = +c[0][0], a = +c[0][1], u = +c[1][0], h = +c[1][1]), l()) : r == null ? null : [[r, a], [u, h]];
1271
+ };
1272
+ function l() {
1273
+ var c = z * i(), f = t(mo(t.rotate()).invert([0, 0]));
1274
+ return s(r == null ? [[f[0] - c, f[1] - c], [f[0] + c, f[1] + c]] : n === hi ? [[Math.max(f[0] - c, r), a], [Math.min(f[0] + c, u), h]] : [[r, Math.max(f[1] - c, a)], [u, Math.min(f[1] + c, h)]]);
1275
+ }
1276
+ return l();
1277
+ }
1278
+ class mt extends Wi {
1279
+ constructor() {
1280
+ super(...arguments), this._types = [], this._geometries = [], this._geoJSONparsed = !1, this._excluded = [], this._notIncluded = [];
1281
+ }
1282
+ _afterNew() {
1283
+ this.fields.push("geometry", "geometryType"), this._setRawDefault("geometryField", "geometry"), this._setRawDefault("geometryTypeField", "geometryType"), this._setRawDefault("idField", "id"), this.on("geoJSON", (t) => {
1284
+ let e = this._prevSettings.geoJSON;
1285
+ e && e != t && this.data.clear();
1286
+ }), super._afterNew();
1287
+ }
1288
+ _handleDirties() {
1289
+ const t = this.get("geoJSON");
1290
+ let e = this._prevSettings.geoJSON;
1291
+ e && e != t && (this._prevSettings.geoJSON = void 0, this._geoJSONparsed = !1), this._geoJSONparsed || (this._parseGeoJSON(), this._geoJSONparsed = !0);
1292
+ }
1293
+ _prepareChildren() {
1294
+ if (super._prepareChildren(), this._valuesDirty && this._handleDirties(), this.get("geoJSON") && (this.isDirty("geoJSON") || this.isDirty("include") || this.isDirty("exclude"))) {
1295
+ this._handleDirties();
1296
+ const t = this.chart, e = this.get("exclude");
1297
+ e && (t && (t._centerLocation = null), N(e, (o) => {
1298
+ const s = this.getDataItemById(o);
1299
+ s && this._excludeDataItem(s);
1300
+ }), N(this._excluded, (o) => {
1301
+ const s = o.get("id");
1302
+ s && e.indexOf(s) == -1 && this._unexcludeDataItem(o);
1303
+ })), (!e || e.length == 0) && (N(this._excluded, (o) => {
1304
+ this._unexcludeDataItem(o);
1305
+ }), this._excluded = []);
1306
+ const i = this.get("include");
1307
+ i && (t && (t._centerLocation = null), N(this.dataItems, (o) => {
1308
+ const s = o.get("id");
1309
+ s && i.indexOf(s) == -1 ? this._notIncludeDataItem(o) : this._unNotIncludeDataItem(o);
1310
+ })), i || (N(this._notIncluded, (o) => {
1311
+ this._unNotIncludeDataItem(o);
1312
+ }), this._notIncluded = []);
1313
+ }
1314
+ }
1315
+ _excludeDataItem(t) {
1316
+ this._removeGeometry(t.get("geometry")), fi(this._excluded, t);
1317
+ }
1318
+ _unexcludeDataItem(t) {
1319
+ this._addGeometry(t.get("geometry"), this);
1320
+ }
1321
+ _notIncludeDataItem(t) {
1322
+ this._removeGeometry(t.get("geometry")), fi(this._notIncluded, t);
1323
+ }
1324
+ _unNotIncludeDataItem(t) {
1325
+ this._addGeometry(t.get("geometry"), this);
1326
+ }
1327
+ checkInclude(t, e, i) {
1328
+ if (e) {
1329
+ if (e.length == 0)
1330
+ return !1;
1331
+ if (e.indexOf(t) == -1)
1332
+ return !1;
1333
+ }
1334
+ return !(i && i.length > 0 && i.indexOf(t) != -1);
1335
+ }
1336
+ _parseGeoJSON() {
1337
+ const t = this.get("geoJSON");
1338
+ if (t) {
1339
+ let e;
1340
+ t.type == "FeatureCollection" ? e = t.features : t.type == "Feature" ? e = [t] : ["Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon"].indexOf(t.type) != -1 ? e = [{ geometry: t }] : console.log("nothing found in geoJSON");
1341
+ const i = this.get("geodataNames");
1342
+ if (e) {
1343
+ const s = this.get("idField", "id");
1344
+ for (let r = 0, a = e.length; r < a; r++) {
1345
+ let u = e[r], h = u.geometry;
1346
+ if (h) {
1347
+ let l = h.type, c = u[s];
1348
+ if (i && i[c] && (u.properties.name = i[c]), this._types.indexOf(l) != -1) {
1349
+ let f;
1350
+ c != null && (f = En(this.dataItems, (g) => g.get("id") == c));
1351
+ let p;
1352
+ f && (p = f.dataContext), f ? p.geometry || (p.geometry = h, p.geometryType = l, f.set("geometry", h), f.set("geometryType", l), this.processDataItem(f)) : (p = { geometry: h, geometryType: l, madeFromGeoData: !0 }, p[s] = c, this.data.push(p)), Nn(u.properties, p);
1353
+ }
1354
+ }
1355
+ }
1356
+ }
1357
+ const o = "geodataprocessed";
1358
+ this.events.isEnabled(o) && this.events.dispatch(o, { type: o, target: this });
1359
+ }
1360
+ }
1361
+ _placeBulletsContainer(t) {
1362
+ this.children.moveValue(this.bulletsContainer);
1363
+ }
1364
+ _removeBulletsContainer() {
1365
+ }
1366
+ /**
1367
+ * @ignore
1368
+ */
1369
+ projection() {
1370
+ const t = this.chart;
1371
+ if (t)
1372
+ return t.get("projection");
1373
+ }
1374
+ /**
1375
+ * @ignore
1376
+ */
1377
+ geoPath() {
1378
+ const t = this.chart;
1379
+ if (t)
1380
+ return t.getPrivate("geoPath");
1381
+ }
1382
+ _addGeometry(t, e) {
1383
+ if (t && e.get("affectsBounds", !0)) {
1384
+ this._geometries.push(t);
1385
+ const i = this.chart;
1386
+ i && i.markDirtyGeometries();
1387
+ }
1388
+ }
1389
+ _removeGeometry(t) {
1390
+ if (t) {
1391
+ ri(this._geometries, t);
1392
+ const e = this.chart;
1393
+ e && e.markDirtyGeometries();
1394
+ }
1395
+ }
1396
+ _dispose() {
1397
+ super._dispose();
1398
+ const t = this.chart;
1399
+ t && t.series.removeValue(this);
1400
+ }
1401
+ _onDataClear() {
1402
+ super._onDataClear(), this._geoJSONparsed = !1, this._markDirtyKey("exclude");
1403
+ }
1404
+ }
1405
+ mt.className = "MapSeries";
1406
+ mt.classNames = Wi.classNames.concat([mt.className]);
1407
+ class Pe extends we {
1408
+ constructor() {
1409
+ super(...arguments), this._projectionDirty = !1;
1410
+ }
1411
+ _beforeChanged() {
1412
+ if (super._beforeChanged(), this._projectionDirty || this.isDirty("geometry") || this.isDirty("precision")) {
1413
+ const t = this.get("geometry");
1414
+ if (t) {
1415
+ const i = this.getPrivate("series");
1416
+ if (i) {
1417
+ const o = i.chart;
1418
+ if (o) {
1419
+ const s = o.get("projection");
1420
+ let r = null;
1421
+ s && s.clipAngle && (r = s.clipAngle(), s.precision(this.get("precision", 0.5)));
1422
+ const a = this.dataItem, u = o.getPrivate("geoPath");
1423
+ if (u && a)
1424
+ if (this._clear = !0, a.get("lineType", i.get("lineType")) == "straight") {
1425
+ const h = this.get("geometry");
1426
+ if (h) {
1427
+ let l = h.coordinates;
1428
+ if (l) {
1429
+ let c;
1430
+ h.type == "LineString" ? c = [l] : h.type == "MultiLineString" && (c = l), this.set("draw", (f) => {
1431
+ for (let p = 0; p < c.length; p++) {
1432
+ let g = c[p];
1433
+ if (g.length > 0) {
1434
+ const d = g[0], m = o.convert({ longitude: d[0], latitude: d[1] });
1435
+ f.lineTo(m.x, m.y);
1436
+ for (let y = 0; y < g.length; y++) {
1437
+ const P = g[y], _ = o.convert({ longitude: P[0], latitude: P[1] });
1438
+ f.lineTo(_.x, _.y);
1439
+ }
1440
+ }
1441
+ }
1442
+ });
1443
+ }
1444
+ }
1445
+ } else
1446
+ this.set("draw", (h) => {
1447
+ s && i.get("clipBack") === !1 && s.clipAngle(180), u.context(this._display), u(t), u.context(null), s && s.clipAngle && s.clipAngle(r);
1448
+ });
1449
+ }
1450
+ }
1451
+ }
1452
+ const e = "linechanged";
1453
+ this.events.isEnabled(e) && this.events.dispatch(e, { type: e, target: this });
1454
+ }
1455
+ }
1456
+ /**
1457
+ * @ignore
1458
+ */
1459
+ markDirtyProjection() {
1460
+ this.markDirty(), this._projectionDirty = !0;
1461
+ }
1462
+ _clearDirty() {
1463
+ super._clearDirty(), this._projectionDirty = !1;
1464
+ }
1465
+ _getTooltipPoint() {
1466
+ let t = this.get("tooltipX"), e = this.get("tooltipY"), i = 0, o = 0;
1467
+ if (gt(t) && (i = t), gt(e) && (o = e), t instanceof Rn) {
1468
+ const s = this.positionToGeoPoint(t.value), r = this.getPrivate("series");
1469
+ if (r) {
1470
+ const a = r.chart;
1471
+ if (a) {
1472
+ const u = a.convert(s);
1473
+ i = u.x, o = u.y;
1474
+ }
1475
+ }
1476
+ }
1477
+ return { x: i, y: o };
1478
+ }
1479
+ /**
1480
+ * Converts relative position along the line (0-1) into pixel coordinates.
1481
+ *
1482
+ * @param position Position (0-1)
1483
+ * @return Coordinates
1484
+ */
1485
+ positionToGeoPoint(t) {
1486
+ const e = this.get("geometry"), i = this.getPrivate("series"), o = i.chart, s = this.dataItem;
1487
+ if (e && i && o && s) {
1488
+ const r = s.get("lineType", i.get("lineType"));
1489
+ let a = gn(e), u = 0, h, l = 0, c = 0, f, p, g = e.coordinates;
1490
+ if (g) {
1491
+ let d;
1492
+ e.type == "LineString" ? d = [g] : e.type == "MultiLineString" && (d = g);
1493
+ for (let m = 0; m < d.length; m++) {
1494
+ let y = d[m];
1495
+ if (y.length > 1) {
1496
+ for (let P = 1; P < y.length; P++)
1497
+ if (f = y[P - 1], p = y[P], l = u / a, h = Io(f, p), u += h, c = u / a, l <= t && c > t) {
1498
+ m = d.length;
1499
+ break;
1500
+ }
1501
+ } else y.length == 1 && (f = y[0], p = y[0], l = 0, c = 1);
1502
+ }
1503
+ if (f && p) {
1504
+ let m = (t - l) / (c - l), y;
1505
+ if (r == "straight") {
1506
+ let P = o.convert({ longitude: f[0], latitude: f[1] }), _ = o.convert({ longitude: p[0], latitude: p[1] }), D = P.x + (_.x - P.x) * m, w = P.y + (_.y - P.y) * m;
1507
+ return o.invert({ x: D, y: w });
1508
+ } else
1509
+ return y = Bo(f, p)(m), { longitude: y[0], latitude: y[1] };
1510
+ }
1511
+ }
1512
+ }
1513
+ return { longitude: 0, latitude: 0 };
1514
+ }
1515
+ }
1516
+ Pe.className = "MapLine";
1517
+ Pe.classNames = we.classNames.concat([Pe.className]);
1518
+ class Gt extends mt {
1519
+ constructor() {
1520
+ super(...arguments), this.mapLines = this.addDisposer(new Ji(Vi.new({}), () => Pe._new(this._root, {}, [this.mapLines.template]))), this._types = ["LineString", "MultiLineString"];
1521
+ }
1522
+ _afterNew() {
1523
+ this.fields.push("lineType"), this._setRawDefault("lineTypeField", "lineType"), super._afterNew();
1524
+ }
1525
+ /**
1526
+ * @ignore
1527
+ */
1528
+ makeMapLine(t) {
1529
+ const e = this.children.push(this.mapLines.make());
1530
+ return e._setDataItem(t), this.mapLines.push(e), e;
1531
+ }
1532
+ /**
1533
+ * @ignore
1534
+ */
1535
+ markDirtyProjection() {
1536
+ N(this.dataItems, (t) => {
1537
+ let e = t.get("mapLine");
1538
+ e && e.markDirtyProjection();
1539
+ });
1540
+ }
1541
+ _prepareChildren() {
1542
+ super._prepareChildren(), this.isDirty("stroke") && this.mapLines.template.set("stroke", this.get("stroke"));
1543
+ }
1544
+ processDataItem(t) {
1545
+ super.processDataItem(t);
1546
+ let e = t.get("mapLine");
1547
+ e || (e = this.makeMapLine(t)), this._handlePointsToConnect(t), t.on("pointsToConnect", () => {
1548
+ this._handlePointsToConnect(t);
1549
+ }), t.set("mapLine", e), this._addGeometry(t.get("geometry"), this), e.setPrivate("series", this);
1550
+ }
1551
+ _handlePointsToConnect(t) {
1552
+ const e = t.get("pointsToConnect");
1553
+ e && (N(e, (i) => {
1554
+ i.on("geometry", () => {
1555
+ this.markDirtyValues(t);
1556
+ }), i.on("longitude", () => {
1557
+ this.markDirtyValues(t);
1558
+ }), i.on("latitude", () => {
1559
+ this.markDirtyValues(t);
1560
+ });
1561
+ }), this.markDirtyValues(t));
1562
+ }
1563
+ /**
1564
+ * Forces a repaint of the element which relies on data.
1565
+ *
1566
+ * @since 5.0.21
1567
+ */
1568
+ markDirtyValues(t) {
1569
+ if (super.markDirtyValues(), t) {
1570
+ const e = t.get("mapLine");
1571
+ if (e) {
1572
+ const i = t.get("pointsToConnect");
1573
+ if (i) {
1574
+ let o = [];
1575
+ N(i, (r) => {
1576
+ const a = r.get("longitude"), u = r.get("latitude");
1577
+ if (a != null && u != null)
1578
+ o.push([a, u]);
1579
+ else {
1580
+ const h = r.get("geometry");
1581
+ if (h) {
1582
+ const l = h.coordinates;
1583
+ l && o.push([l[0], l[1]]);
1584
+ }
1585
+ }
1586
+ });
1587
+ let s = { type: "LineString", coordinates: o };
1588
+ t.setRaw("geometry", s), e.set("geometry", s);
1589
+ } else
1590
+ e.set("geometry", t.get("geometry"));
1591
+ }
1592
+ }
1593
+ }
1594
+ /**
1595
+ * @ignore
1596
+ */
1597
+ disposeDataItem(t) {
1598
+ super.disposeDataItem(t);
1599
+ const e = t.get("mapLine");
1600
+ e && (this.mapLines.removeValue(e), e.dispose());
1601
+ }
1602
+ /**
1603
+ * @ignore
1604
+ */
1605
+ _excludeDataItem(t) {
1606
+ super._excludeDataItem(t);
1607
+ const e = t.get("mapLine");
1608
+ e && e.setPrivate("visible", !1);
1609
+ }
1610
+ /**
1611
+ * @ignore
1612
+ */
1613
+ _unexcludeDataItem(t) {
1614
+ super._unexcludeDataItem(t);
1615
+ const e = t.get("mapLine");
1616
+ e && e.setPrivate("visible", !0);
1617
+ }
1618
+ /**
1619
+ * @ignore
1620
+ */
1621
+ _notIncludeDataItem(t) {
1622
+ super._notIncludeDataItem(t);
1623
+ const e = t.get("mapLine");
1624
+ e && e.setPrivate("visible", !1);
1625
+ }
1626
+ /**
1627
+ * @ignore
1628
+ */
1629
+ _unNotIncludeDataItem(t) {
1630
+ super._unNotIncludeDataItem(t);
1631
+ const e = t.get("mapLine");
1632
+ e && e.setPrivate("visible", !0);
1633
+ }
1634
+ }
1635
+ Gt.className = "MapLineSeries";
1636
+ Gt.classNames = mt.classNames.concat([Gt.className]);
1637
+ class ei extends Gt {
1638
+ constructor() {
1639
+ super(...arguments), this._dataItem = this.makeDataItem({});
1640
+ }
1641
+ _afterNew() {
1642
+ super._afterNew(), this.dataItems.push(this._dataItem), this._generate();
1643
+ }
1644
+ _updateChildren() {
1645
+ if (super._updateChildren(), this.isDirty("step") && this._generate(), this.isDirty("clipExtent") && this.get("clipExtent")) {
1646
+ const t = this.chart;
1647
+ t && t.events.on("geoboundschanged", () => {
1648
+ this._generate();
1649
+ }), this._generate();
1650
+ }
1651
+ }
1652
+ _generate() {
1653
+ let t = zo();
1654
+ if (t) {
1655
+ if (this.get("clipExtent")) {
1656
+ const i = this.chart;
1657
+ if (i) {
1658
+ const o = i.geoBounds();
1659
+ o && t.extent([[o.left, o.bottom], [o.right, o.top]]);
1660
+ }
1661
+ }
1662
+ const e = this.get("step", 10);
1663
+ t.stepMinor([360, 360]), t.stepMajor([e, e]), this._dataItem.set("geometry", t());
1664
+ }
1665
+ }
1666
+ }
1667
+ ei.className = "GraticuleSeries";
1668
+ ei.classNames = Gt.classNames.concat([ei.className]);
1669
+ class os extends In {
1670
+ setupDefaultRules() {
1671
+ super.setupDefaultRules();
1672
+ const t = this._root.interfaceColors, e = this.rule.bind(this);
1673
+ e("MapChart").setAll({
1674
+ projection: is(),
1675
+ panX: "translateX",
1676
+ panY: "translateY",
1677
+ pinchZoom: !0,
1678
+ zoomStep: 2,
1679
+ zoomLevel: 1,
1680
+ rotationX: 0,
1681
+ rotationY: 0,
1682
+ rotationZ: 0,
1683
+ maxZoomLevel: 32,
1684
+ minZoomLevel: 1,
1685
+ wheelY: "zoom",
1686
+ wheelX: "none",
1687
+ animationEasing: pi(gi),
1688
+ wheelEasing: pi(gi),
1689
+ wheelDuration: 0,
1690
+ wheelSensitivity: 1,
1691
+ maxPanOut: 0.4,
1692
+ centerMapOnZoomOut: !0
1693
+ });
1694
+ {
1695
+ const i = e("MapLine");
1696
+ i.setAll({
1697
+ precision: 0.5,
1698
+ role: "figure"
1699
+ }), Se(i, "stroke", t, "grid");
1700
+ }
1701
+ e("MapPolygonSeries").setAll({
1702
+ affectsBounds: !0
1703
+ }), e("MapPointSeries").setAll({
1704
+ affectsBounds: !1,
1705
+ clipFront: !1,
1706
+ clipBack: !0,
1707
+ autoScale: !1
1708
+ }), e("ClusteredPointSeries").setAll({
1709
+ minDistance: 20,
1710
+ scatterDistance: 3,
1711
+ scatterRadius: 8,
1712
+ stopClusterZoom: 0.95
1713
+ }), e("MapLineSeries").setAll({
1714
+ affectsBounds: !1
1715
+ });
1716
+ {
1717
+ const i = e("MapPolygon");
1718
+ i.setAll({
1719
+ precision: 0.5,
1720
+ isMeasured: !1,
1721
+ role: "figure",
1722
+ fillOpacity: 1,
1723
+ position: "absolute",
1724
+ strokeWidth: 0.2,
1725
+ strokeOpacity: 1
1726
+ }), Se(i, "fill", t, "primaryButton"), Se(i, "stroke", t, "background");
1727
+ }
1728
+ e("Button", ["zoomtools", "home"]).setAll({
1729
+ visible: !1
1730
+ }), e("GraticuleSeries").setAll({
1731
+ step: 10
1732
+ });
1733
+ }
1734
+ }
1735
+ function ci(n) {
1736
+ const t = go(n);
1737
+ return { longitude: t[0], latitude: t[1] };
1738
+ }
1739
+ function te(n) {
1740
+ const t = lo(n);
1741
+ if (t) {
1742
+ const e = { left: t[0][0], right: t[1][0], top: t[1][1], bottom: t[0][1] };
1743
+ return e.right < e.left && (e.right = 180, e.left = -180), e;
1744
+ }
1745
+ return { left: 0, right: 0, top: 0, bottom: 0 };
1746
+ }
1747
+ class ii extends Hi {
1748
+ constructor() {
1749
+ super(...arguments), this._pLat = 0, this._pLon = 0, this._movePoints = {}, this._downZoomLevel = 1, this._doubleDownDistance = 0, this._dirtyGeometries = !1, this._geometryColection = { type: "GeometryCollection", geometries: [] }, this._centerLocation = null, this._mapBounds = [[0, 0], [0, 0]], this._geoCentroid = { longitude: 0, latitude: 0 }, this._geoBounds = { left: 0, right: 0, top: 0, bottom: 0 }, this._prevGeoBounds = { left: 0, right: 0, top: 0, bottom: 0 }, this._dispatchBounds = !1, this._mapFitted = !1, this._centerX = 0, this._centerY = 0;
1750
+ }
1751
+ _makeGeoPath() {
1752
+ const t = this.get("projection"), e = Wo();
1753
+ e.projection(t), this.setPrivateRaw("geoPath", e);
1754
+ }
1755
+ /**
1756
+ * Returns a geoPoint of the current zoom position.
1757
+ *
1758
+ * You can later use it to restore zoom position, e.g.: `chart.zoomToGeoPoint(geoPoint, zoomLevel, true)`.
1759
+ *
1760
+ * @since 5.2.19
1761
+ */
1762
+ geoPoint() {
1763
+ return this.invert(this.seriesContainer.toGlobal({ x: this.width() / 2, y: this.height() / 2 }));
1764
+ }
1765
+ /**
1766
+ * Returns coordinates to geographical center of the map.
1767
+ */
1768
+ geoCentroid() {
1769
+ return this._geoCentroid;
1770
+ }
1771
+ /**
1772
+ * Returns geographical bounds of the map.
1773
+ */
1774
+ geoBounds() {
1775
+ return this._geoBounds;
1776
+ }
1777
+ _handleSetWheel() {
1778
+ const t = this.get("wheelX"), e = this.get("wheelY"), i = this.chartContainer;
1779
+ t != "none" || e != "none" ? (this._wheelDp && this._wheelDp.dispose(), this._wheelDp = i.events.on("wheel", (o) => {
1780
+ const s = this.get("wheelEasing"), r = this.get("wheelSensitivity", 1), a = this.get("wheelDuration", 0), u = o.originalEvent;
1781
+ let h = !1;
1782
+ if (zn(u, this))
1783
+ h = !0;
1784
+ else
1785
+ return;
1786
+ const l = i._display.toLocal(o.point);
1787
+ if (e == "zoom") {
1788
+ if (this.get("zoomLevel") == this.get("minZoomLevel", 1) && u.deltaY > 0)
1789
+ return;
1790
+ this._handleWheelZoom(u.deltaY, l);
1791
+ } else e == "rotateY" ? this._handleWheelRotateY(u.deltaY / 5 * r, a, s) : e == "rotateX" && this._handleWheelRotateX(u.deltaY / 5 * r, a, s);
1792
+ t == "zoom" ? this._handleWheelZoom(u.deltaX, l) : t == "rotateY" ? this._handleWheelRotateY(u.deltaX / 5 * r, a, s) : t == "rotateX" && this._handleWheelRotateX(u.deltaX / 5 * r, a, s), h && u.preventDefault();
1793
+ }), this._disposers.push(this._wheelDp)) : this._wheelDp && this._wheelDp.dispose();
1794
+ }
1795
+ _prepareChildren() {
1796
+ super._prepareChildren();
1797
+ const t = this.get("projection"), e = this.innerWidth(), i = this.innerHeight(), o = this._geometryColection.geometries;
1798
+ if (this.isDirty("projection")) {
1799
+ this._makeGeoPath(), this.markDirtyProjection(), this._fitMap(), t.scale(this.getPrivate("mapScale") * this.get("zoomLevel", 1)), t.rotate && t.rotate([this.get("rotationX", 0), this.get("rotationY", 0), this.get("rotationZ", 0)]);
1800
+ let s = this._prevSettings.projection;
1801
+ if (s && s != t) {
1802
+ let r = e / 2, a = i / 2;
1803
+ if (s.invert) {
1804
+ let u = s.invert([r, a]);
1805
+ if (u) {
1806
+ let h = t(u);
1807
+ if (h) {
1808
+ let l = t.translate(), c = r - (h[0] - l[0]), f = a - (h[1] - l[1]);
1809
+ t.translate([c, f]), this.setRaw("translateX", c), this.setRaw("translateY", f);
1810
+ }
1811
+ }
1812
+ }
1813
+ }
1814
+ }
1815
+ if (this.isPrivateDirty("projectionBlend") && this._projectionBlendData) {
1816
+ const s = this._projectionBlendData, r = this.getPrivate("projectionBlend", 0);
1817
+ s.mutate(r);
1818
+ const a = s.sourceScale + (s.targetScale - s.sourceScale) * r, u = s.sourceTranslateX + (s.targetTranslateX - s.sourceTranslateX) * r, h = s.sourceTranslateY + (s.targetTranslateY - s.sourceTranslateY) * r;
1819
+ s.blended.scale(a * this.get("zoomLevel", 1)), s.blended.translate([u, h]), s.blended.rotate && s.blended.rotate([
1820
+ this.get("rotationX", 0),
1821
+ this.get("rotationY", 0),
1822
+ this.get("rotationZ", 0)
1823
+ ]), this.setPrivateRaw("mapScale", a), this.setRaw("translateX", u), this.setRaw("translateY", h), this.markDirtyProjection(), r >= 1 && (this._projectionRaw = s.targetRaw, this._projectionBlendData = void 0, this._projectionBlendAnim = void 0, this.set("projection", s.target));
1824
+ }
1825
+ if ((this.isDirty("wheelX") || this.isDirty("wheelY")) && this._handleSetWheel(), this._dirtyGeometries && (this._geometryColection.geometries = [], this.series.each((s) => {
1826
+ Bn(this._geometryColection.geometries, s._geometries);
1827
+ }), this._fitMap()), o.length != 0 && (e != this._pw || i != this._ph || this._dirtyGeometries) && e > 0 && i > 0) {
1828
+ let s = e / 2, r = i / 2;
1829
+ t.fitSize([e, i], this._geometryColection);
1830
+ const a = t.scale();
1831
+ if (this.setPrivateRaw("mapScale", a), t.scale(a * this.get("zoomLevel", 1)), this._centerLocation) {
1832
+ let h = t(this._centerLocation);
1833
+ if (h) {
1834
+ let l = t.translate(), c = s - (h[0] - l[0]), f = r - (h[1] - l[1]);
1835
+ t.translate([c, f]), this.setRaw("translateX", c), this.setRaw("translateY", f), this._centerX = l[0], this._centerY = l[1];
1836
+ }
1837
+ }
1838
+ this.markDirtyProjection();
1839
+ const u = this.getPrivate("geoPath");
1840
+ this._mapBounds = u.bounds(this._geometryColection);
1841
+ }
1842
+ if (this._pw = e, this._ph = i, this.isDirty("zoomControl")) {
1843
+ const s = this._prevSettings.zoomControl, r = this.get("zoomControl");
1844
+ r !== s && (this._disposeProperty("zoomControl"), s && s.dispose(), r && (r.setPrivate("chart", this), this.children.push(r)), this.setRaw("zoomControl", r));
1845
+ }
1846
+ if (this.isDirty("zoomLevel")) {
1847
+ t.scale(this.getPrivate("mapScale") * this.get("zoomLevel", 1)), this.markDirtyProjection(), this.series.each((r) => {
1848
+ r.isType("MapPointSeries") && r.get("autoScale") && N(r.dataItems, (a) => {
1849
+ const u = a.bullets;
1850
+ u && N(u, (h) => {
1851
+ const l = h.get("sprite");
1852
+ l && l.set("scale", this.get("zoomLevel"));
1853
+ });
1854
+ });
1855
+ });
1856
+ const s = this.get("zoomControl");
1857
+ if (s) {
1858
+ const r = this.get("zoomLevel", 1);
1859
+ r == this.get("minZoomLevel", 1) ? s.minusButton.set("disabled", !0) : s.minusButton.set("disabled", !1), r == this.get("maxZoomLevel", 32) ? s.plusButton.set("disabled", !0) : s.plusButton.set("disabled", !1);
1860
+ }
1861
+ }
1862
+ (this.isDirty("translateX") || this.isDirty("translateY")) && (t.translate([this.get("translateX", this.width() / 2), this.get("translateY", this.height() / 2)]), this.markDirtyProjection()), t.rotate && (this.isDirty("rotationX") || this.isDirty("rotationY") || this.isDirty("rotationZ")) && (t.rotate([this.get("rotationX", 0), this.get("rotationY", 0), this.get("rotationZ", 0)]), this.markDirtyProjection()), (this.isDirty("pinchZoom") || this.get("panX") || this.get("panY")) && this._setUpTouch();
1863
+ }
1864
+ _fitMap() {
1865
+ const t = this.get("projection");
1866
+ let e = this.innerWidth(), i = this.innerHeight();
1867
+ if (e > 0 && i > 0) {
1868
+ t.fitSize([e, i], this._geometryColection), this.setPrivateRaw("mapScale", t.scale());
1869
+ const o = t.translate();
1870
+ this.setRaw("translateX", o[0]), this.setRaw("translateY", o[1]), this._centerX = o[0], this._centerY = o[1];
1871
+ const s = this.getPrivate("geoPath");
1872
+ this._mapBounds = s.bounds(this._geometryColection), this._geoCentroid = ci(this._geometryColection);
1873
+ const r = te(this._geometryColection);
1874
+ if (this._geoBounds = r, this._geometryColection.geometries.length > 0) {
1875
+ r.left = Ft(this._geoBounds.left, 3), r.right = Ft(this._geoBounds.right, 3), r.top = Ft(this._geoBounds.top, 3), r.bottom = Ft(this._geoBounds.bottom, 3);
1876
+ const a = this._prevGeoBounds;
1877
+ a && !kn(r, a) && (this._dispatchBounds = !0, this._prevGeoBounds = r);
1878
+ }
1879
+ this._mapFitted = !0;
1880
+ }
1881
+ }
1882
+ /**
1883
+ * Returns geographical coordinates for calculated or manual center of the
1884
+ * map.
1885
+ */
1886
+ homeGeoPoint() {
1887
+ let t = this.get("homeGeoPoint");
1888
+ if (!t) {
1889
+ const i = this.getPrivate("geoPath").bounds(this._geometryColection), o = i[0][0], s = i[0][1], r = i[1][0], a = i[1][1];
1890
+ t = this.invert({ x: o + (r - o) / 2, y: s + (a - s) / 2 });
1891
+ }
1892
+ return t;
1893
+ }
1894
+ /**
1895
+ * Repositions the map to the "home" zoom level and center coordinates.
1896
+ *
1897
+ * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Resetting_position_level} for more info
1898
+ * @param duration Animation duration in milliseconds
1899
+ */
1900
+ goHome(t) {
1901
+ this.zoomToGeoPoint(this.homeGeoPoint(), this.get("homeZoomLevel", 1), !0, t, this.get("homeRotationX"), this.get("homeRotationY"));
1902
+ }
1903
+ _updateChildren() {
1904
+ const t = this.get("projection");
1905
+ if (t.invert) {
1906
+ let e = this.innerWidth(), i = this.innerHeight();
1907
+ e > 0 && i > 0 && (this._centerLocation = t.invert([this.innerWidth() / 2, this.innerHeight() / 2]));
1908
+ }
1909
+ super._updateChildren();
1910
+ }
1911
+ _afterChanged() {
1912
+ if (super._afterChanged(), this._dispatchBounds) {
1913
+ this._dispatchBounds = !1;
1914
+ const t = "geoboundschanged";
1915
+ this.events.isEnabled(t) && this.events.dispatch(t, { type: t, target: this });
1916
+ }
1917
+ }
1918
+ _setUpTouch() {
1919
+ this.chartContainer._display.cancelTouch || (this.chartContainer._display.cancelTouch = !!(this.get("pinchZoom") || this.get("panX") || this.get("panY")));
1920
+ }
1921
+ /**
1922
+ * @ignore
1923
+ */
1924
+ markDirtyGeometries() {
1925
+ this._dirtyGeometries = !0, this.markDirty();
1926
+ }
1927
+ /**
1928
+ * @ignore
1929
+ */
1930
+ markDirtyProjection() {
1931
+ this.series.each((t) => {
1932
+ t.markDirtyProjection();
1933
+ });
1934
+ }
1935
+ _afterNew() {
1936
+ this._defaultThemes.push(os.new(this._root)), this._settings.themeTags = jn(this._settings.themeTags, ["map"]), this.children.push(this.bulletsContainer), super._afterNew(), this._makeGeoPath(), this.chartContainer.children.push(this.seriesContainer), this.get("translateX") == null && this.set("translateX", this.width() / 2), this.get("translateY") == null && this.set("translateY", this.height() / 2), this.chartContainer.set("interactive", !0), this.chartContainer.set("interactiveChildren", !1), this.chartContainer.set("background", Yn.new(this._root, {
1937
+ themeTags: ["map", "background"],
1938
+ fill: Xn.fromHex(0),
1939
+ fillOpacity: 0
1940
+ })), this._disposers.push(this.chartContainer.events.on("pointerdown", (e) => {
1941
+ this._handleChartDown(e);
1942
+ })), this._disposers.push(this.chartContainer.events.on("globalpointerup", (e) => {
1943
+ this._handleChartUp(e);
1944
+ })), this._disposers.push(this.chartContainer.events.on("globalpointermove", (e) => {
1945
+ this._handleChartMove(e);
1946
+ }));
1947
+ let t = !1;
1948
+ for (let e = 0; e < di.licenses.length; e++)
1949
+ di.licenses[e].match(/^AM5M.{5,}/i) && (t = !0);
1950
+ t ? this._root._licenseApplied() : this._root._showBranding(), this._setUpTouch();
1951
+ }
1952
+ _handleChartDown(t) {
1953
+ this._downZoomLevel = this.get("zoomLevel", 1);
1954
+ const e = this.chartContainer._downPoints;
1955
+ let i = mi(e).length;
1956
+ if (i == 1) {
1957
+ let o = e[1];
1958
+ o || (o = e[0]), o && o.x == t.point.x && o.y == t.point.y && (i = 0);
1959
+ }
1960
+ if (i > 0) {
1961
+ this._downTranslateX = this.get("translateX"), this._downTranslateY = this.get("translateY"), this._downRotationX = this.get("rotationX"), this._downRotationY = this.get("rotationY"), this._downRotationZ = this.get("rotationZ");
1962
+ const o = this.chartContainer._getDownPointId();
1963
+ if (o) {
1964
+ let s = this._movePoints[o];
1965
+ s && (this.chartContainer._downPoints[o] = s);
1966
+ }
1967
+ } else if (i == 0) {
1968
+ let o = this.chartContainer.get("background");
1969
+ if (o && o.events.enableType("click"), this.get("panX") || this.get("panY")) {
1970
+ this._za && this._za.stop(), this._txa && this._txa.stop(), this._tya && this._tya.stop(), this._rxa && this._rxa.stop(), this._rya && this._rya.stop();
1971
+ const s = this.chartContainer._display.toLocal(t.point);
1972
+ this._downTranslateX = this.get("translateX"), this._downTranslateY = this.get("translateY"), this._downRotationX = this.get("rotationX"), this._downRotationY = this.get("rotationY"), this._downRotationZ = this.get("rotationZ");
1973
+ let r = this.get("projection");
1974
+ if (r.invert) {
1975
+ let a = r.invert([s.x, s.y]), u = r.invert([s.x + 1, s.y + 1]);
1976
+ a && u && (this._pLon = Math.abs(u[0] - a[0]), this._pLat = Math.abs(u[1] - a[1]));
1977
+ }
1978
+ }
1979
+ }
1980
+ }
1981
+ /**
1982
+ * Converts screen coordinates (X and Y) within chart to latitude and
1983
+ * longitude.
1984
+ *
1985
+ * @param point Screen coordinates
1986
+ * @return Geographical coordinates
1987
+ */
1988
+ invert(t) {
1989
+ let e = this.get("projection");
1990
+ if (e.invert) {
1991
+ const i = e.invert([t.x, t.y]);
1992
+ if (i)
1993
+ return { longitude: i[0], latitude: i[1] };
1994
+ }
1995
+ return { longitude: 0, latitude: 0 };
1996
+ }
1997
+ /**
1998
+ * Converts latitude/longitude to screen coordinates (X and Y).
1999
+ *
2000
+ * @param point Geographical coordinates
2001
+ * @param rotationX X rotation of a map if different from current
2002
+ * @param rotationY Y rotation of a map if different from current
2003
+ *
2004
+ * @return Screen coordinates
2005
+ */
2006
+ convert(t, e, i) {
2007
+ let o = this.get("projection"), s;
2008
+ if (o.rotate || (e = void 0, i = void 0), e != null || i != null) {
2009
+ e == null && (e = 0), i == null && (i = 0);
2010
+ let r = o.rotate();
2011
+ o.rotate([e, i, 0]), s = o([t.longitude, t.latitude]), o.rotate(r);
2012
+ } else
2013
+ s = o([t.longitude, t.latitude]);
2014
+ return s ? { x: s[0], y: s[1] } : { x: 0, y: 0 };
2015
+ }
2016
+ _handleChartUp(t) {
2017
+ this.chartContainer._downPoints = {};
2018
+ }
2019
+ _handlePinch() {
2020
+ const t = this.chartContainer;
2021
+ let e = 0, i = [], o = [];
2022
+ if (Ee(t._downPoints, (s, r) => {
2023
+ i[e] = r;
2024
+ let a = this._movePoints[s];
2025
+ a && (o[e] = a), e++;
2026
+ }), i.length > 1 && o.length > 1) {
2027
+ const s = t._display;
2028
+ let r = i[0], a = i[1], u = o[0], h = o[1];
2029
+ if (r && a && u && h) {
2030
+ r = s.toLocal(r), a = s.toLocal(a), u = s.toLocal(u), h = s.toLocal(h);
2031
+ let l = Math.hypot(a.x - r.x, a.y - r.y), f = Math.hypot(h.x - u.x, h.y - u.y) / l * this._downZoomLevel;
2032
+ f = yi(f, this.get("minZoomLevel", 1), this.get("maxZoomLevel", 32));
2033
+ let p = { x: u.x + (h.x - u.x) / 2, y: u.y + (h.y - u.y) / 2 }, g = { x: r.x + (a.x - r.x) / 2, y: r.y + (a.y - r.y) / 2 }, d = this._downTranslateX || 0, m = this._downTranslateY || 0, y = this._downZoomLevel, P = p.x - (-d + g.x) / y * f, _ = p.y - (-m + g.y) / y * f;
2034
+ this.set("zoomLevel", f), this.set("translateX", P), this.set("translateY", _);
2035
+ }
2036
+ }
2037
+ }
2038
+ _handleChartMove(t) {
2039
+ const e = this.chartContainer;
2040
+ let i = e._getDownPoint();
2041
+ const o = e._getDownPointId(), r = t.originalEvent.pointerId;
2042
+ if (this.get("pinchZoom") && r && (this._movePoints[r] = t.point, mi(e._downPoints).length > 1)) {
2043
+ this._handlePinch();
2044
+ return;
2045
+ }
2046
+ if (!(o && r && r != o) && i) {
2047
+ const a = this.get("panX"), u = this.get("panY");
2048
+ if (a != "none" || u != "none") {
2049
+ const h = e._display;
2050
+ let l = h.toLocal(t.point);
2051
+ i = h.toLocal(i);
2052
+ let c = this._downTranslateX, f = this._downTranslateY;
2053
+ if (Math.hypot(i.x - l.x, i.y - l.y) > 5) {
2054
+ let p = e.get("background");
2055
+ if (p && p.events.disableType("click"), gt(c) && gt(f)) {
2056
+ let g = this.get("projection");
2057
+ const d = this.get("zoomLevel", 1), m = this.get("maxPanOut", 0.4), y = this._mapBounds, P = this.width(), _ = this.height(), D = y[1][0] - y[0][0], w = y[1][1] - y[0][1];
2058
+ if (a == "translateX") {
2059
+ c += l.x - i.x;
2060
+ const x = P / 2 - (P / 2 - this._centerX) * d;
2061
+ c = Math.min(c, x + D * m * d), c = Math.max(c, x - D * m * d);
2062
+ }
2063
+ if (u == "translateY") {
2064
+ f += l.y - i.y;
2065
+ const x = _ / 2 - (_ / 2 - this._centerY) * d;
2066
+ f = Math.min(f, x + w * m * d), f = Math.max(f, x - w * m * d);
2067
+ }
2068
+ if (this.set("translateX", c), this.set("translateY", f), g.invert) {
2069
+ let x = g.invert([i.x, i.y]);
2070
+ location && x && (a == "rotateX" && this.set("rotationX", this._downRotationX - (i.x - l.x) * this._pLon), u == "rotateY" && this.set("rotationY", this._downRotationY + (i.y - l.y) * this._pLat));
2071
+ }
2072
+ }
2073
+ }
2074
+ }
2075
+ }
2076
+ }
2077
+ _handleWheelRotateY(t, e, i) {
2078
+ this._rya = this.animate({ key: "rotationY", to: this.get("rotationY", 0) - t, duration: e, easing: i });
2079
+ }
2080
+ _handleWheelRotateX(t, e, i) {
2081
+ this._rxa = this.animate({ key: "rotationX", to: this.get("rotationX", 0) - t, duration: e, easing: i });
2082
+ }
2083
+ _handleWheelZoom(t, e) {
2084
+ let i = this.get("zoomStep", 2), o = this.get("zoomLevel", 1), s = o;
2085
+ t > 0 ? s = o / i : t < 0 && (s = o * i), s != o && this.zoomToPoint(e, s);
2086
+ }
2087
+ /**
2088
+ * Zoom the map to geographical bounds.
2089
+ *
2090
+ * @param geoBounds Bounds
2091
+ * @param duration Animation duration in milliseconds
2092
+ * @param rotationX X rotation of a map at the end of zoom
2093
+ * @param rotationY Y rotation of a map at the end of zoom
2094
+ */
2095
+ zoomToGeoBounds(t, e, i, o) {
2096
+ t.right < t.left && (t.right = 180, t.left = -180);
2097
+ const r = this.getPrivate("geoPath").bounds(this._geometryColection);
2098
+ let a = this.convert({ longitude: t.left, latitude: t.top }, i, o), u = this.convert({ longitude: t.right, latitude: t.bottom }, i, o);
2099
+ a.y < r[0][1] && (a.y = r[0][1]), u.y > r[1][1] && (u.y = r[1][1]);
2100
+ let h = this.get("zoomLevel", 1), l = { left: a.x, right: u.x, top: a.y, bottom: u.y }, c = this.seriesContainer, f = 0.9 * Math.min(c.innerWidth() / (l.right - l.left) * h, c.innerHeight() / (l.bottom - l.top) * h), p = l.left + (l.right - l.left) / 2, g = l.top + (l.bottom - l.top) / 2, d = this.invert({ x: p, y: g });
2101
+ return (i != null || o != null) && this.rotate(i, o), this.zoomToGeoPoint(d, f, !0, e);
2102
+ }
2103
+ /**
2104
+ * Zooms the map to specific screen point.
2105
+ *
2106
+ * @param point Point
2107
+ * @param level Zoom level
2108
+ * @param center Center the map
2109
+ * @param duration Duration of the animation in milliseconds
2110
+ */
2111
+ zoomToPoint(t, e, i, o) {
2112
+ e && (e = yi(e, this.get("minZoomLevel", 1), this.get("maxZoomLevel", 32))), gt(o) || (o = this.get("animationDuration", 0));
2113
+ const s = this.get("animationEasing"), r = this.get("zoomLevel", 1);
2114
+ this.get("centerMapOnZoomOut") && e == this.get("homeZoomLevel", 1) && (t = this.convert(this.homeGeoPoint(), this.get("homeRotationX"), this.get("homeRotationY")), i = !0);
2115
+ let a = t.x, u = t.y, h = this.get("translateX", 0), l = this.get("translateY", 0), c = a, f = u;
2116
+ i && (c = this.width() / 2, f = this.height() / 2);
2117
+ let p = c - (a - h) / r * e, g = f - (u - l) / r * e;
2118
+ return this._txa = this.animate({ key: "translateX", to: p, duration: o, easing: s }), this._tya = this.animate({ key: "translateY", to: g, duration: o, easing: s }), this._za = this.animate({ key: "zoomLevel", to: e, duration: o, easing: s }), r != e && this._root.readerAlert(this._t("Zoom level changed to %1", this._root.locale, $n(e))), this._za;
2119
+ }
2120
+ /**
2121
+ * Zooms the map to specific geographical point.
2122
+ *
2123
+ * @param geoPoint Point
2124
+ * @param level Zoom level
2125
+ * @param center Center the map
2126
+ * @param duration Duration of the animation in milliseconds
2127
+ * @param rotationX X rotation of a map at the end of zoom
2128
+ * @param rotationY Y rotation of a map at the end of zoom
2129
+ *
2130
+ */
2131
+ zoomToGeoPoint(t, e, i, o, s, r) {
2132
+ let a = this.convert(t, s, r);
2133
+ if ((s != null || r != null) && this.rotate(s, r, o), a)
2134
+ return this.zoomToPoint(a, e, i, o);
2135
+ }
2136
+ rotate(t, e, i) {
2137
+ if (this.get("projection").rotate) {
2138
+ gt(i) || (i = this.get("animationDuration", 0));
2139
+ const s = this.get("animationEasing");
2140
+ t != null && this.animate({ key: "rotationX", to: t, duration: i, easing: s }), e != null && this.animate({ key: "rotationY", to: e, duration: i, easing: s });
2141
+ }
2142
+ }
2143
+ /**
2144
+ * Animates the map projection transition from the current projection to
2145
+ * the target projection over the specified duration.
2146
+ *
2147
+ * Since d3-geo does not expose raw projection functions on projection
2148
+ * instances, you must pass both the target `GeoProjection` and its
2149
+ * corresponding `GeoRawProjection`. On the first call you must also
2150
+ * pass `sourceRaw` so the method knows the current projection's raw
2151
+ * function. Subsequent calls reuse the previous target's raw
2152
+ * automatically.
2153
+ *
2154
+ * @param target Target projection (e.g. `geoOrthographic()`)
2155
+ * @param targetRaw Raw projection function (e.g. `geoOrthographicRaw`)
2156
+ * @param duration Duration in milliseconds (default: `animationDuration`)
2157
+ * @param easing Easing function (default: `animationEasing`)
2158
+ * @param sourceRaw Raw function of the current projection (needed on first call)
2159
+ *
2160
+ * @since 5.16.0
2161
+ */
2162
+ animateProjection(t, e, i, o, s) {
2163
+ this._projectionBlendAnim && (this._projectionBlendAnim.stop(), this._projectionBlendAnim = void 0, this._projectionBlendData = void 0), s && (this._projectionRaw = s);
2164
+ const r = this._projectionRaw;
2165
+ if (!r) {
2166
+ this.set("projection", t), this._projectionRaw = e;
2167
+ return;
2168
+ }
2169
+ if (i == null && (i = this.get("animationDuration", 0)), !i) {
2170
+ this.set("projection", t), this._projectionRaw = e;
2171
+ return;
2172
+ }
2173
+ o || (o = this.get("animationEasing")), this._za && this._za.stop(), this._txa && this._txa.stop(), this._tya && this._tya.stop(), this._rxa && this._rxa.stop(), this._rya && this._rya.stop();
2174
+ const a = this.innerWidth(), u = this.innerHeight(), h = this.getPrivate("mapScale"), l = this.get("translateX", a / 2), c = this.get("translateY", u / 2), f = Mn(e);
2175
+ f.fitSize([a, u], this._geometryColection);
2176
+ const p = f.scale(), g = f.translate(), d = Tn((y) => (P, _) => {
2177
+ const D = r(P, _), w = e(P, _);
2178
+ return [
2179
+ (1 - y) * D[0] + y * w[0],
2180
+ (1 - y) * D[1] + y * w[1]
2181
+ ];
2182
+ }), m = d(0);
2183
+ m.scale(h * this.get("zoomLevel", 1)), m.translate([l, c]), m.precision(0.5), m.rotate && m.rotate([
2184
+ this.get("rotationX", 0),
2185
+ this.get("rotationY", 0),
2186
+ this.get("rotationZ", 0)
2187
+ ]), this.setRaw("projection", m), this._makeGeoPath(), this._projectionBlendData = {
2188
+ blended: m,
2189
+ mutate: d,
2190
+ sourceScale: h,
2191
+ targetScale: p,
2192
+ sourceTranslateX: l,
2193
+ sourceTranslateY: c,
2194
+ targetTranslateX: g[0],
2195
+ targetTranslateY: g[1],
2196
+ target: t,
2197
+ targetRaw: e
2198
+ }, this._projectionBlendAnim = this.animatePrivate({
2199
+ key: "projectionBlend",
2200
+ from: 0,
2201
+ to: 1,
2202
+ duration: i,
2203
+ easing: o
2204
+ });
2205
+ }
2206
+ /**
2207
+ * Zooms the map in.
2208
+ */
2209
+ zoomIn() {
2210
+ return this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.get("zoomLevel", 1) * this.get("zoomStep", 2));
2211
+ }
2212
+ /**
2213
+ * Zooms the map out.
2214
+ */
2215
+ zoomOut() {
2216
+ return this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.get("zoomLevel", 1) / this.get("zoomStep", 2));
2217
+ }
2218
+ _clearDirty() {
2219
+ super._clearDirty(), this._dirtyGeometries = !1, this._mapFitted = !1;
2220
+ }
2221
+ /**
2222
+ * Returns area of a mapPolygon in square pixels.
2223
+ */
2224
+ getArea(t) {
2225
+ const e = this.getPrivate("geoPath"), i = t.get("geometry");
2226
+ return i ? e.area(i) : 0;
2227
+ }
2228
+ }
2229
+ ii.className = "MapChart";
2230
+ ii.classNames = Hi.classNames.concat([ii.className]);
2231
+ class Zt extends mt {
2232
+ constructor() {
2233
+ super(...arguments), this._types = ["Point", "MultiPoint"];
2234
+ }
2235
+ _afterNew() {
2236
+ this.fields.push("polygonId", "lineId", "longitude", "latitude", "fixed"), super._afterNew();
2237
+ }
2238
+ /**
2239
+ * @ignore
2240
+ */
2241
+ markDirtyProjection() {
2242
+ this.markDirty();
2243
+ }
2244
+ /**
2245
+ * Forces a repaint of the element which relies on data.
2246
+ *
2247
+ * @since 5.0.21
2248
+ */
2249
+ markDirtyValues(t) {
2250
+ super.markDirtyValues(), t && this._positionBullets(t);
2251
+ }
2252
+ processDataItem(t) {
2253
+ super.processDataItem(t);
2254
+ let e = t.get("geometry");
2255
+ if (!e)
2256
+ e = { type: "Point", coordinates: [t.get("longitude", 0), t.get("latitude", 0)] }, t.set("geometry", e);
2257
+ else if (e.type == "Point") {
2258
+ const i = e.coordinates;
2259
+ i && (t.set("longitude", i[0]), t.set("latitude", i[1]));
2260
+ } else if (e.type == "MultiPoint") {
2261
+ const i = e.coordinates;
2262
+ i && i[0] && (t.set("longitude", i[0][0]), t.set("latitude", i[0][1]));
2263
+ }
2264
+ this._addGeometry(e, this);
2265
+ }
2266
+ _makeBullets(t) {
2267
+ t.bullets = [], this.bullets.each((e) => {
2268
+ const i = t.get("geometry");
2269
+ if (i) {
2270
+ if (i.type == "Point")
2271
+ this._setBulletParent(this._makeBullet(t, e));
2272
+ else if (i.type = "MultiPoint") {
2273
+ let o = 0;
2274
+ N(i.coordinates, () => {
2275
+ this._setBulletParent(this._makeBullet(t, e, o)), o++;
2276
+ });
2277
+ }
2278
+ }
2279
+ });
2280
+ }
2281
+ _setBulletParent(t) {
2282
+ if (t) {
2283
+ const e = t.get("sprite"), i = this.chart;
2284
+ if (e && i) {
2285
+ const o = e.dataItem;
2286
+ o && (o.get("fixed") ? e.parent != i.bulletsContainer && i.bulletsContainer.children.moveValue(e) : e.parent != this.bulletsContainer && this.bulletsContainer.children.moveValue(e));
2287
+ }
2288
+ }
2289
+ }
2290
+ _positionBullet(t) {
2291
+ const e = t.get("sprite");
2292
+ if (e) {
2293
+ const i = e.dataItem;
2294
+ if (i && i.get("fixed"))
2295
+ return;
2296
+ const o = i.get("latitude"), s = i.get("longitude"), r = i.get("lineDataItem"), a = i.get("fixed"), u = this.chart;
2297
+ let h;
2298
+ if (r)
2299
+ h = r.get("mapLine");
2300
+ else {
2301
+ const d = i.get("lineId");
2302
+ d && u && u.series.each((m) => {
2303
+ if (m.isType("MapLineSeries")) {
2304
+ let y = m.getDataItemById(d);
2305
+ y && (i.set("lineDataItem", y), h = y.get("mapLine"));
2306
+ }
2307
+ });
2308
+ }
2309
+ this._lineChangedDp && this._lineChangedDp.dispose(), h && (this._lineChangedDp = h.events.on("linechanged", () => {
2310
+ this._positionBullets(i);
2311
+ }));
2312
+ const l = i.get("polygonDataItem");
2313
+ let c;
2314
+ if (l)
2315
+ c = l.get("mapPolygon");
2316
+ else {
2317
+ const d = i.get("polygonId");
2318
+ d && u && u.series.each((m) => {
2319
+ if (m.isType("MapPolygonSeries")) {
2320
+ let y = m.getDataItemById(d);
2321
+ y && (i.set("polygonDataItem", y), c = y.get("mapPolygon"));
2322
+ }
2323
+ });
2324
+ }
2325
+ const f = i.get("positionOnLine");
2326
+ let p, g;
2327
+ if (c) {
2328
+ let d = c.visualCentroid();
2329
+ p = [d.longitude, d.latitude], i.setRaw("longitude", d.longitude), i.setRaw("latitude", d.latitude);
2330
+ } else if (h && gt(f)) {
2331
+ let d = h.positionToGeoPoint(f);
2332
+ if (p = [d.longitude, d.latitude], i.get("autoRotate", t.get("autoRotate")) && u) {
2333
+ const m = h.positionToGeoPoint(f - 2e-3), y = h.positionToGeoPoint(f + 2e-3), P = u.convert(m), _ = u.convert(y);
2334
+ g = Gn(P, _);
2335
+ }
2336
+ i.setRaw("longitude", d.longitude), i.setRaw("latitude", d.latitude);
2337
+ } else if (gt(s) && gt(o))
2338
+ p = [s, o];
2339
+ else {
2340
+ const d = i.get("geometry");
2341
+ if (d) {
2342
+ if (d.type == "Point")
2343
+ this._positionBulletReal(t, d, d.coordinates, g);
2344
+ else if (d.type == "MultiPoint") {
2345
+ let m = t._index || 0;
2346
+ p = d.coordinates[m];
2347
+ }
2348
+ }
2349
+ }
2350
+ !a && p && this._positionBulletReal(t, { type: "Point", coordinates: p }, p, g);
2351
+ }
2352
+ }
2353
+ _positionBulletReal(t, e, i, o) {
2354
+ const s = t.get("sprite"), r = this.chart;
2355
+ if (r) {
2356
+ const a = r.get("projection"), u = r.getPrivate("geoPath"), h = s.dataItem, l = a(i);
2357
+ if (l) {
2358
+ const f = { x: l[0], y: l[1] };
2359
+ s.setAll(f), h.setRaw("point", f);
2360
+ }
2361
+ let c = !0;
2362
+ u(e) ? this.get("clipFront") && (c = !1) : this.get("clipBack") && (c = !1), s.setPrivate("visible", c), h.set("clipped", !c), h && o != null && h.get("autoRotate", t.get("autoRotate")) && s.set("rotation", o + h.get("autoRotateAngle", t.get("autoRotateAngle", 0)));
2363
+ }
2364
+ }
2365
+ /**
2366
+ * Centers the map to specific series' data item and zooms to the level
2367
+ * specified in the parameters.
2368
+ *
2369
+ * @param dataItem Map point
2370
+ * @param zoomLevel Zoom level
2371
+ * @param rotate If it's true, the map will rotate so that this point would be in the center. Mostly usefull with geoOrthographic projection.
2372
+ */
2373
+ zoomToDataItem(t, e, i) {
2374
+ const o = this.chart;
2375
+ if (o) {
2376
+ const s = t.get("longitude", 0), r = t.get("latitude", 0);
2377
+ return i ? o.zoomToGeoPoint({ longitude: s, latitude: r }, e, !0, void 0, -s, -r) : o.zoomToGeoPoint({ longitude: s, latitude: r }, e, !0);
2378
+ }
2379
+ }
2380
+ /**
2381
+ * Zooms the map in so that all points in the array are visible.
2382
+ *
2383
+ * @param dataItems An array of data items of points to zoom to
2384
+ * @param rotate Rotate the map so it is centered on the selected items
2385
+ * @return Animation
2386
+ * @since 5.5.6
2387
+ */
2388
+ zoomToDataItems(t, e) {
2389
+ let i = null, o = null, s = null, r = null;
2390
+ if (N(t, (a) => {
2391
+ const u = a.get("longitude", 0), h = a.get("latitude", 0);
2392
+ (i == null || i > u) && (i = u), (o == null || o < u) && (o = u), (s == null || s < h) && (s = h), (r == null || r > h) && (r = h);
2393
+ }), i != null && o != null && s != null && r != null) {
2394
+ const a = this.chart;
2395
+ if (a)
2396
+ return e ? a.zoomToGeoBounds({ left: i, right: o, top: s, bottom: r }, void 0, -(i + (o - i) / 2), -(s + (s - r) / 2)) : a.zoomToGeoBounds({ left: i, right: o, top: s, bottom: r });
2397
+ }
2398
+ }
2399
+ /**
2400
+ * @ignore
2401
+ */
2402
+ disposeDataItem(t) {
2403
+ const e = this.chart;
2404
+ e && e.series.each((i) => {
2405
+ i.isType("MapLineSeries") && N(i.dataItems, (o) => {
2406
+ const s = o.get("pointsToConnect");
2407
+ s && N(s, (r) => {
2408
+ r == t && (ri(s, r), i.markDirtyValues(o));
2409
+ });
2410
+ });
2411
+ }), super.disposeDataItem(t);
2412
+ }
2413
+ /**
2414
+ * @ignore
2415
+ */
2416
+ _excludeDataItem(t) {
2417
+ super._excludeDataItem(t);
2418
+ const e = t.bullets;
2419
+ e && N(e, (i) => {
2420
+ const o = i.get("sprite");
2421
+ o && o.setPrivate("visible", !1);
2422
+ });
2423
+ }
2424
+ /**
2425
+ * @ignore
2426
+ */
2427
+ _unexcludeDataItem(t) {
2428
+ super._unexcludeDataItem(t);
2429
+ const e = t.bullets;
2430
+ e && N(e, (i) => {
2431
+ const o = i.get("sprite");
2432
+ o && o.setPrivate("visible", !0);
2433
+ });
2434
+ }
2435
+ /**
2436
+ * @ignore
2437
+ */
2438
+ _notIncludeDataItem(t) {
2439
+ super._notIncludeDataItem(t);
2440
+ const e = t.bullets;
2441
+ e && N(e, (i) => {
2442
+ const o = i.get("sprite");
2443
+ o && o.setPrivate("visible", !1);
2444
+ });
2445
+ }
2446
+ /**
2447
+ * @ignore
2448
+ */
2449
+ _unNotIncludeDataItem(t) {
2450
+ super._unNotIncludeDataItem(t);
2451
+ const e = t.bullets;
2452
+ e && N(e, (i) => {
2453
+ const o = i.get("sprite");
2454
+ o && o.setPrivate("visible", !0);
2455
+ });
2456
+ }
2457
+ }
2458
+ Zt.className = "MapPointSeries";
2459
+ Zt.classNames = mt.classNames.concat([Zt.className]);
2460
+ var qt = { exports: {} };
2461
+ class ss {
2462
+ constructor(t = [], e = rs) {
2463
+ if (this.data = t, this.length = this.data.length, this.compare = e, this.length > 0)
2464
+ for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);
2465
+ }
2466
+ push(t) {
2467
+ this.data.push(t), this.length++, this._up(this.length - 1);
2468
+ }
2469
+ pop() {
2470
+ if (this.length === 0) return;
2471
+ const t = this.data[0], e = this.data.pop();
2472
+ return this.length--, this.length > 0 && (this.data[0] = e, this._down(0)), t;
2473
+ }
2474
+ peek() {
2475
+ return this.data[0];
2476
+ }
2477
+ _up(t) {
2478
+ const { data: e, compare: i } = this, o = e[t];
2479
+ for (; t > 0; ) {
2480
+ const s = t - 1 >> 1, r = e[s];
2481
+ if (i(o, r) >= 0) break;
2482
+ e[t] = r, t = s;
2483
+ }
2484
+ e[t] = o;
2485
+ }
2486
+ _down(t) {
2487
+ const { data: e, compare: i } = this, o = this.length >> 1, s = e[t];
2488
+ for (; t < o; ) {
2489
+ let r = (t << 1) + 1, a = e[r];
2490
+ const u = r + 1;
2491
+ if (u < this.length && i(e[u], a) < 0 && (r = u, a = e[u]), i(a, s) >= 0) break;
2492
+ e[t] = a, t = r;
2493
+ }
2494
+ e[t] = s;
2495
+ }
2496
+ }
2497
+ function rs(n, t) {
2498
+ return n < t ? -1 : n > t ? 1 : 0;
2499
+ }
2500
+ const as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2501
+ __proto__: null,
2502
+ default: ss
2503
+ }, Symbol.toStringTag, { value: "Module" })), ls = /* @__PURE__ */ Wn(as);
2504
+ var bi;
2505
+ function us() {
2506
+ if (bi) return qt.exports;
2507
+ bi = 1;
2508
+ var n = ls;
2509
+ n.default && (n = n.default), qt.exports = t, qt.exports.default = t;
2510
+ function t(a, u, h) {
2511
+ u = u || 1;
2512
+ for (var l, c, f, p, g = 0; g < a[0].length; g++) {
2513
+ var d = a[0][g];
2514
+ (!g || d[0] < l) && (l = d[0]), (!g || d[1] < c) && (c = d[1]), (!g || d[0] > f) && (f = d[0]), (!g || d[1] > p) && (p = d[1]);
2515
+ }
2516
+ var m = f - l, y = p - c, P = Math.min(m, y), _ = P / 2;
2517
+ if (P === 0) {
2518
+ var D = [l, c];
2519
+ return D.distance = 0, D;
2520
+ }
2521
+ for (var w = new n(void 0, e), x = l; x < f; x += P)
2522
+ for (var B = c; B < p; B += P)
2523
+ w.push(new i(x + _, B + _, _, a));
2524
+ var M = s(a), I = new i(l + m / 2, c + y / 2, 0, a);
2525
+ I.d > M.d && (M = I);
2526
+ for (var j = w.length; w.length; ) {
2527
+ var S = w.pop();
2528
+ S.d > M.d && (M = S, h && console.log("found best %d after %d probes", Math.round(1e4 * S.d) / 1e4, j)), !(S.max - M.d <= u) && (_ = S.h / 2, w.push(new i(S.x - _, S.y - _, _, a)), w.push(new i(S.x + _, S.y - _, _, a)), w.push(new i(S.x - _, S.y + _, _, a)), w.push(new i(S.x + _, S.y + _, _, a)), j += 4);
2529
+ }
2530
+ h && (console.log("num probes: " + j), console.log("best distance: " + M.d));
2531
+ var F = [M.x, M.y];
2532
+ return F.distance = M.d, F;
2533
+ }
2534
+ function e(a, u) {
2535
+ return u.max - a.max;
2536
+ }
2537
+ function i(a, u, h, l) {
2538
+ this.x = a, this.y = u, this.h = h, this.d = o(a, u, l), this.max = this.d + this.h * Math.SQRT2;
2539
+ }
2540
+ function o(a, u, h) {
2541
+ for (var l = !1, c = 1 / 0, f = 0; f < h.length; f++)
2542
+ for (var p = h[f], g = 0, d = p.length, m = d - 1; g < d; m = g++) {
2543
+ var y = p[g], P = p[m];
2544
+ y[1] > u != P[1] > u && a < (P[0] - y[0]) * (u - y[1]) / (P[1] - y[1]) + y[0] && (l = !l), c = Math.min(c, r(a, u, y, P));
2545
+ }
2546
+ return c === 0 ? 0 : (l ? 1 : -1) * Math.sqrt(c);
2547
+ }
2548
+ function s(a) {
2549
+ for (var u = 0, h = 0, l = 0, c = a[0], f = 0, p = c.length, g = p - 1; f < p; g = f++) {
2550
+ var d = c[f], m = c[g], y = d[0] * m[1] - m[0] * d[1];
2551
+ h += (d[0] + m[0]) * y, l += (d[1] + m[1]) * y, u += y * 3;
2552
+ }
2553
+ return u === 0 ? new i(c[0][0], c[0][1], 0, a) : new i(h / u, l / u, 0, a);
2554
+ }
2555
+ function r(a, u, h, l) {
2556
+ var c = h[0], f = h[1], p = l[0] - c, g = l[1] - f;
2557
+ if (p !== 0 || g !== 0) {
2558
+ var d = ((a - c) * p + (u - f) * g) / (p * p + g * g);
2559
+ d > 1 ? (c = l[0], f = l[1]) : d > 0 && (c += p * d, f += g * d);
2560
+ }
2561
+ return p = a - c, g = u - f, p * p + g * g;
2562
+ }
2563
+ return qt.exports;
2564
+ }
2565
+ var hs = us();
2566
+ const cs = /* @__PURE__ */ Jn(hs);
2567
+ class De extends we {
2568
+ constructor() {
2569
+ super(...arguments), this._projectionDirty = !1;
2570
+ }
2571
+ _afterNew() {
2572
+ super._afterNew(), this.setPrivate("trustBounds", !0);
2573
+ }
2574
+ _beforeChanged() {
2575
+ if (super._beforeChanged(), this._projectionDirty || this.isDirty("geometry") || this.isDirty("precision")) {
2576
+ const t = this.get("geometry");
2577
+ if (t) {
2578
+ const e = this.series;
2579
+ if (e) {
2580
+ const i = e.projection();
2581
+ i && i.precision(this.get("precision", 0.5));
2582
+ const o = e.geoPath();
2583
+ o && (this._clear = !0, this.set("draw", (s) => {
2584
+ o.context(this._display), o(t), o.context(null);
2585
+ }), this.isHover() && this.showTooltip());
2586
+ }
2587
+ }
2588
+ }
2589
+ }
2590
+ /**
2591
+ * @ignore
2592
+ */
2593
+ markDirtyProjection() {
2594
+ this.markDirty(), this._projectionDirty = !0;
2595
+ }
2596
+ _clearDirty() {
2597
+ super._clearDirty(), this._projectionDirty = !1;
2598
+ }
2599
+ /**
2600
+ * Returns latitude/longitude of the geometrical center of the polygon.
2601
+ *
2602
+ * @return Center
2603
+ */
2604
+ geoCentroid() {
2605
+ const t = this.get("geometry");
2606
+ return t ? ci(t) : { latitude: 0, longitude: 0 };
2607
+ }
2608
+ /**
2609
+ * Returns latitude/longitude of the visual center of the polygon.
2610
+ *
2611
+ * @return Center
2612
+ */
2613
+ visualCentroid() {
2614
+ let t = 0, e = [];
2615
+ const i = this.get("geometry");
2616
+ if (i) {
2617
+ if (i.type == "Polygon")
2618
+ e = i.coordinates;
2619
+ else if (i.type == "MultiPolygon")
2620
+ for (let o = 0; o < i.coordinates.length; o++) {
2621
+ let s = i.coordinates[o], r = oo({ type: "Polygon", coordinates: s });
2622
+ r > t && (e = s, t = r);
2623
+ }
2624
+ if (e) {
2625
+ let o = cs(e);
2626
+ return { longitude: o[0], latitude: o[1] };
2627
+ }
2628
+ }
2629
+ return { longitude: 0, latitude: 0 };
2630
+ }
2631
+ _getTooltipPoint() {
2632
+ const t = this.series;
2633
+ if (t) {
2634
+ const e = t.projection();
2635
+ if (e) {
2636
+ const i = this.visualCentroid(), o = e([i.longitude, i.latitude]);
2637
+ if (o)
2638
+ return { x: o[0], y: o[1] };
2639
+ }
2640
+ }
2641
+ return { x: 0, y: 0 };
2642
+ }
2643
+ }
2644
+ De.className = "MapPolygon";
2645
+ De.classNames = we.classNames.concat([De.className]);
2646
+ class ni extends mt {
2647
+ constructor() {
2648
+ super(...arguments), this.mapPolygons = this.addDisposer(new Ji(Vi.new({}), () => De._new(this._root, {}, [this.mapPolygons.template]))), this._types = ["Polygon", "MultiPolygon"];
2649
+ }
2650
+ /**
2651
+ * @ignore
2652
+ */
2653
+ makeMapPolygon(t) {
2654
+ const e = this.children.push(this.mapPolygons.make());
2655
+ return e._setDataItem(t), this.mapPolygons.push(e), e;
2656
+ }
2657
+ /**
2658
+ * @ignore
2659
+ */
2660
+ markDirtyProjection() {
2661
+ N(this.dataItems, (t) => {
2662
+ let e = t.get("mapPolygon");
2663
+ e && e.markDirtyProjection();
2664
+ });
2665
+ }
2666
+ _prepareChildren() {
2667
+ super._prepareChildren(), this.isDirty("fill") && this.mapPolygons.template.set("fill", this.get("fill")), this.isDirty("stroke") && this.mapPolygons.template.set("stroke", this.get("stroke"));
2668
+ }
2669
+ processDataItem(t) {
2670
+ super.processDataItem(t);
2671
+ let e = t.get("mapPolygon");
2672
+ e || (e = this.makeMapPolygon(t)), t.set("mapPolygon", e);
2673
+ let i = t.get("geometry");
2674
+ if (i) {
2675
+ if (this.get("reverseGeodata") && i.coordinates)
2676
+ for (let s = 0; s < i.coordinates.length; s++)
2677
+ if (i.type == "MultiPolygon")
2678
+ for (let r = 0; r < i.coordinates[s].length; r++)
2679
+ i.coordinates[s][r].reverse();
2680
+ else
2681
+ i.coordinates[s].reverse();
2682
+ e.set("geometry", i);
2683
+ }
2684
+ e.series = this, this._addGeometry(t.get("geometry"), this);
2685
+ }
2686
+ /**
2687
+ * @ignore
2688
+ */
2689
+ disposeDataItem(t) {
2690
+ super.disposeDataItem(t);
2691
+ const e = t.get("mapPolygon");
2692
+ e && (this.mapPolygons.removeValue(e), e.dispose()), this._removeGeometry(t.get("geometry"));
2693
+ }
2694
+ /**
2695
+ * @ignore
2696
+ */
2697
+ _excludeDataItem(t) {
2698
+ super._excludeDataItem(t);
2699
+ const e = t.get("mapPolygon");
2700
+ e && e.setPrivate("visible", !1);
2701
+ }
2702
+ /**
2703
+ * @ignore
2704
+ */
2705
+ _unexcludeDataItem(t) {
2706
+ super._unexcludeDataItem(t);
2707
+ const e = t.get("mapPolygon");
2708
+ e && e.setPrivate("visible", !0);
2709
+ }
2710
+ /**
2711
+ * @ignore
2712
+ */
2713
+ _notIncludeDataItem(t) {
2714
+ super._notIncludeDataItem(t);
2715
+ const e = t.get("mapPolygon");
2716
+ e && e.setPrivate("visible", !1);
2717
+ }
2718
+ /**
2719
+ * @ignore
2720
+ */
2721
+ _unNotIncludeDataItem(t) {
2722
+ super._unNotIncludeDataItem(t);
2723
+ const e = t.get("mapPolygon");
2724
+ e && e.setPrivate("visible", !0);
2725
+ }
2726
+ /**
2727
+ * Forces a repaint of the element which relies on data.
2728
+ *
2729
+ * @since 5.0.21
2730
+ */
2731
+ markDirtyValues(t) {
2732
+ if (super.markDirtyValues(), t) {
2733
+ const e = t.get("mapPolygon");
2734
+ e && e.set("geometry", t.get("geometry"));
2735
+ }
2736
+ }
2737
+ /**
2738
+ * Centers and zooms in on the specific polygon.
2739
+ *
2740
+ * @param dataItem Target data item
2741
+ * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Zooming_to_clicked_object} for more info
2742
+ * @param rotate If it's true, the map will rotate so that this polygon would be in the center. Mostly usefull with geoOrthographic projection.
2743
+ */
2744
+ zoomToDataItem(t, e) {
2745
+ const i = t.get("mapPolygon");
2746
+ if (i) {
2747
+ const o = i.get("geometry"), s = this.chart;
2748
+ if (o && s) {
2749
+ if (e) {
2750
+ const r = ci(o);
2751
+ return s.rotate(-r.longitude, -r.latitude), s.zoomToGeoBounds(te(o), void 0, -r.longitude, -r.latitude);
2752
+ }
2753
+ return s.zoomToGeoBounds(te(o));
2754
+ }
2755
+ }
2756
+ }
2757
+ /**
2758
+ * Zooms the map in so that all polygons in the array are visible.
2759
+ *
2760
+ * @param dataItems An array of data items to zoom to
2761
+ * @param rotate Rotate the map so it is centered on the selected items
2762
+ * @return Animation
2763
+ * @since 5.9.0
2764
+ */
2765
+ zoomToDataItems(t, e) {
2766
+ let i, o, s, r;
2767
+ if (N(t, (a) => {
2768
+ const u = a.get("mapPolygon");
2769
+ if (u) {
2770
+ const h = u.get("geometry");
2771
+ if (h) {
2772
+ let l = te(h);
2773
+ i == null && (i = l.left), o == null && (o = l.right), s == null && (s = l.top), r == null && (r = l.bottom), i = Math.min(l.left, i), o = Math.max(l.right, o), s = Math.max(l.top, s), r = Math.min(l.bottom, r);
2774
+ }
2775
+ }
2776
+ }), i != null && o != null && s != null && r != null) {
2777
+ const a = this.chart;
2778
+ if (a) {
2779
+ if (e) {
2780
+ const u = i + (o - i) / 2, h = r + (s - r) / 2;
2781
+ return a.rotate(-u, -h), a.zoomToGeoBounds({ left: i, right: o, top: s, bottom: r }, void 0, -u, -h);
2782
+ }
2783
+ return a.zoomToGeoBounds({ left: i, right: o, top: s, bottom: r });
2784
+ }
2785
+ }
2786
+ }
2787
+ /**
2788
+ * Returns a [[MapPolygon]] that is under specific X/Y point.
2789
+ *
2790
+ * @since 5.9.8
2791
+ * @param point X/Y
2792
+ * @return Polygon
2793
+ */
2794
+ getPolygonByPoint(t) {
2795
+ let e;
2796
+ const o = this._display._renderer.getObjectAtPoint(t);
2797
+ if (o)
2798
+ return this.mapPolygons.each(function(s) {
2799
+ s._display == o && (e = s);
2800
+ }), e;
2801
+ }
2802
+ getPolygonByGeoPoint(t) {
2803
+ return this.getPolygonByPoint(this.chart.convert(t));
2804
+ }
2805
+ }
2806
+ ni.className = "MapPolygonSeries";
2807
+ ni.classNames = mt.classNames.concat([ni.className]);
2808
+ class oi extends Zt {
2809
+ constructor() {
2810
+ super(...arguments), this._dataItem = this.makeDataItem({}), this._clusterIndex = 0, this._clusters = [], this.clusteredDataItems = [], this._scatterIndex = 0, this._scatters = [], this._packLayout = Vn(), this._spiral = [], this._previousZL = 0;
2811
+ }
2812
+ _afterNew() {
2813
+ this.fields.push("groupId"), this._setRawDefault("groupIdField", "groupId"), super._afterNew();
2814
+ }
2815
+ _afterDataChange() {
2816
+ super._afterDataChange(), this._previousZL = 0;
2817
+ }
2818
+ _updateChildren() {
2819
+ super._updateChildren(), this.isDirty("scatterRadius") && (this._spiral = Zn(0, 0, 300, 300, 0, 3, 3, 0, 0));
2820
+ const t = this.chart;
2821
+ if (t) {
2822
+ const e = t.get("zoomLevel", 1);
2823
+ if (e != this._previousZL) {
2824
+ const i = this.get("clusterDelay", 0);
2825
+ i ? this._clusterDP ? (this._clusterDP.dispose(), this._clusterDP = this.setTimeout(() => {
2826
+ this._doTheCluster();
2827
+ }, i)) : (this._doTheCluster(), this._clusterDP = this.setTimeout(() => {
2828
+ }, 0)) : this._doTheCluster(), this._previousZL = e;
2829
+ }
2830
+ N(this.clusteredDataItems, (i) => {
2831
+ const o = i.get("bullet"), s = i.get("longitude", 0), r = i.get("latitude", 0);
2832
+ this._positionBulletReal(o, { type: "Point", coordinates: [s, r] }, [s, r]);
2833
+ });
2834
+ }
2835
+ }
2836
+ _doTheCluster() {
2837
+ const t = {};
2838
+ N(this.dataItems, (e) => {
2839
+ const i = e.get("groupId", "_default");
2840
+ t[i] || (t[i] = []), t[i].push(e);
2841
+ }), this._scatterIndex = -1, this._scatters = [], this._clusterIndex = -1, this._clusters = [], N(this.clusteredDataItems, (e) => {
2842
+ e.setRaw("children", void 0);
2843
+ }), N(this.dataItems, (e) => {
2844
+ e.setRaw("cluster", void 0);
2845
+ }), Ee(t, (e, i) => {
2846
+ this._scatterGroup(i);
2847
+ }), Ee(t, (e, i) => {
2848
+ this._clusterGroup(i);
2849
+ }), N(this.dataItems, (e) => {
2850
+ if (!e.get("cluster")) {
2851
+ const i = e.bullets;
2852
+ i && N(i, (o) => {
2853
+ const s = o.get("sprite");
2854
+ s && s.set("forceHidden", !1);
2855
+ });
2856
+ }
2857
+ });
2858
+ }
2859
+ /**
2860
+ * Zooms to the area so that all clustered data items of a cluster would be
2861
+ * visible.
2862
+ *
2863
+ * Pass in `true` as a second parameter to rotate that map so that the group
2864
+ * is in the center. This is especially useful in the maps that use
2865
+ * Orthographic (globe) projection.
2866
+ *
2867
+ * @param dataItem Group data item
2868
+ * @param rotate Rotate the map so that group is in the center?
2869
+ * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/clustered-point-series/#Drill_down} for more info
2870
+ */
2871
+ zoomToCluster(t, e) {
2872
+ this.zoomToDataItems(t.get("children", []), e);
2873
+ }
2874
+ _clusterGroup(t) {
2875
+ const e = this.chart;
2876
+ if (!(e && e.get("zoomLevel", 1) >= e.get("maxZoomLevel", 100) * this.get("stopClusterZoom", 0.95))) for (t.sort((s, r) => {
2877
+ const a = s.get("point"), u = r.get("point");
2878
+ return a && u ? Math.hypot(a.x - u.x, a.y - u.y) : 0;
2879
+ }); t.length > 0; ) {
2880
+ this._clusterIndex++, this._clusters[this._clusterIndex] = [];
2881
+ const s = this._clusters[this._clusterIndex], r = t[0];
2882
+ s.push(r), xe(t, r), this._clusterDataItem(r, t);
2883
+ }
2884
+ let i = 0;
2885
+ const o = this.get("clusteredBullet");
2886
+ o && N(this._clusters, (s) => {
2887
+ let r = 0, a = 0, u = s.length;
2888
+ if (u > 1) {
2889
+ let h = this.clusteredDataItems[i];
2890
+ if (!h) {
2891
+ h = new An(this, void 0, {});
2892
+ const d = h.set("bullet", o(this._root, this, h));
2893
+ if (d) {
2894
+ const m = d.get("sprite");
2895
+ m && (this.bulletsContainer.children.push(m), m._setDataItem(h), this.root.events.once("frameended", () => {
2896
+ m instanceof _i && m.walkChildren((y) => {
2897
+ y instanceof On && y.markDirtyValues();
2898
+ });
2899
+ }));
2900
+ }
2901
+ this.clusteredDataItems.push(h);
2902
+ }
2903
+ let l;
2904
+ N(s, (d) => {
2905
+ d.setRaw("cluster", h);
2906
+ const m = d.get("point");
2907
+ m && (r += m.x, a += m.y);
2908
+ const y = d.bullets;
2909
+ y && N(y, (P) => {
2910
+ const _ = P.get("sprite");
2911
+ _ && _.set("forceHidden", !0);
2912
+ }), l = d.get("groupId");
2913
+ });
2914
+ let c = r / u, f = a / u;
2915
+ h.setRaw("children", s), h.setRaw("groupId", l);
2916
+ const p = h.get("value");
2917
+ h.setRaw("value", u);
2918
+ const g = h.get("bullet");
2919
+ if (g) {
2920
+ let d = this.chart.invert({ x: c, y: f });
2921
+ d && h.setAll({
2922
+ longitude: d.longitude,
2923
+ latitude: d.latitude
2924
+ }), this._positionBullets(h);
2925
+ const m = g.get("sprite");
2926
+ m && (m.set("forceHidden", !1), p != u && m instanceof _i && m.walkChildren((y) => {
2927
+ y instanceof Fn && y.text.markDirtyText();
2928
+ }));
2929
+ }
2930
+ i++;
2931
+ }
2932
+ }), N(this.clusteredDataItems, (s) => {
2933
+ let r = s.get("children");
2934
+ if (!r || r.length == 0) {
2935
+ const a = s.get("bullet");
2936
+ if (a) {
2937
+ const u = a.get("sprite");
2938
+ u && u.set("forceHidden", !0);
2939
+ }
2940
+ }
2941
+ });
2942
+ }
2943
+ _onDataClear() {
2944
+ super._onDataClear(), N(this.clusteredDataItems, (t) => {
2945
+ const e = t.get("bullet");
2946
+ if (e) {
2947
+ const i = e.get("sprite");
2948
+ i && i.dispose();
2949
+ }
2950
+ }), this.clusteredDataItems = [];
2951
+ }
2952
+ _clusterDataItem(t, e) {
2953
+ const i = t.get("point");
2954
+ if (i) {
2955
+ let o = this.get("minDistance", 20);
2956
+ const s = this._clusters[this._clusterIndex];
2957
+ for (let r = e.length - 1; r >= 0; r--) {
2958
+ const a = e[r];
2959
+ if (a && !a.get("clipped")) {
2960
+ const u = a.get("point");
2961
+ u && Math.hypot(u.x - i.x, u.y - i.y) < o && (s.push(a), xe(e, a), this._clusterDataItem(a, e));
2962
+ }
2963
+ }
2964
+ }
2965
+ }
2966
+ _scatterGroup(t) {
2967
+ const e = this.chart;
2968
+ if (e && e.get("zoomLevel", 1) >= e.get("maxZoomLevel", 100) * this.get("stopClusterZoom", 0.95)) {
2969
+ for (; t.length > 0; ) {
2970
+ this._scatterIndex++, this._scatters[this._scatterIndex] = [];
2971
+ const i = this._scatters[this._scatterIndex], o = t[0];
2972
+ i.push(o), ri(t, o), this._scatterDataItem(o, t);
2973
+ }
2974
+ N(this._scatters, (i) => {
2975
+ if (i.length > 1) {
2976
+ let s = [], r = 0, a = this.get("scatterRadius", 8);
2977
+ N(i, (u) => {
2978
+ let h = this._spiral[r], l = !0;
2979
+ if (s.length > 0)
2980
+ for (; l; )
2981
+ N(s, (g) => {
2982
+ for (l = !1; bn({ x: h.x, y: h.y, radius: a }, g); )
2983
+ r++, this._spiral[r] == null ? l = !1 : (l = !0, h = this._spiral[r]);
2984
+ });
2985
+ const c = h.x, f = h.y;
2986
+ s.push({ x: c, y: f, radius: a }), u.set("dx", c), u.set("dy", f);
2987
+ const p = u.bullets;
2988
+ p && N(p, (g) => {
2989
+ const d = g.get("sprite");
2990
+ d && d.setAll({ dx: c, dy: f });
2991
+ });
2992
+ });
2993
+ }
2994
+ });
2995
+ }
2996
+ }
2997
+ _scatterDataItem(t, e) {
2998
+ const i = t.get("point");
2999
+ if (i) {
3000
+ const o = this.get("scatterDistance", 5), s = this._scatters[this._scatterIndex];
3001
+ N(e, (r) => {
3002
+ if (r && !r.get("clipped")) {
3003
+ const a = r.get("point");
3004
+ a && Math.hypot(a.x - i.x, a.y - i.y) < o && (s.push(r), xe(e, r), this._scatterDataItem(r, e));
3005
+ }
3006
+ });
3007
+ }
3008
+ }
3009
+ }
3010
+ oi.className = "ClusteredPointSeries";
3011
+ oi.classNames = Zt.classNames.concat([oi.className]);
3012
+ class si extends qi {
3013
+ _afterNew() {
3014
+ super._afterNew(), this.addTag("zoomtools");
3015
+ }
3016
+ _prepareChildren() {
3017
+ super._prepareChildren(), this.isPrivateDirty("chart") && this.set("target", this.getPrivate("chart"));
3018
+ }
3019
+ }
3020
+ si.className = "ZoomControl";
3021
+ si.classNames = qi.classNames.concat([si.className]);
3022
+ export {
3023
+ oi as ClusteredPointSeries,
3024
+ os as DefaultTheme,
3025
+ ei as GraticuleSeries,
3026
+ ii as MapChart,
3027
+ Pe as MapLine,
3028
+ Gt as MapLineSeries,
3029
+ Zt as MapPointSeries,
3030
+ De as MapPolygon,
3031
+ ni as MapPolygonSeries,
3032
+ mt as MapSeries,
3033
+ si as ZoomControl,
3034
+ is as geoMercator,
3035
+ te as getGeoBounds,
3036
+ ci as getGeoCentroid
3037
+ };