@tabler/core 1.0.0-beta20 → 1.0.0-beta21

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 (378) hide show
  1. package/README.md +7 -6
  2. package/dist/css/demo.css +8 -8
  3. package/dist/css/demo.min.css +5 -5
  4. package/dist/css/demo.rtl.css +8 -8
  5. package/dist/css/demo.rtl.min.css +5 -5
  6. package/dist/css/tabler-flags.css +10 -10
  7. package/dist/css/tabler-flags.min.css +5 -5
  8. package/dist/css/tabler-flags.rtl.css +10 -10
  9. package/dist/css/tabler-flags.rtl.min.css +5 -5
  10. package/dist/css/tabler-payments.css +4 -4
  11. package/dist/css/tabler-payments.min.css +4 -4
  12. package/dist/css/tabler-payments.rtl.css +4 -4
  13. package/dist/css/tabler-payments.rtl.min.css +4 -4
  14. package/dist/css/tabler-social.css +4 -4
  15. package/dist/css/tabler-social.min.css +4 -4
  16. package/dist/css/tabler-social.rtl.css +4 -4
  17. package/dist/css/tabler-social.rtl.min.css +4 -4
  18. package/dist/css/tabler-vendors.css +246 -253
  19. package/dist/css/tabler-vendors.min.css +5 -5
  20. package/dist/css/tabler-vendors.rtl.css +246 -253
  21. package/dist/css/tabler-vendors.rtl.min.css +5 -5
  22. package/dist/css/tabler.css +643 -426
  23. package/dist/css/tabler.min.css +8 -8
  24. package/dist/css/tabler.rtl.css +667 -441
  25. package/dist/css/tabler.rtl.min.css +8 -8
  26. package/dist/js/demo-theme.js +4 -4
  27. package/dist/js/demo-theme.min.js +4 -4
  28. package/dist/js/demo.js +41 -42
  29. package/dist/js/demo.min.js +5 -5
  30. package/dist/js/tabler.esm.js +1949 -1248
  31. package/dist/js/tabler.esm.min.js +8 -8
  32. package/dist/js/tabler.js +1949 -1248
  33. package/dist/js/tabler.min.js +8 -8
  34. package/dist/libs/apexcharts/dist/apexcharts.amd.js +1 -1
  35. package/dist/libs/apexcharts/dist/apexcharts.common.js +5 -5
  36. package/dist/libs/apexcharts/dist/apexcharts.css +166 -65
  37. package/dist/libs/apexcharts/dist/apexcharts.esm.js +5 -5
  38. package/dist/libs/apexcharts/dist/apexcharts.js +7964 -8527
  39. package/dist/libs/apexcharts/dist/apexcharts.min.js +5 -5
  40. package/dist/libs/apexcharts/dist/locales/be-cyrl.json +55 -0
  41. package/dist/libs/apexcharts/dist/locales/be-latn.json +55 -0
  42. package/dist/libs/apexcharts/dist/locales/da.json +55 -0
  43. package/dist/libs/apexcharts/dist/locales/ms.json +63 -0
  44. package/dist/libs/apexcharts/dist/locales/pt.json +3 -3
  45. package/dist/libs/apexcharts/dist/locales/vi.json +63 -0
  46. package/dist/libs/apexcharts/dist/locales/zh-tw.json +1 -1
  47. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +8 -8
  48. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -1
  49. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +3 -3
  50. package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -1
  51. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +8 -8
  52. package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -1
  53. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +3 -3
  54. package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -1
  55. package/dist/libs/bootstrap/dist/js/bootstrap.js +8 -8
  56. package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -1
  57. package/dist/libs/bootstrap/dist/js/bootstrap.min.js +3 -3
  58. package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -1
  59. package/dist/libs/countup.js/dist/countUp.d.ts +1 -0
  60. package/dist/libs/countup.js/dist/countUp.js +4 -1
  61. package/dist/libs/countup.js/dist/countUp.min.js +1 -1
  62. package/dist/libs/countup.js/dist/countUp.umd.js +1 -1
  63. package/dist/libs/jsvectormap/dist/jsvectormap.cjs +2279 -0
  64. package/dist/libs/jsvectormap/dist/jsvectormap.css +121 -0
  65. package/dist/libs/jsvectormap/dist/jsvectormap.esm.js +2277 -0
  66. package/dist/libs/jsvectormap/dist/jsvectormap.js +2285 -0
  67. package/dist/libs/jsvectormap/dist/jsvectormap.min.css +1 -0
  68. package/dist/libs/jsvectormap/dist/jsvectormap.min.js +1 -0
  69. package/dist/libs/jsvectormap/dist/maps/world-merc.js +1 -1
  70. package/dist/libs/jsvectormap/dist/maps/world.js +1 -1
  71. package/dist/libs/nouislider/dist/nouislider.d.ts +8 -10
  72. package/dist/libs/nouislider/dist/nouislider.js +64 -5
  73. package/dist/libs/nouislider/dist/nouislider.min.js +1 -1
  74. package/dist/libs/nouislider/dist/nouislider.min.mjs +1 -1
  75. package/dist/libs/nouislider/dist/nouislider.mjs +64 -5
  76. package/dist/libs/star-rating.js/dist/star-rating.cjs.js +5 -2
  77. package/dist/libs/star-rating.js/dist/star-rating.css +23 -20
  78. package/dist/libs/star-rating.js/dist/star-rating.esm.js +5 -2
  79. package/dist/libs/star-rating.js/dist/star-rating.js +5 -9
  80. package/dist/libs/star-rating.js/dist/star-rating.min.css +1 -8
  81. package/dist/libs/star-rating.js/dist/star-rating.min.js +1 -8
  82. package/dist/libs/tinymce/CHANGELOG.md +471 -12
  83. package/dist/libs/tinymce/README.md +16 -10
  84. package/dist/libs/tinymce/bower.json +1 -1
  85. package/dist/libs/tinymce/composer.json +2 -2
  86. package/dist/libs/tinymce/icons/default/icons.js +13 -2
  87. package/dist/libs/tinymce/icons/default/icons.min.js +1 -1
  88. package/dist/libs/tinymce/license.md +6 -0
  89. package/dist/libs/tinymce/models/dom/model.js +237 -213
  90. package/dist/libs/tinymce/models/dom/model.min.js +2 -2
  91. package/dist/libs/tinymce/package.json +2 -2
  92. package/dist/libs/tinymce/plugins/accordion/index.js +7 -0
  93. package/dist/libs/tinymce/plugins/accordion/plugin.js +1055 -0
  94. package/dist/libs/tinymce/plugins/accordion/plugin.min.js +4 -0
  95. package/dist/libs/tinymce/plugins/advlist/plugin.js +4 -4
  96. package/dist/libs/tinymce/plugins/advlist/plugin.min.js +2 -2
  97. package/dist/libs/tinymce/plugins/anchor/plugin.js +21 -3
  98. package/dist/libs/tinymce/plugins/anchor/plugin.min.js +2 -2
  99. package/dist/libs/tinymce/plugins/autolink/plugin.js +1 -1
  100. package/dist/libs/tinymce/plugins/autolink/plugin.min.js +2 -2
  101. package/dist/libs/tinymce/plugins/autoresize/plugin.js +20 -33
  102. package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +2 -2
  103. package/dist/libs/tinymce/plugins/autosave/plugin.js +1 -1
  104. package/dist/libs/tinymce/plugins/autosave/plugin.min.js +1 -1
  105. package/dist/libs/tinymce/plugins/charmap/plugin.js +15 -3
  106. package/dist/libs/tinymce/plugins/charmap/plugin.min.js +2 -2
  107. package/dist/libs/tinymce/plugins/code/plugin.js +1 -1
  108. package/dist/libs/tinymce/plugins/code/plugin.min.js +1 -1
  109. package/dist/libs/tinymce/plugins/codesample/plugin.js +27 -13
  110. package/dist/libs/tinymce/plugins/codesample/plugin.min.js +2 -2
  111. package/dist/libs/tinymce/plugins/directionality/plugin.js +33 -27
  112. package/dist/libs/tinymce/plugins/directionality/plugin.min.js +2 -2
  113. package/dist/libs/tinymce/plugins/emoticons/plugin.js +17 -4
  114. package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +2 -2
  115. package/dist/libs/tinymce/plugins/fullscreen/plugin.js +168 -105
  116. package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +2 -2
  117. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ar.js +93 -0
  118. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +93 -0
  119. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ca.js +93 -0
  120. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/cs.js +93 -0
  121. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/da.js +93 -0
  122. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/de.js +93 -0
  123. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/el.js +93 -0
  124. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/en.js +93 -0
  125. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/es.js +93 -0
  126. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/eu.js +93 -0
  127. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/fa.js +93 -0
  128. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/fi.js +93 -0
  129. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +93 -0
  130. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/he_IL.js +93 -0
  131. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/hi.js +93 -0
  132. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/hr.js +93 -0
  133. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +93 -0
  134. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/id.js +93 -0
  135. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/it.js +93 -0
  136. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ja.js +93 -0
  137. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/kk.js +93 -0
  138. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +93 -0
  139. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ms.js +93 -0
  140. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +93 -0
  141. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/nl.js +93 -0
  142. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/pl.js +93 -0
  143. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +93 -0
  144. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +93 -0
  145. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ro.js +93 -0
  146. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/ru.js +93 -0
  147. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/sk.js +93 -0
  148. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +93 -0
  149. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +93 -0
  150. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/th_TH.js +93 -0
  151. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/tr.js +93 -0
  152. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/uk.js +93 -0
  153. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/vi.js +93 -0
  154. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +87 -0
  155. package/dist/libs/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +93 -0
  156. package/dist/libs/tinymce/plugins/help/plugin.js +115 -135
  157. package/dist/libs/tinymce/plugins/help/plugin.min.js +2 -2
  158. package/dist/libs/tinymce/plugins/image/plugin.js +23 -5
  159. package/dist/libs/tinymce/plugins/image/plugin.min.js +2 -2
  160. package/dist/libs/tinymce/plugins/importcss/plugin.js +4 -3
  161. package/dist/libs/tinymce/plugins/importcss/plugin.min.js +2 -2
  162. package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +15 -3
  163. package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +2 -2
  164. package/dist/libs/tinymce/plugins/link/plugin.js +193 -114
  165. package/dist/libs/tinymce/plugins/link/plugin.min.js +2 -2
  166. package/dist/libs/tinymce/plugins/lists/plugin.js +290 -66
  167. package/dist/libs/tinymce/plugins/lists/plugin.min.js +2 -2
  168. package/dist/libs/tinymce/plugins/media/plugin.js +80 -33
  169. package/dist/libs/tinymce/plugins/media/plugin.min.js +2 -2
  170. package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +15 -3
  171. package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +2 -2
  172. package/dist/libs/tinymce/plugins/pagebreak/plugin.js +15 -3
  173. package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +2 -2
  174. package/dist/libs/tinymce/plugins/preview/plugin.js +1 -1
  175. package/dist/libs/tinymce/plugins/preview/plugin.min.js +1 -1
  176. package/dist/libs/tinymce/plugins/quickbars/plugin.js +19 -7
  177. package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +2 -2
  178. package/dist/libs/tinymce/plugins/save/plugin.js +3 -2
  179. package/dist/libs/tinymce/plugins/save/plugin.min.js +2 -2
  180. package/dist/libs/tinymce/plugins/searchreplace/plugin.js +42 -36
  181. package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +2 -2
  182. package/dist/libs/tinymce/plugins/table/plugin.js +121 -76
  183. package/dist/libs/tinymce/plugins/table/plugin.min.js +2 -2
  184. package/dist/libs/tinymce/plugins/visualblocks/plugin.js +1 -1
  185. package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +1 -1
  186. package/dist/libs/tinymce/plugins/visualchars/plugin.js +1 -1
  187. package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +1 -1
  188. package/dist/libs/tinymce/plugins/wordcount/plugin.js +27 -19
  189. package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +2 -2
  190. package/dist/libs/tinymce/skins/content/dark/content.js +1 -0
  191. package/dist/libs/tinymce/skins/content/default/content.js +1 -0
  192. package/dist/libs/tinymce/skins/content/document/content.js +1 -0
  193. package/dist/libs/tinymce/skins/content/tinymce-5/content.js +1 -0
  194. package/dist/libs/tinymce/skins/content/tinymce-5-dark/content.js +1 -0
  195. package/dist/libs/tinymce/skins/content/writer/content.js +1 -0
  196. package/dist/libs/tinymce/skins/ui/oxide/content.css +32 -29
  197. package/dist/libs/tinymce/skins/ui/oxide/content.inline.css +32 -29
  198. package/dist/libs/tinymce/skins/ui/oxide/content.inline.js +1 -0
  199. package/dist/libs/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
  200. package/dist/libs/tinymce/skins/ui/oxide/content.js +1 -0
  201. package/dist/libs/tinymce/skins/ui/oxide/content.min.css +1 -1
  202. package/dist/libs/tinymce/skins/ui/oxide/skin.css +1003 -105
  203. package/dist/libs/tinymce/skins/ui/oxide/skin.js +1 -0
  204. package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -1
  205. package/dist/libs/tinymce/skins/ui/oxide/skin.shadowdom.js +1 -0
  206. package/dist/libs/tinymce/skins/ui/oxide-dark/content.css +32 -22
  207. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.css +32 -29
  208. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.js +1 -0
  209. package/dist/libs/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
  210. package/dist/libs/tinymce/skins/ui/oxide-dark/content.js +1 -0
  211. package/dist/libs/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
  212. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +1008 -110
  213. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.js +1 -0
  214. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  215. package/dist/libs/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +1 -0
  216. package/dist/libs/tinymce/skins/ui/tinymce-5/content.css +32 -29
  217. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.css +32 -29
  218. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.js +1 -0
  219. package/dist/libs/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -1
  220. package/dist/libs/tinymce/skins/ui/tinymce-5/content.js +1 -0
  221. package/dist/libs/tinymce/skins/ui/tinymce-5/content.min.css +1 -1
  222. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +1003 -86
  223. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.js +1 -0
  224. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
  225. package/dist/libs/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +1 -0
  226. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.css +32 -22
  227. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.css +32 -29
  228. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.js +1 -0
  229. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
  230. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.js +1 -0
  231. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -1
  232. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +1009 -92
  233. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -0
  234. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  235. package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +1 -0
  236. package/dist/libs/tinymce/themes/silver/theme.js +26361 -24936
  237. package/dist/libs/tinymce/themes/silver/theme.min.js +2 -2
  238. package/dist/libs/tinymce/tinymce.d.ts +205 -136
  239. package/dist/libs/tinymce/tinymce.js +4400 -2838
  240. package/dist/libs/tinymce/tinymce.min.js +2 -2
  241. package/dist/libs/tom-select/dist/js/plugins/caret_position.js +11 -16
  242. package/dist/libs/tom-select/dist/js/plugins/caret_position.js.map +1 -1
  243. package/dist/libs/tom-select/dist/js/plugins/change_listener.js +3 -2
  244. package/dist/libs/tom-select/dist/js/plugins/change_listener.js.map +1 -1
  245. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js +47 -34
  246. package/dist/libs/tom-select/dist/js/plugins/checkbox_options.js.map +1 -1
  247. package/dist/libs/tom-select/dist/js/plugins/clear_button.js +3 -13
  248. package/dist/libs/tom-select/dist/js/plugins/clear_button.js.map +1 -1
  249. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js +249 -29
  250. package/dist/libs/tom-select/dist/js/plugins/drag_drop.js.map +1 -1
  251. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js +3 -11
  252. package/dist/libs/tom-select/dist/js/plugins/dropdown_header.js.map +1 -1
  253. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js +15 -24
  254. package/dist/libs/tom-select/dist/js/plugins/dropdown_input.js.map +1 -1
  255. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js +4 -6
  256. package/dist/libs/tom-select/dist/js/plugins/input_autogrow.js.map +1 -1
  257. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js +2 -1
  258. package/dist/libs/tom-select/dist/js/plugins/no_active_items.js.map +1 -1
  259. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js +2 -2
  260. package/dist/libs/tom-select/dist/js/plugins/no_backspace_delete.js.map +1 -1
  261. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js +3 -15
  262. package/dist/libs/tom-select/dist/js/plugins/optgroup_columns.js.map +1 -1
  263. package/dist/libs/tom-select/dist/js/plugins/remove_button.js +11 -15
  264. package/dist/libs/tom-select/dist/js/plugins/remove_button.js.map +1 -1
  265. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js +2 -3
  266. package/dist/libs/tom-select/dist/js/plugins/restore_on_backspace.js.map +1 -1
  267. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js +41 -50
  268. package/dist/libs/tom-select/dist/js/plugins/virtual_scroll.js.map +1 -1
  269. package/dist/libs/tom-select/dist/js/tom-select.base.js +411 -685
  270. package/dist/libs/tom-select/dist/js/tom-select.base.js.map +1 -1
  271. package/dist/libs/tom-select/dist/js/tom-select.base.min.js +87 -78
  272. package/dist/libs/tom-select/dist/js/tom-select.base.min.js.map +1 -1
  273. package/dist/libs/tom-select/dist/js/tom-select.complete.js +614 -820
  274. package/dist/libs/tom-select/dist/js/tom-select.complete.js.map +1 -1
  275. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js +195 -176
  276. package/dist/libs/tom-select/dist/js/tom-select.complete.min.js.map +1 -1
  277. package/dist/libs/tom-select/dist/js/tom-select.popular.js +436 -705
  278. package/dist/libs/tom-select/dist/js/tom-select.popular.js.map +1 -1
  279. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js +87 -78
  280. package/dist/libs/tom-select/dist/js/tom-select.popular.min.js.map +1 -1
  281. package/docs/base/colors.mdx +25 -0
  282. package/docs/base/typography.mdx +296 -0
  283. package/docs/components/alerts.mdx +430 -0
  284. package/docs/components/autosize.mdx +16 -0
  285. package/docs/components/avatars.mdx +172 -0
  286. package/docs/components/badges.mdx +127 -0
  287. package/docs/components/breadcrumb.mdx +107 -0
  288. package/docs/components/buttons.mdx +863 -0
  289. package/docs/components/cards.mdx +343 -0
  290. package/docs/components/carousel.mdx +235 -0
  291. package/docs/components/charts.mdx +526 -0
  292. package/docs/components/countup.mdx +136 -0
  293. package/docs/components/datagrid.mdx +90 -0
  294. package/docs/components/divider.mdx +63 -0
  295. package/docs/components/dropdowns.mdx +245 -0
  296. package/docs/components/dropzone.mdx +63 -0
  297. package/docs/components/empty.mdx +103 -0
  298. package/docs/components/icons.mdx +120 -0
  299. package/docs/components/inline-player.mdx +31 -0
  300. package/docs/components/modals.mdx +222 -0
  301. package/docs/components/placeholder.mdx +270 -0
  302. package/docs/components/popover.mdx +55 -0
  303. package/docs/components/progress.mdx +92 -0
  304. package/docs/components/progressbg.mdx +16 -0
  305. package/docs/components/range-slider.mdx +17 -0
  306. package/docs/components/ribbons.mdx +151 -0
  307. package/docs/components/spinners.mdx +119 -0
  308. package/docs/components/statuses.mdx +285 -0
  309. package/docs/components/steps.mdx +111 -0
  310. package/docs/components/switch-icon.mdx +155 -0
  311. package/docs/components/tables.mdx +410 -0
  312. package/docs/components/tabs.mdx +243 -0
  313. package/docs/components/timelines.mdx +506 -0
  314. package/docs/components/tinymce.mdx +44 -0
  315. package/docs/components/toasts.mdx +73 -0
  316. package/docs/components/tooltips.mdx +34 -0
  317. package/docs/components/tracking.mdx +162 -0
  318. package/docs/forms/form-color-check.mdx +179 -0
  319. package/docs/forms/form-elements.mdx +498 -0
  320. package/docs/forms/form-fieldset.mdx +44 -0
  321. package/docs/forms/form-helpers.mdx +12 -0
  322. package/docs/forms/form-image-check.mdx +162 -0
  323. package/docs/forms/form-input-mask.mdx +18 -0
  324. package/docs/forms/form-selectboxes.mdx +205 -0
  325. package/docs/forms/form-validation.mdx +25 -0
  326. package/docs/getting-started/browser-support.mdx +20 -0
  327. package/docs/getting-started/customize.mdx +24 -0
  328. package/docs/getting-started/download.mdx +42 -0
  329. package/docs/getting-started/faq.mdx +28 -0
  330. package/docs/getting-started/index.mdx +40 -0
  331. package/docs/icons/eps.mdx +13 -0
  332. package/docs/icons/figma.mdx +7 -0
  333. package/docs/icons/index.mdx +103 -0
  334. package/docs/icons/pdf.mdx +13 -0
  335. package/docs/icons/png.mdx +19 -0
  336. package/docs/icons/preact.mdx +40 -0
  337. package/docs/icons/react.mdx +40 -0
  338. package/docs/icons/solidjs.mdx +39 -0
  339. package/docs/icons/svelte.mdx +40 -0
  340. package/docs/icons/svg.mdx +74 -0
  341. package/docs/icons/vue.mdx +45 -0
  342. package/docs/icons/webfont.mdx +52 -0
  343. package/docs/layout/page-headers.mdx +226 -0
  344. package/docs/layout/page-layouts.mdx +204 -0
  345. package/docs/menu.json +317 -0
  346. package/docs/plugins/flags.mdx +52 -0
  347. package/docs/plugins/payments.mdx +43 -0
  348. package/docs/utilities/borders.mdx +114 -0
  349. package/docs/utilities/cursors.mdx +92 -0
  350. package/docs/utilities/interactions.mdx +23 -0
  351. package/package.json +37 -37
  352. package/src/js/src/toast.js +9 -1
  353. package/src/scss/_variables-dark.scss +3 -3
  354. package/src/scss/_variables.scss +38 -33
  355. package/src/scss/layout/_dark.scss +10 -2
  356. package/src/scss/layout/_navbar.scss +22 -13
  357. package/src/scss/layout/_page.scss +4 -4
  358. package/src/scss/layout/_root.scss +1 -1
  359. package/src/scss/mixins/_mixins.scss +4 -4
  360. package/src/scss/ui/_alerts.scss +2 -2
  361. package/src/scss/ui/_buttons.scss +4 -4
  362. package/src/scss/ui/_dropdowns.scss +1 -0
  363. package/src/scss/ui/_empty.scss +0 -5
  364. package/src/scss/ui/_flags.scss +2 -2
  365. package/src/scss/ui/_forms.scss +5 -4
  366. package/src/scss/ui/_modals.scss +3 -3
  367. package/src/scss/ui/_ribbons.scss +1 -0
  368. package/src/scss/ui/_toasts.scss +0 -1
  369. package/src/scss/ui/_type.scss +4 -2
  370. package/src/scss/vendor/_apexcharts.scss +2 -2
  371. package/src/scss/vendor/_jsvectormap.scss +1 -1
  372. package/src/scss/vendor/_litepicker.scss +1 -1
  373. package/dist/libs/jsvectormap/dist/js/jsvectormap.js +0 -2318
  374. package/dist/libs/jsvectormap/dist/js/jsvectormap.min.js +0 -1
  375. package/dist/libs/tinymce/license.txt +0 -21
  376. package/dist/libs/tinymce/plugins/template/index.js +0 -7
  377. package/dist/libs/tinymce/plugins/template/plugin.js +0 -554
  378. package/dist/libs/tinymce/plugins/template/plugin.min.js +0 -4
@@ -0,0 +1,2277 @@
1
+ /**
2
+ * By https://github.com/TehShrike/deepmerge
3
+ */
4
+
5
+ var isMergeableObject = function isMergeableObject(value) {
6
+ return isNonNullObject(value) && !isSpecial(value);
7
+ };
8
+ function isNonNullObject(value) {
9
+ return !!value && typeof value === 'object';
10
+ }
11
+ function isSpecial(value) {
12
+ var stringValue = Object.prototype.toString.call(value);
13
+ return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isNode(value) || isReactElement(value);
14
+ }
15
+
16
+ // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
17
+ var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
18
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
19
+ function isReactElement(value) {
20
+ return value.$$typeof === REACT_ELEMENT_TYPE;
21
+ }
22
+ function isNode(value) {
23
+ return value instanceof Node;
24
+ }
25
+ function emptyTarget(val) {
26
+ return Array.isArray(val) ? [] : {};
27
+ }
28
+ function cloneUnlessOtherwiseSpecified(value, options) {
29
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
30
+ }
31
+ function defaultArrayMerge(target, source, options) {
32
+ return target.concat(source).map(function (element) {
33
+ return cloneUnlessOtherwiseSpecified(element, options);
34
+ });
35
+ }
36
+ function getMergeFunction(key, options) {
37
+ if (!options.customMerge) {
38
+ return deepmerge;
39
+ }
40
+ var customMerge = options.customMerge(key);
41
+ return typeof customMerge === 'function' ? customMerge : deepmerge;
42
+ }
43
+ function getEnumerableOwnPropertySymbols(target) {
44
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function (symbol) {
45
+ return target.propertyIsEnumerable(symbol);
46
+ }) : [];
47
+ }
48
+ function getKeys(target) {
49
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
50
+ }
51
+ function propertyIsOnObject(object, property) {
52
+ try {
53
+ return property in object;
54
+ } catch (_) {
55
+ return false;
56
+ }
57
+ }
58
+
59
+ // Protects from prototype poisoning and unexpected merging up the prototype chain.
60
+ function propertyIsUnsafe(target, key) {
61
+ return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
62
+ && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
63
+ && Object.propertyIsEnumerable.call(target, key)); // and also unsafe if they're nonenumerable.
64
+ }
65
+ function mergeObject(target, source, options) {
66
+ var destination = {};
67
+ if (options.isMergeableObject(target)) {
68
+ getKeys(target).forEach(function (key) {
69
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
70
+ });
71
+ }
72
+ getKeys(source).forEach(function (key) {
73
+ if (propertyIsUnsafe(target, key)) {
74
+ return;
75
+ }
76
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
77
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
78
+ } else {
79
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
80
+ }
81
+ });
82
+ return destination;
83
+ }
84
+ var deepmerge = function deepmerge(target, source, options) {
85
+ options = options || {};
86
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
87
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
88
+ // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
89
+ // implementations can use it. The caller may not replace it.
90
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
91
+ var sourceIsArray = Array.isArray(source);
92
+ var targetIsArray = Array.isArray(target);
93
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
94
+ if (!sourceAndTargetTypesMatch) {
95
+ return cloneUnlessOtherwiseSpecified(source, options);
96
+ } else if (sourceIsArray) {
97
+ return options.arrayMerge(target, source, options);
98
+ } else {
99
+ return mergeObject(target, source, options);
100
+ }
101
+ };
102
+
103
+ /**
104
+ * --------------------------------------------------------------------------
105
+ * Public Util Api
106
+ * --------------------------------------------------------------------------
107
+ */
108
+ var getElement = function getElement(selector) {
109
+ if (typeof selector === 'object' && typeof selector.nodeType !== 'undefined') {
110
+ return selector;
111
+ }
112
+ if (typeof selector === 'string') {
113
+ return document.querySelector(selector);
114
+ }
115
+ return null;
116
+ };
117
+ var createElement = function createElement(type, classes, content, html) {
118
+ if (html === void 0) {
119
+ html = false;
120
+ }
121
+ var el = document.createElement(type);
122
+ if (content) {
123
+ el[!html ? 'textContent' : 'innerHTML'] = content;
124
+ }
125
+ if (classes) {
126
+ el.className = classes;
127
+ }
128
+ return el;
129
+ };
130
+ var findElement = function findElement(parentElement, selector) {
131
+ return Element.prototype.querySelector.call(parentElement, selector);
132
+ };
133
+ var removeElement = function removeElement(target) {
134
+ target.parentNode.removeChild(target);
135
+ };
136
+ var isImageUrl = function isImageUrl(url) {
137
+ return /\.(jpg|gif|png)$/.test(url);
138
+ };
139
+ var hyphenate = function hyphenate(string) {
140
+ return string.replace(/[\w]([A-Z])/g, function (m) {
141
+ return m[0] + "-" + m[1];
142
+ }).toLowerCase();
143
+ };
144
+ var merge = function merge(target, source, deep) {
145
+ if (deep === void 0) {
146
+ deep = false;
147
+ }
148
+ if (deep) {
149
+ return deepmerge(target, source);
150
+ }
151
+ return Object.assign(target, source);
152
+ };
153
+ var getLineUid = function getLineUid(from, to) {
154
+ return from.toLowerCase() + ":to:" + to.toLowerCase();
155
+ };
156
+ var inherit = function inherit(target, source) {
157
+ Object.assign(target.prototype, source);
158
+ };
159
+
160
+ var eventRegistry = {};
161
+ var eventUid = 1;
162
+
163
+ /**
164
+ * ------------------------------------------------------------------------
165
+ * Event Handler
166
+ * ------------------------------------------------------------------------
167
+ */
168
+ var EventHandler = {
169
+ on: function on(element, event, handler, options) {
170
+ if (options === void 0) {
171
+ options = {};
172
+ }
173
+ var uid = "jvm:" + event + "::" + eventUid++;
174
+ eventRegistry[uid] = {
175
+ selector: element,
176
+ handler: handler
177
+ };
178
+ handler._uid = uid;
179
+ element.addEventListener(event, handler, options);
180
+ },
181
+ delegate: function delegate(element, event, selector, handler) {
182
+ event = event.split(' ');
183
+ event.forEach(function (eventName) {
184
+ EventHandler.on(element, eventName, function (e) {
185
+ var target = e.target;
186
+ if (target.matches(selector)) {
187
+ handler.call(target, e);
188
+ }
189
+ });
190
+ });
191
+ },
192
+ off: function off(element, event, handler) {
193
+ var eventType = event.split(':')[1];
194
+ element.removeEventListener(eventType, handler);
195
+ delete eventRegistry[handler._uid];
196
+ },
197
+ flush: function flush() {
198
+ Object.keys(eventRegistry).forEach(function (event) {
199
+ EventHandler.off(eventRegistry[event].selector, event, eventRegistry[event].handler);
200
+ });
201
+ },
202
+ getEventRegistry: function getEventRegistry() {
203
+ return eventRegistry;
204
+ }
205
+ };
206
+
207
+ function setupContainerEvents() {
208
+ var _this = this;
209
+ var map = this;
210
+ var mouseDown = false;
211
+ var oldPageX;
212
+ var oldPageY;
213
+ if (this.params.draggable) {
214
+ EventHandler.on(this.container, 'mousemove', function (e) {
215
+ if (!mouseDown) {
216
+ return false;
217
+ }
218
+ map.transX -= (oldPageX - e.pageX) / map.scale;
219
+ map.transY -= (oldPageY - e.pageY) / map.scale;
220
+ map._applyTransform();
221
+ oldPageX = e.pageX;
222
+ oldPageY = e.pageY;
223
+ });
224
+ EventHandler.on(this.container, 'mousedown', function (e) {
225
+ mouseDown = true;
226
+ oldPageX = e.pageX;
227
+ oldPageY = e.pageY;
228
+ return false;
229
+ });
230
+ EventHandler.on(document.body, 'mouseup', function () {
231
+ mouseDown = false;
232
+ });
233
+ }
234
+ if (this.params.zoomOnScroll) {
235
+ EventHandler.on(this.container, 'wheel', function (event) {
236
+ var deltaY = ((event.deltaY || -event.wheelDelta || event.detail) >> 10 || 1) * 75;
237
+ var rect = _this.container.getBoundingClientRect();
238
+ var offsetX = event.pageX - rect.left - window.pageXOffset;
239
+ var offsetY = event.pageY - rect.top - window.pageYOffset;
240
+ var zoomStep = Math.pow(1 + map.params.zoomOnScrollSpeed / 1000, -1.5 * deltaY);
241
+ if (map.tooltip) {
242
+ map._tooltip.hide();
243
+ }
244
+ map._setScale(map.scale * zoomStep, offsetX, offsetY);
245
+ event.preventDefault();
246
+ });
247
+ }
248
+ }
249
+
250
+ var Events = {
251
+ onLoaded: 'map:loaded',
252
+ onViewportChange: 'viewport:changed',
253
+ onRegionClick: 'region:clicked',
254
+ onMarkerClick: 'marker:clicked',
255
+ onRegionSelected: 'region:selected',
256
+ onMarkerSelected: 'marker:selected',
257
+ onRegionTooltipShow: 'region.tooltip:show',
258
+ onMarkerTooltipShow: 'marker.tooltip:show',
259
+ onDestroyed: 'map:destroyed'
260
+ };
261
+
262
+ var parseEvent = function parseEvent(map, selector, isTooltip) {
263
+ var element = getElement(selector);
264
+ var type = element.getAttribute('class').indexOf('jvm-region') === -1 ? 'marker' : 'region';
265
+ var isRegion = type === 'region';
266
+ var code = isRegion ? element.getAttribute('data-code') : element.getAttribute('data-index');
267
+ var event = isRegion ? Events.onRegionSelected : Events.onMarkerSelected;
268
+
269
+ // Init tooltip event
270
+ if (isTooltip) {
271
+ event = isRegion ? Events.onRegionTooltipShow : Events.onMarkerTooltipShow;
272
+ }
273
+ return {
274
+ type: type,
275
+ code: code,
276
+ event: event,
277
+ element: isRegion ? map.regions[code].element : map._markers[code].element,
278
+ tooltipText: isRegion ? map._mapData.paths[code].name || '' : map._markers[code].config.name || ''
279
+ };
280
+ };
281
+ function setupElementEvents() {
282
+ var map = this;
283
+ var container = this.container;
284
+ var pageX, pageY, mouseMoved;
285
+ EventHandler.on(container, 'mousemove', function (event) {
286
+ if (Math.abs(pageX - event.pageX) + Math.abs(pageY - event.pageY) > 2) {
287
+ mouseMoved = true;
288
+ }
289
+ });
290
+
291
+ // When the mouse is pressed
292
+ EventHandler.delegate(container, 'mousedown', '.jvm-element', function (event) {
293
+ pageX = event.pageX;
294
+ pageY = event.pageY;
295
+ mouseMoved = false;
296
+ });
297
+
298
+ // When the mouse is over the region/marker | When the mouse is out the region/marker
299
+ EventHandler.delegate(container, 'mouseover mouseout', '.jvm-element', function (event) {
300
+ var data = parseEvent(map, this, true);
301
+ var showTooltip = map.params.showTooltip;
302
+ if (event.type === 'mouseover') {
303
+ data.element.hover(true);
304
+ if (showTooltip) {
305
+ map._tooltip.text(data.tooltipText);
306
+ map._tooltip.show();
307
+ map._emit(data.event, [event, map._tooltip, data.code]);
308
+ }
309
+ } else {
310
+ data.element.hover(false);
311
+ if (showTooltip) {
312
+ map._tooltip.hide();
313
+ }
314
+ }
315
+ });
316
+
317
+ // When the click is released
318
+ EventHandler.delegate(container, 'mouseup', '.jvm-element', function (event) {
319
+ var data = parseEvent(map, this);
320
+ if (mouseMoved) {
321
+ return;
322
+ }
323
+ if (data.type === 'region' && map.params.regionsSelectable || data.type === 'marker' && map.params.markersSelectable) {
324
+ var element = data.element;
325
+
326
+ // We're checking if regions/markers|SelectableOne option is presented
327
+ if (map.params[data.type + "sSelectableOne"]) {
328
+ map._clearSelected(data.type + "s");
329
+ }
330
+ if (data.element.isSelected) {
331
+ element.select(false);
332
+ } else {
333
+ element.select(true);
334
+ }
335
+ map._emit(data.event, [data.code, element.isSelected, map._getSelected(data.type + "s")]);
336
+ }
337
+ });
338
+
339
+ // When region/marker is clicked
340
+ EventHandler.delegate(container, 'click', '.jvm-element', function (event) {
341
+ var _parseEvent = parseEvent(map, this),
342
+ type = _parseEvent.type,
343
+ code = _parseEvent.code;
344
+ map._emit(type === 'region' ? Events.onRegionClick : Events.onMarkerClick, [event, code]);
345
+ });
346
+ }
347
+
348
+ function setupZoomButtons() {
349
+ var _this = this;
350
+ var zoomin = createElement('div', 'jvm-zoom-btn jvm-zoomin', '+', true);
351
+ var zoomout = createElement('div', 'jvm-zoom-btn jvm-zoomout', '&#x2212', true);
352
+ this.container.appendChild(zoomin);
353
+ this.container.appendChild(zoomout);
354
+ var handler = function handler(zoomin) {
355
+ if (zoomin === void 0) {
356
+ zoomin = true;
357
+ }
358
+ return function () {
359
+ return _this._setScale(zoomin ? _this.scale * _this.params.zoomStep : _this.scale / _this.params.zoomStep, _this._width / 2, _this._height / 2, false, _this.params.zoomAnimate);
360
+ };
361
+ };
362
+ EventHandler.on(zoomin, 'click', handler());
363
+ EventHandler.on(zoomout, 'click', handler(false));
364
+ }
365
+
366
+ function setupContainerTouchEvents() {
367
+ var map = this,
368
+ touchStartScale,
369
+ touchStartDistance,
370
+ touchX,
371
+ touchY,
372
+ centerTouchX,
373
+ centerTouchY,
374
+ lastTouchesLength;
375
+ var handleTouchEvent = function handleTouchEvent(e) {
376
+ var touches = e.touches;
377
+ var offset, scale, transXOld, transYOld;
378
+ if (e.type == 'touchstart') {
379
+ lastTouchesLength = 0;
380
+ }
381
+ if (touches.length == 1) {
382
+ if (lastTouchesLength == 1) {
383
+ transXOld = map.transX;
384
+ transYOld = map.transY;
385
+ map.transX -= (touchX - touches[0].pageX) / map.scale;
386
+ map.transY -= (touchY - touches[0].pageY) / map.scale;
387
+ map._tooltip.hide();
388
+ map._applyTransform();
389
+ if (transXOld != map.transX || transYOld != map.transY) {
390
+ e.preventDefault();
391
+ }
392
+ }
393
+ touchX = touches[0].pageX;
394
+ touchY = touches[0].pageY;
395
+ } else if (touches.length == 2) {
396
+ if (lastTouchesLength == 2) {
397
+ scale = Math.sqrt(Math.pow(touches[0].pageX - touches[1].pageX, 2) + Math.pow(touches[0].pageY - touches[1].pageY, 2)) / touchStartDistance;
398
+ map._setScale(touchStartScale * scale, centerTouchX, centerTouchY);
399
+ map._tooltip.hide();
400
+ e.preventDefault();
401
+ } else {
402
+ var rect = map.container.getBoundingClientRect();
403
+ offset = {
404
+ top: rect.top + window.scrollY,
405
+ left: rect.left + window.scrollX
406
+ };
407
+ if (touches[0].pageX > touches[1].pageX) {
408
+ centerTouchX = touches[1].pageX + (touches[0].pageX - touches[1].pageX) / 2;
409
+ } else {
410
+ centerTouchX = touches[0].pageX + (touches[1].pageX - touches[0].pageX) / 2;
411
+ }
412
+ if (touches[0].pageY > touches[1].pageY) {
413
+ centerTouchY = touches[1].pageY + (touches[0].pageY - touches[1].pageY) / 2;
414
+ } else {
415
+ centerTouchY = touches[0].pageY + (touches[1].pageY - touches[0].pageY) / 2;
416
+ }
417
+ centerTouchX -= offset.left;
418
+ centerTouchY -= offset.top;
419
+ touchStartScale = map.scale;
420
+ touchStartDistance = Math.sqrt(Math.pow(touches[0].pageX - touches[1].pageX, 2) + Math.pow(touches[0].pageY - touches[1].pageY, 2));
421
+ }
422
+ }
423
+ lastTouchesLength = touches.length;
424
+ };
425
+ EventHandler.on(map.container, 'touchstart', handleTouchEvent);
426
+ EventHandler.on(map.container, 'touchmove', handleTouchEvent);
427
+ }
428
+
429
+ function _arrayLikeToArray(r, a) {
430
+ (null == a || a > r.length) && (a = r.length);
431
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
432
+ return n;
433
+ }
434
+ function _assertThisInitialized(e) {
435
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
436
+ return e;
437
+ }
438
+ function _createForOfIteratorHelperLoose(r, e) {
439
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
440
+ if (t) return (t = t.call(r)).next.bind(t);
441
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
442
+ t && (r = t);
443
+ var o = 0;
444
+ return function () {
445
+ return o >= r.length ? {
446
+ done: !0
447
+ } : {
448
+ done: !1,
449
+ value: r[o++]
450
+ };
451
+ };
452
+ }
453
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
454
+ }
455
+ function _extends() {
456
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
457
+ for (var e = 1; e < arguments.length; e++) {
458
+ var t = arguments[e];
459
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
460
+ }
461
+ return n;
462
+ }, _extends.apply(null, arguments);
463
+ }
464
+ function _inheritsLoose(t, o) {
465
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
466
+ }
467
+ function _setPrototypeOf(t, e) {
468
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
469
+ return t.__proto__ = e, t;
470
+ }, _setPrototypeOf(t, e);
471
+ }
472
+ function _unsupportedIterableToArray(r, a) {
473
+ if (r) {
474
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
475
+ var t = {}.toString.call(r).slice(8, -1);
476
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
477
+ }
478
+ }
479
+
480
+ /**
481
+ * ------------------------------------------------------------------------
482
+ * Class Definition
483
+ * ------------------------------------------------------------------------
484
+ */
485
+ var BaseComponent = /*#__PURE__*/function () {
486
+ function BaseComponent() {}
487
+ var _proto = BaseComponent.prototype;
488
+ _proto.dispose = function dispose() {
489
+ if (this._tooltip) {
490
+ removeElement(this._tooltip);
491
+ } else {
492
+ // @todo: move shape in base component in v2
493
+ this.shape.remove();
494
+ }
495
+ for (var _iterator = _createForOfIteratorHelperLoose(Object.getOwnPropertyNames(this)), _step; !(_step = _iterator()).done;) {
496
+ var propertyName = _step.value;
497
+ this[propertyName] = null;
498
+ }
499
+ };
500
+ return BaseComponent;
501
+ }();
502
+
503
+ /**
504
+ * ------------------------------------------------------------------------
505
+ * Interactable
506
+ * ------------------------------------------------------------------------
507
+ */
508
+ var Interactable = {
509
+ getLabelText: function getLabelText(key, label) {
510
+ if (!label) {
511
+ return;
512
+ }
513
+ if (typeof label.render === 'function') {
514
+ var params = [];
515
+
516
+ // Pass additional paramater (Marker config object) in case it's a Marker.
517
+ if (this.config && this.config.marker) {
518
+ params.push(this.config.marker);
519
+ }
520
+
521
+ // Becuase we need to add the key always at the end
522
+ params.push(key);
523
+ return label.render.apply(this, params);
524
+ }
525
+ return key;
526
+ },
527
+ getLabelOffsets: function getLabelOffsets(key, label) {
528
+ if (typeof label.offsets === 'function') {
529
+ return label.offsets(key);
530
+ }
531
+
532
+ // If offsets are an array of offsets e.g offsets: [ [0, 25], [10, 15] ]
533
+ if (Array.isArray(label.offsets)) {
534
+ return label.offsets[key];
535
+ }
536
+ return [0, 0];
537
+ },
538
+ setStyle: function setStyle(property, value) {
539
+ this.shape.setStyle(property, value);
540
+ },
541
+ remove: function remove() {
542
+ this.shape.remove();
543
+ if (this.label) this.label.remove();
544
+ },
545
+ hover: function hover(state) {
546
+ this._setStatus('isHovered', state);
547
+ },
548
+ select: function select(state) {
549
+ this._setStatus('isSelected', state);
550
+ },
551
+ // Private
552
+ _setStatus: function _setStatus(property, state) {
553
+ this.shape[property] = state;
554
+ this.shape.updateStyle();
555
+ this[property] = state;
556
+ if (this.label) {
557
+ this.label[property] = state;
558
+ this.label.updateStyle();
559
+ }
560
+ }
561
+ };
562
+
563
+ /**
564
+ * ------------------------------------------------------------------------
565
+ * Class Definition
566
+ * ------------------------------------------------------------------------
567
+ */
568
+ var Region = /*#__PURE__*/function (_BaseComponent) {
569
+ function Region(_ref) {
570
+ var _this;
571
+ var map = _ref.map,
572
+ code = _ref.code,
573
+ path = _ref.path,
574
+ style = _ref.style,
575
+ label = _ref.label,
576
+ labelStyle = _ref.labelStyle,
577
+ labelsGroup = _ref.labelsGroup;
578
+ _this = _BaseComponent.call(this) || this;
579
+ _this._map = map;
580
+ _this.shape = _this._createRegion(path, code, style);
581
+ var text = _this.getLabelText(code, label);
582
+
583
+ // If label is passed and render function returns something
584
+ if (label && text) {
585
+ var bbox = _this.shape.getBBox();
586
+ var offsets = _this.getLabelOffsets(code, label);
587
+ _this.labelX = bbox.x + bbox.width / 2 + offsets[0];
588
+ _this.labelY = bbox.y + bbox.height / 2 + offsets[1];
589
+ _this.label = _this._map.canvas.createText({
590
+ text: text,
591
+ textAnchor: 'middle',
592
+ alignmentBaseline: 'central',
593
+ dataCode: code,
594
+ x: _this.labelX,
595
+ y: _this.labelY
596
+ }, labelStyle, labelsGroup);
597
+ _this.label.addClass('jvm-region jvm-element');
598
+ }
599
+ return _this;
600
+ }
601
+ _inheritsLoose(Region, _BaseComponent);
602
+ var _proto = Region.prototype;
603
+ _proto._createRegion = function _createRegion(path, code, style) {
604
+ path = this._map.canvas.createPath({
605
+ d: path,
606
+ dataCode: code
607
+ }, style);
608
+ path.addClass('jvm-region jvm-element');
609
+ return path;
610
+ };
611
+ _proto.updateLabelPosition = function updateLabelPosition() {
612
+ if (this.label) {
613
+ this.label.set({
614
+ x: this.labelX * this._map.scale + this._map.transX * this._map.scale,
615
+ y: this.labelY * this._map.scale + this._map.transY * this._map.scale
616
+ });
617
+ }
618
+ };
619
+ return Region;
620
+ }(BaseComponent);
621
+ inherit(Region, Interactable);
622
+
623
+ function createRegions() {
624
+ this._regionLabelsGroup = this._regionLabelsGroup || this.canvas.createGroup('jvm-regions-labels-group');
625
+ for (var code in this._mapData.paths) {
626
+ var region = new Region({
627
+ map: this,
628
+ code: code,
629
+ path: this._mapData.paths[code].path,
630
+ style: merge({}, this.params.regionStyle),
631
+ labelStyle: this.params.regionLabelStyle,
632
+ labelsGroup: this._regionLabelsGroup,
633
+ label: this.params.labels && this.params.labels.regions
634
+ });
635
+ this.regions[code] = {
636
+ config: this._mapData.paths[code],
637
+ element: region
638
+ };
639
+ }
640
+ }
641
+
642
+ /**
643
+ * ------------------------------------------------------------------------
644
+ * Class Definition
645
+ * ------------------------------------------------------------------------
646
+ */
647
+ var Line = /*#__PURE__*/function (_BaseComponent) {
648
+ function Line(_ref) {
649
+ var _this;
650
+ var index = _ref.index,
651
+ map = _ref.map,
652
+ style = _ref.style,
653
+ x1 = _ref.x1,
654
+ y1 = _ref.y1,
655
+ x2 = _ref.x2,
656
+ y2 = _ref.y2,
657
+ group = _ref.group,
658
+ config = _ref.config;
659
+ _this = _BaseComponent.call(this) || this;
660
+ _this.config = config;
661
+ _this.shape = map.canvas.createLine({
662
+ x1: x1,
663
+ y1: y1,
664
+ x2: x2,
665
+ y2: y2,
666
+ dataIndex: index
667
+ }, style, group);
668
+ _this.shape.addClass('jvm-line');
669
+ return _this;
670
+ }
671
+ _inheritsLoose(Line, _BaseComponent);
672
+ var _proto = Line.prototype;
673
+ _proto.setStyle = function setStyle(property, value) {
674
+ this.shape.setStyle(property, value);
675
+ };
676
+ return Line;
677
+ }(BaseComponent);
678
+
679
+ function createLines(lines, markers, isRecentlyCreated) {
680
+ if (isRecentlyCreated === void 0) {
681
+ isRecentlyCreated = false;
682
+ }
683
+ var point1 = false,
684
+ point2 = false;
685
+
686
+ // Create group for holding lines
687
+ // we're checking if `linesGroup` exists or not becuase we may add lines
688
+ // after the map has loaded so we will append the futured lines to this group as well.
689
+ this.linesGroup = this.linesGroup || this.canvas.createGroup('jvm-lines-group');
690
+ for (var index in lines) {
691
+ var config = lines[index];
692
+ for (var mindex in markers) {
693
+ var markerConfig = isRecentlyCreated ? markers[mindex].config : markers[mindex];
694
+ if (markerConfig.name === config.from) {
695
+ point1 = this.getMarkerPosition(markerConfig);
696
+ }
697
+ if (markerConfig.name === config.to) {
698
+ point2 = this.getMarkerPosition(markerConfig);
699
+ }
700
+ }
701
+ if (point1 !== false && point2 !== false) {
702
+ // Register lines with unique keys
703
+ this._lines[getLineUid(config.from, config.to)] = new Line({
704
+ index: index,
705
+ map: this,
706
+ // Merge the default `lineStyle` object with the custom `line` config style
707
+ style: merge({
708
+ initial: this.params.lineStyle
709
+ }, {
710
+ initial: config.style || {}
711
+ }, true),
712
+ x1: point1.x,
713
+ y1: point1.y,
714
+ x2: point2.x,
715
+ y2: point2.y,
716
+ group: this.linesGroup,
717
+ config: config
718
+ });
719
+ }
720
+ }
721
+ }
722
+
723
+ /**
724
+ * ------------------------------------------------------------------------
725
+ * Class Definition
726
+ * ------------------------------------------------------------------------
727
+ */
728
+ var Marker = /*#__PURE__*/function (_BaseComponent) {
729
+ function Marker(_ref) {
730
+ var _this;
731
+ var index = _ref.index,
732
+ style = _ref.style,
733
+ label = _ref.label,
734
+ cx = _ref.cx,
735
+ cy = _ref.cy,
736
+ map = _ref.map,
737
+ group = _ref.group;
738
+ _this = _BaseComponent.call(this) || this;
739
+
740
+ // Private
741
+ _this._map = map;
742
+ _this._isImage = !!style.initial.image;
743
+
744
+ // Protected
745
+ _this.config = arguments[0];
746
+ _this.shape = map.canvas[_this._isImage ? 'createImage' : 'createCircle']({
747
+ dataIndex: index,
748
+ cx: cx,
749
+ cy: cy
750
+ }, style, group);
751
+ _this.shape.addClass('jvm-marker jvm-element');
752
+ if (_this._isImage) {
753
+ _this.updateLabelPosition();
754
+ }
755
+ if (label) {
756
+ _this._createLabel(_this.config);
757
+ }
758
+ return _this;
759
+ }
760
+ _inheritsLoose(Marker, _BaseComponent);
761
+ var _proto = Marker.prototype;
762
+ _proto.updateLabelPosition = function updateLabelPosition() {
763
+ if (this.label) {
764
+ this.label.set({
765
+ x: this._labelX * this._map.scale + this._offsets[0] + this._map.transX * this._map.scale + 5 + (this._isImage ? (this.shape.width || 0) / 2 : this.shape.node.r.baseVal.value),
766
+ y: this._labelY * this._map.scale + this._map.transY * this._map.scale + this._offsets[1]
767
+ });
768
+ }
769
+ };
770
+ _proto._createLabel = function _createLabel(_ref2) {
771
+ var index = _ref2.index,
772
+ map = _ref2.map,
773
+ label = _ref2.label,
774
+ labelsGroup = _ref2.labelsGroup,
775
+ cx = _ref2.cx,
776
+ cy = _ref2.cy,
777
+ marker = _ref2.marker,
778
+ isRecentlyCreated = _ref2.isRecentlyCreated;
779
+ var labelText = this.getLabelText(index, label);
780
+ this._labelX = cx / map.scale - map.transX;
781
+ this._labelY = cy / map.scale - map.transY;
782
+ this._offsets = isRecentlyCreated && marker.offsets ? marker.offsets : this.getLabelOffsets(index, label);
783
+ this.label = map.canvas.createText({
784
+ text: labelText,
785
+ dataIndex: index,
786
+ x: this._labelX,
787
+ y: this._labelY,
788
+ dy: '0.6ex'
789
+ }, map.params.markerLabelStyle, labelsGroup);
790
+ this.label.addClass('jvm-marker jvm-element');
791
+ if (isRecentlyCreated) {
792
+ this.updateLabelPosition();
793
+ }
794
+ };
795
+ return Marker;
796
+ }(BaseComponent);
797
+ inherit(Marker, Interactable);
798
+
799
+ function createMarkers(markers, isRecentlyCreated) {
800
+ var _this = this;
801
+ if (markers === void 0) {
802
+ markers = {};
803
+ }
804
+ if (isRecentlyCreated === void 0) {
805
+ isRecentlyCreated = false;
806
+ }
807
+ // Create groups for holding markers and markers labels
808
+ // We're checking if `markersGroup` exists or not becuase we may add markers after the map has loaded
809
+ // So we will append the futured markers to this group as well.
810
+ this._markersGroup = this._markersGroup || this.canvas.createGroup('jvm-markers-group');
811
+ this._markerLabelsGroup = this._markerLabelsGroup || this.canvas.createGroup('jvm-markers-labels-group');
812
+ var _loop = function _loop() {
813
+ var config = markers[index];
814
+ var point = _this.getMarkerPosition(config);
815
+ var uid = config.coords.join(':');
816
+ if (!point) {
817
+ return 0; // continue
818
+ }
819
+
820
+ // We're checking if recently created marker does already exist
821
+ // If it does we don't need to create it again, so we'll continue
822
+ // Becuase we may have more than one marker submitted via `addMarkers` method.
823
+ if (isRecentlyCreated) {
824
+ if (Object.keys(_this._markers).filter(function (i) {
825
+ return _this._markers[i]._uid === uid;
826
+ }).length) {
827
+ return 0; // continue
828
+ }
829
+ index = Object.keys(_this._markers).length;
830
+ }
831
+ var marker = new Marker({
832
+ index: index,
833
+ map: _this,
834
+ // Merge the `markerStyle` object with the marker config `style` if presented.
835
+ style: merge(_this.params.markerStyle, _extends({}, config.style || {}), true),
836
+ label: _this.params.labels && _this.params.labels.markers,
837
+ labelsGroup: _this._markerLabelsGroup,
838
+ cx: point.x,
839
+ cy: point.y,
840
+ group: _this._markersGroup,
841
+ marker: config,
842
+ isRecentlyCreated: isRecentlyCreated
843
+ });
844
+
845
+ // Check for marker duplication
846
+ // this is useful when for example: a user clicks a button for creating marker two times
847
+ // so it will remove the old one and the new one will take its place.
848
+ if (_this._markers[index]) {
849
+ _this.removeMarkers([index]);
850
+ }
851
+ _this._markers[index] = {
852
+ _uid: uid,
853
+ config: config,
854
+ element: marker
855
+ };
856
+ },
857
+ _ret;
858
+ for (var index in markers) {
859
+ _ret = _loop();
860
+ if (_ret === 0) continue;
861
+ }
862
+ }
863
+
864
+ /**
865
+ * ------------------------------------------------------------------------
866
+ * Class Definition
867
+ * ------------------------------------------------------------------------
868
+ */
869
+ var Legend = /*#__PURE__*/function () {
870
+ function Legend(options) {
871
+ if (options === void 0) {
872
+ options = {};
873
+ }
874
+ this._options = options;
875
+ this._map = this._options.map;
876
+ this._series = this._options.series;
877
+ this._body = createElement('div', 'jvm-legend');
878
+ if (this._options.cssClass) {
879
+ this._body.setAttribute('class', this._options.cssClass);
880
+ }
881
+ if (options.vertical) {
882
+ this._map.legendVertical.appendChild(this._body);
883
+ } else {
884
+ this._map.legendHorizontal.appendChild(this._body);
885
+ }
886
+ this.render();
887
+ }
888
+ var _proto = Legend.prototype;
889
+ _proto.render = function render() {
890
+ var ticks = this._series.scale.getTicks();
891
+ var inner = createElement('div', 'jvm-legend-inner');
892
+ this._body.innderHTML = '';
893
+ if (this._options.title) {
894
+ var legendTitle = createElement('div', 'jvm-legend-title', this._options.title);
895
+ this._body.appendChild(legendTitle);
896
+ }
897
+ this._body.appendChild(inner);
898
+ for (var i = 0; i < ticks.length; i++) {
899
+ var tick = createElement('div', 'jvm-legend-tick');
900
+ var sample = createElement('div', 'jvm-legend-tick-sample');
901
+ switch (this._series.config.attribute) {
902
+ case 'fill':
903
+ if (isImageUrl(ticks[i].value)) {
904
+ sample.style.background = "url(" + ticks[i].value + ")";
905
+ } else {
906
+ sample.style.background = ticks[i].value;
907
+ }
908
+ break;
909
+ case 'stroke':
910
+ sample.style.background = ticks[i].value;
911
+ break;
912
+ case 'image':
913
+ sample.style.background = "url(" + (typeof ticks[i].value === 'object' ? ticks[i].value.url : ticks[i].value) + ") no-repeat center center";
914
+ sample.style.backgroundSize = 'cover';
915
+ break;
916
+ }
917
+ tick.appendChild(sample);
918
+ var label = ticks[i].label;
919
+ if (this._options.labelRender) {
920
+ label = this._options.labelRender(label);
921
+ }
922
+ var tickText = createElement('div', 'jvm-legend-tick-text', label);
923
+ tick.appendChild(tickText);
924
+ inner.appendChild(tick);
925
+ }
926
+ };
927
+ return Legend;
928
+ }();
929
+
930
+ /**
931
+ * ------------------------------------------------------------------------
932
+ * Class Definition
933
+ * ------------------------------------------------------------------------
934
+ */
935
+ var OrdinalScale = /*#__PURE__*/function () {
936
+ function OrdinalScale(scale) {
937
+ this._scale = scale;
938
+ }
939
+ var _proto = OrdinalScale.prototype;
940
+ _proto.getValue = function getValue(value) {
941
+ return this._scale[value];
942
+ };
943
+ _proto.getTicks = function getTicks() {
944
+ var ticks = [];
945
+ for (var key in this._scale) {
946
+ ticks.push({
947
+ label: key,
948
+ value: this._scale[key]
949
+ });
950
+ }
951
+ return ticks;
952
+ };
953
+ return OrdinalScale;
954
+ }();
955
+
956
+ /**
957
+ * ------------------------------------------------------------------------
958
+ * Class Definition
959
+ * ------------------------------------------------------------------------
960
+ */
961
+ var Series = /*#__PURE__*/function () {
962
+ function Series(config, elements, map) {
963
+ if (config === void 0) {
964
+ config = {};
965
+ }
966
+ // Private
967
+ this._map = map;
968
+ this._elements = elements; // Could be markers or regions
969
+ this._values = config.values || {};
970
+
971
+ // Protected
972
+ this.config = config;
973
+ this.config.attribute = config.attribute || 'fill';
974
+
975
+ // Set initial attributes
976
+ if (config.attributes) {
977
+ this.setAttributes(config.attributes);
978
+ }
979
+ if (typeof config.scale === 'object') {
980
+ this.scale = new OrdinalScale(config.scale);
981
+ }
982
+ if (this.config.legend) {
983
+ this.legend = new Legend(merge({
984
+ map: this._map,
985
+ series: this
986
+ }, this.config.legend));
987
+ }
988
+ this.setValues(this._values);
989
+ }
990
+ var _proto = Series.prototype;
991
+ _proto.setValues = function setValues(values) {
992
+ var attrs = {};
993
+ for (var key in values) {
994
+ if (values[key]) {
995
+ attrs[key] = this.scale.getValue(values[key]);
996
+ }
997
+ }
998
+ this.setAttributes(attrs);
999
+ };
1000
+ _proto.setAttributes = function setAttributes(attrs) {
1001
+ for (var code in attrs) {
1002
+ if (this._elements[code]) {
1003
+ this._elements[code].element.setStyle(this.config.attribute, attrs[code]);
1004
+ }
1005
+ }
1006
+ };
1007
+ _proto.clear = function clear() {
1008
+ var key,
1009
+ attrs = {};
1010
+ for (key in this._values) {
1011
+ if (this._elements[key]) {
1012
+ attrs[key] = this._elements[key].element.shape.style.initial[this.config.attribute];
1013
+ }
1014
+ }
1015
+ this.setAttributes(attrs);
1016
+ this._values = {};
1017
+ };
1018
+ return Series;
1019
+ }();
1020
+
1021
+ function createSeries() {
1022
+ this.series = {
1023
+ markers: [],
1024
+ regions: []
1025
+ };
1026
+ for (var key in this.params.series) {
1027
+ for (var i = 0; i < this.params.series[key].length; i++) {
1028
+ this.series[key][i] = new Series(this.params.series[key][i], key === 'markers' ? this._markers : this.regions, this);
1029
+ }
1030
+ }
1031
+ }
1032
+
1033
+ function applyTransform() {
1034
+ var maxTransX, maxTransY, minTransX, minTransY;
1035
+ if (this._defaultWidth * this.scale <= this._width) {
1036
+ maxTransX = (this._width - this._defaultWidth * this.scale) / (2 * this.scale);
1037
+ minTransX = (this._width - this._defaultWidth * this.scale) / (2 * this.scale);
1038
+ } else {
1039
+ maxTransX = 0;
1040
+ minTransX = (this._width - this._defaultWidth * this.scale) / this.scale;
1041
+ }
1042
+ if (this._defaultHeight * this.scale <= this._height) {
1043
+ maxTransY = (this._height - this._defaultHeight * this.scale) / (2 * this.scale);
1044
+ minTransY = (this._height - this._defaultHeight * this.scale) / (2 * this.scale);
1045
+ } else {
1046
+ maxTransY = 0;
1047
+ minTransY = (this._height - this._defaultHeight * this.scale) / this.scale;
1048
+ }
1049
+ if (this.transY > maxTransY) {
1050
+ this.transY = maxTransY;
1051
+ } else if (this.transY < minTransY) {
1052
+ this.transY = minTransY;
1053
+ }
1054
+ if (this.transX > maxTransX) {
1055
+ this.transX = maxTransX;
1056
+ } else if (this.transX < minTransX) {
1057
+ this.transX = minTransX;
1058
+ }
1059
+ this.canvas.applyTransformParams(this.scale, this.transX, this.transY);
1060
+ if (this._markers) {
1061
+ this._repositionMarkers();
1062
+ }
1063
+ if (this._lines) {
1064
+ this._repositionLines();
1065
+ }
1066
+ this._repositionLabels();
1067
+ }
1068
+
1069
+ function resize() {
1070
+ var curBaseScale = this._baseScale;
1071
+ if (this._width / this._height > this._defaultWidth / this._defaultHeight) {
1072
+ this._baseScale = this._height / this._defaultHeight;
1073
+ this._baseTransX = Math.abs(this._width - this._defaultWidth * this._baseScale) / (2 * this._baseScale);
1074
+ } else {
1075
+ this._baseScale = this._width / this._defaultWidth;
1076
+ this._baseTransY = Math.abs(this._height - this._defaultHeight * this._baseScale) / (2 * this._baseScale);
1077
+ }
1078
+ this.scale *= this._baseScale / curBaseScale;
1079
+ this.transX *= this._baseScale / curBaseScale;
1080
+ this.transY *= this._baseScale / curBaseScale;
1081
+ }
1082
+
1083
+ function setScale(scale, anchorX, anchorY, isCentered, animate) {
1084
+ var _this = this;
1085
+ var zoomStep,
1086
+ interval,
1087
+ i = 0,
1088
+ count = Math.abs(Math.round((scale - this.scale) * 60 / Math.max(scale, this.scale))),
1089
+ scaleStart,
1090
+ scaleDiff,
1091
+ transXStart,
1092
+ transXDiff,
1093
+ transYStart,
1094
+ transYDiff,
1095
+ transX,
1096
+ transY;
1097
+ if (scale > this.params.zoomMax * this._baseScale) {
1098
+ scale = this.params.zoomMax * this._baseScale;
1099
+ } else if (scale < this.params.zoomMin * this._baseScale) {
1100
+ scale = this.params.zoomMin * this._baseScale;
1101
+ }
1102
+ if (typeof anchorX != 'undefined' && typeof anchorY != 'undefined') {
1103
+ zoomStep = scale / this.scale;
1104
+ if (isCentered) {
1105
+ transX = anchorX + this._defaultWidth * (this._width / (this._defaultWidth * scale)) / 2;
1106
+ transY = anchorY + this._defaultHeight * (this._height / (this._defaultHeight * scale)) / 2;
1107
+ } else {
1108
+ transX = this.transX - (zoomStep - 1) / scale * anchorX;
1109
+ transY = this.transY - (zoomStep - 1) / scale * anchorY;
1110
+ }
1111
+ }
1112
+ if (animate && count > 0) {
1113
+ scaleStart = this.scale;
1114
+ scaleDiff = (scale - scaleStart) / count;
1115
+ transXStart = this.transX * this.scale;
1116
+ transYStart = this.transY * this.scale;
1117
+ transXDiff = (transX * scale - transXStart) / count;
1118
+ transYDiff = (transY * scale - transYStart) / count;
1119
+ interval = setInterval(function () {
1120
+ i += 1;
1121
+ _this.scale = scaleStart + scaleDiff * i;
1122
+ _this.transX = (transXStart + transXDiff * i) / _this.scale;
1123
+ _this.transY = (transYStart + transYDiff * i) / _this.scale;
1124
+ _this._applyTransform();
1125
+ if (i == count) {
1126
+ clearInterval(interval);
1127
+ _this._emit(Events.onViewportChange, [_this.scale, _this.transX, _this.transY]);
1128
+ }
1129
+ }, 10);
1130
+ } else {
1131
+ this.transX = transX;
1132
+ this.transY = transY;
1133
+ this.scale = scale;
1134
+ this._applyTransform();
1135
+ this._emit(Events.onViewportChange, [this.scale, this.transX, this.transY]);
1136
+ }
1137
+ }
1138
+
1139
+ function setFocus(config) {
1140
+ var _this = this;
1141
+ if (config === void 0) {
1142
+ config = {};
1143
+ }
1144
+ var bbox,
1145
+ codes = [];
1146
+ if (config.region) {
1147
+ codes.push(config.region);
1148
+ } else if (config.regions) {
1149
+ codes = config.regions;
1150
+ }
1151
+ if (codes.length) {
1152
+ codes.forEach(function (code) {
1153
+ if (_this.regions[code]) {
1154
+ var itemBbox = _this.regions[code].element.shape.getBBox();
1155
+ if (itemBbox) {
1156
+ // Handle the first loop
1157
+ if (typeof bbox == 'undefined') {
1158
+ bbox = itemBbox;
1159
+ } else {
1160
+ // get the old bbox properties plus the current
1161
+ // this kinda incrementing the old values and the new values
1162
+ bbox = {
1163
+ x: Math.min(bbox.x, itemBbox.x),
1164
+ y: Math.min(bbox.y, itemBbox.y),
1165
+ width: Math.max(bbox.x + bbox.width, itemBbox.x + itemBbox.width) - Math.min(bbox.x, itemBbox.x),
1166
+ height: Math.max(bbox.y + bbox.height, itemBbox.y + itemBbox.height) - Math.min(bbox.y, itemBbox.y)
1167
+ };
1168
+ }
1169
+ }
1170
+ }
1171
+ });
1172
+ return this._setScale(Math.min(this._width / bbox.width, this._height / bbox.height), -(bbox.x + bbox.width / 2), -(bbox.y + bbox.height / 2), true, config.animate);
1173
+ } else if (config.coords) {
1174
+ var point = this.coordsToPoint(config.coords[0], config.coords[1]);
1175
+ var x = this.transX - point.x / this.scale;
1176
+ var y = this.transY - point.y / this.scale;
1177
+ return this._setScale(config.scale * this._baseScale, x, y, true, config.animate);
1178
+ }
1179
+ }
1180
+
1181
+ function updateSize() {
1182
+ this._width = this.container.offsetWidth;
1183
+ this._height = this.container.offsetHeight;
1184
+ this._resize();
1185
+ this.canvas.setSize(this._width, this._height);
1186
+ this._applyTransform();
1187
+ }
1188
+
1189
+ /**
1190
+ * ------------------------------------------------------------------------
1191
+ * Object
1192
+ * ------------------------------------------------------------------------
1193
+ */
1194
+ var Proj = {
1195
+ /* sgn(n){
1196
+ if (n > 0) {
1197
+ return 1;
1198
+ } else if (n < 0) {
1199
+ return -1;
1200
+ } else {
1201
+ return n;
1202
+ }
1203
+ }, */
1204
+ mill: function mill(lat, lng, c) {
1205
+ return {
1206
+ x: this.radius * (lng - c) * this.radDeg,
1207
+ y: -this.radius * Math.log(Math.tan((45 + 0.4 * lat) * this.radDeg)) / 0.8
1208
+ };
1209
+ },
1210
+ /* mill_inv(x, y, c) {
1211
+ return {
1212
+ lat: (2.5 * Math.atan(Math.exp(0.8 * y / this.radius)) - 5 * Math.PI / 8) * this.degRad,
1213
+ lng: (c * this.radDeg + x / this.radius) * this.degRad
1214
+ };
1215
+ }, */
1216
+ merc: function merc(lat, lng, c) {
1217
+ return {
1218
+ x: this.radius * (lng - c) * this.radDeg,
1219
+ y: -this.radius * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360))
1220
+ };
1221
+ },
1222
+ /* merc_inv(x, y, c) {
1223
+ return {
1224
+ lat: (2 * Math.atan(Math.exp(y / this.radius)) - Math.PI / 2) * this.degRad,
1225
+ lng: (c * this.radDeg + x / this.radius) * this.degRad
1226
+ };
1227
+ }, */
1228
+ aea: function aea(lat, lng, c) {
1229
+ var fi0 = 0,
1230
+ lambda0 = c * this.radDeg,
1231
+ fi1 = 29.5 * this.radDeg,
1232
+ fi2 = 45.5 * this.radDeg,
1233
+ fi = lat * this.radDeg,
1234
+ lambda = lng * this.radDeg,
1235
+ n = (Math.sin(fi1) + Math.sin(fi2)) / 2,
1236
+ C = Math.cos(fi1) * Math.cos(fi1) + 2 * n * Math.sin(fi1),
1237
+ theta = n * (lambda - lambda0),
1238
+ ro = Math.sqrt(C - 2 * n * Math.sin(fi)) / n,
1239
+ ro0 = Math.sqrt(C - 2 * n * Math.sin(fi0)) / n;
1240
+ return {
1241
+ x: ro * Math.sin(theta) * this.radius,
1242
+ y: -(ro0 - ro * Math.cos(theta)) * this.radius
1243
+ };
1244
+ },
1245
+ /* aea_inv(xCoord, yCoord, c) {
1246
+ var x = xCoord / this.radius,
1247
+ y = yCoord / this.radius,
1248
+ fi0 = 0,
1249
+ lambda0 = c * this.radDeg,
1250
+ fi1 = 29.5 * this.radDeg,
1251
+ fi2 = 45.5 * this.radDeg,
1252
+ n = (Math.sin(fi1)+Math.sin(fi2)) / 2,
1253
+ C = Math.cos(fi1)*Math.cos(fi1)+2*n*Math.sin(fi1),
1254
+ ro0 = Math.sqrt(C-2*n*Math.sin(fi0))/n,
1255
+ ro = Math.sqrt(x*x+(ro0-y)*(ro0-y)),
1256
+ theta = Math.atan( x / (ro0 - y) );
1257
+ return {
1258
+ lat: (Math.asin((C - ro * ro * n * n) / (2 * n))) * this.degRad,
1259
+ lng: (lambda0 + theta / n) * this.degRad
1260
+ };
1261
+ }, */
1262
+ lcc: function lcc(lat, lng, c) {
1263
+ var fi0 = 0,
1264
+ lambda0 = c * this.radDeg,
1265
+ lambda = lng * this.radDeg,
1266
+ fi1 = 33 * this.radDeg,
1267
+ fi2 = 45 * this.radDeg,
1268
+ fi = lat * this.radDeg,
1269
+ n = Math.log(Math.cos(fi1) * (1 / Math.cos(fi2))) / Math.log(Math.tan(Math.PI / 4 + fi2 / 2) * (1 / Math.tan(Math.PI / 4 + fi1 / 2))),
1270
+ F = Math.cos(fi1) * Math.pow(Math.tan(Math.PI / 4 + fi1 / 2), n) / n,
1271
+ ro = F * Math.pow(1 / Math.tan(Math.PI / 4 + fi / 2), n),
1272
+ ro0 = F * Math.pow(1 / Math.tan(Math.PI / 4 + fi0 / 2), n);
1273
+ return {
1274
+ x: ro * Math.sin(n * (lambda - lambda0)) * this.radius,
1275
+ y: -(ro0 - ro * Math.cos(n * (lambda - lambda0))) * this.radius
1276
+ };
1277
+ }
1278
+ /* lcc_inv(xCoord, yCoord, c) {
1279
+ var x = xCoord / this.radius,
1280
+ y = yCoord / this.radius,
1281
+ fi0 = 0,
1282
+ lambda0 = c * this.radDeg,
1283
+ fi1 = 33 * this.radDeg,
1284
+ fi2 = 45 * this.radDeg,
1285
+ n = Math.log( Math.cos(fi1) * (1 / Math.cos(fi2)) ) / Math.log( Math.tan( Math.PI / 4 + fi2 / 2) * (1 / Math.tan( Math.PI / 4 + fi1 / 2) ) ),
1286
+ F = ( Math.cos(fi1) * Math.pow( Math.tan( Math.PI / 4 + fi1 / 2 ), n ) ) / n,
1287
+ ro0 = F * Math.pow( 1 / Math.tan( Math.PI / 4 + fi0 / 2 ), n ),
1288
+ ro = this.sgn(n) * Math.sqrt(x*x+(ro0-y)*(ro0-y)),
1289
+ theta = Math.atan( x / (ro0 - y) );
1290
+ return {
1291
+ lat: (2 * Math.atan(Math.pow(F/ro, 1/n)) - Math.PI / 2) * this.degRad,
1292
+ lng: (lambda0 + theta / n) * this.degRad
1293
+ };
1294
+ } */
1295
+ };
1296
+ Proj.degRad = 180 / Math.PI;
1297
+ Proj.radDeg = Math.PI / 180;
1298
+ Proj.radius = 6381372;
1299
+
1300
+ function coordsToPoint(lat, lng) {
1301
+ var projection = Map.maps[this.params.map].projection;
1302
+ var _Proj$projection$type = Proj[projection.type](lat, lng, projection.centralMeridian),
1303
+ x = _Proj$projection$type.x,
1304
+ y = _Proj$projection$type.y;
1305
+ var inset = this.getInsetForPoint(x, y);
1306
+ if (!inset) {
1307
+ return false;
1308
+ }
1309
+ var bbox = inset.bbox;
1310
+ x = (x - bbox[0].x) / (bbox[1].x - bbox[0].x) * inset.width * this.scale;
1311
+ y = (y - bbox[0].y) / (bbox[1].y - bbox[0].y) * inset.height * this.scale;
1312
+ return {
1313
+ x: x + this.transX * this.scale + inset.left * this.scale,
1314
+ y: y + this.transY * this.scale + inset.top * this.scale
1315
+ };
1316
+ }
1317
+
1318
+ function getInsetForPoint(x, y) {
1319
+ var insets = Map.maps[this.params.map].insets;
1320
+ for (var index = 0; index < insets.length; index++) {
1321
+ var _insets$index$bbox = insets[index].bbox,
1322
+ start = _insets$index$bbox[0],
1323
+ end = _insets$index$bbox[1];
1324
+ if (x > start.x && x < end.x && y > start.y && y < end.y) {
1325
+ return insets[index];
1326
+ }
1327
+ }
1328
+ }
1329
+
1330
+ function getMarkerPosition(_ref) {
1331
+ var coords = _ref.coords;
1332
+ if (Map.maps[this.params.map].projection) {
1333
+ return this.coordsToPoint.apply(this, coords);
1334
+ }
1335
+ return {
1336
+ x: coords[0] * this.scale + this.transX * this.scale,
1337
+ y: coords[1] * this.scale + this.transY * this.scale
1338
+ };
1339
+ }
1340
+
1341
+ function repositionLines() {
1342
+ var point1 = false,
1343
+ point2 = false;
1344
+ for (var index in this._lines) {
1345
+ for (var mindex in this._markers) {
1346
+ var marker = this._markers[mindex];
1347
+ if (marker.config.name === this._lines[index].config.from) {
1348
+ point1 = this.getMarkerPosition(marker.config);
1349
+ }
1350
+ if (marker.config.name === this._lines[index].config.to) {
1351
+ point2 = this.getMarkerPosition(marker.config);
1352
+ }
1353
+ }
1354
+ if (point1 !== false && point2 !== false) {
1355
+ this._lines[index].setStyle({
1356
+ x1: point1.x,
1357
+ y1: point1.y,
1358
+ x2: point2.x,
1359
+ y2: point2.y
1360
+ });
1361
+ }
1362
+ }
1363
+ }
1364
+
1365
+ function repositionMarkers() {
1366
+ for (var index in this._markers) {
1367
+ var point = this.getMarkerPosition(this._markers[index].config);
1368
+ if (point !== false) {
1369
+ this._markers[index].element.setStyle({
1370
+ cx: point.x,
1371
+ cy: point.y
1372
+ });
1373
+ }
1374
+ }
1375
+ }
1376
+
1377
+ function repositionLabels() {
1378
+ var labels = this.params.labels;
1379
+ if (!labels) {
1380
+ return;
1381
+ }
1382
+
1383
+ // Regions labels
1384
+ if (labels.regions) {
1385
+ for (var key in this.regions) {
1386
+ this.regions[key].element.updateLabelPosition();
1387
+ }
1388
+ }
1389
+
1390
+ // Markers labels
1391
+ if (labels.markers) {
1392
+ for (var _key in this._markers) {
1393
+ this._markers[_key].element.updateLabelPosition();
1394
+ }
1395
+ }
1396
+ }
1397
+
1398
+ var core = {
1399
+ _setupContainerEvents: setupContainerEvents,
1400
+ _setupElementEvents: setupElementEvents,
1401
+ _setupZoomButtons: setupZoomButtons,
1402
+ _setupContainerTouchEvents: setupContainerTouchEvents,
1403
+ _createRegions: createRegions,
1404
+ _createLines: createLines,
1405
+ _createMarkers: createMarkers,
1406
+ _createSeries: createSeries,
1407
+ _applyTransform: applyTransform,
1408
+ _resize: resize,
1409
+ _setScale: setScale,
1410
+ setFocus: setFocus,
1411
+ updateSize: updateSize,
1412
+ coordsToPoint: coordsToPoint,
1413
+ getInsetForPoint: getInsetForPoint,
1414
+ getMarkerPosition: getMarkerPosition,
1415
+ _repositionLines: repositionLines,
1416
+ _repositionMarkers: repositionMarkers,
1417
+ _repositionLabels: repositionLabels
1418
+ };
1419
+
1420
+ var Defaults = {
1421
+ map: 'world',
1422
+ backgroundColor: 'transparent',
1423
+ draggable: true,
1424
+ zoomButtons: true,
1425
+ zoomOnScroll: true,
1426
+ zoomOnScrollSpeed: 3,
1427
+ zoomMax: 12,
1428
+ zoomMin: 1,
1429
+ zoomAnimate: true,
1430
+ showTooltip: true,
1431
+ zoomStep: 1.5,
1432
+ bindTouchEvents: true,
1433
+ // Line options
1434
+ lineStyle: {
1435
+ stroke: '#808080',
1436
+ strokeWidth: 1,
1437
+ strokeLinecap: 'round'
1438
+ },
1439
+ // Marker options
1440
+ markersSelectable: false,
1441
+ markersSelectableOne: false,
1442
+ markerStyle: {
1443
+ initial: {
1444
+ r: 7,
1445
+ fill: '#374151',
1446
+ fillOpacity: 1,
1447
+ stroke: '#FFF',
1448
+ strokeWidth: 5,
1449
+ strokeOpacity: .5
1450
+ },
1451
+ hover: {
1452
+ fill: '#3cc0ff',
1453
+ cursor: 'pointer'
1454
+ },
1455
+ selected: {
1456
+ fill: 'blue'
1457
+ },
1458
+ selectedHover: {}
1459
+ },
1460
+ markerLabelStyle: {
1461
+ initial: {
1462
+ fontFamily: 'Verdana',
1463
+ fontSize: 12,
1464
+ fontWeight: 500,
1465
+ cursor: 'default',
1466
+ fill: '#374151'
1467
+ },
1468
+ hover: {
1469
+ cursor: 'pointer'
1470
+ },
1471
+ selected: {},
1472
+ selectedHover: {}
1473
+ },
1474
+ // Region options
1475
+ regionsSelectable: false,
1476
+ regionsSelectableOne: false,
1477
+ regionStyle: {
1478
+ initial: {
1479
+ fill: '#dee2e8',
1480
+ fillOpacity: 1,
1481
+ stroke: 'none',
1482
+ strokeWidth: 0
1483
+ },
1484
+ hover: {
1485
+ fillOpacity: .7,
1486
+ cursor: 'pointer'
1487
+ },
1488
+ selected: {
1489
+ fill: '#9ca3af'
1490
+ },
1491
+ selectedHover: {}
1492
+ },
1493
+ regionLabelStyle: {
1494
+ initial: {
1495
+ fontFamily: 'Verdana',
1496
+ fontSize: '12',
1497
+ fontWeight: 'bold',
1498
+ cursor: 'default',
1499
+ fill: '#35373e'
1500
+ },
1501
+ hover: {
1502
+ cursor: 'pointer'
1503
+ }
1504
+ }
1505
+ };
1506
+
1507
+ /**
1508
+ * ------------------------------------------------------------------------
1509
+ * Class Definition
1510
+ * ------------------------------------------------------------------------
1511
+ */
1512
+ var SVGElement = /*#__PURE__*/function () {
1513
+ function SVGElement(name, config) {
1514
+ this.node = this._createElement(name);
1515
+ if (config) {
1516
+ this.set(config);
1517
+ }
1518
+ }
1519
+
1520
+ // Create new SVG element `svg`, `g`, `path`, `line`, `circle`, `image`, etc.
1521
+ // https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS#important_namespace_uris
1522
+ var _proto = SVGElement.prototype;
1523
+ _proto._createElement = function _createElement(tagName) {
1524
+ return document.createElementNS('http://www.w3.org/2000/svg', tagName);
1525
+ };
1526
+ _proto.addClass = function addClass(className) {
1527
+ this.node.setAttribute('class', className);
1528
+ };
1529
+ _proto.getBBox = function getBBox() {
1530
+ return this.node.getBBox();
1531
+ }
1532
+
1533
+ // Apply attributes on the current node element
1534
+ ;
1535
+ _proto.set = function set(property, value) {
1536
+ if (typeof property === 'object') {
1537
+ for (var attr in property) {
1538
+ this.applyAttr(attr, property[attr]);
1539
+ }
1540
+ } else {
1541
+ this.applyAttr(property, value);
1542
+ }
1543
+ };
1544
+ _proto.get = function get(property) {
1545
+ return this.style.initial[property];
1546
+ };
1547
+ _proto.applyAttr = function applyAttr(property, value) {
1548
+ this.node.setAttribute(hyphenate(property), value);
1549
+ };
1550
+ _proto.remove = function remove() {
1551
+ removeElement(this.node);
1552
+ };
1553
+ return SVGElement;
1554
+ }();
1555
+
1556
+ /**
1557
+ * ------------------------------------------------------------------------
1558
+ * Class Definition
1559
+ * ------------------------------------------------------------------------
1560
+ */
1561
+ var SVGShapeElement = /*#__PURE__*/function (_SVGElement) {
1562
+ function SVGShapeElement(name, config, style) {
1563
+ var _this;
1564
+ if (style === void 0) {
1565
+ style = {};
1566
+ }
1567
+ _this = _SVGElement.call(this, name, config) || this;
1568
+ _this.isHovered = false;
1569
+ _this.isSelected = false;
1570
+ _this.style = style;
1571
+ _this.style.current = {};
1572
+ _this.updateStyle();
1573
+ return _this;
1574
+ }
1575
+ _inheritsLoose(SVGShapeElement, _SVGElement);
1576
+ var _proto = SVGShapeElement.prototype;
1577
+ _proto.setStyle = function setStyle(property, value) {
1578
+ if (typeof property === 'object') {
1579
+ merge(this.style.current, property);
1580
+ } else {
1581
+ var _merge;
1582
+ merge(this.style.current, (_merge = {}, _merge[property] = value, _merge));
1583
+ }
1584
+ this.updateStyle();
1585
+ };
1586
+ _proto.updateStyle = function updateStyle() {
1587
+ var attrs = {};
1588
+ merge(attrs, this.style.initial);
1589
+ merge(attrs, this.style.current);
1590
+ if (this.isHovered) {
1591
+ merge(attrs, this.style.hover);
1592
+ }
1593
+ if (this.isSelected) {
1594
+ merge(attrs, this.style.selected);
1595
+ if (this.isHovered) {
1596
+ merge(attrs, this.style.selectedHover);
1597
+ }
1598
+ }
1599
+ this.set(attrs);
1600
+ };
1601
+ return SVGShapeElement;
1602
+ }(SVGElement);
1603
+
1604
+ /**
1605
+ * ------------------------------------------------------------------------
1606
+ * Class Definition
1607
+ * ------------------------------------------------------------------------
1608
+ */
1609
+ var SVGTextElement = /*#__PURE__*/function (_SVGShapeElement) {
1610
+ function SVGTextElement(config, style) {
1611
+ return _SVGShapeElement.call(this, 'text', config, style) || this;
1612
+ }
1613
+ _inheritsLoose(SVGTextElement, _SVGShapeElement);
1614
+ var _proto = SVGTextElement.prototype;
1615
+ _proto.applyAttr = function applyAttr(attr, value) {
1616
+ attr === 'text' ? this.node.textContent = value : _SVGShapeElement.prototype.applyAttr.call(this, attr, value);
1617
+ };
1618
+ return SVGTextElement;
1619
+ }(SVGShapeElement);
1620
+
1621
+ /**
1622
+ * ------------------------------------------------------------------------
1623
+ * Class Definition
1624
+ * ------------------------------------------------------------------------
1625
+ */
1626
+ var SVGImageElement = /*#__PURE__*/function (_SVGShapeElement) {
1627
+ function SVGImageElement(config, style) {
1628
+ return _SVGShapeElement.call(this, 'image', config, style) || this;
1629
+ }
1630
+ _inheritsLoose(SVGImageElement, _SVGShapeElement);
1631
+ var _proto = SVGImageElement.prototype;
1632
+ _proto.applyAttr = function applyAttr(attr, value) {
1633
+ var imageUrl;
1634
+ if (attr === 'image') {
1635
+ // This get executed when we have url in series.markers[0].scale.someScale.url
1636
+ if (typeof value === 'object') {
1637
+ imageUrl = value.url;
1638
+ this.offset = value.offset || [0, 0];
1639
+ } else {
1640
+ imageUrl = value;
1641
+ this.offset = [0, 0];
1642
+ }
1643
+ this.node.setAttributeNS('http://www.w3.org/1999/xlink', 'href', imageUrl);
1644
+
1645
+ // Set width and height then call this `applyAttr` again
1646
+ this.width = 23;
1647
+ this.height = 23;
1648
+ this.applyAttr('width', this.width);
1649
+ this.applyAttr('height', this.height);
1650
+ this.applyAttr('x', this.cx - this.width / 2 + this.offset[0]);
1651
+ this.applyAttr('y', this.cy - this.height / 2 + this.offset[1]);
1652
+ } else if (attr == 'cx') {
1653
+ this.cx = value;
1654
+ if (this.width) {
1655
+ this.applyAttr('x', value - this.width / 2 + this.offset[0]);
1656
+ }
1657
+ } else if (attr == 'cy') {
1658
+ this.cy = value;
1659
+ if (this.height) {
1660
+ this.applyAttr('y', value - this.height / 2 + this.offset[1]);
1661
+ }
1662
+ } else {
1663
+ // This time Call SVGElement
1664
+ _SVGShapeElement.prototype.applyAttr.apply(this, arguments);
1665
+ }
1666
+ };
1667
+ return SVGImageElement;
1668
+ }(SVGShapeElement);
1669
+
1670
+ /**
1671
+ * ------------------------------------------------------------------------
1672
+ * Class Definition
1673
+ * ------------------------------------------------------------------------
1674
+ */
1675
+ var SVGCanvasElement = /*#__PURE__*/function (_SVGElement) {
1676
+ function SVGCanvasElement(container) {
1677
+ var _this;
1678
+ _this = _SVGElement.call(this, 'svg') || this; // Create svg element for holding the whole map
1679
+
1680
+ _this._container = container;
1681
+
1682
+ // Create the defs element
1683
+ _this._defsElement = new SVGElement('defs');
1684
+
1685
+ // Create group element which will hold the paths (regions)
1686
+ _this._rootElement = new SVGElement('g', {
1687
+ id: 'jvm-regions-group'
1688
+ });
1689
+
1690
+ // Append the defs element to the this.node (SVG tag)
1691
+ _this.node.appendChild(_this._defsElement.node);
1692
+
1693
+ // Append the group to this.node (SVG tag)
1694
+ _this.node.appendChild(_this._rootElement.node);
1695
+
1696
+ // Append this.node (SVG tag) to the container
1697
+ _this._container.appendChild(_this.node);
1698
+ return _this;
1699
+ }
1700
+ _inheritsLoose(SVGCanvasElement, _SVGElement);
1701
+ var _proto = SVGCanvasElement.prototype;
1702
+ _proto.setSize = function setSize(width, height) {
1703
+ this.node.setAttribute('width', width);
1704
+ this.node.setAttribute('height', height);
1705
+ };
1706
+ _proto.applyTransformParams = function applyTransformParams(scale, transX, transY) {
1707
+ this._rootElement.node.setAttribute('transform', "scale(" + scale + ") translate(" + transX + ", " + transY + ")");
1708
+ }
1709
+
1710
+ // Create `path` element
1711
+ ;
1712
+ _proto.createPath = function createPath(config, style) {
1713
+ var path = new SVGShapeElement('path', config, style);
1714
+ path.node.setAttribute('fill-rule', 'evenodd');
1715
+ return this._add(path);
1716
+ }
1717
+
1718
+ // Create `circle` element
1719
+ ;
1720
+ _proto.createCircle = function createCircle(config, style, group) {
1721
+ var circle = new SVGShapeElement('circle', config, style);
1722
+ return this._add(circle, group);
1723
+ }
1724
+
1725
+ // Create `line` element
1726
+ ;
1727
+ _proto.createLine = function createLine(config, style, group) {
1728
+ var line = new SVGShapeElement('line', config, style);
1729
+ return this._add(line, group);
1730
+ }
1731
+
1732
+ // Create `text` element
1733
+ ;
1734
+ _proto.createText = function createText(config, style, group) {
1735
+ var text = new SVGTextElement(config, style);
1736
+ return this._add(text, group);
1737
+ }
1738
+
1739
+ // Create `image` element
1740
+ ;
1741
+ _proto.createImage = function createImage(config, style, group) {
1742
+ var image = new SVGImageElement(config, style);
1743
+ return this._add(image, group);
1744
+ }
1745
+
1746
+ // Create `g` element
1747
+ ;
1748
+ _proto.createGroup = function createGroup(id) {
1749
+ var group = new SVGElement('g');
1750
+ this.node.appendChild(group.node);
1751
+ if (id) {
1752
+ group.node.id = id;
1753
+ }
1754
+ group.canvas = this;
1755
+ return group;
1756
+ }
1757
+
1758
+ // Add some element to a spcific group or the root element if the group isn't given
1759
+ ;
1760
+ _proto._add = function _add(element, group) {
1761
+ group = group || this._rootElement;
1762
+ group.node.appendChild(element.node);
1763
+ return element;
1764
+ };
1765
+ return SVGCanvasElement;
1766
+ }(SVGElement);
1767
+
1768
+ /**
1769
+ * ------------------------------------------------------------------------
1770
+ * Class Definition
1771
+ * ------------------------------------------------------------------------
1772
+ */
1773
+ var Tooltip = /*#__PURE__*/function (_BaseComponent) {
1774
+ function Tooltip(map) {
1775
+ var _this;
1776
+ _this = _BaseComponent.call(this) || this;
1777
+ var tooltip = createElement('div', 'jvm-tooltip');
1778
+ _this._map = map;
1779
+ _this._tooltip = document.body.appendChild(tooltip);
1780
+ _this._bindEventListeners();
1781
+ return _this || _assertThisInitialized(_this);
1782
+ }
1783
+ _inheritsLoose(Tooltip, _BaseComponent);
1784
+ var _proto = Tooltip.prototype;
1785
+ _proto._bindEventListeners = function _bindEventListeners() {
1786
+ var _this2 = this;
1787
+ EventHandler.on(this._map.container, 'mousemove', function (event) {
1788
+ if (!_this2._tooltip.classList.contains('active')) {
1789
+ return;
1790
+ }
1791
+ var container = findElement(_this2._map.container, '#jvm-regions-group').getBoundingClientRect();
1792
+ var space = 5; // Space between the cursor and tooltip element
1793
+
1794
+ // Tooltip
1795
+ var _this2$_tooltip$getBo = _this2._tooltip.getBoundingClientRect(),
1796
+ height = _this2$_tooltip$getBo.height,
1797
+ width = _this2$_tooltip$getBo.width;
1798
+ var topIsPassed = event.clientY <= container.top + height + space;
1799
+ var top = event.pageY - height - space;
1800
+ var left = event.pageX - width - space;
1801
+
1802
+ // Ensure the tooltip will never cross outside the canvas area(map)
1803
+ if (topIsPassed) {
1804
+ // Top:
1805
+ top += height + space;
1806
+
1807
+ // The cursor is a bit larger from left side
1808
+ left -= space * 2;
1809
+ }
1810
+ if (event.clientX < container.left + width + space) {
1811
+ // Left:
1812
+ left = event.pageX + space + 2;
1813
+ if (topIsPassed) {
1814
+ left += space * 2;
1815
+ }
1816
+ }
1817
+ _this2.css({
1818
+ top: top + "px",
1819
+ left: left + "px"
1820
+ });
1821
+ });
1822
+ };
1823
+ _proto.getElement = function getElement() {
1824
+ return this._tooltip;
1825
+ };
1826
+ _proto.show = function show() {
1827
+ this._tooltip.classList.add('active');
1828
+ };
1829
+ _proto.hide = function hide() {
1830
+ this._tooltip.classList.remove('active');
1831
+ };
1832
+ _proto.text = function text(string, html) {
1833
+ if (html === void 0) {
1834
+ html = false;
1835
+ }
1836
+ var property = html ? 'innerHTML' : 'textContent';
1837
+ if (!string) {
1838
+ return this._tooltip[property];
1839
+ }
1840
+ this._tooltip[property] = string;
1841
+ };
1842
+ _proto.css = function css(_css) {
1843
+ for (var style in _css) {
1844
+ this._tooltip.style[style] = _css[style];
1845
+ }
1846
+ return this;
1847
+ };
1848
+ return Tooltip;
1849
+ }(BaseComponent);
1850
+
1851
+ var DataVisualization = /*#__PURE__*/function () {
1852
+ function DataVisualization(_ref, map) {
1853
+ var scale = _ref.scale,
1854
+ values = _ref.values;
1855
+ this._scale = scale;
1856
+ this._values = values;
1857
+ this._fromColor = this.hexToRgb(scale[0]);
1858
+ this._toColor = this.hexToRgb(scale[1]);
1859
+ this._map = map;
1860
+ this.setMinMaxValues(values);
1861
+ this.visualize();
1862
+ }
1863
+ var _proto = DataVisualization.prototype;
1864
+ _proto.setMinMaxValues = function setMinMaxValues(values) {
1865
+ this.min = Number.MAX_VALUE;
1866
+ this.max = 0;
1867
+ for (var value in values) {
1868
+ value = parseFloat(values[value]);
1869
+ if (value > this.max) {
1870
+ this.max = value;
1871
+ }
1872
+ if (value < this.min) {
1873
+ this.min = value;
1874
+ }
1875
+ }
1876
+ };
1877
+ _proto.visualize = function visualize() {
1878
+ var attrs = {},
1879
+ value;
1880
+ for (var regionCode in this._values) {
1881
+ value = parseFloat(this._values[regionCode]);
1882
+ if (!isNaN(value)) {
1883
+ attrs[regionCode] = this.getValue(value);
1884
+ }
1885
+ }
1886
+ this.setAttributes(attrs);
1887
+ };
1888
+ _proto.setAttributes = function setAttributes(attrs) {
1889
+ for (var code in attrs) {
1890
+ if (this._map.regions[code]) {
1891
+ this._map.regions[code].element.setStyle('fill', attrs[code]);
1892
+ }
1893
+ }
1894
+ };
1895
+ _proto.getValue = function getValue(value) {
1896
+ if (this.min === this.max) {
1897
+ return "#" + this._toColor.join('');
1898
+ }
1899
+ var hex,
1900
+ color = '#';
1901
+ for (var i = 0; i < 3; i++) {
1902
+ hex = Math.round(this._fromColor[i] + (this._toColor[i] - this._fromColor[i]) * ((value - this.min) / (this.max - this.min))).toString(16);
1903
+ color += (hex.length === 1 ? '0' : '') + hex;
1904
+ }
1905
+ return color;
1906
+ };
1907
+ _proto.hexToRgb = function hexToRgb(h) {
1908
+ var r = 0,
1909
+ g = 0,
1910
+ b = 0;
1911
+ if (h.length == 4) {
1912
+ r = '0x' + h[1] + h[1];
1913
+ g = '0x' + h[2] + h[2];
1914
+ b = '0x' + h[3] + h[3];
1915
+ } else if (h.length == 7) {
1916
+ r = '0x' + h[1] + h[2];
1917
+ g = '0x' + h[3] + h[4];
1918
+ b = '0x' + h[5] + h[6];
1919
+ }
1920
+ return [parseInt(r), parseInt(g), parseInt(b)];
1921
+ };
1922
+ return DataVisualization;
1923
+ }();
1924
+
1925
+ /**
1926
+ * ------------------------------------------------------------------------
1927
+ * Class Definition
1928
+ * ------------------------------------------------------------------------
1929
+ */
1930
+ var Map = /*#__PURE__*/function () {
1931
+ function Map(options) {
1932
+ var _this = this;
1933
+ if (options === void 0) {
1934
+ options = {};
1935
+ }
1936
+ // Merge the given options with the default options
1937
+ this.params = merge(Map.defaults, options, true);
1938
+
1939
+ // Throw an error if the given map name doesn't match
1940
+ // the map that was set in map file
1941
+ if (!Map.maps[this.params.map]) {
1942
+ throw new Error("Attempt to use map which was not loaded: " + options.map);
1943
+ }
1944
+ this.regions = {};
1945
+ this.scale = 1;
1946
+ this.transX = 0;
1947
+ this.transY = 0;
1948
+ this._mapData = Map.maps[this.params.map];
1949
+ this._markers = {};
1950
+ this._lines = {};
1951
+ this._defaultWidth = this._mapData.width;
1952
+ this._defaultHeight = this._mapData.height;
1953
+ this._height = 0;
1954
+ this._width = 0;
1955
+ this._baseScale = 1;
1956
+ this._baseTransX = 0;
1957
+ this._baseTransY = 0;
1958
+
1959
+ // `document` is already ready, just initialise now
1960
+ if (document.readyState !== 'loading') {
1961
+ this._init();
1962
+ } else {
1963
+ // Wait until `document` is ready
1964
+ window.addEventListener('DOMContentLoaded', function () {
1965
+ return _this._init();
1966
+ });
1967
+ }
1968
+ }
1969
+ var _proto = Map.prototype;
1970
+ _proto._init = function _init() {
1971
+ var options = this.params;
1972
+ this.container = getElement(options.selector);
1973
+ this.container.classList.add('jvm-container');
1974
+
1975
+ // The map canvas element
1976
+ this.canvas = new SVGCanvasElement(this.container);
1977
+
1978
+ // Set the map's background color
1979
+ this.setBackgroundColor(options.backgroundColor);
1980
+
1981
+ // Create regions
1982
+ this._createRegions();
1983
+
1984
+ // Update size
1985
+ this.updateSize();
1986
+
1987
+ // Create lines
1988
+ this._createLines(options.lines || {}, options.markers || {});
1989
+
1990
+ // Create markers
1991
+ this._createMarkers(options.markers);
1992
+
1993
+ // Position labels
1994
+ this._repositionLabels();
1995
+
1996
+ // Setup the container events
1997
+ this._setupContainerEvents();
1998
+
1999
+ // Setup regions/markers events
2000
+ this._setupElementEvents();
2001
+
2002
+ // Create zoom buttons if `zoomButtons` is presented
2003
+ if (options.zoomButtons) {
2004
+ this._setupZoomButtons();
2005
+ }
2006
+
2007
+ // Create toolip
2008
+ if (options.showTooltip) {
2009
+ this._tooltip = new Tooltip(this);
2010
+ }
2011
+
2012
+ // Set selected regions if any
2013
+ if (options.selectedRegions) {
2014
+ this._setSelected('regions', options.selectedRegions);
2015
+ }
2016
+
2017
+ // Set selected regions if any
2018
+ if (options.selectedMarkers) {
2019
+ this._setSelected('_markers', options.selectedMarkers);
2020
+ }
2021
+
2022
+ // Set focus on a spcific region
2023
+ if (options.focusOn) {
2024
+ this.setFocus(options.focusOn);
2025
+ }
2026
+
2027
+ // Data visualization
2028
+ if (options.visualizeData) {
2029
+ this.dataVisualization = new DataVisualization(options.visualizeData, this);
2030
+ }
2031
+
2032
+ // Bind touch events if true
2033
+ if (options.bindTouchEvents) {
2034
+ if ('ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch) {
2035
+ this._setupContainerTouchEvents();
2036
+ }
2037
+ }
2038
+
2039
+ // Create series if any
2040
+ if (options.series) {
2041
+ this.container.appendChild(this.legendHorizontal = createElement('div', 'jvm-series-container jvm-series-h'));
2042
+ this.container.appendChild(this.legendVertical = createElement('div', 'jvm-series-container jvm-series-v'));
2043
+ this._createSeries();
2044
+ }
2045
+
2046
+ // Fire loaded event
2047
+ this._emit(Events.onLoaded, [this]);
2048
+ }
2049
+
2050
+ // Public
2051
+ ;
2052
+ _proto.setBackgroundColor = function setBackgroundColor(color) {
2053
+ this.container.style.backgroundColor = color;
2054
+ }
2055
+
2056
+ // Region methods
2057
+ ;
2058
+ _proto.getSelectedRegions = function getSelectedRegions() {
2059
+ return this._getSelected('regions');
2060
+ };
2061
+ _proto.clearSelectedRegions = function clearSelectedRegions(regions) {
2062
+ var _this2 = this;
2063
+ if (regions === void 0) {
2064
+ regions = undefined;
2065
+ }
2066
+ regions = this._normalizeRegions(regions) || this._getSelected('regions');
2067
+ regions.forEach(function (key) {
2068
+ _this2.regions[key].element.select(false);
2069
+ });
2070
+ };
2071
+ _proto.setSelectedRegions = function setSelectedRegions(regions) {
2072
+ this.clearSelectedRegions();
2073
+ this._setSelected('regions', this._normalizeRegions(regions));
2074
+ }
2075
+
2076
+ // Markers methods
2077
+ ;
2078
+ _proto.getSelectedMarkers = function getSelectedMarkers() {
2079
+ return this._getSelected('_markers');
2080
+ };
2081
+ _proto.clearSelectedMarkers = function clearSelectedMarkers() {
2082
+ this._clearSelected('_markers');
2083
+ };
2084
+ _proto.addMarkers = function addMarkers(config) {
2085
+ config = Array.isArray(config) ? config : [config];
2086
+ this._createMarkers(config, true);
2087
+ };
2088
+ _proto.removeMarkers = function removeMarkers(markers) {
2089
+ var _this3 = this;
2090
+ if (!markers) {
2091
+ markers = Object.keys(this._markers);
2092
+ }
2093
+ markers.forEach(function (index) {
2094
+ // Remove the element from the DOM
2095
+ _this3._markers[index].element.remove();
2096
+ // Remove the element from markers object
2097
+ delete _this3._markers[index];
2098
+ });
2099
+ };
2100
+ _proto.addLine = function addLine(from, to, style) {
2101
+ if (style === void 0) {
2102
+ style = {};
2103
+ }
2104
+ console.warn('`addLine` method is deprecated, please use `addLines` instead.');
2105
+ this._createLines([{
2106
+ from: from,
2107
+ to: to,
2108
+ style: style
2109
+ }], this._markers, true);
2110
+ };
2111
+ _proto.addLines = function addLines(config) {
2112
+ var uids = this._getLinesAsUids();
2113
+ if (!Array.isArray(config)) {
2114
+ config = [config];
2115
+ }
2116
+ this._createLines(config.filter(function (line) {
2117
+ return !(uids.indexOf(getLineUid(line.from, line.to)) > -1);
2118
+ }), this._markers, true);
2119
+ };
2120
+ _proto.removeLines = function removeLines(lines) {
2121
+ var _this4 = this;
2122
+ if (Array.isArray(lines)) {
2123
+ lines = lines.map(function (line) {
2124
+ return getLineUid(line.from, line.to);
2125
+ });
2126
+ } else {
2127
+ lines = this._getLinesAsUids();
2128
+ }
2129
+ lines.forEach(function (uid) {
2130
+ _this4._lines[uid].dispose();
2131
+ delete _this4._lines[uid];
2132
+ });
2133
+ };
2134
+ _proto.removeLine = function removeLine(from, to) {
2135
+ console.warn('`removeLine` method is deprecated, please use `removeLines` instead.');
2136
+ var uid = getLineUid(from, to);
2137
+ if (this._lines.hasOwnProperty(uid)) {
2138
+ this._lines[uid].element.remove();
2139
+ delete this._lines[uid];
2140
+ }
2141
+ }
2142
+
2143
+ // Reset map
2144
+ ;
2145
+ _proto.reset = function reset() {
2146
+ for (var key in this.series) {
2147
+ for (var i = 0; i < this.series[key].length; i++) {
2148
+ this.series[key][i].clear();
2149
+ }
2150
+ }
2151
+ if (this.legendHorizontal) {
2152
+ removeElement(this.legendHorizontal);
2153
+ this.legendHorizontal = null;
2154
+ }
2155
+ if (this.legendVertical) {
2156
+ removeElement(this.legendVertical);
2157
+ this.legendVertical = null;
2158
+ }
2159
+ this.scale = this._baseScale;
2160
+ this.transX = this._baseTransX;
2161
+ this.transY = this._baseTransY;
2162
+ this._applyTransform();
2163
+ this.clearSelectedMarkers();
2164
+ this.clearSelectedRegions();
2165
+ this.removeMarkers();
2166
+ }
2167
+
2168
+ // Destroy the map
2169
+ ;
2170
+ _proto.destroy = function destroy(destroyInstance) {
2171
+ var _this5 = this;
2172
+ if (destroyInstance === void 0) {
2173
+ destroyInstance = true;
2174
+ }
2175
+ // Remove event registry
2176
+ EventHandler.flush();
2177
+
2178
+ // Remove tooltip from DOM and memory
2179
+ this._tooltip.dispose();
2180
+
2181
+ // Fire destroyed event
2182
+ this._emit(Events.onDestroyed);
2183
+
2184
+ // Remove references
2185
+ if (destroyInstance) {
2186
+ Object.keys(this).forEach(function (key) {
2187
+ try {
2188
+ delete _this5[key];
2189
+ } catch (e) {}
2190
+ });
2191
+ }
2192
+ };
2193
+ _proto.extend = function extend(name, callback) {
2194
+ if (typeof this[name] === 'function') {
2195
+ throw new Error("The method [" + name + "] does already exist, please use another name.");
2196
+ }
2197
+ Map.prototype[name] = callback;
2198
+ }
2199
+
2200
+ // Private
2201
+ ;
2202
+ _proto._emit = function _emit(eventName, args) {
2203
+ for (var event in Events) {
2204
+ if (Events[event] === eventName && typeof this.params[event] === 'function') {
2205
+ this.params[event].apply(this, args);
2206
+ }
2207
+ }
2208
+ }
2209
+
2210
+ // Get selected markers/regions
2211
+ ;
2212
+ _proto._getSelected = function _getSelected(type) {
2213
+ var selected = [];
2214
+ for (var key in this[type]) {
2215
+ if (this[type][key].element.isSelected) {
2216
+ selected.push(key);
2217
+ }
2218
+ }
2219
+ return selected;
2220
+ };
2221
+ _proto._setSelected = function _setSelected(type, keys) {
2222
+ var _this6 = this;
2223
+ keys.forEach(function (key) {
2224
+ if (_this6[type][key]) {
2225
+ _this6[type][key].element.select(true);
2226
+ }
2227
+ });
2228
+ };
2229
+ _proto._clearSelected = function _clearSelected(type) {
2230
+ var _this7 = this;
2231
+ this._getSelected(type).forEach(function (key) {
2232
+ _this7[type][key].element.select(false);
2233
+ });
2234
+ };
2235
+ _proto._getLinesAsUids = function _getLinesAsUids() {
2236
+ return Object.keys(this._lines);
2237
+ };
2238
+ _proto._normalizeRegions = function _normalizeRegions(regions) {
2239
+ return typeof regions === 'string' ? [regions] : regions;
2240
+ };
2241
+ return Map;
2242
+ }();
2243
+ Map.maps = {};
2244
+ Map.defaults = Defaults;
2245
+ Object.assign(Map.prototype, core);
2246
+
2247
+ /**
2248
+ * jsVectorMap
2249
+ * Copyrights (c) Mustafa Omar https://github.com/themustafaomar
2250
+ * Released under the MIT License.
2251
+ */
2252
+
2253
+ /**
2254
+ * ------------------------------------------------------------------------
2255
+ * Class Definition
2256
+ * ------------------------------------------------------------------------
2257
+ */
2258
+ var jsVectorMap = /*#__PURE__*/function () {
2259
+ function jsVectorMap(options) {
2260
+ if (options === void 0) {
2261
+ options = {};
2262
+ }
2263
+ if (!options.selector) {
2264
+ throw new Error('Selector is not given.');
2265
+ }
2266
+ return new Map(options);
2267
+ }
2268
+
2269
+ // Public
2270
+ jsVectorMap.addMap = function addMap(name, map) {
2271
+ Map.maps[name] = map;
2272
+ };
2273
+ return jsVectorMap;
2274
+ }();
2275
+ var index = window.jsVectorMap = jsVectorMap;
2276
+
2277
+ export { index as default };