@tabler/core 1.0.0-beta10 → 1.0.0-beta12

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