@visactor/vstory 0.0.4-alpha.2 → 0.0.5-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (734) hide show
  1. package/README.md +13 -0
  2. package/cjs/animate/typewirter.d.ts +3 -4
  3. package/cjs/animate/typewirter.js +44 -30
  4. package/cjs/animate/typewirter.js.map +1 -1
  5. package/cjs/constants/action.d.ts +9 -0
  6. package/cjs/constants/action.js +10 -2
  7. package/cjs/constants/action.js.map +1 -1
  8. package/cjs/constants/character.d.ts +2 -2
  9. package/cjs/constants/character.js +2 -3
  10. package/cjs/constants/character.js.map +1 -1
  11. package/cjs/constants/config.js +2 -1
  12. package/cjs/dsl/constant/index.d.ts +13 -0
  13. package/cjs/dsl/constant/index.js +6 -1
  14. package/cjs/dsl/constant/index.js.map +1 -1
  15. package/cjs/dsl/story-chart/area.d.ts +2 -0
  16. package/cjs/dsl/story-chart/area.js +5 -1
  17. package/cjs/dsl/story-chart/area.js.map +1 -1
  18. package/cjs/dsl/story-chart/bar.d.ts +2 -0
  19. package/cjs/dsl/story-chart/bar.js +1 -1
  20. package/cjs/dsl/story-chart/bar.js.map +1 -1
  21. package/cjs/dsl/story-chart/line.d.ts +2 -0
  22. package/cjs/dsl/story-chart/line.js +2 -2
  23. package/cjs/dsl/story-chart/line.js.map +1 -1
  24. package/cjs/dsl/story-chart/pie.d.ts +2 -0
  25. package/cjs/dsl/story-chart/pie.js +4 -1
  26. package/cjs/dsl/story-chart/pie.js.map +1 -1
  27. package/cjs/dsl/story-processor/graphic/appear.js.map +1 -1
  28. package/cjs/dsl/story-processor/graphic/effect/appear.js +2 -7
  29. package/cjs/dsl/story-processor/graphic/effect/appear.js.map +1 -1
  30. package/cjs/dsl/story-processor/graphic/effect/typewriter.js +1 -1
  31. package/cjs/dsl/story-processor/graphic/effect/typewriter.js.map +1 -1
  32. package/cjs/dsl/story-processor/index.js +1 -1
  33. package/cjs/dsl/story-processor/processor.js +1 -1
  34. package/cjs/dsl/types/index.d.ts +1 -0
  35. package/cjs/dsl/types/index.js.map +1 -1
  36. package/cjs/dsl/utils/datum.js +2 -1
  37. package/cjs/dsl/utils/flicker.js +1 -1
  38. package/cjs/edit/const.d.ts +1 -3
  39. package/cjs/edit/const.js +1 -0
  40. package/cjs/edit/const.js.map +1 -1
  41. package/cjs/edit/edit-action.d.ts +9 -0
  42. package/cjs/edit/edit-action.js +61 -5
  43. package/cjs/edit/edit-action.js.map +1 -1
  44. package/cjs/edit/edit-component/base-selection.d.ts +8 -3
  45. package/cjs/edit/edit-component/base-selection.js +30 -4
  46. package/cjs/edit/edit-component/base-selection.js.map +1 -1
  47. package/cjs/edit/edit-component/chart-selection.d.ts +15 -0
  48. package/cjs/edit/edit-component/chart-selection.js +39 -0
  49. package/cjs/edit/edit-component/chart-selection.js.map +1 -0
  50. package/cjs/edit/edit-component/common.d.ts +1 -11
  51. package/cjs/edit/edit-component/common.js +1 -32
  52. package/cjs/edit/edit-component/common.js.map +1 -1
  53. package/cjs/edit/edit-component/edit-control/richtext-control.d.ts +19 -0
  54. package/cjs/edit/edit-component/edit-control/richtext-control.js +34 -0
  55. package/cjs/edit/edit-component/edit-control/richtext-control.js.map +1 -0
  56. package/cjs/edit/edit-component/edit-control/richtext-transform-control.d.ts +2 -3
  57. package/cjs/edit/edit-component/edit-control/richtext-transform-control.js +30 -32
  58. package/cjs/edit/edit-component/edit-control/richtext-transform-control.js.map +1 -1
  59. package/cjs/edit/edit-component/edit-control/transform-control.d.ts +4 -2
  60. package/cjs/edit/edit-component/edit-control/transform-control.js +10 -6
  61. package/cjs/edit/edit-component/edit-control/transform-control.js.map +1 -1
  62. package/cjs/edit/edit-component/edit-control/transform-drag.d.ts +1 -0
  63. package/cjs/edit/edit-component/edit-control/transform-drag.js +4 -2
  64. package/cjs/edit/edit-component/edit-control/transform-drag.js.map +1 -1
  65. package/cjs/edit/edit-component/image-selection.d.ts +1 -2
  66. package/cjs/edit/edit-component/image-selection.js +2 -5
  67. package/cjs/edit/edit-component/image-selection.js.map +1 -1
  68. package/cjs/edit/edit-component/index.js +4 -5
  69. package/cjs/edit/edit-component/index.js.map +1 -1
  70. package/cjs/edit/edit-component/layer-edit.js +0 -2
  71. package/cjs/edit/edit-component/mixin/richtext.d.ts +21 -0
  72. package/cjs/edit/edit-component/mixin/richtext.js +26 -0
  73. package/cjs/edit/edit-component/mixin/richtext.js.map +1 -0
  74. package/cjs/edit/edit-component/rect-selection.d.ts +8 -12
  75. package/cjs/edit/edit-component/rect-selection.js +13 -18
  76. package/cjs/edit/edit-component/rect-selection.js.map +1 -1
  77. package/cjs/edit/edit-component/richtext-selection-common.d.ts +19 -0
  78. package/cjs/edit/edit-component/richtext-selection-common.js +35 -0
  79. package/cjs/edit/edit-component/richtext-selection-common.js.map +1 -0
  80. package/cjs/edit/edit-component/richtext-selection.d.ts +0 -2
  81. package/cjs/edit/edit-component/richtext-selection.js +1 -7
  82. package/cjs/edit/edit-component/richtext-selection.js.map +1 -1
  83. package/cjs/edit/edit-component/shape-selection.d.ts +11 -0
  84. package/cjs/edit/edit-component/shape-selection.js +36 -0
  85. package/cjs/edit/edit-component/shape-selection.js.map +1 -0
  86. package/cjs/edit/edit-component/text-selection.d.ts +0 -3
  87. package/cjs/edit/edit-component/text-selection.js +3 -11
  88. package/cjs/edit/edit-component/text-selection.js.map +1 -1
  89. package/cjs/edit/edit.d.ts +5 -2
  90. package/cjs/edit/edit.js +20 -5
  91. package/cjs/edit/edit.js.map +1 -1
  92. package/cjs/edit/interface.d.ts +6 -1
  93. package/cjs/edit/interface.js +3 -1
  94. package/cjs/edit/interface.js.map +1 -1
  95. package/cjs/index.d.ts +3 -1
  96. package/cjs/index.js +2 -1
  97. package/cjs/index.js.map +1 -1
  98. package/cjs/interface/type.js +1 -2
  99. package/cjs/player/interface/player.d.ts +5 -2
  100. package/cjs/player/interface/player.js.map +1 -1
  101. package/cjs/player/interface/scheduler.d.ts +1 -1
  102. package/cjs/player/interface/scheduler.js.map +1 -1
  103. package/cjs/player/player.d.ts +7 -2
  104. package/cjs/player/player.js +31 -21
  105. package/cjs/player/player.js.map +1 -1
  106. package/cjs/player/processor/chart/common/chartAppear.d.ts +5 -0
  107. package/cjs/player/processor/chart/common/chartAppear.js +11 -0
  108. package/cjs/player/processor/chart/common/chartAppear.js.map +1 -0
  109. package/cjs/player/processor/chart/common/commonAppear.d.ts +8 -0
  110. package/cjs/player/processor/chart/common/commonAppear.js +46 -0
  111. package/cjs/player/processor/chart/common/commonAppear.js.map +1 -0
  112. package/cjs/player/processor/chart/component/axisAppear.d.ts +2 -2
  113. package/cjs/player/processor/chart/component/axisAppear.js +2 -2
  114. package/cjs/player/processor/chart/component/axisAppear.js.map +1 -1
  115. package/cjs/player/processor/chart/component/commonAppear.d.ts +3 -3
  116. package/cjs/player/processor/chart/component/commonAppear.js +5 -17
  117. package/cjs/player/processor/chart/component/commonAppear.js.map +1 -1
  118. package/cjs/player/processor/chart/component/labelAppear.d.ts +2 -2
  119. package/cjs/player/processor/chart/component/labelAppear.js +1 -1
  120. package/cjs/player/processor/chart/component/labelAppear.js.map +1 -1
  121. package/cjs/player/processor/chart/component/legendsAppear.d.ts +4 -3
  122. package/cjs/player/processor/chart/component/legendsAppear.js +2 -3
  123. package/cjs/player/processor/chart/component/legendsAppear.js.map +1 -1
  124. package/cjs/player/processor/chart/component/titleAppear.d.ts +4 -3
  125. package/cjs/player/processor/chart/component/titleAppear.js +2 -3
  126. package/cjs/player/processor/chart/component/titleAppear.js.map +1 -1
  127. package/cjs/player/processor/chart/rankingBar/rankingBar.d.ts +29 -0
  128. package/cjs/player/processor/chart/rankingBar/rankingBar.js +54 -0
  129. package/cjs/player/processor/chart/rankingBar/rankingBar.js.map +1 -0
  130. package/cjs/player/processor/chart/seriesmark/commonTransformMarkAppear.d.ts +3 -3
  131. package/cjs/player/processor/chart/seriesmark/commonTransformMarkAppear.js.map +1 -1
  132. package/cjs/player/processor/chart/seriesmark/{transformArcAppear.d.ts → transformArcVisibility.d.ts} +2 -2
  133. package/cjs/player/processor/chart/seriesmark/{transformArcAppear.js → transformArcVisibility.js} +5 -6
  134. package/cjs/player/processor/chart/seriesmark/transformArcVisibility.js.map +1 -0
  135. package/cjs/player/processor/chart/seriesmark/{transformRectAppear.d.ts → transformLineVisibility.d.ts} +2 -2
  136. package/cjs/player/processor/chart/seriesmark/transformLineVisibility.js +12 -0
  137. package/cjs/player/processor/chart/seriesmark/transformLineVisibility.js.map +1 -0
  138. package/cjs/player/processor/chart/seriesmark/{transformLineAppear.d.ts → transformRectVisibility.d.ts} +2 -2
  139. package/cjs/player/processor/chart/seriesmark/{transformRectAppear.js → transformRectVisibility.js} +6 -7
  140. package/cjs/player/processor/chart/seriesmark/transformRectVisibility.js.map +1 -0
  141. package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.d.ts +12 -0
  142. package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.js +12 -0
  143. package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.js.map +1 -0
  144. package/cjs/player/processor/chart/seriesmark/transformTextVisibility.d.ts +12 -0
  145. package/cjs/player/processor/chart/seriesmark/transformTextVisibility.js +12 -0
  146. package/cjs/player/processor/chart/seriesmark/transformTextVisibility.js.map +1 -0
  147. package/cjs/player/processor/chart/transformMap.d.ts +24 -18
  148. package/cjs/player/processor/chart/transformMap.js +8 -7
  149. package/cjs/player/processor/chart/transformMap.js.map +1 -1
  150. package/cjs/player/processor/chart/vchart.d.ts +76 -18
  151. package/cjs/player/processor/chart/vchart.js +151 -36
  152. package/cjs/player/processor/chart/vchart.js.map +1 -1
  153. package/cjs/player/processor/common/bounce-processor.d.ts +3 -0
  154. package/cjs/player/processor/common/bounce-processor.js +23 -0
  155. package/cjs/player/processor/common/bounce-processor.js.map +1 -0
  156. package/cjs/player/processor/common/common.d.ts +5 -0
  157. package/cjs/player/processor/common/common.js +20 -0
  158. package/cjs/player/processor/common/common.js.map +1 -0
  159. package/cjs/player/processor/common/fade-processor.d.ts +4 -0
  160. package/cjs/player/processor/common/fade-processor.js +36 -0
  161. package/cjs/player/processor/common/fade-processor.js.map +1 -0
  162. package/cjs/player/processor/common/move-processor.d.ts +8 -0
  163. package/cjs/player/processor/common/move-processor.js +155 -0
  164. package/cjs/player/processor/common/move-processor.js.map +1 -0
  165. package/cjs/player/processor/common/scale-processor.d.ts +8 -0
  166. package/cjs/player/processor/common/scale-processor.js +49 -0
  167. package/cjs/player/processor/common/scale-processor.js.map +1 -0
  168. package/cjs/player/processor/common/wipe-processor.d.ts +4 -0
  169. package/cjs/player/processor/common/wipe-processor.js +40 -0
  170. package/cjs/player/processor/common/wipe-processor.js.map +1 -0
  171. package/cjs/player/processor/common-processor.js +3 -0
  172. package/cjs/player/processor/common-processor.js.map +1 -0
  173. package/cjs/player/processor/component/common-component.d.ts +45 -9
  174. package/cjs/player/processor/component/common-component.js +99 -78
  175. package/cjs/player/processor/component/common-component.js.map +1 -1
  176. package/cjs/player/processor/component/image/image-visibility.d.ts +5 -0
  177. package/cjs/player/processor/component/image/image-visibility.js +16 -0
  178. package/cjs/player/processor/component/image/image-visibility.js.map +1 -0
  179. package/cjs/player/processor/component/line/line-visibility.d.ts +5 -0
  180. package/cjs/player/processor/component/line/line-visibility.js +16 -0
  181. package/cjs/player/processor/component/line/line-visibility.js.map +1 -0
  182. package/cjs/player/processor/component/rect/rect-visibility.d.ts +5 -0
  183. package/cjs/player/processor/component/rect/rect-visibility.js +16 -0
  184. package/cjs/player/processor/component/rect/rect-visibility.js.map +1 -0
  185. package/cjs/player/processor/component/shape/shape-visibility.d.ts +5 -0
  186. package/cjs/player/processor/component/shape/shape-visibility.js +16 -0
  187. package/cjs/player/processor/component/shape/shape-visibility.js.map +1 -0
  188. package/cjs/player/processor/component/text/text-visibility.d.ts +6 -0
  189. package/cjs/player/processor/component/text/text-visibility.js +41 -0
  190. package/cjs/player/processor/component/text/text-visibility.js.map +1 -0
  191. package/cjs/player/processor/component/timeline/timeline-visibility.d.ts +15 -0
  192. package/cjs/player/processor/component/timeline/timeline-visibility.js +79 -0
  193. package/cjs/player/processor/component/timeline/timeline-visibility.js.map +1 -0
  194. package/cjs/player/processor/component/utils.d.ts +3 -1
  195. package/cjs/player/processor/component/utils.js +16 -1
  196. package/cjs/player/processor/component/utils.js.map +1 -1
  197. package/cjs/player/processor/interface/action-processor.d.ts +6 -6
  198. package/cjs/player/processor/interface/action-processor.js.map +1 -1
  199. package/cjs/player/processor/interface/appear-action.d.ts +30 -18
  200. package/cjs/player/processor/interface/appear-action.js.map +1 -1
  201. package/cjs/player/processor/interface/common-action.d.ts +15 -0
  202. package/cjs/player/processor/interface/common-action.js +6 -0
  203. package/cjs/player/processor/interface/common-action.js.map +1 -0
  204. package/cjs/player/processor/interface/style-action.d.ts +33 -0
  205. package/cjs/player/processor/interface/style-action.js +6 -0
  206. package/cjs/player/processor/interface/style-action.js.map +1 -0
  207. package/cjs/player/processor/processor-item.d.ts +5 -5
  208. package/cjs/player/processor/processor-item.js.map +1 -1
  209. package/cjs/player/processor/processor.d.ts +3 -3
  210. package/cjs/player/processor/processor.js +2 -2
  211. package/cjs/player/processor/processor.js.map +1 -1
  212. package/cjs/player/processor/processorMap.d.ts +31 -21
  213. package/cjs/player/processor/processorMap.js +48 -8
  214. package/cjs/player/processor/processorMap.js.map +1 -1
  215. package/cjs/player/scheduler.d.ts +4 -3
  216. package/cjs/player/scheduler.js +16 -10
  217. package/cjs/player/scheduler.js.map +1 -1
  218. package/cjs/scene/scene.js +2 -0
  219. package/cjs/story/canvas/canvas.d.ts +4 -2
  220. package/cjs/story/canvas/canvas.js +20 -14
  221. package/cjs/story/canvas/canvas.js.map +1 -1
  222. package/cjs/story/character/base/base.d.ts +7 -4
  223. package/cjs/story/character/base/base.js +7 -4
  224. package/cjs/story/character/base/base.js.map +1 -1
  225. package/cjs/story/character/chart/character.d.ts +16 -0
  226. package/cjs/story/character/chart/character.js +59 -14
  227. package/cjs/story/character/chart/character.js.map +1 -1
  228. package/cjs/story/character/chart/characters/rankingBar.d.ts +4 -0
  229. package/cjs/story/character/chart/characters/rankingBar.js +15 -0
  230. package/cjs/story/character/chart/characters/rankingBar.js.map +1 -0
  231. package/cjs/story/character/chart/graphic/vchart-graphic-picker.js +6 -8
  232. package/cjs/story/character/chart/graphic/vchart-graphic-picker.js.map +1 -1
  233. package/cjs/story/character/chart/graphic/vchart-graphic-render.js +8 -8
  234. package/cjs/story/character/chart/graphic/vchart-graphic-render.js.map +1 -1
  235. package/cjs/story/character/chart/graphic/vchart-graphic.d.ts +13 -2
  236. package/cjs/story/character/chart/graphic/vchart-graphic.js +82 -14
  237. package/cjs/story/character/chart/graphic/vchart-graphic.js.map +1 -1
  238. package/cjs/story/character/chart/runtime/common-spec.d.ts +2 -4
  239. package/cjs/story/character/chart/runtime/common-spec.js +0 -2
  240. package/cjs/story/character/chart/runtime/common-spec.js.map +1 -1
  241. package/cjs/story/character/chart/runtime/component-spec.d.ts +4 -3
  242. package/cjs/story/character/chart/runtime/component-spec.js +7 -5
  243. package/cjs/story/character/chart/runtime/component-spec.js.map +1 -1
  244. package/cjs/story/character/chart/temp/constant.d.ts +1 -0
  245. package/cjs/story/character/chart/temp/constant.js +2 -1
  246. package/cjs/story/character/chart/temp/constant.js.map +1 -1
  247. package/cjs/story/character/chart/temp/templates/bar.d.ts +20 -0
  248. package/cjs/story/character/chart/temp/templates/bar.js +31 -0
  249. package/cjs/story/character/chart/temp/templates/bar.js.map +1 -0
  250. package/cjs/story/character/chart/temp/templates/base-temp.d.ts +6 -4
  251. package/cjs/story/character/chart/temp/templates/base-temp.js +1 -1
  252. package/cjs/story/character/chart/temp/templates/base-temp.js.map +1 -1
  253. package/cjs/story/character/chart/temp/templates/ranking-bar-temp.d.ts +8 -0
  254. package/cjs/story/character/chart/temp/templates/ranking-bar-temp.js +22 -0
  255. package/cjs/story/character/chart/temp/templates/ranking-bar-temp.js.map +1 -0
  256. package/cjs/story/character/component/character-group/component-group-graphic-render.d.ts +2 -2
  257. package/cjs/story/character/component/character-group/component-group-graphic-render.js +3 -3
  258. package/cjs/story/character/component/character-group/component-group-graphic-render.js.map +1 -1
  259. package/cjs/story/character/component/character-group/component-group-graphic.d.ts +2 -1
  260. package/cjs/story/character/component/character-group/component-group-graphic.js +12 -4
  261. package/cjs/story/character/component/character-group/component-group-graphic.js.map +1 -1
  262. package/cjs/story/character/component/character.d.ts +9 -4
  263. package/cjs/story/character/component/character.js +26 -6
  264. package/cjs/story/character/component/character.js.map +1 -1
  265. package/cjs/story/character/component/characters/character-image.d.ts +3 -0
  266. package/cjs/story/character/component/characters/character-image.js +4 -0
  267. package/cjs/story/character/component/characters/character-image.js.map +1 -1
  268. package/cjs/story/character/component/characters/character-rect.d.ts +3 -0
  269. package/cjs/story/character/component/characters/character-rect.js +4 -0
  270. package/cjs/story/character/component/characters/character-rect.js.map +1 -1
  271. package/cjs/story/character/component/characters/character-richtext.d.ts +1 -6
  272. package/cjs/story/character/component/characters/character-richtext.js +0 -16
  273. package/cjs/story/character/component/characters/character-richtext.js.map +1 -1
  274. package/cjs/story/character/component/characters/character-shape.d.ts +4 -0
  275. package/cjs/story/character/component/characters/character-shape.js +15 -0
  276. package/cjs/story/character/component/characters/character-shape.js.map +1 -1
  277. package/cjs/story/character/component/characters/character-text.js +1 -1
  278. package/cjs/story/character/component/characters/character-text.js.map +1 -1
  279. package/cjs/story/character/component/graphic/graphic-base-text.d.ts +24 -0
  280. package/cjs/story/character/component/graphic/{graphic-text.js → graphic-base-text.js} +45 -24
  281. package/cjs/story/character/component/graphic/graphic-base-text.js.map +1 -0
  282. package/cjs/story/character/component/graphic/graphic.d.ts +1 -1
  283. package/cjs/story/character/component/graphic/graphic.js.map +1 -1
  284. package/cjs/story/character/component/graphic/richtext.d.ts +1 -9
  285. package/cjs/story/character/component/graphic/richtext.js +0 -45
  286. package/cjs/story/character/component/graphic/richtext.js.map +1 -1
  287. package/cjs/story/character/component/graphic/symbol.d.ts +3 -0
  288. package/cjs/story/character/component/graphic/symbol.js +17 -3
  289. package/cjs/story/character/component/graphic/symbol.js.map +1 -1
  290. package/cjs/story/character/component/graphic/text.d.ts +4 -3
  291. package/cjs/story/character/component/graphic/text.js +21 -6
  292. package/cjs/story/character/component/graphic/text.js.map +1 -1
  293. package/cjs/story/character/component/graphic/timeline.d.ts +6 -0
  294. package/cjs/story/character/component/graphic/timeline.js +7 -1
  295. package/cjs/story/character/component/graphic/timeline.js.map +1 -1
  296. package/cjs/story/character/dsl-interface.d.ts +4 -2
  297. package/cjs/story/character/dsl-interface.js.map +1 -1
  298. package/cjs/story/character/runtime-interface.d.ts +10 -4
  299. package/cjs/story/character/runtime-interface.js.map +1 -1
  300. package/cjs/story/character/visactor/character.d.ts +20 -6
  301. package/cjs/story/character/visactor/character.js +17 -1
  302. package/cjs/story/character/visactor/character.js.map +1 -1
  303. package/cjs/story/character/visactor/interface.d.ts +1 -0
  304. package/cjs/story/character/visactor/interface.js.map +1 -1
  305. package/cjs/story/character-tree/character-tree.d.ts +1 -0
  306. package/cjs/story/character-tree/character-tree.js +6 -0
  307. package/cjs/story/character-tree/character-tree.js.map +1 -1
  308. package/cjs/story/index.js +5 -3
  309. package/cjs/story/index.js.map +1 -1
  310. package/cjs/story/interface/dsl-interface.d.ts +7 -9
  311. package/cjs/story/interface/dsl-interface.js.map +1 -1
  312. package/cjs/story/interface/player.d.ts +1 -13
  313. package/cjs/story/interface/player.js +1 -4
  314. package/cjs/story/interface/player.js.map +1 -1
  315. package/cjs/story/interface/runtime-interface.d.ts +5 -3
  316. package/cjs/story/interface/runtime-interface.js.map +1 -1
  317. package/cjs/story/story.d.ts +2 -1
  318. package/cjs/story/story.js +9 -6
  319. package/cjs/story/story.js.map +1 -1
  320. package/cjs/story/utils/layout.d.ts +2 -1
  321. package/cjs/story/utils/layout.js +2 -2
  322. package/cjs/story/utils/layout.js.map +1 -1
  323. package/cjs/story/utils/vchart-pick.d.ts +115 -0
  324. package/cjs/story/utils/vchart-pick.js +109 -0
  325. package/cjs/story/utils/vchart-pick.js.map +1 -0
  326. package/cjs/util/space.js +2 -1
  327. package/dist/index.js +50811 -0
  328. package/dist/index.min.js +20 -0
  329. package/es/animate/typewirter.d.ts +3 -4
  330. package/es/animate/typewirter.js +46 -30
  331. package/es/animate/typewirter.js.map +1 -1
  332. package/es/constants/action.d.ts +9 -0
  333. package/es/constants/action.js +11 -1
  334. package/es/constants/action.js.map +1 -1
  335. package/es/constants/character.d.ts +2 -2
  336. package/es/constants/character.js +2 -3
  337. package/es/constants/character.js.map +1 -1
  338. package/es/constants/config.js +2 -1
  339. package/es/dsl/constant/index.d.ts +13 -0
  340. package/es/dsl/constant/index.js +6 -1
  341. package/es/dsl/constant/index.js.map +1 -1
  342. package/es/dsl/story-chart/area.d.ts +2 -0
  343. package/es/dsl/story-chart/area.js +5 -1
  344. package/es/dsl/story-chart/area.js.map +1 -1
  345. package/es/dsl/story-chart/bar.d.ts +2 -0
  346. package/es/dsl/story-chart/bar.js +1 -1
  347. package/es/dsl/story-chart/bar.js.map +1 -1
  348. package/es/dsl/story-chart/line.d.ts +2 -0
  349. package/es/dsl/story-chart/line.js +2 -2
  350. package/es/dsl/story-chart/line.js.map +1 -1
  351. package/es/dsl/story-chart/pie.d.ts +2 -0
  352. package/es/dsl/story-chart/pie.js +4 -1
  353. package/es/dsl/story-chart/pie.js.map +1 -1
  354. package/es/dsl/story-processor/graphic/appear.js.map +1 -1
  355. package/es/dsl/story-processor/graphic/effect/appear.js +1 -8
  356. package/es/dsl/story-processor/graphic/effect/appear.js.map +1 -1
  357. package/es/dsl/story-processor/graphic/effect/typewriter.js +1 -1
  358. package/es/dsl/story-processor/graphic/effect/typewriter.js.map +1 -1
  359. package/es/dsl/story-processor/index.js +1 -1
  360. package/es/dsl/story-processor/processor.js +1 -1
  361. package/es/dsl/types/index.d.ts +1 -0
  362. package/es/dsl/types/index.js.map +1 -1
  363. package/es/dsl/utils/datum.js +2 -1
  364. package/es/dsl/utils/flicker.js +1 -1
  365. package/es/edit/const.d.ts +1 -3
  366. package/es/edit/const.js +1 -0
  367. package/es/edit/const.js.map +1 -1
  368. package/es/edit/edit-action.d.ts +9 -0
  369. package/es/edit/edit-action.js +63 -5
  370. package/es/edit/edit-action.js.map +1 -1
  371. package/es/edit/edit-component/base-selection.d.ts +8 -3
  372. package/es/edit/edit-component/base-selection.js +31 -3
  373. package/es/edit/edit-component/base-selection.js.map +1 -1
  374. package/es/edit/edit-component/chart-selection.d.ts +15 -0
  375. package/es/edit/edit-component/chart-selection.js +31 -0
  376. package/es/edit/edit-component/chart-selection.js.map +1 -0
  377. package/es/edit/edit-component/common.d.ts +1 -11
  378. package/es/edit/edit-component/common.js +1 -26
  379. package/es/edit/edit-component/common.js.map +1 -1
  380. package/es/edit/edit-component/edit-control/richtext-control.d.ts +19 -0
  381. package/es/edit/edit-component/edit-control/richtext-control.js +28 -0
  382. package/es/edit/edit-component/edit-control/richtext-control.js.map +1 -0
  383. package/es/edit/edit-component/edit-control/richtext-transform-control.d.ts +2 -3
  384. package/es/edit/edit-component/edit-control/richtext-transform-control.js +29 -34
  385. package/es/edit/edit-component/edit-control/richtext-transform-control.js.map +1 -1
  386. package/es/edit/edit-component/edit-control/transform-control.d.ts +4 -2
  387. package/es/edit/edit-component/edit-control/transform-control.js +10 -6
  388. package/es/edit/edit-component/edit-control/transform-control.js.map +1 -1
  389. package/es/edit/edit-component/edit-control/transform-drag.d.ts +1 -0
  390. package/es/edit/edit-component/edit-control/transform-drag.js +4 -2
  391. package/es/edit/edit-component/edit-control/transform-drag.js.map +1 -1
  392. package/es/edit/edit-component/image-selection.d.ts +1 -2
  393. package/es/edit/edit-component/image-selection.js +2 -5
  394. package/es/edit/edit-component/image-selection.js.map +1 -1
  395. package/es/edit/edit-component/index.js +7 -9
  396. package/es/edit/edit-component/index.js.map +1 -1
  397. package/es/edit/edit-component/layer-edit.js +0 -2
  398. package/es/edit/edit-component/mixin/richtext.d.ts +21 -0
  399. package/es/edit/edit-component/mixin/richtext.js +18 -0
  400. package/es/edit/edit-component/mixin/richtext.js.map +1 -0
  401. package/es/edit/edit-component/rect-selection.d.ts +8 -12
  402. package/es/edit/edit-component/rect-selection.js +14 -21
  403. package/es/edit/edit-component/rect-selection.js.map +1 -1
  404. package/es/edit/edit-component/richtext-selection-common.d.ts +19 -0
  405. package/es/edit/edit-component/richtext-selection-common.js +33 -0
  406. package/es/edit/edit-component/richtext-selection-common.js.map +1 -0
  407. package/es/edit/edit-component/richtext-selection.d.ts +0 -2
  408. package/es/edit/edit-component/richtext-selection.js +1 -7
  409. package/es/edit/edit-component/richtext-selection.js.map +1 -1
  410. package/es/edit/edit-component/shape-selection.d.ts +11 -0
  411. package/es/edit/edit-component/shape-selection.js +30 -0
  412. package/es/edit/edit-component/shape-selection.js.map +1 -0
  413. package/es/edit/edit-component/text-selection.d.ts +0 -3
  414. package/es/edit/edit-component/text-selection.js +2 -12
  415. package/es/edit/edit-component/text-selection.js.map +1 -1
  416. package/es/edit/edit.d.ts +5 -2
  417. package/es/edit/edit.js +21 -4
  418. package/es/edit/edit.js.map +1 -1
  419. package/es/edit/interface.d.ts +6 -1
  420. package/es/edit/interface.js +3 -1
  421. package/es/edit/interface.js.map +1 -1
  422. package/es/index.d.ts +3 -1
  423. package/es/index.js +5 -1
  424. package/es/index.js.map +1 -1
  425. package/es/interface/type.js +1 -2
  426. package/es/player/interface/player.d.ts +5 -2
  427. package/es/player/interface/player.js.map +1 -1
  428. package/es/player/interface/scheduler.d.ts +1 -1
  429. package/es/player/interface/scheduler.js.map +1 -1
  430. package/es/player/player.d.ts +7 -2
  431. package/es/player/player.js +33 -20
  432. package/es/player/player.js.map +1 -1
  433. package/es/player/processor/chart/common/chartAppear.d.ts +5 -0
  434. package/es/player/processor/chart/common/chartAppear.js +4 -0
  435. package/es/player/processor/chart/common/chartAppear.js.map +1 -0
  436. package/es/player/processor/chart/common/commonAppear.d.ts +8 -0
  437. package/es/player/processor/chart/common/commonAppear.js +36 -0
  438. package/es/player/processor/chart/common/commonAppear.js.map +1 -0
  439. package/es/player/processor/chart/component/axisAppear.d.ts +2 -2
  440. package/es/player/processor/chart/component/axisAppear.js +3 -1
  441. package/es/player/processor/chart/component/axisAppear.js.map +1 -1
  442. package/es/player/processor/chart/component/commonAppear.d.ts +3 -3
  443. package/es/player/processor/chart/component/commonAppear.js +3 -14
  444. package/es/player/processor/chart/component/commonAppear.js.map +1 -1
  445. package/es/player/processor/chart/component/labelAppear.d.ts +2 -2
  446. package/es/player/processor/chart/component/labelAppear.js +1 -1
  447. package/es/player/processor/chart/component/labelAppear.js.map +1 -1
  448. package/es/player/processor/chart/component/legendsAppear.d.ts +4 -3
  449. package/es/player/processor/chart/component/legendsAppear.js +2 -2
  450. package/es/player/processor/chart/component/legendsAppear.js.map +1 -1
  451. package/es/player/processor/chart/component/titleAppear.d.ts +4 -3
  452. package/es/player/processor/chart/component/titleAppear.js +2 -2
  453. package/es/player/processor/chart/component/titleAppear.js.map +1 -1
  454. package/es/player/processor/chart/rankingBar/rankingBar.d.ts +29 -0
  455. package/es/player/processor/chart/rankingBar/rankingBar.js +50 -0
  456. package/es/player/processor/chart/rankingBar/rankingBar.js.map +1 -0
  457. package/es/player/processor/chart/seriesmark/commonTransformMarkAppear.d.ts +3 -3
  458. package/es/player/processor/chart/seriesmark/commonTransformMarkAppear.js.map +1 -1
  459. package/{cjs/player/processor/chart/seriesmark/transformSymbolAppear.d.ts → es/player/processor/chart/seriesmark/transformArcVisibility.d.ts} +3 -3
  460. package/es/player/processor/chart/seriesmark/{transformArcAppear.js → transformArcVisibility.js} +3 -4
  461. package/es/player/processor/chart/seriesmark/transformArcVisibility.js.map +1 -0
  462. package/es/player/processor/chart/seriesmark/transformLineVisibility.d.ts +12 -0
  463. package/es/player/processor/chart/seriesmark/transformLineVisibility.js +4 -0
  464. package/es/player/processor/chart/seriesmark/transformLineVisibility.js.map +1 -0
  465. package/es/player/processor/chart/seriesmark/transformRectVisibility.d.ts +12 -0
  466. package/es/player/processor/chart/seriesmark/{transformRectAppear.js → transformRectVisibility.js} +4 -5
  467. package/es/player/processor/chart/seriesmark/transformRectVisibility.js.map +1 -0
  468. package/es/player/processor/chart/seriesmark/transformSymbolVisibility.d.ts +12 -0
  469. package/es/player/processor/chart/seriesmark/transformSymbolVisibility.js +4 -0
  470. package/es/player/processor/chart/seriesmark/transformSymbolVisibility.js.map +1 -0
  471. package/es/player/processor/chart/seriesmark/transformTextVisibility.d.ts +12 -0
  472. package/es/player/processor/chart/seriesmark/transformTextVisibility.js +4 -0
  473. package/es/player/processor/chart/seriesmark/transformTextVisibility.js.map +1 -0
  474. package/es/player/processor/chart/transformMap.d.ts +24 -18
  475. package/es/player/processor/chart/transformMap.js +14 -11
  476. package/es/player/processor/chart/transformMap.js.map +1 -1
  477. package/es/player/processor/chart/vchart.d.ts +76 -18
  478. package/es/player/processor/chart/vchart.js +145 -34
  479. package/es/player/processor/chart/vchart.js.map +1 -1
  480. package/es/player/processor/common/bounce-processor.d.ts +3 -0
  481. package/es/player/processor/common/bounce-processor.js +19 -0
  482. package/es/player/processor/common/bounce-processor.js.map +1 -0
  483. package/es/player/processor/common/common.d.ts +5 -0
  484. package/es/player/processor/common/common.js +12 -0
  485. package/es/player/processor/common/common.js.map +1 -0
  486. package/es/player/processor/common/fade-processor.d.ts +4 -0
  487. package/es/player/processor/common/fade-processor.js +30 -0
  488. package/es/player/processor/common/fade-processor.js.map +1 -0
  489. package/es/player/processor/common/move-processor.d.ts +8 -0
  490. package/es/player/processor/common/move-processor.js +148 -0
  491. package/es/player/processor/common/move-processor.js.map +1 -0
  492. package/es/player/processor/common/scale-processor.d.ts +8 -0
  493. package/es/player/processor/common/scale-processor.js +43 -0
  494. package/es/player/processor/common/scale-processor.js.map +1 -0
  495. package/es/player/processor/common/wipe-processor.d.ts +4 -0
  496. package/es/player/processor/common/wipe-processor.js +36 -0
  497. package/es/player/processor/common/wipe-processor.js.map +1 -0
  498. package/es/player/processor/common-processor.js +3 -0
  499. package/es/player/processor/common-processor.js.map +1 -0
  500. package/es/player/processor/component/common-component.d.ts +45 -9
  501. package/es/player/processor/component/common-component.js +97 -73
  502. package/es/player/processor/component/common-component.js.map +1 -1
  503. package/es/player/processor/component/image/image-visibility.d.ts +5 -0
  504. package/es/player/processor/component/image/image-visibility.js +8 -0
  505. package/es/player/processor/component/image/image-visibility.js.map +1 -0
  506. package/es/player/processor/component/line/line-visibility.d.ts +5 -0
  507. package/es/player/processor/component/line/line-visibility.js +8 -0
  508. package/es/player/processor/component/line/line-visibility.js.map +1 -0
  509. package/es/player/processor/component/rect/rect-visibility.d.ts +5 -0
  510. package/es/player/processor/component/rect/rect-visibility.js +8 -0
  511. package/es/player/processor/component/rect/rect-visibility.js.map +1 -0
  512. package/es/player/processor/component/shape/shape-visibility.d.ts +5 -0
  513. package/es/player/processor/component/shape/shape-visibility.js +8 -0
  514. package/es/player/processor/component/shape/shape-visibility.js.map +1 -0
  515. package/es/player/processor/component/text/text-visibility.d.ts +6 -0
  516. package/es/player/processor/component/text/text-visibility.js +39 -0
  517. package/es/player/processor/component/text/text-visibility.js.map +1 -0
  518. package/es/player/processor/component/timeline/timeline-visibility.d.ts +15 -0
  519. package/es/player/processor/component/timeline/timeline-visibility.js +71 -0
  520. package/es/player/processor/component/timeline/timeline-visibility.js.map +1 -0
  521. package/es/player/processor/component/utils.d.ts +3 -1
  522. package/es/player/processor/component/utils.js +13 -0
  523. package/es/player/processor/component/utils.js.map +1 -1
  524. package/es/player/processor/interface/action-processor.d.ts +6 -6
  525. package/es/player/processor/interface/action-processor.js.map +1 -1
  526. package/es/player/processor/interface/appear-action.d.ts +30 -18
  527. package/es/player/processor/interface/appear-action.js.map +1 -1
  528. package/es/player/processor/interface/common-action.d.ts +15 -0
  529. package/es/player/processor/interface/common-action.js +2 -0
  530. package/es/player/processor/interface/common-action.js.map +1 -0
  531. package/es/player/processor/interface/style-action.d.ts +33 -0
  532. package/es/player/processor/interface/style-action.js +2 -0
  533. package/es/player/processor/interface/style-action.js.map +1 -0
  534. package/es/player/processor/processor-item.d.ts +5 -5
  535. package/es/player/processor/processor-item.js.map +1 -1
  536. package/es/player/processor/processor.d.ts +3 -3
  537. package/es/player/processor/processor.js +2 -2
  538. package/es/player/processor/processor.js.map +1 -1
  539. package/es/player/processor/processorMap.d.ts +31 -21
  540. package/es/player/processor/processorMap.js +59 -15
  541. package/es/player/processor/processorMap.js.map +1 -1
  542. package/es/player/scheduler.d.ts +4 -3
  543. package/es/player/scheduler.js +16 -10
  544. package/es/player/scheduler.js.map +1 -1
  545. package/es/scene/scene.js +2 -0
  546. package/es/story/canvas/canvas.d.ts +4 -2
  547. package/es/story/canvas/canvas.js +21 -14
  548. package/es/story/canvas/canvas.js.map +1 -1
  549. package/es/story/character/base/base.d.ts +7 -4
  550. package/es/story/character/base/base.js +7 -4
  551. package/es/story/character/base/base.js.map +1 -1
  552. package/es/story/character/chart/character.d.ts +16 -0
  553. package/es/story/character/chart/character.js +63 -17
  554. package/es/story/character/chart/character.js.map +1 -1
  555. package/es/story/character/chart/characters/rankingBar.d.ts +4 -0
  556. package/es/story/character/chart/characters/rankingBar.js +14 -0
  557. package/es/story/character/chart/characters/rankingBar.js.map +1 -0
  558. package/es/story/character/chart/graphic/vchart-graphic-picker.js +6 -8
  559. package/es/story/character/chart/graphic/vchart-graphic-picker.js.map +1 -1
  560. package/es/story/character/chart/graphic/vchart-graphic-render.js +9 -9
  561. package/es/story/character/chart/graphic/vchart-graphic-render.js.map +1 -1
  562. package/es/story/character/chart/graphic/vchart-graphic.d.ts +13 -2
  563. package/es/story/character/chart/graphic/vchart-graphic.js +85 -13
  564. package/es/story/character/chart/graphic/vchart-graphic.js.map +1 -1
  565. package/es/story/character/chart/runtime/common-spec.d.ts +2 -4
  566. package/es/story/character/chart/runtime/common-spec.js +0 -2
  567. package/es/story/character/chart/runtime/common-spec.js.map +1 -1
  568. package/es/story/character/chart/runtime/component-spec.d.ts +4 -3
  569. package/es/story/character/chart/runtime/component-spec.js +7 -5
  570. package/es/story/character/chart/runtime/component-spec.js.map +1 -1
  571. package/es/story/character/chart/temp/constant.d.ts +1 -0
  572. package/es/story/character/chart/temp/constant.js +2 -1
  573. package/es/story/character/chart/temp/constant.js.map +1 -1
  574. package/es/story/character/chart/temp/templates/bar.d.ts +20 -0
  575. package/es/story/character/chart/temp/templates/bar.js +27 -0
  576. package/es/story/character/chart/temp/templates/bar.js.map +1 -0
  577. package/es/story/character/chart/temp/templates/base-temp.d.ts +6 -4
  578. package/es/story/character/chart/temp/templates/base-temp.js +1 -1
  579. package/es/story/character/chart/temp/templates/base-temp.js.map +1 -1
  580. package/es/story/character/chart/temp/templates/ranking-bar-temp.d.ts +8 -0
  581. package/es/story/character/chart/temp/templates/ranking-bar-temp.js +18 -0
  582. package/es/story/character/chart/temp/templates/ranking-bar-temp.js.map +1 -0
  583. package/es/story/character/component/character-group/component-group-graphic-render.d.ts +2 -2
  584. package/es/story/character/component/character-group/component-group-graphic-render.js +4 -4
  585. package/es/story/character/component/character-group/component-group-graphic-render.js.map +1 -1
  586. package/es/story/character/component/character-group/component-group-graphic.d.ts +2 -1
  587. package/es/story/character/component/character-group/component-group-graphic.js +11 -3
  588. package/es/story/character/component/character-group/component-group-graphic.js.map +1 -1
  589. package/es/story/character/component/character.d.ts +9 -4
  590. package/es/story/character/component/character.js +26 -5
  591. package/es/story/character/component/character.js.map +1 -1
  592. package/es/story/character/component/characters/character-image.d.ts +3 -0
  593. package/es/story/character/component/characters/character-image.js +4 -0
  594. package/es/story/character/component/characters/character-image.js.map +1 -1
  595. package/es/story/character/component/characters/character-rect.d.ts +3 -0
  596. package/es/story/character/component/characters/character-rect.js +4 -0
  597. package/es/story/character/component/characters/character-rect.js.map +1 -1
  598. package/es/story/character/component/characters/character-richtext.d.ts +1 -6
  599. package/es/story/character/component/characters/character-richtext.js +0 -12
  600. package/es/story/character/component/characters/character-richtext.js.map +1 -1
  601. package/es/story/character/component/characters/character-shape.d.ts +4 -0
  602. package/es/story/character/component/characters/character-shape.js +15 -0
  603. package/es/story/character/component/characters/character-shape.js.map +1 -1
  604. package/es/story/character/component/characters/character-text.js +2 -2
  605. package/es/story/character/component/characters/character-text.js.map +1 -1
  606. package/es/story/character/component/graphic/graphic-base-text.d.ts +24 -0
  607. package/es/story/character/component/graphic/{graphic-text.js → graphic-base-text.js} +44 -23
  608. package/es/story/character/component/graphic/graphic-base-text.js.map +1 -0
  609. package/es/story/character/component/graphic/graphic.d.ts +1 -1
  610. package/es/story/character/component/graphic/graphic.js.map +1 -1
  611. package/es/story/character/component/graphic/richtext.d.ts +1 -9
  612. package/es/story/character/component/graphic/richtext.js +0 -41
  613. package/es/story/character/component/graphic/richtext.js.map +1 -1
  614. package/es/story/character/component/graphic/symbol.d.ts +3 -0
  615. package/es/story/character/component/graphic/symbol.js +17 -2
  616. package/es/story/character/component/graphic/symbol.js.map +1 -1
  617. package/es/story/character/component/graphic/text.d.ts +4 -3
  618. package/es/story/character/component/graphic/text.js +21 -4
  619. package/es/story/character/component/graphic/text.js.map +1 -1
  620. package/es/story/character/component/graphic/timeline.d.ts +6 -0
  621. package/es/story/character/component/graphic/timeline.js +7 -1
  622. package/es/story/character/component/graphic/timeline.js.map +1 -1
  623. package/es/story/character/dsl-interface.d.ts +4 -2
  624. package/es/story/character/dsl-interface.js.map +1 -1
  625. package/es/story/character/runtime-interface.d.ts +10 -4
  626. package/es/story/character/runtime-interface.js.map +1 -1
  627. package/es/story/character/visactor/character.d.ts +20 -6
  628. package/es/story/character/visactor/character.js +18 -0
  629. package/es/story/character/visactor/character.js.map +1 -1
  630. package/es/story/character/visactor/interface.d.ts +1 -0
  631. package/es/story/character/visactor/interface.js.map +1 -1
  632. package/es/story/character-tree/character-tree.d.ts +1 -0
  633. package/es/story/character-tree/character-tree.js +6 -0
  634. package/es/story/character-tree/character-tree.js.map +1 -1
  635. package/es/story/index.js +7 -6
  636. package/es/story/index.js.map +1 -1
  637. package/es/story/interface/dsl-interface.d.ts +7 -9
  638. package/es/story/interface/dsl-interface.js.map +1 -1
  639. package/es/story/interface/player.d.ts +1 -13
  640. package/es/story/interface/player.js +2 -1
  641. package/es/story/interface/player.js.map +1 -1
  642. package/es/story/interface/runtime-interface.d.ts +5 -3
  643. package/es/story/interface/runtime-interface.js.map +1 -1
  644. package/es/story/story.d.ts +2 -1
  645. package/es/story/story.js +9 -6
  646. package/es/story/story.js.map +1 -1
  647. package/es/story/utils/layout.d.ts +2 -1
  648. package/es/story/utils/layout.js +2 -2
  649. package/es/story/utils/layout.js.map +1 -1
  650. package/es/story/utils/vchart-pick.d.ts +115 -0
  651. package/es/story/utils/vchart-pick.js +115 -0
  652. package/es/story/utils/vchart-pick.js.map +1 -0
  653. package/es/util/space.js +2 -1
  654. package/package.json +9 -8
  655. package/cjs/player/processor/chart/seriesmark/transformArcAppear.js.map +0 -1
  656. package/cjs/player/processor/chart/seriesmark/transformLineAppear.js +0 -14
  657. package/cjs/player/processor/chart/seriesmark/transformLineAppear.js.map +0 -1
  658. package/cjs/player/processor/chart/seriesmark/transformRectAppear.js.map +0 -1
  659. package/cjs/player/processor/chart/seriesmark/transformSymbolAppear.js +0 -14
  660. package/cjs/player/processor/chart/seriesmark/transformSymbolAppear.js.map +0 -1
  661. package/cjs/player/processor/chart/seriesmark/transformTextAppear.d.ts +0 -12
  662. package/cjs/player/processor/chart/seriesmark/transformTextAppear.js +0 -14
  663. package/cjs/player/processor/chart/seriesmark/transformTextAppear.js.map +0 -1
  664. package/cjs/player/processor/component/image/image-appear.d.ts +0 -5
  665. package/cjs/player/processor/component/image/image-appear.js +0 -16
  666. package/cjs/player/processor/component/image/image-appear.js.map +0 -1
  667. package/cjs/player/processor/component/line/line-appear.d.ts +0 -5
  668. package/cjs/player/processor/component/line/line-appear.js +0 -16
  669. package/cjs/player/processor/component/line/line-appear.js.map +0 -1
  670. package/cjs/player/processor/component/rect/rect-appear.d.ts +0 -5
  671. package/cjs/player/processor/component/rect/rect-appear.js +0 -16
  672. package/cjs/player/processor/component/rect/rect-appear.js.map +0 -1
  673. package/cjs/player/processor/component/shape/shape-appear.d.ts +0 -5
  674. package/cjs/player/processor/component/shape/shape-appear.js +0 -16
  675. package/cjs/player/processor/component/shape/shape-appear.js.map +0 -1
  676. package/cjs/player/processor/component/text/text-appear.d.ts +0 -7
  677. package/cjs/player/processor/component/text/text-appear.js +0 -34
  678. package/cjs/player/processor/component/text/text-appear.js.map +0 -1
  679. package/cjs/player/processor/component/timeline/timeline-appear.d.ts +0 -7
  680. package/cjs/player/processor/component/timeline/timeline-appear.js +0 -33
  681. package/cjs/player/processor/component/timeline/timeline-appear.js.map +0 -1
  682. package/cjs/story/character/component/graphic/graphic-text.d.ts +0 -18
  683. package/cjs/story/character/component/graphic/graphic-text.js.map +0 -1
  684. package/cjs/story/player/encode.js +0 -3
  685. package/cjs/story/player/encode.js.map +0 -1
  686. package/cjs/story/player/index.js +0 -3
  687. package/cjs/story/player/index.js.map +0 -1
  688. package/cjs/story/player/ticker.d.ts +0 -1
  689. package/cjs/story/player/ticker.js +0 -3
  690. package/cjs/story/player/ticker.js.map +0 -1
  691. package/es/player/processor/chart/seriesmark/transformArcAppear.d.ts +0 -12
  692. package/es/player/processor/chart/seriesmark/transformArcAppear.js.map +0 -1
  693. package/es/player/processor/chart/seriesmark/transformLineAppear.d.ts +0 -12
  694. package/es/player/processor/chart/seriesmark/transformLineAppear.js +0 -7
  695. package/es/player/processor/chart/seriesmark/transformLineAppear.js.map +0 -1
  696. package/es/player/processor/chart/seriesmark/transformRectAppear.d.ts +0 -12
  697. package/es/player/processor/chart/seriesmark/transformRectAppear.js.map +0 -1
  698. package/es/player/processor/chart/seriesmark/transformSymbolAppear.d.ts +0 -12
  699. package/es/player/processor/chart/seriesmark/transformSymbolAppear.js +0 -7
  700. package/es/player/processor/chart/seriesmark/transformSymbolAppear.js.map +0 -1
  701. package/es/player/processor/chart/seriesmark/transformTextAppear.d.ts +0 -12
  702. package/es/player/processor/chart/seriesmark/transformTextAppear.js +0 -7
  703. package/es/player/processor/chart/seriesmark/transformTextAppear.js.map +0 -1
  704. package/es/player/processor/component/image/image-appear.d.ts +0 -5
  705. package/es/player/processor/component/image/image-appear.js +0 -8
  706. package/es/player/processor/component/image/image-appear.js.map +0 -1
  707. package/es/player/processor/component/line/line-appear.d.ts +0 -5
  708. package/es/player/processor/component/line/line-appear.js +0 -8
  709. package/es/player/processor/component/line/line-appear.js.map +0 -1
  710. package/es/player/processor/component/rect/rect-appear.d.ts +0 -5
  711. package/es/player/processor/component/rect/rect-appear.js +0 -8
  712. package/es/player/processor/component/rect/rect-appear.js.map +0 -1
  713. package/es/player/processor/component/shape/shape-appear.d.ts +0 -5
  714. package/es/player/processor/component/shape/shape-appear.js +0 -8
  715. package/es/player/processor/component/shape/shape-appear.js.map +0 -1
  716. package/es/player/processor/component/text/text-appear.d.ts +0 -7
  717. package/es/player/processor/component/text/text-appear.js +0 -32
  718. package/es/player/processor/component/text/text-appear.js.map +0 -1
  719. package/es/player/processor/component/timeline/timeline-appear.d.ts +0 -7
  720. package/es/player/processor/component/timeline/timeline-appear.js +0 -27
  721. package/es/player/processor/component/timeline/timeline-appear.js.map +0 -1
  722. package/es/story/character/component/graphic/graphic-text.d.ts +0 -18
  723. package/es/story/character/component/graphic/graphic-text.js.map +0 -1
  724. package/es/story/player/encode.d.ts +0 -1
  725. package/es/story/player/encode.js +0 -3
  726. package/es/story/player/encode.js.map +0 -1
  727. package/es/story/player/index.d.ts +0 -1
  728. package/es/story/player/index.js +0 -3
  729. package/es/story/player/index.js.map +0 -1
  730. package/es/story/player/ticker.d.ts +0 -1
  731. package/es/story/player/ticker.js +0 -3
  732. package/es/story/player/ticker.js.map +0 -1
  733. /package/cjs/{story/player/encode.d.ts → player/processor/common-processor.d.ts} +0 -0
  734. /package/{cjs/story/player/index.d.ts → es/player/processor/common-processor.d.ts} +0 -0
@@ -0,0 +1,20 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VStory={})}(this,(function(t){"use strict";function e(t,e,n){return e=c(e),v(t,i()?Reflect.construct(e,n||[],c(t).constructor):e.apply(t,n))}function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(i=function(){return!!t})()}function n(){n=function(){return e};var t,e={},i=Object.prototype,r=i.hasOwnProperty,a=Object.defineProperty||function(t,e,i){t[e]=i.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,i){return t[e]=i}}function c(t,e,i,n){var r=e&&e.prototype instanceof m?e:m,o=Object.create(r.prototype),s=new M(n||[]);return a(o,"_invoke",{value:C(t,i,s)}),o}function d(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var f="suspendedStart",v="suspendedYield",p="executing",g="completed",y={};function m(){}function k(){}function _(){}var b={};h(b,s,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(P([])));S&&S!==i&&r.call(S,s)&&(b=S);var w=_.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function i(n,a,o,s){var u=d(t[n],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,o,s)}),(function(t){i("throw",t,o,s)})):e.resolve(h).then((function(t){l.value=t,o(l)}),(function(t){return i("throw",t,o,s)}))}s(u.arg)}var n;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,n){i(t,r,e,n)}))}return n=n?n.then(a,a):a()}})}function C(e,i,n){var r=f;return function(a,o){if(r===p)throw Error("Generator is already running");if(r===g){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var l=d(e,i,n);if("normal"===l.type){if(r=n.done?g:v,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=g,n.method="throw",n.arg=l.arg)}}}function E(e,i){var n=i.method,r=e.iterator[n];if(r===t)return i.delegate=null,"throw"===n&&e.iterator.return&&(i.method="return",i.arg=t,E(e,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=d(r,e.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,y;var o=a.arg;return o?o.done?(i[e.resultName]=o.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,y):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function P(e){if(e||""===e){var i=e[s];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return k.prototype=_,a(w,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:k,configurable:!0}),k.displayName=h(_,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===k||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,h(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},A(T.prototype),h(T.prototype,u,(function(){return this})),e.AsyncIterator=T,e.async=function(t,i,n,r,a){void 0===a&&(a=Promise);var o=new T(c(t,i,n,r),a);return e.isGeneratorFunction(i)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},A(w),h(w,l,"Generator"),h(w,s,(function(){return this})),h(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(n,r){return s.type="throw",s.arg=e,i.next=n,r&&(i.method="next",i.arg=t),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),R(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;R(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:P(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function r(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,r(n.key),n)}}function u(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,i){return(e=r(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return f(t)}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}},p.apply(this,arguments)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,a,o,s=[],u=!0,l=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;u=!1}else for(;!(u=(n=a.call(i)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,r=t}finally{try{if(!u&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(l)throw r}}return s}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){if(t){if("string"==typeof t)return k(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function _(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=m(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}var b=function(){function t(){o(this,t)}return u(t,null,[{key:"GenAutoIncrementId",value:function(){return t.auto_increment_id++}}])}();b.auto_increment_id=0;var x=u((function t(e){o(this,t),this.id=b.GenAutoIncrementId(),this.registry=e})),S="named",w="inject",A="multi_inject",T="inversify:tagged",C="inversify:paramtypes",E=function(){return u((function t(e,i){o(this,t),this.key=e,this.value=i}),[{key:"toString",value:function(){return this.key===S?"named: ".concat(String(this.value).toString()," "):"tagged: { key:".concat(this.key.toString(),", value: ").concat(String(this.value)," }")}}])}(),B=function(t){var e;return function(t){var e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==("undefined"==typeof process?"undefined":a(process))&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=new WeakMap;function o(t,e,i){var a=r.get(t);if(h(a)){if(!i)return;a=new n,r.set(t,a)}var o=a.get(e);if(h(o)){if(!i)return;o=new n,a.set(e,o)}return o}function s(t,e,i){if(u(t,e,i))return!0;var n=g(e);return!c(n)&&s(t,n,i)}function u(t,e,i){var n=o(e,i,!1);return!h(n)&&!!n.has(t)}function l(t,e,i){if(u(t,e,i))return function(t,e,i){var n=o(e,i,!1);if(!h(n))return n.get(t)}(t,e,i);var n=g(e);return c(n)?void 0:l(t,n,i)}function h(t){return void 0===t}function c(t){return null===t}function d(t){return"object"==a(t)?null!==t:"function"==typeof t}function f(t,i){switch(function(t){if(null===t)return 1;switch(a(t)){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===i?"string":5===i?"number":"default",r=function(t,e){var i=t[e];if(null!=i){if(!p(i))throw new TypeError;return i}}(t,e);if(void 0!==r){var o=r.call(t,n);if(d(o))throw new TypeError;return o}return function(t,e){if("string"===e){var i=t.toString;if(p(i)){var n=i.call(t);if(!d(n))return n}var r=t.valueOf;if(p(r)){var a=r.call(t);if(!d(a))return a}}else{var o=t.valueOf;if(p(o)){var s=o.call(t);if(!d(s))return s}var u=t.toString;if(p(u)){var l=u.call(t);if(!d(l))return l}}throw new TypeError}(t,"default"===n?"number":n)}function v(t){var e=f(t,3);return"symbol"==a(e)?e:function(t){return""+t}(e)}function p(t){return"function"==typeof t}function g(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var a=r.constructor;return"function"!=typeof a||a===t?e:a}t("defineMetadata",(function(t,e,i,n){if(!d(i))throw new TypeError;return r=t,a=e,void o(i,n,!0).set(r,a);var r,a})),t("hasMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=v(i)),s(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=v(i)),u(t,e,i)})),t("getMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=v(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function R(t,e,i,n){!function(t,e,i,n){var r,a=[n],o={};B.hasOwnMetadata(t,e)&&(o=B.getMetadata(t,e));var s=o[i];void 0===s&&(s=[]),(r=s).push.apply(r,a),o[i]=s,B.defineMetadata(t,o,e)}(T,t,i.toString(),n)}function M(t){return function(e,i,n){R(e,0,n,t)}}function P(t){return function(e){return function(i,n,r){return M(new E(t,e))(i,n,r)}}}var O=P(w),I=P(A);function L(){return function(t){return B.defineMetadata(C,null,t),t}}function D(t){return M(new E(S,t))}var F,j="Singleton",N="Transient",z="ConstantValue",U="DynamicValue",G="Factory",W="Function",V="Instance",H="Invalid",K=function(){function t(e,i){o(this,t),this.id=b.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=e,this.scope=i,this.type=H,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}return u(t,[{key:"clone",value:function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===j&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.provider=this.provider,e.constraint=this.constraint,e.cache=this.cache,e}}])}(),X=function(){return u((function t(){o(this,t)}),[{key:"getConstructorMetadata",value:function(t){return{compilerGeneratedMetadata:B.getMetadata(C,t),userGeneratedMetadata:B.getMetadata(T,t)||{}}}},{key:"getPropertiesMetadata",value:function(t){throw new Error("暂未实现")}}])}(),Y=(F=S,function(t){var e=function(e){if(null==e)return!1;if(e.key===F&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;for(var i=e.constructorArgsMetadata,n=0;n<i.length;n++)if(i[n].key===F&&i[n].value===t)return!0;return!1};return e.metaData=new E(F,t),e}),q=function(){return u((function t(e){o(this,t),this._binding=e}),[{key:"inRequestScope",value:function(){throw new Error("暂未实现")}},{key:"inSingletonScope",value:function(){return this._binding.scope=j,this}},{key:"inTransientScope",value:function(){return this._binding.scope=N,this}},{key:"whenTargetNamed",value:function(t){return this._binding.constraint=Y(t),this}}])}(),Z=function(){return u((function t(e){o(this,t),this._binding=e}),[{key:"to",value:function(t){return this._binding.type=V,this._binding.implementationType=t,new q(this._binding)}},{key:"toSelf",value:function(){var t=this._binding.serviceIdentifier;return this.to(t)}},{key:"toDynamicValue",value:function(t){return this._binding.type=U,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new q(this._binding)}},{key:"toConstantValue",value:function(t){return this._binding.type=z,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=j,new q(this._binding)}},{key:"toFactory",value:function(t){return this._binding.type=G,this._binding.factory=t,this._binding.scope=j,new q(this._binding)}},{key:"toService",value:function(t){this.toDynamicValue((function(e){return e.container.get(t)}))}}])}(),J=function(){return u((function t(e){o(this,t);var i=e||{};i.defaultScope=i.defaultScope||N,this.options=i,this.id=b.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new X}),[{key:"load",value:function(t){var e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}},{key:"get",value:function(t){var e=this._getNotAllArgs(t,!1);return this._get(e)}},{key:"getAll",value:function(t){var e=this._getAllArgs(t);return this._get(e)}},{key:"getTagged",value:function(t,e,i){var n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}},{key:"getNamed",value:function(t,e){return this.getTagged(t,S,e)}},{key:"isBound",value:function(t){return this._bindingDictionary.has(t)}},{key:"bind",value:function(t){var e=this.options.defaultScope,i=new K(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new Z(i)}},{key:"unbind",value:function(t){this._bindingDictionary.delete(t)}},{key:"rebind",value:function(t){return this.unbind(t),this.bind(t)}},{key:"_getContainerModuleHelpersFactory",value:function(){var t=this,e=function(t,e){t._binding.moduleId=e},i=function(i){return function(n){var r=t.rebind(n);return e(r,i),r}};return function(n){return{bindFunction:(r=n,function(i){var n=t.bind(i);return e(n,r),n}),isboundFunction:function(e){return t.isBound(e)},rebindFunction:i(n),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(t){return null}};var r}}},{key:"_getNotAllArgs",value:function(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}},{key:"_getAllArgs",value:function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}},{key:"_get",value:function(t){var e=this,i=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((function(e){return e.constraint(t)})).forEach((function(t){i.push(e._resolveFromBinding(t))})),t.isMultiInject||1!==i.length?i:i[0]}},{key:"_getChildRequest",value:function(t){for(var e=this,i=t.implementationType,n=this._metadataReader.getConstructorMetadata(i).userGeneratedMetadata,r=Object.keys(n),a=[],o=function(){var t=n[s],i={};t.forEach((function(t){i[t.key]=t.value}));var r={inject:i[w],multiInject:i[A]},o=r.inject||r.multiInject,u={serviceIdentifier:o,constructorArgsMetadata:t},l={injectIdentifier:o,metadata:t,bindings:e._bindingDictionary.get(o).filter((function(t){return t.constraint(u)}))};a.push(l)},s=0;s<r.length;s++)o();return a}},{key:"_resolveFromBinding",value:function(t){var e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}},{key:"_getResolvedFromBinding",value:function(t){var e;switch(t.type){case z:case W:e=t.cache;break;case V:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}},{key:"_resolveInstance",value:function(t,e){if(t.activated)return t.cache;var i=this._getChildRequest(t);return this._createInstance(e,i)}},{key:"_createInstance",value:function(t,e){return e.length?function(t,e,n){if(i())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var a=new(t.bind.apply(t,r));return n&&d(a,n.prototype),a}(t,y(this._resolveRequests(e))):new t}},{key:"_resolveRequests",value:function(t){var e=this;return t.map((function(t){return t.bindings.length>1?t.bindings.map((function(t){return e._resolveFromBinding(t)})):e._resolveFromBinding(t.bindings[0])}))}},{key:"_saveToScope",value:function(t,e){t.scope===j&&(t.cache=e,t.activated=!0)}}])}(),$=Symbol("ContributionProvider"),Q=function(){return u((function t(e,i){o(this,t),this.serviceIdentifier=e,this.container=i}),[{key:"getContributions",value:function(){var t;return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&(t=this.caches).push.apply(t,y(this.container.getAll(this.serviceIdentifier)))),this.caches}}])}();function tt(t,e){t($).toDynamicValue((function(t){var i=t.container;return new Q(e,i)})).inSingletonScope().whenTargetNamed(e)}var et=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((function(t){return t.fn})).forEach((function(t){return t.apply(void 0,e)}))}}])}(function(){return u((function t(e,i){o(this,t),this._args=e,this.name=i,this.taps=[]}),[{key:"tap",value:function(t,e){this._tap("sync",t,e)}},{key:"unTap",value:function(t,e){var i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((function(t){return!(t.name===i&&(!e||t.fn===e))})))}},{key:"_parseOptions",value:function(t,e,i){var n;if("string"==typeof e)n={name:e.trim()};else if("object"!=a(e)||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n)}},{key:"_tap",value:function(t,e,i){this._insert(this._parseOptions(t,e,i))}},{key:"_insert",value:function(t){var e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var i=0;"number"==typeof t.stage&&(i=t.stage);for(var n=this.taps.length;n>0;){n--;var r=this.taps[n];this.taps[n+1]=r;var a=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(a>i)){n++;break}}this.taps[n]=t}}])}()),it=Symbol.for("EnvContribution"),nt=Symbol.for("VGlobal"),rt=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},at=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ot=function(t,e){return function(i,n){e(i,n,t)}},st=function(){return u((function t(e){o(this,t),this.contributions=e,this.id=b.GenAutoIncrementId(),this.hooks={onSetEnv:new et(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}),[{key:"env",get:function(){return this._env}},{key:"devicePixelRatio",get:function(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}},{key:"supportEvent",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}},{key:"supportsTouchEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}},{key:"supportsPointerEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}},{key:"supportsMouseEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}},{key:"applyStyles",get:function(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles},set:function(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}},{key:"bindContribution",value:function(t){var e=this,i=[];if(this.contributions.getContributions().forEach((function(n){var r=n.configure(e,t);r&&r.then&&i.push(r)})),i.length)return Promise.all(i)}},{key:"getDynamicCanvasCount",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}},{key:"getStaticCanvasCount",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}},{key:"setEnv",value:function(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}},{key:"deactiveCurrentEnv",value:function(){this.envContribution&&this.envContribution.release()}},{key:"activeEnv",value:function(t,e){var i=this,n=this._env;this._env=t;var r=this.bindContribution(e);if(r&&r.then)return r.then((function(){i.envParams=e,i.hooks.onSetEnv.call(n,t,i)}));this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}},{key:"setActiveEnvContribution",value:function(t){this.envContribution=t}},{key:"createCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}},{key:"createOffscreenCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}},{key:"releaseCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}},{key:"addEventListener",value:function(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}},{key:"getRequestAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}},{key:"getCancelAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}},{key:"getElementById",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}},{key:"getRootElement",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}},{key:"getDocument",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}},{key:"mapToCanvasPoint",value:function(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}},{key:"loadImage",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}},{key:"loadSvg",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}},{key:"loadJson",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}},{key:"loadArrayBuffer",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}},{key:"loadBlob",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}},{key:"isChrome",value:function(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}},{key:"isSafari",value:function(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}},{key:"getNativeAABBBounds",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}},{key:"removeDom",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}},{key:"createDom",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}},{key:"updateDom",value:function(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}},{key:"getElementTop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}},{key:"getElementLeft",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}},{key:"getElementTopLeft",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}}])}();function ut(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}st=rt([L(),ot(0,O($)),ot(0,D(it)),at("design:paramtypes",[Object])],st);var lt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,n,a,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,a||t,o),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,a=n.length,o=new Array(a);r<a;r++)o[r]=n[r].fn;return o},s.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},s.prototype.emit=function(t,e,n,r,a,o){var s=i?i+t:t;if(!this._events[s])return!1;var u,l,h=this._events[s],c=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),c){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,n),!0;case 4:return h.fn.call(h.context,e,n,r),!0;case 5:return h.fn.call(h.context,e,n,r,a),!0;case 6:return h.fn.call(h.context,e,n,r,a,o),!0}for(l=1,u=new Array(c-1);l<c;l++)u[l-1]=arguments[l];h.fn.apply(h.context,u)}else{var d,f=h.length;for(l=0;l<f;l++)switch(h[l].once&&this.removeListener(t,h[l].fn,void 0,!0),c){case 1:h[l].fn.call(h[l].context);break;case 2:h[l].fn.call(h[l].context,e);break;case 3:h[l].fn.call(h[l].context,e,n);break;case 4:h[l].fn.call(h[l].context,e,n,r);break;default:if(!u)for(d=1,u=new Array(c-1);d<c;d++)u[d-1]=arguments[d];h[l].fn.apply(h[l].context,u)}}return!0},s.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},s.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},s.prototype.removeListener=function(t,e,n,r){var a=i?i+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||r&&!s.once||n&&s.context!==n||o(this,a);else{for(var u=0,l=[],h=s.length;u<h;u++)(s[u].fn!==e||r&&!s[u].once||n&&s[u].context!==n)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,t.exports=s}(lt);var ht=ut(lt.exports),ct=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},dt=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||ct(t,"Boolean")},ft=function(t){return"function"==typeof t},vt=function(t){return null==t},pt=function(t){return null!=t},gt=function(t){var e=a(t);return null!==t&&"object"===e||"function"===e},yt=function(t){return"object"==a(t)&&null!==t},mt=function(t){if(!yt(t)||!ct(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},kt=function(t){return void 0===t},_t=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=a(t);return e?"string"===i:"string"===i||ct(t,"String")},bt=function(t){return Array.isArray?Array.isArray(t):ct(t,"Array")},xt=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},St=function(t){return ct(t,"Date")},wt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=a(t);return e?"number"===i:"number"===i||ct(t,"Number")},At=function(t){return wt(t)&&Number.isFinite(t)},Tt=function(t){return new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t)},Ct=function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)},Et=function(t){return{}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")},Bt=Object.prototype,Rt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Bt)},Mt=Object.prototype.hasOwnProperty;function Pt(t){if(vt(t))return!0;if(xt(t))return!t.length;var e=Et(t);if("Map"===e||"Set"===e)return!t.size;if(Rt(t))return!Object.keys(t).length;for(var i in t)if(Mt.call(t,i))return!1;return!0}var Ot=function(t,e,i){for(var n=_t(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},It=Object.prototype.hasOwnProperty,Lt=function(t,e){return null!=t&&It.call(t,e)};function Dt(t,e,i){var n;if(!pt(t)||"object"!=a(t)||e&&e(t))return t;var r=bt(t),o=t.length;n=r?new Array(o):"object"==a(t)?{}:dt(t)||wt(t)||_t(t)?t:St(t)?new Date(+t):void 0;var s=r?void 0:Object.keys(Object(t)),u=-1;if(n)for(;++u<(s||t).length;){var l=s?s[u]:u,h=t[l];i&&i.includes(l.toString())?n[l]=h:n[l]=Dt(h,e,i)}return n}function Ft(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(pt(e)&&"object"==a(e)){var r=Object(e),o=[];for(var s in r)o.push(s);for(var u=o.length,l=-1;u--;){var h=o[++l];!pt(r[h])||"object"!=a(r[h])||n&&bt(t[h])?Nt(t,h,r[h]):jt(t,e,h,i,n)}}}}function jt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=t[i],s=e[i],u=e[i],l=!0;if(bt(s)){if(n)u=[];else if(bt(o))u=o;else if(xt(o)){u=new Array(o.length);for(var h=-1,c=o.length;++h<c;)u[h]=o[h]}}else mt(s)?(u=o,"function"!=typeof o&&"object"==a(o)||(u={})):l=!1;l&&Ft(u,s,n,r),Nt(t,i,u)}function Nt(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function zt(t){for(var e=-1,i=arguments.length<=1?0:arguments.length-1;++e<i;)Ft(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function Ut(t){return Object.prototype.toString.call(t)}function Gt(t){return Object.keys(t)}function Wt(t,e,i){if(t===e)return!0;if(a(t)!=a(e))return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(Ut(t)!==Ut(e))return!1;if(ft(t))return!!(null==i?void 0:i.skipFunction);if("object"!=a(t))return!1;if(bt(t)){if(t.length!==e.length)return!1;for(var n=t.length-1;n>=0;n--)if(!Wt(t[n],e[n],i))return!1;return!0}if(!mt(t))return!1;var r=Gt(t),o=Gt(e);if(r.length!==o.length)return!1;r.sort(),o.sort();for(var s=r.length-1;s>=0;s--)if(r[s]!=o[s])return!1;for(var u=r.length-1;u>=0;u--){var l=r[u];if(!Wt(t[l],e[l],i))return!1}return!0}function Vt(t,e,i){for(var n=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e}(e),r=0;r<n.length;r++){var a=n[r];(i?null!=e[a]:null==t[a])&&(t[a]=e[a])}return t}function Ht(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var a=n[r];"constructor"!==a&&(i?null!=e[a]:null==t[a])&&(t[a]=e[a])}else Vt(t,e,i)}function Kt(t){return pt(t)?bt(t)?t:[t]:[]}function Xt(t){if(xt(t))return t[t.length-1]}function Yt(t,e){if(!bt(t)||!bt(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function qt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Zt(t){return Number(t)}var Jt,$t="undefined"!=typeof console;function Qt(t,e,i){var n=[e].concat([].slice.call(i));$t&&console[t].apply(console,n)}!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(Jt||(Jt={}));var te=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jt.None,i=arguments.length>1?arguments[1]:void 0;o(this,t),this._onErrorHandler=[],this._level=e,this._method=i}return u(t,[{key:"addErrorHandler",value:function(t){this._onErrorHandler.find((function(e){return e===t}))||this._onErrorHandler.push(t)}},{key:"removeErrorHandler",value:function(t){var e=this._onErrorHandler.findIndex((function(e){return e===t}));e<0||this._onErrorHandler.splice(e,1)}},{key:"callErrorHandler",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((function(t){return t.apply(void 0,e)}))}},{key:"canLogInfo",value:function(){return this._level>=Jt.Info}},{key:"canLogDebug",value:function(){return this._level>=Jt.Debug}},{key:"canLogError",value:function(){return this._level>=Jt.Error}},{key:"canLogWarn",value:function(){return this._level>=Jt.Warn}},{key:"level",value:function(t){return arguments.length?(this._level=+t,this):this._level}},{key:"error",value:function(){for(var t,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=Jt.Error&&(this._onErrorHandler.length?this.callErrorHandler.apply(this,i):Qt(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=Jt.Warn&&Qt(this._method||"warn","WARN",e),this}},{key:"info",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=Jt.Info&&Qt(this._method||"log","INFO",e),this}},{key:"debug",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=Jt.Debug&&Qt(this._method||"log","DEBUG",e),this}}],[{key:"getInstance",value:function(e,i){return t._instance&&wt(e)?t._instance.level(e):t._instance||(t._instance=new t(e,i)),t._instance}},{key:"setInstance",value:function(e){return t._instance=e}},{key:"setInstanceLevel",value:function(e){t._instance?t._instance.level(e):t._instance=new t(e)}},{key:"clearInstance",value:function(){t._instance=null}}])}();function ee(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;for(vt(n)&&(n=t.length);i<n;){var r=i+n>>>1;qt(t[r],e)>0?n=r:i=r+1}return i}te._instance=null;var ie=1e-10,ne=1e-10;function re(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ie,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:ne)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}function ae(t,e,i,n){return t>e&&!re(t,e,i,n)}function oe(t,e,i,n){return t<e&&!re(t,e,i,n)}var se=function(t){var e=null,i=null;return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e&&r.every((function(t,i){return t===e[i]}))||(e=r,i=t.apply(void 0,r)),i}},ue=function(t,e,i){return t<e?e:t>i?i:t};function le(t,e){var i;return t>e&&(i=t,t=e,e=i),function(i){return Math.max(t,Math.min(e,i))}}var he=!1;try{he="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){he=!1}function ce(t,e,i){var n,r,a,o,s,u,l=0,h=!1,c=!1,d=!0,f=!e&&0!==e&&he;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var i=n,a=r;return n=r=void 0,l=e,o=t.apply(a,i)}function p(t,e){return f?(cancelAnimationFrame(s),requestAnimationFrame(t)):setTimeout(t,e)}function g(t){var i=t-u;return void 0===u||i>=e||i<0||c&&t-l>=a}function y(){var t=Date.now();if(g(t))return m(t);s=p(y,function(t){var i=t-l,n=e-(t-u);return c?Math.min(n,a-i):n}(t))}function m(t){return s=void 0,d&&n?v(t):(n=r=void 0,o)}function k(){for(var t=Date.now(),i=g(t),a=arguments.length,d=new Array(a),f=0;f<a;f++)d[f]=arguments[f];if(n=d,r=this,u=t,i){if(void 0===s)return function(t){return l=t,s=p(y,e),h?v(t):o}(u);if(c)return s=p(y,e),v(u)}return void 0===s&&(s=p(y,e)),o}return e=+e||0,gt(i)&&(h=!!i.leading,(c="maxWait"in i)&&(a=Math.max(At(i.maxWait)?i.maxWait:0,e)),d="trailing"in i?!!i.trailing:d),k.cancel=function(){void 0!==s&&function(t){if(f)return cancelAnimationFrame(t);clearTimeout(t)}(s),l=0,n=u=r=s=void 0},k.flush=function(){return void 0===s?o:m(Date.now())},k.pending=function(){return void 0!==s},k}function de(t,e){return function(i){return t*(1-i)+e*i}}function fe(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}he=!1;var ve=1e-12,pe=Math.PI,ge=pe/2,ye=2*pe,me=2*Math.PI,ke=Math.abs,_e=Math.atan2,be=Math.cos,xe=Math.max,Se=Math.min,we=Math.sin,Ae=Math.sqrt,Te=Math.pow;function Ce(t){return t>=1?ge:t<=-1?-ge:Math.asin(t)}function Ee(t,e,i,n,r){var a=i,o=n;return"number"==typeof t&&"number"==typeof i&&(a=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:a,y:o}}var Be=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;o(this,t),this.x=0,this.y=0,this.x=e,this.y=i,this.x1=n,this.y1=r}return u(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return wt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return wt(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}])}(),Re=function(){return u((function t(){o(this,t)}),null,[{key:"distancePP",value:function(t,e){return Ae(Te(t.x-e.x,2)+Te(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return Ae(Te(t-i,2)+Te(e-n,2))}},{key:"distancePN",value:function(t,e,i){return Ae(Te(e-t.x,2)+Te(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new Be((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}])}();function Me(t,e,i){var n=e.x1,r=e.y1,a=e.x2,o=e.y2;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*a+i.c*r+i.e,i.b*a+i.d*r+i.f),t.add(i.a*a+i.c*o+i.e,i.b*a+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}var Pe=function(){function t(e){o(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return u(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return bt(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return Me(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,i){var n=this.x1,r=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),u=Math.sin(t),l=e-e*s+i*u,h=i-e*u-i*s;return[s*n-u*r+l,u*n+s*r+h,s*n-u*o+l,u*n+s*o+h,s*a-u*r+l,u*a+s*r+h,s*a-u*o+l,u*a+s*o+h]}},{key:"scalePoints",value:function(t,e,i,n){return[t*this.x1+(1-t)*i,e*this.y1+(1-e)*n,t*this.x2+(1-t)*i,e*this.y2+(1-e)*n]}}])}(),Oe=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i)}(Pe);function Ie(t){return t*(Math.PI/180)}var Le=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-ye;)t+=ye;else if(t>0)for(;t>ye;)t-=ye;return t},De=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;o(this,t),this.a=e,this.b=i,this.c=n,this.d=r,this.e=a,this.f=s}return u(t,[{key:"equalToMatrix",value:function(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}},{key:"equalTo",value:function(t,e,i,n,r,a){return!(this.e!==r||this.f!==a||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}},{key:"setValue",value:function(t,e,i,n,r,a){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=a,this}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,i=this.b,n=this.c,r=this.d,a=this.e,o=this.f,s=new t,u=e*r-i*n;return s.a=r/u,s.b=-i/u,s.c=-n/u,s.d=e/u,s.e=(n*o-r*a)/u,s.f=-(e*o-i*a)/u,s}},{key:"rotate",value:function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,a=this.a*-i+this.c*e,o=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=a,this.d=o,this}},{key:"rotateByCenter",value:function(t,e,i){var n=Math.cos(t),r=Math.sin(t),a=(1-n)*e+r*i,o=(1-n)*i-r*e,s=n*this.a-r*this.b,u=r*this.a+n*this.b,l=n*this.c-r*this.d,h=r*this.c+n*this.d,c=n*this.e-r*this.f+a,d=r*this.e+n*this.f+o;return this.a=s,this.b=u,this.c=l,this.d=h,this.e=c,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,i,n,r,a){return this.multiply(t,e,i,n,r,a),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,a=this.f;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=a,this.f=r,this}},{key:"multiply",value:function(t,e,i,n,r,a){var o=this.a,s=this.b,u=this.c,l=this.d,h=o*t+u*e,c=s*t+l*e,d=o*i+u*n,f=s*i+l*n,v=o*r+u*a+this.e,p=s*r+l*a+this.f;return this.a=h,this.b=c,this.c=d,this.d=f,this.e=v,this.f=p,this}},{key:"interpolate",value:function(e,i){var n=new t;return n.a=this.a+(e.a-this.a)*i,n.b=this.b+(e.b-this.b)*i,n.c=this.c+(e.c-this.c)*i,n.d=this.d+(e.d-this.d)*i,n.e=this.e+(e.e-this.e)*i,n.f=this.f+(e.f-this.f)*i,n}},{key:"transformPoint",value:function(t,e){var i=this.a,n=this.b,r=this.c,a=this.d,o=this.e,s=this.f,u=i*a-n*r,l=a/u,h=-n/u,c=-r/u,d=i/u,f=(r*s-a*o)/u,v=-(i*s-n*o)/u,p=t.x,g=t.y;e.x=p*l+g*c+f,e.y=p*h+g*d+v}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,a={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){var o=Math.sqrt(t*t+e*e);a.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),a.scaleX=o,a.scaleY=r/o,a.skewX=(t*i+e*n)/r,a.skewY=0}else if(0!==i||0!==n){var s=Math.sqrt(i*i+n*n);a.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/s):-Math.acos(i/s)),a.scaleX=r/s,a.scaleY=s,a.skewX=0,a.skewY=(t*i+e*n)/r}return a.rotateDeg=180*a.rotateDeg/Math.PI,a}}])}();var Fe=function(){return u((function t(){o(this,t),this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}),[{key:"clearCache",value:function(t,e){var i=e.CLEAN_THRESHOLD,n=void 0===i?this.CLEAN_THRESHOLD:i,r=e.L_TIME,a=void 0===r?this.L_TIME:r,o=e.R_COUNT,s=void 0===o?this.R_COUNT:o;if(t.size<n)return 0;var u=0,l=function(e){u++,t.delete(e)},h=Date.now();return t.forEach((function(t,e){if(t.timestamp.length<s)return l(e);for(var i=0;h-t.timestamp[t.timestamp.length-1-i]<a&&!(++i>=s););if(i<s)return l(e);for(;h-t.timestamp[0]>a;)t.timestamp.shift()})),u}},{key:"addLimitedTimestamp",value:function(t,e,i){var n=i.R_TIMESTAMP_MAX_SIZE,r=void 0===n?this.R_TIMESTAMP_MAX_SIZE:n;t.timestamp.length>r&&t.timestamp.shift(),t.timestamp.push(e)}},{key:"clearTimeStamp",value:function(t,e){var i=e.L_TIME,n=void 0===i?this.L_TIME:i,r=Date.now();t.forEach((function(t){for(;r-t.timestamp[0]>n;)t.timestamp.shift()}))}},{key:"clearItemTimestamp",value:function(t,e){for(var i=e.L_TIME,n=void 0===i?this.L_TIME:i,r=Date.now();r-t.timestamp[0]>n;)t.timestamp.shift()}}])}();function je(t,e,i){e/=100,i/=100;var n=(1-Math.abs(2*i-1))*e,r=n*(1-Math.abs(t/60%2-1)),a=i-n/2,o=0,s=0,u=0;return 0<=t&&t<60?(o=n,s=r,u=0):60<=t&&t<120?(o=r,s=n,u=0):120<=t&&t<180?(o=0,s=n,u=r):180<=t&&t<240?(o=0,s=r,u=n):240<=t&&t<300?(o=r,s=0,u=n):300<=t&&t<360&&(o=n,s=0,u=r),{r:o=Math.round(255*(o+a)),g:s=Math.round(255*(s+a)),b:u=Math.round(255*(u+a))}}function Ne(t,e,i){t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),a=r-n,o=0,s=0;return o=0===a?0:r===t?(e-i)/a%6:r===e?(i-t)/a+2:(t-e)/a+4,(o=Math.round(60*o))<0&&(o+=360),s=(r+n)/2,{h:o,s:+(100*(0===a?0:a/(1-Math.abs(2*s-1)))).toFixed(1),l:s=+(100*s).toFixed(1)}}var ze=/^#([0-9a-f]{3,8})$/,Ue={transparent:4294967040},Ge={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function We(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ve(t){return wt(t)?new Ze(t>>16,t>>8&255,255&t,1):bt(t)?new Ze(t[0],t[1],t[2]):new Ze(255,255,255)}function He(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ke(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var Xe,Ye=function(t,e){var i=ze.exec(t);if(e||i){var n=parseInt(i[1],16),r=i[1].length;return 3===r?new Ze((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):6===r?Ve(n):8===r?new Ze(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):null}},qe=function(){function t(e){o(this,t);var i=t.parseColorString(e);i?this.color=i:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new Ze(255,255,255))}return u(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"brighter",value:function(t){var e=this.color,i=e.r,n=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t))),this}},{key:"add",value:function(t){var e=this.color,i=e.r,n=e.g,r=e.b;return this.color.r+=Math.min(255,i+t.color.r),this.color.g+=Math.min(255,n+t.color.g),this.color.b+=Math.min(255,r+t.color.b),this}},{key:"sub",value:function(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}},{key:"multiply",value:function(t){var e=this.color,i=e.r,n=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(i*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t.color.b))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}},{key:"setHsl",value:function(t,e,i){var n=this.color.opacity,r=Ne(this.color.r,this.color.g,this.color.b),a=je(vt(t)?r.h:ue(t,0,360),vt(e)?r.s:e>=0&&e<=1?100*e:e,vt(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new Ze(a.r,a.g,a.b,n),this}},{key:"setRGB",value:function(t,e,i){return!vt(t)&&(this.color.r=t),!vt(e)&&(this.color.g=e),!vt(i)&&(this.color.b=i),this}},{key:"setHex",value:function(t){var e="".concat(t).trim().toLowerCase(),i=Ye(e,!0);return null!=i?i:this}},{key:"setColorName",value:function(t){var e=Ge[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"setScalar",value:function(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}},{key:"clone",value:function(){return new t(this.color.toString())}},{key:"copyGammaToLinear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}},{key:"copyLinearToGamma",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}},{key:"convertGammaToLinear",value:function(t){return this.copyGammaToLinear(this,t),this}},{key:"convertLinearToGamma",value:function(t){return this.copyLinearToGamma(this,t),this}},{key:"copySRGBToLinear",value:function(t){return this.color.r=He(t.color.r),this.color.g=He(t.color.g),this.color.b=He(t.color.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.color.r=Ke(t.color.r),this.color.g=Ke(t.color.g),this.color.b=Ke(t.color.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}}],[{key:"Brighter",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===i?e:new t(e).brighter(i).toRGBA()}},{key:"SetOpacity",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===i?e:new t(e).setOpacity(i).toRGBA()}},{key:"getColorBrightness",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",n=e instanceof t?e:new t(e);switch(i){case"hsv":default:return n.getHSVBrightness();case"hsl":return n.getHSLBrightness();case"lum":return n.getLuminance();case"lum2":return n.getLuminance2();case"lum3":return n.getLuminance3()}}},{key:"parseColorString",value:function(t){if(pt(Ue[t]))return function(t){return wt(t)?new Ze(t>>>24,t>>>16&255,t>>>8&255,255&t):bt(t)?new Ze(t[0],t[1],t[2],t[3]):new Ze(255,255,255,1)}(Ue[t]);if(pt(Ge[t]))return Ve(Ge[t]);var e="".concat(t).trim().toLowerCase(),i=Ye(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var n=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Ze(parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10),parseFloat(n[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var r=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),a=je(parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10));return new Ze(a.r,a.g,a.b,parseFloat(r[3]))}}}])}(),Ze=function(){return u((function t(e,i,n,r){o(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),pt(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}),[{key:"formatHex",value:function(){return"#".concat(We(this.r)+We(this.g)+We(this.b)+(1===this.opacity?"":We(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=Ne(this.r,this.g,this.b),i=e.h,n=e.s,r=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(i,",").concat(n,"%,").concat(r,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}])}();!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Xe||(Xe={}));var Je=function(t,e,i){var n,r,a,o,s=t.x1,u=t.x2,l=t.y1,h=t.y2,c=e.x1,d=e.x2,f=e.y1,v=e.y2;return i&&(s>u&&(s=(n=[u,s])[0],u=n[1]),l>h&&(l=(r=[h,l])[0],h=r[1]),c>d&&(c=(a=[d,c])[0],d=a[1]),f>v&&(f=(o=[v,f])[0],v=o[1])),{x11:s,x12:u,y11:l,y12:h,x21:c,x22:d,y21:f,y22:v}};function $e(t,e,i){if(t&&e){if(!i)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);var n=Je(t,e,!0),r=n.x11,a=n.x12,o=n.y11,s=n.y12,u=n.x21,l=n.x22,h=n.y21,c=n.y22;return!(r>l||a<u||o>c||s<h)}return!0}var Qe=function(t){var e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(n=(e&=1023)<<10|(i&=1023),n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function ti(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);var n=t.fontStyle,r=void 0===n?e.fontStyle:n,a=t.fontVariant,o=void 0===a?e.fontVariant:a,s=t.fontWeight,u=void 0===s?e.fontWeight:s,l=t.fontSize,h=void 0===l?e.fontSize:l,c=t.fontFamily;return(r?r+" ":"")+(o?o+" ":"")+(u?u+" ":"")+h*i+"px "+((void 0===c?e.fontFamily:c)||"sans-serif")}var ei=function(){function t(e,i){o(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=i?i:{},this.textSpec=this._initSpec(),pt(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=pt(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return u(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(vt(this._canvas)&&(pt(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),vt(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&pt(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),vt(this._context)&&pt(this._canvas)){var t=this._canvas.getContext("2d");pt(t)&&(t.save(),t.font=ti(this.textSpec),this._contextSaved=!0,this._context=t)}return!vt(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,i,n=this._option.defaultFontParams,r=void 0===n?{}:n,a=this._userSpec,o=a.fontStyle,s=void 0===o?r.fontStyle:o,u=a.fontVariant,l=void 0===u?r.fontVariant:u,h=a.fontWeight,c=void 0===h?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":h,d=a.fontSize,f=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,v=a.fontFamily,p=void 0===v?null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif":v,g=a.align,y=a.textAlign,m=void 0===y?null!=g?g:"center":y,k=a.baseline,_=a.textBaseline,b=void 0===_?null!=k?k:"middle":_,x=a.ellipsis,S=a.limit,w=this._userSpec.lineHeight,A=void 0===w?f:w;if(_t(A)&&"%"===A[A.length-1]){var T=Number.parseFloat(A.substring(0,A.length-1))/100;A=f*T}return{fontStyle:s,fontVariant:l,fontFamily:p,fontSize:f,fontWeight:c,textAlign:m,textBaseline:b,ellipsis:x,limit:S,lineHeight:A}}},{key:"measure",value:function(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}},{key:"fullMeasure",value:function(t){if(vt(t))return{width:0,height:0};if(vt(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,a=i.fontWeight,o=i.textAlign,s=i.textBaseline,u=i.ellipsis,l=i.limit,h=i.lineHeight;try{var c=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:a,textAlign:o,textBaseline:s,ellipsis:!!u,maxLineWidth:l||1/0,lineHeight:h});e={width:c.width(),height:c.height()}}catch(i){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var i=this._context.measureText(t),n=this.textSpec,r=n.fontSize,a=n.lineHeight;return{width:i.width,height:null!==(e=a)&&void 0!==e?e:r}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var i={width:0,height:0},n=0;n<e.length;n++){var r=e[n],a=this._measureSpecialChar(r);vt(a)&&t.NUMBERS_CHAR_SET.includes(r)&&(a=this._measureNumberChar()),vt(a)&&["F","W"].includes(Qe(r))&&(a=this._measureFullSizeChar()),vt(a)&&(a=this._measureLetterChar()),i.width+=a.width,i.height=Math.max(i.height,a.height)}return i}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e,i={width:0,height:0},n=this.textSpec,r=n.fontSize,a=n.lineHeight,o=0;o<t.length;o++){var s=t[o],u=["F","W"].includes(Qe(s))?1:.53;i.width+=u*r}return i.height=null!==(e=a)&&void 0!==e?e:r,i}},{key:"_measureReduce",value:function(t,e){var i,n=this.textSpec,r=n.fontSize,a=n.lineHeight,o={width:0,height:0};if(vt(t))return o;if(bt(t)){var s=t.filter(pt).map((function(t){return t.toString()}));return 0===s.length?o:1===s.length?e(s[0]):{width:s.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:s.length*((null!==(i=a)&&void 0!==i?i:r)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(vt(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return vt(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(vt(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return pt(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){pt(this._canvas)&&(this._canvas=null),pt(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}])}();ei.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ei.NUMBERS_CHAR_SET="0123456789",ei.FULL_SIZE_CHAR="字";function ii(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t)return{width:i,height:n};try{e=null===window||void 0===window?void 0:window.getComputedStyle}catch(t){e=function(){return{}}}var r=e(t);if(/^(\d*\.?\d+)(px)$/.exec(r.width)){var a=parseFloat(r.width)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)||t.clientWidth-1,o=parseFloat(r.height)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)||t.clientHeight-1;return{width:a<=0?i:a,height:o<=0?n:o}}return{width:i,height:n}}var ni,ri,ai,oi,si,ui,li,hi,ci,di,fi,vi,pi,gi,yi,mi=function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()},ki=ye-1e-8,_i=function(){return u((function t(e){o(this,t),this.init(e)}),[{key:"init",value:function(t){this.bounds=t}},{key:"arc",value:function(t,e,i,n,r,a){if(Math.abs(r-n)>ki)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);var o,s,u,l,h=1/0,c=-1/0,d=1/0,f=-1/0;function v(t){u=i*Math.cos(t),l=i*Math.sin(t),u<h&&(h=u),u>c&&(c=u),l<d&&(d=l),l>f&&(f=l)}if(v(n),v(r),r!==n)if((n%=ye)<0&&(n+=ye),(r%=ye)<0&&(r+=ye),r<n&&(a=!a,o=n,n=r,r=o),a)for(r-=ye,o=n-n%ge,s=0;s<4&&o>r;++s,o-=ge)v(o);else for(o=n-n%ge+ge,s=0;s<4&&o<r;++s,o+=ge)v(o);this.bounds.add(t+h,e+d),this.bounds.add(t+c,e+f)}},{key:"arcTo",value:function(t,e,i,n,r){throw new Error("不支持arcTo")}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,a)}},{key:"closePath",value:function(){}},{key:"ellipse",value:function(){throw new Error("不支持ellipse")}},{key:"lineTo",value:function(t,e){this.bounds.add(t,e)}},{key:"moveTo",value:function(t,e){this.bounds.add(t,e)}},{key:"quadraticCurveTo",value:function(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}},{key:"rect",value:function(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}},{key:"clear",value:function(){this.bounds.clear()}},{key:"release",value:function(){}}])}(),bi=function(){return u((function t(){o(this,t),this.curves=[],this.bounds=new Oe}),[{key:"getCurveLengths",value:function(){return this.curves.map((function(t){return t.getLength()}))}},{key:"getPointAt",value:function(t){return{x:0,y:0}}},{key:"getLength",value:function(){return 0}},{key:"getBounds",value:function(){return this.bounds}}])}(),xi=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Si={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},wi=0,Ai=1,Ti=2,Ci=3,Ei=4,Bi=5,Ri=6,Mi=7,Pi=8;function Oi(t,e,i,n){for(var r,a,o,s,u,l,h,c,d,f,v,p,g,y,m,k,_,b,x,S,w,A,T,C,E,B,R=function(t,e,i,n,r,a,o,s,u){var l=Ie(o),h=Math.sin(l),c=Math.cos(l),d=c*(s-t)*.5+h*(u-e)*.5,f=c*(u-e)*.5-h*(s-t)*.5,v=d*d/((i=Math.abs(i))*i)+f*f/((n=Math.abs(n))*n);v>1&&(i*=v=Math.sqrt(v),n*=v);var p=c/i,g=h/i,y=-h/n,m=c/n,k=p*s+g*u,_=y*s+m*u,b=p*t+g*e,x=y*t+m*e,S=1/((b-k)*(b-k)+(x-_)*(x-_))-.25;S<0&&(S=0);var w=Math.sqrt(S);a===r&&(w=-w);var A=.5*(k+b)-w*(x-_),T=.5*(_+x)+w*(b-k),C=Math.atan2(_-T,k-A),E=Math.atan2(x-T,b-A)-C;E<0&&1===a?E+=ye:E>0&&0===a&&(E-=ye);for(var B=Math.ceil(Math.abs(E/(ge+.001))),R=[],M=0;M<B;++M){var P=C+M*E/B,O=C+(M+1)*E/B;R[M]=[A,T,P,O,i,n,h,c]}return R}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i),M=0;M<R.length;++M){var P=(r=R[M],a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,h=void 0,c=void 0,d=void 0,f=void 0,v=void 0,p=void 0,g=void 0,y=void 0,m=void 0,k=void 0,_=void 0,b=void 0,x=void 0,S=void 0,w=void 0,A=void 0,T=void 0,C=void 0,E=void 0,B=void 0,a=r[0],o=r[1],s=r[2],u=r[3],l=r[4],h=r[5],c=r[6],d=r[7],f=d*l,v=-c*h,p=c*l,g=d*h,y=Math.cos(s),m=Math.sin(s),k=Math.cos(u),_=Math.sin(u),b=.5*(u-s),x=Math.sin(.5*b),S=8/3*x*x/Math.sin(b),[f*(w=a+y-S*m)+v*(A=o+m+S*y),p*w+g*A,f*(E=(T=a+k)+S*_)+v*(B=(C=o+_)-S*k),p*E+g*B,f*T+v*C,p*T+g*C]);t.bezierCurveTo(P[0],P[1],P[2],P[3],P[4],P[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(li||(li={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(hi||(hi={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(ci||(ci={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(di||(di={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(fi||(fi={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(vi||(vi={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(pi||(pi={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(gi||(gi={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(yi||(yi={}));var Ii=[function(t,e,i,n,r,a,o){return e.arc(t[1]*r+i,t[2]*a+n,t[3]*(r+a)/2,t[4],t[5],t[6],o)},function(t,e,i,n,r,a,o){return e.arcTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,t[5]*(r+a)/2,o)},function(t,e,i,n,r,a,o){return e.bezierCurveTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,t[5]*r+i,t[6]*a+n,o)},function(t,e,i,n){return e.closePath()},function(t,e,i,n,r,a){return e.ellipse(t[1]*r+i,t[2]*a+n,t[3]*r,t[4]*a,t[5],t[6],t[7],t[8])},function(t,e,i,n,r,a,o){return e.lineTo(t[1]*r+i,t[2]*a+n,o)},function(t,e,i,n,r,a,o){return e.moveTo(t[1]*r+i,t[2]*a+n,o)},function(t,e,i,n,r,a,o){return e.quadraticCurveTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,o)},function(t,e,i,n,r,a,o){return e.rect(t[1]*r+i,t[2]*a+n,t[3]*r,t[4]*a,o)}];function Li(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0,s=0;s<t.length;s++){var u=t[s];Ii[u[0]](u,e,i,n,r,a,o)}}var Di=function(){return u((function t(){o(this,t)}),[{key:"getLength",value:function(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}])}();function Fi(t,e,i,n,r){return function(t,e){for(var i=0,n=t.length,r=0;r<n;r++){var a=t[r],o=e[r],s=t[(r+1)%n],u=e[(r+1)%n];i+=Re.distanceNN(a,o,s,u)}return i/2}([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function ji(t,e,i,n,r){var a=1-r;return a*a*a*t+3*e*r*a*a+3*i*r*r*a+n*r*r*r}function Ni(t,e,i,n,r){var a=ji(t.x,e.x,i.x,n.x,r),o=ji(t.y,e.y,i.y,n.y,r);return new Be(a,o)}function zi(t,e){var i=t.p0,n=t.p1,r=t.p2,a=t.p3,o=Ni(i,n,r,a,e),s=Re.pointAtPP(i,n,e),u=Re.pointAtPP(n,r,e),l=Re.pointAtPP(r,a,e),h=Re.pointAtPP(s,u,e),c=Re.pointAtPP(u,l,e);return[new Ui(i,s,h,o),new Ui(o,c,l,a)]}var Ui=function(t){function i(t,n,r,a){var s;return o(this,i),(s=e(this,i)).type=gi.CubicBezierCurve,s.p0=t,s.p1=n,s.p2=r,s.p3=a,s}return h(i,t),u(i,[{key:"_validPoint",value:function(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}},{key:"getPointAt",value:function(t){if(!1!==this.defined)return Ni(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}},{key:"calcLength",value:function(){return this._validPoint()?Fi(this.p0,this.p1,this.p2,this.p3):60}},{key:"calcProjLength",value:function(t){return t===pi.ROW?ke(this.p0.x-this.p3.x):t===pi.COLUMN?ke(this.p0.y-this.p3.y):0}},{key:"getAngleAt",value:function(t){var e=xe(t-.01,0),i=Se(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return _e(r.y-n.y,r.x-n.x)}}])}(Di);function Gi(t,e){var i=t.p0,n=t.p1,r=Re.pointAtPP(i,n,e);return[new Wi(i,r),new Wi(r,n)]}var Wi=function(t){function i(t,n){var r;return o(this,i),(r=e(this,i)).type=gi.LineCurve,r.p0=t,r.p1=n,r}return h(i,t),u(i,[{key:"getPointAt",value:function(t){if(!1!==this.defined)return Re.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}},{key:"getAngleAt",value:function(t){return null==this.angle&&(this.angle=_e(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}},{key:"_validPoint",value:function(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}},{key:"calcLength",value:function(){return this._validPoint()?Re.distancePP(this.p0,this.p1):60}},{key:"calcProjLength",value:function(t){return t===pi.ROW?ke(this.p0.x-this.p1.x):t===pi.COLUMN?ke(this.p0.y-this.p1.y):0}}])}(Di),Vi=function(){return u((function t(e,i){o(this,t),this.init(e,i)}),[{key:"endX",get:function(){return this._lastX}},{key:"endY",get:function(){return this._lastY}},{key:"init",value:function(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a,o,s){var u=new Ui(new Be(this._lastX,this._lastY),new Be(t,e),new Be(i,n),new Be(r,a));u.originP1=this._lastOriginP,u.originP2=s,u.defined=o,this.curves.push(u),this._lastX=r,this._lastY=a,this._lastOriginP=s}},{key:"closePath",value:function(){if(!(this.curves.length<2)){var t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}}},{key:"ellipse",value:function(){throw new Error("SegContext不支持调用ellipse")}},{key:"lineTo",value:function(t,e,i,n){var r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}},{key:"moveTo",value:function(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}},{key:"quadraticCurveTo",value:function(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}},{key:"clear",value:function(){this.curves=[],this.length=NaN}},{key:"tryUpdateLength",value:function(t){return this.getLength(t)}},{key:"addLinearCurve",value:function(t,e,i,n,r){var a=new Wi(new Be(this._lastX,this._lastY),new Be(t,e));return a.originP1=n,a.originP2=r,a.defined=i,a}},{key:"getPointAt",value:function(t){throw new Error("暂未实现")}},{key:"getCurveLengths",value:function(){return[]}},{key:"getLength",value:function(t){var e,i;if(t===pi.COLUMN){if(!this.curves.length)return 0;var n=this.curves[0],r=this.curves[this.curves.length-1],a=null!==(e=r.p3)&&void 0!==e?e:r.p1;return ke(n.p0.y-a.y)}if(t===pi.ROW){if(!this.curves.length)return 0;var o=this.curves[0],s=this.curves[this.curves.length-1],u=null!==(i=s.p3)&&void 0!==i?i:s.p1;return ke(o.p0.x-u.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((function(t,e){return t+e.getLength()}),0)),this.length}}])}(),Hi=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"bezierCurveTo",value:function(t,e,n,r,a,o,s,u){return p(c(i.prototype),"bezierCurveTo",this).call(this,e,t,r,n,o,a,s,u)}},{key:"lineTo",value:function(t,e,n,r){return p(c(i.prototype),"lineTo",this).call(this,e,t,n,r)}},{key:"moveTo",value:function(t,e,n){return p(c(i.prototype),"moveTo",this).call(this,e,t,n)}},{key:"clear",value:function(){return p(c(i.prototype),"clear",this).call(this)}}])}(Vi);function Ki(t,e){for(var i=!1,n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function Xi(t,e,i){var n=null!=e?e:ke(i[i.length-1].x-i[0].x)>ke(i[i.length-1].y-i[0].y)?pi.ROW:pi.COLUMN;return"monotoneY"===t?new Hi(t,n):new Vi(t,n)}var Yi=function(){return u((function t(e,i){o(this,t),this.context=e,i&&(this.startPoint=i)}),[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function qi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;var r=Xi("linear",i,t);return function(t,e){Ki(t,e)}(new Yi(r,n),t),r}function Zi(t,e,i,n,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}var Ji=function(){return u((function t(e,i){o(this,t),this.context=e,this.startPoint=i}),[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){2===this._point&&Zi(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:Zi(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function $i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return qi(t,e);var r=Xi("basis",i,t);return function(t,e){Ki(t,e)}(new Ji(r,n),t),r}function Qi(t){return t<0?-1:1}function tn(t,e,i){var n=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(n||Number(r<0&&-0)),o=(i-t._y1)/(r||Number(n<0&&-0)),s=(a*r+o*n)/(n+r);return(Qi(a)+Qi(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function en(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function nn(t,e,i,n,r){var a=t._x0,o=t._y0,s=t._x1,u=t._y1,l=(s-a)/3;t.context.bezierCurveTo(a+l,o+l*e,s-l,u-l*i,s,u,n,t.lastPoint1)}var rn=function(){return u((function t(e,i){o(this,t),this.context=e,this.startPoint=i}),[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:nn(this,this._t0,en(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=NaN,i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,nn(this,en(this,e=tn(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:nn(this,this._t0,e=tn(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}(),an=function(t){function i(t,n){return o(this,i),e(this,i,[t,n])}return h(i,t),u(i,[{key:"point",value:function(t){return p(c(i.prototype),"point",this).call(this,{y:t.x,x:t.y,defined:t.defined})}}])}(rn);function on(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return qi(t,e);var r=Xi("monotoneX",i,t);return function(t,e){Ki(t,e)}(new rn(r,n),t),r}function sn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return qi(t,e);var r=Xi("monotoneY",i,t);return function(t,e){Ki(t,e)}(new an(r,n),t),r}var un=function(){return u((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;o(this,t),this.context=e,this._t=i,this.startPoint=n}),[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{var n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function ln(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;var a=new Vi("step",null!=n?n:ke(t[t.length-1].x-t[0].x)>ke(t[t.length-1].y-t[0].y)?pi.ROW:pi.COLUMN);return function(t,e){Ki(t,e)}(new un(a,e,r),t),a}var hn=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"lineEnd",value:function(){this.context.closePath()}}])}(Yi);function cn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;var r=Xi("linear",i,t);return function(t,e){Ki(t,e)}(new hn(r,n),t),r}function dn(t,e,i,n,r){var a=t._x1,o=t._y1,s=t._x2,u=t._y2;if(t._l01_a>ve){var l=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,h=3*t._l01_a*(t._l01_a+t._l12_a);a=(a*l-t._x0*t._l12_2a+t._x2*t._l01_2a)/h,o=(o*l-t._y0*t._l12_2a+t._y2*t._l01_2a)/h}if(t._l23_a>ve){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,d=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*c+t._x1*t._l23_2a-e*t._l12_2a)/d,u=(u*c+t._y1*t._l23_2a-i*t._l12_2a)/d}t.context.bezierCurveTo(a,o,s,u,t._x2,t._y2,n,t.lastPoint1)}var fn=function(){return u((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;o(this,t),this.context=e,this.startPoint=n,this._alpha=i}),[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}},{key:"lineEnd",value:function(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,i=t.y;if(this._point){var n=this._x2-e,r=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:dn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function vn(t,e){return function(i,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r.direction,o=r.startPoint;if(i.length<2-Number(!!o))return null;if(i.length<3-Number(!!o))return qi(i,r);var s=Xi(t,a,i);return Ki(new e(s,n,o),i),s}}var pn=vn("catmullRom",fn),gn=function(){return u((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;o(this,t),this.context=e,this.startPoint=n,this._alpha=i}),[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}},{key:"lineEnd",value:function(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}},{key:"point",value:function(t){var e=t.x,i=t.y;if(this._point){var n=this._x2-e,r=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:dn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}(),yn=vn("catmullRomClosed",gn);function mn(t,e,i){var n,r;switch(e){case"linear":default:return qi(t,i);case"basis":return $i(t,i);case"monotoneX":return on(t,i);case"monotoneY":return sn(t,i);case"step":return ln(t,.5,i);case"stepBefore":return ln(t,0,i);case"stepAfter":return ln(t,1,i);case"catmullRom":return pn(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return yn(t,null!==(r=null==i?void 0:i.curveTension)&&void 0!==r?r:.5,i);case"linearClosed":return cn(t,i)}}var kn=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).commandList=[],t&&(n._ctx=t),n._boundsContext=new _i(n.bounds),n}return h(i,t),u(i,[{key:"setCtx",value:function(t){this._ctx=t}},{key:"moveTo",value:function(t,e){return this.commandList.push([Ri,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.commandList.push([Bi,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,i,n){return this.commandList.push([Mi,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a){return this.commandList.push([Ti,t,e,i,n,r,a]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,a),this}},{key:"arcTo",value:function(t,e,i,n,r){return this.commandList.push([Ai,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}},{key:"ellipse",value:function(t,e,i,n,r,a,o,s){return this.commandList.push([Ei,t,e,i,n,r,a,o,s]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,a,o,s),this}},{key:"rect",value:function(t,e,i,n){return this.commandList.push([Pi,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}},{key:"arc",value:function(t,e,i,n,r,a){return this.commandList.push([wi,t,e,i,n,r,a]),this._ctx&&this._ctx.arc(t,e,i,n,r,a),this}},{key:"closePath",value:function(){return this.commandList.push([Ci]),this._ctx&&this._ctx.closePath(),this}},{key:"addCurve",value:function(t){this.curves.push(t)}},{key:"clear",value:function(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}},{key:"beginPath",value:function(){this.clear()}},{key:"toString",value:function(){if(!this.toStringCbList){var t=[];t[Ri]=function(t){return"M".concat(t[1]," ").concat(t[2])},t[Bi]=function(t){return"L".concat(t[1]," ").concat(t[2])},t[Mi]=function(t){return"Q".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4])},t[Ti]=function(t){return"C".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4]," ").concat(t[5]," ").concat(t[6])},t[wi]=function(t){var e,i,n,r,a,o,s,u,l,h,c,d,f,v,p,g,y,m,k,_,b=[];e=b,i=t[4],n=t[5],r=t[1],a=t[2],o=t[3],s=t[3],u=Math.abs(n-i),l=4*Math.tan(u/4)/3,h=n<i?-1:1,c=Math.cos(i),d=Math.sin(i),f=Math.cos(n),v=Math.sin(n),p=c*o+r,g=d*s+a,y=f*o+r,m=v*s+a,k=o*l*h,_=s*l*h,e.push(p-k*d,g+_*c,y+k*v,m-_*f,y,m);for(var x="",S=0;S<b.length;S+=6)x+="C".concat(b[S]," ").concat(b[S+1]," ").concat(b[S+2]," ").concat(b[S+3]," ").concat(b[S+4]," ").concat(b[S+5]);return x},t[Pi]=function(t){return"M".concat(t[1]," ").concat(t[2]," h").concat(t[3]," v").concat(t[4]," H").concat(t[1],"Z")},t[Ci]=function(t){return"Z"},this.toStringCbList=t}var e=this.toStringCbList,i="";return this.commandList.forEach((function(t){i+=e[t[0]](t)})),i}},{key:"fromString",value:function(t,e,i,n,r){this.clear();var a=function(t){if(!t)return[];var e,i,n=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===n)return[];for(var r=[],a=0,o=n.length;a<o;a++)if(ni=n[a],ri=ni.slice(1),e=[ai=ni[0]],null!==(i=ri.match(xi))){for(var s=0,u=i.length;s<u;s++)oi=i[s],si=parseFloat(oi),Number.isNaN(si)||e.push(si);if(ui=Si[ai],e.length-1>ui)for(var l=void 0,h=1,c=e.length;h<c;h+=ui){l=[ai];for(var d=h,f=h+ui;d<f;d++)l.push(e[d]);r.push(l)}else r.push(e)}else r.push(e);return r}(t);return this._runCommandStrList(a,e,i,n,r),this._updateBounds(),this}},{key:"fromLine",value:function(t){var e=t.attribute,i=e.points,n=e.curveType,r=e.clipRangeByDimension;if(i){var a=mn(i,n);"x"===r?this.direction=pi.ROW:"y"===r?this.direction=pi.COLUMN:"auto"===r&&(this.direction=a.direction),this.curves=a.curves}}},{key:"fromCustomPath2D",value:function(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}},{key:"transform",value:function(t,e,i,n){var r=this,a=this.commandList;if(!this.transformCbList){var o=[];o[Ri]=this.moveToTransform,o[Bi]=this.lineToTransform,o[Mi]=this.quadraticCurveToTransform,o[Ti]=this.bezierCurveToTransform,o[Ai]=this.arcToTransform,o[Ei]=this.ellipseTransform,o[Pi]=this.rectTransform,o[wi]=this.arcTransform,o[Ci]=this.closePathTransform,this.transformCbList=o}a.forEach((function(a){r.transformCbList[a[0]](a,t,e,i,n)})),this._updateBounds()}},{key:"moveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}},{key:"lineToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}},{key:"quadraticCurveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}},{key:"bezierCurveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}},{key:"arcToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}},{key:"ellipseTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}},{key:"rectTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}},{key:"arcTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}},{key:"closePathTransform",value:function(){}},{key:"_runCommandStrList",value:function(t){for(var e,i,n,r,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,h=null,c=0,d=0,f=0,v=0,p=0,g=t.length;p<g;++p){switch(e=t[p],1===u&&1===l||(e=bn(e,u,l)),e[0]){case"l":c+=e[1],d+=e[2],this.lineTo(c+o,d+s);break;case"L":c=e[1],d=e[2],this.lineTo(c+o,d+s);break;case"h":c+=e[1],this.lineTo(c+o,d+s);break;case"H":c=e[1],this.lineTo(c+o,d+s);break;case"v":d+=e[1],this.lineTo(c+o,d+s);break;case"V":d=e[1],this.lineTo(c+o,d+s);break;case"m":c+=e[1],d+=e[2],this.moveTo(c+o,d+s);break;case"M":c=e[1],d=e[2],this.moveTo(c+o,d+s);break;case"c":i=c+e[5],n=d+e[6],f=c+e[3],v=d+e[4],this.bezierCurveTo(c+e[1]+o,d+e[2]+s,f+o,v+s,i+o,n+s),c=i,d=n;break;case"C":c=e[5],d=e[6],f=e[3],v=e[4],this.bezierCurveTo(e[1]+o,e[2]+s,f+o,v+s,c+o,d+s);break;case"s":i=c+e[3],n=d+e[4],f=2*c-f,v=2*d-v,this.bezierCurveTo(f+o,v+s,c+e[1]+o,d+e[2]+s,i+o,n+s),f=c+e[1],v=d+e[2],c=i,d=n;break;case"S":i=e[3],n=e[4],f=2*c-f,v=2*d-v,this.bezierCurveTo(f+o,v+s,e[1]+o,e[2]+s,i+o,n+s),c=i,d=n,f=e[1],v=e[2];break;case"q":i=c+e[3],n=d+e[4],f=c+e[1],v=d+e[2],this.quadraticCurveTo(f+o,v+s,i+o,n+s),c=i,d=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+o,e[2]+s,i+o,n+s),c=i,d=n,f=e[1],v=e[2];break;case"t":i=c+e[1],n=d+e[2],null===h[0].match(/[QqTt]/)?(f=c,v=d):"t"===h[0]?(f=2*c-r,v=2*d-a):"q"===h[0]&&(f=2*c-f,v=2*d-v),r=f,a=v,this.quadraticCurveTo(f+o,v+s,i+o,n+s),d=n,f=(c=i)+e[1],v=d+e[2];break;case"T":i=e[1],n=e[2],f=2*c-f,v=2*d-v,this.quadraticCurveTo(f+o,v+s,i+o,n+s),c=i,d=n;break;case"a":Oi(this,c+o,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+c+o,e[7]+d+s]),c+=e[6],d+=e[7];break;case"A":Oi(this,c+o,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+s]),c=e[6],d=e[7];break;case"z":case"Z":this.closePath()}h=e}}},{key:"_runCommandList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==r)for(var a=0,o=t.length;a<o;++a){var s=t[a].slice();switch(s[0]){case Bi:this.lineToTransform(s,e,i,n,r);break;case Ri:this.moveToTransform(s,e,i,n,r);break;case Ti:this.bezierCurveToTransform(s,e,i,n,r);break;case Mi:this.quadraticCurveToTransform(s,e,i,n,r);break;case wi:this.arcToTransform(s,e,i,n,r);break;case Ei:this.ellipseTransform(s,e,i,n,r);break;case Pi:this.rectTransform(s,e,i,n,r);break;case Ai:this.arcToTransform(s,e,i,n,r);break;case Ci:this.closePath()}}else this.commandList=t.map((function(t){return t.slice()}))}},{key:"_updateBounds",value:function(){this.bounds.clear(),Li(this.commandList,this._boundsContext)}},{key:"release",value:function(){this.commandList=[],this._boundsContext=null,this._ctx=null}},{key:"getLength",value:function(){if(this.direction===pi.COLUMN){if(!this.curves.length)return 0;var t=this.curves[0],e=this.curves[this.curves.length-1];return ke(t.p0.y-e.p1.y)}if(this.direction===pi.ROW){if(!this.curves.length)return 0;var i=this.curves[0],n=this.curves[this.curves.length-1];return ke(i.p0.x-n.p1.x)}return this.curves.reduce((function(t,e){return t+e.getLength()}),0)}},{key:"getAttrAt",value:function(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};for(var e,i=0,n=0;n<this.curves.length;n++){var r=(e=this.curves[n]).getLength(this.direction);if(i+r>=t)break;i+=r}var a=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(a),angle:e.getAngleAt(a)}}}])}(bi),_n=["l",0,0,0,0,0,0,0];function bn(t,e,i){var n=_n[0]=t[0];if("a"===n||"A"===n)_n[1]=e*t[1],_n[2]=i*t[2],_n[3]=t[3],_n[4]=t[4],_n[5]=t[5],_n[6]=e*t[6],_n[7]=i*t[7];else if("h"===n||"H"===n)_n[1]=e*t[1];else if("v"===n||"V"===n)_n[1]=i*t[1];else for(var r=1,a=t.length;r<a;++r)_n[r]=(r%2==1?e:i)*t[r];return _n}var xn={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new De},Sn={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},wn={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},An=Object.assign({outerBorder:Object.assign(Object.assign({},wn),{distance:0}),innerBorder:Object.assign(Object.assign({},wn),{distance:0})},wn),Tn={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},Cn=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},Sn),An),{alignSelf:"auto"}),{pickStrokeBuffer:0}),En={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Bn=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic"},{_debug_bounds:!1}),Cn),xn),Rn=Object.assign(Object.assign({},Bn),{startAngle:0,endAngle:me,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Mn=Object.assign(Object.assign(Object.assign({},Bn),En),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Pn=Object.assign(Object.assign({},Bn),{radius:1,startAngle:0,endAngle:me}),On=Object.assign(Object.assign({},Bn),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),In=Object.assign(Object.assign({},Bn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Ln=Object.assign(Object.assign(Object.assign({},Bn),En),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Dn=Object.assign(Object.assign({},Bn),{path:new kn,customPath:function(){te.getInstance().warn("空函数")}}),Fn=Object.assign(Object.assign({},Bn),{points:[],cornerRadius:0,closePath:!0}),jn=Object.assign(Object.assign({},Bn),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},Bn),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});var Nn=Object.assign(Object.assign({},Bn),{symbolType:"circle",size:10,keepDirIn3d:!0}),zn=Object.assign(Object.assign(Object.assign({},Bn),Tn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Un=Object.assign(Object.assign(Object.assign({},Bn),Tn),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Gn=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Bn),{fill:!0,cornerRadius:0}),Wn=Object.assign(Object.assign({},Gn),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1}),Vn=new(u((function t(){o(this,t)}))),Hn={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},Kn=!0,Xn=!1,Yn=/\w|\(|\)|-/,qn=/[.?!,;:/,。?!、;:]/,Zn=/\S/,Jn=function(t,e){var i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})};function $n(t,e,i,n,r){if(!e||e<=0)return 0;for(var a=Vn.graphicUtil.textMeasure,o=n,s=t.slice(0,o),u=Math.floor(a.measureText(s,i).width),l=t.slice(0,o+1),h=Math.floor(a.measureText(l,i).width);u>e||h<=e;){if(u>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}s=t.slice(0,o),u=Math.floor(a.measureText(s,i).width),l=t.slice(0,o+1),h=Math.floor(a.measureText(l,i).width)}return r&&(o=Qn(t,o)),o}function Qn(t,e){for(var i=e;Yn.test(t[i-1])&&Yn.test(t[i])||qn.test(t[i]);)if(--i<=0)return e;return i}function tr(t,e){var i=Vn.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}var er=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},ir=function(){return u((function t(){o(this,t)}),[{key:"configure",value:function(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}},{key:"measureTextWidth",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}},{key:"estimate",value:function(t,e){for(var i=e.fontSize,n=void 0===i?zn.fontSize:i,r=0,a=0,o=0;o<t.length;o++)t.charCodeAt(o)<128?r++:a++;return{width:~~(.8*r*n+a*n),height:n}}},{key:"measureTextPixelHeight",value:function(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Tn.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}},{key:"measureTextBoundHieght",value:function(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Tn.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}},{key:"measureText",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}},{key:"clipTextVertical",value:function(t,e,i,n){var r=this;if(0===t.length)return{verticalList:t,width:0};var a=e.fontSize,o=void 0===a?12:a;t.forEach((function(t){t.width=0===t.direction?o:r.measureTextWidth(t.text,e)}));for(var s=[],u=0,l=0;l<t.length&&u+t[l].width<i;l++)u+=t[l].width,s.push(t[l]);if(t[l]&&t[l].text.length>1){var h=this._clipText(t[l].text,e,i-u,0,t[l].text.length-1,"end",!1);if(n&&h.str!==t[l].text){for(var c="",d=0,f=0;f<l;f++){var v=t[f];c+=v.text,d+=v.text.length}var p=Qn(c+=t[l].text,d+h.str.length);(p-=d)!==h.str.length-1&&(h.str=h.str.substring(0,p),h.width=this.measureTextWidth(h.str,e))}s.push(Object.assign(Object.assign({},t[l]),{text:h.str,width:h.width})),u+=h.width}return{verticalList:s,width:u}}},{key:"clipText",value:function(t,e,i,n){if(0===t.length)return{str:"",width:0};var r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if((r=this.measureTextWidth(t[0],e))>i)return{str:"",width:0};var a=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&a.str!==t){var o=Qn(t,a.str.length);o!==a.str.length&&(a.str=t.substring(0,o),a.width=this.measureTextWidth(a.str,e))}return a}},{key:"_clipText",value:function(t,e,i,n,r,a,o){var s;if("start"===a)s=this._clipTextStart(t,e,i,n,r),o&&(s.result=o+s.str);else if("middle"===a){var u=this._clipTextMiddle(t,e,i,"","",0,0,1);s={str:"none",width:u.width,result:u.left+o+u.right}}else s=this._clipTextEnd(t,e,i,n,r),o&&(s.result=s.str+o);return s}},{key:"_clipTextEnd",value:function(t,e,i,n,r){var a,o=Math.floor((n+r)/2),s=t.substring(0,o+1),u=this.measureTextWidth(s,e);if(u>i){if(s.length<=1)return{str:"",width:0};var l=t.substring(0,o);return(a=this.measureTextWidth(l,e))<=i?{str:l,width:a}:this._clipTextEnd(t,e,i,n,o)}if(u<i){if(o>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};var h=t.substring(0,o+2);return(a=this.measureTextWidth(h,e))>=i?{str:s,width:u}:this._clipTextEnd(t,e,i,o,r)}return{str:s,width:u}}},{key:"_clipTextStart",value:function(t,e,i,n,r){var a,o=Math.ceil((n+r)/2),s=t.substring(o-1,t.length-1),u=this.measureTextWidth(s,e);if(u>i){if(s.length<=1)return{str:"",width:0};var l=t.substring(o,t.length-1);return(a=this.measureTextWidth(l,e))<=i?{str:l,width:a}:this._clipTextStart(t,e,i,o,t.length-1)}if(u<i){if(o<=0)return{str:t,width:this.measureTextWidth(t,e)};var h=t.substring(o-2,t.length-1);return(a=this.measureTextWidth(h,e))>=i?{str:s,width:u}:this._clipTextStart(t,e,i,n,o)}return{str:s,width:u}}},{key:"_clipTextMiddle",value:function(t,e,i,n,r,a,o,s){var u=t.substring(0,s),l=this.measureTextWidth(u,e);if(l+o>i)return{left:n,right:r,width:a+o};var h=t.substring(t.length-s,t.length),c=this.measureTextWidth(h,e);return l+c>i?{left:u,right:r,width:l+o}:this._clipTextMiddle(t,e,i,u,h,l,c,s+1)}},{key:"clipTextWithSuffixVertical",value:function(t,e,i,n,r,a){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};var o=this.clipTextVertical(t,e,i,r);if(o.verticalList.length===t.length&&o.verticalList[o.verticalList.length-1].width===t[t.length-1].width)return o;var s,u=this.measureTextWidth(n,e);if(u>i)return o;if(i-=u,"start"===a){var l=this.revertVerticalList(t);s=this.clipTextVertical(l,e,i,r);var h=this.revertVerticalList(s.verticalList);h.unshift({text:n,direction:1,width:u}),s.verticalList=h}else if("middle"===a){var c=this.clipTextVertical(t,e,i/2,r),d=this.revertVerticalList(t),f=this.clipTextVertical(d,e,i/2,r);c.verticalList.push({text:n,direction:1,width:u}),this.revertVerticalList(f.verticalList).forEach((function(t){return c.verticalList.push(t)})),s={verticalList:c.verticalList,width:c.width+f.width}}else(s=this.clipTextVertical(t,e,i,r)).verticalList.push({text:n,direction:1,width:u});return s.width+=u,s}},{key:"revertVerticalList",value:function(t){return t.reverse().map((function(t){var e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}},{key:"clipTextWithSuffix",value:function(t,e,i,n,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};var s=this.measureTextWidth(t,e);if(!o&&s<=i)return{str:t,width:s};var u=this.measureTextWidth(n,e);if(u>i)return{str:"",width:0};if(o&&s+u<=i)return{str:t+n,width:s+u};i-=u;var l=this._clipText(t,e,i,0,t.length-1,a,n);if(r&&l.str!==t){var h=Qn(t,l.str.length);h!==l.str.length&&(l.result=t.substring(0,h),l.width=this.measureTextWidth(l.str,e))}else o&&l.str===t&&(l.result=t+n);return l.str=l.result,l.width+=u,l}}])}();ir=er([L()],ir);var nr=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},rr=Symbol.for("TextMeasureContribution"),ar=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i)}(ir);ar=nr([L()],ar);var or=new J,sr=Symbol.for("CanvasFactory"),ur=Symbol.for("Context2dFactory");function lr(t){return or.getNamed(sr,Vn.global.env)(t)}var hr=function(){return u((function t(){o(this,t),this.pools=[],this.allocatedCanvas=[]}),[{key:"shareCanvas",value:function(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}},{key:"getCommonCanvas",value:function(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}},{key:"allocate",value:function(t){if(!this.pools.length){var e=lr(Object.assign({nativeCanvas:Vn.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}var i=this.pools.pop();return i.resize(t.width,t.height),i.dpr=t.dpr,i}},{key:"allocateByObj",value:function(t){if(!this.pools.length){var e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=lr(Object.assign({nativeCanvas:Vn.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}var n=this.pools.pop();return n.width=t.width,n.height=t.height,n}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),cr=new hr,dr=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},fr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vr=Symbol.for("VWindow"),pr=Symbol.for("WindowHandlerContribution"),gr=function(){return u((function t(){var e=this;o(this,t),this.hooks={onChange:new et(["x","y","width","height"])},this.active=function(){var t=e.global;t.env&&!e.actived&&(or.getNamed(pr,t.env).configure(e,t),e.actived=!0)},this._uid=b.GenAutoIncrementId(),this.global=Vn.global,this.postInit()}),[{key:"width",get:function(){if(this._handler){var t=this._handler.getWH();return this._width=t.width}return this._width}},{key:"height",get:function(){if(this._handler){var t=this._handler.getWH();return this._height=t.height}return this._height}},{key:"dpr",get:function(){return this._handler.getDpr()}},{key:"postInit",value:function(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}},{key:"style",get:function(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}},set:function(t){this._handler.setStyle(t)}},{key:"create",value:function(t){var e,i;this._handler.createWindow(t);var n=this._handler.getWH();this._width=n.width,this._height=n.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}},{key:"setWindowHandler",value:function(t){this._handler=t}},{key:"setDpr",value:function(t){return this._handler.setDpr(t)}},{key:"resize",value:function(t,e){return this._handler.resizeWindow(t,e)}},{key:"configure",value:function(){throw new Error("暂不支持")}},{key:"release",value:function(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}},{key:"getContext",value:function(){return this._handler.getContext()}},{key:"getNativeHandler",value:function(){return this._handler.getNativeHandler()}},{key:"getImageBuffer",value:function(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}},{key:"addEventListener",value:function(t,e,i){return this._handler.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return this._handler.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return this._handler.dispatchEvent(t)}},{key:"getBoundingClientRect",value:function(){return this._handler.getBoundingClientRect()}},{key:"getContainer",value:function(){return this._handler.container}},{key:"clearViewBox",value:function(t){this._handler.clearViewBox(t)}},{key:"setViewBox",value:function(t){this._handler.setViewBox(t)}},{key:"setViewBoxTransform",value:function(t,e,i,n,r,a){this._handler.setViewBoxTransform(t,e,i,n,r,a)}},{key:"getViewBox",value:function(){return this._handler.getViewBox()}},{key:"getViewBoxTransform",value:function(){return this._handler.getViewBoxTransform()}},{key:"pointTransform",value:function(t,e){var i=this._handler.getViewBox(),n={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},n),n.x-=i.x1,n.y-=i.y1,n}},{key:"hasSubView",value:function(){var t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}},{key:"isVisible",value:function(t){return this._handler.isVisible(t)}},{key:"onVisibleChange",value:function(t){return this._handler.onVisibleChange(t)}},{key:"getTopLeft",value:function(t){return this._handler.getTopLeft(t)}}])}();gr=dr([L(),fr("design:paramtypes",[])],gr);var yr,mr=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},kr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_r=function(t,e){return function(i,n){e(i,n,t)}},br=function(){return u((function t(e){var i=this;o(this,t),this.contributions=e,this.configured=!1,this.global=Vn.global,this.global.hooks.onSetEnv.tap("graphic-util",(function(t,e,n){i.configured=!1,i.configure(n,e)}))}),[{key:"canvas",get:function(){return this.tryInitCanvas(),this._canvas}},{key:"context",get:function(){return this.tryInitCanvas(),this._context}},{key:"textMeasure",get:function(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}},{key:"configure",value:function(t,e){var i=this;this.configured||(this.contributions.getContributions().forEach((function(t){t.configure(i,e)})),this.configured=!0)}},{key:"tryInitCanvas",value:function(){if(!this._canvas){var t=cr.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}},{key:"bindTextMeasure",value:function(t){this._textMeasure=t}},{key:"measureText",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";this.configure(this.global,this.global.env);var r=this.global.measureTextMethod;this.global.measureTextMethod=n;var a={width:this._textMeasure.measureTextWidth(t,e),height:null!==(i=e.fontSize)&&void 0!==i?i:Tn.fontSize};return this.global.measureTextMethod=r,a}},{key:"createTextMeasureInstance",value:function(t,e,i){var n=this;return this.configure(this.global,this.global.env),new ei(Object.assign({defaultFontParams:{fontFamily:Tn.fontFamily,fontSize:Tn.fontSize},getCanvasForMeasure:i||function(){return n.canvas},getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+ei.ALPHABET_CHAR_SET+ei.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}},{key:"drawGraphicToCanvas",value:function(t,e,i){if(!e.defaultLayer)return null;var n=or.get(vr),r=t.AABBBounds,a=r.width(),o=r.height(),s=-r.x1,u=-r.y1;n.create({viewBox:{x1:s,y1:u,x2:r.x2,y2:r.y2},width:a,height:o,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});var l=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(n,[t],{transMatrix:n.getViewBoxTransform(),viewBox:n.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=l;var h=n.getNativeHandler();return h.nativeCanvas?h.nativeCanvas:null}}])}();br=mr([L(),_r(0,O($)),_r(0,D(rr)),kr("design:paramtypes",[Object])],br),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(yr||(yr={}));var xr=new De,Sr=function(){return u((function t(){o(this,t),this.matrix=new De}),[{key:"init",value:function(t){return this.mode=yr.transform,this.originTransform=t,this.matrix.reset(),this}},{key:"fromMatrix",value:function(t,e){return this.mode=yr.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}},{key:"scaleMatrix",value:function(t,e,i){var n=this.outSourceMatrix;if(xr.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){var r=i.x,a=i.y;this.outTargetMatrix.translate(r,a),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-r,-a)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(xr.a,xr.b,xr.c,xr.d,xr.e,xr.f),this}},{key:"rotateMatrix",value:function(t,e){var i=this.outSourceMatrix;if(xr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){var n=e.x,r=e.y;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(xr.a,xr.b,xr.c,xr.d,xr.e,xr.f),this}},{key:"scale",value:function(t,e,i){return this.mode===yr.matrix?this.scaleMatrix(t,e,i):this}},{key:"rotate",value:function(t,e){return this.mode===yr.matrix?this.rotateMatrix(t,e):this}},{key:"translateMatrix",value:function(t,e){var i=this.outSourceMatrix;return xr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(xr.a,xr.b,xr.c,xr.d,xr.e,xr.f),this}},{key:"translate",value:function(t,e){return this.mode===yr.matrix?this.translateMatrix(t,e):this}},{key:"simplify",value:function(t){return this.mode===yr.matrix?this.simplifyMatrix(t):this}},{key:"simplifyMatrix",value:function(t){return this}}])}();Sr=mr([L(),kr("design:paramtypes",[])],Sr);var wr={arc:Rn,area:Mn,circle:Pn,line:Ln,path:Dn,symbol:Nn,text:zn,rect:jn,polygon:Fn,richtext:Un,richtextIcon:Wn,image:Gn,group:On,glyph:In},Ar=Object.keys(wr);function Tr(t,e){Object.keys(e).forEach((function(i){t[i]=e[i]}))}var Cr={arc:Object.assign({},wr.arc),area:Object.assign({},wr.area),circle:Object.assign({},wr.circle),line:Object.assign({},wr.line),path:Object.assign({},wr.path),symbol:Object.assign({},wr.symbol),text:Object.assign({},wr.text),rect:Object.assign({},wr.rect),polygon:Object.assign({},wr.polygon),richtext:Object.assign({},wr.richtext),richtextIcon:Object.assign({},wr.richtextIcon),image:Object.assign({},wr.image),group:Object.assign({},wr.group),glyph:Object.assign({},wr.glyph)},Er=function(){return u((function t(){o(this,t),this.initTheme(),this.dirty=!1}),[{key:"initTheme",value:function(){var t=this;this._defaultTheme={},Ar.forEach((function(e){t._defaultTheme[e]=Object.create(Cr[e])})),this.combinedTheme=this._defaultTheme}},{key:"getTheme",value:function(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;var e={},i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}},{key:"getParentWithTheme",value:function(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}},{key:"applyTheme",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){var n=this.getParentWithTheme(t);if(n){var r=n.theme;(r.dirty||i)&&r.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,te.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}},{key:"doCombine",value:function(t){var e=this,i=this.userTheme,n=this.combinedTheme;Ar.forEach((function(r){var a=Object.create(Cr[r]);t&&t[r]&&Tr(a,t[r]),n[r]&&Tr(a,n[r]),i[r]&&Tr(a,i[r]),e.combinedTheme[r]=a})),i.common&&Ar.forEach((function(t){Tr(e.combinedTheme[t],i.common)})),this.dirty=!1}},{key:"setTheme",value:function(t,e){var i=this.userTheme;i?Object.keys(t).forEach((function(e){i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}},{key:"resetTheme",value:function(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}},{key:"dirtyChildren",value:function(t){var e=this;t.forEachChildren((function(t){t.isContainer&&(t.theme&&(t.theme.dirty=!0),e.dirtyChildren(t))}))}}])}(),Br=new Er;function Rr(t,e){return t.glyphHost?Rr(t.glyphHost):e?(t.isContainer,e):function(t){var e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):Br.getTheme()}return null}(t)||t.attachedThemeGraphic&&Rr(t.attachedThemeGraphic)||Br.getTheme()}var Mr=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}u((n=n.apply(t,e||[])).next())}))},Pr=function(t){function i(){var t;return o(this,i),(t=e(this,i))._uid=b.GenAutoIncrementId(),t._firstChild=null,t._lastChild=null,t.parent=null,t._count=1,t}return h(i,t),u(i,[{key:"previousSibling",get:function(){return this._prev}},{key:"nextSibling",get:function(){return this._next}},{key:"children",get:function(){return this.getChildren()}},{key:"firstChild",get:function(){return this._firstChild}},{key:"lastChild",get:function(){return this._lastChild}},{key:"count",get:function(){return this._count}},{key:"childrenCount",get:function(){return this._idMap?this._idMap.size:0}},{key:"forEachChildren",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])for(var e=this._lastChild,i=0;e;){if(t(e,i++))return;e=e._prev}else for(var n=this._firstChild,r=0;n;){if(t(n,r++))return;n=n._next}}},{key:"forEachChildrenAsync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Mr(this,void 0,void 0,n().mark((function i(){var r,a,o,s,u,l;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!e){i.next=16;break}r=this._lastChild,a=0;case 2:if(!r){i.next=14;break}if(o=t(r,a++),i.t0=o.then,!i.t0){i.next=9;break}return i.next=8,o;case 8:o=i.sent;case 9:if(!o){i.next=11;break}return i.abrupt("return");case 11:r=r._prev;case 12:i.next=2;break;case 14:i.next=29;break;case 16:s=this._firstChild,u=0;case 17:if(!s){i.next=29;break}if(l=t(s,u++),i.t1=l.then,!i.t1){i.next=24;break}return i.next=23,l;case 23:l=i.sent;case 24:if(!l){i.next=26;break}return i.abrupt("return");case 26:s=s._next;case 27:i.next=17;break;case 29:case"end":return i.stop()}}),i,this)})))}},{key:"forEach",value:function(t){return this.forEachChildren(t)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}},{key:"appendChildArrHighPerformance",value:function(t){return console.error("暂不支持该函数"),t}},{key:"insertBefore",value:function(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}},{key:"insertAfter",value:function(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}},{key:"insertInto",value:function(t,e){if(!this._ignoreWarn&&this._nodeList&&te.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{for(var i=this._firstChild,n=0;n<e;n++){if(!i)return null;n>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}},{key:"insertIntoKeepIdx",value:function(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){var i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}var n;this._nodeList[e]=t;for(var r=e-1;r>=0&&!(n=this._nodeList[r]);r--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;var a=this.insertInto(t,0);return this._ignoreWarn=!1,a}},{key:"removeChild",value:function(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){var e=this._nodeList.findIndex((function(e){return e===t}));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}},{key:"delete",value:function(){this.parent&&this.parent.removeChild(this)}},{key:"removeAllChild",value:function(t){if(this._idMap){this._nodeList&&(this._nodeList.length=0);for(var e=this._firstChild;e;){var i=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=i}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}}},{key:"replaceChild",value:function(t,e){throw new Error("暂不支持")}},{key:"find",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;return this.forEachChildren((function(i,r){return!(i===e||!t(i,r)||(n=i,0))})),i&&this.forEachChildren((function(e){if(e.isContainer){var i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}},{key:"findAll",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return this.forEachChildren((function(i,r){i!==e&&t(i,r)&&n.push(i)})),i&&this.forEachChildren((function(e){if(e.isContainer){var i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}},{key:"getElementById",value:function(t){return this.find((function(e){return e.id===t}),!0)}},{key:"findChildById",value:function(t){return this.getElementById(t)}},{key:"findChildByUid",value:function(t){return this._idMap&&this._idMap.get(t)||null}},{key:"getElementsByName",value:function(t){return this.findAll((function(e){return e.name===t}),!0)}},{key:"findChildrenByName",value:function(t){return this.getElementsByName(t)}},{key:"getElementsByType",value:function(t){return this.findAll((function(e){return e.type===t}),!0)}},{key:"getChildByName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((function(e){return e.name===t}),e)}},{key:"getChildAt",value:function(t){var e=this._firstChild;if(!e)return null;for(var i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}},{key:"at",value:function(t){return this.getChildAt(t)}},{key:"containNode",value:function(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;for(var e=this._firstChild;e;){if(e.containNode(t))return!0;e=e._next}return!1}},{key:"getRootNode",value:function(){for(var t=this.parent;null==t?void 0:t.parent;)t=t.parent;return t||this}},{key:"hasChildNodes",value:function(){return null!==this._firstChild}},{key:"addChild",value:function(t){return this.appendChild(t)}},{key:"add",value:function(t){return this.appendChild(t)}},{key:"getChildren",value:function(){for(var t=[],e=this._firstChild;e;)t.push(e),e=e._next;return t}},{key:"isChildOf",value:function(t){return!!this.parent&&this.parent._uid===t._uid}},{key:"isParentOf",value:function(t){return t.isChildOf(this)}},{key:"isDescendantsOf",value:function(t){var e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}},{key:"isAncestorsOf",value:function(t){return t.isDescendantsOf(this)}},{key:"getAncestor",value:function(t){throw new Error("暂不支持")}},{key:"setAllDescendantsProps",value:function(t,e){for(var i=this._firstChild;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}},{key:"setCount",value:function(t){this._count+=t;var e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}},{key:"clone",value:function(){throw new Error("暂不支持")}},{key:"cloneTo",value:function(t){throw new Error("暂不支持")}},{key:"getParent",value:function(){return this.parent}},{key:"del",value:function(t){return this.removeChild(t)}},{key:"addEventListener",value:function(t,e,n){var r=dt(n,!0)&&n||gt(n)&&n.capture,a=gt(n)&&n.once,o=ft(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=ft(e)?e:e.handleEvent,a?p(c(i.prototype),"once",this).call(this,t,e,o):p(c(i.prototype),"on",this).call(this,t,e,o),this}},{key:"on",value:function(t,e,i){return this.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,n){var r=dt(n,!0)&&n||gt(n)&&n.capture,a=ft(e)?void 0:e;t=r?"".concat(t,"capture"):t,e=ft(e)?e:e.handleEvent;var o=gt(n)&&n.once;return p(c(i.prototype),"off",this).call(this,t,e,a,o),this}},{key:"off",value:function(t,e,i){return this.removeEventListener(t,e,i)}},{key:"once",value:function(t,e,i){return gt(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}},{key:"removeAllEventListeners",value:function(){return p(c(i.prototype),"removeAllListeners",this).call(this),this}},{key:"removeAllListeners",value:function(){return this.removeAllEventListeners()}},{key:"dispatchEvent",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return(e=p(c(i.prototype),"emit",this)).call.apply(e,[this,t.type,t].concat(r)),!t.defaultPrevented}},{key:"emit",value:function(t,e){return this.dispatchEvent(t,e)}},{key:"release",value:function(){this.removeAllListeners()}}])}(ht),Or=function(){return u((function t(e){o(this,t),this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=t.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewX",get:function(){return this.viewport.x}},{key:"viewY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}},{key:"composedDetailPath",value:function(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}},{key:"_composedDetailPath",value:function(t){if(t&&t.graphic){var e=this.pickParams.graphic;if(e.stage){var i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}},{key:"preventDefault",value:function(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&ft(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&ft(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error("Method not implemented.")}}])}(),Ir=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).client={x:0,y:0},t.movement={x:0,y:0},t.offset={x:0,y:0},t.global={x:0,y:0},t.screen={x:0,y:0},t}return h(i,t),u(i,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d,f,v){throw new Error("Method not implemented.")}}])}(Or),Lr=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).width=0,t.height=0,t.isPrimary=!1,t}return h(i,t),u(i,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){var t,e,n,r=new i(this.manager);r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.detailPath=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(n=this.manager)||void 0===n||n.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice();var a=this.composedDetailPath();return r.detailPath=a&&a.slice(),r.type=this.type,r}}])}(Ir),Dr=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).DOM_DELTA_PIXEL=0,t.DOM_DELTA_LINE=1,t.DOM_DELTA_PAGE=2,t}return h(i,t),u(i,[{key:"clone",value:function(){var t,e,n,r=new i(this.manager);r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.detailPath=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(n=this.manager)||void 0===n||n.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice();var a=this.composedDetailPath();return r.detailPath=a&&a.slice(),r.type=this.type,r}}])}(Ir);Dr.DOM_DELTA_PIXEL=0,Dr.DOM_DELTA_LINE=1,Dr.DOM_DELTA_PAGE=2;var Fr=function(t){function i(t,n){var r;return o(this,i),(r=e(this,i)).type=t,r.detail=n,r}return h(i,t),u(i)}(Or),jr="object"==("undefined"==typeof performance?"undefined":a(performance))&&performance.now?performance:Date;function Nr(t){return"mouse"===t||"pen"===t}var zr,Ur=function(){return u((function t(e,i){var n=this;o(this,t),this.dispatch=new ht,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=function(t,e){if(t instanceof Lr){var i=n.createPointerEvent(t,t.type,e);if(n.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)n.dispatchEvent(i,"touchstart");else if(Nr(i.pointerType)){var r=2===i.button;n.dispatchEvent(i,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),n.freeEvent(i)}else te.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerMove=function(t,e){var i,r;if(t instanceof Lr){var a=n.createPointerEvent(t,t.type,e),o=Nr(a.pointerType),s=n.trackingData(t.pointerId),u=n.findMountedTarget(s.overTargets);if(s.overTargets&&u&&u!==n.rootTarget&&u!==a.target){var l="mousemove"===t.type?"mouseout":"pointerout",h=n.createPointerEvent(t,l,u||void 0);if(n.dispatchEvent(h,"pointerout"),o&&n.dispatchEvent(h,"mouseout"),!a.composedPath().includes(u)){var c=n.createPointerEvent(t,"pointerleave",u||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!a.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),o&&n.notifyTarget(c,"mouseleave"),c.target=c.target.parent;n.freeEvent(c)}n.freeEvent(h)}if(u!==a.target){var d="mousemove"===t.type?"mouseover":"pointerover",f=n.clonePointerEvent(a,d);n.dispatchEvent(f,"pointerover"),o&&n.dispatchEvent(f,"mouseover");for(var v=null==u?void 0:u.parent;v&&v!==n.rootTarget.parent&&v!==a.target;)v=v.parent;if(!v||v===n.rootTarget.parent){var p=n.clonePointerEvent(a,"pointerenter");p.eventPhase=p.AT_TARGET;for(var g=p.target,y=new Set,m=u;m&&m!==n.rootTarget;)y.add(m),m=m.parent;for(;g&&g!==u&&g!==n.rootTarget.parent;)y.has(g)||(p.currentTarget=g,n.notifyTarget(p),o&&n.notifyTarget(p,"mouseenter")),g=g.parent;n.freeEvent(p)}n.freeEvent(f)}n.dispatchEvent(a,"pointermove"),"touch"===a.pointerType&&n.dispatchEvent(a,"touchmove"),o&&(n.dispatchEvent(a,"mousemove"),n.cursorTarget=a.target,n.cursor=(null===(r=null===(i=a.target)||void 0===i?void 0:i.attribute)||void 0===r?void 0:r.cursor)||n.rootTarget.getCursor()),s.overTargets=a.composedPath(),n.freeEvent(a)}else te.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOver=function(t,e){var i,r;if(t instanceof Lr){var a=n.trackingData(t.pointerId),o=n.createPointerEvent(t,t.type,e),s=Nr(o.pointerType);n.dispatchEvent(o,"pointerover"),s&&n.dispatchEvent(o,"mouseover"),"mouse"===o.pointerType&&(n.cursorTarget=o.target,n.cursor=(null===(r=null===(i=o.target)||void 0===i?void 0:i.attribute)||void 0===r?void 0:r.cursor)||n.rootTarget.getCursor());var u=n.clonePointerEvent(o,"pointerenter");for(u.eventPhase=u.AT_TARGET;u.target&&u.target!==n.rootTarget.parent;)u.currentTarget=u.target,n.notifyTarget(u),s&&n.notifyTarget(u,"mouseenter"),u.target=u.target.parent;a.overTargets=o.composedPath(),n.freeEvent(o),n.freeEvent(u)}else te.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOut=function(t,e){if(t instanceof Lr){var i=n.trackingData(t.pointerId);if(i.overTargets){var r=Nr(t.pointerType),a=n.findMountedTarget(i.overTargets),o=n.createPointerEvent(t,"pointerout",a||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var s=n.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==n.rootTarget.parent;)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],n.freeEvent(o),n.freeEvent(s)}n.cursorTarget=null,n.cursor=""}else te.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUp=function(t,e){var i;if(t instanceof Lr){var r=jr.now(),a=n.createPointerEvent(t,t.type,e);if(n.dispatchEvent(a,"pointerup"),"touch"===a.pointerType)n.dispatchEvent(a,"touchend");else if(Nr(a.pointerType)){var o=2===a.button;n.dispatchEvent(a,o?"rightup":"mouseup")}var s=n.trackingData(t.pointerId),u=n.findMountedTarget(s.pressTargetsByButton[t.button]),l=u;if(u&&!a.composedPath().includes(u)){for(var h=u;h&&!a.composedPath().includes(h);){if(a.currentTarget=h,n.notifyTarget(a,"pointerupoutside"),"touch"===a.pointerType)n.notifyTarget(a,"touchendoutside");else if(Nr(a.pointerType)){var c=2===a.button;n.notifyTarget(a,c?"rightupoutside":"mouseupoutside")}h=h.parent}delete s.pressTargetsByButton[t.button],l=h}if(l){var d=n.clonePointerEvent(a,"click");d.target=l,d.path=[],d.detailPath=[],s.clicksByButton[t.button]||(s.clicksByButton[t.button]={clickCount:0,target:d.target,timeStamp:r});var f=s.clicksByButton[t.button];f.target===d.target&&r-f.timeStamp<(null!==(i=n._config.clickInterval)&&void 0!==i?i:200)?++f.clickCount:f.clickCount=1,f.target=d.target,f.timeStamp=r,d.detail=f.clickCount,Nr(d.pointerType)?(n.dispatchEvent(d,"click"),2===f.clickCount&&n.dispatchEvent(d,"dblclick")):"touch"===d.pointerType&&(n.dispatchEvent(d,"tap"),2===f.clickCount&&n.dispatchEvent(d,"dbltap")),n.dispatchEvent(d,"pointertap"),n.freeEvent(d)}n.freeEvent(a)}else te.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUpOutside=function(t,e){if(t instanceof Lr){var i=n.trackingData(t.pointerId),r=n.findMountedTarget(i.pressTargetsByButton[t.button]),a=n.createPointerEvent(t,t.type,e);if(r){for(var o=r;o;)a.currentTarget=o,n.notifyTarget(a,"pointerupoutside"),"touch"===a.pointerType?n.notifyTarget(a,"touchendoutside"):Nr(a.pointerType)&&n.notifyTarget(a,2===a.button?"rightupoutside":"mouseupoutside"),o=o.parent;delete i.pressTargetsByButton[t.button]}n.freeEvent(a)}else te.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onWheel=function(t,e){if(t instanceof Dr){var i=n.createWheelEvent(t,e);n.dispatchEvent(i),n.freeEvent(i)}else te.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event")},this.rootTarget=e,this.mappingTable={},this._config=Object.assign({clickInterval:200},i),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}),[{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"dispatchEvent",value:function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}},{key:"mapEvent",value:function(t){var e,i,n,r,a,o,s;if(this.rootTarget){var u,h=this.mappingTable[t.type],c="".concat(t.canvasX,"-").concat(t.canvasY);if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[c])&&(null===(n=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[c])||void 0===n?void 0:n.stage)&&(null===(a=null===(r=this._prePointTargetCache)||void 0===r?void 0:r[c])||void 0===a?void 0:a.stage.renderCount)===(null===(o=this._prePointTargetCache)||void 0===o?void 0:o.stageRenderCount)?u=this._prePointTargetCache[c]:(u=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache=l(l({},c,u),"stageRenderCount",null!==(s=null==u?void 0:u.stage.renderCount)&&void 0!==s?s:-1))),h)for(var d=0,f=h.length;d<f;d++)h[d].fn(t,u);else te.getInstance().warn("[EventManager]: Event mapping not defined for ".concat(t.type))}}},{key:"propagate",value:function(t,e){if(t.target){var i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(var a=i.length-2;a>=0;a--)if(t.currentTarget=i[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){for(var e=[t],i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}},{key:"notifyTarget",value:function(t,e){if(!this.pauseNotify){e=null!=e?e:t.type;var i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[0],i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}},{key:"createPointerEvent",value:function(t,e,i){var n,r,a=this.allocateEvent(Lr);return this.copyPointerData(t,a),this.copyMouseData(t,a),this.copyData(t,a),a.nativeEvent=t.nativeEvent,a.originalEvent=t,a.target=i||this.pickTarget(null!==(n=a.viewX)&&void 0!==n?n:a.global.x,null!==(r=a.viewY)&&void 0!==r?r:a.global.y,a),"string"==typeof e&&(a.type=e),a}},{key:"createWheelEvent",value:function(t,e){var i,n,r=this.allocateEvent(Dr);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget(null!==(i=r.viewX)&&void 0!==i?i:r.global.x,null!==(n=r.viewY)&&void 0!==n?n:r.global.y,r),r}},{key:"clonePointerEvent",value:function(t,e){var i=this.allocateEvent(Lr);i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice();var n=t.composedDetailPath();return i.detailPath=n&&n.slice(),i.type=null!=e?e:i.type,i}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyPointerData",value:function(t,e){t instanceof Lr&&e instanceof Lr&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}},{key:"copyMouseData",value:function(t,e){t instanceof Ir&&e instanceof Ir&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((function(i){e[i].x=t[i].x,e[i].y=t[i].y})))}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=jr.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"allocateEvent",value:function(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);var i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}},{key:"freeEvent",value:function(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");var i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}},{key:"notifyListeners",value:function(t,e){var i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(var n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);this.emitDelegation(t,e)}},{key:"emitDelegation",value:function(t,e){var i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(var n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}},{key:"pickTarget",value:function(t,e,i){var n,r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),n}},{key:"release",value:function(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}])}(),Gr={dispatchEvent:function(t){var e;if(!(t instanceof Or))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit:function(t,e){return this.dispatchEvent(new Fr(t,e))}},Wr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Vr=function(){return u((function t(e){var i=this;o(this,t),this.resolution=1,this.onPointerDown=function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=i.normalizeToPointerData(t);i.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var n=0,r=e.length;n<r;n++){var a=e[n],o=i.bootstrapEvent(i.rootPointerEvent,a);i.manager.mapEvent(o)}i.setCursor(i.manager.cursor,i.manager.cursorTarget),i.rootPointerEvent.nativeEvent=null}},this.onPointerMove=function(t){if(!(i.supportsTouchEvents&&"touch"===t.pointerType||i.isEventOutsideOfTargetElement(t))){for(var e=i.normalizeToPointerData(t),n=0,r=e.length;n<r;n++){var a=i.bootstrapEvent(i.rootPointerEvent,e[n]);i.manager.mapEvent(a)}i.setCursor(i.manager.cursor,i.manager.cursorTarget),i.rootPointerEvent.nativeEvent=null}},this.onPointerUp=function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){for(var e=i.isEventOutsideOfTargetViewPort(t)?"outside":"",n=i.normalizeToPointerData(t),r=0,a=n.length;r<a;r++){var o=i.bootstrapEvent(i.rootPointerEvent,n[r]);o.type+=e,i.manager.mapEvent(o)}i.setCursor(i.manager.cursor,i.manager.cursorTarget),i.rootPointerEvent.nativeEvent=null}},this.onPointerOverOut=function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){for(var e=i.normalizeToPointerData(t),n=0,r=e.length;n<r;n++){var a=i.bootstrapEvent(i.rootPointerEvent,e[n]);i.manager.mapEvent(a)}i.setCursor(i.manager.cursor,i.manager.cursorTarget),i.rootPointerEvent.nativeEvent=null}},this.onWheel=function(t){var e=i.normalizeWheelEvent(t);i.manager.mapEvent(e)};var n=e.targetElement,r=e.resolution,a=e.rootNode,s=e.global,u=e.autoPreventDefault,l=void 0!==u&&u,h=e.clickInterval,c=e.supportsTouchEvents,d=void 0===c?s.supportsTouchEvents:c,f=e.supportsPointerEvents,v=void 0===f?s.supportsPointerEvents:f;this.manager=new Ur(a,{clickInterval:h}),this.globalObj=s,this.supportsPointerEvents=v,this.supportsTouchEvents=d,this.supportsMouseEvents=s.supportsMouseEvents,this.applyStyles=s.applyStyles,this.autoPreventDefault=l,this.eventsAdded=!1,this.rootPointerEvent=new Lr,this.rootWheelEvent=new Dr,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=r,this.setTargetElement(n)}),[{key:"release",value:function(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}},{key:"setCursor",value:function(t,e){if(e||this.manager.rootTarget.window._handler.canvas.controled){t||(t="default");var i=this.applyStyles,n=this.domElement;if(this.currentCursor!==t){this.currentCursor=t;var r=this.cursorStyles[t];r?"string"==typeof r&&i?n.style.cursor=r:"function"==typeof r?r(t):"object"==a(r)&&i&&Object.assign(n.style,r):i&&_t(t)&&!Lt(this.cursorStyles,t)&&(n.style.cursor=t)}}}},{key:"setTargetElement",value:function(t){this.removeEvents(),this.domElement=t,this.addEvents()}},{key:"addEvents",value:function(){if(!this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}}},{key:"removeEvents",value:function(){if(this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}}},{key:"mapToViewportPoint",value:function(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}},{key:"mapToCanvasPoint",value:function(t){var e,i,n=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(n)return n;var r=0,a=0;if(t.changedTouches){var o=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};r=o.clientX||0,a=o.clientY||0}else r=t.clientX||0,a=t.clientY||0;var s=this.domElement.getBoundingClientRect();return{x:r-s.left,y:a-s.top}}},{key:"normalizeToPointerData",value:function(t){var e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(var i=0,n=t.changedTouches.length;i<n;i++){var r=t.changedTouches[i];kt(r.button)&&(r.button=0),kt(r.buttons)&&(r.buttons=1),kt(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),kt(r.width)&&(r.width=r.radiusX||1),kt(r.height)&&(r.height=r.radiusY||1),kt(r.tiltX)&&(r.tiltX=0),kt(r.tiltY)&&(r.tiltY=0),kt(r.pointerType)&&(r.pointerType="touch"),kt(r.pointerId)&&(r.pointerId=r.identifier||0),kt(r.pressure)&&(r.pressure=r.force||.5),kt(r.twist)&&(r.twist=0),kt(r.tangentialPressure)&&(r.tangentialPressure=0),kt(r.layerX)&&(r.layerX=r.offsetX=r.clientX),kt(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){var a=t;kt(a.isPrimary)&&(a.isPrimary=!0),kt(a.width)&&(a.width=1),kt(a.height)&&(a.height=1),kt(a.tiltX)&&(a.tiltX=0),kt(a.tiltY)&&(a.tiltY=0),kt(a.pointerType)&&(a.pointerType="mouse"),kt(a.pointerId)&&(a.pointerId=1),kt(a.pressure)&&(a.pressure=.5),kt(a.twist)&&(a.twist=0),kt(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,e.push(a)}else e.push(t);return e}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var i=this.mapToCanvasPoint(t),n=i.x,r=i.y;e.canvas.x=n,e.canvas.y=r,e.global.x=n,e.global.y=r,e.offset.x=n,e.offset.y=r;var a=this.mapToViewportPoint(e),o=a.x,s=a.y;return e.viewport.x=o,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}},{key:"bootstrapEvent",value:function(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.mapToCanvasPoint(e),n=i.x,r=i.y;t.canvas.x=n,t.canvas.y=r,t.global.x=n,t.global.y=r,t.offset.x=n,t.offset.y=r;var a=this.mapToViewportPoint(t),o=a.x,s=a.y;return t.viewport.x=o,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Wr[t.type]||t.type),t}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=jr.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}},{key:"isEventOutsideOfTargetViewPort",value:function(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){var e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),n=i.width(),r=i.height();return!(e.x<n&&e.y<r&&e.x>0&&e.y>0)}return!1}},{key:"isEventOutsideOfTargetElement",value:function(t){var e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}},{key:"pauseTriggerEvent",value:function(){this.manager.pauseNotify=!0}},{key:"resumeTriggerEvent",value:function(){this.manager.pauseNotify=!1}}])}();!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(zr||(zr={}));var Hr=function(){function t(){o(this,t)}return u(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var i=this;Vn.global.getRequestAnimationFrame()((function(){i.released||e(i)}))}},{key:"release",value:function(){this.released=!0}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!!Vn.global.getRequestAnimationFrame()}}])}(),Kr=function(){function t(){o(this,t)}return u(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var i=this;this.timerId=setTimeout((function(){e(i)}),t)}},{key:"release",value:function(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!0}}])}(),Xr=function(){return u((function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o(this,t),this.handleTick=function(t,i){var n=(null!=i?i:{}).once,r=void 0!==n&&n;e.ifCanStop()?e.stop():(e._handlerTick(t),r||t.tick(e.interval,e.handleTick))},this._handlerTick=function(t){var i=e.tickerHandler.getTime(),n=0;e.lastFrameTime>=0&&(n=i-e.lastFrameTime),e.lastFrameTime=i,e.status===zr.RUNNING&&(e.tickCounts++,e.timelines.forEach((function(t){t.tick(n)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=i,this.autoStop=!0}),[{key:"mode",get:function(){return this._mode},set:function(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}},{key:"init",value:function(){var t=this;this.interval=NaN,this.status=zr.INITIAL,Vn.global.hooks.onSetEnv.tap("default-ticker",(function(){t.initHandler()})),Vn.global.env&&this.initHandler()}},{key:"addTimeline",value:function(t){this.timelines.push(t)}},{key:"remTimeline",value:function(t){this.timelines=this.timelines.filter((function(e){return e!==t}))}},{key:"initHandler",value:function(){if(this._mode)return null;for(var t=[{mode:"raf",cons:Hr},{mode:"timeout",cons:Kr}],e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}},{key:"setupTickHandler",value:function(){var t;switch(this._mode){case"raf":t=new Hr;break;case"timeout":t=new Kr;break;default:te.getInstance().warn("非法的计时器模式"),t=new Hr}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}},{key:"setInterval",value:function(t){this.interval=t}},{key:"getInterval",value:function(){return this.interval}},{key:"setFPS",value:function(t){this.setInterval(1e3/t)}},{key:"getFPS",value:function(){return 1e3/this.interval}},{key:"tick",value:function(t){var e=this;this.tickerHandler.tick(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"tickTo",value:function(t){var e=this;this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"pause",value:function(){return this.status!==zr.INITIAL&&(this.status=zr.PAUSE,!0)}},{key:"resume",value:function(){return this.status!==zr.INITIAL&&(this.status=zr.RUNNING,!0)}},{key:"ifCanStop",value:function(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!0}return!1}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===zr.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===zr.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!1}return this.status=zr.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}},{key:"stop",value:function(){this.status=zr.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}])}(),Yr=function(){function t(){o(this,t),this.time=0}return u(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}},{key:"tickTo",value:function(t,e){this.time=Math.max(0,t),e(this,{once:!0})}},{key:"release",value:function(){this.timerId>0&&(this.timerId=-1)}},{key:"getTime",value:function(){return this.time}}],[{key:"Avaliable",value:function(){return!0}}])}(),qr=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"mode",get:function(){return this._mode},set:function(t){this.setupTickHandler()}},{key:"initHandler",value:function(){return this.mode="manual",null}},{key:"setupTickHandler",value:function(){var t=new Yr;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}},{key:"tickAt",value:function(t){var e=this;this.tickerHandler.tick(t-Math.max(this.lastFrameTime,0),(function(t){e.handleTick(t,{once:!0})}))}},{key:"ifCanStop",value:function(){return!1}}])}(Xr),Zr=function(){function t(){o(this,t)}return u(t,null,[{key:"linear",value:function(t){return t}},{key:"none",value:function(){return this.linear}},{key:"get",value:function(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}},{key:"getPowIn",value:function(t){return function(e){return Math.pow(e,t)}}},{key:"getPowOut",value:function(t){return function(e){return 1-Math.pow(1-e,t)}}},{key:"getPowInOut",value:function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}},{key:"getBackIn",value:function(t){return function(e){return e*e*((t+1)*e-t)}}},{key:"getBackOut",value:function(t){return function(e){return--e*e*((t+1)*e+t)+1}}},{key:"getBackInOut",value:function(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}},{key:"sineIn",value:function(t){return 1-Math.cos(t*Math.PI/2)}},{key:"sineOut",value:function(t){return Math.sin(t*Math.PI/2)}},{key:"sineInOut",value:function(t){return-(Math.cos(Math.PI*t)-1)/2}},{key:"expoIn",value:function(t){return 0===t?0:Math.pow(2,10*t-10)}},{key:"expoOut",value:function(t){return 1===t?1:1-Math.pow(2,-10*t)}},{key:"expoInOut",value:function(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}},{key:"circIn",value:function(t){return-(Math.sqrt(1-t*t)-1)}},{key:"circOut",value:function(t){return Math.sqrt(1- --t*t)}},{key:"circInOut",value:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},{key:"bounceOut",value:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},{key:"bounceIn",value:function(e){return 1-t.bounceOut(1-e)}},{key:"bounceInOut",value:function(e){return e<.5?.5*t.bounceIn(2*e):.5*t.bounceOut(2*e-1)+.5}},{key:"getElasticIn",value:function(t,e){return function(i){if(0===i||1===i)return i;var n=e/me*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*me/e)}}},{key:"getElasticOut",value:function(t,e){return function(i){if(0===i||1===i)return i;var n=e/me*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*me/e)+1}}},{key:"getElasticInOut",value:function(t,e){return function(i){var n=e/me*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*me/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*me/e)*.5+1}}}])}();Zr.quadIn=Zr.getPowIn(2),Zr.quadOut=Zr.getPowOut(2),Zr.quadInOut=Zr.getPowInOut(2),Zr.cubicIn=Zr.getPowIn(3),Zr.cubicOut=Zr.getPowOut(3),Zr.cubicInOut=Zr.getPowInOut(3),Zr.quartIn=Zr.getPowIn(4),Zr.quartOut=Zr.getPowOut(4),Zr.quartInOut=Zr.getPowInOut(4),Zr.quintIn=Zr.getPowIn(5),Zr.quintOut=Zr.getPowOut(5),Zr.quintInOut=Zr.getPowInOut(5),Zr.backIn=Zr.getBackIn(1.7),Zr.backOut=Zr.getBackOut(1.7),Zr.backInOut=Zr.getBackInOut(1.7),Zr.elasticIn=Zr.getElasticIn(1,.3),Zr.elasticOut=Zr.getElasticOut(1,.3),Zr.elasticInOut=Zr.getElasticInOut(1,.3*1.5);var Jr=function(){return u((function t(){o(this,t),this.id=b.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}),[{key:"addAnimate",value:function(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}},{key:"pause",value:function(){this.paused=!0}},{key:"resume",value:function(){this.paused=!1}},{key:"tick",value:function(t){if(!this.paused){var e=this.animateHead;for(this.animateCount=0;e;)e.status===di.END?this.removeAnimate(e):e.status===di.RUNNING||e.status===di.INITIAL?(this.animateCount++,e.advance(t)):e.status===di.PAUSED&&this.animateCount++,e=e.nextAnimate}}},{key:"clear",value:function(){for(var t=this.animateHead;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}},{key:"removeAnimate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((function(t){return t()})),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}])}(),$r=new Jr,Qr=function(){return u((function t(e,i,n,r,a){o(this,t),this.from=e,this.to=i,this.duration=n,this.easing=r,this.params=a,this.updateCount=0}),[{key:"bind",value:function(t,e){this.target=t,this.subAnimate=e,this.onBind()}},{key:"onBind",value:function(){}},{key:"onFirstRun",value:function(){}},{key:"onStart",value:function(){}},{key:"onEnd",value:function(){}},{key:"getEndProps",value:function(){return this.to}},{key:"getFromProps",value:function(){return this.from}},{key:"getMergedEndProps",value:function(){var t,e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}},{key:"update",value:function(t,e,i){var n=this;if(0===this.updateCount){this.onFirstRun();var r=this.step.getLastProps();Object.keys(r).forEach((function(t){n.subAnimate.animate.validAttr(t)&&(i[t]=r[t])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}])}(),ta=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[null,null,0,"linear"])).cb=t,n}return h(i,t),u(i,[{key:"onUpdate",value:function(t,e,i){}},{key:"onStart",value:function(){this.cb()}}])}(Qr),ea=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b.GenAutoIncrementId(),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$r;o(this,t),this.id=e,this.timeline=i,this.status=di.INITIAL,this.tailAnimate=new na(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}return u(t,[{key:"setTimeline",value:function(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}},{key:"getStartTime",value:function(){return this._startTime}},{key:"getDuration",value:function(){return this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0)}},{key:"after",value:function(t){var e=t.getDuration();return this._startTime=e,this}},{key:"afterAll",value:function(t){var e=-1/0;return t.forEach((function(t){e=xe(t.getDuration(),e)})),this._startTime=e,this}},{key:"parallel",value:function(t){return this._startTime=t.getStartTime(),this}},{key:"play",value:function(t){if(this.tailAnimate.play(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}},{key:"trySetAttribute",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.mode;e&&i&fi.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:ci.ANIMATE_PLAY})}},{key:"runCb",value:function(t){var e=this,i=new ta((function(){t(e,i.step.prev)}));return this.tailAnimate.play(i),this}},{key:"customInterpolate",value:function(e,i,n,r,a,o){var s=t.interpolateMap.get(e)||t.interpolateMap.get("");return!!s&&s(e,i,n,r,a,o)}},{key:"pause",value:function(){this.status===di.RUNNING&&(this.status=di.PAUSED)}},{key:"resume",value:function(){this.status===di.PAUSED&&(this.status=di.RUNNING)}},{key:"to",value:function(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"from",value:function(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"wait",value:function(t){if(this.tailAnimate.wait(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"startAt",value:function(t){if(this.tailAnimate.startAt(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"loop",value:function(t){if(this.tailAnimate.loop=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"reversed",value:function(t){if(this.tailAnimate.reversed=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"bounce",value:function(t){if(this.tailAnimate.bounce=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"subAnimate",value:function(){var t=new na(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}},{key:"getStartProps",value:function(){return this.subAnimates[0].getStartProps()}},{key:"getEndProps",value:function(){return this.tailAnimate.getEndProps()}},{key:"depreventAttr",value:function(t){this._preventAttrs&&this._preventAttrs.delete(t)}},{key:"preventAttr",value:function(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}},{key:"preventAttrs",value:function(t){var e=this;t.forEach((function(t){return e.preventAttr(t)}))}},{key:"validAttr",value:function(t){return!this._preventAttrs||!this._preventAttrs.has(t)}},{key:"bind",value:function(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((function(e){e.bind(t)})),this}},{key:"advance",value:function(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===di.INITIAL&&(this.status=di.RUNNING,this._onStart&&this._onStart.forEach((function(t){return t()}))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===di.RUNNING&&(this.status=di.END,this._onEnd&&this._onEnd.forEach((function(t){return t()})))}},{key:"setPosition",value:function(t){var e,i=0,n=this.rawPosition,r=this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0);t<0&&(t=0);var a=t>=r;if(a&&(t=r),t===n)return a;for(var o=0;o<this.subAnimates.length&&!(i+(e=this.subAnimates[o]).totalDuration>=t);o++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),a}},{key:"onStart",value:function(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}},{key:"onEnd",value:function(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}},{key:"onRemove",value:function(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}},{key:"onFrame",value:function(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}},{key:"release",value:function(){this.status=di.END}},{key:"stop",value:function(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}],[{key:"AddInterpolate",value:function(e,i){t.interpolateMap.set(e,i)}}])}();ea.mode=fi.NORMAL,ea.interpolateMap=new Map;var ia,na=function(){return u((function t(e,i){o(this,t),this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=e,this.stepHead=new ra(0,0,i?Object.assign({},i.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}),[{key:"totalDuration",get:function(){return this.calcAttr(),this._totalDuration+this._startAt}},{key:"calcAttr",value:function(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}},{key:"bind",value:function(t){return this.target=t,this}},{key:"play",value:function(t){var e=t.duration;(null==e||e<0)&&(e=0);var i=t.easing,n="string"==typeof i?Zr[i]:i,r=this._addStep(e,null,n);return r.type=vi.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}},{key:"to",value:function(t,e,i,n){var r=this;(null==e||e<0)&&(e=0);var a="string"==typeof i?Zr[i]:i,o=this._addStep(e,null,a);return o.type=vi.to,this._appendProps(t,o,!!n&&n.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),n&&n.noPreventAttrs||this.target.animates.forEach((function(t){t.id!==r.animate.id&&t.preventAttrs(o.propKeys)})),this}},{key:"from",value:function(t,e,i,n){var r=this;this.to(t,0,i,n);var a={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((function(t){a[t]=r.getLastPropByName(t,r.stepTail)})),this.to(a,e,i,n),this.stepTail.type=vi.from}},{key:"startAt",value:function(t){return t<0&&(t=0),this._startAt=t,this}},{key:"getStartProps",value:function(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}},{key:"getEndProps",value:function(){return this.stepTail.props}},{key:"getLastStep",value:function(){return this._lastStep}},{key:"wait",value:function(t){if(t>0){var e=this._addStep(+t,null);e.type=vi.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}},{key:"_addStep",value:function(t,e,i){var n=new ra(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}},{key:"_appendProps",value:function(t,e,i){var n=this;e.props=i?t:Object.assign({},t);var r=e.prev,a=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((function(t){void 0===e.props[t]&&(e.props[t]=n.target.getDefaultAttribute(t))}));r.prev;)r.props&&(r.propKeys||(r.propKeys=Object.keys(r.props)),r.propKeys.forEach((function(t){void 0===a[t]&&(a[t]=r.props[t])}))),e.propKeys=Object.keys(e.props),r=r.prev;var o=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(a)),e.propKeys.forEach((function(t){if(void 0===o[t]){var e=n.animate.getStartProps();o[t]=e[t]=n.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}},{key:"_appendCustomAnimate",value:function(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}},{key:"setPosition",value:function(t){var e,i,n,r=this.duration,a=this.loop,o=this.rawPosition,s=!1,u=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<u)return this.rawPosition=t,!1;if(r<=0&&(s=!0,r<0))return s;if(n=(t-=u)-(i=Math.floor(t/r))*r,(s=t>=a*r+r)&&(t=(n=r)*(i=a)+r),t===o)return s;var l=!this.reversed!=!(this.bounce&&i%2);return l&&(n=r-n),this._deltaPosition=n-this.position,this.position=n,this.rawPosition=t+u,this.updatePosition(s,l),s}},{key:"updatePosition",value:function(t,e){if(this.stepHead){var i=this.stepHead.next,n=this.position,r=this.duration;if(this.target&&i){for(var a=i.next;a&&a.position<=n;)a=(i=a).next;var o=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((function(t){return t(i,o)}))}}}},{key:"tryCallCustomAnimateLifeCycle",value:function(t,e,i){if(t!==e)if(i){for(var n=e.prev;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{for(var r=e.next;r&&r!==t;)r.customAnimate&&(r.customAnimate.onStart&&r.customAnimate.onStart(),r.customAnimate.onEnd&&r.customAnimate.onEnd()),r=r.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}},{key:"getLastPropByName",value:function(t,e){for(var i=e.prev;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){var n=i.customAnimate.getEndProps()[t];if(void 0!==n)return n}i=i.prev}return te.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}},{key:"updateTarget",value:function(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}])}(),ra=function(){return u((function t(e,i,n,r){o(this,t),this.duration=i,this.position=e,this.props=n,this.easing=r}),[{key:"append",value:function(t){t.prev=this,t.next=this.next,this.next=t}},{key:"getLastProps",value:function(){for(var t=this.prev;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}])}(),aa=200,oa="cubicOut";!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(ia||(ia={}));var sa=[!1,!1,!1,!1],ua=[0,0,0,0],la=function(t){return t?bt(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(ua[0]=t[0],ua[2]=t[0],ua[1]=t[1],ua[3]=t[1],ua):t:t:0},ha=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],ca=[1,2,3,0,1,2,3,0];function da(t,e,i,n){for(;t>=me;)t-=me;for(;t<0;)t+=me;for(;t>e;)e+=me;ha[0].x=i,ha[1].y=i,ha[2].x=-i,ha[3].y=-i;var r=Math.ceil(t/ge)%4,a=Math.ceil(e/ge)%4;if(n.add(be(t)*i,we(t)*i),n.add(be(e)*i,we(e)*i),r!==a||e-t>pe)for(var o=!1,s=0;s<ca.length;s++)if(o||r!==ca[s]){if(o&&a===ca[s])break;if(o){var u=ha[ca[s]];n.add(u.x,u.y)}}else{o=!0;var l=ha[r];n.add(l.x,l.y)}}function fa(t,e,i){var n=Ee(t.x,t.y,e.x,e.y,i),r=n.x,a=n.y,o=Ee(t.x1,t.y1,e.x1,e.y1,i),s=o.x,u=o.y,l=new Be(r,a,s,u);return l.defined=e.defined,l}function va(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);var n=[];if(t.length>e.length){n=e.map((function(t){var e=new Be(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var r=0;r<e.length;r++)n[r]=fa(t[r],e[r],i)}else{n=e.map((function(t){var e=new Be(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var a=0;a<t.length;a++)n[a]=fa(t[a],e[a],i)}return n}function pa(t,e){if(bt(t)){for(var i,n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}var ga=function(){return u((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.TimeOut;o(this,t),this.durations=[],this.timeout=e,this.lastDate=0,this.durationsListThreshold=30}),[{key:"call",value:function(t){var e=this;return this.lastDate=Date.now(),setTimeout((function(){e.appendDuration(Date.now()-e.lastDate),t(0)}),this.timeout,!0)}},{key:"clear",value:function(t){clearTimeout(t)}},{key:"appendDuration",value:function(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce((function(t,e){return t+e}),0)/this.durations.length,1e3/60),1e3/30)}}])}();ga.TimeOut=1e3/60;var ya,ma=new ga,ka=function(t,e){return _t(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t};!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(ya||(ya={}));var _a=function(){function t(){o(this,t)}return u(t,null,[{key:"Get",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ya.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===ya.Color1){var r=t.store1[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;var a=qe.parseColorString(e);if(a){var o=[a.r/255,a.g/255,a.b/255,a.opacity];t.store1[e]=o,t.store255[e]=[a.r,a.g,a.b,a.opacity],n[0]=o[0],n[1]=o[1],n[2]=o[2],n[3]=o[3]}return n}var s=t.store255[e];if(s)return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n;var u=qe.parseColorString(e);return u&&(t.store1[e]=[u.r/255,u.g/255,u.b/255,u.opacity],t.store255[e]=[u.r,u.g,u.b,u.opacity],n[0]=u.r,n[1]=u.g,n[2]=u.b,n[3]=u.opacity),n}},{key:"Set",value:function(e,i,n){if(i===ya.Color1){if(t.store1[e])return;t.store1[e]=n,t.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(t.store255[e])return;t.store255[e]=n,t.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}])}();function ba(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&wt(t[0])?e?"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),",").concat(t[3].toFixed(2),")"):"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),")"):t}function xa(t,e,i,n,r){return Array.isArray(t)&&!wt(t[0])||Array.isArray(e)&&!wt(e[0])?new Array(4).fill(0).map((function(r,a){return Sa(bt(t)?t[a]:t,bt(e)?e[a]:e,i,n)})):Sa(t,e,i,n,r)}function Sa(t,e,i,n,r){if(!t||!e)return t&&ba(t)||e&&ba(e)||!1;var a,o,s=!1,u=!1;if(Array.isArray(t)?a=t:"string"==typeof t?a=_a.Get(t,ya.Color255):s=!0,Array.isArray(e)?o=e:"string"==typeof e?o=_a.Get(e,ya.Color255):u=!0,s!==u){var l=s?t:e,h=s?e:t,c=Object.assign(Object.assign({},l),{stops:l.stops.map((function(t){return Object.assign(Object.assign({},t),{color:ba(h)})}))});return s?xa(l,c,i,n,r):xa(c,l,i,n,r)}if(s){if(t.gradient===e.gradient){var d=t,f=e,v=d.stops,p=f.stops;if(v.length!==p.length)return!1;if("linear"===d.gradient)return function(t,e,i){var n=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map((function(t,e){return{color:Ta(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(d,f,i);if("radial"===d.gradient)return function(t,e,i){var n=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map((function(t,e){return{color:Ta(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(d,f,i);if("conical"===d.gradient)return function(t,e,i){var n=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map((function(t,e){return{color:Ta(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(d,f,i)}return!1}return r&&r(a,o),ba(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(a,o,i),n)}_a.store255={},_a.store1={};var wa=[0,0,0,0],Aa=[0,0,0,0];function Ta(t,e,i){return _a.Get(t,ya.Color255,wa),_a.Get(e,ya.Color255,Aa),"rgba(".concat(Math.round(wa[0]+(Aa[0]-wa[0])*i),",").concat(Math.round(wa[1]+(Aa[1]-wa[1])*i),",").concat(Math.round(wa[2]+(Aa[2]-wa[2])*i),",").concat(wa[3]+(Aa[3]-wa[3])*i,")")}var Ca=function(){function t(){o(this,t)}return u(t,null,[{key:"GetImage",value:function(e,i){var n,r=t.cache.get(e);r?"fail"===r.loadState?Vn.global.getRequestAnimationFrame()((function(){i.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(n=r.waitingMark)||void 0===n||n.push(i):i&&i.imageLoadSuccess(e,r.data):t.loadImage(e,i)}},{key:"GetSvg",value:function(e,i){var n,r=t.cache.get(e);r?"fail"===r.loadState?Vn.global.getRequestAnimationFrame()((function(){i.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(n=r.waitingMark)||void 0===n||n.push(i):i&&i.imageLoadSuccess(e,r.data):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=Vn.global.loadSvg(e),r.dataPromise?(r.waitingMark=[i],r.dataPromise.then((function(t){var i;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(i=r.waitingMark)||void 0===i||i.map((function(i,n){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,i.imageLoadSuccess(e,t.data)):(r.loadState="fail",i.imageLoadFail(e))}))}))):(r.loadState="fail",i.imageLoadFail(e)))}},{key:"GetFile",value:function(e,i){var n=t.cache.get(e);return n?"init"===n.loadState||"fail"===n.loadState?Promise.reject():"loading"===n.loadState?n.dataPromise.then((function(t){return t.data})):Promise.resolve(n.data):(n={type:i,loadState:"init"},t.cache.set(e,n),"arrayBuffer"===i?n.dataPromise=Vn.global.loadArrayBuffer(e):"blob"===i?n.dataPromise=Vn.global.loadBlob(e):"json"===i&&(n.dataPromise=Vn.global.loadJson(e)),n.dataPromise.then((function(t){return t.data})))}},{key:"loading",value:function(){var e=this;setTimeout((function(){if(!t.isLoading&&t.toLoadAueue.length){t.isLoading=!0;var i=t.toLoadAueue.splice(0,10),n=[];i.forEach((function(e){var i=e.url,r=e.marks,a={type:"image",loadState:"init"};if(t.cache.set(i,a),a.dataPromise=Vn.global.loadImage(i),a.dataPromise){a.waitingMark=r;var o=a.dataPromise.then((function(t){var e;a.loadState=(null==t?void 0:t.data)?"success":"fail",a.data=null==t?void 0:t.data,null===(e=a.waitingMark)||void 0===e||e.map((function(e,n){(null==t?void 0:t.data)?(a.loadState="success",a.data=t.data,e.imageLoadSuccess(i,t.data)):(a.loadState="fail",e.imageLoadFail(i))}))}));n.push(o)}else a.loadState="fail",r.forEach((function(t){return t.imageLoadFail(i)}))})),Promise.all(n).then((function(){t.isLoading=!1,e.onLoadSuccessCb.forEach((function(t){return t()})),t.loading()})).catch((function(i){console.error(i),t.isLoading=!1,e.onLoadSuccessCb.forEach((function(t){return t()})),t.loading()}))}}),0)}},{key:"loadImage",value:function(e,i){var n=Ea(e,t.toLoadAueue);if(-1!==n)return t.toLoadAueue[n].marks.push(i),void t.loading();t.toLoadAueue.push({url:e,marks:[i]}),t.loading()}},{key:"improveImageLoading",value:function(e){var i=Ea(e,t.toLoadAueue);if(-1!==i){var n=t.toLoadAueue.splice(i,1);t.toLoadAueue.unshift(n[0])}}},{key:"onLoadSuccess",value:function(t){this.onLoadSuccessCb.push(t)}}])}();function Ea(t,e){for(var i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Ca.cache=new Map,Ca.isLoading=!1,Ca.toLoadAueue=[],Ca.onLoadSuccessCb=[];var Ba=new De,Ra=new Oe,Ma=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Pa=["x","y"],Oa=["scaleX","scaleY"],Ia=["angle"],La=new Be,Da={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1},Fa=function(t){function i(){var t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,i),(t=e(this,i))._AABBBounds=new Oe,t._updateTag=li.INIT,t.attribute=r,t.valid=t.isValid(),r.background?t.loadImage(null!==(n=r.background.background)&&void 0!==n?n:r.background,!0):r.shadowGraphic&&t.setShadowGraphic(r.shadowGraphic),t}return h(i,t),u(i,[{key:"AABBBounds",get:function(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}},{key:"globalAABBBounds",get:function(){return this.tryUpdateGlobalAABBBounds()}},{key:"transMatrix",get:function(){return this.tryUpdateLocalTransMatrix(!0)}},{key:"globalTransMatrix",get:function(){return this.tryUpdateGlobalTransMatrix(!0)}},{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"getOffsetXY",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attribute,a=r.dx,o=void 0===a?t.dx:a,s=r.dy,u=void 0===s?t.dy:s;if(n&&this.parent){var l=this.parent.attribute;La.x=o+(null!==(e=l.scrollX)&&void 0!==e?e:0),La.y=u+(null!==(i=l.scrollY)&&void 0!==i?i:0)}else La.x=o,La.y=u;return La}},{key:"onAnimateBind",value:function(t){this._emitCustomEvent("animate-bind",t)}},{key:"tryUpdateAABBBounds",value:function(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Vn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var e=this.doUpdateAABBBounds(t);return Vn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}},{key:"combindShadowAABBBounds",value:function(t){if(this.shadowRoot){var e=this.shadowRoot.AABBBounds.clone();t.union(e)}}},{key:"doUpdateAABBBounds",value:function(t){var e=this.getGraphicTheme();this._AABBBounds.clear();var i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,o=la(a);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"updatePathProxyAABBBounds",value:function(t){var e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;var i=new _i(t);return Li(e.commandList,i,0,0),!0}},{key:"tryUpdateGlobalAABBBounds",value:function(){var t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}},{key:"tryUpdateGlobalTransMatrix",value:function(){if(this._globalTransMatrix){if(this.parent){var t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}},{key:"shouldUpdateGlobalMatrix",value:function(){return!0}},{key:"tryUpdateLocalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new De),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}},{key:"shouldUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&li.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&li.UPDATE_BOUNDS)}},{key:"shouldSelfChangeUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&li.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&li.UPDATE_BOUNDS)}},{key:"shouldUpdateLocalMatrix",value:function(){return!!(this._updateTag&li.UPDATE_LOCAL_MATRIX)}},{key:"isValid",value:function(){var t,e,i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}},{key:"_validNumber",value:function(t){return null==t||Number.isFinite(t)}},{key:"shouldUpdateShape",value:function(){return!!(this._updateTag&li.UPDATE_SHAPE)}},{key:"clearUpdateShapeTag",value:function(){this._updateTag&=li.CLEAR_SHAPE}},{key:"containsPoint",value:function(t,e,i,n){if(!n)return!1;if(i===hi.GLOBAL){var r=new Be(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),t=r.x,e=r.y}return n.containsPoint(this,{x:t,y:e})}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}},{key:"_setAttributes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,n=Object.keys(t),r=0;r<n.length;r++){var a=n[r];this.attribute[a]=t[a]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}},{key:"setAttribute",value:function(t,e,i,n){var r,a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(l({},t,e),this.attribute,t,n);a?this._setAttributes(a,i,n):vt(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}},{key:"needUpdateTags",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ma,i=0;i<e.length;i++){var n=e[i];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ma,i=0;i<e.length;i++)if(t===e[i])return!0;return!1}},{key:"initAttributes",value:function(t){var e={type:ci.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=li.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}},{key:"translate",value:function(t,e){var i,n;if(0===t&&0===e)return this;var r={type:ci.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Pa,r);a&&(t=a.x,e=a.y,delete a.x,delete a.y,this._setAttributes(a));var o=this.attribute,s=o.postMatrix;return s?Vn.transformUtil.fromMatrix(s,s).translate(t,e):(o.x=(null!==(i=o.x)&&void 0!==i?i:xn.x)+t,o.y=(null!==(n=o.y)&&void 0!==n?n:xn.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}},{key:"translateTo",value:function(t,e){var i=this.attribute;if(i.x===t&&i.y===e)return this;var n={type:ci.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Pa,n);return r?(this._setAttributes(r,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}},{key:"scale",value:function(t,e,i){var n,r;if(1===t&&1===e)return this;var a={type:ci.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,Oa,a);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));var s=this.attribute;if(i){var u=this.attribute.postMatrix;u||(u=new De,s.postMatrix=u),Vn.transformUtil.fromMatrix(u,u).scale(t,e,i)}else s.scaleX=(null!==(n=s.scaleX)&&void 0!==n?n:xn.scaleX)*t,s.scaleY=(null!==(r=s.scaleY)&&void 0!==r?r:xn.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}},{key:"scaleTo",value:function(t,e){var i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;var n={type:ci.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Oa,n);return r?(this._setAttributes(r,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}},{key:"rotate",value:function(t,e){var i;if(0===t)return this;var n={type:ci.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Ia,n);r&&(delete r.angle,this._setAttributes(r,!1,n));var a=this.attribute;if(e){var o=this.attribute.postMatrix;o||(o=new De,a.postMatrix=o),Vn.transformUtil.fromMatrix(o,o).rotate(t,e)}else a.angle=(null!==(i=a.angle)&&void 0!==i?i:xn.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}},{key:"rotateTo",value:function(t){var e=this.attribute;if(e.angle===t)return this;var i={type:ci.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Ia,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}},{key:"skewTo",value:function(t,e){return this}},{key:"animate",value:function(t){var e=this;this.animates||(this.animates=new Map);var i=new ea(null==t?void 0:t.id,this.stage&&this.stage.getTimeline()).bind(this);if(t){var n=t.onStart,r=t.onFrame,a=t.onEnd,o=t.onRemove;null!=n&&i.onStart(n),null!=r&&i.onFrame(r),null!=a&&i.onEnd(a),null!=o&&i.onRemove(o),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((function(){e.animates.delete(i.id)})),i}},{key:"onAttributeUpdate",value:function(t){t&&t.skipUpdateCallback||(Vn.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}},{key:"update",value:function(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}},{key:"hasState",value:function(t){return!(!this.currentStates||!this.currentStates.length)&&(!!vt(t)||this.currentStates.includes(t))}},{key:"getState",value:function(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}},{key:"applyStateAttrs",value:function(t,e,i,n){var r,a,o,s,u=this;if(i){var l,h=Object.keys(t),c=this.getNoWorkAnimateAttr(),d={};h.forEach((function(e){c[e]?(l||(l={}),l[e]=t[e]):d[e]=n&&void 0===t[e]?u.getDefaultAttribute(e):t[e]}));var f=this.animate();f.stateNames=e,f.to(d,null!==(a=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==a?a:aa,null!==(s=null===(o=this.stateAnimateConfig)||void 0===o?void 0:o.easing)&&void 0!==s?s:oa),l&&this.setAttributes(l,!1,{type:ci.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:ci.STATE})}},{key:"updateNormalAttrs",value:function(t){var e=this,i={};this.normalAttrs?(Object.keys(t).forEach((function(t){t in e.normalAttrs?(i[t]=e.normalAttrs[t],delete e.normalAttrs[t]):i[t]=e.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((function(i){t[i]=e.normalAttrs[i]}))):Object.keys(t).forEach((function(t){i[t]=e.getNormalAttribute(t)})),this.normalAttrs=i}},{key:"stopStateAnimates",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((function(i){i.stateNames&&(i.stop(e),t.animates.delete(i.id))}))}},{key:"getNormalAttribute",value:function(t){var e=this.attribute[t];return this.animates&&this.animates.forEach((function(i){if(i.stateNames){var n=i.getEndProps();Lt(n,t)&&(e=n[t])}})),e}},{key:"clearStates",value:function(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}},{key:"removeState",value:function(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){var i=this.currentStates.filter((function(e){return e!==t}));this.useStates(i,e)}}},{key:"toggleState",value:function(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){var i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}},{key:"addState",value:function(t,e,i){var n;if(!this.currentStates||!this.currentStates.includes(t)||!e&&1!==this.currentStates.length){var r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}}},{key:"useStates",value:function(t,e){var i,n=this;if(t.length){if((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some((function(t,e){return n.currentStates[e]!==t}))){var r={};t.forEach((function(e){var i,a=n.stateProxy?n.stateProxy(e,t):null===(i=n.states)||void 0===i?void 0:i[e];a&&Object.assign(r,a)})),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}}else this.clearStates(e)}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=li.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"addUpdateShapeTag",value:function(){this._updateTag|=li.UPDATE_SHAPE}},{key:"addUpdateShapeAndBoundsTag",value:function(){this._updateTag|=li.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"updateShapeAndBoundsTagSetted",value:function(){return(this._updateTag&li.UPDATE_SHAPE_AND_BOUNDS)===li.UPDATE_SHAPE_AND_BOUNDS}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=li.CLEAR_BOUNDS}},{key:"addUpdatePositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=li.UPDATE_GLOBAL_LOCAL_MATRIX}},{key:"addUpdateGlobalPositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=li.UPDATE_GLOBAL_MATRIX}},{key:"clearUpdateLocalPositionTag",value:function(){this._updateTag&=li.CLEAR_LOCAL_MATRIX}},{key:"clearUpdateGlobalPositionTag",value:function(){this._updateTag&=li.CLEAR_GLOBAL_MATRIX}},{key:"addUpdateLayoutTag",value:function(){this._updateTag|=li.UPDATE_LAYOUT}},{key:"clearUpdateLayoutTag",value:function(){this._updateTag&=li.CLEAR_LAYOUT}},{key:"needUpdateLayout",value:function(){return!!(this._updateTag&li.UPDATE_LAYOUT)}},{key:"getAnchor",value:function(t,e){var i=this,n=[0,0],r=function(){if(e.b)return e.b;var t=i.attribute,n=t.scaleX,r=t.scaleY,a=t.angle;return Ra.copy(i._AABBBounds),i.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=i.AABBBounds.clone(),i._AABBBounds.copy(Ra),i.setAttributes({scaleX:n,scaleY:r,angle:a}),e.b};if("string"==typeof t[0]){var a=parseFloat(t[0])/100,o=r();n[0]=o.x1+(o.x2-o.x1)*a}else n[0]=t[0];if("string"==typeof t[1]){var s=parseFloat(t[1])/100,u=r();n[1]=u.y1+(u.y2-u.y1)*s}else n[1]=t[1];return n}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,i=void 0===e?xn.x:e,n=t.y,r=void 0===n?xn.y:n,a=t.scaleX,o=void 0===a?xn.scaleX:a,s=t.scaleY,u=void 0===s?xn.scaleY:s,l=t.angle,h=void 0===l?xn.angle:l,c=t.scaleCenter,d=t.anchor,f=t.postMatrix,v=[0,0],p={};if(d&&(v=this.getAnchor(d,p)),!c||1===o&&1===u)!function(t,e,i,n,r,a,o,s){var u,l,h=e.a,c=e.b,d=e.c,f=e.d,v=e.e,p=e.f,g=be(o),y=we(o);s?(u=s[0],l=s[1]):(u=i,l=n);var m=u-i,k=l-n,_=h*g+d*y,b=c*g+f*y,x=d*g-h*y,S=f*g-c*y;t.a=r*_,t.b=r*b,t.c=a*x,t.d=a*S,t.e=v+h*u+d*l-_*m-x*k,t.f=p+c*u+f*l-b*m-S*k}(this._transMatrix,this._transMatrix.reset(),i,r,o,u,h,d&&v);else{var g=this._transMatrix;g.reset(),g.translate(v[0],v[1]),g.rotate(h),g.translate(-v[0],-v[1]),g.translate(i,r),v=this.getAnchor(c,p),Vn.transformUtil.fromMatrix(g,g).scale(o,u,{x:v[0],y:v[1]})}var y=this.getOffsetXY(xn);if(this._transMatrix.e+=y.x,this._transMatrix.f+=y.y,f){var m=Ba.setValue(f.a,f.b,f.c,f.d,f.e,f.f),k=this._transMatrix;m.multiply(k.a,k.b,k.c,k.d,k.e,k.f),k.setValue(m.a,m.b,m.c,m.d,m.e,m.f)}}},{key:"doUpdateGlobalMatrix",value:function(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);var t=this.parent.attribute,e=t.scrollX,i=void 0===e?0:e,n=t.scrollY,r=void 0===n?0:n;this._globalTransMatrix.translate(i,r)}}},{key:"setStage",value:function(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){var i=t.getTimeline();this.animates.forEach((function(t){t.setTimeline(i)}))}this._onSetStage&&this._onSetStage(this,t,e),Vn.graphicService.onSetStage(this,t)}}},{key:"setStageToShadowRoot",value:function(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}},{key:"onAddStep",value:function(t){}},{key:"onStop",value:function(t){t&&this.setAttributes(t,!1,{type:ci.ANIMATE_END})}},{key:"onStep",value:function(t,e,i,n,r){var a={};if(i.customAnimate)i.customAnimate.update(r,n,a);else{var o=i.props,s=i.parsedProps,u=i.propKeys;this.stepInterpolate(t,e,a,i,n,r,o,void 0,s,u)}this.setAttributes(a,!1,{type:ci.ANIMATE_UPDATE,animationState:{ratio:n,end:r,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}},{key:"stepInterpolate",value:function(t,e,i,n,r,a,o,s,u,l){var h=this;l||(l=Object.keys(o),n.propKeys=l),a?n.propKeys.forEach((function(t){e.validAttr(t)&&(i[t]=o[t])})):l.forEach((function(a){var l;if(e.validAttr(a)){var c=o[a],d=null!==(l=s&&s[a])&&void 0!==l?l:t.getLastPropByName(a,n);if(null!=c&&null!=d)e.interpolateFunc&&e.interpolateFunc(a,r,d,c,i)||(e.customInterpolate(a,r,d,c,h,i)||h.defaultInterpolate(c,d,a,i,u,r)||h._interpolate(a,r,d,c,i));else i[a]=c}})),n.parsedProps=u}},{key:"defaultInterpolate",value:function(t,e,i,n,r,a){if(Number.isFinite(t))return n[i]=e+(t-e)*a,!0;if("fill"===i){r||(r={});var o=r.fillColorArray,s=xa(e,null!=o?o:t,a,!1,(function(t,e){r.fillColorArray=e}));return s&&(n[i]=s),!0}if("stroke"===i){r||(r={});var u=r.strokeColorArray,l=xa(e,null!=u?u:t,a,!1,(function(t,e){r.strokeColorArray=e}));return l&&(n[i]=l),!0}if("shadowColor"===i){r||(r={});var h=r.shadowColorArray,c=xa(e,null!=h?h:t,a,!0,(function(t,e){r.shadowColorArray=e}));return c&&(n[i]=c),!0}return!1}},{key:"_interpolate",value:function(t,e,i,n,r){}},{key:"getDefaultAttribute",value:function(t){return this.getGraphicTheme()[t]}},{key:"getComputedAttribute",value:function(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}},{key:"onSetStage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}},{key:"attachShadow",value:function(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Vn.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}},{key:"detachShadow",value:function(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}},{key:"toJson",value:function(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((function(t){return t.toJson()}))}}},{key:"createPathProxy",value:function(t){return _t(t,!0)?this.pathProxy=(new kn).fromString(t):this.pathProxy=new kn,this.pathProxy}},{key:"loadImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))){var i=t;this.resources||(this.resources=new Map);var n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Ca.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(Tt(t)||t.includes("/")||Ct(t))&&(Ca.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):gt(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}}},{key:"setShadowGraphic",value:function(t){t?this.attachShadow().add(t):this.detachShadow()}},{key:"imageLoadSuccess",value:function(t,e,i){if(this.resources){var n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}}},{key:"imageLoadFail",value:function(t,e){if(this.resources){var i=this.resources.get(t);i&&(i.state="fail",e&&e())}}},{key:"_stopAnimates",value:function(t){t&&t.forEach((function(t){t.stop()}))}},{key:"stopAnimates",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((function(e){e.stopAnimates(t)}))}},{key:"release",value:function(){this.releaseStatus="released",Vn.graphicService.onRelease(this)}},{key:"_emitCustomEvent",value:function(t,e){var i,n;if(this._events&&t in this._events){var r=new Fr(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}],[{key:"mixin",value:function(t){for(var e=Object.keys(t),n=0;n<e.length;++n){var r=e[n];Object.defineProperty(i.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}}])}(Pr);Fa.mixin(Gr);var ja=function(){return u((function t(e){o(this,t),this.tagname=e,this.child=[],this[":@"]={}}),[{key:"add",value:function(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push(l({},t,e))}},{key:"addChild",value:function(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(l(l({},t.tagname,t.child),":@",t[":@"])):this.child.push(l({},t.tagname,t.child))}}])}();function Na(t,e,i,n){var r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function za(t,e,i){var n=function(t,e){for(var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="",a=e;a<t.length;a++){var o=t[a];if(i)o===i&&(i="");else if('"'===o||"'"===o)i=o;else if(o===n[0]){if(!n[1])return{data:r,index:a};if(t[a+1]===n[1])return{data:r,index:a}}else"\t"===o&&(o=" ");r+=o}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(n){var r=n.data,a=n.index,o=r.search(/\s/),s=r,u=!0;-1!==o&&(s=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));var l=s;if(i){var h=s.indexOf(":");-1!==h&&(u=(s=s.substr(h+1))!==n.data.substr(h+1))}return{tagName:s,tagExp:r,closeIndex:a,attrExpPresent:u,rawTagName:l}}}var Ua=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm"),Ga=function(){return u((function t(e){o(this,t),this.currentNode=null,this.options=e,this.tagsNodeStack=[],this.docTypeEntities={}}),[{key:"addChild",value:function(t,e,i){var n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}},{key:"buildAttributesMap",value:function(t,e,i){var n={};if(t){for(var r=function(t,e){for(var i=[],n=e.exec(t);n;){var r=[];r.startIndex=e.lastIndex-n[0].length;for(var a=n.length,o=0;o<a;o++)r.push(n[o]);i.push(r),n=e.exec(t)}return i}(t,Ua),a=r.length,o=0;o<a;o++){var s=r[o][1],u=r[o][4];s&&(n[s]=void 0===u||(isNaN(u)?u:Number(u)))}return n}}},{key:"parseXml",value:function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new ja("!xml"),i=e,n="",r="",a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var o=Na(t,">",a,"Closing Tag is not closed."),s=r.lastIndexOf(".");r=r.substring(0,s),(i=this.tagsNodeStack.pop())&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",a=o}else if("?"===t[a+1])a=za(t,a,!1,"?>").closeIndex+1;else if("!--"===t.substr(a+1,3))a=Na(t,"--\x3e",a+4,"Comment is not closed.");else{var u=za(t,a,!1),l=u.tagName,h=u.tagExp,c=u.attrExpPresent,d=u.closeIndex;if(l!==e.tagname&&(r+=r?"."+l:l),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),r=r.substr(0,r.length-1),h=l):h=h.substr(0,h.length-1);var f=new ja(l);l!==h&&c&&(f[":@"]=this.buildAttributesMap(h,r,l)),this.addChild(i,f,r),r=r.substr(0,r.lastIndexOf("."))}else{var v=new ja(l);this.tagsNodeStack.push(i),l!==h&&c&&(v[":@"]=this.buildAttributesMap(h,r,l)),this.addChild(i,v,r),i=v}n="",a=d}else n+=t[a];return e.child}}])}();function Wa(t,e){return Va(t)}function Va(t,e){for(var i,n={},r=0;r<t.length;r++){var a=t[r],o=Ha(a);if(void 0!==o&&a[o]){var s=Va(a[o]);i=s,Object.keys(i).length,a[":@"]&&Ka(s,a[":@"]),void 0!==n[o]&&n.hasOwnProperty(o)?(Array.isArray(n[o])||(n[o]=[n[o]]),n[o].push(s)):n[o]=s}}return n}function Ha(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(":@"!==n)return n}}function Ka(t,e,i){if(e)for(var n=Object.keys(e),r=n.length,a=0;a<r;a++){var o=n[a];t[o]=e[o]}}var Xa=function(){return u((function t(e){o(this,t),this.options=Object.assign({},t.defaultOptions,e)}),[{key:"valid",value:function(t){return t.startsWith("<")}},{key:"parse",value:function(t){return!!this.valid&&Wa(new Ga(this.options).parseXml(t),this.options)}}])}();Xa.defaultOptions={};var Ya=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}u((n=n.apply(t,e||[])).next())}))};function qa(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}var Za,Ja=0;function $a(){return Ja++}function Qa(t){for(var e=[],i=0,n="",r=0;r<t.length;r++)io(t[r])?i?n+=t[r]:(i=1,n=t[r]):(i&&(e.push({text:n,direction:Za.VERTICAL}),n="",i=0),e.push({text:t[r],direction:Za.HORIZONTAL}));return n&&e.push({text:n,direction:Za.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Za||(Za={}));var to=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((function(t){return to.set(t,!0)}));var eo=new Map;function io(t){if(to.has(t))return!0;if(eo.has(t))return!1;var e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((function(t){return eo.set(t,!0)}));var no,ro=$a(),ao=$a(),oo=$a(),so=$a(),uo=$a(),lo=$a(),ho=$a(),co=$a(),fo=$a(),vo=$a(),po=$a(),go=$a(),yo=$a(),mo=$a(),ko=$a(),_o=$a(),bo=Symbol.for("GraphicService"),xo=Symbol.for("GraphicCreator"),So={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},wo=Object.keys(So);!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(no||(no={}));var Ao=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="group",n.parent=null,n.isContainer=!0,n.numberType=lo,n._childUpdateTag=li.UPDATE_BOUNDS,n}return h(i,t),u(i,[{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"setTheme",value:function(t){return this.theme||(this.theme=new Er),this.theme.setTheme(t,this)}},{key:"createTheme",value:function(){this.theme||(this.theme=new Er)}},{key:"visibleAll",value:function(t){this.setAttribute("visible",t),this.forEachChildren((function(e){e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}},{key:"hideAll",value:function(){this.visibleAll(!1)}},{key:"showAll",value:function(){this.visibleAll(!0)}},{key:"containsPoint",value:function(t,e,i){if(i===hi.GLOBAL){var n=new Be(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}},{key:"shouldUpdateAABBBounds",value:function(){return!!p(c(i.prototype),"shouldUpdateAABBBounds",this).call(this)||!!(this._childUpdateTag&li.UPDATE_BOUNDS)}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Vn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Vn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,n=void 0===e?xn.x:e,r=t.y,a=void 0===r?xn.y:r,o=t.dx,s=void 0===o?xn.dx:o,u=t.dy,l=void 0===u?xn.dy:u,h=t.scaleX,d=void 0===h?xn.scaleX:h,f=t.scaleY,v=void 0===f?xn.scaleY:f,g=t.angle,y=void 0===g?xn.angle:g,m=t.postMatrix;if(0!==n||0!==a||0!==s||0!==l||1!==d||1!==v||0!==y||m)return p(c(i.prototype),"doUpdateLocalMatrix",this).call(this);this._transMatrix.reset()}},{key:"getGraphicTheme",value:function(){return Rr(this).group}},{key:"updateAABBBounds",value:function(t,e,i){var n=i;i=i.clone();var r=t.width,a=t.height,o=t.path,s=t.clip,u=void 0===s?e.clip:s;return t.display,o&&o.length?o.forEach((function(t){i.union(t.AABBBounds)})):null!=r&&null!=a&&i.set(0,0,Math.max(0,r),Math.max(0,a)),u||this.forEachChildren((function(t){i.union(t.AABBBounds)})),Vn.graphicService.updateTempAABBBounds(i),Vn.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}},{key:"doUpdateAABBBounds",value:function(){var t=p(c(i.prototype),"doUpdateAABBBounds",this).call(this);return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=li.CLEAR_BOUNDS,this._childUpdateTag&=li.CLEAR_BOUNDS}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=li.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}},{key:"addChildUpdateBoundTag",value:function(){this._childUpdateTag&li.UPDATE_BOUNDS||(this._childUpdateTag|=li.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}},{key:"getTheme",value:function(){return this.theme.getTheme(this)}},{key:"incrementalAppendChild",value:function(t){var e=p(c(i.prototype),"appendChild",this).call(this,t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),Vn.graphicService.onAddIncremental(t,this,this.stage),e}},{key:"incrementalClearChild",value:function(){p(c(i.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag(),Vn.graphicService.onClearIncremental(this,this.stage)}},{key:"_updateChildToStage",value:function(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=p(c(i.prototype),"appendChild",this).call(this,t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}},{key:"insertBefore",value:function(t,e){return this._updateChildToStage(p(c(i.prototype),"insertBefore",this).call(this,t,e))}},{key:"insertAfter",value:function(t,e){return this._updateChildToStage(p(c(i.prototype),"insertAfter",this).call(this,t,e))}},{key:"insertInto",value:function(t,e){return this._updateChildToStage(p(c(i.prototype),"insertInto",this).call(this,t,e))}},{key:"removeChild",value:function(t){var e=p(c(i.prototype),"removeChild",this).call(this,t);return t.stage=null,Vn.graphicService.onRemove(t),this.addUpdateBoundTag(),e}},{key:"removeAllChild",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((function(e){Vn.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),p(c(i.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag()}},{key:"setStage",value:function(t,e){var i=this;this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),Vn.graphicService.onSetStage(this,t),this.forEachChildren((function(e){e.setStage(t,i.layer)})))}},{key:"addUpdatePositionTag",value:function(){p(c(i.prototype),"addUpdatePositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"addUpdateGlobalPositionTag",value:function(){p(c(i.prototype),"addUpdateGlobalPositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){var e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"shouldUpdateGlobalMatrix",value:function(){return!!(this._updateTag&li.UPDATE_GLOBAL_MATRIX)}},{key:"_getChildByName",value:function(t,e){return this.find((function(e){return e.name===t}),e)}},{key:"createOrUpdateChild",value:function(t,e,i){var n=this._getChildByName(t);return n?n.setAttributes(e):((n=Vn.graphicService.creator[i](e)).name=t,this.add(n)),n}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function To(t){return new Ao(t)}Ao.NOWORK_ANIMATE_ATTR=Da;var Co,Eo=function(t){function i(t,n,r,a){var s,u;return o(this,i),(s=e(this,i,[{}])).stage=t,s.global=n,s.window=r,s.main=a.main,s.layerHandler=a.layerHandler,s.layerHandler.init(f(s),r,{main:a.main,canvasId:a.canvasId,width:s.viewWidth,height:s.viewHeight,zIndex:null!==(u=a.zIndex)&&void 0!==u?u:0}),s.layer=f(s),s.subLayers=new Map,s.theme=new Er,s.background="rgba(0, 0, 0, 0)",s.afterDrawCbs=[],s}return h(i,t),u(i,[{key:"offscreen",get:function(){return this.layerHandler.offscreen}},{key:"layerMode",get:function(){return this.layerHandler.type}},{key:"width",get:function(){return this.stage?this.stage.width:0}},{key:"height",get:function(){return this.stage?this.stage.height:0}},{key:"viewWidth",get:function(){return this.stage?this.stage.viewWidth:0}},{key:"viewHeight",get:function(){return this.stage?this.stage.viewHeight:0}},{key:"dirtyBound",get:function(){throw new Error("暂不支持")}},{key:"dpr",get:function(){return this._dpr}},{key:"combineSubLayer",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=Array.from(this.subLayers.values()).sort((function(t,e){return t.zIndex-e.zIndex}));this.layerHandler.merge(i.map((function(t){return t.layer.subLayers.size&&t.layer.combineSubLayer(e),t.layer.getNativeHandler()}))),e&&i.forEach((function(t){t.group&&(t.group.incremental=0)})),i.forEach((function(e){Vn.layerService.releaseLayer(t.stage,e.layer)})),this.subLayers.clear()}},{key:"getNativeHandler",value:function(){return this.layerHandler}},{key:"setStage",value:function(t,e){p(c(i.prototype),"setStage",this).call(this,t,this)}},{key:"pick",value:function(t,e){throw new Error("暂不支持")}},{key:"tryRenderSecondaryLayer",value:function(t,e){var i=this;this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((function(n){n.layer.renderCount=i.renderCount,n.layer.render(t,e)}))}},{key:"render",value:function(t,e){var i,n=this;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((function(t){return t(n)})),this.tryRenderSecondaryLayer(t,e)}},{key:"resize",value:function(t,e){this.layerHandler.resize(t,e)}},{key:"resizeView",value:function(t,e){this.layerHandler.resizeView(t,e)}},{key:"setDpr",value:function(t){this.layerHandler.setDpr(t)}},{key:"afterDraw",value:function(t){this.afterDrawCbs.push(t)}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"prepare",value:function(t,e){}},{key:"release",value:function(){var t=this;p(c(i.prototype),"release",this).call(this),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((function(e){Vn.layerService.releaseLayer(t.stage,e.layer)}))}},{key:"drawTo",value:function(t,e){var i,n=this;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((function(t){return t(n)}))}}])}(Ao),Bo=Symbol.for("TransformUtil"),Ro=Symbol.for("GraphicUtil"),Mo=Symbol.for("LayerService"),Po=Symbol.for("StaticLayerHandlerContribution"),Oo=Symbol.for("DynamicLayerHandlerContribution"),Io=Symbol.for("VirtualLayerHandlerContribution"),Lo=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Do=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fo=Co=function(){return u((function t(){o(this,t),this.layerMap=new Map,this.global=Vn.global}),[{key:"tryInit",value:function(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}},{key:"getStageLayer",value:function(t){return this.layerMap.get(t)}},{key:"getRecommendedLayerType",value:function(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}},{key:"getLayerHandler",value:function(t){return"static"===t?or.get(Po):"dynamic"===t?or.get(Oo):or.get(Io)}},{key:"createLayer",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();var n=this.getRecommendedLayerType(i.layerMode);n=i.main||i.canvasId?"static":n;var r=this.getLayerHandler(n),a=new Eo(t,this.global,t.window,Object.assign(Object.assign({main:!1},i),{layerMode:n,canvasId:null!==(e=i.canvasId)&&void 0!==e?e:Co.GenerateLayerId(),layerHandler:r})),o=this.layerMap.get(t)||[];return o.push(a),this.layerMap.set(t,o),this.staticLayerCountInEnv--,a}},{key:"prepareStageLayer",value:function(t){var e;t.forEachChildren((function(t){var i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i).secondaryHandlers=[]}))}},{key:"releaseLayer",value:function(t,e){e.release();var i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((function(t){return t!==e})))}},{key:"layerCount",value:function(t){return(this.layerMap.get(t)||[]).length}},{key:"restLayerCount",value:function(t){return"browser"===this.global.env?10:0}},{key:"releaseStage",value:function(t){this.layerMap.delete(t)}}],[{key:"GenerateLayerId",value:function(){return"".concat(Co.idprefix,"_").concat(Co.prefix_count++)}}])}();Fo.idprefix="visactor_layer",Fo.prefix_count=0,Fo=Co=Lo([L(),Do("design:paramtypes",[])],Fo);var jo=new x((function(t){t(nt).to(st).inSingletonScope(),t(vr).to(gr),t(Ro).to(br).inSingletonScope(),t(Bo).to(Sr).inSingletonScope(),t(Mo).to(Fo).inSingletonScope()}));function No(t,e){return!(!t&&!e)}function zo(t,e){return(bt(t)?t.some((function(t){return t||void 0===t})):!!t)&&e>0}function Uo(t,e,i){return i&&t*e>0}function Go(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}function Wo(t,e){return t*e>0}function Vo(t,e,i,n){return t*e>0&&0!==i&&0!==n}function Ho(t,e,i,n,r,a,o){var s=t-i,u=e-n,l=(o?a:-a)/Math.sqrt(s*s+u*u),h=l*u,c=-l*s,d=t+h,f=e+c,v=i+h,p=n+c,g=(d+v)/2,y=(f+p)/2,m=v-d,k=p-f,_=m*m+k*k,b=r-a,x=d*p-v*f,S=(k<0?-1:1)*Math.sqrt(Math.max(0,b*b*_-x*x)),w=(x*k-m*S)/_,A=(-x*m-k*S)/_,T=(x*k+m*S)/_,C=(-x*m+k*S)/_,E=w-g,B=A-y,R=T-g,M=C-y;return E*E+B*B>R*R+M*M&&(w=T,A=C),{cx:w,cy:A,x01:-h,y01:-c,x11:w*(r/b-1),y11:A*(r/b-1)}}function Ko(t,e,i,n,r){var a,o,s,u,l,h,c,d,f,v,p,g,y,m,k=ke(i-e),_=t.getParsedCornerRadius(),b=bt(_),x=t.getParsePadAngle(e,i),S=x.outerDeltaAngle,w=x.innerDeltaAngle,A=x.outerStartAngle,T=x.outerEndAngle,C=x.innerEndAngle,E=x.innerStartAngle,B=b?_[0]:_,R=b?_[1]:_,M=b?_[2]:_,P=b?_[3]:_,O=Math.max(R,B),I=Math.max(M,P),L=O,D=I,F=r*be(A),j=r*we(A),N=n*be(C),z=n*we(C);if((I>ve||O>ve)&&(a=r*be(T),o=r*we(T),s=n*be(E),u=n*we(E),k<pe)){var U=(m=(y=z-(f=o))*(v=s-(h=F))-(g=N-(d=a))*(p=u-(c=j)))*m<ve?[]:[h+(m=(g*(c-f)-y*(h-d))/m)*v,c+m*p];if(U){var G=F-U[0],W=j-U[1],V=a-U[0],H=o-U[1],K=1/we(((l=(G*V+W*H)/(Ae(G*G+W*W)*Ae(V*V+H*H)))>1?0:l<-1?pe:Math.acos(l))/2),X=Ae(U[0]*U[0]+U[1]*U[1]);D=Se(I,(n-X)/(K-1)),L=Se(O,(r-X)/(K+1))}}return{outerDeltaAngle:S,xors:F,yors:j,xirs:s,yirs:u,xore:a,yore:o,xire:N,yire:z,limitedOcr:L,limitedIcr:D,outerCornerRadiusStart:B,outerCornerRadiusEnd:R,maxOuterCornerRadius:O,maxInnerCornerRadius:I,outerStartAngle:A,outerEndAngle:T,innerDeltaAngle:w,innerEndAngle:C,innerStartAngle:E,innerCornerRadiusStart:P,innerCornerRadiusEnd:M}}function Xo(t,e,i,n,r,a,o){var s=t.getParsedAngle(),u=s.startAngle,l=s.endAngle,h=ke(l-u),c=l>u,d=!1;if(r<a){var f=r;r=a,a=f}if(r<=ve)e.moveTo(i,n);else if(h>=me-ve)e.moveTo(i+r*be(u),n+r*we(u)),e.arc(i,n,r,u,l,!c),a>ve&&(e.moveTo(i+a*be(l),n+a*we(l)),e.arc(i,n,a,l,u,c));else{var v=Ko(t,u,l,a,r),p=v.outerDeltaAngle,g=v.xors,y=v.yors,m=v.xirs,k=v.yirs,_=v.limitedOcr,b=v.outerCornerRadiusStart,x=v.outerCornerRadiusEnd,S=v.maxOuterCornerRadius,w=v.xore,A=v.yore,T=v.xire,C=v.yire,E=v.outerStartAngle,B=v.outerEndAngle,R=v.limitedIcr,M=v.innerDeltaAngle,P=v.innerEndAngle,O=v.innerStartAngle,I=v.innerCornerRadiusStart,L=v.innerCornerRadiusEnd,D=v.maxInnerCornerRadius;if(p<.001)o&&(o[3]||o[1])&&e.moveTo(i+g,n+y),d=!0;else if(_>ve){var F=Se(b,_),j=Se(x,_),N=Ho(m,k,g,y,r,F,Number(c)),z=Ho(w,A,T,C,r,j,Number(c));_<S&&F===j?!o||o[0]?(e.moveTo(i+N.cx+N.x01,n+N.cy+N.y01),e.arc(i+N.cx,n+N.cy,_,_e(N.y01,N.x01),_e(z.y01,z.x01),!c)):e.moveTo(i+N.cx+_*be(_e(z.y01,z.x01)),n+N.cy+_*we(_e(z.y01,z.x01))):!o||o[0]?(e.moveTo(i+N.cx+N.x01,n+N.cy+N.y01),F>0&&e.arc(i+N.cx,n+N.cy,F,_e(N.y01,N.x01),_e(N.y11,N.x11),!c),e.arc(i,n,r,_e(N.cy+N.y11,N.cx+N.x11),_e(z.cy+z.y11,z.cx+z.x11),!c),j>0&&e.arc(i+z.cx,n+z.cy,j,_e(z.y11,z.x11),_e(z.y01,z.x01),!c)):j>0?e.moveTo(i+z.cx+j*be(_e(z.y01,z.x01)),n+z.cy+j*we(_e(z.y01,z.x01))):e.moveTo(i+w,n+r*we(B))}else!o||o[0]?(e.moveTo(i+g,n+y),e.arc(i,n,r,E,B,!c)):e.moveTo(i+r*be(B),n+r*we(B));if(!(a>ve)||M<.001)!o||o[1]?e.lineTo(i+T,n+C):e.moveTo(i+T,n+C),d=!0;else if(R>ve){var U=Se(I,R),G=Se(L,R),W=Ho(T,C,w,A,a,-G,Number(c)),V=Ho(g,y,m,k,a,-U,Number(c));if(!o||o[1]?e.lineTo(i+W.cx+W.x01,n+W.cy+W.y01):e.moveTo(i+W.cx+W.x01,n+W.cy+W.y01),R<D&&U===G){var H=_e(V.y01,V.x01);!o||o[2]?e.arc(i+W.cx,n+W.cy,R,_e(W.y01,W.x01),H,!c):e.moveTo(i+W.cx+be(H),n+W.cy+we(H))}else!o||o[2]?(G>0&&e.arc(i+W.cx,n+W.cy,G,_e(W.y01,W.x01),_e(W.y11,W.x11),!c),e.arc(i,n,a,_e(W.cy+W.y11,W.cx+W.x11),_e(V.cy+V.y11,V.cx+V.x11),c),U>0&&e.arc(i+V.cx,n+V.cy,U,_e(V.y11,V.x11),_e(V.y01,V.x01),!c)):U>0?e.moveTo(i+V.cx+U*be(_e(V.y01,V.x01)),n+V.cy+U*we(_e(V.y01,V.x01))):e.moveTo(i+m,n+k)}else!o||o[1]?e.lineTo(i+T,n+C):e.moveTo(i+T,n+C),!o||o[2]?e.arc(i,n,a,P,O,c):e.moveTo(i+a*be(O),n+a*we(O))}return o?o[3]&&e.lineTo(i+r*be(u),n+r*we(u)):e.closePath(),d}var Yo=function(){function t(){o(this,t)}return u(t,null,[{key:"GetCanvas",value:function(){try{return t.canvas||(t.canvas=Vn.global.createCanvas({})),t.canvas}catch(t){return null}}},{key:"GetCtx",value:function(){if(!t.ctx){var e=t.GetCanvas();t.ctx=e.getContext("2d")}return t.ctx}}])}(),qo=function(t){function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;o(this,i),(t=e(this,i)).cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},t.dataMap=new Map;var a=Yo.GetCanvas(),s=Yo.GetCtx();if(a.width=r,a.height=1,!s)return v(t);if(s.translate(0,0),!s)throw new Error("获取ctx发生错误");var u=s.createLinearGradient(0,0,r,0);return n.forEach((function(t){u.addColorStop(t[0],t[1])})),s.fillStyle=u,s.fillRect(0,0,r,1),t.rgbaSet=s.getImageData(0,0,r,1).data,t}return h(i,t),u(i,[{key:"getColor",value:function(t){var e=this.rgbaSet.slice(4*t,4*t+4);return"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3]/255,")")}},{key:"GetOrCreate",value:function(t,e,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,s="".concat(t).concat(e).concat(n).concat(r);a.forEach((function(t){return s+=t.join()})),s+=o;var u=this.dataMap.get(s);return u||(u={data:new i(a,o),timestamp:[]},this.addLimitedTimestamp(u,Date.now(),{}),this.dataMap.set(s,u)),this.clearCache(this.dataMap,this.cacheParams),u.data}}],[{key:"getInstance",value:function(){return i._instance||(i._instance=new i),i._instance}}])}(Fe),Zo=function(){function t(){o(this,t)}return u(t,null,[{key:"GetSize",value:function(e){for(var i=0;i<t.ImageSize.length;i++)if(t.ImageSize[i]>=e)return t.ImageSize[i];return e}},{key:"Get",value:function(e,i,n,r,a,o,s){var u=t.GenKey(e,i,n,r,a),l=t.cache[u];if(!l||0===l.length)return null;for(var h=0;h<l.length;h++)if(l[h].width>=o&&l[h].height>=s)return l[h].pattern;return null}},{key:"Set",value:function(e,i,n,r,a,o,s,u){var l=t.GenKey(e,i,n,r,a);t.cache[l]?t.cache[l].push({width:s,height:u,pattern:o}):t.cache[l]=[{width:s,height:u,pattern:o}]}},{key:"GenKey",value:function(t,e,i,n,r){return"".concat(e,",").concat(i,",").concat(n,",").concat(r,",").concat(t.join())}}])}();Zo.cache={},Zo.ImageSize=[20,40,80,160,320,640,1280,2560];var Jo=Symbol.for("ArcRenderContribution"),$o=Symbol.for("AreaRenderContribution"),Qo=Symbol.for("CircleRenderContribution"),ts=Symbol.for("GroupRenderContribution"),es=Symbol.for("ImageRenderContribution"),is=Symbol.for("PathRenderContribution"),ns=Symbol.for("PolygonRenderContribution"),rs=Symbol.for("RectRenderContribution"),as=Symbol.for("SymbolRenderContribution"),os=Symbol.for("TextRenderContribution"),ss=Symbol.for("InteractiveSubRenderContribution");function us(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function ls(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function hs(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function cs(t,e,i){var n,r,a,o,s,u,l,h,c,d,f,v,p=i[0],g=i[1],y=i[2];return e===t?(t[12]=e[0]*p+e[4]*g+e[8]*y+e[12],t[13]=e[1]*p+e[5]*g+e[9]*y+e[13],t[14]=e[2]*p+e[6]*g+e[10]*y+e[14],t[15]=e[3]*p+e[7]*g+e[11]*y+e[15]):(n=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],h=e[7],c=e[8],d=e[9],f=e[10],v=e[11],t[0]=n,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=h,t[8]=c,t[9]=d,t[10]=f,t[11]=v,t[12]=n*p+s*g+c*y+e[12],t[13]=r*p+u*g+d*y+e[13],t[14]=a*p+l*g+f*y+e[14],t[15]=o*p+h*g+v*y+e[15]),t}function ds(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function fs(t,e,i){var n=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],h=e[7],c=e[8],d=e[9],f=e[10],v=e[11],p=e[12],g=e[13],y=e[14],m=e[15],k=i[0],_=i[1],b=i[2],x=i[3];return t[0]=k*n+_*s+b*c+x*p,t[1]=k*r+_*u+b*d+x*g,t[2]=k*a+_*l+b*f+x*y,t[3]=k*o+_*h+b*v+x*m,k=i[4],_=i[5],b=i[6],x=i[7],t[4]=k*n+_*s+b*c+x*p,t[5]=k*r+_*u+b*d+x*g,t[6]=k*a+_*l+b*f+x*y,t[7]=k*o+_*h+b*v+x*m,k=i[8],_=i[9],b=i[10],x=i[11],t[8]=k*n+_*s+b*c+x*p,t[9]=k*r+_*u+b*d+x*g,t[10]=k*a+_*l+b*f+x*y,t[11]=k*o+_*h+b*v+x*m,k=i[12],_=i[13],b=i[14],x=i[15],t[12]=k*n+_*s+b*c+x*p,t[13]=k*r+_*u+b*d+x*g,t[14]=k*a+_*l+b*f+x*y,t[15]=k*o+_*h+b*v+x*m,t}function vs(t,e,i){var n=e[0],r=e[1],a=e[2],o=i[3]*n+i[7]*r+i[11]*a+i[15];return o=o||1,t[0]=(i[0]*n+i[4]*r+i[8]*a+i[12])/o,t[1]=(i[1]*n+i[5]*r+i[9]*a+i[13])/o,t[2]=(i[2]*n+i[6]*r+i[10]*a+i[14])/o,t}var ps=function(){return u((function t(){o(this,t),this.pools=[]}),[{key:"allocate",value:function(t,e,i,n,r,a){if(!this.pools.length)return new De(t,e,i,n,r,a);var o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=n,o.e=r,o.f=a,o}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new De(t.a,t.b,t.c,t.d,t.e,t.f);var e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),gs=function(){function t(){o(this,t),this.pools=[]}return u(t,[{key:"allocate",value:function(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var e=this.pools.pop();return t.identity(e),e}},{key:"allocateByObj",value:function(t){var e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(var i=0;i<e.length;i++)e[i]=t[i];return e}},{key:"free",value:function(t){t&&this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}],[{key:"identity",value:function(t){return hs(t)}}])}(),ys=new ps,ms=new gs,ks=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},_s=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bs=function(t,e){return function(i,n){e(i,n,t)}};function xs(t,e,i){var n,r=e.attribute,a=r.x,o=void 0===a?i.x:a,s=r.y,u=void 0===s?i.y:s,l=r.z,h=void 0===l?i.z:l,c=r.dx,d=void 0===c?i.dx:c,f=r.dy,v=void 0===f?i.dy:f,p=r.dz,g=void 0===p?i.dz:p,y=r.scaleX,m=void 0===y?i.scaleX:y,k=r.scaleY,_=void 0===k?i.scaleY:k,b=r.scaleZ,x=void 0===b?i.scaleZ:b,S=r.alpha,w=void 0===S?i.alpha:S,A=r.beta,T=void 0===A?i.beta:A,C=r.angle,E=void 0===C?i.angle:C,B=r.anchor3d,R=void 0===B?e.attribute.anchor:B,M=r.anchor,P=[0,0,0];if(R){if("string"==typeof R[0]){var O=parseFloat(R[0])/100,I=e.AABBBounds;P[0]=I.x1+(I.x2-I.x1)*O}else P[0]=R[0];if("string"==typeof R[1]){var L=parseFloat(R[1])/100,D=e.AABBBounds;P[1]=D.x1+(D.x2-D.x1)*L}else P[1]=R[1];P[2]=null!==(n=R[2])&&void 0!==n?n:0}if(hs(t),cs(t,t,[o+d,u+v,h+g]),cs(t,t,[P[0],P[1],P[2]]),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],h=e[9],c=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*r+l*n,t[5]=o*r+h*n,t[6]=s*r+c*n,t[7]=u*r+d*n,t[8]=l*r-a*n,t[9]=h*r-o*n,t[10]=c*r-s*n,t[11]=d*r-u*n}(t,t,T),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],h=e[9],c=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r-l*n,t[1]=o*r-h*n,t[2]=s*r-c*n,t[3]=u*r-d*n,t[8]=a*n+l*r,t[9]=o*n+h*r,t[10]=s*n+c*r,t[11]=u*n+d*r}(t,t,w),cs(t,t,[-P[0],-P[1],P[2]]),function(t,e,i){var n=i[0],r=i[1],a=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[m,_,x]),E){var F=ms.allocate(),j=[0,0];if(M){if("string"==typeof R[0]){var N=parseFloat(R[0])/100,z=e.AABBBounds;j[0]=z.x1+(z.x2-z.x1)*N}else j[0]=R[0];if("string"==typeof R[1]){var U=parseFloat(R[1])/100,G=e.AABBBounds;j[1]=G.x1+(G.x2-G.x1)*U}else j[1]=R[1]}cs(F,F,[j[0],j[1],0]),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],h=e[5],c=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r+l*n,t[1]=o*r+h*n,t[2]=s*r+c*n,t[3]=u*r+d*n,t[4]=l*r-a*n,t[5]=h*r-o*n,t[6]=c*r-s*n,t[7]=d*r-u*n}(F,F,E),cs(F,F,[-j[0],-j[1],0]),fs(t,t,F)}}var Ss=function(){return u((function t(e){o(this,t),this.creator=e,this.hooks={onAttributeUpdate:new et(["graphic"]),onSetStage:new et(["graphic","stage"]),onRemove:new et(["graphic"]),onRelease:new et(["graphic"]),onAddIncremental:new et(["graphic","group","stage"]),onClearIncremental:new et(["graphic","group","stage"]),beforeUpdateAABBBounds:new et(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new et(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Oe,this.tempAABBBounds2=new Oe}),[{key:"onAttributeUpdate",value:function(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}},{key:"onSetStage",value:function(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}},{key:"onRemove",value:function(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}},{key:"onRelease",value:function(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}},{key:"onAddIncremental",value:function(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}},{key:"onClearIncremental",value:function(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}},{key:"beforeUpdateAABBBounds",value:function(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}},{key:"afterUpdateAABBBounds",value:function(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}},{key:"updatePathProxyAABBBounds",value:function(t,e){var i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;var n=new _i(t);return Li(i.commandList,n,0,0),!0}},{key:"updateHTMLTextAABBBounds",value:function(t,e,i,n){var r=t.textAlign,a=t.textBaseline;if(null!=t.forceBoundsHeight){var o=wt(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=ls(a,o,o);i.set(i.x1,s,i.x2,s+o)}if(null!=t.forceBoundsWidth){var u=wt(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),l=us(r,u);i.set(l,i.y1,l+u,i.y2)}}},{key:"combindShadowAABBBounds",value:function(t,e){if(e&&e.shadowRoot){var i=e.shadowRoot.AABBBounds;t.union(i)}}},{key:"transformAABBBounds",value:function(t,e,i,n,r){if(!e.empty()){var a=t.scaleX,o=void 0===a?i.scaleX:a,s=t.scaleY,u=void 0===s?i.scaleY:s,l=t.stroke,h=void 0===l?i.stroke:l,c=t.shadowBlur,d=void 0===c?i.shadowBlur:c,f=t.lineWidth,v=void 0===f?i.lineWidth:f,p=t.pickStrokeBuffer,g=void 0===p?i.pickStrokeBuffer:p,y=t.strokeBoundsBuffer,m=void 0===y?i.strokeBoundsBuffer:y,k=this.tempAABBBounds1,_=this.tempAABBBounds2;if(h&&v)qa(k,(v+g)/Math.abs(o+u),n,m),e.union(k),k.setValue(_.x1,_.y1,_.x2,_.y2);if(d){var b=t.shadowOffsetX,x=void 0===b?i.shadowOffsetX:b,S=t.shadowOffsetY,w=void 0===S?i.shadowOffsetY:S;qa(k,d/Math.abs(o+u)*2,!1,m+1),k.translate(x,w),e.union(k)}}if(this.combindShadowAABBBounds(e,r),!e.empty()){var A=!0,T=r.transMatrix;r&&r.isContainer&&(A=!(1===T.a&&0===T.b&&0===T.c&&1===T.d&&0===T.e&&0===T.f)),A&&Me(e,e,T)}}},{key:"validCheck",value:function(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(!n.valid)return i.clear(),!1;var r=t.visible;return!!(void 0===r?e.visible:r)||(i.clear(),!1)}},{key:"updateTempAABBBounds",value:function(t){var e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}}])}();Ss=ks([L(),bs(0,O(xo)),_s("design:paramtypes",[Object])],Ss);var ws={x:0,y:0,z:0,lastModelMatrix:null},As=function(){return u((function t(){o(this,t)}),[{key:"init",value:function(t){var e=this;t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((function(t){return e._renderContribitions.push(t)})),this._renderContribitions.length&&(this._renderContribitions.sort((function(t,e){return e.order-t.order})),this._beforeRenderContribitions=this._renderContribitions.filter((function(t){return t.time===yi.beforeFillStroke})),this._afterRenderContribitions=this._renderContribitions.filter((function(t){return t.time===yi.afterFillStroke})))}},{key:"beforeRenderStep",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((function(f){f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,i,n,r,a,o,s,u,l,h,c,d)}))}},{key:"afterRenderStep",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((function(f){f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,i,n,r,a,o,s,u,l,h,c,d)}))}},{key:"valid",value:function(t,e,i,n){var r=t.attribute,a=r.fill,o=void 0===a?e.fill:a,s=r.background,u=r.stroke,l=void 0===u?e.stroke:u,h=r.opacity,c=void 0===h?e.opacity:h,d=r.fillOpacity,f=void 0===d?e.fillOpacity:d,v=r.lineWidth,p=void 0===v?e.lineWidth:v,g=r.strokeOpacity,y=void 0===g?e.strokeOpacity:g,m=r.visible,k=void 0===m?e.visible:m,_=Uo(c,f,o),b=Wo(c,y),x=No(o,s),S=zo(l,p);return!(!t.valid||!k)&&!(!x&&!S)&&!!(_||b||i||n||s)&&{fVisible:_,sVisible:b,doFill:x,doStroke:S}}},{key:"transform",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t.attribute,a=r.x,o=void 0===a?e.x:a,s=r.y,u=void 0===s?e.y:s,l=r.z,h=void 0===l?e.z:l,c=r.scaleX,d=void 0===c?e.scaleX:c,f=r.scaleY,v=void 0===f?e.scaleY:f,p=r.angle,g=void 0===p?e.angle:p,y=r.postMatrix,m=i.modelMatrix,k=i.camera;ws.x=o,ws.y=u,ws.z=h,ws.lastModelMatrix=m;var _=k&&(n||function(t){var e=t.attribute,i=e.alpha,n=e.beta;return i||n}(t)),b=_?t.transMatrix.onlyTranslate()&&!y:1===d&&1===v&&0===g&&!y;if(_){var x=ms.allocate(),S=ms.allocate();xs(S,t,e),fs(x,m||x,S),ws.x=0,ws.y=0,ws.z=0,i.modelMatrix=x,i.setTransform(1,0,0,1,0,0,!0),ms.free(S)}if(b&&!m){var w=t.getOffsetXY(e);ws.x+=w.x,ws.y+=w.y,ws.z=h,i.setTransformForCurrent()}else if(_)ws.x=0,ws.y=0,ws.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(k&&i.project){var A=t.getOffsetXY(e);ws.x+=A.x,ws.y+=A.y,this.transformWithoutTranslate(i,ws.x,ws.y,ws.z,d,v,g)}else i.transformFromMatrix(t.transMatrix,!0),ws.x=0,ws.y=0,ws.z=0;return ws}},{key:"transformUseContext2d",value:function(t,e,i,n){var r=n.camera;if(this.camera=r,r){var a=t.AABBBounds,o=a.x2-a.x1,s=a.y2-a.y1,u=n.project(0,0,i),l=n.project(o,0,i),h=n.project(o,s,i),c={x:0,y:0},d={x:o,y:0},f={x:o,y:s};n.camera=null;var v=1/(c.x*(f.y-d.y)-d.x*f.y+f.x*d.y+(d.x-f.x)*c.y),p=-(c.y*(h.x-l.x)-d.y*h.x+f.y*l.x+(d.y-f.y)*u.x)*v,g=(d.y*h.y+c.y*(l.y-h.y)-f.y*l.y+(f.y-d.y)*u.y)*v,y=(c.x*(h.x-l.x)-d.x*h.x+f.x*l.x+(d.x-f.x)*u.x)*v,m=-(d.x*h.y+c.x*(l.y-h.y)-f.x*l.y+(f.x-d.x)*u.y)*v,k=(c.x*(f.y*l.x-d.y*h.x)+c.y*(d.x*h.x-f.x*l.x)+(f.x*d.y-d.x*f.y)*u.x)*v,_=(c.x*(f.y*l.y-d.y*h.y)+c.y*(d.x*h.y-f.x*l.y)+(f.x*d.y-d.x*f.y)*u.y)*v;n.setTransform(p,g,y,m,k,_,!0)}}},{key:"restoreTransformUseContext2d",value:function(t,e,i,n){this.camera&&(n.camera=this.camera)}},{key:"transformWithoutTranslate",value:function(t,e,i,n,r,a,o){var s=t.project(e,i,n);t.translate(s.x,s.y,!1),t.scale(r,a,!1),t.rotate(o,!1),t.translate(-s.x,-s.y,!1),t.setTransformForCurrent()}},{key:"_draw",value:function(t,e,i,n,r){var a=n.context;if(a&&!1!==t.attribute.renderable){a.highPerformanceSave();var o=this.transform(t,e,a,i),s=o.x,u=o.y,l=o.z,h=o.lastModelMatrix;this.z=l,function(t,e,i,n,r,a,o,s){if(!t.pathProxy)return!1;var u=Rr(t,null==a?void 0:a.theme)[t.type.replace("3d","")],l=t.attribute,h=l.fill,c=void 0===h?u.fill:h,d=l.stroke,f=void 0===d?u.stroke:d,v=l.opacity,p=void 0===v?u.opacity:v,g=l.fillOpacity,y=void 0===g?u.fillOpacity:g,m=l.lineWidth,k=void 0===m?u.lineWidth:m,_=l.strokeOpacity,b=void 0===_?u.strokeOpacity:_,x=l.visible,S=void 0===x?u.visible:x,w=l.x,A=void 0===w?u.x:w,T=l.y,C=void 0===T?u.y:T,E=Uo(p,y,c),B=Wo(p,b),R=No(c),M=zo(f,k);return!S||!R&&!M||!(E||B||o||s)||(e.beginPath(),Li(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),M&&(s?s(e,t.attribute,u):B&&(e.setStrokeStyle(t,t.attribute,i-A,n-C,u),e.stroke())),R&&(o?o(e,t.attribute,u):E&&(e.setCommonStyle(t,t.attribute,i-A,n-C,u),e.fill())),!0)}(t,a,s,u,0,r)||(this.drawShape(t,a,s,u,n,r),this.z=0,a.modelMatrix!==h&&ms.free(a.modelMatrix),a.modelMatrix=h),a.highPerformanceRestore()}}}])}(),Ts=function(){var t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function i(t){var i=new Error(e+": "+t);throw i.source=e,i}function n(){return r("linear",t.linearGradient,a)||r("radial",t.radialGradient,s)||r("conic",t.conicGradient,o)}function r(e,n,r){return function(n,a){var o,s=y(n);if(s){y(t.startCall)||i("Missing (");var u=((o=r())&&(y(t.comma)||i("Missing comma before color stops")),{type:e,orientation:o,colorStops:d(f)});return y(t.endCall)||i("Missing )"),u}}(n)}function a(){return g("directional",t.sideOrCorner,1)||g("angular",t.angleValue,1)}function o(){return g("angular",t.fromAngleValue,1)}function s(){var i,n,r=u();return r&&((i=[]).push(r),n=e,y(t.comma)&&((r=u())?i.push(r):e=n)),i}function u(){var t,e=function(){var t=g("shape",/^(circle)/i,0);return t&&(t.style=p()||l()),t}()||((t=g("shape",/^(ellipse)/i,0))&&(t.style=v()||l()),t);if(e)e.at=h();else{var i=l();if(i){e=i;var n=h();n&&(e.at=n)}else{var r=c();r&&(e={type:"default-radial",at:r})}}return e}function l(){return g("extent-keyword",t.extentKeywords,1)}function h(){if(g("position",/^at/,0)){var t=c();return t||i("Missing positioning value"),t}}function c(){var t={x:v(),y:v()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var n=e(),r=[];if(n)for(r.push(n);y(t.comma);)(n=e())?r.push(n):i("One extra comma");return r}function f(){var e=g("hex",t.hexColor,1)||g("rgba",t.rgbaColor,1)||g("rgb",t.rgbColor,1)||g("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=v(),e}function v(){return g("%",t.percentageValue,1)||g("position-keyword",t.positionKeywords,1)||p()}function p(){return g("px",t.pixelValue,1)||g("em",t.emValue,1)}function g(t,e,i){var n=y(e);if(n)return{type:t,value:n[i]}}function y(t){var i=/^[\n\r\t\s]+/.exec(e);i&&m(i[0].length);var n=t.exec(e);return n&&m(n[0].length),n}function m(t){e=e.substr(t)}return function(t){return e=t.toString(),r=d(n),e.length>0&&i("Invalid input not EOF"),r;var r}}(),Cs=function(){function t(){o(this,t)}return u(t,null,[{key:"IsGradient",value:function(t){return!("string"==typeof t&&!t.includes("gradient"))}},{key:"IsGradientStr",value:function(t){return"string"==typeof t&&t.includes("gradient")}},{key:"Parse",value:function(e){if(t.IsGradientStr(e))try{var i=Ts(e)[0];if(i){if("linear"===i.type)return t.ParseLinear(i);if("radial"===i.type)return t.ParseRadial(i);if("conic"===i.type)return t.ParseConic(i)}}catch(t){return e}return e}},{key:"ParseConic",value:function(t){var e=t.orientation,i=t.colorStops,n=void 0===i?[]:i,r=pe/2,a=parseFloat(e.value)/180*pe-r;return{gradient:"conical",x:.5,y:.5,startAngle:a,endAngle:a+me,stops:n.map((function(t){return{color:t.value,offset:parseFloat(t.length.value)/100}}))}}},{key:"ParseRadial",value:function(t){var e=t.colorStops;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:(void 0===e?[]:e).map((function(t){return{color:t.value,offset:parseFloat(t.length.value)/100}}))}}},{key:"ParseLinear",value:function(t){for(var e=t.orientation,i=t.colorStops,n=void 0===i?[]:i,r=pe/2,a="angular"===e.type?parseFloat(e.value)/180*pe:0;a<0;)a+=me;for(;a>me;)a-=me;var o=0,s=0,u=0,l=0;return a<r?(o=0,s=1,u=Math.sin(a),l=Math.cos(a)):a<pe?(o=0,s=0,u=Math.cos(a-r),l=Math.sin(a-r)):a<pe+r?(s=0,u=(o=1)-Math.sin(a-pe),l=Math.cos(a-pe)):(u=(o=1)-Math.cos(a-r-pe),l-=Math.sin(a-r-pe)),{gradient:"linear",x0:o,y0:s,x1:u,y1:l,stops:n.map((function(t){return{color:t.value,offset:parseFloat(t.length.value)/100}}))}}}])}();function Es(t,e,i){var n=e,r=t.currentMatrix,a=r.a,o=r.b,s=r.c,u=r.d,l=Math.sign(a)*Math.sqrt(a*a+o*o),h=Math.sign(u)*Math.sqrt(s*s+u*u);return l+h===0?0:n=n/Math.abs(l+h)*2*i}function Bs(t,e,i){var n,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e||!0===e)return"black";if(bt(e))for(var s=0;s<e.length&&!(r=e[s]);s++);else r=e;if("string"==typeof(r=Cs.Parse(r)))return r;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){var u=i.AABBBounds,l=u.x2-u.x1,h=u.y2-u.y1,c=u.x1-a,d=u.y1-o;if(i.attribute){var f=i.attribute,v=f.scaleX,p=void 0===v?1:v,g=f.scaleY,y=void 0===g?1:g;l/=p,h/=y,c/=p,d/=y}"linear"===r.gradient?n=function(t,e,i,n,r,a){var o,s,u,l,h=t.createLinearGradient(i+(null!==(o=e.x0)&&void 0!==o?o:0)*r,n+(null!==(s=e.y0)&&void 0!==s?s:0)*a,i+(null!==(u=e.x1)&&void 0!==u?u:1)*r,n+(null!==(l=e.y1)&&void 0!==l?l:0)*a);return e.stops.forEach((function(t){h.addColorStop(t.offset,t.color)})),h}(t,r,c,d,l,h):"conical"===r.gradient?n=function(t,e,i,n,r,a){var o,s,u=t.createConicGradient(i+(null!==(o=e.x)&&void 0!==o?o:0)*r,n+(null!==(s=e.y)&&void 0!==s?s:0)*a,e.startAngle,e.endAngle);return e.stops.forEach((function(t){u.addColorStop(t.offset,t.color)})),u.GetPattern(r+i,a+n,void 0)}(t,r,c,d,l,h):"radial"===r.gradient&&(n=function(t,e,i,n,r,a){var o,s,u,l,h,c,d=t.createRadialGradient(i+(null!==(o=e.x0)&&void 0!==o?o:.5)*r,n+(null!==(s=e.y0)&&void 0!==s?s:.5)*a,Math.max(r,a)*(null!==(u=e.r0)&&void 0!==u?u:0),i+(null!==(l=e.x1)&&void 0!==l?l:.5)*r,n+(null!==(h=e.y1)&&void 0!==h?h:.5)*a,Math.max(r,a)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((function(t){d.addColorStop(t.offset,t.color)})),d}(t,r,c,d,l,h))}return n||"orange"}var Rs=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Ms=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ps=function(t,e){return function(i,n){e(i,n,t)}},Os=function(){return u((function t(){o(this,t),this.time=yi.beforeFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d){var f,v=t.attribute,p=v.background,g=v.backgroundOpacity,y=void 0===g?null!==(f=t.attribute.fillOpacity)&&void 0!==f?f:u.backgroundOpacity:g,m=v.opacity,k=void 0===m?u.opacity:m,_=v.backgroundMode,b=void 0===_?u.backgroundMode:_,x=v.backgroundFit,S=void 0===x?u.backgroundFit:x;if(p)if(t.backgroundImg&&t.resources){var w=t.resources.get(p);if("success"!==w.state||!w.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var A=Rr(t.parent).group,T=t.parent.attribute,C=T.scrollX,E=void 0===C?A.scrollX:C,B=T.scrollY,R=void 0===B?A.scrollY:B;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(E,R)}e.clip();var M=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,u),e.globalAlpha=y*k,this.doDrawImage(e,w.data,M,b,S),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,u),e.globalAlpha=y*k,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}},{key:"doDrawImage",value:function(t,e,i,n,r){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{var a=i.width(),o=i.height(),s=a,u=o;if(r&&"repeat"!==n&&(e.width||e.height)){var l=e.width,h=e.height;"repeat-x"===n?(s=l*(o/h),u=o):"repeat-y"===n&&(u=h*(a/l),s=a);var c=t.dpr,d=cr.allocate({width:s,height:u,dpr:c}),f=d.getContext("2d");f&&(f.inuse=!0,f.clearMatrix(),f.setTransformForCurrent(!0),f.clearRect(0,0,s,u),f.drawImage(e,0,0,s,u),e=d.nativeCanvas),cr.free(d)}var v=t.dpr,p=t.createPattern(e,n);p.setTransform&&p.setTransform(new DOMMatrix([1/v,0,0,1/v,0,0])),t.fillStyle=p,t.translate(i.x1,i.y1),t.fillRect(0,0,a,o),t.translate(-i.x1,-i.y1)}}}])}(),Is=new Os,Ls=function(){return u((function t(e){o(this,t),this.subRenderContribitions=e,this.time=yi.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((function(f){f.render(t,e,i,n,r,a,o,s,u,l,h,c,d)}))}}])}();Ls=Rs([L(),Ps(0,O($)),Ps(0,D(ss)),Ms("design:paramtypes",[Object])],Ls);var Ds=function(){return u((function t(){o(this,t),this.time=yi.afterFillStroke,this.useStyle=!0,this.order=10}),[{key:"createCommonPattern",value:function(t,e,i,n,r){var a=(t-2*e)/2,o=n.dpr,s=cr.allocate({width:t,height:t,dpr:o}),u=s.getContext("2d");if(!u)return null;u.inuse=!0,u.clearMatrix(),u.setTransformForCurrent(!0),u.clearRect(0,0,t,t),r(a,u);var l=n.createPattern(s.nativeCanvas,"repeat");return l.setTransform&&l.setTransform(new DOMMatrix([1/o,0,0,1/o,0,0])),cr.free(s),l}},{key:"createCirclePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(t,e){e.fillStyle=i,e.arc(t,t,t,0,me),e.fill()}))}},{key:"createDiamondPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){var r=t/2,a=r;n.fillStyle=i,n.moveTo(r,a-e),n.lineTo(e+r,a),n.lineTo(r,a+e),n.lineTo(r-e,a),n.closePath(),n.fill()}))}},{key:"createRectPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(t,n){var r=e,a=r;n.fillStyle=i,n.fillRect(r,a,2*t,2*t)}))}},{key:"createVerticalLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(n,r){var a=e;r.fillStyle=i,r.fillRect(a,0,2*n,t)}))}},{key:"createHorizontalLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(n,r){var a=e;r.fillStyle=i,r.fillRect(0,a,t,2*n)}))}},{key:"createBiasLRLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);var r=t/2,a=-r;n.moveTo(r,a),n.lineTo(r+t,a+t),n.moveTo(-r,-a),n.lineTo(-r+t,-a+t),n.stroke()}))}},{key:"createBiasRLLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);var r=t/2,a=r;n.moveTo(t+r,a),n.lineTo(r,a+t),n.moveTo(t-r,-a),n.lineTo(-r,-a+t),n.stroke()}))}},{key:"createGridPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(t,n){var r=e,a=r;n.fillStyle=i,n.fillRect(r,a,t,t),n.fillRect(r+t,a+t,t,t)}))}},{key:"initTextureMap",value:function(t,e){this.textureMap=new Map}},{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d){this.textureMap||this.initTextureMap(e,t.stage);var f=t.attribute,v=f.texture,p=void 0===v?u.texture:v,g=f.textureColor,y=void 0===g?u.textureColor:g,m=f.textureSize,k=void 0===m?u.textureSize:m,_=f.texturePadding,b=void 0===_?u.texturePadding:_;p&&this.drawTexture(p,t,e,i,n,u,y,k,b)}},{key:"drawTexture",value:function(t,e,i,n,r,a,o,s,u){var l=this.textureMap.get(t);if(!l)switch(t){case"circle":l=this.createCirclePattern(s,u,o,i);break;case"diamond":l=this.createDiamondPattern(s,u,o,i);break;case"rect":l=this.createRectPattern(s,u,o,i);break;case"vertical-line":l=this.createVerticalLinePattern(s,u,o,i);break;case"horizontal-line":l=this.createHorizontalLinePattern(s,u,o,i);break;case"bias-lr":l=this.createBiasLRLinePattern(s,u,o,i);break;case"bias-rl":l=this.createBiasRLLinePattern(s,u,o,i);break;case"grid":l=this.createGridPattern(s,u,o,i)}l&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,r,a),i.fillStyle=l,i.fill(),i.highPerformanceRestore())}}])}(),Fs=new Ds,js=function(){return u((function t(){o(this,t),this.time=yi.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c){var d=t.attribute,f=d.outerBorder,v=d.innerBorder,p=f&&!1!==f.visible,g=v&&!1!==v.visible;if(p||g){var y=t.attribute,m=y.innerPadding,k=void 0===m?u.innerPadding:m,_=y.outerPadding,b=void 0===_?u.outerPadding:_,x=y.startAngle,S=void 0===x?u.startAngle:x,w=y.endAngle,A=void 0===w?u.endAngle:w,T=y.opacity,C=void 0===T?u.opacity:T,E=y.x,B=void 0===E?u.x:E,R=y.y,M=void 0===R?u.y:R,P=y.scaleX,O=void 0===P?u.scaleX:P,I=y.scaleY,L=void 0===I?u.scaleY:I,D=t.attribute,F=D.innerRadius,j=void 0===F?u.innerRadius:F,N=D.outerRadius,z=void 0===N?u.outerRadius:N;z+=b,j-=k;var U=function(r,a){var o=!(!r||!r.stroke),s=r.distance,l=void 0===s?u[a].distance:s,h=Es(e,l,e.dpr),d=l/z,f="outerBorder"===a?1:-1;if(t.setAttributes({outerRadius:z+f*h,innerRadius:j-f*h,startAngle:S-f*d,endAngle:A+f*d}),e.beginPath(),Xo(t,e,i,n,z+f*h,j-f*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),c)c(e,r,u[a]);else if(o){var v=u[a].opacity;u[a].opacity=C,e.setStrokeStyle(t,r,(B-i)/O,(M-n)/L,u[a]),u[a].opacity=v,e.stroke()}};p&&U(f,"outerBorder"),g&&U(v,"innerBorder"),t.setAttributes({outerRadius:z,innerRadius:j,startAngle:S,endAngle:A})}}}])}(),Ns=new js,zs=Fs,Us=Is,Gs=function(){return u((function t(){o(this,t),this.time=yi.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c){var d=t.attribute,f=d.outerBorder,v=d.innerBorder,p=f&&!1!==f.visible,g=v&&!1!==v.visible;if(p||g){var y=t.attribute,m=y.radius,k=void 0===m?u.radius:m,_=y.startAngle,b=void 0===_?u.startAngle:_,x=y.endAngle,S=void 0===x?u.endAngle:x,w=y.opacity,A=void 0===w?u.opacity:w,T=y.x,C=void 0===T?u.x:T,E=y.y,B=void 0===E?u.y:E,R=y.scaleX,M=void 0===R?u.scaleX:R,P=y.scaleY,O=void 0===P?u.scaleY:P,I=function(r,a){var o=!(!r||!r.stroke),s=r.distance,l=void 0===s?u[a].distance:s,h=Es(e,l,e.dpr),d="outerBorder"===a?1:-1;if(e.beginPath(),e.arc(i,n,k+d*h,b,S),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),c)c(e,r,u[a]);else if(o){var f=u[a].opacity;u[a].opacity=A,e.setStrokeStyle(t,r,(C-i)/M,(B-n)/O,u[a]),u[a].opacity=f,e.stroke()}};p&&I(f,"outerBorder"),g&&I(v,"innerBorder")}}}])}(),Ws=new Gs,Vs=Fs,Hs=Is,Ks=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).time=yi.beforeFillStroke,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c){var d=t.attribute,f=d.background,v=d.backgroundMode,p=void 0===v?u.backgroundMode:v,g=d.backgroundFit,y=void 0===g?u.backgroundFit:g;if(f)if(t.backgroundImg&&t.resources){var m=t.resources.get(f);if("success"!==m.state||!m.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);var k=t.AABBBounds;this.doDrawImage(e,m.data,k,p,y),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=f,e.fill(),e.highPerformanceRestore()}}])}(Os),Xs=new Ks,Ys=pe/2;function qs(t,e,i,n,r,a,o){var s;if(n<0&&(e+=n,n=-n),r<0&&(i+=r,r=-r),wt(a,!0))s=[a=ke(a),a,a,a];else if(Array.isArray(a)){var u,l,h=a;switch(h.length){case 0:s=[0,0,0,0];break;case 1:s=[u=ke(h[0]),u,u,u];break;case 2:case 3:s=[u=ke(h[0]),l=ke(h[1]),u,l];break;default:(s=h)[0]=ke(s[0]),s[1]=ke(s[1]),s[2]=ke(s[2]),s[3]=ke(s[3])}}else s=[0,0,0,0];if(n<0||s[0]+s[1]+s[2]+s[3]<1e-12)return t.rect(e,i,n,r);var c=[e,i],d=[e+n,i],f=[e+n,i+r],v=[e,i+r],p=Math.min(n/2,r/2),g=[Math.min(p,s[0]),Math.min(p,s[1]),Math.min(p,s[2]),Math.min(p,s[3])],y=[c[0]+g[0],c[1]],m=[c[0],c[1]+g[0]],k=[d[0]-g[1],d[1]],_=[d[0],d[1]+g[1]],b=[f[0]-g[2],f[1]],x=[f[0],f[1]-g[2]],S=[v[0]+g[3],v[1]],w=[v[0],v[1]-g[3]];if(t.moveTo(y[0],y[1]),o&&o[0]?o[0](y[0],y[1],k[0],k[1]):t.lineTo(k[0],k[1]),!Yt(k,_)){o&&o[0]&&t.moveTo(k[0],k[1]);var A=k[0],T=k[1]+g[1];t.arc(A,T,g[1],-Ys,0,!1)}if(o&&o[1]?o[1](_[0],_[1],x[0],x[1]):t.lineTo(x[0],x[1]),!Yt(b,x)){var C=x[0]-g[2],E=x[1];o&&o[1]&&t.moveTo(x[0],x[1]),t.arc(C,E,g[2],0,Ys,!1)}if(o&&o[2]?o[2](b[0],b[1],S[0],S[1]):t.lineTo(S[0],S[1]),!Yt(S,w)){var B=S[0],R=S[1]-g[3];o&&o[2]&&t.moveTo(S[0],S[1]),t.arc(B,R,g[3],Ys,pe,!1)}if(o&&o[3]?o[3](w[0],w[1],m[0],m[1]):t.lineTo(m[0],m[1]),!Yt(y,m)){var M=y[0],P=y[1]+g[0];o&&o[3]&&t.moveTo(m[0],m[1]),t.arc(M,P,g[0],pe,pe+Ys,!1)}return!o&&t.closePath(),t}var Zs=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Js=function(){return u((function t(){o(this,t),this.time=yi.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c){var d=t.attribute,f=d.outerBorder,v=d.innerBorder,p=f&&!1!==f.visible,g=v&&!1!==v.visible;if(p||g){var y=t.attribute,m=y.cornerRadius,k=void 0===m?u.cornerRadius:m,_=y.opacity,b=void 0===_?u.opacity:_,x=y.x,S=void 0===x?u.x:x,w=y.y,A=void 0===w?u.y:w,T=y.scaleX,C=void 0===T?u.scaleX:T,E=y.scaleY,B=void 0===E?u.scaleY:E,R=y.x1,M=y.y1,P=t.attribute,O=P.width,I=P.height;O=(null!=O?O:R-i)||0,I=(null!=I?I:M-n)||0;var L=function(r,a){var o=!(!r||!r.stroke),s="outerBorder"===a?-1:1,l=r.distance,h=void 0===l?u[a].distance:l,d=Es(e,h,e.dpr),f=i+s*d,v=n+s*d,p=2*d;if(0===k||bt(k)&&k.every((function(t){return 0===t}))?(e.beginPath(),e.rect(f,v,O-s*p,I-s*p)):(e.beginPath(),qs(e,f,v,O-s*p,I-s*p,k)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),c)c(e,r,u[a]);else if(o){var g=u[a].opacity;u[a].opacity=b,e.setStrokeStyle(t,r,(S-i)/C,(A-n)/B,u[a]),u[a].opacity=g,e.stroke()}};p&&L(f,"outerBorder"),g&&L(v,"innerBorder")}}}])}(),$s=function(){return u((function t(){o(this,t),this.time=yi.beforeFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d){var f=t.attribute.stroke,v=void 0===f?u.stroke:f;Array.isArray(v)&&v.some((function(t){return!1===t}))&&(d.doStroke=!1)}}])}();$s=Zs([L()],$s);var Qs=function(){return u((function t(){o(this,t),this.time=yi.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c){var d=t.attribute,f=d.x1,v=d.y1,p=d.x,g=void 0===p?u.x:p,y=d.y,m=void 0===y?u.y:y,k=d.stroke,_=void 0===k?u.stroke:k,b=d.cornerRadius,x=void 0===b?u.cornerRadius:b,S=t.attribute,w=S.width,A=S.height;if(w=(null!=w?w:f-g)||0,A=(null!=A?A:v-m)||0,Array.isArray(_)&&_.some((function(t){return!1===t}))){if(e.setStrokeStyle(t,t.attribute,i,n,u),!(0===x||bt(x)&&x.every((function(t){return 0===t})))){var T,C=0;return qs(e,i,n,w,A,x,new Array(4).fill(0).map((function(r,a){return function(r,o,s,l){_[a]&&(C===a-1&&_[a]===T||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:_[a]}),i,n,u),e.beginPath(),e.moveTo(r,o),T=_[a]),C=a,e.lineTo(s,l),e.stroke(),3===a&&e.beginPath())}}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,n),_[0]?e.lineTo(i+w,n):e.moveTo(i+w,n),_[1]?e.lineTo(i+w,n+A):e.moveTo(i+w,n+A),_[2]?e.lineTo(i,n+A):e.moveTo(i,n+A),_[3]){var E=_[0]?n-e.lineWidth/2:n;e.lineTo(i,E)}else e.moveTo(i,n);e.stroke()}}}])}();Qs=Zs([L()],Qs);var tu=new Js,eu=Fs,iu=Is,nu=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).time=yi.beforeFillStroke,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c){var d=t.attribute,f=d.background,v=d.backgroundMode,p=void 0===v?u.backgroundMode:v,g=d.backgroundFit,y=void 0===g?u.backgroundFit:g;if(f)if(t.backgroundImg){var m=t.resources.get(f);if("success"!==m.state||!m.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var k=Rr(t.parent).group,_=t.parent.attribute,b=_.scrollX,x=void 0===b?k.scrollX:b,S=_.scrollY,w=void 0===S?k.scrollY:S;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(x,w)}var A=t.AABBBounds;this.doDrawImage(e,m.data,A,p,y),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(gt(f)){var T=f.stroke,C=f.fill,E=f.lineWidth,B=void 0===E?1:E,R=f.cornerRadius,M=void 0===R?0:R,P=f.expandX,O=void 0===P?0:P,I=f.expandY,L=void 0===I?0:I;if(!T&&!C)return;e.beginPath();var D=function(t){var e=la(t.attribute.boundsPadding),i=t.AABBBounds,n=i.x1,r=i.y1,a=i.width(),o=i.height();return wt(e)?(n+=e,r+=e,a-=2*e,o-=2*e):(n+=e[3],r+=e[0],a-=e[1]+e[3],o-=e[0]+e[2]),{x:n,y:r,width:a,height:o}}(t),F=D.x,j=D.y,N=D.width,z=D.height;M?qs(e,F-O,j-L,N+2*O,z+2*L,M):e.rect(F-O,j-L,N+2*O,z+2*L),e.globalAlpha=1,C&&(e.fillStyle=C,e.fill()),T&&B>0&&(e.lineWidth=B,e.strokeStyle=T,e.stroke())}else{e.beginPath();var U=t.AABBBounds;e.rect(i,n,U.width(),U.height()),e.fillStyle=f,e.globalAlpha=1,e.fill()}}}])}(Os);var ru=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).time=yi.afterFillStroke,t.useStyle=!0,t.order=0,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,n,r,a,o,s,u,l,h,d,f){return p(c(i.prototype),"drawShape",this).call(this,t,e,n,r,a,o,s,u,l,h,d,f)}}])}(Js),au=new ru,ou=new nu,su=function(){return u((function t(){o(this,t),this.time=yi.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c){var d=t.getParsedPath();if(d){var f=t.attribute,v=f.outerBorder,p=f.innerBorder,g=v&&!1!==v.visible,y=p&&!1!==p.visible;if(g||y){var m=t.attribute,k=m.size,_=void 0===k?u.size:k,b=m.opacity,x=void 0===b?u.opacity:b,S=m.x,w=void 0===S?u.x:S,A=m.y,T=void 0===A?u.y:A,C=m.scaleX,E=void 0===C?u.scaleX:C,B=m.scaleY,R=void 0===B?u.scaleY:B,M=function(r,a){var o=!(!r||!r.stroke),s=r.distance,l=void 0===s?u[a].distance:s,h=Es(e,l,e.dpr),f="outerBorder"===a?1:-1;if(e.beginPath(),!1===d.drawOffset(e,_,i,n,f*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),c)c(e,r,u[a]);else if(o){var v=u[a].opacity;u[a].opacity=x,e.setStrokeStyle(t,r,(w-i)/E,(T-n)/R,u[a]),u[a].opacity=v,e.stroke()}};g&&M(v,"outerBorder"),y&&M(p,"innerBorder")}}}}])}(),uu=new su,lu=Fs,hu=Is,cu=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).time=yi.afterFillStroke,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d){var f,v,p,g;this.textureMap||this.initTextureMap(e,t.stage);var y=(d||{}).attribute,m=void 0===y?t.attribute:y,k=m.texture,_=void 0===k?null!==(f=t.attribute.texture)&&void 0!==f?f:pa(u,"texture"):k,b=m.textureColor,x=void 0===b?null!==(v=t.attribute.textureColor)&&void 0!==v?v:pa(u,"textureColor"):b,S=m.textureSize,w=void 0===S?null!==(p=t.attribute.textureSize)&&void 0!==p?p:pa(u,"textureSize"):S,A=m.texturePadding,T=void 0===A?null!==(g=t.attribute.texturePadding)&&void 0!==g?g:pa(u,"texturePadding"):A;_&&this.drawTexture(_,t,e,i,n,u,x,w,T)}}])}(Ds),du=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},fu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vu=function(t,e){return function(i,n){e(i,n,t)}},pu=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).arcRenderContribitions=t,n.numberType=ro,n.builtinContributions=[Ns,Us,zs],n.init(t),n}return h(i,t),u(i,[{key:"drawArcTailCapPath",value:function(t,e,i,n,r,a,o,s){var u=s-o,l=t.getParsedAngle(),h=l.startAngle,c=l.endAngle,d=(c=s)>h,f=!1;if(r<a){var v=r;r=a,a=v}var p=Ko(t,h,c,a,r);p.outerDeltaAngle;var g=p.xors,y=p.yors,m=p.xirs,k=p.yirs,_=p.limitedOcr,b=p.outerCornerRadiusStart,x=p.outerCornerRadiusEnd,S=p.maxOuterCornerRadius,w=p.xore,A=p.yore,T=p.xire,C=p.yire,E=p.limitedIcr,B=p.innerDeltaAngle,R=p.innerStartAngle,M=p.innerCornerRadiusStart,P=p.innerCornerRadiusEnd,O=p.maxInnerCornerRadius;if(_>ve){var I=Se(b,_),L=Se(x,_),D=Ho(m,k,g,y,r,I,Number(d)),F=Ho(w,A,T,C,r,L,Number(d));if(_<S&&I===L)e.moveTo(i+D.cx+D.x01,n+D.cy+D.y01),e.arc(i+D.cx,n+D.cy,_,_e(D.y01,D.x01),_e(F.y01,F.x01),!d);else{var j=c-u-.03,N=_e(F.y11,F.x11);e.arc(i,n,r,j,N,!d),L>0&&e.arc(i+F.cx,n+F.cy,L,_e(F.y11,F.x11),_e(F.y01,F.x01),!d)}}else e.moveTo(i+g,n+y);if(!(a>ve)||B<.001)e.lineTo(i+T,n+C),f=!0;else if(E>ve){var z=Se(M,E),U=Se(P,E),G=Ho(T,C,w,A,a,-U,Number(d)),W=Ho(g,y,m,k,a,-z,Number(d));if(e.lineTo(i+G.cx+G.x01,n+G.cy+G.y01),E<O&&z===U){var V=_e(W.y01,W.x01);e.arc(i+G.cx,n+G.cy,E,_e(G.y01,G.x01),V,!d)}else{U>0&&e.arc(i+G.cx,n+G.cy,U,_e(G.y01,G.x01),_e(G.y11,G.x11),!d);var H=_e(G.cy+G.y11,G.cx+G.x11),K=c-u-.03;e.arc(i,n,a,H,K,d)}}else e.lineTo(i+a*be(R),n+a*we(R));return f}},{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u=Rr(t,null==a?void 0:a.theme).arc,l=t.attribute,h=l.fill,c=void 0===h?u.fill:h,d=l.stroke,f=void 0===d?u.stroke:d,v=l.x,p=void 0===v?u.x:v,g=l.y,y=void 0===g?u.y:g,m=this.valid(t,u,o,s);if(m){var k=m.fVisible,_=m.sVisible,b=m.doFill,x=m.doStroke,S=t.attribute,w=S.outerPadding,A=void 0===w?u.outerPadding:w,T=S.innerPadding,C=void 0===T?u.innerPadding:T,E=S.cap,B=void 0===E?u.cap:E,R=S.forceShowCap,M=void 0===R?u.forceShowCap:R,P=t.attribute,O=P.outerRadius,I=void 0===O?u.outerRadius:O,L=P.innerRadius,D=void 0===L?u.innerRadius:L;I+=A,D-=C;var F=0,j=(dt(B)&&B||B[0])&&"conical"===c.gradient;if(j){var N=t.getParsedAngle(),z=N.sc,U=N.startAngle,G=N.endAngle;ke(G-U)<me-ve&&(F=z||0,c.startAngle-=F,c.endAngle-=F)}var W=!1,V=function(t){var e,i=!0;if(dt(t,!0)){for(var n=0;n<4;n++)sa[n]=t,i&&(i=!(null!==(e=sa[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(var r=0;r<4;r++)sa[r]=!!t[r],i&&(i=!!sa[r]);else sa[0]=!1,sa[1]=!1,sa[2]=!1,sa[3]=!1;return{isFullStroke:i,stroke:sa}}(f),H=V.isFullStroke,K=V.stroke;if((b||H)&&(e.beginPath(),Xo(t,e,i,n,I,D),W=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,b,x,k,_,u,r,o,s),b&&(o?o(e,t.attribute,u):k&&(e.setCommonStyle(t,t.attribute,p-i,y-n,u),e.fill())),x&&H&&(s?s(e,t.attribute,u):_&&(e.setStrokeStyle(t,t.attribute,p-i,y-n,u),e.stroke()))),!H&&x&&(e.beginPath(),Xo(t,e,i,n,I,D,K),W||this.beforeRenderStep(t,e,i,n,b,x,k,_,u,r,o,s),s?s(e,t.attribute,u):_&&(e.setStrokeStyle(t,t.attribute,i,n,u),e.stroke())),(dt(B)&&B||B[1])&&M){var X=t.getParsedAngle(),Y=X.startAngle,q=X.endAngle;if(ke(q-Y)>=me-ve){e.beginPath();var Z=Math.abs(I-D)/2/I,J=t.attribute,$=J.endAngle,Q=void 0===$?u.endAngle:$,tt=J.fill,et=void 0===tt?u.fill:tt,it=Q;if(this.drawArcTailCapPath(t,e,i,n,I,D,it,it+Z),W||this.beforeRenderStep(t,e,i,n,b,x,k,_,u,r,o,s),b){var nt=et;if("conical"===nt.gradient){var rt=function(t,e,i,n){for(var r=n.stops,a=n.startAngle,o=n.endAngle;i<0;)i+=me;for(;i>me;)i-=me;if(i<a)return r[0].color;if(i>o)return r[0].color;for(var s,u,l=(i-a)/(o-a),h=0;h<r.length;h++)if(r[h].offset>=l){s=r[h-1],u=r[h];break}return l=(l-s.offset)/(u.offset-s.offset),xa(s.color,u.color,l,!1)}(0,0,Q,nt);o||Uo&&(e.setCommonStyle(t,t.attribute,i,n,u),e.fillStyle=rt,e.fill())}}x&&(s||_&&(e.setStrokeStyle(t,t.attribute,i,n,u),e.stroke()))}}this.afterRenderStep(t,e,i,n,b,x,k,_,u,r,o,s),j&&(c.startAngle+=F,c.endAngle+=F)}}},{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}}])}(As);pu=du([L(),vu(0,O($)),vu(0,D(Jo)),fu("design:paramtypes",[Object])],pu);var gu=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},yu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mu=function(t,e){return function(i,n){e(i,n,t)}},ku=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).circleRenderContribitions=t,n.numberType=so,n.builtinContributions=[Ws,Hs,Vs],n.init(t),n}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u=Rr(t,null==a?void 0:a.theme).circle,l=t.attribute,h=l.radius,c=void 0===h?u.radius:h,d=l.startAngle,f=void 0===d?u.startAngle:d,v=l.endAngle,p=void 0===v?u.endAngle:v,g=l.x,y=void 0===g?u.x:g,m=l.y,k=void 0===m?u.y:m,_=this.valid(t,u,o,s);if(_){var b=_.fVisible,x=_.sVisible,S=_.doFill,w=_.doStroke;e.beginPath(),e.arc(i,n,c,f,p),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,S,w,b,x,u,r,o,s),S&&(o?o(e,t.attribute,u):b&&(e.setCommonStyle(t,t.attribute,y-i,k-n,u),e.fill())),w&&(s?s(e,t.attribute,u):x&&(e.setStrokeStyle(t,t.attribute,y-i,k-n,u),e.stroke())),this.afterRenderStep(t,e,i,n,S,w,b,x,u,r,o,s)}}},{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}}])}(As);function _u(t,e,i,n){if(e.p1){var r=n||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=r.offsetZ,h=void 0===l?0:l;if(1===i)e.p2&&e.p3?t.bezierCurveTo(o+e.p1.x,u+e.p1.y,o+e.p2.x,u+e.p2.y,o+e.p3.x,u+e.p3.y,h):t.lineTo(o+e.p1.x,u+e.p1.y,h);else if(e.p2&&e.p3){var c=g(zi(e,i),1)[0];t.bezierCurveTo(o+c.p1.x,u+c.p1.y,o+c.p2.x,u+c.p2.y,o+c.p3.x,u+c.p3.y,h)}else{var d=e.getPointAt(i);t.lineTo(o+d.x,u+d.y,h)}}}function bu(t,e,i,n,r,a,o){var s,u=e.p0,l=n;if(i&&i.originP1===i.originP2&&(u=i.p0),e.defined)n||(t.lineTo(u.x+r,u.y+a,o),l=!n);else{var h,c=e.originP1,d=e.originP2;if(c&&!1!==c.defined?h=u:c&&!1!==d.defined&&(h=null!==(s=e.p3)&&void 0!==s?s:e.p1),n){l=!n;var f=h?h.x:e.p0.x,v=h?h.y:e.p0.y;t.moveTo(f+r,v+a,o)}else h&&(l=!n,t.lineTo(h.x+r,h.y+a,o))}return l}function xu(t,e,i,n,r){var a=r||{},o=a.offsetX,s=void 0===o?0:o,u=a.offsetY,l=void 0===u?0:u,h=a.offsetZ,c=void 0===h?0:h,d=a.mode,f=void 0===d?"none":d,v=a.drawConnect,p=void 0!==v&&v;if((!p||"none"!==f)&&e){var g=!0,y=e.curves;if(i>=1)if(p){var m,k=!0;y.forEach((function(e,i){e.originP1!==e.originP2?(k=bu(t,e,m,k,s,l,c),m=e):m=e}))}else y.forEach((function(e){e.defined?(g&&t.moveTo(e.p0.x+s,e.p0.y+l,c),_u(t,e,1,r),g=!1):g=!0}));else if(!(i<=0)){var _;"x"===n?_=pi.ROW:"y"===n?_=pi.COLUMN:"auto"===n&&(_=e.direction);for(var b=i*e.tryUpdateLength(_),x=0,S=!0,w=null,A=0,T=y.length;A<T;A++){var C=y[A],E=C.getLength(_),B=(b-x)/E;if(x+=E,B<0)break;if(p){if(C.originP1===C.originP2){w=C;continue}S=bu(t,C,w,S,s,l,c),w=C}else{if(!C.defined){g=!0;continue}g&&t.moveTo(C.p0.x+s,C.p0.y+l,c),_u(t,C,Se(B,1),r),g=!1}}}}}ku=gu([L(),mu(0,O($)),mu(0,D(Qo)),yu("design:paramtypes",[Object])],ku);var Su=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},wu=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).numberType=co,t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}},{key:"drawSegmentItem",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d,f,v){var p,g,y,m,k;if(e){t.beginPath();var _=null!==(p=this.z)&&void 0!==p?p:0;xu(t.camera?t:t.nativeContext,e,u,l,{offsetX:h,offsetY:c,offsetZ:_}),d.cache&&!bt(d.cache)&&d.cache.curves.every((function(t){return t.defined}))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,o,s);var b=o.x,x=void 0===b?0:b,S=o.x,w=void 0===S?0:S;!1!==i&&(f?f(t,o,s):r&&(t.setCommonStyle(d,o,x-h,w-c,s),t.fill())),!1!==n&&(v?v(t,o,s):a&&(t.setStrokeStyle(d,o,x-h,w-c,s),t.stroke()));var A=o.connectedType,T=o.connectedX,C=o.connectedY,E=o.connectedStyle;if(bt(s)?(A=null!==(g=null!=A?A:s[0].connectedType)&&void 0!==g?g:s[1].connectedType,T=null!==(y=null!=T?T:s[0].connectedX)&&void 0!==y?y:s[1].connectedX,C=null!==(m=null!=C?C:s[0].connectedY)&&void 0!==m?m:s[1].connectedY,E=null!==(k=null!=E?E:s[0].connectedStyle)&&void 0!==k?k:s[1].connectedStyle):(A=null!=A?A:s.connectedType,T=null!=T?T:s.connectedX,C=null!=C?C:s.connectedY,E=null!=E?E:s.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),"none"!==A){t.beginPath(),xu(t.camera?t:t.nativeContext,e,u,l,{offsetX:h,offsetY:c,offsetZ:_,drawConnect:!0,mode:A,zeroX:T,zeroY:C});var B=[];bt(s)?s.forEach((function(t){return B.push(t)})):B.push(s),B.push(o),!1!==i&&(f?f(t,o,s):r&&(t.setCommonStyle(d,E,x-h,w-c,B),t.fill())),!1!==n&&(v?v(t,o,s):a&&(t.setStrokeStyle(d,E,x-h,w-c,B),t.stroke()))}return!1}}},{key:"drawLinearLineHighPerformance",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d){var f;e.beginPath();var v=null!==(f=this.z)&&void 0!==f?f:0,p=t.attribute.points,g=p[0];e.moveTo(g.x+o,g.y+s,v);for(var y=1;y<p.length;y++){var m=p[y];e.lineTo(m.x+o,m.y+s,v)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u);var k=t.attribute,_=k.x,b=void 0===_?0:_,x=k.x,S=void 0===x?0:x;!1!==i&&(c?c(e,t.attribute,u):r&&(e.setCommonStyle(t,t.attribute,b-o,S-s,u),e.fill())),!1!==n&&(d?d(e,t.attribute,u):a&&(e.setStrokeStyle(t,t.attribute,b-o,S-s,u),e.stroke()))}},{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u=this,l=Rr(t,null==a?void 0:a.theme).line,h=t.attribute,c=h.fill,d=void 0===c?l.fill:c,f=h.stroke,v=void 0===f?l.stroke:f,p=h.fillOpacity,g=void 0===p?l.fillOpacity:p,y=h.strokeOpacity,m=void 0===y?l.strokeOpacity:y,k=h.segments,_=h.points,b=h.closePath,x=h.curveTension,S=void 0===x?l.curveTension:x;if(this.valid(t,l,o,s)){var w=t.attribute.curveType,A=void 0===w?l.curveType:w;b&&"linear"===A&&(A="linearClosed");var T=t.attribute,C=T.clipRange,E=void 0===C?l.clipRange:C,B=T.clipRangeByDimension,R=void 0===B?l.clipRangeByDimension:B;if(1===E&&!k&&!_.some((function(t){return!1===t.defined}))&&"linear"===A)return this.drawLinearLineHighPerformance(t,e,!!d,!!v,g,m,i,n,l,r,a,o,s);if(t.shouldUpdateShape()){var M=t.attribute,P=M.points,O=M.segments,I=P;if(O&&O.length){var L,D;if(t.cache=O.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(D={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===e?L={x:D.endX,y:D.endY,defined:D.curves[D.curves.length-1].defined}:e>1&&(L.x=D.endX,L.y=D.endY,L.defined=D.curves[D.curves.length-1].defined);var i=mn(t.points,A,{startPoint:L,curveTension:S});return D=i,i})).filter((function(t){return!!t})),"linearClosed"===A){for(var F,j=0;j<t.cache.length;j++){for(var N=t.cache[j],z=0;z<N.curves.length;z++)if(N.curves[z].defined){F=N.curves[z].p0;break}if(F)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(F.x,F.y,!0)}}else{if(!P||!P.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=mn(I,A,{curveTension:S})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){var U=t.attribute.segments.filter((function(t){return t.points.length}));if(1===U[0].points.length&&U.shift(),1===E){var G=!1;t.cache.forEach((function(r,a){G||(G=u.drawSegmentItem(e,r,!!d,!!v,g,m,U[a],[l,t.attribute],E,R,i,n,t,o,s))}))}else{var W=t.cache.reduce((function(t,e){return t+e.getLength()}),0),V=E*W,H=0,K=!1;t.cache.forEach((function(r,a){if(!K){var h=r.getLength(),c=(V-H)/h;H+=h,c>0&&(K=u.drawSegmentItem(e,r,!!d,!!v,g,m,U[a],[l,t.attribute],Se(c,1),R,i,n,t,o,s))}}))}}else this.drawSegmentItem(e,t.cache,!!d,!!v,g,m,t.attribute,l,E,R,i,n,t,o,s)}}}])}(As);function Au(t,e,i,n){if(!(e.length<2)){var r=n||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=r.offsetZ,h=void 0===l?0:l;r.mode;var c=e[0];t.moveTo(c.p0.x+o,c.p0.y+u,h);var d=(c=e[e.length-1]).p3||c.p1;t.lineTo(d.x+o,d.y+u,h),c=i[i.length-1],t.lineTo(c.p0.x+o,c.p0.y+u,h),d=(c=i[0]).p3||c.p1,t.lineTo(d.x+o,d.y+u,h),t.closePath()}}function Tu(t,e,i,n){var r=n||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=r.offsetZ,h=void 0===l?0:l,c=!0;e.forEach((function(e){e.defined?(c&&t.moveTo(e.p0.x+o,e.p0.y+u,h),_u(t,e,1,n),c=!1):c=!0})),c=!0;for(var d=i.length-1;d>=0;d--){var f=i[d];f.defined?(c&&t.lineTo(f.p0.x+o,f.p0.y+u,h),_u(t,f,1,n),c=!1):c=!0}t.closePath()}wu=Su([L()],wu);var Cu=new cu,Eu=Is,Bu=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Ru=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Mu=function(t,e){return function(i,n){e(i,n,t)}},Pu=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).areaRenderContribitions=t,n.numberType=oo,n.builtinContributions=[Cu,Eu],n.init(t),n}return h(i,t),u(i,[{key:"drawLinearAreaHighPerformance",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d){var f,v,p,g,y,m=t.attribute.points;if(!(m.length<2)){e.beginPath();var k=null!==(f=this.z)&&void 0!==f?f:0,_=m[0];e.moveTo(_.x+o,_.y+s,k);for(var b=1;b<m.length;b++){var x=m[b];e.lineTo(x.x+o,x.y+s,k)}for(var S=m.length-1;S>=0;S--){var w=m[S];e.lineTo((null!==(v=w.x1)&&void 0!==v?v:w.x)+o,(null!==(p=w.y1)&&void 0!==p?p:w.y)+s,k)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,o,s,!!r,!1,i,!1,u,l,c,null,{attribute:t.attribute});var A=t.attribute,T=A.x,C=void 0===T?0:T,E=A.x,B=void 0===E?0:E;if(!1!==i&&(c?c(e,t.attribute,u):r&&(e.setCommonStyle(t,t.attribute,C-o,B-s,u),e.fill())),this.afterRenderStep(t,e,o,s,!!r,!1,i,!1,u,l,c,null,{attribute:t.attribute}),n){var R=t.attribute.stroke,M=void 0===R?u&&u.stroke:R;if(bt(M)&&(M[0]||M[2])&&!1===M[1])if(e.beginPath(),M[0]){e.moveTo(_.x+o,_.y+s,k);for(var P=1;P<m.length;P++){var O=m[P];e.lineTo(O.x+o,O.y+s,k)}}else if(M[2]){var I=m[m.length-1];e.moveTo(I.x+o,I.y+s,k);for(var L=m.length-2;L>=0;L--){var D=m[L];e.lineTo((null!==(g=D.x1)&&void 0!==g?g:D.x)+o,(null!==(y=D.y1)&&void 0!==y?y:D.y)+s,k)}}d?d(e,t.attribute,u):(e.setStrokeStyle(t,t.attribute,C-o,B-s,u),e.stroke())}}}},{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u,l,h,c,d,f,v=this,p=Rr(t,null==a?void 0:a.theme).area,g=t.attribute,y=g.fill,m=void 0===y?p.fill:y,k=g.stroke;void 0===k&&p.stroke;var _=g.fillOpacity,b=void 0===_?p.fillOpacity:_,x=g.z,S=void 0===x?p.z:x,w=g.strokeOpacity,A=void 0===w?p.strokeOpacity:w,T=g.curveTension,C=void 0===T?p.curveTension:T,E=this.valid(t,p,o,s);if(E){var B=E.doFill,R=E.doStroke&&E.sVisible,M=t.attribute,P=M.clipRange,O=void 0===P?p.clipRange:P,I=M.closePath,L=M.points,D=M.segments,F=t.attribute.curveType,j=void 0===F?p.curveType:F;if(I&&"linear"===j&&(j="linearClosed"),1===O&&!D&&!L.some((function(t){return!1===t.defined}))&&"linear"===j)return this.drawLinearAreaHighPerformance(t,e,!!m,R,b,A,i,n,p,r,a,o,s);if(t.shouldUpdateShape()){if(D&&D.length){for(var N,z,U,G=D.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(z={endX:t.points[0].x,endY:t.points[0].y}),null;1===e?N={x:z.endX,y:z.endY}:e>1&&(N.x=z.endX,N.y=z.endY);var i=mn(t.points,j,{startPoint:N,curveTension:C});return z=i,i})).filter((function(t){return!!t})),W=[],V=D.length-1;V>=0;V--){for(var H=D[V].points,K=[],X=H.length-1;X>=0;X--)K.push({x:null!==(u=H[X].x1)&&void 0!==u?u:H[X].x,y:null!==(l=H[X].y1)&&void 0!==l?l:H[X].y});if(0!==V){var Y=D[V-1].points,q=Y[Y.length-1];q&&K.push({x:null!==(h=q.x1)&&void 0!==h?h:q.x,y:null!==(c=q.y1)&&void 0!==c?c:q.y})}K.length>1&&(U=mn(K,"stepBefore"===j?"stepAfter":"stepAfter"===j?"stepBefore":j,{curveTension:C}),W.unshift(U))}t.cacheArea=W.map((function(t,e){return{top:G[e],bottom:t}}))}else{if(!L||!L.length)return t.cacheArea=null,void t.clearUpdateShapeTag();for(var Z=L,J=[],$=L.length-1;$>=0;$--)J.push({x:null!==(d=L[$].x1)&&void 0!==d?d:L[$].x,y:null!==(f=L[$].y1)&&void 0!==f?f:L[$].y});var Q=mn(Z,j,{curveTension:C}),tt=mn(J,"stepBefore"===j?"stepAfter":"stepAfter"===j?"stepBefore":j,{curveTension:C});t.cacheArea={top:Q,bottom:tt}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){var et=t.attribute.segments.filter((function(t){return t.points.length}));if(1===et[0].points.length&&et.shift(),1===O){var it=!1;t.cacheArea.forEach((function(a,u){it||(it=v.drawSegmentItem(e,a,B,b,R,A,et[u],[p,t.attribute],O,i,n,S,t,r,o,s))}))}else{var nt=t.cacheArea.reduce((function(t,e){return t+e.top.getLength()}),0),rt=O*nt,at=0,ot=!1;t.cacheArea.forEach((function(a,u){if(!ot){var l=a.top.getLength(),h=(rt-at)/l;at+=l,h>0&&(ot=v.drawSegmentItem(e,a,B,b,R,A,et[u],[p,t.attribute],Se(h,1),i,n,S,t,r,o,s))}}))}}else this.drawSegmentItem(e,t.cacheArea,B,b,R,A,t.attribute,p,O,i,n,S,t,r,o,s)}}},{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}},{key:"drawSegmentItem",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d,f,v,p){var g=!1;return g=(g=g||this._drawSegmentItem(t,e,i,n,r,a,o,s,u,l,h,c,d,f,!1,v,p))||this._drawSegmentItem(t,e,i,n,r,a,o,s,u,l,h,c,d,f,!0,v,p)}},{key:"_drawSegmentItem",value:function(t,e,i,n,r,a,o,s,u,l,h,c,d,f,v,p,g){var y,m,k,_;if(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length){var b=o.connectedType,x=o.connectedX,S=o.connectedY,w=o.connectedStyle,A=[];if(v&&(bt(s)?(b=null!==(y=null!=b?b:s[0].connectedType)&&void 0!==y?y:s[1].connectedType,x=null!==(m=null!=x?x:s[0].connectedX)&&void 0!==m?m:s[1].connectedX,S=null!==(k=null!=S?S:s[0].connectedY)&&void 0!==k?k:s[1].connectedY,w=null!==(_=null!=w?w:s[0].connectedStyle)&&void 0!==_?_:s[1].connectedStyle):(b=null!=b?b:s.connectedType,x=null!=x?x:s.connectedX,S=null!=S?S:s.connectedY,w=null!=w?w:s.connectedStyle),"connect"!==b&&"zero"!==b&&(b="none"),bt(s)?s.forEach((function(t){return A.push(t)})):A.push(s),A.push(o)),v&&"none"===b)return!1;t.beginPath();var T,C,E=d.attribute,B=E.points,R=E.segments,M=pi.ROW;if(R){var P=R[R.length-1];C=R[0].points[0],T=P.points[P.points.length-1]}else C=B[0],T=B[B.length-1];var O=ke(T.x-C.x),I=ke(T.y-C.y);M=null==T.x1?pi.ROW:null==T.y1?pi.COLUMN:Number.isFinite(O+I)?O>I?pi.ROW:pi.COLUMN:pi.ROW,function(t,e,i,n){var r,a=n||{},o=a.drawConnect,s=void 0!==o&&o,u=a.mode;if(!s||"none"!==(void 0===u?"none":u)){var l=e.top,h=e.bottom;if(l.curves.length===h.curves.length)if(i>=1){var c=[],d=[],f=!0;if(s){var v,p,g=!0,y=l.curves.length;l.curves.forEach((function(e,i){var r=h.curves[y-i-1],a=e,o=r;if(e.originP1===e.originP2)return v=e,void(p=r);if(v&&v.originP1===v.originP2&&(a=v,o=p),e.defined)g||(c.push(a),d.push(o),Au(t,c,d,n),c.length=0,d.length=0,g=!g);else{var s,u,l=e.originP1,f=e.originP2;l&&!1!==l.defined?(s=a,u=o):l&&!1!==f.defined&&(s=e,u=r),g?(g=!g,c.push(s||e),d.push(u||r)):s&&(g=!g,c.push(s||e),d.push(u||r),Au(t,c,d,n),c.length=0,d.length=0)}v=e})),Au(t,c,d,n)}else{for(var m=0,k=l.curves.length;m<k;m++){var _=l.curves[m];f!==_.defined?(f?(Tu(t,c,d,n),c.length=0,d.length=0):(c.push(_),d.push(h.curves[k-m-1])),f=!f):f&&(c.push(_),d.push(h.curves[k-m-1]))}Tu(t,c,d,n)}}else if(!(i<=0)){var b=(n||{}).direction,x=l.curves,S=null!==(r=x[x.length-1].p3)&&void 0!==r?r:x[x.length-1].p1,w=ke(S.x-x[0].p0.x),A=ke(S.y-x[0].p0.y);b=null!=b?b:w>A?pi.ROW:pi.COLUMN,Number.isFinite(w)||(b=pi.COLUMN),Number.isFinite(A)||(b=pi.ROW);for(var T,C,E=i*(b===pi.ROW?w:A),B=0,R=!0,M=[],P=[],O=!0,I=0,L=l.curves.length;I<L;I++){var D=l.curves[I],F=D.getLength(b),j=(E-B)/F;if(j<0)break;if(B+=F,s){var N=h.curves[L-I-1],z=D,U=N;if(D.originP1===D.originP2){T=D,C=N;continue}if(T&&T.originP1===T.originP2&&(z=T,U=C),D.defined)O||(M.push(z),P.push(U),Au(t,M,P,n),M.length=0,P.length=0,O=!O);else{var G=D.originP1,W=D.originP2,V=void 0,H=void 0;G&&!1!==G.defined?(V=z,H=U):G&&!1!==W.defined&&(V=D,H=N),O?(O=!O,M.push(V||D),P.push(H||N)):V&&(O=!O,M.push(V||D),P.push(H||N),Au(t,M,P,n),M.length=0,P.length=0)}T=D}else{var K=null,X=null;R!==D.defined?(R?(Tu(t,M,P,n),M.length=0,P.length=0):(K=D,X=h.curves[L-I-1]),R=!R):R&&(K=D,X=h.curves[L-I-1]),K&&X&&(j<1&&(K=K.p2&&K.p3?zi(K,j)[0]:Gi(K,j)[0],X=X.p2&&X.p3?zi(X,1-j)[1]:Gi(X,1-j)[1]),K.defined=R,X.defined=R,M.push(K),P.push(X)),K=null,X=null}}s?Au(t,M,P,n):Tu(t,M,P,n)}}}(t.camera?t:t.nativeContext,e,u,{offsetX:l,offsetY:h,offsetZ:c,direction:M,drawConnect:v,mode:b,zeroX:x,zeroY:S}),this.beforeRenderStep(d,t,l,h,!!n,!1,i,!1,s,f,p,null,{attribute:o}),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,o,s);var L=o.x,D=void 0===L?0:L,F=o.x,j=void 0===F?0:F;if(!1!==i&&(p?p(t,o,s):n&&(t.setCommonStyle(d,v?w:o,D-l,j-h,v?A:s),t.fill())),this.afterRenderStep(d,t,l,h,!!n,!1,i,!1,s,f,p,null,{attribute:o}),!1!==r)if(g)g(t,o,s);else{var N=o.stroke,z=void 0===N?s&&s[1]&&s[1].stroke:N;bt(z)&&(z[0]||z[2])&&!1===z[1]&&(t.beginPath(),xu(t.camera?t:t.nativeContext,z[0]?e.top:e.bottom,u,M===pi.ROW?"x":"y",{offsetX:l,offsetY:h,offsetZ:c,drawConnect:v,mode:b,zeroX:x,zeroY:S})),t.setStrokeStyle(d,v?w:o,D-l,j-h,v?A:s),t.stroke()}return!1}}}])}(As);Pu=Bu([L(),Mu(0,O($)),Mu(0,D($o)),Ru("design:paramtypes",[Object])],Pu);var Ou=Fs,Iu=Is,Lu=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Du=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fu=function(t,e){return function(i,n){e(i,n,t)}},ju=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).pathRenderContribitions=t,n.numberType=fo,n.builtinContributions=[Iu,Ou],n.init(t),n}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u,l,h,c=null!==(u=this.tempTheme)&&void 0!==u?u:Rr(t,null==a?void 0:a.theme).path,d=t.attribute,f=d.x,v=void 0===f?c.x:f,p=d.y,g=void 0===p?c.y:p,y=null!==(l=this.z)&&void 0!==l?l:0,m=this.valid(t,c,o,s);if(m){var k=m.fVisible,_=m.sVisible,b=m.doFill,x=m.doStroke;if(e.beginPath(),t.pathShape)Li(t.pathShape.commandList,e,i,n,1,1,y);else Li((null!==(h=t.attribute.path)&&void 0!==h?h:c.path).commandList,e,i,n,1,1,y);e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,n,b,x,k,_,c,r,o,s),x&&(s?s(e,t.attribute,c):_&&(e.setStrokeStyle(t,t.attribute,v-i,g-n,c),e.stroke())),b&&(o?o(e,t.attribute,c):k&&(e.setCommonStyle(t,t.attribute,v-i,g-n,c),e.fill())),this.afterRenderStep(t,e,i,n,b,x,k,_,c,r,o,s)}}},{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}}])}(As);ju=Lu([L(),Fu(0,O($)),Fu(0,D(is)),Du("design:paramtypes",[Object])],ju);var Nu=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},zu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uu=function(t,e){return function(i,n){e(i,n,t)}},Gu=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).rectRenderContribitions=t,n.type="rect",n.numberType=go,n.builtinContributions=[tu,iu,eu],n.init(t),n}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u,l=null!==(u=this.tempTheme)&&void 0!==u?u:Rr(t,null==a?void 0:a.theme).rect,h=t.attribute,c=h.fill,d=void 0===c?l.fill:c,f=h.background,v=h.stroke,p=void 0===v?l.stroke:v,g=h.cornerRadius,y=void 0===g?l.cornerRadius:g,m=h.opacity,k=void 0===m?l.opacity:m,_=h.fillOpacity,b=void 0===_?l.fillOpacity:_,x=h.lineWidth,S=void 0===x?l.lineWidth:x,w=h.strokeOpacity,A=void 0===w?l.strokeOpacity:w,T=h.visible,C=void 0===T?l.visible:T,E=h.x1,B=h.y1,R=h.x,M=void 0===R?l.x:R,P=h.y,O=void 0===P?l.y:P,I=t.attribute,L=I.width,D=I.height,F=Go(k,b,L=(null!=L?L:E-M)||0,D=(null!=D?D:B-O)||0,d),j=Vo(k,A,L,D),N=No(d,f),z=zo(p,S);if(t.valid&&C&&(N||z)&&(F||j||o||s||f)){0===y||bt(y)&&y.every((function(t){return 0===t}))?(e.beginPath(),e.rect(i,n,L,D)):(e.beginPath(),qs(e,i,n,L,D,y));var U={doFill:N,doStroke:z};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,N,z,F,j,l,r,o,s,U),U.doFill&&(o?o(e,t.attribute,l):F&&(e.setCommonStyle(t,t.attribute,M-i,O-n,l),e.fill())),U.doStroke&&(s?s(e,t.attribute,l):j&&(e.setStrokeStyle(t,t.attribute,M-i,O-n,l),e.stroke())),this.afterRenderStep(t,e,i,n,N,z,F,j,l,r,o,s)}}},{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}}])}(As);Gu=Nu([L(),Uu(0,O($)),Uu(0,D(rs)),zu("design:paramtypes",[Object])],Gu);var Wu=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Vu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hu=function(t,e){return function(i,n){e(i,n,t)}},Ku=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).symbolRenderContribitions=t,n.numberType=ko,n.builtinContributions=[uu,hu,lu],n.init(t),n}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u,l=Rr(t,null==a?void 0:a.theme).symbol,h=t.attribute,c=h.size,d=void 0===c?l.size:c,f=h.x,v=void 0===f?l.x:f,p=h.y,g=void 0===p?l.y:p,y=h.scaleX,m=void 0===y?l.scaleX:y,k=h.scaleY,_=void 0===k?l.scaleY:k,b=this.valid(t,l,o,s);if(b){var x=b.fVisible,S=b.sVisible,w=b.doFill,A=b.doStroke,T=t.getParsedPath();if(T){var C=t.attribute.keepDirIn3d,E=void 0===C?l.keepDirIn3d:C,B=null!==(u=this.z)&&void 0!==u?u:0;e.beginPath();var R=function(r,a){var u,h,c;if(t._parsedPath.svgCache){var d=Object.assign({},a);d.fill=null!==(u=a.fill)&&void 0!==u?u:t.attribute.fill,d.opacity=null!==(h=a.opacity)&&void 0!==h?h:t.attribute.opacity,d.fillOpacity=t.attribute.fillOpacity,d.stroke=null!==(c=a.stroke)&&void 0!==c?c:t.attribute.stroke,a=d}a.fill&&(o?o(e,t.attribute,l):(e.setCommonStyle(t,a,v-i,g-n,l),e.fill())),a.stroke&&(s?s(e,t.attribute,l):(e.setStrokeStyle(t,a,(v-i)/m,(g-n)/_,l),e.stroke()))};if(E&&e.camera&&e.project){var M=e.project(i,n,B),P=e.camera;e.camera=null,!1===T.draw(e,bt(d)?[d[0]*m,d[1]*_]:d*m,M.x,M.y,void 0,R)&&e.closePath(),e.camera=P}else!1===T.draw(e,d,i,n,B,R)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,w,A,x,S,l,r,o,s),w&&!T.isSvg&&(o?o(e,t.attribute,l):x&&(e.setCommonStyle(t,t.attribute,v-i,g-n,l),e.fill())),A&&!T.isSvg&&(s?s(e,t.attribute,l):S&&(e.setStrokeStyle(t,t.attribute,(v-i)/m,(g-n)/_,l),e.stroke())),this.afterRenderStep(t,e,i,n,w,A,x,S,l,r,o,s)}}}},{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}}])}(As);Ku=Wu([L(),Hu(0,O($)),Hu(0,D(as)),Vu("design:paramtypes",[Object])],Ku);var Xu,Yu=new(function(){return u((function t(){o(this,t),this.pools=[];for(var e=0;e<10;e++)this.pools.push(new Oe)}),[{key:"allocate",value:function(t,e,i,n){if(!this.pools.length)return(new Oe).setValue(t,e,i,n);var r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=i,r.y2=n,r}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new Oe(t);var e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}()),qu=new(function(){return u((function t(){o(this,t),this.store=new Map}),[{key:"RegisterGraphicCreator",value:function(t,e){this.store.set(t,e),this[t]=e}},{key:"CreateGraphic",value:function(t,e){var i=this.store.get(t);return i?i(e):null}}])}());function Zu(t){return Xu||(Xu=qu.CreateGraphic("text",{})),Xu.initAttributes(t),Xu.AABBBounds}var Ju=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).time=yi.beforeFillStroke,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s,u,l,h,c){var d,f,v,p,g,y,m,k,_,b,x,S=t.attribute,w=S.backgroundMode,A=void 0===w?u.backgroundMode:w,T=S.backgroundFit,C=void 0===T?u.backgroundFit:T,E=t.attribute.background;if(E){var B,R=function(){"richtext"===t.type&&(e.restore(),e.save(),x&&e.setTransformFromMatrix(x,!0,1))};"richtext"===t.type&&(x=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());var M=gt(E)&&E.background,P=t.transMatrix.onlyTranslate();if(M){var O=t.AABBBounds,I=(null!==(d=E.x)&&void 0!==d?d:O.x1)+(null!==(f=E.dx)&&void 0!==f?f:0),L=(null!==(v=E.y)&&void 0!==v?v:O.y1)+(null!==(p=E.dy)&&void 0!==p?p:0),D=null!==(g=E.width)&&void 0!==g?g:O.width(),F=null!==(y=E.height)&&void 0!==y?y:O.height();if(B=Yu.allocate(I,L,I+D,L+F),E=E.background,!P){var j=B.width(),N=B.height();B.set((null!==(m=E.x)&&void 0!==m?m:0)+(null!==(k=E.dx)&&void 0!==k?k:0),(null!==(_=E.y)&&void 0!==_?_:0)+(null!==(b=E.dy)&&void 0!==b?b:0),j,N)}}else B=t.AABBBounds,P||(B=Zu(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){var z=t.resources.get(E);if("success"!==z.state||!z.data)return void R();e.highPerformanceSave(),P&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,u),this.doDrawImage(e,z.data,B,A,C),e.highPerformanceRestore(),e.setTransformForCurrent()}else{var U=t.attribute.backgroundCornerRadius;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,u),e.fillStyle=E,U?(qs(e,B.x1,B.y1,B.width(),B.height(),U),e.fill()):e.fillRect(B.x1,B.y1,B.width(),B.height()),e.highPerformanceRestore()}M&&Yu.free(B),R()}}}])}(Os),$u=new Ju,Qu=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},tl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},el=function(t,e){return function(i,n){e(i,n,t)}},il=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).textRenderContribitions=t,n.numberType=_o,n.builtinContributions=[$u],n.init(t),n}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u,l,h,c=this,d=Rr(t,null==a?void 0:a.theme).text,f=t.attribute;f.text;var v=f.underline,p=void 0===v?d.underline:v,g=f.lineThrough,y=void 0===g?d.lineThrough:g,m=f.keepDirIn3d,k=void 0===m?d.keepDirIn3d:m,_=f.direction,b=void 0===_?d.direction:_,x=f.fontSize,S=void 0===x?d.fontSize:x,w=f.verticalMode,A=void 0===w?d.verticalMode:w,T=f.x,C=void 0===T?d.x:T,E=f.y,B=void 0===E?d.y:E,R=t.attribute,M=R.textAlign,P=void 0===M?d.textAlign:M,O=R.textBaseline,I=void 0===O?d.textBaseline:O;if(!A&&"vertical"===b){var L=P;P=null!==(u=t.getBaselineMapAlign()[I])&&void 0!==u?u:"left",I=null!==(l=t.getAlignMapBaseline()[L])&&void 0!==l?l:"top"}var D=null!==(h=ka(t.attribute.lineHeight,S))&&void 0!==h?h:S,F=this.valid(t,d,o,s);if(F){var j=F.fVisible,N=F.sVisible,z=F.doFill,U=F.doStroke,G=!k,W=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,i,n,z,U,j,N,d,r,o,s),G&&this.transformUseContext2d(t,d,W,e);var V=function(r,a,u,l){var h=i+a,f=n+u;if(l){e.highPerformanceSave(),h+=S;var v=ys.allocate(1,0,0,1,0,0);v.rotateByCenter(Math.PI/2,h,f),e.transformFromMatrix(v,!0),ys.free(v)}U&&(s?s(e,t.attribute,d):N&&(e.setStrokeStyle(t,t.attribute,C-i,B-n,d),e.strokeText(r,h,f,W))),z&&(o?o(e,t.attribute,d):j&&(e.setCommonStyle(t,t.attribute,C-i,B-n,d),e.fillText(r,h,f,W),c.drawUnderLine(p,y,t,h,f,W,d,e))),l&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,d,W),"horizontal"===b){var H=t.multilineLayout;if(!H)return void e.highPerformanceRestore();var K=H.bbox,X=K.xOffset,Y=K.yOffset;U&&(s?s(e,t.attribute,d):N&&(e.setStrokeStyle(t,t.attribute,C-i,B-n,d),H.lines.forEach((function(t){e.strokeText(t.str,(t.leftOffset||0)+X+i,(t.topOffset||0)+Y+n,W)})))),z&&(o?o(e,t.attribute,d):j&&(e.setCommonStyle(t,t.attribute,C-i,B-n,d),H.lines.forEach((function(r){var a,o;e.fillText(r.str,(r.leftOffset||0)+X+i,(r.topOffset||0)+Y+n,W),c.drawUnderLine(p,y,t,(r.leftOffset||0)+X+i,(r.topOffset||0)+Y+n-(o=S,"top"===(a="bottom")?Math.ceil(.79*o):"middle"===a?Math.round(.3*o):"bottom"===a?Math.round(-.21*o):0)-.05*S,W,d,e,{width:r.width})}))))}else{t.tryUpdateAABBBounds();var q=t.cache.verticalList;e.textAlign="left",e.textBaseline="top";var Z=D*q.length,J=0;q.forEach((function(t){var e=t.reduce((function(t,e){return t+(e.width||0)}),0);J=xe(e,J)}));var $=0,Q=0;"bottom"===I?Q=-Z:"middle"===I&&(Q=-Z/2),"center"===P?$-=J/2:"right"===P&&($-=J),q.forEach((function(t,e){var i=t.reduce((function(t,e){return t+(e.width||0)}),0),n=J-i,r=$;"center"===P?r+=n/2:"right"===P&&(r+=n),t.forEach((function(t){var i=t.text,n=t.width,a=t.direction;V(i,Z-(e+1)*D+Q,r,a),r+=n}))}))}else if("horizontal"===b){e.setTextStyle(t.attribute,d,W);var tt=t.clipedText,et=0;D!==S&&("top"===I?et=(D-S)/2:"middle"===I||"bottom"===I&&(et=-(D-S)/2)),V(tt,0,et,0)}else{t.tryUpdateAABBBounds();var it=t.cache;if(it){e.setTextStyleWithoutAlignBaseline(t.attribute,d,W);var nt=it.verticalList,rt=0,at=nt[0].reduce((function(t,e){return t+(e.width||0)}),0),ot=0;"bottom"===I?ot=-D:"middle"===I&&(ot=-D/2),"center"===P?rt-=at/2:"right"===P&&(rt-=at),e.textAlign="left",e.textBaseline="top",nt[0].forEach((function(t){var e=t.text,i=t.width,n=t.direction;V(e,ot,rt,n),rt+=i}))}}G&&this.restoreTransformUseContext2d(t,d,W,e),this.afterRenderStep(t,e,i,n,z,U,j,N,d,r,o,s)}}},{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).text,a=t.attribute.keepDirIn3d,o=!(void 0===a?r.keepDirIn3d:a);this._draw(t,r,o,i,n)}},{key:"drawUnderLine",value:function(t,e,i,n,r,a,o,s,u){if(!(e+t<=0)){var l=i.attribute,h=l.textAlign,c=void 0===h?o.textAlign:h,d=l.textBaseline,f=void 0===d?o.textBaseline:d,v=l.fontSize,p=void 0===v?o.fontSize:v,g=l.fill,y=void 0===g?o.fill:g,m=l.opacity,k=void 0===m?o.opacity:m,_=l.underlineOffset,b=void 0===_?o.underlineOffset:_,x=l.underlineDash,S=void 0===x?o.underlineDash:x,w=l.fillOpacity,A=void 0===w?o.fillOpacity:w,T=!vt(u),C=T?u.width:i.clipedWidth,E=T?0:us(c,C),B=ls(T?"alphabetic":f,p,p),R={lineWidth:0,stroke:y,opacity:k,strokeOpacity:A},M=T?-3:0;if(t){R.lineWidth=t,s.setStrokeStyle(i,R,n,r,o),S&&s.setLineDash(S),s.beginPath();var P=r+B+p+b+M;s.moveTo(n+E,P,a),s.lineTo(n+E+C,P,a),s.stroke()}if(T&&(M=-1),e){R.lineWidth=e,s.setStrokeStyle(i,R,n,r,o),s.beginPath();var O=r+B+p/2+M;s.moveTo(n+E,O,a),s.lineTo(n+E+C,O,a),s.stroke()}}}}])}(As);function nl(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(var r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function rl(t,e){return Math.sqrt(t*t+e*e)}function al(t,e,i,n,r){var a=e/i;return{x:t.x-n*a,y:t.y-r*a}}il=Qu([L(),el(0,O($)),el(0,D(os)),tl("design:paramtypes",[Object])],il);var ol=Fs,sl=Is,ul=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},ll=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hl=function(t,e){return function(i,n){e(i,n,t)}},cl=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).polygonRenderContribitions=t,n.numberType=vo,n.builtinContributions=[sl,ol],n.init(t),n}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u=Rr(t,null==a?void 0:a.theme).polygon,l=t.attribute,h=l.points,c=void 0===h?u.points:h,d=l.cornerRadius,f=void 0===d?u.cornerRadius:d,v=l.x,p=void 0===v?u.x:v,g=l.y,y=void 0===g?u.y:g,m=l.closePath,k=void 0===m?u.closePath:m,_=this.valid(t,u,o,s);if(_){var b=_.fVisible,x=_.sVisible,S=_.doFill,w=_.doStroke;e.beginPath(),f<=0||bt(f)&&f.every((function(t){return 0===t}))?nl(e.camera?e:e.nativeContext,c,i,n):function(t,e,i,n,r){var a,o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e.length<3)nl(t,e,i,n);else{var s=0,u=e.length-1;o||(s+=1,u-=1,t.moveTo(e[0].x+i,e[0].y+n));for(var l=s;l<=u;l++){var h=e[0===l?u:(l-1)%e.length],c=e[l%e.length],d=e[(l+1)%e.length],f=c.x-h.x,v=c.y-h.y,p=c.x-d.x,g=c.y-d.y,y=(Math.atan2(v,f)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(y)),k=Array.isArray(r)?null!==(a=r[l%e.length])&&void 0!==a?a:0:r,_=k/m,b=rl(f,v),x=rl(p,g),S=Math.min(b,x);_>S&&(_=S,k=S*m);var w=al(c,_,b,f,v),A=al(c,_,x,p,g),T=2*c.x-w.x-A.x,C=2*c.y-w.y-A.y,E=rl(T,C),B=al(c,rl(_,k),E,T,C),R=Math.atan2(w.y-B.y,w.x-B.x),M=Math.atan2(A.y-B.y,A.x-B.x),P=M-R;P<0&&(R=M,P=-P),P>Math.PI&&(P-=Math.PI),0===l?t.moveTo(w.x+i,w.y+n):t.lineTo(w.x+i,w.y+n),P&&t.arcTo(c.x+i,c.y+n,A.x+i,A.y+n,k),t.lineTo(A.x+i,A.y+n)}o||t.lineTo(e[u+1].x+i,e[u+1].y+n)}}(e.camera?e:e.nativeContext,c,i,n,f,k),k&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,S,w,b,x,u,r,o,s),S&&(o?o(e,t.attribute,u):b&&(e.setCommonStyle(t,t.attribute,p-i,y-n,u),e.fill())),w&&(s?s(e,t.attribute,u):x&&(e.setStrokeStyle(t,t.attribute,p-i,y-n,u),e.stroke())),this.afterRenderStep(t,e,i,n,S,w,b,x,u,r,o,s)}}},{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}}])}(As);cl=ul([L(),hl(0,O($)),hl(0,D(ns)),ll("design:paramtypes",[Object])],cl);var dl=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},fl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vl=function(t,e){return function(i,n){e(i,n,t)}},pl=function(){return u((function t(e){o(this,t),this.groupRenderContribitions=e,this.numberType=lo}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u=Rr(t,null==a?void 0:a.theme).group,l=t.attribute,h=l.fill,c=void 0===h?u.fill:h,d=l.background,f=l.stroke,v=void 0===f?u.stroke:f,p=l.opacity,g=void 0===p?u.opacity:p,y=l.width,m=void 0===y?u.width:y,k=l.height,_=void 0===k?u.height:k,b=l.clip,x=void 0===b?u.clip:b,S=l.fillOpacity,w=void 0===S?u.fillOpacity:S,A=l.strokeOpacity,T=void 0===A?u.strokeOpacity:A,C=l.cornerRadius,E=void 0===C?u.cornerRadius:C,B=l.path,R=void 0===B?u.path:B,M=l.lineWidth,P=void 0===M?u.lineWidth:M,O=l.visible,I=void 0===O?u.visible:O,L=Go(g,w,m,_,c),D=Vo(g,T,m,_),F=No(c,d),j=zo(v,P);if(t.valid&&I){if(!x){if(!F&&!j)return;if(!(L||D||o||s||d))return}if(R&&R.length&&r.drawContribution){var N=e.disableFill,z=e.disableStroke,U=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,R.forEach((function(t){r.drawContribution.getRenderContribution(t).draw(t,r.renderService,r,a)})),e.disableFill=N,e.disableStroke=z,e.disableBeginPath=U}else 0===E||bt(E)&&E.every((function(t){return 0===t}))?(e.beginPath(),e.rect(i,n,m,_)):(e.beginPath(),qs(e,i,n,m,_,E));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Xs));var G={doFill:F,doStroke:j};this._groupRenderContribitions.forEach((function(a){a.time===yi.beforeFillStroke&&a.drawShape(t,e,i,n,F,j,L,D,u,r,o,s,G)})),x&&e.clip(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),G.doFill&&(o?o(e,t.attribute,u):L&&(e.setCommonStyle(t,t.attribute,i,n,u),e.fill())),G.doStroke&&(s?s(e,t.attribute,u):D&&(e.setStrokeStyle(t,t.attribute,i,n,u),e.stroke())),this._groupRenderContribitions.forEach((function(a){a.time===yi.afterFillStroke&&a.drawShape(t,e,i,n,F,j,L,D,u,r,o,s)}))}}},{key:"draw",value:function(t,e,i,n){var r=i.context;if(r){var a=t.attribute,o=a.clip,s=a.baseOpacity,u=void 0===s?1:s;o?r.save():r.highPerformanceSave();var l=r.baseGlobalAlpha;r.baseGlobalAlpha*=u;var h=Rr(t,null==n?void 0:n.theme).group,c=r.modelMatrix;if(r.camera){var d=ms.allocate(),f=ms.allocate();xs(f,t,h),fs(d,c||d,f),r.modelMatrix=d,ms.free(f),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(function(){return!1}),(function(){return!1})):this.drawShape(t,r,0,0,i);var v,p=t.attribute,g=p.scrollX,y=void 0===g?h.scrollX:g,m=p.scrollY,k=void 0===m?h.scrollY:m;(y||k)&&r.translate(y,k),n&&n.drawingCb&&(v=n.drawingCb()),r.modelMatrix!==c&&ms.free(r.modelMatrix),r.modelMatrix=c,r.baseGlobalAlpha=l,v&&v.then?v.then((function(){o?r.restore():r.highPerformanceRestore()})):o?r.restore():r.highPerformanceRestore()}}}])}();pl=dl([L(),vl(0,O($)),vl(0,D(ts)),fl("design:paramtypes",[Object])],pl);var gl=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},yl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ml=function(t,e){return function(i,n){e(i,n,t)}},kl=["","repeat-x","repeat-y","repeat"],_l=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).imageRenderContribitions=t,n.numberType=ho,n.builtinContributions=[au,ou],n.init(t),n}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u=Rr(t).image,l=t.attribute,h=l.width,c=void 0===h?u.width:h,d=l.height,f=void 0===d?u.height:d,v=l.repeatX,p=void 0===v?u.repeatX:v,g=l.repeatY,y=void 0===g?u.repeatY:g,m=l.x,k=void 0===m?u.x:m,_=l.y,b=void 0===_?u.y:_,x=l.cornerRadius,S=void 0===x?u.cornerRadius:x,w=l.image,A=this.valid(t,u,o);if(A){var T=A.fVisible,C=A.sVisible,E=A.doFill,B=A.doStroke;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,u),this.beforeRenderStep(t,e,i,n,E,!1,T,!1,u,r,o),E)if(o)o(e,t.attribute,u);else if(T){if(!w||!t.resources)return;var R=t.resources.get(w);if("success"!==R.state)return;var M=!1;0===S||bt(S)&&S.every((function(t){return 0===t}))||(e.beginPath(),qs(e,i,n,c,f,S),e.save(),e.clip(),M=!0),e.setCommonStyle(t,t.attribute,i,n,u);var P=0;if("repeat"===p&&(P|=1),"repeat"===y&&(P|=2),P){var O=e.createPattern(R.data,kl[P]);e.fillStyle=O,e.translate(i,n,!0),e.fillRect(0,0,c,f),e.translate(-i,-n,!0)}else e.drawImage(R.data,i,n,c,f);M&&e.restore()}B&&(s?s(e,t.attribute,u):C&&(e.setStrokeStyle(t,t.attribute,k-i,b-n,u),e.stroke())),this.afterRenderStep(t,e,i,n,E,!1,T,!1,u,r,o)}}},{key:"draw",value:function(t,e,i){var n=t.attribute.image;if(n&&t.resources){var r=t.resources.get(n);if("loading"===r.state&&_t(n))Ca.improveImageLoading(n);else if("success"===r.state)if(e.drawParams.context){var a=Rr(t).image;this._draw(t,a,!1,i)}}}}])}(As);_l=gl([L(),ml(0,O($)),ml(0,D(es)),yl("design:paramtypes",[Object])],_l);var bl=Symbol.for("IncrementalDrawContribution"),xl=Symbol.for("ArcRender"),Sl=Symbol.for("Arc3dRender"),wl=Symbol.for("AreaRender"),Al=Symbol.for("CircleRender"),Tl=Symbol.for("GraphicRender"),Cl=Symbol.for("GroupRender"),El=Symbol.for("LineRender"),Bl=Symbol.for("PathRender"),Rl=Symbol.for("PolygonRender"),Ml=Symbol.for("RectRender"),Pl=Symbol.for("Rect3DRender"),Ol=Symbol.for("SymbolRender"),Il=Symbol.for("TextRender"),Ll=Symbol.for("RichTextRender"),Dl=Symbol.for("Pyramid3dRender"),Fl=Symbol.for("GlyphRender"),jl=Symbol.for("ImageRender"),Nl=Symbol.for("DrawContribution"),zl=function(t,e,i,n){var r,a=!1,o=!1;if(e.forEachChildren((function(t){return!(a=t.numberType===ao)})),e.forEachChildren((function(t){return!(o=!!t.findFace)})),a){var s=e.getChildren(),u=y(s);u.sort((function(t,e){for(var i,n,r,a,o=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,s=(null!==(a=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==a?a:0)/2;o<0;)o+=me;for(;s<0;)s+=me;return s-o})),u.forEach((function(t){t._next=null,t._prev=null})),e.removeAllChild(),e.update(),u.forEach((function(t){e.appendChild(t)})),n.hack_pieFace="outside",(r=i(a,o))&&r.graphic||(n.hack_pieFace="inside",r=i(a,o)),r&&r.graphic||(n.hack_pieFace="top",r=i(a,o)),e.removeAllChild(),s.forEach((function(t){t._next=null,t._prev=null})),s.forEach((function(t){e.appendChild(t)}))}else if(o){var l=e.getChildren(),h=l.map((function(e){return{ave_z:e.findFace().vertices.map((function(i){var n;return t.view(i[0],i[1],null!==(n=i[2]+e.attribute.z)&&void 0!==n?n:0)[2]})).reduce((function(t,e){return t+e}),0),g:e}}));h.sort((function(t,e){return e.ave_z-t.ave_z})),e.removeAllChild(),h.forEach((function(t){t.g._next=null,t.g._prev=null})),e.update(),h.forEach((function(t){e.add(t.g)})),r=i(a,o),e.removeAllChild(),l.forEach((function(t){t._next=null,t._prev=null})),e.update(),l.forEach((function(t){e.add(t)}))}else r=i(a,o);return r},Ul=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Gl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wl=Symbol.for("DrawItemInterceptor"),Vl=new Oe,Hl=new Oe,Kl=function(){return u((function t(){o(this,t),this.order=1}),[{key:"afterDrawItem",value:function(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,n,r),!1}},{key:"beforeDrawItem",value:function(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,n,r),!1}},{key:"drawItem",value:function(t,e,i,n,r){if(!t.shadowRoot)return!1;var a=i.context;if(a.highPerformanceSave(),a.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){Vl.copy(n.dirtyBounds),Hl.copy(n.backupDirtyBounds);var o=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(o),n.backupDirtyBounds.copy(n.dirtyBounds)}return n.renderGroup(t.shadowRoot,i,ys.allocate(1,0,0,1,0,0)),a.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&(n.dirtyBounds.copy(Vl),n.backupDirtyBounds.copy(Hl)),!0}}])}(),Xl=function(){return u((function t(){o(this,t),this.order=1}),[{key:"afterDrawItem",value:function(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}},{key:"drawItem",value:function(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;var a=i.context;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);var o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(a,t),a.strokeRect(o.x1,o.y1,o.width(),o.height()),a.highPerformanceRestore(),!0}}])}(),Yl=function(){return u((function t(){o(this,t),this.order=1,this.interceptors=[new Kl,new Zl,new ql,new Xl]}),[{key:"afterDrawItem",value:function(t,e,i,n,r){for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].afterDrawItem&&this.interceptors[a].afterDrawItem(t,e,i,n,r))return!0;return!1}},{key:"beforeDrawItem",value:function(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].beforeDrawItem&&this.interceptors[a].beforeDrawItem(t,e,i,n,r))return!0;return!1}}])}();Yl=Ul([L(),Gl("design:paramtypes",[])],Yl);var ql=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforeDrawItem",value:function(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}},{key:"beforeSetInteractive",value:function(t,e,i,n,r){var a=t.interactiveGraphic;if(t.attribute.globalZIndex){a||(a=t.clone(),t.interactiveGraphic=a,a.baseGraphic=t),a.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();var o=i.stage.getLayer("_builtin_interactive");return o&&this.getShadowRoot(o).add(a),!0}if(a){i.stage.tryInitInteractiveLayer();var s=i.stage.getLayer("_builtin_interactive");s&&this.getShadowRoot(s).removeChild(a),t.interactiveGraphic=null,a.baseGraphic=null}return!1}},{key:"beforeDrawInteractive",value:function(t,e,i,n,r){var a=t.baseGraphic;if(!a.stage){var o=i.stage.getLayer("_builtin_interactive");return o&&this.getShadowRoot(o).removeChild(t),!0}if(a){this.processing=!0;var s=i.context;return s.highPerformanceSave(),s.setTransformFromMatrix(a.parent.globalTransMatrix,!0),a.isContainer?n.renderGroup(a,i,a.parent.globalTransMatrix):n.renderItem(a,i),s.highPerformanceRestore(),this.processing=!1,!0}return!1}},{key:"getShadowRoot",value:function(t){var e,i=t.getElementById("_interactive_group");return i||((i=qu.CreateGraphic("group",{})).id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}])}(),Zl=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforeDrawItem",value:function(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;var a=e.drawParams,o=a.context,s=a.stage;o.canvas,o.save(),this.initCanvasCtx(o),o.camera=s.camera;var u=o.currentMatrix;u.a/=o.dpr,u.b/=o.dpr,u.c/=o.dpr,u.d/=o.dpr,u.e/=o.dpr,u.f/=o.dpr;var l=ms.allocate();ds(l,u);var h=o.modelMatrix;if(h){if(l){var c=ms.allocate();o.modelMatrix=fs(c,h,l)}}else o.modelMatrix=l;return o.setTransform(1,0,0,1,0,0,!0),t.isContainer?zl(o,t,(function(e,r){return n.renderGroup(t,i,t.parent.globalTransMatrix,!e&&r)}),i):n.renderItem(t,i),o.camera=null,o.restore(),o.modelMatrix!==h&&ms.free(o.modelMatrix),o.modelMatrix=h,i.in3dInterceptor=!1,!0}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}])}(),Jl=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},$l=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ql=function(t,e){return function(i,n){e(i,n,t)}},th=Symbol.for("RenderService"),eh=function(){return u((function t(e){o(this,t),this.drawContribution=e}),[{key:"prepare",value:function(t){var e=this;t&&this.renderTreeRoots.forEach((function(i){e._prepare(i,t)}))}},{key:"_prepare",value:function(t,e){var i=this;t.forEachChildren((function(t){i._prepare(t,e)})),t.update({bounds:e,trans:!0})}},{key:"prepareRenderList",value:function(){}},{key:"beforeDraw",value:function(t){}},{key:"draw",value:function(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}},{key:"afterDraw",value:function(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}},{key:"render",value:function(t,e){this.renderTreeRoots=t,this.drawParams=e;var i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}}])}();eh=Jl([L(),Ql(0,O(Nl)),$l("design:paramtypes",[Object])],eh);var ih=new x((function(t){t(th).to(eh)})),nh=Symbol.for("PickerService"),rh=Symbol.for("GlobalPickerService"),ah=function(t,e,i){var n=t.outerBorder,r=t.shadowBlur,a=void 0===r?e.shadowBlur:r;if(n){var o=e.outerBorder,s=n.distance,u=void 0===s?o.distance:s,l=n.lineWidth,h=void 0===l?o.lineWidth:l;i.expand(u+(a+h)/2)}return i},oh=["radius","startAngle","endAngle"].concat(y(Ma)),sh=function(t){function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1};return o(this,i),(t=e(this,i,[n])).type="circle",t.numberType=so,t}return h(i,t),u(i,[{key:"isValid",value:function(){return p(c(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,i=t.endAngle,n=t.radius;return this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}},{key:"getGraphicTheme",value:function(){return Rr(this).circle}},{key:"updateAABBBounds",value:function(t,e,i,n){if(!Vn.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(n?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));var r=Vn.graphicService.updateTempAABBBounds(i),a=r.tb1,o=r.tb2;return ah(t,e,a),i.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2),Vn.graphicService.transformAABBBounds(t,i,e,!1,this),i}},{key:"updateCircleAABBBoundsImprecise",value:function(t,e,i){var n=t.radius,r=void 0===n?e.radius:n;return i.set(-r,-r,r,r),i}},{key:"updateCircleAABBBoundsAccurate",value:function(t,e,i){var n=t.startAngle,r=void 0===n?e.startAngle:n,a=t.endAngle,o=void 0===a?e.endAngle:a,s=t.radius,u=void 0===s?e.radius:s;return o-r>me-ve?i.set(-u,-u,u,u):da(r,o,u,i),i}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,oh)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,oh)}},{key:"toCustomPath",value:function(){var t,e,i,n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),a=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),s=new kn;return s.arc(0,0,r,a,o),s}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function uh(t){return new sh(t)}sh.NOWORK_ANIMATE_ATTR=Da;var lh=function(){return u((function t(e,i,n){o(this,t),this.fontFamily=e,this.textOptions=i,this.textMeasure=n}),[{key:"LayoutBBox",value:function(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}},{key:"GetLayout",value:function(t,e,i,n,r,a,o,s,u){for(var l=[],h=[e,i],c=[0,0];t.length>0;){var d=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,s,u).str;l.push({str:d,width:this.textMeasure.measureTextWidth(d,this.textOptions)}),t=t.substring(d.length)}"left"===n||"start"===n||("center"===n?c[0]=h[0]/-2:"right"!==n&&"end"!==n||(c[0]=-h[0])),"top"===r||("middle"===r?c[1]=h[1]/-2:"bottom"===r&&(c[1]=-h[1]));var f={xOffset:c[0],yOffset:c[1],width:h[0],height:h[1]};return this.layoutWithBBox(f,l,n,r,a)}},{key:"GetLayoutByLines",value:function(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((function(t){return t.toString()}));var u=[],l=[0,0];if("number"==typeof o&&o!==1/0){for(var h,c=0,d=t.length;c<d;c++)h=Math.min(this.textMeasure.measureTextWidth(t[c],this.textOptions),o),u.push({str:this.textMeasure.clipTextWithSuffix(t[c],this.textOptions,h,r,a,s).str,width:h});l[0]=o}else{var f,v;o=0;for(var p=0,g=t.length;p<g;p++)v=t[p],f=this.textMeasure.measureTextWidth(v,this.textOptions),o=Math.max(o,f),u.push({str:v,width:f});l[0]=o}l[1]=u.length*n,l[0]=u.reduce((function(t,e){return Math.max(t,e.width)}),0);var y={xOffset:0,yOffset:0,width:l[0],height:l[1]};return this.LayoutBBox(y,e,i),this.layoutWithBBox(y,u,e,i,n)}},{key:"layoutWithBBox",value:function(t,e,i,n,r){var a=[0,0],o=e.length*r;"top"===n||("middle"===n?a[1]=(t.height-o)/2:"bottom"===n&&(a[1]=t.height-o));for(var s=0;s<e.length;s++)this.lineOffset(t,e[s],i,n,r,a);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}},{key:"lineOffset",value:function(t,e,i,n,r,a){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+a[1],a[1]+=r,e}}])}(),hh=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp"].concat(y(Ma)),ch=function(t){function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16};return o(this,i),(t=e(this,i,[n])).type="text",t.numberType=_o,t.cache={},t}return h(i,t),u(i,[{key:"font",get:function(){var t=this.getGraphicTheme();return this._font||(this._font=ti(this.attribute,t)),this._font}},{key:"clipedText",get:function(){var t,e=this.attribute,i=this.getGraphicTheme();if(this.isSimplify()){var n=e.maxLineWidth,r=void 0===n?i.maxLineWidth:n;return Number.isFinite(r)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}}},{key:"clipedWidth",get:function(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}},{key:"cliped",get:function(){var t=this.getGraphicTheme(),e=this.attribute;if(!this.isMultiLine){var i=e.maxLineWidth,n=void 0===i?t.maxLineWidth:i;return!!Number.isFinite(n)&&(this.tryUpdateAABBBounds(),"vertical"===e.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((function(t){return t.text})).join("")!==e.text.toString():null!=this.clipedText&&this.clipedText!==e.text.toString())}}},{key:"multilineLayout",get:function(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}},{key:"isSimplify",value:function(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}},{key:"isMultiLine",get:function(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}},{key:"isValid",value:function(){return p(c(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.text;return bt(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"getGraphicTheme",value:function(){return Rr(this).text}},{key:"updateAABBBounds",value:function(t,e,i){if(!Vn.graphicService.validCheck(t,e,i,this))return i;var n=this.attribute.text,r=void 0===n?e.text:n;Array.isArray(r)?this.updateMultilineAABBBounds(r):this.updateSingallineAABBBounds(r);var a=Vn.graphicService.updateTempAABBBounds(i).tb1,o=t.scaleX,s=void 0===o?e.scaleX:o,u=t.scaleY,l=void 0===u?e.scaleY:u,h=t.shadowBlur,c=void 0===h?e.shadowBlur:h,d=t.strokeBoundsBuffer,f=void 0===d?e.strokeBoundsBuffer:d;c&&(qa(a,c/Math.abs(s+l),!0,f),i.union(a));return Vn.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Vn.graphicService.updateHTMLTextAABBBounds(t,e,i),Me(i,i,this.transMatrix),i}},{key:"updateWrapAABBBounds",value:function(t){var e,i,n,r,a=this.getGraphicTheme(),o=this.attribute,s=o.fontFamily,u=void 0===s?a.fontFamily:s,l=o.textAlign,h=void 0===l?a.textAlign:l,c=o.textBaseline,d=void 0===c?a.textBaseline:c,f=o.fontSize,v=void 0===f?a.fontSize:f,p=o.ellipsis,g=void 0===p?a.ellipsis:p,y=o.maxLineWidth,m=o.stroke,k=void 0===m?a.stroke:m,_=o.lineWidth,b=void 0===_?a.lineWidth:_,x=o.wordBreak,S=void 0===x?a.wordBreak:x,w=o.fontWeight,A=void 0===w?a.fontWeight:w,T=o.ignoreBuf,C=void 0===T?a.ignoreBuf:T,E=o.suffixPosition,B=void 0===E?a.suffixPosition:E,R=o.heightLimit,M=void 0===R?0:R,P=o.lineClamp,O=null!==(e=ka(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,I=C?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var L=this.cache.layoutData.bbox;return this._AABBBounds.set(L.xOffset,L.yOffset,L.xOffset+L.width,L.yOffset+L.height),k&&this._AABBBounds.expand(b/2),this._AABBBounds}var D=Vn.graphicUtil.textMeasure,F=new lh(u,{fontSize:v,fontWeight:A,fontFamily:u},D),j=bt(t)?t.map((function(t){return t.toString()})):[t.toString()],N=[],z=[0,0],U=1/0;if(M>0&&(U=Math.max(Math.floor(M/O),1)),P&&(U=Math.min(U,P)),"number"==typeof y&&y!==1/0){if(y>0)for(var G=0;G<j.length;G++){var W=j[G],V=!0;if(G===U-1){var H=F.textMeasure.clipTextWithSuffix(W,F.textOptions,y,g,!1,B,G!==j.length-1);N.push({str:H.str,width:H.width});break}var K=F.textMeasure.clipText(W,F.textOptions,y,"break-word"===S);if(""!==W&&""===K.str){if(g){var X=F.textMeasure.clipTextWithSuffix(W,F.textOptions,y,g,!1,B);K.str=null!==(n=X.str)&&void 0!==n?n:"",K.width=null!==(r=X.width)&&void 0!==r?r:0}else K.str="",K.width=0;V=!1}if(N.push({str:K.str,width:K.width}),K.str.length===W.length);else if(V){var Y=W.substring(K.str.length);j.splice(G+1,0,Y)}}var q=0;N.forEach((function(t){q=Math.max(q,t.width)})),z[0]=q}else{for(var Z,J,$=0,Q=0,tt=j.length;Q<tt;Q++){if(Q===U-1){var et=F.textMeasure.clipTextWithSuffix(j[Q],F.textOptions,y,g,!1,B);N.push({str:et.str,width:et.width}),$=Math.max($,et.width);break}J=j[Q],Z=F.textMeasure.measureTextWidth(J,F.textOptions,"break-word"===S),$=Math.max($,Z),N.push({str:J,width:Z})}z[0]=$}z[1]=N.length*(O+I);var it={xOffset:0,yOffset:0,width:z[0],height:z[1]};F.LayoutBBox(it,h,d);var nt=F.layoutWithBBox(it,N,h,d,O);return this.cache.layoutData=nt,this.clearUpdateShapeTag(),this._AABBBounds.set(it.xOffset,it.yOffset,it.xOffset+it.width,it.yOffset+it.height),k&&this._AABBBounds.expand(b/2),this._AABBBounds}},{key:"updateSingallineAABBBounds",value:function(t){var e=this.getGraphicTheme(),i=this.attribute,n=i.direction,r=void 0===n?e.direction:n,a=i.underlineOffset,o=void 0===a?e.underlineOffset:a,s="horizontal"===r?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===r&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),s}},{key:"updateMultilineAABBBounds",value:function(t){var e=this.getGraphicTheme(),i=this.attribute,n=i.direction,r=void 0===n?e.direction:n,a=i.underlineOffset,o=void 0===a?e.underlineOffset:a,s="horizontal"===r?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===r&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),s}},{key:"updateHorizontalSinglelineAABBBounds",value:function(t){var e,i,n=this.getGraphicTheme(),r=this.attribute.wrap;if(void 0===r?n.wrap:r)return this.updateWrapAABBBounds([t]);var a,o,s=Vn.graphicUtil.textMeasure,u=this.attribute,l=u.maxLineWidth,h=void 0===l?n.maxLineWidth:l,c=u.ellipsis,d=void 0===c?n.ellipsis:c,f=u.textAlign,v=void 0===f?n.textAlign:f,p=u.textBaseline,g=void 0===p?n.textBaseline:p,y=u.fontFamily,m=void 0===y?n.fontFamily:y,k=u.fontSize,_=void 0===k?n.fontSize:k,b=u.fontWeight,x=void 0===b?n.fontWeight:b,S=u.stroke,w=void 0===S?n.stroke:S,A=u.lineWidth,T=void 0===A?n.lineWidth:A,C=u.ignoreBuf,E=void 0===C?n.ignoreBuf:C,B=u.whiteSpace,R=void 0===B?n.whiteSpace:B,M=u.suffixPosition,P=void 0===M?n.suffixPosition:M;if("normal"===R)return this.updateWrapAABBBounds(t);var O=E?0:Math.max(2,.075*_),I=u.fontSize||n.fontSize,L=null!==(e=ka(u.lineHeight,I))&&void 0!==e?e:I+O;if(!this.shouldUpdateShape()&&this.cache){var D=us(v,a=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0),F=ls(g,L,_);return this._AABBBounds.set(D,F,D+a,F+L),w&&this._AABBBounds.expand(T/2),this._AABBBounds}if(Number.isFinite(h)){if(d){var j=!0===d?n.ellipsis:d,N=s.clipTextWithSuffix(t.toString(),{fontSize:_,fontWeight:x,fontFamily:m},h,j,!1,P);o=N.str,a=N.width}else{var z=s.clipText(t.toString(),{fontSize:_,fontWeight:x,fontFamily:m},h,!1);o=z.str,a=z.width}this.cache.clipedText=o,this.cache.clipedWidth=a}else a=s.measureTextWidth(t.toString(),{fontSize:_,fontWeight:x,fontFamily:m}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=a;this.clearUpdateShapeTag();var U=us(v,a),G=L;Vn.global&&Vn.global.isSafari()&&(G+=.2*_);var W=ls(g,G,_,O);return this._AABBBounds.set(U,W,U+a,W+G),w&&this._AABBBounds.expand(T/2),this._AABBBounds}},{key:"getBaselineMapAlign",value:function(){return i.baselineMapAlign}},{key:"getAlignMapBaseline",value:function(){return i.alignMapBaseline}},{key:"updateVerticalSinglelineAABBBounds",value:function(t){var e,n,r,a,o=this.getGraphicTheme(),s=Vn.graphicUtil.textMeasure,u=this.attribute,l=u.ignoreBuf,h=(void 0===l?o.ignoreBuf:l)?0:2,c=u.maxLineWidth,d=void 0===c?o.maxLineWidth:c,f=u.ellipsis,v=void 0===f?o.ellipsis:f,p=u.fontSize,g=void 0===p?o.fontSize:p,y=u.fontWeight,m=void 0===y?o.fontWeight:y,k=u.fontFamily,_=void 0===k?o.fontFamily:k,b=u.stroke,x=void 0===b?o.stroke:b,S=u.lineWidth,w=void 0===S?o.lineWidth:S,A=u.verticalMode,T=void 0===A?o.verticalMode:A,C=u.suffixPosition,E=void 0===C?o.suffixPosition:C,B=null!==(e=ka(u.lineHeight,u.fontSize||o.fontSize))&&void 0!==e?e:(u.fontSize||o.fontSize)+h,R=u.textAlign,M=void 0===R?o.textAlign:R,P=u.textBaseline,O=void 0===P?o.textBaseline:P;if(!T){var I=M;M=null!==(n=i.baselineMapAlign[O])&&void 0!==n?n:"left",O=null!==(r=i.alignMapBaseline[I])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){var L=us(M,a=this.cache.clipedWidth),D=ls(O,B,g);return this._AABBBounds.set(D,L,D+B,L+a),x&&this._AABBBounds.expand(w/2),this._AABBBounds}var F=[Qa(t.toString())];if(Number.isFinite(d)){if(v){var j=!0===v?o.ellipsis:v,N=s.clipTextWithSuffixVertical(F[0],{fontSize:g,fontWeight:m,fontFamily:_},d,j,!1,E);F=[N.verticalList],a=N.width}else{var z=s.clipTextVertical(F[0],{fontSize:g,fontWeight:m,fontFamily:_},d,!1);F=[z.verticalList],a=z.width}this.cache.verticalList=F,this.cache.clipedWidth=a}else a=0,F[0].forEach((function(t){var e=t.direction===Za.HORIZONTAL?g:s.measureTextWidth(t.text,{fontSize:g,fontWeight:m,fontFamily:_});a+=e,t.width=e})),this.cache.verticalList=F,this.cache.clipedWidth=a;this.clearUpdateShapeTag();var U=us(M,a),G=ls(O,B,g);return this._AABBBounds.set(G,U,G+B,U+a),x&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"updateHorizontalMultilineAABBBounds",value:function(t){var e,i,n=this.getGraphicTheme(),r=this.attribute.wrap;if(void 0===r?n.wrap:r)return this.updateWrapAABBBounds(t);var a=this.attribute,o=a.fontFamily,s=void 0===o?n.fontFamily:o,u=a.textAlign,l=void 0===u?n.textAlign:u,h=a.textBaseline,c=void 0===h?n.textBaseline:h,d=a.fontSize,f=void 0===d?n.fontSize:d,v=a.fontWeight,p=void 0===v?n.fontWeight:v,g=a.ellipsis,y=void 0===g?n.ellipsis:g,m=a.maxLineWidth,k=a.stroke,_=void 0===k?n.stroke:k,b=a.lineWidth,x=void 0===b?n.lineWidth:b,S=a.whiteSpace,w=void 0===S?n.whiteSpace:S,A=a.suffixPosition,T=void 0===A?n.suffixPosition:A,C=null!==(e=ka(a.lineHeight,a.fontSize||n.fontSize))&&void 0!==e?e:a.fontSize||n.fontSize;if("normal"===w)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var E=this.cache.layoutData.bbox;return this._AABBBounds.set(E.xOffset,E.yOffset,E.xOffset+E.width,E.yOffset+E.height),_&&this._AABBBounds.expand(x/2),this._AABBBounds}var B=Vn.graphicUtil.textMeasure,R=new lh(s,{fontSize:f,fontWeight:p,fontFamily:s},B).GetLayoutByLines(t,l,c,C,!0===y?n.ellipsis:y||void 0,!1,m,T),M=R.bbox;return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),_&&this._AABBBounds.expand(x/2),this._AABBBounds}},{key:"updateVerticalMultilineAABBBounds",value:function(t){var e,n,r,a,o=this.getGraphicTheme(),s=Vn.graphicUtil.textMeasure,u=this.attribute,l=u.ignoreBuf,h=(void 0===l?o.ignoreBuf:l)?0:2,c=u.maxLineWidth,d=void 0===c?o.maxLineWidth:c,f=u.ellipsis,v=void 0===f?o.ellipsis:f,p=u.fontFamily,g=void 0===p?o.fontFamily:p,y=u.fontSize,m=void 0===y?o.fontSize:y,k=u.fontWeight,_=void 0===k?o.fontWeight:k,b=u.stroke,x=void 0===b?o.stroke:b,S=u.lineWidth,w=void 0===S?o.lineWidth:S,A=u.verticalMode,T=void 0===A?o.verticalMode:A,C=u.suffixPosition,E=void 0===C?o.suffixPosition:C,B=null!==(e=ka(u.lineHeight,u.fontSize||o.fontSize))&&void 0!==e?e:(u.fontSize||o.fontSize)+h,R=u.textAlign,M=void 0===R?o.textAlign:R,P=u.textBaseline,O=void 0===P?o.textBaseline:P;if(!T){var I=M;M=null!==(n=i.baselineMapAlign[O])&&void 0!==n?n:"left",O=null!==(r=i.alignMapBaseline[I])&&void 0!==r?r:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((function(t){var e=t.reduce((function(t,e){return t+e.width}),0);a=xe(e,a)}));var L=us(M,a),D=this.cache.verticalList.length*B,F=ls(O,D,m);return this._AABBBounds.set(F,L,F+D,L+a),x&&this._AABBBounds.expand(w/2),this._AABBBounds}var j=t.map((function(t){return Qa(t.toString())}));j.forEach((function(t,e){if(Number.isFinite(d))if(v){var i=!0===v?o.ellipsis:v,n=s.clipTextWithSuffixVertical(t,{fontSize:m,fontWeight:_,fontFamily:g},d,i,!1,E);j[e]=n.verticalList,a=n.width}else{var r=s.clipTextVertical(t,{fontSize:m,fontWeight:_,fontFamily:g},d,!1);j[e]=r.verticalList,a=r.width}else a=0,t.forEach((function(t){var e=t.direction===Za.HORIZONTAL?m:s.measureTextWidth(t.text,{fontSize:m,fontWeight:_,fontFamily:g});a+=e,t.width=e}))})),this.cache.verticalList=j,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((function(t){var e=t.reduce((function(t,e){return t+e.width}),0);a=xe(e,a)}));var N=us(M,a),z=this.cache.verticalList.length*B,U=ls(O,z,m);return this._AABBBounds.set(U,N,U+z,N+a),x&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hh;return p(c(i.prototype),"needUpdateTags",this).call(this,t,e)}},{key:"needUpdateTag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hh;return p(c(i.prototype),"needUpdateTag",this).call(this,t,e)}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function dh(t){return new ch(t)}ch.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Da),ch.baselineMapAlign={top:"left",bottom:"right",middle:"center"},ch.alignMapBaseline={left:"top",right:"bottom",center:"middle"};var fh=["heightLimit","lineClamp"],vh=function(t){function i(t){return o(this,i),e(this,i,[Object.assign(Object.assign({},t),{wrap:!0})])}return h(i,t),u(i,[{key:"_isValid",value:function(){var t=this.attribute.text;return bt(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"updateMultilineAABBBounds",value:function(t){var e,i,n,r,a=this.getGraphicTheme(),o=this.attribute,s=o.fontFamily,u=void 0===s?a.fontFamily:s,l=o.textAlign,h=void 0===l?a.textAlign:l,c=o.textBaseline,d=void 0===c?a.textBaseline:c,f=o.fontSize,v=void 0===f?a.fontSize:f,p=o.ellipsis,g=void 0===p?a.ellipsis:p,y=o.maxLineWidth,m=o.stroke,k=void 0===m?a.stroke:m,_=o.lineWidth,b=void 0===_?a.lineWidth:_,x=o.wordBreak,S=void 0===x?a.wordBreak:x,w=o.fontWeight,A=void 0===w?a.fontWeight:w,T=o.ignoreBuf,C=void 0===T?a.ignoreBuf:T,E=o.heightLimit,B=void 0===E?0:E,R=o.suffixPosition,M=void 0===R?a.suffixPosition:R,P=o.lineClamp,O=null!==(e=ka(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,I=C?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var L=this.cache.layoutData.bbox;return this._AABBBounds.set(L.xOffset,L.yOffset,L.xOffset+L.width,L.yOffset+L.height),k&&this._AABBBounds.expand(b/2),this._AABBBounds}var D=Vn.graphicUtil.textMeasure,F=new lh(u,{fontSize:v,fontWeight:A,fontFamily:u},D),j=t.map((function(t){return t.toString()})),N=[],z=[0,0],U=1/0;if(B>0&&(U=Math.max(Math.floor(B/O),1)),P&&(U=Math.min(U,P)),"number"==typeof y&&y!==1/0){if(y>0)for(var G=0;G<j.length;G++){var W=j[G],V=!0;if(G===U-1){var H=F.textMeasure.clipTextWithSuffix(W,F.textOptions,y,g,!1,M);N.push({str:H.str,width:H.width});break}var K=F.textMeasure.clipText(W,F.textOptions,y,"break-word"===S);if(""!==W&&""===K.str){if(g){var X=F.textMeasure.clipTextWithSuffix(W,F.textOptions,y,g,!1,M);K.str=null!==(n=X.str)&&void 0!==n?n:"",K.width=null!==(r=X.width)&&void 0!==r?r:0}else K.str="",K.width=0;V=!1}if(N.push({str:K.str,width:K.width}),K.str.length===W.length);else if(V){var Y=W.substring(K.str.length);j.splice(G+1,0,Y)}}var q=0;N.forEach((function(t){q=Math.max(q,t.width)})),z[0]=q}else{for(var Z,J,$=0,Q=0,tt=j.length;Q<tt;Q++){if(Q===U-1){var et=F.textMeasure.clipTextWithSuffix(j[Q],F.textOptions,y,g,!1,M);N.push({str:et.str,width:et.width}),$=Math.max($,et.width);break}J=j[Q],Z=F.textMeasure.measureTextWidth(J,F.textOptions,"break-word"===S),$=Math.max($,Z),N.push({str:J,width:Z})}z[0]=$}z[1]=N.length*(O+I);var it={xOffset:0,yOffset:0,width:z[0],height:z[1]};F.LayoutBBox(it,h,d);var nt=F.layoutWithBBox(it,N,h,d,O);return this.cache.layoutData=nt,this.clearUpdateShapeTag(),this._AABBBounds.set(it.xOffset,it.yOffset,it.xOffset+it.width,it.yOffset+it.height),k&&this._AABBBounds.expand(b/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){for(var e=0;e<fh.length;e++){var n=fh[e];if(-1!==t.indexOf(n))return!0}return p(c(i.prototype),"needUpdateTags",this).call(this,t)}},{key:"needUpdateTag",value:function(t){for(var e=0;e<fh.length;e++)if(t===fh[e])return!0;return p(c(i.prototype),"needUpdateTag",this).call(this,t)}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(ch);function ph(t){return new vh(t)}var gh=function(){return u((function t(){o(this,t)}),[{key:"bounds",value:function(t,e){if(wt(t)){var i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}])}();function yh(t,e,i,n,r){return r?t.arc(i,n,e,0,ye,!1,r):t.arc(i,n,e,0,ye),!1}var mh=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="circle",t.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n,r){return yh(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return yh(t,e/2+r,i,n,a)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i," a ").concat(r,",").concat(r," 0 1,0 ").concat(2*r,",0 a ").concat(r,",").concat(r," 0 1,0 -").concat(2*r,",0")}}])}(gh),kh=new mh;var _h=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="cross",t.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return function(t,e,i,n,r,a){return t.moveTo(-3*e+i-r,-e+n-r,a),t.lineTo(-e+i-r,-e+n-r,a),t.lineTo(-e+i-r,-3*e+n-r,a),t.lineTo(e+i+r,-3*e+n-r,a),t.lineTo(e+i+r,-e+n-r,a),t.lineTo(3*e+i+r,-e+n-r,a),t.lineTo(3*e+i+r,e+n+r,a),t.lineTo(e+i+r,e+n+r,a),t.lineTo(e+i+r,3*e+n+r,a),t.lineTo(-e+i-r,3*e+n+r,a),t.lineTo(-e+i-r,e+n+r,a),t.lineTo(-3*e+i-r,e+n+r,a),t.closePath(),!0}(t,e/6,i,n,r,a)}}])}(gh),bh=new _h;function xh(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var Sh=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="diamond",t.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n,r){return xh(t,e/2,i,n,r)}},{key:"drawFitDir",value:function(t,e,i,n,r){return xh(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return xh(t,e/2+r,i,n,a)}}])}(gh),wh=new Sh;function Ah(t,e,i,n){var r=2*e;return t.rect(i-e,n-e,r,r),!1}var Th=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="square",t.pathStr="M-0.5,-0.5h1v1h-1Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return Ah(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ah(t,e/2+r,i,n)}}])}(gh),Ch=new Th;function Eh(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}var Bh=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="triangleUp",t.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return Eh(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Eh(t,e/2,i,n,r)}}])}(gh),Rh=new Bh,Mh=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="triangle",t}return h(i,t),u(i)}(Bh),Ph=new Mh,Oh=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Ih=Math.sin(ye/10)*Oh,Lh=-Math.cos(ye/10)*Oh;function Dh(t,e,i,n){var r=Ih*e,a=Lh*e;t.moveTo(i,-e+n),t.lineTo(r+i,a+n);for(var o=1;o<5;++o){var s=ye*o/5,u=Math.cos(s),l=Math.sin(s);t.lineTo(l*e+i,-u*e+n),t.lineTo(u*r-l*a+i,l*r+u*a+n)}return t.closePath(),!0}var Fh=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="star",t.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return Dh(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Dh(t,e/2+r,i,n)}}])}(gh),jh=new Fh,Nh=Ae(3);function zh(t,e,i,n){var r=e,a=r/Nh,o=a/5,s=e;return t.moveTo(0+i,-r+n),t.lineTo(a/2+i,n),t.lineTo(o/2+i,n),t.lineTo(o/2+i,s+n),t.lineTo(-o/2+i,s+n),t.lineTo(-o/2+i,n),t.lineTo(-a/2+i,n),t.closePath(),!0}var Uh=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="arrow",t.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return zh(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return zh(t,e/2+r,i,n)}}])}(gh),Gh=new Uh;function Wh(t,e,i,n){var r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var Vh=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="wedge",t.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return Wh(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Wh(t,e/2+r,i,n)}}])}(gh),Hh=new Vh;function Kh(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Xh=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="stroke",t.pathStr="",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return Kh(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Kh(t,e/2+r,i,n)}}])}(gh),Yh=new Xh,qh=-.5,Zh=Ae(3)/2,Jh=1/Ae(12);function $h(t,e,i,n){var r=e/2,a=e*Jh,o=r,s=e*Jh+e,u=-o,l=s;return t.moveTo(r+i,a+n),t.lineTo(o+i,s+n),t.lineTo(u+i,l+n),t.lineTo(qh*r-Zh*a+i,Zh*r+qh*a+n),t.lineTo(qh*o-Zh*s+i,Zh*o+qh*s+n),t.lineTo(qh*u-Zh*l+i,Zh*u+qh*l+n),t.lineTo(qh*r+Zh*a+i,qh*a-Zh*r+n),t.lineTo(qh*o+Zh*s+i,qh*s-Zh*o+n),t.lineTo(qh*u+Zh*l+i,qh*l-Zh*u+n),t.closePath(),!1}var Qh=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="wye",t.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return $h(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return $h(t,e/2+r,i,n)}}])}(gh),tc=new Qh;function ec(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}var ic=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="triangleLeft",t.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return ec(t,e/2,i,n,0)}},{key:"drawOffset",value:function(t,e,i,n,r){return ec(t,e/2,i,n,r)}}])}(gh),nc=new ic;function rc(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}var ac=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="triangleRight",t.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return rc(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return rc(t,e/2,i,n,r)}}])}(gh),oc=new ac;function sc(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}var uc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="triangleDown",t.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return sc(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return sc(t,e/2,i,n,r)}}])}(gh),lc=new uc,hc=Ae(3);function cc(t,e,i,n){var r=e*hc;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var dc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="thinTriangle",t.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return cc(t,e/2/hc,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return cc(t,e/2/hc+r,i,n)}}])}(gh),fc=new dc;function vc(t,e,i,n){var r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var pc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="arrow2Left",t.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return vc(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return vc(t,e/4+r,i,n)}}])}(gh),gc=new pc;function yc(t,e,i,n){var r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var mc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="arrow2Right",t.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return yc(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return yc(t,e/4+r,i,n)}}])}(gh),kc=new mc;function _c(t,e,i,n){var r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var bc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="arrow2Up",t.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return _c(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return _c(t,e/4+r,i,n)}}])}(gh),xc=new bc;function Sc(t,e,i,n){var r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var wc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="arrow2Down",t.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return Sc(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Sc(t,e/4+r,i,n)}}])}(gh),Ac=new wc;function Tc(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Cc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="lineV",t.pathStr="M0,-0.5L0,0.5",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n,r){return Tc(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return Tc(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e,", ").concat(i-r," L ").concat(e,",").concat(i+r)}}])}(gh),Ec=new Cc;function Bc(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Rc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="lineH",t.pathStr="M-0.5,0L0.5,0",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n,r){return Bc(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return Bc(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i," L ").concat(e+r,",").concat(i)}}])}(gh),Mc=new Rc;function Pc(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var Oc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="close",t.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n,r){return Pc(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return Pc(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i-r," L ").concat(e+r,",").concat(i+r," M ").concat(e+r,", ").concat(i-r," L ").concat(e-r,",").concat(i+r)}}])}(gh),Ic=new Oc;function Lc(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function Dc(t,e,i,n){var r=e,a=e/2;return t.rect(i-r/2,n-a/2,r,a),!1}var Fc=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="rect",t.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",t}return h(i,t),u(i,[{key:"draw",value:function(t,e,i,n){return wt(e)?Dc(t,e,i,n):Lc(t,e,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return wt(e)?Dc(t,e+2*r,i,n):Lc(t,[e[0]+2*r,e[1]+2*r],i,n)}}])}(gh),jc=new Fc,Nc=new Oe,zc=function(){return u((function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o(this,t),this.pathStr="",this.type=e,bt(i)?this.svgCache=i:this.path=i,this.isSvg=n}),[{key:"drawOffset",value:function(t,e,i,n,r,a,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),Li(r.path.commandList,t,i,n,e,e),o&&o(r.path,r.attribute)})),!1):(Li(this.path.commandList,t,i,n,e+r,e+r),!1)}},{key:"draw",value:function(t,e,i,n,r,a){return this.drawOffset(t,e,i,n,0,r,a)}},{key:"bounds",value:function(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((function(i){var n=i.path;Nc.x1=n.bounds.x1*t,Nc.y1=n.bounds.y1*t,Nc.x2=n.bounds.x2*t,Nc.y2=n.bounds.y2*t,e.union(Nc)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}])}(),Uc={};[kh,bh,wh,Ch,fc,Ph,jh,Gh,Hh,Yh,tc,nc,oc,Rh,lc,gc,kc,xc,Ac,jc,Ec,Mc,Ic].forEach((function(t){Uc[t.type]=t}));var Gc={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},Wc=new Oe,Vc=["symbolType","size"].concat(y(Ma)),Hc=function(t){function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"};return o(this,i),(t=e(this,i,[n])).type="symbol",t.numberType=ko,t}return h(i,t),u(i,[{key:"getParsedPath",value:function(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}},{key:"isValid",value:function(){return p(c(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.size;return bt(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}},{key:"doUpdateParsedPath",value:function(){var t,e=this.getGraphicTheme(),n=this.attribute.symbolType,r=void 0===n?e.symbolType:n,a=Uc[r];if(a)return this._parsedPath=a,a;if(a=i.userSymbolMap[r])return this._parsedPath=a,a;if(!0===((t=r=Gc[r]||r).startsWith("<svg")||t.startsWith("<?xml"))){var o=(new Xa).parse(r).svg;if(!o)return null;var s=bt(o.path)?o.path:[o.path];Wc.clear();var u=[];s.forEach((function(t){var e=(new kn).fromString(t.d),i={};wo.forEach((function(e){t[e]&&(i[So[e]]=t[e])})),u.push({path:e,attribute:i}),Wc.union(e.bounds)}));var l=Wc.width(),h=Wc.height(),c=1/xe(l,h);return u.forEach((function(t){return t.path.transform(0,0,c,c)})),this._parsedPath=new zc(r,u,!0),i.userSymbolMap[r]=this._parsedPath,this._parsedPath}var d=(new kn).fromString(r),f=d.bounds.width(),v=d.bounds.height(),p=1/xe(f,v);return d.transform(0,0,p,p),this._parsedPath=new zc(r,d),i.userSymbolMap[r]=this._parsedPath,this._parsedPath}},{key:"getGraphicTheme",value:function(){return Rr(this).symbol}},{key:"updateAABBBounds",value:function(t,e,i,n){if(!Vn.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));var r=Vn.graphicService.updateTempAABBBounds(i),a=r.tb1,o=r.tb2;(function(t,e,i){var n=t.outerBorder,r=t.shadowBlur,a=void 0===r?e.shadowBlur:r,o=t.strokeBoundsBuffer,s=void 0===o?e.strokeBoundsBuffer:o;if(n){var u=e.outerBorder,l=n.distance,h=void 0===l?u.distance:l,c=n.lineWidth;qa(i,h+(a+(void 0===c?u.lineWidth:c))/2,!0,s)}})(t,e,a),i.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2);var s=t.lineJoin,u=void 0===s?e.lineJoin:s;return Vn.graphicService.transformAABBBounds(t,i,e,"miter"===u,this),i}},{key:"updateSymbolAABBBoundsImprecise",value:function(t,e,i){var n=t.size,r=void 0===n?e.size:n;if(bt(r))i.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{var a=r/2;i.set(-a,-a,a,a)}return i}},{key:"updateSymbolAABBBoundsAccurate",value:function(t,e,i){var n=t.size,r=void 0===n?e.size:n;return this.getParsedPath().bounds(r,i),i}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,Vc)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,Vc)}},{key:"toCustomPath",value:function(){var t=this.getParsedPath(),e=this.attribute.size,i=bt(e)?e:[e,e];return t.path?(new kn).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new kn).fromString(t.pathStr,0,0,i[0],i[1])}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function Kc(t){return new Hc(t)}Hc.userSymbolMap={},Hc.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Da);var Xc=["segments","points","curveType","curveTension"].concat(y(Ma)),Yc=function(t){function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,i),(t=e(this,i,[n])).type="line",t.numberType=co,t}return h(i,t),u(i,[{key:"isValid",value:function(){return p(c(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,i=t.segments;return i?0!==i.length:!(!e||e.length<=1)}},{key:"_interpolate",value:function(t,e,i,n,r){"points"===t&&(r.points=va(i,n,e))}},{key:"getGraphicTheme",value:function(){return Rr(this).line}},{key:"updateAABBBounds",value:function(t,e,i){if(!Vn.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),Vn.graphicService.updateTempAABBBounds(i);var n=t.lineJoin,r=void 0===n?e.lineJoin:n;return Vn.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}},{key:"updateLineAABBBoundsByPoints",value:function(t,e,i,n){var r=t.points,a=void 0===r?e.points:r,o=t.connectedType,s=i;return a.forEach((function(t){!1===t.defined&&"zero"!==o||s.add(t.x,t.y)})),s}},{key:"updateLineAABBBoundsBySegments",value:function(t,e,i,n){var r=t.segments,a=void 0===r?e.segments:r,o=t.connectedType,s=i;return a.forEach((function(t){t.points.forEach((function(t){!1===t.defined&&"zero"!==o||s.add(t.x,t.y)}))})),s}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,Xc)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,Xc)}},{key:"toCustomPath",value:function(){var t=this.attribute,e=new kn,i=t.segments,n=function(t){if(t&&t.length){var i=!0;t.forEach((function(t){!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((function(t){n(t.points)})):t.points&&n(t.points),e}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function qc(t){return new Yc(t)}Yc.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Da);var Zc=["width","x1","y1","height","cornerRadius"].concat(y(Ma)),Jc=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="rect",n.numberType=go,n}return h(i,t),u(i,[{key:"isValid",value:function(){return p(c(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){return!0}},{key:"getGraphicTheme",value:function(){return Rr(this).rect}},{key:"updateAABBBounds",value:function(t,e,i){if(!Vn.graphicService.validCheck(t,e,i,this))return i;if(!this.updatePathProxyAABBBounds(i)){var n=t.width,r=t.height,a=t.x1,o=t.y1,s=t.x,u=t.y;n=null!=n?n:a-s,r=null!=r?r:o-u,(isFinite(n)||isFinite(r)||isFinite(s)||isFinite(u))&&i.set(0,0,n||0,r||0)}var l=Vn.graphicService.updateTempAABBBounds(i),h=l.tb1,c=l.tb2;return ah(t,e,h),i.union(h),h.setValue(c.x1,c.y1,c.x2,c.y2),Vn.graphicService.transformAABBBounds(t,i,e,!1,this),i}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,Zc)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,Zc)}},{key:"toCustomPath",value:function(){var t=function(t){if(!t)return{x:0,y:0,width:0,height:0};var e=vt(t.width)?t.x1-t.x:t.width,i=vt(t.height)?t.y1-t.y:t.height,n=0,r=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(r=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:r,width:e,height:i}}(this.attribute),e=t.x,i=t.y,n=t.width,r=t.height,a=new kn;return a.moveTo(e,i),a.rect(e,i,n,r),a}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function $c(t){return new Jc(t)}Jc.NOWORK_ANIMATE_ATTR=Da;var Qc=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]],td=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="rect3d",n.numberType=yo,n}return h(i,t),u(i,[{key:"findFace",value:function(){var t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),i=this.attribute,n=i.x1,r=i.y1,a=i.x,o=i.y,s=i.length,u=void 0===s?Se(e.width,e.height):s,l=this.attribute,h=l.width,c=l.height;h=null!=h?h:n-a,c=null!=c?c:r-o;for(var d=0;d<Qc.length;d++){var f=Qc[d];t.vertices.push([f[0]*h,f[1]*c,f[2]*u])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Jc);function ed(t){return new td(t)}td.NOWORK_ANIMATE_ATTR=Da;var id=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="glyph",n.numberType=uo,n.subGraphic=[],n._onInit&&n._onInit(f(n)),n.valid=n.isValid(),n}return h(i,t),u(i,[{key:"setSubGraphic",value:function(t){var e=this;this.detachSubGraphic(),this.subGraphic=t,t.forEach((function(t){t.glyphHost=e,Object.setPrototypeOf(t.attribute,e.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}},{key:"detachSubGraphic",value:function(){this.subGraphic.forEach((function(t){t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}},{key:"getSubGraphic",value:function(){return this.subGraphic}},{key:"onInit",value:function(t){this._onInit=t}},{key:"onUpdate",value:function(t){this._onUpdate=t}},{key:"isValid",value:function(){return!0}},{key:"setAttribute",value:function(t,e,n,r){p(c(i.prototype),"setAttribute",this).call(this,t,e,n,r),this.subGraphic.forEach((function(t){t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;p(c(i.prototype),"setAttributes",this).call(this,t,e,n),this.subGraphic.forEach((function(t){t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}},{key:"translate",value:function(t,e){return p(c(i.prototype),"translate",this).call(this,t,e),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"translateTo",value:function(t,e){return p(c(i.prototype),"translateTo",this).call(this,t,e),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"scale",value:function(t,e,n){return p(c(i.prototype),"scale",this).call(this,t,e,n),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"scaleTo",value:function(t,e){return p(c(i.prototype),"scaleTo",this).call(this,t,e),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"rotate",value:function(t){return p(c(i.prototype),"rotate",this).call(this,t),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"rotateTo",value:function(t){return p(c(i.prototype),"rotate",this).call(this,t),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"getGraphicTheme",value:function(){return Rr(this).glyph}},{key:"updateAABBBounds",value:function(t,e,i){return Vn.graphicService.validCheck(t,e,i,this)?(this.getSubGraphic().forEach((function(t){i.union(t.AABBBounds)})),i):i}},{key:"doUpdateAABBBounds",value:function(){this._AABBBounds.clear();var t=this.updateAABBBounds(this.attribute,this.getGraphicTheme(),this._AABBBounds);return this.clearUpdateBoundTag(),t}},{key:"needUpdateTags",value:function(t){return!1}},{key:"needUpdateTag",value:function(t){return!1}},{key:"useStates",value:function(t,e){var i,n=this;if(t.length){if((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some((function(t,e){return n.currentStates[e]!==t}))){this.stopStateAnimates();var r={},a=this.subGraphic.map((function(){return{}}));t.forEach((function(e){var i,o=n.glyphStateProxy?n.glyphStateProxy(e,t):n.glyphStates[e];o&&(Object.assign(r,o.attributes),(null===(i=o.subAttributes)||void 0===i?void 0:i.length)&&a.forEach((function(t,e){Object.assign(t,o.subAttributes[e])})))})),this.subGraphic.forEach((function(i,n){i.updateNormalAttrs(a[n]),i.applyStateAttrs(a[n],t,e)})),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}}else this.clearStates(e)}},{key:"clearStates",value:function(t){var e=this;this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((function(i){i.applyStateAttrs(i.normalAttrs,e.currentStates,t,!0),i.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}},{key:"clone",value:function(){var t=new i(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((function(t){return t.clone()}))),t}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function nd(t){return new id(t)}id.NOWORK_ANIMATE_ATTR=Da;var rd=function(){return u((function t(e,i,n,r,a,s,u,l,h,c,d,f,v,p){o(this,t),this.left=e,this.top=i,this.width=n,this.height=r,this.actualHeight=0,this.bottom=i+r,this.right=e+n,this.ellipsis=a,this.wordBreak=s,this.verticalDirection=u,this.lines=[],this.globalAlign=l,this.globalBaseline=h,this.layoutDirection=c,this.directionKey=Hn[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=f,this.singleLine=v,p?(p.clear(),this.icons=p):this.icons=new Map}),[{key:"draw",value:function(t,e){var i=this.getActualSize(),n=i.width,r=i.height,a=this.isWidthMax?Math.min(this.width,n):this.width||n||0,o=this.isHeightMax?Math.min(this.height,r):this.height||r||0;o=Math.min(o,r);var s=0;switch(this.globalBaseline){case"top":s=0;break;case"middle":s=-o/2;break;case"bottom":s=-o}var u=0;"right"===this.globalAlign||"end"===this.globalAlign?u=-a:"center"===this.globalAlign&&(u=-a/2);var l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);var h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(var c=0;c<this.lines.length;c++){var d=this.lines[c],f=d.top,v=d.height;if(f+v<this[this.directionKey.top]||f+v>this[this.directionKey.top]+l)return h;var p=!1;this.ellipsis&&this.lines[c+1]&&this.lines[c+1].top+this.lines[c+1].height>this[this.directionKey.top]+l&&(p=!0,h=!0),this.lines[c].draw(t,p,this.lines[c][this.directionKey.left]+u,this.lines[c][this.directionKey.top]+s,this.ellipsis,e)}else{var g=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?u+=g:s+=g;for(var y=0;y<this.lines.length;y++)this.lines[y].draw(t,!1,this.lines[y][this.directionKey.left]+u,this.lines[y][this.directionKey.top]+s,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(var m=0;m<this.lines.length;m++){var k=this.lines[m];k.top;var _=k.height,b=l-this.lines[m].top-this.lines[m].height;if(0===l)this.lines[m].draw(t,!1,u,b+s,this.ellipsis,e);else{if(b+_>this[this.directionKey.top]+l||b<this[this.directionKey.top])return h;var x=!1;this.ellipsis&&this.lines[m+1]&&b-this.lines[m+1].height<this[this.directionKey.top]&&(x=!0,h=!0),this.lines[m].draw(t,x,u,b+s,this.ellipsis,e)}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(u+=this.lines[0].height+1);for(var S=0;S<this.lines.length;S++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(u-=this.lines[S].height+this.lines[S].top);var w=this.lines[S],A=w.top,T=w.height;if(0===l)this.lines[S].draw(t,!1,this.lines[S][this.directionKey.left]+u,this.lines[S][this.directionKey.top]+s,this.ellipsis,e);else{if(A+T<this[this.directionKey.top]||A+T>this[this.directionKey.top]+l)return h;var C=!1;this.ellipsis&&this.lines[S+1]&&this.lines[S+1].top+this.lines[S+1].height>this[this.directionKey.top]+l&&(C=!0,h=!0),this.lines[S].draw(t,C,this.lines[S][this.directionKey.left]+u,this.lines[S][this.directionKey.top]+s,this.ellipsis,e)}}}return h}},{key:"getActualSize",value:function(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}},{key:"getRawActualSize",value:function(){for(var t=0,e=0,i=0;i<this.lines.length;i++){var n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}},{key:"getActualSizeWidthEllipsis",value:function(){var t=0,e=0,i=this.getRawActualSize();i.width;i.height;this.width,this.height;var n=this[this.directionKey.height];if(this.singleLine&&(n=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=n&&0!==n)for(var r=0;r<this.lines.length;r++){var a=this.lines[r],o=a.top,s=a.height;if(o+s<this[this.directionKey.top]||o+s>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[r+1]&&this.lines[r+1].top+this.lines[r+1].height>this[this.directionKey.top]+n){var u=!0===this.ellipsis?"...":this.ellipsis||"",l=this.lines[r].getWidthWithEllips(u);l>t&&(t=l),e+=this.lines[r].height}else this.lines[r].actualWidth>t&&(t=this.lines[r].actualWidth),e+=this.lines[r].height}else{Math.floor((n-this.actualHeight)/2);for(var h=0;h<this.lines.length;h++)this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height}else if("bottom"===this.verticalDirection)for(var c=0;c<this.lines.length;c++){var d=this.lines[c];d.top;var f=d.height,v=n-this.lines[c].top-this.lines[c].height;if(0===n)this.lines[c].actualWidth>t&&(t=this.lines[c].actualWidth),e+=this.lines[c].height;else if(v+f>this[this.directionKey.top]+n||v<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[c+1]&&v-this.lines[c+1].height<this[this.directionKey.top]){var p=!0===this.ellipsis?"...":this.ellipsis||"",g=this.lines[c].getWidthWithEllips(p);g>t&&(t=g),e+=this.lines[c].height}else this.lines[c].actualWidth>t&&(t=this.lines[c].actualWidth),e+=this.lines[c].height}else for(var y=0;y<this.lines.length;y++){var m=this.lines[y],k=m.top,_=m.height;if(0===n)this.lines[y].actualWidth>t&&(t=this.lines[y].actualWidth),e+=this.lines[y].height;else if(k+_<this[this.directionKey.top]||k+_>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[y+1]&&this.lines[y+1].top+this.lines[y+1].height>this[this.directionKey.top]+n){var b=!0===this.ellipsis?"...":this.ellipsis||"",x=this.lines[y].getWidthWithEllips(b);x>t&&(t=x),e+=this.lines[y].height}else this.lines[y].actualWidth>t&&(t=this.lines[y].actualWidth),e+=this.lines[y].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}])}(),ad=function(){return u((function t(e,i,n){o(this,t),this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic";var r=ka(n.lineHeight,this.fontSize);this.lineHeight="number"==typeof r?r>this.fontSize?r:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;var a=tr(e,n),s=a.ascent,u=a.height,l=a.descent,h=a.width,c=0,d=0,f=0;this.height>u&&(c=(this.height-u)/2,d=Math.ceil(c),f=Math.floor(c)),"top"===this.textBaseline?(this.ascent=c,this.descent=u-c):"bottom"===this.textBaseline?(this.ascent=u-c,this.descent=c):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=s+d,this.descent=l+f),this.length=e.length,this.width=h||0,this.text=e||"",this.newLine=i||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===n.direction&&(this.direction=n.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}),[{key:"updateWidth",value:function(){var t=tr(this.text,this.character).width;this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}},{key:"draw",value:function(t,e,i,n,r){var a=this.text,o=this.left+i;e+=this.top;var s=this.direction;if(this.verticalEllipsis)a=this.ellipsisStr,s="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)a+=this.ellipsisStr,"right"!==r&&"end"!==r||(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){var u=$n(a,("vertical"===s?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,a.length-1);if(a=a.slice(0,u),a+=this.ellipsisStr,"right"===r||"end"===r){var l=tr(this.text.slice(u),this.character).width;"vertical"===s||(o-=this.ellipsisWidth-l)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===s&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(function(t,e){var i=e&&e.stroke||Xn;if(i){var n=e.strokeOpacity,r=void 0===n?1:n,a=e.opacity,o=void 0===a?1:a;t.globalAlpha=r*o,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Jn(t,e)}else t.globalAlpha=0}(t,this.character),t.strokeText(a,o,e)),function(t,e){var i=e&&e.fill||Kn;if(i){var n=e.fillOpacity,r=void 0===n?1:n,a=e.opacity,o=void 0===a?1:a;t.globalAlpha=r*o,t.fillStyle=i,Jn(t,e)}else t.globalAlpha=0}(t,this.character),this.character.fill&&t.fillText(a,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===s&&t.restore()}},{key:"getWidthWithEllips",value:function(t){var e=this.text,i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){var n=$n(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,n),e+=this.ellipsisStr;var r=tr(this.text.slice(n),this.character).width;return i+this.ellipsisWidth-r}return i}}])}();var od=["width","height","image"].concat(y(Ma)),sd=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="image",n.numberType=ho,n.loadImage(n.attribute.image),n}return h(i,t),u(i,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0},set:function(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0},set:function(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"repeatX",get:function(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"},set:function(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}},{key:"repeatY",get:function(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"},set:function(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}},{key:"image",get:function(){return this.attribute.image},set:function(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}},{key:"imageLoadSuccess",value:function(t,e,n){var r=this;p(c(i.prototype),"imageLoadSuccess",this).call(this,t,e,(function(){r.successCallback&&r.successCallback()}))}},{key:"imageLoadFail",value:function(t,e){var n=this;p(c(i.prototype),"imageLoadFail",this).call(this,t,(function(){n.failCallback&&n.failCallback()}))}},{key:"setAttributes",value:function(t,e,n){return t.image&&this.loadImage(t.image),p(c(i.prototype),"setAttributes",this).call(this,t,e,n)}},{key:"setAttribute",value:function(t,e,n,r){return"image"===t&&this.loadImage(e),p(c(i.prototype),"setAttribute",this).call(this,t,e,n,r)}},{key:"getGraphicTheme",value:function(){return Rr(this).image}},{key:"updateAABBBounds",value:function(t,e,i){if(!Vn.graphicService.validCheck(t,e,i,this))return i;if(!this.updatePathProxyAABBBounds(i)){var n=t.width,r=void 0===n?e.width:n,a=t.height,o=void 0===a?e.height:a;i.set(0,0,r,o)}var s=Vn.graphicService.updateTempAABBBounds(i),u=s.tb1,l=s.tb2;return ah(t,e,u),i.union(u),u.setValue(l.x1,l.y1,l.x2,l.y2),Vn.graphicService.transformAABBBounds(t,i,e,!1,this),i}},{key:"getDefaultAttribute",value:function(t){return Gn[t]}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,od)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,od)}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function ud(t){return new sd(t)}sd.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Da);var ld=function(t){function i(t){var n;if(o(this,i),(n=e(this,i,[t]))._x=0,n._y=0,n._hovered=!1,n._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(n._hovered=!0),t.margin){var r=la(t.margin);n._marginArray="number"==typeof r?[r,r,r,r]:r}return n.onBeforeAttributeUpdate=function(t,e,i){if(bt(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){var r=la(e.margin);n._marginArray="number"==typeof r?[r,r,r,r]:r}else n._marginArray=[0,0,0,0]},f(n)}return h(i,t),u(i,[{key:"width",get:function(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}},{key:"height",get:function(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();var t=this.attribute,e=t.width,i=void 0===e?Gn.width:e,n=t.height,r=void 0===n?Gn.height:n,a=this.attribute,o=a.backgroundWidth,s=void 0===o?i:o,u=a.backgroundHeight,l=(s-i)/2,h=((void 0===u?r:u)-r)/2;return this._AABBBounds.expand([0,2*l,2*h,0]),this._AABBBounds}},{key:"setHoverState",value:function(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}])}(sd),hd=function(){return u((function t(e,i,n,r,a,s,u,l){var h=this;o(this,t),this.left=e,this.width=i,this.baseline=n,this.ascent=r,this.descent=a,this.top=n-r,this.paragraphs=s.map((function(t){return t})),this.textAlign=(this.paragraphs[0]instanceof ld?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=u,this.directionKey=Hn[this.direction],this.actualWidth=0;var c=0;this.paragraphs.forEach((function(t,e){if(0===e&&t instanceof ad){var i=Zn.exec(t.text);0!==(null==i?void 0:i.index)&&(t.text=t.text.slice(null==i?void 0:i.index),t.updateWidth())}h.actualWidth+=t[h.directionKey.width],c=Math.max(t[h.directionKey.height],c)})),this.height=c,this.blankWidth=l?0:this.width-this.actualWidth,this.calcOffset(i,l)}),[{key:"calcOffset",value:function(t,e){var i=this.directionKey,n=this.height,r=this.left,a=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:a=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof ld?(t["_"+i.x]=r,r+=t[i.width]+a,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=r,r+=t[i.width]+a)}))}},{key:"draw",value:function(t,e,i,n,r,a){var o=this;if(r&&(e||this.paragraphs.some((function(t){return t.overflow}))))for(var s=0,u=this.paragraphs.length-1;u>=0;u--){var l=this.paragraphs[u];if(!l.overflow){if(l instanceof ld)break;if("vertical"===this.direction&&"vertical"!==l.direction){l.verticalEllipsis=!0;break}var h=!0===r?"...":r||"";l.ellipsisStr=h;var c=tr(h,l.character).width||0;if(c<=this.blankWidth+s){e&&(l.ellipsis="add");break}if(c<=this.blankWidth+s+l.width){l.ellipsis="replace",l.ellipsisWidth=c,l.ellipsisOtherParagraphWidth=this.blankWidth+s;break}l.ellipsis="hide",s+=l.width}}this.paragraphs.map((function(e,r){if(e instanceof ld)return e.setAttributes({x:i+e._x,y:n+e._y}),void a(e,t,i+e._x,n+e._y,o.ascent);e.draw(t,n+o.ascent,i,0===r,o.textAlign)}))}},{key:"getWidthWithEllips",value:function(t){for(var e=this,i=0,n=this.paragraphs.length-1;n>=0;n--){var r=this.paragraphs[n];if(r instanceof ld)break;var a=tr(t,r.character).width||0;if(a<=this.blankWidth+i){r.ellipsis="add",r.ellipsisWidth=a;break}if(a<=this.blankWidth+i+r.width){r.ellipsis="replace",r.ellipsisWidth=a,r.ellipsisOtherParagraphWidth=this.blankWidth+i;break}r.ellipsis="hide",i+=r.width}var o=0;return this.paragraphs.map((function(t,i){o+=t instanceof ld?t.width:t.getWidthWithEllips(e.direction)})),o}}])}(),cd=function(){return u((function t(e){o(this,t),this.frame=e,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=e.layoutDirection,this.directionKey=Hn[this.direction]}),[{key:"store",value:function(t){if(t instanceof ld){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];var e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}},{key:"send",value:function(){if(0!==this.lineBuffer.length){var t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new hd(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}}},{key:"deal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t instanceof ld?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}},{key:"cut",value:function(t,e){var i=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(i/t[this.directionKey.width]*t.length)||0,r=$n(t.text,i,t.character,n,"break-word"===this.frame.wordBreak);if(0!==r){var a=function(t,e){var i=t.text.slice(0,e),n=t.text.slice(e);return[new ad(i,t.newLine,t.character),new ad(n,!0,t.character)]}(t,r),o=g(a,2),s=o[0],u=o[1];this.store(s),e?this.send():this.deal(u)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}])}(),dd=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize"].concat(y(Ma)),fd=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="richtext",n._currentHoverIcon=null,n.numberType=mo,n}return h(i,t),u(i,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Un.width},set:function(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:Un.height},set:function(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxWidth",get:function(){return this.attribute.maxWidth},set:function(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxHeight",get:function(){return this.attribute.maxHeight},set:function(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}},{key:"ellipsis",get:function(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:Un.ellipsis},set:function(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}},{key:"wordBreak",get:function(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:Un.wordBreak},set:function(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}},{key:"verticalDirection",get:function(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:Un.verticalDirection},set:function(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}},{key:"textAlign",get:function(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:Un.textAlign},set:function(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}},{key:"textBaseline",get:function(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:Un.textBaseline},set:function(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}},{key:"textConfig",get:function(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:Un.textConfig},set:function(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}},{key:"getGraphicTheme",value:function(){return Rr(this).richtext}},{key:"updateAABBBounds",value:function(t,e,i){if(!Vn.graphicService.validCheck(t,e,i,this))return i;var n=t.width,r=void 0===n?e.width:n,a=t.height,o=void 0===a?e.height:a,s=t.maxWidth,u=void 0===s?e.maxWidth:s,l=t.maxHeight,h=void 0===l?e.maxHeight:l,c=t.textAlign,d=void 0===c?e.textAlign:c,f=t.textBaseline,v=void 0===f?e.textBaseline:f;if(r>0&&o>0)i.set(0,0,r,o);else{var p=this.getFrameCache().getActualSize(),g=p.width,y=p.height,m=r||g||0,k=o||y||0;k="number"==typeof h&&k>h?h:k||0,m="number"==typeof u&&m>u?u:m||0,i.set(0,0,m,k)}var _=0;switch(v){case"top":_=0;break;case"middle":_=-i.height()/2;break;case"bottom":_=-i.height()}var b=0;switch(d){case"left":b=0;break;case"center":b=-i.width()/2;break;case"right":b=-i.width()}return i.translate(b,_),Vn.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Vn.graphicService.updateHTMLTextAABBBounds(t,e,i),Vn.graphicService.transformAABBBounds(t,i,e,!1,this),i}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,dd)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,dd)}},{key:"getFrameCache",value:function(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}},{key:"combinedStyleToCharacter",value:function(t){var e=this.attribute,i=e.fill,n=e.stroke,r=e.fontSize,a=e.fontFamily,o=e.fontStyle,s=e.fontWeight,u=e.lineWidth,l=e.opacity,h=e.fillOpacity,c=e.strokeOpacity;return Object.assign({fill:i,stroke:n,fontSize:r,fontFamily:a,fontStyle:o,fontWeight:s,lineWidth:u,opacity:l,fillOpacity:h,strokeOpacity:c},t)}},{key:"doUpdateFrameCache",value:function(t){for(var e,i=this,n=this.attribute,r=n.textConfig,a=void 0===r?[]:r,o=n.maxWidth,s=n.maxHeight,u=n.width,l=n.height,h=n.ellipsis,c=n.wordBreak,d=n.verticalDirection,f=n.textAlign,v=n.textBaseline,p=n.layoutDirection,g=n.singleLine,y=n.disableAutoWrapLine,m=[],k=null!=t?t:a,_=0;_<k.length;_++)if("image"in k[_]){var b=this.combinedStyleToCharacter(k[_]),x=b.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(b.id);if(x)m.push(x);else{var S=new ld(b);S.successCallback=function(){var t;i.addUpdateBoundTag(),null===(t=i.stage)||void 0===t||t.renderNextFrame()},S.richtextId=b.id,m.push(S)}}else{var w=this.combinedStyleToCharacter(k[_]);if(wt(w.text)&&(w.text="".concat(w.text)),w.text&&w.text.includes("\n"))for(var A=w.text.split("\n"),T=0;T<A.length;T++)m.push(new ad(A[T],0!==T,w));else w.text&&m.push(new ad(w.text,!1,w))}var C="number"==typeof o&&Number.isFinite(o)&&o>0,E="number"==typeof s&&Number.isFinite(s)&&s>0,B="number"==typeof u&&Number.isFinite(u)&&u>0&&(!C||u<=o),R="number"==typeof l&&Number.isFinite(l)&&l>0&&(!E||l<=s),M=new rd(0,0,(B?u:C?o:0)||0,(R?l:E?s:0)||0,h,c,d,f,v,p||"horizontal",!B&&C,!R&&E,g||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),P=new cd(M);if(y)for(var O=0,I=!1,L=0;L<m.length;L++){var D=m[L];I?(D.overflow=!0,D.left=1/0,D.top=1/0,!D.newLine&&M.lines[M.lines.length-1].paragraphs.push(D)):P.deal(D,!0),M.lines.length!==O&&(O=M.lines.length,P.lineBuffer.length=0,D.overflow=!0,D.left=1e3,D.top=1e3,M.lines[M.lines.length-1].paragraphs.push(D),I=!0),D.newLine&&(I=!1,P.lineWidth=0),P.send()}else for(var F=0;F<m.length;F++)P.deal(m[F]);if(P.send(),!("horizontal"===M.layoutDirection?B:R)){var j=M.getActualSizeWidthEllipsis(),N="horizontal"===M.layoutDirection?j.width:j.height;("horizontal"===M.layoutDirection?C:E)&&(N=Math.min(N,"horizontal"===M.layoutDirection?o:s)),M.lines.forEach((function(t){t.calcOffset(N,!1)}))}this._frameCache=M}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"setStage",value:function(t,e){p(c(i.prototype),"setStage",this).call(this,t,e),this.getFrameCache().icons.forEach((function(i){i.setStage(t,e)}))}},{key:"bindIconEvent",value:function(){var t=this;this.addEventListener("pointermove",(function(e){var i,n,r,a,o,s=t.pickIcon(e.global);s&&s===t._currentHoverIcon||(s?(null===(i=t._currentHoverIcon)||void 0===i||i.setHoverState(!1),t._currentHoverIcon=s,t._currentHoverIcon.setHoverState(!0),null===(n=t.stage)||void 0===n||n.setCursor(s.attribute.cursor),null===(r=t.stage)||void 0===r||r.renderNextFrame()):!s&&t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(a=t.stage)||void 0===a||a.setCursor(),null===(o=t.stage)||void 0===o||o.renderNextFrame()))})),this.addEventListener("pointerleave",(function(e){var i,n;t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(i=t.stage)||void 0===i||i.setCursor(),null===(n=t.stage)||void 0===n||n.renderNextFrame())}))}},{key:"pickIcon",value:function(t){var e,i=this.getFrameCache(),n=this.globalTransMatrix,r=n.e,a=n.f;return i.icons.forEach((function(i){var n,o,s=i.AABBBounds.clone();s.translate(i._marginArray[3],i._marginArray[0]),s.containsPoint({x:t.x-r,y:t.y-a})&&(e=i,e.globalX=(null!==(n=e.attribute.x)&&void 0!==n?n:0)+r+i._marginArray[3],e.globalY=(null!==(o=e.attribute.y)&&void 0!==o?o:0)+a+i._marginArray[0])})),e}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function vd(t){return new fd(t)}fd.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Da);var pd=["path","customPath"].concat(y(Ma)),gd=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="path",n.numberType=fo,n}return h(i,t),u(i,[{key:"pathShape",get:function(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}},{key:"isValid",value:function(){return p(c(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.path;return null!=t&&""!==t}},{key:"getParsedPathShape",value:function(){var t=this.getGraphicTheme();if(!this.valid)return t.path;var e=this.attribute;return e.path instanceof kn?e.path:(vt(this.cache)&&this.doUpdatePathShape(),this.cache instanceof kn?this.cache:t.path)}},{key:"getGraphicTheme",value:function(){return Rr(this).path}},{key:"updateAABBBounds",value:function(t,e,i){if(!Vn.graphicService.validCheck(t,e,i,this))return i;if(!this.updatePathProxyAABBBounds(i)){var n=this.getParsedPathShape();i.union(n.getBounds())}var r=Vn.graphicService.updateTempAABBBounds(i),a=r.tb1,o=r.tb2;ah(t,e,a),i.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2);var s=t.lineJoin,u=void 0===s?e.lineJoin:s;return Vn.graphicService.transformAABBBounds(t,i,e,"miter"===u,this),i}},{key:"doUpdateAABBBounds",value:function(t){return this.doUpdatePathShape(),p(c(i.prototype),"doUpdateAABBBounds",this).call(this,t)}},{key:"doUpdatePathShape",value:function(){var t=this.attribute;_t(t.path,!0)?this.cache=(new kn).fromString(t.path):t.customPath&&(this.cache=new kn,t.customPath(this.cache,this))}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,pd)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,pd)}},{key:"toCustomPath",value:function(){return(new kn).fromCustomPath2D(this.getParsedPathShape(),0,0)}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function yd(t){return new gd(t)}gd.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Da);var md=["segments","points","curveType","curveTension"].concat(y(Ma)),kd=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="area",n.numberType=oo,n}return h(i,t),u(i,[{key:"isValid",value:function(){return p(c(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,i=t.segments;return i?0!==i.length:!!e&&0!==e.length}},{key:"getGraphicTheme",value:function(){return Rr(this).area}},{key:"updateAABBBounds",value:function(t,e,i){if(!Vn.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),Vn.graphicService.updateTempAABBBounds(i);var n=t.lineJoin,r=void 0===n?e.lineJoin:n;return Vn.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}},{key:"updateAreaAABBBoundsByPoints",value:function(t,e,i,n){var r=t.points,a=void 0===r?e.points:r,o=i;return a.forEach((function(t){var e,i;o.add(t.x,t.y),o.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),o}},{key:"updateAreaAABBBoundsBySegments",value:function(t,e,i,n){var r=t.segments,a=void 0===r?e.segments:r,o=i;return a.forEach((function(t){t.points.forEach((function(t){var e,i;o.add(t.x,t.y),o.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),o}},{key:"_interpolate",value:function(t,e,i,n,r){"points"===t&&(r.points=va(i,n,e))}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,md)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,md)}},{key:"toCustomPath",value:function(){var t=new kn,e=this.attribute,i=e.segments,n=function(e){if(e&&e.length){var i=!0,n=[];if(e.forEach((function(e){var r,a;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(a=e.y1)&&void 0!==a?a:e.y}),i=!1)})),n.length){for(var r=n.length-1;r>=0;r--)t.lineTo(n[r].x,n[r].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((function(t){n(t.points)})),t}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function _d(t){return new kd(t)}kd.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Da);var bd=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap"].concat(y(Ma)),xd=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="arc",n.numberType=ro,n}return h(i,t),u(i,[{key:"isValid",value:function(){return p(c(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,i=t.endAngle,n=t.outerRadius,r=t.innerRadius;return this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)&&this._validNumber(r)}},{key:"getParsedCornerRadius",value:function(){var t=this.getGraphicTheme(),e=this.attribute,i=e.cornerRadius,n=void 0===i?t.cornerRadius:i,r=e.innerPadding,a=void 0===r?t.innerPadding:r,o=e.outerPadding,s=void 0===o?t.outerPadding:o,u=this.attribute,l=u.outerRadius,h=void 0===l?t.outerRadius:l,c=u.innerRadius,d=void 0===c?t.innerRadius:c;if(h+=s,d-=a,0===n||"0%"===n)return 0;var f=Math.abs(h-d),v=function(t){return Math.min(wt(t,!0)?t:f*parseFloat(t)/100,f/2)};if(bt(n)){var p=n.map((function(t){return v(t)||0}));return 0===p.length?[p[0],p[0],p[0],p[0]]:2===p.length?[p[0],p[1],p[0],p[1]]:(3===p.length&&p.push(0),p)}return v(n)}},{key:"getParsedAngle",value:function(){var t=this.getGraphicTheme(),e=this.attribute,i=e.startAngle,n=void 0===i?t.startAngle:i,r=e.endAngle,a=void 0===r?t.endAngle:r,o=this.attribute.cap,s=void 0===o?t.cap:o,u=a-n>=0?1:-1,l=a-n;if(a=(n=Le(n))+l,s&&ke(l)<me-ve){var h=1,c=1;s.length&&(h=Number(s[0]),c=Number(s[1]));var d=this.attribute,f=d.outerRadius,v=void 0===f?t.outerRadius:f,p=d.innerRadius,g=void 0===p?t.innerRadius:p,y=this.attribute,m=y.outerPadding,k=void 0===m?t.outerPadding:m,_=y.innerPadding;v+=k,g-=void 0===_?t.innerPadding:_;var b=Math.abs(v-g)/2,x=b/v;if(b>ve&&v>ve)return{startAngle:n-u*x*h,endAngle:a+u*x*c,sc:u*x*h,ec:u*x*c}}return{startAngle:n,endAngle:a}}},{key:"getParsePadAngle",value:function(t,e){var i=this.getGraphicTheme(),n=this.attribute,r=n.innerPadding,a=void 0===r?i.innerPadding:r,o=n.outerPadding,s=void 0===o?i.outerPadding:o,u=n.padAngle,l=void 0===u?i.padAngle:u,h=this.attribute,c=h.outerRadius,d=void 0===c?i.outerRadius:c,f=h.innerRadius,v=void 0===f?i.innerRadius:f;d+=s,v-=a;var p=this.attribute.padRadius,g=void 0===p?Ae(d*d+v*v):p,y=ke(e-t),m=t,k=e,_=t,b=e,x=l/2,S=y,w=y;if(x>ve&&g>ve){var A=e>t?1:-1,T=Ce(Number(g)/v*we(x)),C=Ce(Number(g)/d*we(x));return(S-=2*T)>ve?(_+=T*=A,b-=T):(S=0,_=b=(t+e)/2),(w-=2*C)>ve?(m+=C*=A,k-=C):(w=0,m=k=(t+e)/2),{outerStartAngle:m,outerEndAngle:k,innerStartAngle:_,innerEndAngle:b,innerDeltaAngle:S,outerDeltaAngle:w}}return{outerStartAngle:m,outerEndAngle:k,innerStartAngle:_,innerEndAngle:b,innerDeltaAngle:S,outerDeltaAngle:w}}},{key:"getGraphicTheme",value:function(){return Rr(this).arc}},{key:"updateAABBBounds",value:function(t,e,i,n){if(!Vn.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(n?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));var r=Vn.graphicService.updateTempAABBBounds(i),a=r.tb1,o=r.tb2;ah(t,e,a),i.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2);var s=t.lineJoin,u=void 0===s?e.lineJoin:s;return Vn.graphicService.transformAABBBounds(t,i,e,"miter"===u,this),i}},{key:"updateArcAABBBoundsImprecise",value:function(t,e,i){var n=t.outerRadius,r=void 0===n?e.outerRadius:n,a=t.innerRadius,o=void 0===a?e.innerRadius:a,s=t.outerPadding,u=void 0===s?e.outerPadding:s,l=t.innerPadding;return(r+=u)<(o-=void 0===l?e.innerPadding:l)&&(r=o),i.set(-r,-r,r,r),i}},{key:"updateArcAABBBoundsAccurate",value:function(t,e,i){var n=t.outerRadius,r=void 0===n?e.outerRadius:n,a=t.innerRadius,o=void 0===a?e.innerRadius:a,s=t.outerPadding,u=void 0===s?e.outerPadding:s,l=t.innerPadding;if((r+=u)<(o-=void 0===l?e.innerPadding:l)){var h=r;r=o,o=h}var c=t.endAngle,d=void 0===c?e.endAngle:c,f=t.startAngle,v=void 0===f?e.startAngle:f;if(v>d){var p=v;v=d,d=p}return r<=ve?i.set(0,0,0,0):Math.abs(d-v)>me-ve?i.set(-r,-r,r,r):(da(v,d,r,i),da(v,d,o,i)),i}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,bd)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,bd)}},{key:"toCustomPath",value:function(){var t=this.attribute,e=this.getParsedAngle(),i=e.startAngle,n=e.endAngle,r=t.innerRadius-(t.innerPadding||0),a=t.outerRadius-(t.outerPadding||0),o=ke(n-i),s=n>i;if(a<r){var u=a;a=r,r=u}var l=new kn;if(a<=ve)l.moveTo(0,0);else if(o>=me-ve)l.moveTo(0+a*be(i),0+a*we(i)),l.arc(0,0,a,i,n,!s),r>ve&&(l.moveTo(0+r*be(n),0+r*we(n)),l.arc(0,0,r,n,i,s));else{var h=a*be(i),c=a*we(i),d=r*be(n),f=r*we(n);l.moveTo(0+h,0+c),l.arc(0,0,a,i,n,!s),l.lineTo(0+d,0+f),l.arc(0,0,r,n,i,s),l.closePath()}return l}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function Sd(t){return new xd(t)}xd.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Da);var wd=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="arc3d",n.numberType=ao,n}return h(i,t),u(i,[{key:"updateAABBBounds",value:function(t,e,i){var n=this.stage;if(!n||!n.camera)return i;var r=t.outerRadius,a=void 0===r?e.outerRadius:r,o=t.height,s=a+(void 0===o?0:o);return i.setValue(-s,-s,s,s),Vn.graphicService.updateTempAABBBounds(i),Vn.graphicService.transformAABBBounds(t,i,e,!1,this),i}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(xd);function Ad(t){return new wd(t)}wd.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Da);var Td=["points","cornerRadius"].concat(y(Ma)),Cd=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="polygon",n.numberType=vo,n}return h(i,t),u(i,[{key:"isValid",value:function(){return p(c(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.points;return t&&t.length>=2}},{key:"getGraphicTheme",value:function(){return Rr(this).polygon}},{key:"updateAABBBounds",value:function(t,e,i){if(!Vn.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),Vn.graphicService.updateTempAABBBounds(i);var n=t.lineJoin,r=void 0===n?e.lineJoin:n;return Vn.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}},{key:"updatePolygonAABBBoundsImprecise",value:function(t,e,i){var n=t.points;return(void 0===n?e.points:n).forEach((function(t){i.add(t.x,t.y)})),i}},{key:"_interpolate",value:function(t,e,i,n,r){"points"===t&&(r.points=va(i,n,e))}},{key:"needUpdateTags",value:function(t){return p(c(i.prototype),"needUpdateTags",this).call(this,t,Td)}},{key:"needUpdateTag",value:function(t){return p(c(i.prototype),"needUpdateTag",this).call(this,t,Td)}},{key:"toCustomPath",value:function(){var t=this.attribute.points,e=new kn;return t.forEach((function(t,i){0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Fa);function Ed(t){return new Cd(t)}Cd.NOWORK_ANIMATE_ATTR=Da;var Bd=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t])).type="pyramid3d",n.numberType=po,n}return h(i,t),u(i,[{key:"updateAABBBounds",value:function(t,e,i){var n=this.stage;return n&&n.camera?(this.findFace().vertices.forEach((function(t){var e=t[0],n=t[1];i.add(e,n)})),Vn.graphicService.updateTempAABBBounds(i),Vn.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}},{key:"findFace",value:function(){for(var t=this.attribute.points,e=t.map((function(e,i){var n=3===i?t[0]:t[i+1],r=e.x-n.x;return 0===r?0:(e.y-n.y)/r})),i=t.map((function(t){return{p:t,d:0}})),n=!1,r=0,a=0;a<e.length-1;a++){for(var o=a+1;o<e.length;o++){if(e[a]===e[o]){n=!0;var s=Re.distancePP(i[a].p,i[a+1].p);i[a].d=s,i[a+1].d=s,r=xe(r,s);var u=Re.distancePP(i[o].p,i[o+1].p);i[o].d=u,i[o+1].d=u,r=xe(r,u)}if(n)break}if(n)break}for(var l=t.length-1;l>=0;l--){var h=t[l];i.unshift({p:h,d:0})}for(var c=0;c<t.length;c++){var d=(r-i[c+t.length].d)/2;i[c].d+=d,i[c+t.length].d+=d}var f={polygons:[],vertices:[],edges:[]};return i.forEach((function(t){f.vertices.push([t.p.x,t.p.y,t.d])})),f.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),f.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),f.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),f.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),f.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),f.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),f.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],f}},{key:"_isValid",value:function(){return p(c(i.prototype),"_isValid",this).call(this)&&4===this.attribute.points.length}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(Cd);function Rd(t){return new Bd(t)}Bd.NOWORK_ANIMATE_ATTR=Da;var Md=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[{x:0,y:0}])).type="shadowroot",n.shadowHost=t,n}return h(i,t),u(i,[{key:"addUpdateBoundTag",value:function(){p(c(i.prototype),"addUpdateBoundTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"addUpdateShapeAndBoundsTag",value:function(){p(c(i.prototype),"addUpdateShapeAndBoundsTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){var e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"doUpdateGlobalMatrix",value:function(){if(this.shadowHost){var t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}])}(Ao);function Pd(t){return new Md(t)}var Od=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Id=Symbol.for("PickItemInterceptor"),Ld=function(){return u((function t(){o(this,t),this.order=1}),[{key:"afterPickItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}},{key:"beforePickItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}},{key:"_pickItem",value:function(t,e,i,n,r){var a;if(!t.shadowRoot)return null;var o=(r||{}).parentMatrix;if(!o)return null;var s=e.pickContext;s.highPerformanceSave();var u=null===(a=Rr(t))||void 0===a?void 0:a[t.type],l=t.attribute.shadowPickMode,h=void 0===l?null==u?void 0:u.shadowPickMode:l,c=t.shadowRoot,d=ys.allocateByObj(o),f=new Be(d.a*i.x+d.c*i.y+d.e,d.b*i.x+d.d*i.y+d.f),v=e.pickGroup(c,f,d,n);return s.highPerformanceRestore(),!v.graphic&&v.group&&"full"===h&&(v.graphic=v.group),v}}])}();Ld=Od([L()],Ld);var Dd=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforePickItem",value:function(t,e,i,n,r){var a=t.baseGraphic;if(a&&a.parent){var o=new Be(i.x,i.y),s=e.pickContext;s.highPerformanceSave();var u=a.parent.globalTransMatrix;u.transformPoint(o,o);var l=a.isContainer?e.pickGroup(a,o.clone(),u,n):e.pickItem(a,o.clone(),u,n);return s.highPerformanceRestore(),l}return null}}])}();Dd=Od([L()],Dd);var Fd=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforePickItem",value:function(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;var a=e.pickContext,o=t.stage;if(!a||!o)return null;if(n.in3dInterceptor=!0,a.save(),this.initCanvasCtx(a),a.camera=o.camera,t.isContainer){var s=zl(a,t,(function(){return e.pickGroup(t,i,r.parentMatrix,n)}),n);return a.camera=null,n.in3dInterceptor=!1,a.restore(),s}return a.restore(),null}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}])}();Fd=Od([L()],Fd);var jd=new x((function(t,e,i){i(nh)||(t(rh).toSelf(),t(nh).toService(rh)),t(Fd).toSelf().inSingletonScope(),t(Id).toService(Fd),t(Ld).toSelf().inSingletonScope(),t(Id).toService(Ld),t(Dd).toSelf().inSingletonScope(),t(Id).toService(Dd),tt(t,Id)})),Nd=new x((function(t){t(bo).to(Ss).inSingletonScope(),t(xo).toConstantValue(qu)})),zd=Symbol.for("AutoEnablePlugins"),Ud=Symbol.for("PluginService"),Gd=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Wd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vd=function(t,e){return function(i,n){e(i,n,t)}},Hd=function(){return u((function t(e){o(this,t),this.autoEnablePlugins=e,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}),[{key:"active",value:function(t,e){var i=this;this.stage=t,this.actived=!0;var n=e.pluginList;n&&or.isBound(zd)&&this.autoEnablePlugins.getContributions().forEach((function(t){n.includes(t.name)&&i.register(t)}))}},{key:"findPluginsByName",value:function(t){var e=[];return this.onStartupFinishedPlugin.forEach((function(i){i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((function(i){i.name===t&&e.push(i)})),e}},{key:"register",value:function(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}},{key:"unRegister",value:function(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}},{key:"release",value:function(){var t=this;this.onStartupFinishedPlugin.forEach((function(e){e.deactivate(t)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((function(e){e.deactivate(t)})),this.onRegisterPlugin=[]}}])}();Hd=Gd([L(),Vd(0,O($)),Vd(0,D(zd)),Wd("design:paramtypes",[Object])],Hd);var Kd=new x((function(t){t(Ud).to(Hd),function(t,e){t($).toDynamicValue((function(t){var i=t.container;return new Q(e,i)})).whenTargetNamed(e)}(t,zd)})),Xd=new x((function(t){tt(t,it)})),Yd=new x((function(t){t(rr).to(ar).inSingletonScope(),tt(t,rr)})),qd=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Zd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jd=function(){return u((function t(){o(this,t),this.type="static",this.offscreen=!1,this.global=Vn.global}),[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{var n;this.main=!1,i.canvasId&&(n=this.global.getElementById(i.canvasId)),n||(n=this.global.createCanvas({width:e.width,height:e.height})),n.style&&(n.style["pointer-events"]="none");var r=e.getContext().getCanvas().nativeCanvas,a=lr({nativeCanvas:n,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:r.offsetLeft,y:r.offsetTop});a.applyPosition(),this.canvas=a,this.context=a.getContext()}}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){}},{key:"render",value:function(t,e,i){var n;if(!this.main){var r=this.window.getContext().getCanvas().nativeCanvas;!r||this.canvas.x===r.offsetLeft&&this.canvas.y===r.offsetTop||(this.canvas.x=r.offsetLeft,this.canvas.y=r.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"},e),i))}},{key:"merge",value:function(t){var e=this;t.forEach((function(t){var i=t.getContext().canvas.nativeCanvas;e.context.drawImage(i,0,0)}))}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,i){var n,r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}},{key:"getContext",value:function(){return this.context}},{key:"release",value:function(){this.canvas.release()}}])}();Jd=qd([L(),Zd("design:paramtypes",[])],Jd);var $d=new x((function(t){t(Jd).toSelf(),t(Po).toService(Jd)}));var Qd=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}u((n=n.apply(t,e||[])).next())}))};function tf(t,e,i){var n={},r=[];return t.forEachChildren((function(t){var i=t.attribute.zIndex,a=void 0===i?e:i;n[a]?n[a].push(t):(n[a]=[t],r.push(a))}),i),r.sort((function(t,e){return i?e-t:t-e})),{childMap:n,zIdxArray:r}}function ef(t,e,i){var n,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=!1;a?o=!0:t.forEachChildren((function(t,i){var r=t.attribute.zIndex,a=void 0===r?e:r;if(0===i)n=a;else if(n!==a)return o=!0,!0;return!1}),r);if(o)for(var s=tf(t,e,r),u=s.childMap,l=s.zIdxArray,h=!1,c=0;c<l.length&&!h;c++){var d=u[l[c]];a&&d.sort((function(t,e){var i,n;return(r?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(var f=0;f<d.length;f++)if(i(d[f],f)){h=!0;break}}else t.forEachChildren(i,r)}function nf(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Qd(this,void 0,void 0,n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.forEachChildrenAsync(i,r);case 2:case"end":return e.stop()}}),e)})))}function rf(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=!1;t.forEachChildren((function(t,e){var n=t.attribute.zIndex;if(0===e);else if(void 0!==(void 0===n?i:n))return r=!0,!0;return!1}),n);var a=null,o=!1;if(r)for(var s=tf(t,i,n),u=s.childMap,l=s.zIdxArray,h=!1,c=0;c<l.length&&!h;c++)for(var d=u[l[c]],f=0;f<d.length;f++){if(o){h=!0,a=d[f];break}d[f]._uid!==e||(o=!0)}else t.forEachChildren((function(t){return o?(a=t,!0):(t._uid===e&&(o=!0),!1)}),n);return a}var af=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},of=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sf=function(t,e){return function(i,n){e(i,n,t)}},uf=function(){return u((function t(e,i){o(this,t),this.contributions=e,this.drawItemInterceptorContributions=i,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Pe,this.backupDirtyBounds=new Pe,this.global=Vn.global,this.layerService=Vn.layerService,this.init()}),[{key:"init",value:function(){var t=this;this.contributions.forEach((function(e){if(e.style){var i=t.styleRenderMap.get(e.style)||new Map;i.set(e.numberType,e),t.styleRenderMap.set(e.style,i)}else t.defaultRenderMap.set(e.numberType,e)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"prepareForDraw",value:function(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}},{key:"draw",value:function(t,e){var i=this;this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;var n=e.context,r=e.stage,a=e.viewBox,o=e.transMatrix;if(n){var s=this.dirtyBounds.setValue(0,0,a.width(),a.height());if(r.dirtyBounds&&!r.dirtyBounds.empty()){var u=function(t,e,i){if(null===t)return e;if(null===e)return t;var n=Je(t,e,i),r=n.x11,a=n.x12,o=n.y11,s=n.y12,u=n.x21,l=n.x22,h=n.y21,c=n.y22;return r>=l||a<=u||o>=c||s<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(r,u),y1:Math.max(o,h),x2:Math.min(a,l),y2:Math.min(s,c)}}(s,r.dirtyBounds,!1);s.x1=Math.floor(u.x1),s.y1=Math.floor(u.y1),s.x2=Math.ceil(u.x2),s.y2=Math.ceil(u.y2)}var l=n.dpr%1;(l||.5!==l)&&(s.x1=Math.floor(s.x1*n.dpr)/n.dpr,s.y1=Math.floor(s.y1*n.dpr)/n.dpr,s.x2=Math.ceil(s.x2*n.dpr)/n.dpr,s.y2=Math.ceil(s.y2*n.dpr)/n.dpr),this.backupDirtyBounds.copy(s),n.inuse=!0,n.setClearMatrix(o.a,o.b,o.c,o.d,o.e,o.f),n.clearMatrix(),n.setTransformForCurrent(!0),n.translate(a.x1,a.y1,!0),n.beginPath(),n.rect(s.x1,s.y1,s.width(),s.height()),n.clip(),r.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,n,e),n.save(),t.renderTreeRoots.sort((function(t,e){var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Bn.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Bn.zIndex)})).forEach((function(t){t.isContainer?i.renderGroup(t,e,ys.allocate(1,0,0,1,0,0)):i.renderItem(t,e)})),n.restore(),n.setClearMatrix(1,0,0,1,0,0),n.inuse=!1,n.draw()}}},{key:"doRegister",value:function(){throw new Error("暂不支持")}},{key:"_findNextGraphic",value:function(t){for(var e=t.parent,i=t._uid;e;){var n=rf(e,i,Bn.zIndex);if(n)return n;i=e._uid,e=e.parent}return null}},{key:"renderGroup",value:function(t,e,i,n){var r=this;if(!e.break&&!1!==t.attribute.visibleAll){if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!this.useDirtyBounds||$e(t.AABBBounds,this.dirtyBounds,!1)){var a,o=i;if(this.useDirtyBounds){a=Yu.allocateByObj(this.dirtyBounds);var s=t.transMatrix;o=ys.allocateByObj(i).multiply(s.a,s.b,s.c,s.d,s.e,s.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(o.getInverse())}this.renderItem(t,e,{drawingCb:function(){var i;n?t.forEachChildren((function(t){e.break||(t.isContainer?r.renderGroup(t,e,o):r.renderItem(t,e))})):ef(t,Bn.zIndex,(function(t){e.break||(t.isContainer?r.renderGroup(t,e,o):r.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(a),Yu.free(a),ys.free(o))}}}},{key:"_increaseRender",value:function(t,e){var i=e.layer,n=e.stage,r=i.subLayers,a=r.get(t._uid);a||(a={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,a));var o=a.layer.getNativeHandler().getContext(),s=a.drawContribution||or.get(bl);s.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:a.layer,context:o,startAtId:t._uid,break:!1})),a.drawContribution=s;var u=this._findNextGraphic(t);if(u)if(u.isContainer&&u.incremental)this._increaseRender(u,e);else{var l=r.get(u._uid);l||(l={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(u._uid,l));var h=l.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:l.layer,context:h,startAtId:u._uid,break:!1}))}}},{key:"getRenderContribution",value:function(t){var e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}},{key:"renderItem",value:function(t,e,i){if(this.InterceptorContributions.length)for(var n=0;n<this.InterceptorContributions.length;n++){var r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}var a=this.getRenderContribution(t);if(a){var o,s=!1;if(t.parent){var u=t.parent.attribute,l=u.scrollX,h=void 0===l?0:l,c=u.scrollY,d=void 0===c?0:c;if(s=!(!h&&!d)){o=this.dirtyBounds.clone();var f=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(f),this.dirtyBounds.translate(-h,-d)}}if(!this.useDirtyBounds||t.isContainer||$e(t.AABBBounds,this.dirtyBounds,!1)){var v=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=v),v?t.isContainer&&a.draw(t,this.currentRenderService,e,i):a.draw(t,this.currentRenderService,e,i),s&&this.dirtyBounds.copy(o),this.InterceptorContributions.length)for(var p=0;p<this.InterceptorContributions.length;p++){var g=this.InterceptorContributions[p];if(g.afterDrawItem&&g.afterDrawItem(t,this.currentRenderService,e,this))return}}else s&&this.dirtyBounds.copy(o)}}},{key:"selectRenderByType",value:function(t){return te.getInstance().warn("未知错误,不应该走到这里"),null}},{key:"selectRenderByNumberType",value:function(t,e){var i;if(e.attribute.renderStyle){var n=this.styleRenderMap.get(e.attribute.renderStyle);i=n&&n.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}},{key:"clearScreen",value:function(t,e,i){var n,r,a=i.clear,o=i.viewBox,s=o.width(),u=o.height();if(a){e.clearRect(0,0,s,u);var l=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(l&&(e.globalAlpha=null!==(r=l.attribute.opacity)&&void 0!==r?r:1),l&&l.backgroundImg&&l.resources){var h=l.resources.get(a);h&&"success"===h.state&&h.data&&e.drawImage(h.data,0,0,s,u)}else e.fillStyle=Bs(e,a,{AABBBounds:{x1:0,y1:0,x2:0+s,y2:0+u}},0,0),e.fillRect(0,0,s,u)}}},{key:"afterDraw",value:function(t,e){}}])}();uf=af([L(),sf(0,I(Tl)),sf(1,O($)),sf(1,D(Wl)),of("design:paramtypes",[Array,Object])],uf);var lf=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},hf=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).numberType=co,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,n,r,a,o,s,u){if(t.incremental&&a.multiGraphicOptions){var l=a.multiGraphicOptions,h=l.startAtIdx,d=l.length,f=t.attribute.segments,v=void 0===f?[]:f;if(h>v.length)return;var g=Rr(t).line,y=t.attribute,m=y.fill,k=void 0===m?g.fill:m,_=y.stroke,b=void 0===_?g.stroke:_,x=y.opacity,S=void 0===x?g.opacity:x,w=y.fillOpacity,A=void 0===w?g.fillOpacity:w,T=y.strokeOpacity,C=void 0===T?g.strokeOpacity:T,E=y.lineWidth,B=void 0===E?g.lineWidth:E,R=y.visible,M=void 0===R?g.visible:R,P=Uo(S,A,k),O=Wo(S,C),I=No(k),L=zo(b,B);if(!t.valid||!M)return;if(!I&&!L)return;if(!(P||O||s||u))return;for(var D=a.context,F=h;F<h+d;F++)this.drawIncreaseSegment(t,D,v[F-1],v[F],t.attribute.segments[F],[g,t.attribute],n,r)}else p(c(i.prototype),"drawShape",this).call(this,t,e,n,r,a,o,s,u)}},{key:"drawIncreaseSegment",value:function(t,e,i,n,r,a,o,s){n&&(e.beginPath(),function(t,e,i,n){var r=n||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=e?e.points[e.points.length-1]:i.points[0];t.moveTo(l.x+o,l.y+u),i.points.forEach((function(e){!1!==e.defined?t.lineTo(e.x+o,e.y+u):t.moveTo(e.x+o,e.y+u)}))}(e.nativeContext,i,n,{offsetX:o,offsetY:s}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setStrokeStyle(t,r,o,s,a),e.stroke())}}])}(wu);hf=lf([L()],hf);var cf=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},df=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).numberType=oo,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,n,r,a,o,s){if(t.incremental&&a.multiGraphicOptions){var u=a.multiGraphicOptions,l=u.startAtIdx,h=u.length,d=t.attribute.segments,f=void 0===d?[]:d;if(l>f.length)return;var v=Rr(t).area,g=t.attribute,y=g.fill,m=void 0===y?v.fill:y,k=g.fillOpacity,_=void 0===k?v.fillOpacity:k,b=g.opacity,x=void 0===b?v.opacity:b,S=g.visible,w=void 0===S?v.visible:S,A=Uo(x,_,m),T=No(m);if(!t.valid||!w)return;if(!T)return;if(!A&&!s)return;for(var C=l;C<l+h;C++)this.drawIncreaseSegment(t,e,f[C-1],f[C],t.attribute.segments[C],[v,t.attribute],n,r)}else p(c(i.prototype),"drawShape",this).call(this,t,e,n,r,a,o,s)}},{key:"drawIncreaseSegment",value:function(t,e,i,n,r,a,o,s){n&&(e.beginPath(),function(t,e,i,n){for(var r=n||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=i.points,h=[],c=0;c<l.length;c++)l[c].defined;h.push(l),h.forEach((function(i,n){var r,a,s,l,h=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(h.x+o,h.y+u),i.forEach((function(e){!1!==e.defined?t.lineTo(e.x+o,e.y+u):t.moveTo(e.x+o,e.y+u)}));for(var c=i.length-1;c>=0;c--){var d=i[c];t.lineTo(null!==(r=d.x1)&&void 0!==r?r:d.x,null!==(a=d.y1)&&void 0!==a?a:d.y)}t.lineTo(null!==(s=h.x1)&&void 0!==s?s:h.x,null!==(l=h.y1)&&void 0!==l?l:h.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:s}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setCommonStyle(t,r,o,s,a),e.fill())}}])}(Pu);df=cf([L()],df);var ff,vf=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},pf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gf=function(t,e){return function(i,n){e(i,n,t)}},yf=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}u((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(ff||(ff={}));var mf=function(t){function i(t,n,r,a){var s;return o(this,i),(s=e(this,i,[t,a])).contributions=t,s.lineRender=n,s.areaRender=r,s.drawItemInterceptorContributions=a,s.rendering=!1,s.currFrameStartAt=0,s.currentIdx=0,s.status=ff.NORMAL,s.checkingForDrawPromise=null,s.hooks={completeDraw:new et([])},s.defaultRenderMap.set(s.lineRender.numberType,s.lineRender),s.defaultRenderMap.set(s.areaRender.numberType,s.areaRender),s}return h(i,t),u(i,[{key:"draw",value:function(t,e){return yf(this,void 0,void 0,n().mark((function i(){var r,a,o,s=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!this.checkingForDrawPromise){i.next=2;break}return i.abrupt("return");case 2:return this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e),i.next=5,this.checkingForDrawPromise;case 5:if(r=i.sent,this.checkingForDrawPromise=null,!r){i.next=8;break}return i.abrupt("return");case 8:this.currentRenderService=t,a=e.context,o=e.viewBox,a&&(a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,a,e),a.translate(o.x1,o.y1,!0),a.save(),t.renderTreeRoots.sort((function(t,e){var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Bn.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Bn.zIndex)})).forEach((function(t){s.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(function(){a.restore(),a.restore(),a.draw(),a.inuse=!1,s.rendering=!1})));case 11:case"end":return i.stop()}}),i,this)})))}},{key:"_increaseRender",value:function(t,e){return yf(this,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.rendering=!0,i.next=3,this._renderIncrementalGroup(t,e);case 3:case"end":return i.stop()}}),i,this)})))}},{key:"_renderIncrementalGroup",value:function(t,e){return yf(this,void 0,void 0,n().mark((function i(){var r=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.count=t.count,i.next=3,new Promise((function(i){r.renderItem(t,e,{drawingCb:function(){return yf(r,void 0,void 0,n().mark((function r(){var a,o=this;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(2===t.count){n.next=6;break}return n.next=3,nf(t,Bn.zIndex,(function(i,n){if(o.status===ff.STOP)return!0;if(i.isContainer)return!1;if(n<o.currentIdx)return!1;var r=o.currFrameStartAt+t.incremental;return n<r&&(o.currentIdx=n+1,o.renderItem(i,e)),n===r-1&&(o.currFrameStartAt=o.currentIdx,o.waitToNextFrame())}));case 3:i(!1),n.next=21;break;case 6:if(!(a=t.getChildAt(0)).incremental||!a.attribute.segments){n.next=19;break}a.incrementalAt||(a.incrementalAt=0);case 9:if(!(a.incrementalAt<a.attribute.segments.length)){n.next=17;break}return e.multiGraphicOptions={startAtIdx:a.incrementalAt,length:a.incremental},this.renderItem(a,e),a.incrementalAt+=a.incremental,n.next=15,this.waitToNextFrame();case 15:n.next=9;break;case 17:n.next=20;break;case 19:this.renderItem(a,e);case 20:i(!1);case 21:case"end":return n.stop()}}),r,this)})))}})}));case 3:this.hooks.completeDraw.call();case 4:case"end":return i.stop()}}),i,this)})))}},{key:"waitToNextFrame",value:function(){return yf(this,void 0,void 0,n().mark((function t(){var e=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){e.global.getRequestAnimationFrame()((function(){t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))}},{key:"checkForDraw",value:function(t){return yf(this,void 0,void 0,n().mark((function e(){var i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.rendering,e.t0=t.restartIncremental,!e.t0){e.next=7;break}return i=!1,e.next=6,this.forceStop();case 6:this.resetToInit();case 7:return e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"forceStop",value:function(){return yf(this,void 0,void 0,n().mark((function t(){var e=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=this.rendering,!t.t0){t.next=5;break}return this.status=ff.STOP,t.next=5,new Promise((function(t){e.hooks.completeDraw.tap("stopCb",(function(){e.status=ff.NORMAL,e.hooks.completeDraw.taps=e.hooks.completeDraw.taps.filter((function(t){return"stopCb"!==t.name})),t(!1)}))}));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"resetToInit",value:function(){this.currFrameStartAt=0,this.currentIdx=0}},{key:"renderGroup",value:function(t,e){return yf(this,void 0,void 0,n().mark((function i(){var r=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.break||!1===t.attribute.visibleAll){i.next=11;break}if(!t.incremental||e.startAtId!==t._uid){i.next=7;break}return i.next=4,this._increaseRender(t,e);case 4:i.t0=void(e.break=!0),i.next=10;break;case 7:return i.next=9,new Promise((function(i){r.renderItem(t,e,{drawingCb:function(){return yf(r,void 0,void 0,n().mark((function r(){var a=this;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,nf(t,Bn.zIndex,(function(t){return yf(a,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(i.t0=e.break,i.t0){i.next=6;break}if(i.t1=t.isContainer,!i.t1){i.next=6;break}return i.next=6,this.renderGroup(t,e);case 6:case"end":return i.stop()}}),i,this)})))}));case 2:i(!1);case 3:case"end":return r.stop()}}),r)})))}})}));case 9:i.t0=void i.sent;case 10:return i.abrupt("return",i.t0);case 11:case"end":return i.stop()}}),i,this)})))}}])}(uf);mf=vf([L(),gf(0,I(Tl)),gf(1,O(hf)),gf(2,O(df)),gf(3,O($)),gf(3,D(Wl)),pf("design:paramtypes",[Array,Object,Object,Object])],mf);var kf=new x((function(t){t(Os).toSelf().inSingletonScope(),t(Ds).toSelf().inSingletonScope(),t(Nl).to(uf),t(bl).to(mf),t(Cl).to(pl).inSingletonScope(),t(Tl).toService(Cl),tt(t,ts),t(Ls).toSelf().inSingletonScope(),tt(t,ss),tt(t,Tl),t(Yl).toSelf().inSingletonScope(),t(Wl).toService(Yl),tt(t,Wl)}));function _f(){_f.__loaded||(_f.__loaded=!0,or.load(jo),or.load(Nd),or.load(ih),or.load(jd),or.load(Kd),function(t){t.load(Xd),t.load(Yd),t.load($d)}(or),function(t){t.load(kf)}(or))}_f.__loaded=!1,_f();var bf=or.get(nt);Vn.global=bf;var xf=or.get(Ro);Vn.graphicUtil=xf;var Sf=or.get(Bo);Vn.transformUtil=Sf;var wf=or.get(bo);Vn.graphicService=wf;var Af=or.get(Mo);Vn.layerService=Af;var Tf,Cf=function(){return u((function t(){var e=this;o(this,t),this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=b.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=function(t){t.glyphHost&&(t=t.glyphHost),t.stage===e.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}),[{key:"activate",value:function(t){this.pluginService=t,Vn.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),Vn.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),Vn.graphicService.hooks.onRemove.tap(this.key,this.handleChange)}},{key:"deactivate",value:function(t){var e=this,i=function(t){return t.filter((function(t){return t.name!==e.key}))};Vn.graphicService.hooks.onAttributeUpdate.taps=i(Vn.graphicService.hooks.onAttributeUpdate.taps),Vn.graphicService.hooks.onSetStage.taps=i(Vn.graphicService.hooks.onSetStage.taps),Vn.graphicService.hooks.onRemove.taps=i(Vn.graphicService.hooks.onRemove.taps)}}])}(),Ef=function(){return u((function t(){o(this,t),this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=b.GenAutoIncrementId(),this.key=this.name+this._uid}),[{key:"activate",value:function(t){var e=this;this.pluginService=t,Vn.graphicService.hooks.onAddIncremental.tap(this.key,(function(i,n,r){i.glyphHost&&(i=i.glyphHost),i.stage===t.stage&&null!=i.stage&&(e.nextUserParams.startAtId=n._uid,e.renderNextFrame(n))})),Vn.graphicService.hooks.onClearIncremental.tap(this.key,(function(i,n){i.stage===t.stage&&null!=i.stage&&(e.nextUserParams.startAtId=i._uid,e.nextUserParams.restartIncremental=!0,e.renderNextFrame(i))}))}},{key:"deactivate",value:function(t){var e=this;Vn.graphicService.hooks.onAddIncremental.taps=Vn.graphicService.hooks.onAddIncremental.taps.filter((function(t){return t.name!==e.key})),Vn.graphicService.hooks.onClearIncremental.taps=Vn.graphicService.hooks.onClearIncremental.taps.filter((function(t){return t.name!==e.key}))}},{key:"renderNextFrame",value:function(t){var e=this;this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,Vn.global.getRequestAnimationFrame()((function(){e._doRenderInThisFrame(),e.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){var t=this,e=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((function(i){var n=i.layer;if(n&&i.layer.subLayers){var r=i.layer.subLayers.get(i._uid);r&&r.drawContribution&&r.drawContribution.draw(e.renderService,Object.assign({stage:e,layer:n,viewBox:e.window.getViewBox(),transMatrix:e.window.getViewBoxTransform(),clear:"transparent",renderService:e.renderService,updateBounds:!1,startAtId:i._uid,context:r.layer.getNativeHandler().getContext()},t.nextUserParams))}})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}])}(),Bf=new Oe,Rf=function(){return u((function t(){o(this,t),this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=b.GenAutoIncrementId(),this.key=this.name+this._uid}),[{key:"activate",value:function(t){var e=this;this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(function(t){t&&t===e.pluginService.stage&&t.dirtyBounds.clear()})),Vn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(function(t,i,n,r){t.glyphHost&&(t=t.glyphHost),i&&i===e.pluginService.stage&&i.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||n&&(Bf.setValue(r.x1,r.y1,r.x2,r.y2),i.dirty(Bf,t.parent&&t.parent.globalTransMatrix)))})),Vn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(function(t,i,n,r,a){i&&i===e.pluginService.stage&&i.renderCount&&(t.isContainer&&!a||i.dirty(r.globalAABBBounds))})),Vn.graphicService.hooks.onRemove.tap(this.key,(function(t){var i=t.stage;i&&i===e.pluginService.stage&&i.renderCount&&i&&i.dirty(t.globalAABBBounds)}))}},{key:"deactivate",value:function(t){var e=this;Vn.graphicService.hooks.beforeUpdateAABBBounds.taps=Vn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),Vn.graphicService.hooks.afterUpdateAABBBounds.taps=Vn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((function(t){return t.name!==e.key})),Vn.graphicService.hooks.onRemove.taps=Vn.graphicService.hooks.onRemove.taps.filter((function(t){return t.name!==e.key}))}}])}(),Mf=new Xr;function Pf(){if(null==Tf)try{var t=document.createElement("canvas"),e=t.getContext("2d");(Tf=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke))&&(Tf=!!document.createElement)}catch(t){Tf=!1}}function Of(){Pf();var t=Vn.global&&Vn.global.env;return t?"browser"===t:Tf}Mf.addTimeline($r),Mf.setFPS(60);var If=function(){function t(){o(this,t)}return u(t,null,[{key:"registerPlugin",value:function(e,i){t._pluginClasses[e]=i}},{key:"getPlugin",value:function(e){return t._pluginClasses[e]}}])}();If._pluginClasses={};var Lf="white",Df=function(t){function i(){var t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,i),(t=e(this,i,[{}]))._onVisibleChange=function(e){if(!(t._skipRender<0))if(e){if(t.dirtyBounds){var i=t.window.getViewBox();t.dirtyBounds.setValue(i.x1,i.y1,i.width(),i.height())}t._skipRender>1&&t.renderNextFrame(),t._skipRender=0}else t._skipRender=1},t.beforeRender=function(e){t._beforeRender&&t._beforeRender(e)},t.afterRender=function(e){t.renderCount++,t._afterRender&&t._afterRender(e),t._afterNextRenderCbs&&t._afterNextRenderCbs.forEach((function(t){return t(e)})),t._afterNextRenderCbs=null},t.params=r,t.theme=new Er,t.hooks={beforeRender:new et(["stage"]),afterRender:new et(["stage"])},t.global=Vn.global,!t.global.env&&Of()&&t.global.setEnv("browser"),t.window=or.get(vr),t.renderService=or.get(th),t.pluginService=or.get(Ud),t.layerService=or.get(Mo),t.pluginService.active(f(t),r),t.window.create({width:r.width,height:r.height,viewBox:r.viewBox,container:r.container,dpr:r.dpr||t.global.devicePixelRatio,canvasControled:!1!==r.canvasControled,title:r.title||"",canvas:r.canvas}),t.state="normal",t.renderCount=0,t.tryInitEventSystem(),t._background=null!==(n=r.background)&&void 0!==n?n:Lf,t.appendChild(t.layerService.createLayer(f(t),{main:!0})),t.nextFrameRenderLayerSet=new Set,t.willNextFrameRender=!1,t.stage=f(t),t.renderStyle=r.renderStyle,r.autoRender&&t.enableAutoRender(),!1===r.disableDirtyBounds&&t.enableDirtyBounds(),r.enableHtmlAttribute&&t.enableHtmlAttribute(r.enableHtmlAttribute),r.ReactDOM&&t.enableReactAttribute(r.ReactDOM),r.enableLayout&&t.enableLayout(),t.hooks.beforeRender.tap("constructor",t.beforeRender),t.hooks.afterRender.tap("constructor",t.afterRender),t._beforeRender=r.beforeRender,t._afterRender=r.afterRender,t.ticker=r.ticker||Mf,t.supportInteractiveLayer=!1!==r.interactiveLayer,t.timeline=new Jr,t.ticker.addTimeline(t.timeline),t.timeline.pause(),r.optimize||(r.optimize={}),t.optmize(r.optimize),r.background&&_t(t._background)&&t._background.includes("/")&&t.setAttributes({background:t._background}),t}return h(i,t),u(i,[{key:"viewBox",get:function(){return this.window.getViewBox()},set:function(t){this.window.setViewBox(t)}},{key:"x",get:function(){return this.window.getViewBox().x1},set:function(t){var e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}},{key:"y",get:function(){return this.window.getViewBox().y1},set:function(t){var e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}},{key:"width",get:function(){return this.window.width},set:function(t){this.resize(t,this.height)}},{key:"viewWidth",get:function(){return this.window.getViewBox().width()},set:function(t){this.resizeView(t,this.viewHeight)}},{key:"viewHeight",get:function(){return this.window.getViewBox().height()},set:function(t){this.resizeView(this.viewWidth,t)}},{key:"height",get:function(){return this.window.height},set:function(t){this.resize(this.width,t)}},{key:"dpr",get:function(){return this.window.dpr},set:function(t){this.setDpr(t)}},{key:"background",get:function(){var t;return null!==(t=this._background)&&void 0!==t?t:Lf},set:function(t){this._background=t}},{key:"defaultLayer",get:function(){return this.at(0)}},{key:"eventSystem",get:function(){return this._eventSystem}},{key:"pauseRender",value:function(){this._skipRender=-1}},{key:"resumeRender",value:function(){this._skipRender=0}},{key:"tryInitEventSystem",value:function(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new Vr(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}},{key:"preventRender",value:function(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}},{key:"optmize",value:function(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}},{key:"optmizeRender",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}},{key:"getTimeline",value:function(){return this.timeline}},{key:"get3dOptions",value:function(t){var e=t.center,i=void 0===e?{x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0}:e,n=t.light,r=void 0===n?{}:n,a=t.alpha,o=void 0===a?0:a,s=t.beta,u=void 0===s?0:s,l=t.camera,h=t.fieldRatio,c=void 0===h?1:h,d=t.fieldDepth;return Object.assign(Object.assign({},t),{center:i,light:r,alpha:o,beta:u,camera:l,fieldRatio:c,fieldDepth:d})}},{key:"set3dOptions",value:function(t){var e,i,n,r,a,o;this.option3d=t;var s=this.get3dOptions(t),u=s.light,l=s.center,h=s.camera,c=s.alpha,d=s.beta,f=s.fieldRatio,v=s.fieldDepth,p=u.dir,g=void 0===p?[1,1,-1]:p,y=u.color,m=void 0===y?"white":y,k=u.ambient,_=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),b=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[_,b,(null!==(a=l.z)&&void 0!==a?a:0)+(null!==(o=l.dz)&&void 0!==o?o:0)],S=0,w=0,A=0;h||(S=Math.sin(c)+_,w=Math.sin(d)+b,A=Math.cos(c)*Math.cos(d)*1);var T=If.getPlugin("DirectionalLight");T&&(this.light=new T(g,m,k));var C={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:f,fieldDepth:v,viewParams:{pos:[S,w,A],center:x,up:[0,1,0]}};if(this.camera)this.camera.params=C;else{var E=If.getPlugin("OrthoCamera");E&&(this.camera=new E(C))}t.enableView3dTransform&&this.enableView3dTransform()}},{key:"setBeforeRender",value:function(t){this._beforeRender=t}},{key:"setAfterRender",value:function(t){this._afterRender=t}},{key:"afterNextRender",value:function(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}},{key:"enableView3dTransform",value:function(){if(!this.view3dTranform){this.view3dTranform=!0;var t=If.getPlugin("ViewTransform3dPlugin");t&&this.pluginService.register(new t)}}},{key:"disableView3dTranform",value:function(){var t=this;this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableAutoRender",value:function(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new Cf))}},{key:"disableAutoRender",value:function(){var t=this;this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableIncrementalAutoRender",value:function(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new Ef))}},{key:"disableIncrementalAutoRender",value:function(){var t=this;this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableDirtyBounds",value:function(){if(!this.dirtyBounds){this.dirtyBounds=new Pe;var t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new Rf,this.pluginService.register(t))}}},{key:"disableDirtyBounds",value:function(){var t=this;this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableLayout",value:function(){if(!this._enableLayout){this._enableLayout=!0;var t=If.getPlugin("FlexLayoutPlugin");t&&this.pluginService.register(new t)}}},{key:"disableLayout",value:function(){var t=this;this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableHtmlAttribute",value:function(t){if(!this.htmlAttribute){var e=If.getPlugin("HtmlAttributePlugin");e&&(this.htmlAttribute=t,this.pluginService.register(new e))}}},{key:"disableHtmlAttribute",value:function(){var t=this;this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableReactAttribute",value:function(t){if(!this.reactAttribute){var e=If.getPlugin("ReactAttributePlugin");e&&(this.reactAttribute=t,this.pluginService.register(new e))}}},{key:"disableReactAttribute",value:function(){var t=this;this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"getPluginsByName",value:function(t){return this.pluginService.findPluginsByName(t)}},{key:"tryUpdateAABBBounds",value:function(){var t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}},{key:"combineLayer",value:function(t,e){throw new Error("暂不支持")}},{key:"createLayer",value:function(t,e){if("released"!==this.releaseStatus){var i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}}},{key:"sortLayer",value:function(t){var e=this,i=this.children;i.sort(t),this.removeAllChild(),i.forEach((function(t){e.appendChild(t)}))}},{key:"removeLayer",value:function(t){return this.removeChild(this.findChildByUid(t))}},{key:"tryInitInteractiveLayer",value:function(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}},{key:"clearViewBox",value:function(t){this.window.clearViewBox(t)}},{key:"render",value:function(t,e){if("released"!==this.releaseStatus){this.ticker.start(),this.timeline.resume();var i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}}},{key:"combineLayersToWindow",value:function(){if("harmony"===this.global.env){var t=this.window.getContext().nativeContext;this.forEachChildren((function(e,i){if(i>0){var n=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(n)}}))}}},{key:"renderNextFrame",value:function(t,e){var i=this;this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((function(t){i.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((function(){i._doRenderInThisFrame(),i.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){if("released"!==this.releaseStatus){this.timeline.resume(),this.ticker.start();var t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}}},{key:"renderLayerList",value:function(t,e){for(var i=this,n=[],r=0;r<t.length;r++){var a=t[r];"virtual"===a.layerMode&&(a=a.getNativeHandler().mainHandler.layer),n.includes(a)||n.push(a)}n.forEach((function(t){t.renderCount>i.renderCount||(t.renderCount=i.renderCount+1,t.render({renderService:i.renderService,background:t===i.defaultLayer?i.background:void 0,updateBounds:!(!i.dirtyBounds||i.dirtyBounds.empty()),viewBox:i.window.getViewBox(),transMatrix:i.window.getViewBoxTransform()},Object.assign({renderStyle:i.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e))}},{key:"resizeWindow",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),i&&this.render()}},{key:"resize",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((function(i){i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}},{key:"resizeView",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((function(i){i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}},{key:"setViewBox",value:function(t,e,i,n,r){var o=this,s=!0;"object"==a(t)?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((function(t){t.resizeView(o.viewBox.width(),o.viewBox.height())})),s&&this.render()}},{key:"setDpr",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((function(e){e.setDpr(t)})),e&&this.render()}},{key:"setOrigin",value:function(t,e){throw new Error("暂不支持")}},{key:"export",value:function(t){throw new Error("暂不支持")}},{key:"pick",value:function(t,e){if("released"!==this.releaseStatus){this.pickerService||(this.pickerService=or.get(nh));var i=this.pickerService.pick(this.children,new Be(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"release",value:function(){p(c(i.prototype),"release",this).call(this),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((function(t){t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}},{key:"setStage",value:function(t){}},{key:"dirty",value:function(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}},{key:"getLayer",value:function(t){return this.children.filter((function(e){return e.name===t}))[0]}},{key:"renderTo",value:function(t){var e=this;"released"!==this.releaseStatus&&this.forEachChildren((function(i,n){i.drawTo(t,{renderService:e.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:i===e.defaultLayer?e.background:void 0,clear:0===n,updateBounds:!(!e.dirtyBounds||e.dirtyBounds.empty())})}))}},{key:"renderToNewWindow",value:function(){var t=arguments.length>1?arguments[1]:void 0;if("released"!==this.releaseStatus){var e=or.get(vr),i=t?-t.x1:0,n=t?-t.y1:0,r=t?t.x2:this.viewWidth,a=t?t.y2:this.viewHeight,o=t?t.width():this.viewWidth,s=t?t.height():this.viewHeight;return e.create({viewBox:{x1:i,y1:n,x2:r,y2:a},width:o,height:s,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}}},{key:"toCanvas",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;if("released"!==this.releaseStatus){var i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}}},{key:"setCursor",value:function(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}},{key:"getCursor",value:function(){return this._cursor}},{key:"eventPointTransform",value:function(t){var e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}},{key:"pauseTriggerEvent",value:function(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}},{key:"resumeTriggerEvent",value:function(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}}])}(Ao);function Ff(t){return new Df(t)}var jf=500,Nf=500,zf=1,Uf=function(){return u((function t(e){var i;o(this,t);var n=e.nativeCanvas,r=e.width,a=void 0===r?jf:r,s=e.height,u=void 0===s?Nf:s,l=e.dpr,h=void 0===l?zf:l,c=e.x,d=e.y,f=e.id,v=e.canvasControled,p=void 0===v||v;this._x=null!=c?c:0,this._y=null!=d?d:0,this._pixelWidth=a*h,this._pixelHeight=u*h,this._visiable=!1!==e.visiable,this.controled=p,this._displayWidth=a,this._displayHeight=u,this._dpr=h,this._nativeCanvas=n,this._id=null!==(i=n.id)&&void 0!==i?i:f,f&&(n.id=f),this.init(e)}),[{key:"displayWidth",get:function(){return this._pixelWidth/this._dpr}},{key:"displayHeight",get:function(){return this._pixelHeight/this._dpr}},{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x},set:function(t){this._x=t}},{key:"y",get:function(){return this._y},set:function(t){this._y=t}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"applyPosition",value:function(){}},{key:"resetStyle",value:function(t){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,i,n){return this._context.getImageData(t,e,i,n)}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}])}();Uf.env="browser";var Gf=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Wf=function(){return u((function t(){o(this,t)}),[{key:"configure",value:function(t){t.env===this.type&&t.setActiveEnvContribution(this)}},{key:"getNativeAABBBounds",value:function(t){return new Oe}},{key:"removeDom",value:function(t){return!1}},{key:"createDom",value:function(t){return null}},{key:"updateDom",value:function(t,e){return!1}},{key:"getDynamicCanvasCount",value:function(){return 999}},{key:"getStaticCanvasCount",value:function(){return 999}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadBlob",value:function(t){return fetch(t).then((function(t){return t.blob()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"getElementTop",value:function(t,e){return 0}},{key:"getElementLeft",value:function(t,e){return 0}},{key:"getElementTopLeft",value:function(t,e){return{top:0,left:0}}}])}();Wf=Gf([L()],Wf);var Vf=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Hf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kf=function(){return u((function t(){o(this,t),this._uid=b.GenAutoIncrementId(),this.viewBox=new Oe,this.modelMatrix=new De(1,0,0,1,0,0)}),[{key:"onChange",value:function(t){this._onChangeCb=t}},{key:"configure",value:function(t,e){e.env===this.type&&t.setWindowHandler(this)}},{key:"release",value:function(){this.releaseWindow()}},{key:"isVisible",value:function(t){return!0}},{key:"onVisibleChange",value:function(t){}},{key:"getTopLeft",value:function(t){return{top:0,left:0}}},{key:"setViewBox",value:function(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}},{key:"getViewBox",value:function(){return this.viewBox}},{key:"setViewBoxTransform",value:function(t,e,i,n,r,a){this.modelMatrix.setValue(t,e,i,n,r,a)}},{key:"getViewBoxTransform",value:function(){return this.modelMatrix}}])}();Kf=Vf([L(),Hf("design:paramtypes",[])],Kf);var Xf=function(){return u((function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;o(this,t),this.dir=e,this.color=i,this.colorRgb=_a.Get(i,ya.Color1),this.ambient=n;var r=Ae(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);this.formatedDir=[e[0]/r,e[1]/r,e[2]/r]}),[{key:"computeColor",value:function(t,e){var i,n=this.formatedDir,r=Se(xe((t[0]*n[0]+t[1]*n[1]+t[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);i=_t(e)?_a.Get(e,ya.Color1):e;var a=this.colorRgb;return"rgb(".concat(a[0]*i[0]*r,", ").concat(a[1]*i[1]*r,", ").concat(a[2]*i[2]*r,")")}}])}(),Yf=function(){If.registerPlugin("DirectionalLight",Xf)},qf=function(){return u((function t(e){o(this,t),this.params=e}),[{key:"params",get:function(){return Object.assign({},this._params)},set:function(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}},{key:"getViewMatrix",value:function(){return this._viewMatrixCached||(this._viewMatrixCached=ms.allocate()),this._viewMatrixCached}},{key:"forceGetViewMatrix",value:function(){this._viewMatrixCached||(this._viewMatrixCached=ms.allocate());var t=this.params.viewParams,e=t.pos,i=t.center,n=t.up;return function(t,e,i,n){var r,a,o,s,u,l,h,c,d,f,v=e[0],p=e[1],g=e[2],y=n[0],m=n[1],k=n[2],_=i[0],b=i[1],x=i[2];Math.abs(v-_)<ve&&Math.abs(p-b)<ve&&Math.abs(g-x)<ve?hs(t):(h=v-_,c=p-b,d=g-x,r=m*(d*=f=1/Math.hypot(h,c,d))-k*(c*=f),a=k*(h*=f)-y*d,o=y*c-m*h,(f=Math.hypot(r,a,o))?(r*=f=1/f,a*=f,o*=f):(r=0,a=0,o=0),s=c*o-d*a,u=d*r-h*o,l=h*a-c*r,(f=Math.hypot(s,u,l))?(s*=f=1/f,u*=f,l*=f):(s=0,u=0,l=0),t[0]=r,t[1]=s,t[2]=h,t[3]=0,t[4]=a,t[5]=u,t[6]=c,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*v+a*p+o*g),t[13]=-(s*v+u*p+l*g),t[14]=-(h*v+c*p+d*g),t[15]=1)}(this._viewMatrixCached,e,i,n),this._vp||(this._vp=ms.allocate()),this._vp=fs(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}},{key:"getProjectionMatrix",value:function(){return this._projectionMatrixCached||(this._projectionMatrixCached=ms.allocate()),this._projectionMatrixCached}},{key:"forceGetProjectionMatrix",value:function(){this._projectionMatrixCached||(this._projectionMatrixCached=ms.allocate());var t=this._params,e=t.left,i=t.top,n=t.right,r=t.bottom;return function(t,e,i,n,r,a,o){var s=1/(e-i),u=1/(n-r),l=1/(a-o);t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*s,t[13]=(r+n)*u,t[14]=(o+a)*l,t[15]=1}(this._projectionMatrixCached,e,n,r,i,0,-2e6),this._vp||(this._vp=ms.allocate()),this._vp=fs(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}},{key:"getField",value:function(){var t=this._params,e=t.fieldRatio,i=void 0===e?.8:e,n=t.fieldDepth,r=t.left,a=t.right;return(null!=n?n:a-r)*i}},{key:"getProjectionScale",value:function(t){var e=this.getField();return e/(e+t)}},{key:"view",value:function(t,e,i){var n=[0,0,0];return vs(n,[t,e,i],this._viewMatrixCached),n}},{key:"vp",value:function(t,e,i){var n=[0,0,0],r=this._params.viewParams.pos;vs(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];var a=this.getProjectionScale(i);return{x:t*a+r[0],y:e*a+r[1]}}}])}(),Zf=function(){If.registerPlugin("OrthoCamera",qf)},Jf=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},$f=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qf=function(t,e){return function(i,n){e(i,n,t)}},tv=function(){return u((function t(e){o(this,t),this.pickItemInterceptorContributions=e,this.type="default",this.global=Vn.global}),[{key:"_init",value:function(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"pick",value:function(t,e,i){var n={graphic:null,group:null};i.pickerService=this;var r=i.bounds.width(),a=i.bounds.height();if(!(new Oe).setValue(0,0,r,a).containsPoint(e))return n;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);for(var o,s=new De(1,0,0,1,0,0),u=t.length-1;u>=0&&!(n=t[u].isContainer?this.pickGroup(t[u],e,s,i):this.pickItem(t[u],e,s,i)).graphic;u--)o||(o=n.group);if(n.graphic||(n.group=o),this.pickContext&&(this.pickContext.inuse=!1),n.graphic){for(var l=n.graphic;l.parent;)l=l.parent;l.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=l.shadowHost)}return n}},{key:"containsPoint",value:function(t,e,i){var n;return!!(null===(n=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===n?void 0:n.graphic)}},{key:"pickGroup",value:function(t,e,i,n){var r=this,a={group:null,graphic:null};if(!1===t.attribute.visibleAll)return a;var o=n.pickContext,s=o.modelMatrix;if(o.camera){var u=t.transMatrix,l=ms.allocate();if(ds(l,u),s){if(l){var h=ms.allocate();o.modelMatrix=fs(h,s,l),ms.free(l)}}else ds(l,t.globalTransMatrix),o.modelMatrix=l}if(this.InterceptorContributions.length)for(var c=0;c<this.InterceptorContributions.length;c++){var d=this.InterceptorContributions[c];if(d.beforePickItem){var f=d.beforePickItem(t,this,e,n,{parentMatrix:i});if(f)return o.modelMatrix!==s&&ms.free(o.modelMatrix),o.modelMatrix=s,f}}var v=t.transMatrix,p=ys.allocateByObj(i),g=new Be(e.x,e.y);p.transformPoint(g,g);var y=t.AABBBounds.containsPoint(g);if(!y&&!t.stage.camera)return a;var m=this.pickItem(t,g.clone(),i,n);m&&m.graphic&&(a.graphic=m.graphic,a.params=m.params);var k=!1!==t.attribute.pickable&&y;return p.multiply(v.a,v.b,v.c,v.d,v.e,v.f),!1===t.attribute.childrenPickable||m&&m.graphic||ef(t,Bn.zIndex,(function(o){if(o.isContainer){var s=new Be(e.x,e.y),u=Rr(t).group,l=t.attribute,h=l.scrollX,c=void 0===h?u.scrollX:h,d=l.scrollY,f=void 0===d?u.scrollY:d;s.x-=c,s.y-=f,a=r.pickGroup(o,s,p,n)}else{var v=new Be(e.x,e.y);p.transformPoint(v,v);var g=Rr(t).group,y=t.attribute,m=y.scrollX,k=void 0===m?g.scrollX:m,_=y.scrollY,b=void 0===_?g.scrollY:_;v.x-=k,v.y-=b;var x=r.pickItem(o,v,i,n);x&&x.graphic&&(a.graphic=x.graphic,a.params=x.params)}return!!a.graphic||!!a.group}),!0,!!o.camera),o.modelMatrix!==s&&ms.free(o.modelMatrix),o.modelMatrix=s,a.graphic||a.group||!k||t.stage.camera||(a.group=t),ys.free(p),a}},{key:"selectPicker",value:function(t){return this.pickerMap.get(t.numberType)||null}}])}();function ev(t,e){var i=0;for(i=0;i<t.length;i++){var n=t[i];if(n.text&&"\n"===n.text||e--,e<0)break}return i}tv=Jf([L(),Qf(0,O($)),Qf(0,D(Id)),$f("design:paramtypes",[Object])],tv);var iv=function(){return u((function t(e){var i=this;o(this,t),this.handleKeyDown=function(t){"Delete"!==t.key&&"Backspace"!==t.key||i.handleInput({data:null,type:"Backspace"})},this.handleCompositionStart=function(){var t=i.currRt.attribute.textConfig,e=void 0===t?[]:t,n=ev(e,i.cursorIndex),r=e[n];e.splice(n+1,0,Object.assign(Object.assign({},r),{text:""})),i.isComposing=!0},this.handleCompositionEnd=function(){i.isComposing=!1;var t=i.currRt.attribute.textConfig,e=void 0===t?[]:t,n=ev(e,i.cursorIndex+1),r=e[n];e.splice(n,1);for(var a=r.text,o=Array.from(a.toString()),s=0;s<o.length;s++)e.splice(s+n,0,Object.assign(Object.assign({},r),{text:o[s]}));i.currRt.setAttributes({textConfig:e}),i.onChangeCbList.forEach((function(t){t(a,i.isComposing,i.cursorIndex+o.length,i.currRt,"right")}))},this.handleInput=function(t){var e;if(i.currRt){var n=t.data;"Backspace"===t.type||n||(n="\n");var r=i.currRt.attribute.textConfig,a=void 0===r?[]:r,o=i.selectionStartCursorIdx,s=i.cursorIndex;o>s&&(o=(e=[s,o])[0],s=e[1]),i.selectionStartCursorIdx=o,i.cursorIndex=o,o=ev(a,o);var u=i.selectionStartCursorIdx-o;s=ev(a,s);var l=a[o+(i.isComposing?1:0)],h=l;"Backspace"!==t.type||i.isComposing?(o!==s&&a.splice(o+1,s-o),i.isComposing||(h=Object.assign(Object.assign({},l),{text:""}),o+=1,a.splice(o,0,h)),h.text=n):o!==s?a.splice(o+1,s-o):(a.splice(o,1),o-=1),i.currRt.setAttributes({textConfig:a}),i.isComposing?i.onInputCbList.forEach((function(t){t(n,i.isComposing,o+u,i.currRt,"\n"===n?"left":"right")})):i.onChangeCbList.forEach((function(t){t(n,i.isComposing,o+u,i.currRt,"\n"===n?"left":"right")}))}},this.container=null!=e?e:document.body;var n=document.createElement("textarea");n.autocomplete="off",n.innerText="",this.applyStyle(n),this.container.append(n),this.textAreaDom=n,this.isComposing=!1,this.onInputCbList=[],this.onChangeCbList=[]}),[{key:"onInput",value:function(t){this.onInputCbList.push(t)}},{key:"onChange",value:function(t){this.onChangeCbList.push(t)}},{key:"applyStyle",value:function(t){t.setAttribute("style","width: 100px; height: 30px; left: 0; position: absolute; z-index: -1; outline: none; resize: none; border: none; overflow: hidden; color: transparent; user-select: none; caret-color: transparent;background-color: transparent;"),t.addEventListener("input",this.handleInput),t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd),window.addEventListener("keydown",this.handleKeyDown)}},{key:"moveTo",value:function(t,e,i,n,r){var a=this;this.textAreaDom.style.left="".concat(t,"px"),this.textAreaDom.style.top="".concat(e,"px"),setTimeout((function(){a.textAreaDom.focus(),a.textAreaDom.setSelectionRange(0,0)})),this.currRt=i,this.cursorIndex=n,this.selectionStartCursorIdx=r}},{key:"release",value:function(){this.textAreaDom.removeEventListener("input",this.handleInput),this.textAreaDom.removeEventListener("compositionstart",this.handleCompositionStart),this.textAreaDom.removeEventListener("compositionend",this.handleCompositionEnd),window.removeEventListener("keydown",this.handleKeyDown)}}])}(),nv=function(){return u((function t(e,i,n,r,a){o(this,t),this.curCursorIdx=r,this.selectionStartCursorIdx=n,this.cacheCurCursorIdx=i,this.cacheSelectionStartCursorIdx=e,this.rt=a}),[{key:"hasFormat",value:function(t){return null!=this.getFormat(t)}},{key:"getFormat",value:function(t){if(!this.rt)return null;var e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t];if(null==i)return null;for(var n=this.selectionStartCursorIdx+2;n<=this.curCursorIdx;n++)if(i!==e[n][t])return null;return i}},{key:"getAllFormat",value:function(t){if(!this.rt)return[];var e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t],n=new Set;n.add(i);for(var r=this.selectionStartCursorIdx+2;r<=this.curCursorIdx;r++){var a=e[r];n.add(a[t])}return Array.from(n.values())}}])}(),rv=function(){return u((function t(){var e=this;o(this,t),this.name="RichTextEditPlugin",this.activeEvent="onRegister",this._uid=b.GenAutoIncrementId(),this.key=this.name+this._uid,this.editing=!1,this.pointerDown=!1,this.handleInput=function(t,i,n,r,a){var o=e.getPointByColumnIdx(n,r,a);e.hideSelection(),e.setCursor(o.x,o.y1,o.y2),e.updateCbs.forEach((function(t){return t("input",e)}))},this.handleChange=function(t,i,n,r,a){var o=e.getPointByColumnIdx(n,r,a);e.curCursorIdx=n,e.selectionStartCursorIdx=n,e.setCursorAndTextArea(o.x,o.y1,o.y2,r),e.hideSelection(),e.updateCbs.forEach((function(t){return t("change",e)}))},this.handleMove=function(t){e.isRichtext(t)&&(e.currRt=t.target,e.handleEnter(t),t.target.once("pointerleave",e.handleLeave),e.showSelection(t))},this.handlePointerDown=function(t){e.editing?e.onFocus(t):e.deFocus(t),e.applyUpdate(),e.pointerDown=!0,e.updateCbs.forEach((function(t){return t(e.editing?"onfocus":"defocus",e)}))},this.handlePointerUp=function(t){e.pointerDown=!1},this.handleEnter=function(t){e.editing=!0,e.pluginService.stage.setCursor("text")},this.handleLeave=function(t){e.editing=!1,e.pluginService.stage.setCursor("default")},this.commandCbs=new Map,this.commandCbs.set("FORMAT_TEXT_COMMAND",[this.formatTextCommandCb]),this.updateCbs=[]}),[{key:"getSelection",value:function(){return this.selectionStartCursorIdx&&this.curCursorIdx&&this.selectionStartCursorIdx!==this.curCursorIdx&&this.currRt?new nv(this.selectionStartCursorIdx,this.curCursorIdx,ev(this.currRt.attribute.textConfig,this.selectionStartCursorIdx),ev(this.currRt.attribute.textConfig,this.curCursorIdx),this.currRt):null}},{key:"formatTextCommandCb",value:function(t,e){var i=e.currRt;if(i){var n=e.getSelection();if(n){var r=n.selectionStartCursorIdx,a=n.curCursorIdx,o=i.attribute.textConfig.slice(r+1,a+1);"bold"===t?o.forEach((function(t){return t.fontWeight="bold"})):"italic"===t?o.forEach((function(t){return t.fontStyle="italic"})):"underline"===t?o.forEach((function(t){return t.underline=!0})):"lineThrough"===t?o.forEach((function(t){return t.lineThrough=!0})):gt(t)&&o.forEach((function(e){return zt(e,t)})),i.setAttributes(i.attribute)}}}},{key:"dispatchCommand",value:function(t,e){var i=this,n=this.commandCbs.get(t);n&&n.forEach((function(t){return t(e,i)})),this.updateCbs.forEach((function(t){return t("dispatch",i)}))}},{key:"registerCommand",value:function(t,e){(this.commandCbs.get(t)||[]).push(e)}},{key:"registerUpdateListener",value:function(t){(this.updateCbs||[]).push(t)}},{key:"activate",value:function(t){this.pluginService=t,this.editModule=new iv,t.stage.on("pointermove",this.handleMove),t.stage.on("pointerdown",this.handlePointerDown),t.stage.on("pointerup",this.handlePointerUp),t.stage.on("pointerleave",this.handlePointerUp),this.editModule.onInput(this.handleInput),this.editModule.onChange(this.handleChange)}},{key:"showSelection",value:function(t){var e=this,i=t.target.getFrameCache();if(i&&this.editBg&&this.pointerDown){var n,r,a=this.lastPoint,o=this.getEventPosition(t),s=this.getLineByPoint(i,o),u=this.getColumnByLinePoint(s,o),l=s.top,h=s.top+s.height,c=u.left+u.width,d=this.getColumnIndex(i,u);o.x<u.left+u.width/2&&(c=u.left,d-=1),o.x=c,o.y=(l+h)/2;var f=this.getLineByPoint(i,a);if((a.y>o.y||a.y===o.y&&a.x>o.x)&&(a=(n=[o,a])[0],o=n[1],s=(r=[f,s])[0],f=r[1]),this.editBg.removeAllChild(),f===s){var v=this.getColumnByLinePoint(f,a);this.editBg.setAttributes({x:a.x,y:f.top,width:o.x-a.x,height:v.height,fill:"#336df4",fillOpacity:.2})}else{this.editBg.setAttributes({x:0,y:f.top,width:0,height:0});for(var p=i.lines.findIndex((function(t){return t===f})),g=i.lines.findIndex((function(t){return t===s})),y=0,m=p;m<=g;m++){var k=i.lines[m];if(m===p){var _=k.paragraphs[k.paragraphs.length-1];this.editBg.add($c({x:a.x,y:y,width:_.left+_.width-a.x,height:k.height,fill:"#336df4",fillOpacity:.2}))}else if(m===g){var b=k.paragraphs[0];this.editBg.add($c({x:b.left,y:y,width:o.x-b.left,height:k.height,fill:"#336df4",fillOpacity:.2}))}else{var x=k.paragraphs[0],S=k.paragraphs[k.paragraphs.length-1];this.editBg.add($c({x:x.left,y:y,width:S.left+S.width-x.left,height:k.height,fill:"#336df4",fillOpacity:.2}))}y+=k.height}}this.curCursorIdx=d,this.setCursorAndTextArea(c,l+2,h-2,t.target),this.applyUpdate(),this.updateCbs.forEach((function(t){return t("selection",e)}))}}},{key:"hideSelection",value:function(){this.editBg&&(this.editBg.removeAllChild(),this.editBg.setAttributes({fill:"transparent"}))}},{key:"isRichtext",value:function(t){return!(!t.target||"richtext"!==t.target.type||!t.target.attribute.editable)}},{key:"getEventPosition",value:function(t){var e=this.pluginService.stage.eventPointTransform(t),i={x:0,y:0};return t.target.globalTransMatrix.transformPoint(e,i),i}},{key:"getLineByPoint",value:function(t,e){for(var i=t.lines[0],n=0;n<t.lines.length&&!(i.top<=e.y&&i.top+i.height>=e.y);n++)i=t.lines[n+1];return i}},{key:"getColumnByLinePoint",value:function(t,e){for(var i=t.paragraphs[0],n=0;n<t.paragraphs.length&&!(i.left<=e.x&&i.left+i.width>=e.x);n++)i=t.paragraphs[n];return i}},{key:"onFocus",value:function(t){this.deFocus(t);var e=t.target;this.tryUpdateRichtext(e);var i=e.attachShadow();i.setAttributes({shadowRootIdx:-1});var n=e.getFrameCache();if(n){if(!this.editLine){var r=qc({x:0,y:0,lineWidth:1,stroke:"black"});r.animate().to({opacity:1},10,"linear").wait(700).to({opacity:0},10,"linear").wait(700).loop(1/0),this.editLine=r;var a=To({x:0,y:0,width:0,height:0});this.editBg=a,i.add(this.editLine),i.add(this.editBg)}var o=this.getEventPosition(t),s=this.getLineByPoint(n,o);if(s){var u=this.getColumnByLinePoint(s,o);if(!u)return;var l=s.top,h=s.top+s.height,c=u.left+u.width;l+=2,h-=2;var d=this.getColumnIndex(n,u);o.x<u.left+u.width/2&&(c=u.left,d-=1),this.lastPoint={x:c,y:(l+h)/2},this.curCursorIdx=d,this.selectionStartCursorIdx=d,this.setCursorAndTextArea(c,l,h,e)}}}},{key:"getPointByColumnIdx",value:function(t,e,i){var n=e.getFrameCache(),r=this.getColumnByIndex(n,t),a=r.lineInfo,o=r.columnInfo,s=a.top,u=a.top+a.height;return s+=2,u-=2,{x:o.left+("left"===i?0:o.width),y1:s,y2:u}}},{key:"getColumnIndex",value:function(t,e){for(var i=-1,n=0;n<t.lines.length;n++)for(var r=t.lines[n],a=0;a<r.paragraphs.length;a++)if(i++,e===r.paragraphs[a])return i;return-1}},{key:"getColumnByIndex",value:function(t,e){for(var i=-1,n=0;n<t.lines.length;n++)for(var r=t.lines[n],a=0;a<r.paragraphs.length;a++){var o=r.paragraphs[a];if(++i===e)return{lineInfo:r,columnInfo:o}}return null}},{key:"setCursorAndTextArea",value:function(t,e,i,n){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]});var r={x:0,y:0};n.globalTransMatrix.getInverse().transformPoint({x:t,y:e},r);var a=this.pluginService.stage.window.getBoundingClientRect(),o=a.left,s=a.top;r.x+=o,r.y+=s,this.editModule.moveTo(r.x,r.y,n,this.curCursorIdx,this.selectionStartCursorIdx)}},{key:"setCursor",value:function(t,e,i){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]})}},{key:"applyUpdate",value:function(){this.pluginService.stage.renderNextFrame()}},{key:"deFocus",value:function(t){var e=this.currRt;e&&(e.detachShadow(),this.currRt=null,this.editLine&&(this.editLine.parent.removeChild(this.editLine),this.editLine.release(),this.editLine=null,this.editBg.parent.removeChild(this.editBg),this.editBg.release(),this.editBg=null))}},{key:"splitText",value:function(t){return Array.from(t)}},{key:"tryUpdateRichtext",value:function(t){var e=this;if(!t.getFrameCache().lines.every((function(t){return t.paragraphs.every((function(t){return!(t.text&&_t(t.text)&&e.splitText(t.text).length>1)}))}))){var i=[];t.attribute.textConfig.forEach((function(t){var n=e.splitText(t.text.toString());if(_t(t.text)&&n.length>1)for(var r=0;r<n.length;r++){var a=n[r];i.push(Object.assign(Object.assign({},t),{text:a}))}else i.push(t)})),t.setAttributes({textConfig:i}),t.doUpdateFrameCache(i)}}},{key:"onSelect",value:function(){}},{key:"deactivate",value:function(t){t.stage.off("pointermove",this.handleMove),t.stage.off("pointerdown",this.handlePointerDown),t.stage.off("pointerup",this.handlePointerUp),t.stage.off("pointerleave",this.handlePointerUp)}},{key:"release",value:function(){this.editModule.release()}}])}(),av=!1,ov=new x((function(t){av||(av=!0,t(pu).toSelf().inSingletonScope(),t(xl).to(pu).inSingletonScope(),t(Tl).toService(xl),t(Jo).toService(Ls),tt(t,Jo))})),sv=!1,uv=new x((function(t){sv||(sv=!0,t(Gu).toSelf().inSingletonScope(),t(Ml).to(Gu).inSingletonScope(),t(Tl).toService(Ml),t(Qs).toSelf(),t($s).toSelf(),t(rs).toService(Qs),t(rs).toService($s),t(rs).toService(Ls),tt(t,rs))})),lv=!1,hv=new x((function(t){lv||(lv=!0,t(wu).toSelf().inSingletonScope(),t(hf).toSelf().inSingletonScope(),t(El).to(wu).inSingletonScope(),t(Tl).toService(El))})),cv=!1,dv=new x((function(t){cv||(cv=!0,t(Pu).toSelf().inSingletonScope(),t(wl).to(Pu).inSingletonScope(),t(Tl).toService(wl),t($o).toService(Ls),tt(t,$o),t(df).toSelf().inSingletonScope())})),fv=!1,vv=new x((function(t){fv||(fv=!0,t(Ku).toSelf().inSingletonScope(),t(Ol).to(Ku).inSingletonScope(),t(Tl).toService(Ol),t(as).toService(Ls),tt(t,as))})),pv=!1,gv=new x((function(t){pv||(pv=!0,t(ku).toSelf().inSingletonScope(),t(Al).to(ku).inSingletonScope(),t(Tl).toService(Al),t(Qo).toService(Ls),tt(t,Qo))})),yv=!1,mv=new x((function(t){yv||(yv=!0,t(Il).to(il).inSingletonScope(),t(Tl).toService(Il),t(os).toService(Ls),tt(t,os))})),kv=!1,_v=new x((function(t){kv||(kv=!0,t(ju).toSelf().inSingletonScope(),t(Bl).to(ju).inSingletonScope(),t(Tl).toService(Bl),t(is).toService(Ls),tt(t,is))})),bv=!1,xv=new x((function(t){bv||(bv=!0,t(Rl).to(cl).inSingletonScope(),t(Tl).toService(Rl),t(ns).toService(Ls),tt(t,ns))})),Sv=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},wv=function(){return u((function t(){o(this,t),this.numberType=uo}),[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){r.drawContribution&&t.getSubGraphic().forEach((function(t){var u=r.drawContribution.getRenderContribution(t);u&&u.drawShape&&u.drawShape(t,e,i,n,r,a,o,s)}))}},{key:"draw",value:function(t,e,i,n){var r=i.context;if(r&&(r.highPerformanceSave(),i.drawContribution)){var a=Rr(t),o=t.getSubGraphic();o.length&&o.forEach((function(t){i.drawContribution.renderItem(t,i,{theme:a})})),r.highPerformanceRestore()}}}])}();wv=Sv([L()],wv);var Av=!1,Tv=new x((function(t){Av||(Av=!0,t(Fl).to(wv).inSingletonScope(),t(Tl).toService(Fl))})),Cv=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Ev=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bv=function(t){function i(){var t;return o(this,i),(t=e(this,i)).numberType=mo,t.builtinContributions=[$u],t.init(),t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r){var a=Rr(t).richtext,o=t.attribute,s=o.strokeOpacity,u=void 0===s?a.strokeOpacity:s,l=o.opacity,h=void 0===l?a.opacity:l,c=o.fillOpacity,d=void 0===c?a.fillOpacity:c,f=o.visible,v=void 0===f?a.visible:f;if(t.valid&&v){var p=Uo(h,d,!0),g=Uo(h,u,!0);p&&(e.translate(i,n),this.beforeRenderStep(t,e,i,n,p,g,p,g,a,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,p,g,p,g,a,r))}}},{key:"drawIcon",value:function(t,e,i,n,r){var a,o=Rr(t).richtextIcon,s=t.attribute,u=s.width,l=void 0===u?o.width:u,h=s.height,c=void 0===h?o.height:h,d=s.opacity,f=void 0===d?o.opacity:d,v=s.image,p=s.backgroundFill,g=void 0===p?o.backgroundFill:p,y=s.backgroundFillOpacity,m=void 0===y?o.backgroundFillOpacity:y,k=s.backgroundStroke,_=void 0===k?o.backgroundStroke:k,b=s.backgroundStrokeOpacity,x=void 0===b?o.backgroundStrokeOpacity:b,S=s.backgroundRadius,w=void 0===S?o.backgroundRadius:S,A=s.margin,T=t.attribute,C=T.backgroundWidth,E=void 0===C?l:C,B=T.backgroundHeight,R=void 0===B?c:B;if(A&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){var M=(E-l)/2,P=(R-c)/2;0===w?(e.beginPath(),e.rect(i-M,n-P,E,R)):(e.beginPath(),qs(e,i-M,n-P,E,R,w)),g&&(e.globalAlpha=m,e.fillStyle=g,e.fill()),_&&(e.globalAlpha=x,e.strokeStyle=_,e.stroke())}var O=v&&(null===(a=null==t?void 0:t.resources)||void 0===a?void 0:a.get(v));O&&"success"===O.state&&(e.globalAlpha=f,e.drawImage(O.data,i,n,l,c))}},{key:"draw",value:function(t,e,i){var n=Rr(t).richtext;this._draw(t,n,!1,i)}}])}(As);Bv=Cv([L(),Ev("design:paramtypes",[])],Bv);var Rv=!1,Mv=new x((function(t){Rv||(Rv=!0,t(Ll).to(Bv).inSingletonScope(),t(Tl).toService(Ll))})),Pv=!1,Ov=new x((function(t){Pv||(Pv=!0,t(jl).to(_l).inSingletonScope(),t(Tl).toService(jl),t(es).toService(Ls),tt(t,es))})),Iv=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"stroke",value:function(t,e,i,n,r){var a=n.vertices;n.edges.forEach((function(n){var o=a[n[0]],s={x:t+o[0],y:e+o[1],z:i+o[2]},u=a[n[1]],l={x:t+u[0],y:e+u[1],z:i+u[2]};r.beginPath(),r.moveTo(s.x,s.y,s.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}},{key:"fill",value:function(t,e,i,n,r,a,o,s,u,l,h){var c=_a.Get(a,ya.Color255),d=n.vertices,f=d.map((function(t){return o.view(t[0],t[1],t[2])[2]})),v=[];n.polygons.forEach((function(t,e){if(!r||r[e]){v.push({faceIdx:e,polygon:t});var i=t.polygon,n=f[i[0]],a=f[i[1]],o=f[i[2]],s=f[i[3]];t.ave_z=n+a+o+s}})),v.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),v.forEach((function(n){var r=n.polygon,f=r.polygon,v=r.normal,p=d[f[0]],g=d[f[1]],y=d[f[2]],m=d[f[3]],k={x:t+p[0],y:e+p[1],z:i+p[2]},_={x:t+g[0],y:e+g[1],z:i+g[2]},b={x:t+y[0],y:e+y[1],z:i+y[2]},x={x:t+m[0],y:e+m[1],z:i+m[2]};o.beginPath(),o.moveTo(k.x,k.y,k.z),o.lineTo(_.x,_.y,_.z),o.lineTo(b.x,b.y,b.z),o.lineTo(x.x,x.y,x.z),o.closePath(),h?h(o,u&&u.attribute,l):(o.fillStyle=s?s.computeColor(v,c):a,o.fill())}))}}])}(As),Lv=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Dv=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="rect3d",t.numberType=yo,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u,l=Rr(t,null==a?void 0:a.theme).rect,h=t.attribute,c=h.fill,d=void 0===c?l.fill:c,f=h.stroke,v=void 0===f?l.stroke:f,p=h.x1,g=h.y1,y=h.x,m=h.y,k=h.opacity,_=void 0===k?l.opacity:k,b=h.fillOpacity,x=void 0===b?l.fillOpacity:b,S=h.lineWidth,w=void 0===S?l.lineWidth:S,A=h.strokeOpacity,T=void 0===A?l.strokeOpacity:A,C=h.visible,E=void 0===C?l.visible:C,B=t.attribute,R=B.width,M=B.height;R=(null!=R?R:p-y)||0,M=(null!=M?M:g-m)||0;var P=null!==(u=this.z)&&void 0!==u?u:0,O=Go(_,x,R,M,d),I=Vo(_,T,R,M),L=No(d),D=zo(v,w);if(t.valid&&E&&(L||D)&&(O||I||o||s)){var F=(r.stage||{}).light,j=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,i,n,l);var N=d;"string"!=typeof N&&(N="black"),this.fill(i,n,P,j,null,N,e,F,null,null,o)}!1!==v&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,P,j,e))}}},{key:"draw",value:function(t,e,i){var n=Rr(t).rect;this._draw(t,n,!1,i)}}])}(Iv);Dv=Lv([L()],Dv);var Fv=!1,jv=new x((function(t){Fv||(Fv=!0,t(Pl).to(Dv).inSingletonScope(),t(Tl).toService(Pl))})),Nv=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};var zv=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).numberType=ao,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u,l=Rr(t,null==a?void 0:a.theme).arc,h=t.attribute.fill,c=void 0===h?l.fill:h,d=this.valid(t,l,o,s);if(d){var f=d.fVisible,v=d.sVisible,p=d.doFill,g=d.doStroke,y=null!==(u=this.z)&&void 0!==u?u:0,m=t.attribute,k=m.outerPadding,_=void 0===k?l.outerPadding:k,b=m.innerPadding,x=void 0===b?l.innerPadding:b,S=m.height,w=void 0===S?10:S,A=t.attribute,T=A.outerRadius,C=void 0===T?l.outerRadius:T,E=A.innerRadius,B=void 0===E?l.innerRadius:E;C+=_,B-=x;var R=_a.Get(c,ya.Color255),M=(r.stage||{}).light,P=r.hack_pieFace,O={top:y,bottom:y+w},I={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===P||"top"===P?(e.beginPath(),function(t,e,i,n,r,a,o){var s=t.getParsedAngle(),u=s.startAngle,l=s.endAngle,h=ke(l-u),c=l>u,d=!1;if(a<o){var f=a;a=o,o=f}if(a<=ve)e.moveTo(i,n,r);else if(h>=me-ve)e.moveTo(i+a*be(u),n+a*we(u),r),e.arc(i,n,a,u,l,!c,r),o>ve&&(e.moveTo(i+o*be(l),n+o*we(l),r),e.arc(i,n,o,l,u,c,r));else{var v=t.getParsePadAngle(u,l),p=v.outerDeltaAngle,g=v.innerDeltaAngle,y=v.outerStartAngle,m=v.outerEndAngle,k=v.innerEndAngle,_=v.innerStartAngle,b=a*be(y),x=a*we(y),S=o*be(k),w=o*we(k);p<.001?d=!0:(e.moveTo(i+b,n+x,r),e.arc(i,n,a,y,m,!c,r)),!(o>ve)||g<.001?(e.lineTo(i+S,n+w,r),d=!0):(e.lineTo(i+S,n+w,r),e.arc(i,n,o,k,_,c,r))}e.closePath()}(t,e,i,n,O[P],C,B),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),p&&(o?o(e,t.attribute,l):f&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=M?M.computeColor(I[P],R):c,e.fill())),g&&(s?s(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke()))):"outside"!==P&&"inside"!==P||("inside"===P&&(e.save(),e.beginPath(),e.arc(i,n,B,0,me,!0,O.top),e.clip()),e.beginPath(),function(t,e,i,n,r,a,o,s){var u=t.getParsedAngle(),l=u.startAngle,h=u.endAngle,c=ke(h-l),d=h>l,f=!1;if(o<=ve)e.moveTo(i,n,r);else if(c>=me-ve)e.moveTo(i+o*be(l),n+o*we(l),r),e.arc(i,n,o,l,h,!d,r),e.lineTo(i+o*be(h),n+o*we(h),a),e.arc(i,n,o,h,l,d,a);else{var v=s(l,h),p=v.innerouterDeltaAngle,g=v.innerouterStartAngle,y=v.innerouterEndAngle,m=o*be(g),k=o*we(g),_=o*be(y),b=o*we(y);p<.001?f=!0:(e.moveTo(i+m,n+k,r),e.arc(i,n,o,g,y,!d,r),e.lineTo(i+_,n+b,a),e.arc(i,n,o,y,g,d,a))}e.closePath()}(t,e,i,n,O.top,O.bottom,"outside"===P?C:B,(function(e,i){var n=t.getParsePadAngle(e,i),r=n.outerDeltaAngle,a=n.innerDeltaAngle,o=n.outerStartAngle,s=n.outerEndAngle,u=n.innerEndAngle,l=n.innerStartAngle;return"outside"===P?{innerouterDeltaAngle:r,innerouterEndAngle:s,innerouterStartAngle:o}:{innerouterDeltaAngle:a,innerouterEndAngle:u,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),p&&(o?o(e,t.attribute,l):f&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=M?M.computeColor(I[P],R):c,e.fill())),g&&(s?s(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),"inside"===P&&e.restore())}}},{key:"draw",value:function(t,e,i,n){var r=Rr(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}}])}(As);zv=Nv([L()],zv);var Uv=!1,Gv=new x((function(t){Uv||(Uv=!0,t(Sl).to(zv).inSingletonScope(),t(Tl).toService(Sl))})),Wv=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Vv=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="pyramid3d",t.numberType=po,t}return h(i,t),u(i,[{key:"drawShape",value:function(t,e,i,n,r,a,o,s){var u,l=Rr(t,null==a?void 0:a.theme).polygon,h=t.attribute,c=h.fill,d=void 0===c?l.fill:c,f=h.stroke,v=void 0===f?l.stroke:f,p=h.face,g=void 0===p?[!0,!0,!0,!0,!0,!0]:p,y=null!==(u=this.z)&&void 0!==u?u:0;if(this.valid(t,l,o,s)){var m=(r.stage||{}).light,k=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,i,n,l);var _=d;"string"!=typeof _&&(_="black"),this.fill(i,n,y,k,g,_,e,m,t,l,o)}!1!==v&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,y,k,e))}}},{key:"draw",value:function(t,e,i){var n=Rr(t).polygon;this._draw(t,n,!1,i)}}])}(Iv);Vv=Wv([L()],Vv);var Hv=!1,Kv=new x((function(t){Hv||(Hv=!0,t(Dl).to(Vv).inSingletonScope(),t(Tl).toService(Dl))}));function Xv(){qu.RegisterGraphicCreator("shadowRoot",Pd)}var Yv=function(){return u((function t(){o(this,t),this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=b.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}),[{key:"activate",value:function(t){var e=this;this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(function(i){i&&i===e.pluginService.stage&&e.drawHTML(t.stage.renderService)}))}},{key:"deactivate",value:function(t){var e=this;t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((function(t){return t.name!==e.key})),Vn.graphicService.hooks.onRemove.unTap(this.key),Vn.graphicService.hooks.onRelease.unTap(this.key),this.release()}},{key:"getWrapContainer",value:function(t,e,i){var n;return n=e?"string"==typeof e?Vn.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Vn.global.createDom(Object.assign({tagName:"div",parent:n},i)),nativeContainer:n}}},{key:"parseDefaultStyleFromGraphic",value:function(t){return function(t){var e={},i=function(t){return/^\d+(\.\d+)?$/.test("".concat(t))?"".concat(t,"px"):"".concat(t)};return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((function(i){t[i]&&(e[mi(i)]=t[i])})),["fontSize","lineHeight"].forEach((function(n){var r=mi(n);vt(t[n])||(e[r]=i(t[n]))})),pt(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&_t(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:Rr(t).text)}},{key:"getTransformOfText",value:function(t){var e=Rr(t).text,i=t.attribute,n=i.textAlign,r=void 0===n?e.textAlign:n,a=i.textBaseline,o=void 0===a?e.textBaseline:a,s=t.globalTransMatrix.toTransformAttrs(),u=s.rotateDeg,l=s.scaleX,h=s.scaleY,c={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},d={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:r,transform:"translate(".concat(c[r],",").concat(c[o],") rotate(").concat(u,"deg) scaleX(").concat(l,") scaleY(").concat(h,")"),transformOrigin:"".concat(d[r]," ").concat(d[o])}}},{key:"updateStyleOfWrapContainer",value:function(t,e,i,n,r){var a=r.pointerEvents,o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===a?"all":a||"none",i.style.position||(i.style.position="absolute",n.style.position="relative");var s=0,u=0,l=t.globalAABBBounds,h=r.anchorType;if(vt(h)&&(h="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===h&&(h="top-left"),"position"===h||l.empty()){var c=t.globalTransMatrix;s=c.e,u=c.f}else{var d=function(t,e){var i=t.x1,n=t.x2,r=t.y1,a=t.y2,o=Math.abs(n-i),s=Math.abs(a-r),u=(i+n)/2,l=(r+a)/2,h=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":h=-.5;break;case"right":case"inside-right":h=.5;break;case"top-right":h=.5,c=-.5;break;case"top-left":h=-.5,c=-.5;break;case"bottom-right":h=.5,c=.5;break;case"bottom-left":h=-.5,c=.5}return{x:u+=h*o,y:l+=c*s}}(l,h);s=d.x,u=d.y}var f=Vn.global.getElementTopLeft(n,!1),v=e.window.getTopLeft(!1),p=e.viewBox,g=s+v.left-f.left+p.x1,y=u+v.top-f.top+p.y1;if(o.left="".concat(g,"px"),o.top="".concat(y,"px"),"text"===t.type&&"position"===h&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),ft(r.style)){var m=r.style({top:y,left:g,width:l.width(),height:l.height()},t,i);m&&(o=Object.assign(Object.assign({},o),m))}else gt(r.style)?o=Object.assign(Object.assign({},o),r.style):_t(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),function(){var t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((function(e){if(e){var i=e.split(":");if(2===i.length){var n=i[0].trim(),r=i[1].trim();n&&r&&(t[n]=r)}}})),t}(r.style)));Vn.global.updateDom(i,{width:r.width,height:r.width,style:o})}},{key:"clearCacheContainer",value:function(){var t=this;this.htmlMap&&Object.keys(this.htmlMap).forEach((function(e){t.htmlMap[e]&&t.htmlMap[e].renderId!==t.renderId&&t.removeElement(e)})),this.renderId+=1}},{key:"drawHTML",value:function(t){var e=this;"browser"===Vn.global.env&&(t.renderTreeRoots.sort((function(t,e){var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Bn.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Bn.zIndex)})).forEach((function(t){e.renderGroupHTML(t)})),this.clearCacheContainer())}},{key:"renderGroupHTML",value:function(t){var e=this;this.renderGraphicHTML(t),t.forEachChildren((function(t){t.isContainer?e.renderGroupHTML(t):e.renderGraphicHTML(t)}))}},{key:"removeElement",value:function(t){if(this.htmlMap&&this.htmlMap[t]){var e=this.htmlMap[t].wrapContainer;e&&Vn.global.removeDom(e),this.htmlMap[t]=null}}},{key:"renderGraphicHTML",value:function(t){var e,i=t.attribute.html;if(i){var n=t.stage;if(n){var r=i.dom,a=i.container;if(r){var o=vt(i.id)?"".concat(null!==(e=t.id)&&void 0!==e?e:t._uid,"_react"):i.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])"string"==typeof r?this.htmlMap[o].wrapContainer.innerHTML=r:r!==this.htmlMap[o].wrapContainer.firstChild&&(this.htmlMap[o].wrapContainer.removeChild(this.htmlMap[o].wrapContainer.firstChild),this.htmlMap[o].wrapContainer.appendChild(r));else{var s=this.getWrapContainer(n,a),u=s.wrapContainer,l=s.nativeContainer;u&&("string"==typeof r?u.innerHTML=r:u.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[o]={wrapContainer:u,nativeContainer:l,container:a,renderId:this.renderId})}if(this.htmlMap&&this.htmlMap[o]){var h=this.htmlMap[o],c=h.wrapContainer,d=h.nativeContainer;this.updateStyleOfWrapContainer(t,n,c,d,i),this.htmlMap[o].renderId=this.renderId}}}}}},{key:"release",value:function(){"browser"===Vn.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}},{key:"removeAllDom",value:function(t){var e=this;this.htmlMap&&(Object.keys(this.htmlMap).forEach((function(t){e.removeElement(t)})),this.htmlMap=null)}}])}(),qv=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).name="ReactAttributePlugin",t.activeEvent="onRegister",t._uid=b.GenAutoIncrementId(),t.key=t.name+t._uid,t.htmlMap={},t}return h(i,t),u(i,[{key:"removeElement",value:function(t){if(this.htmlMap&&this.htmlMap[t]){var e=this.htmlMap[t],i=e.root,n=e.wrapContainer,r=e.unmount;i?Vn.global.getRequestAnimationFrame()((function(){i.unmount()})):r&&r(),n&&Vn.global.removeDom(n),this.htmlMap[t]=null}}},{key:"renderGraphicHTML",value:function(t){var e,i=t.attribute.react;if(i){var n=t.stage;if(n){var r=n.params.ReactDOM,a=i.element,o=i.container;if(a&&r&&(r.createRoot||r.render)){var s=vt(i.id)?"".concat(null!==(e=t.id)&&void 0!==e?e:t._uid,"_react"):i.id;if(this.htmlMap&&this.htmlMap[s]&&o&&o!==this.htmlMap[s].container&&this.removeElement(s),this.htmlMap&&this.htmlMap[s])r.createRoot?this.htmlMap[s].root.render(a):r.render(a,this.htmlMap[s].wrapContainer);else{var u=this.getWrapContainer(n,o),l=u.wrapContainer,h=u.nativeContainer;if(l)if(this.htmlMap||(this.htmlMap={}),r.createRoot){var c=r.createRoot(l);c.render(a),this.htmlMap[s]={root:c,wrapContainer:l,nativeContainer:h,container:o,renderId:this.renderId}}else r.render(a,l),this.htmlMap[s]={wrapContainer:l,nativeContainer:h,container:o,renderId:this.renderId,unmount:function(){r.unmountComponentAtNode(l)}}}if(this.htmlMap&&this.htmlMap[s]){var d=this.htmlMap[s],f=d.wrapContainer,v=d.nativeContainer;this.updateStyleOfWrapContainer(t,n,f,v,i),this.htmlMap[s].renderId=this.renderId}}}}}}])}(Yv),Zv=function(){return u((function t(){var e=this;o(this,t),this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=b.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!0,e.pageX=t.page.x,e.pageY=t.page.y)},this.onMouseUp=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!1)},this.onMouseMove=function(t){var i,n,r=e.pluginService.stage;if(e.option3d||(e.option3d=r.option3d),e.option3d&&e.mousedown)if(e.pageX&&e.pageY){var a=t.page.x-e.pageX,o=t.page.y-e.pageY;e.pageX=t.page.x,e.pageY=t.page.y;var s=a/100,u=o/100;e.option3d.alpha=(null!==(i=e.option3d.alpha)&&void 0!==i?i:0)+s,e.option3d.beta=(null!==(n=e.option3d.beta)&&void 0!==n?n:0)+u,r.set3dOptions(e.option3d),r.renderNextFrame()}else e.pageX=t.page.x,e.pageY=t.page.y}}),[{key:"activate",value:function(t){this.pluginService=t;var e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}},{key:"deactivate",value:function(t){var e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}])}(),Jv=new Oe,$v=function(){return u((function t(){o(this,t),this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=b.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new Oe}),[{key:"pauseLayout",value:function(t){this.pause=t}},{key:"tryLayoutChildren",value:function(t){t.firstChild&&this.tryLayout(t.firstChild)}},{key:"tryLayout",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.pause){var n=t.parent;if(i||n&&t.needUpdateLayout()){var r=Rr(n).group,a=n.attribute.display;if("flex"===(void 0===a?r.display:a)){var o=n.attribute,s=o.flexDirection,u=void 0===s?r.flexDirection:s,l=o.flexWrap,h=void 0===l?r.flexWrap:l,c=o.alignItems,d=void 0===c?r.alignItems:c,f=o.clip,v=void 0===f?r.clip:f,p=n.attribute.alignContent,g=void 0===p?null!=d?d:r.alignContent:p,y=n.attribute,m=y.width,k=y.height,_=y.justifyContent,b=void 0===_?r.justifyContent:_,x=n.getChildren();if(null==m||null==k){var S=0,w=0,A=0;if(x.forEach((function(t){var i=e.getAABBBounds(t);i.empty()||("column"===u||"column-reverse"===u?(w+=i.height(),S=Math.max(S,i.width())):(S+=i.width(),w=Math.max(w,i.height())),A+=i.x1,A+=i.y1,A+=i.x2,A+=i.y2)})),!isFinite(A))return;m=S,k=w}null==n.attribute.width?n.attribute.width=m:m=n.attribute.width,null==n.attribute.height?n.attribute.height=k:k=n.attribute.height,this.tempBounds.copy(n._AABBBounds);var T={main:{len:m,field:"x"},cross:{len:k,field:"y"}},C=T.main,E=T.cross;"column"!==u&&"column-reverse"!==u||(C.len=k,E.len=m,C.field="y",E.field="x"),"row-reverse"!==u&&"column-reverse"!==u||("flex-start"===b?b="flex-end":"flex-end"===b?b="flex-start":x.reverse());var B=0,R=0,M=[];x.forEach((function(t){var i=e.getAABBBounds(t);if(!i.empty()){var n="x"===C.field?i.width():i.height(),r="x"===E.field?i.width():i.height();M.push({mainLen:n,crossLen:r}),B+=n,R=Math.max(R,r)}}));var P=[];if(B>C.len&&"wrap"===h){var O=0,I=0;M.forEach((function(t,e){var i=t.mainLen,n=t.crossLen;O+i>C.len?0===O?(P.push({idx:e,mainLen:O+i,crossLen:n}),O=0,I=0):(P.push({idx:e-1,mainLen:O,crossLen:I}),O=i,I=n):(O+=i,I=Math.max(I,n))})),P.push({idx:M.length-1,mainLen:O,crossLen:I})}else P.push({idx:M.length-1,mainLen:B,crossLen:R});var L=0;if(P.forEach((function(t){e.layoutMain(n,x,b,C,M,L,t),L=t.idx+1})),R=P.reduce((function(t,e){return t+e.crossLen}),0),1===P.length){var D={"flex-start":0,"flex-end":E.len,center:E.len/2};this.layoutCross(x,d,E,D,M,P[0],0)}else if("flex-start"===g){L=0;var F=0;P.forEach((function(t,i){var n={"flex-start":F,"flex-end":F+t.crossLen,center:F+t.crossLen/2};e.layoutCross(x,"flex-start",E,n,M,P[i],L),L=t.idx+1,F+=t.crossLen}))}else if("center"===g){L=0;var j=Math.max(0,(E.len-R)/2);P.forEach((function(t,i){var n={"flex-start":j,"flex-end":j+t.crossLen,center:j+t.crossLen/2};e.layoutCross(x,"center",E,n,M,P[i],L),L=t.idx+1,j+=t.crossLen}))}else if("space-around"===g){L=0;var N=Math.max(0,(E.len-R)/P.length/2),z=N;P.forEach((function(t,i){var n={"flex-start":z,"flex-end":z+t.crossLen,center:z+t.crossLen/2};e.layoutCross(x,"flex-start",E,n,M,P[i],L),L=t.idx+1,z+=t.crossLen+2*N}))}else if("space-between"===g){L=0;var U=Math.max(0,(E.len-R)/(2*P.length-2)),G=0;P.forEach((function(t,i){var n={"flex-start":G,"flex-end":G+t.crossLen,center:G+t.crossLen/2};e.layoutCross(x,"flex-start",E,n,M,P[i],L),L=t.idx+1,G+=t.crossLen+2*U}))}x.forEach((function(t,e){t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),n.addUpdateLayoutTag();var W=this.getAABBBounds(n);v||this.tempBounds.equals(W)||this.tryLayout(n,!1)}}}}},{key:"getAABBBounds",value:function(t){this.skipBoundsTrigger=!0;var e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}},{key:"updateChildPos",value:function(t,e,i){return t+(null!=e?e:0)-i}},{key:"layoutMain",value:function(t,e,i,n,r,a,o){if("flex-start"===i)for(var s=0,u=a;u<=o.idx;u++){var l=s+(e[u],n.field,0),h=this.getAABBBounds(e[u]);!h.empty()&&(e[u].attribute[n.field]=this.updateChildPos(l,e[u].attribute[n.field],h["".concat(n.field,"1")])),s+=r[u].mainLen}else if("flex-end"===i)for(var c=n.len,d=o.idx;d>=a;d--){var f=(c-=r[d].mainLen)+(e[d],n.field,0),v=this.getAABBBounds(e[d]);!v.empty()&&(e[d].attribute[n.field]=this.updateChildPos(f,e[d].attribute[n.field],v["".concat(n.field,"1")]))}else if("space-around"===i)if(o.mainLen>=n.len)for(var p=0,g=a;g<=o.idx;g++){var y=p+(e[g],n.field,0),m=this.getAABBBounds(e[g]);!m.empty()&&(e[g].attribute[n.field]=this.updateChildPos(y,e[g].attribute[n.field],m["".concat(n.field,"1")])),p+=r[g].mainLen}else for(var k=o.idx-a+1,_=(n.len-o.mainLen)/k/2,b=_,x=a;x<=o.idx;x++){var S=b+(e[x],n.field,0),w=this.getAABBBounds(e[x]);!w.empty()&&(e[x].attribute[n.field]=this.updateChildPos(S,e[x].attribute[n.field],w["".concat(n.field,"1")])),b+=r[x].mainLen+2*_}else if("space-between"===i)if(o.mainLen>=n.len)for(var A=0,T=a;T<=o.idx;T++){var C=A+(e[T],n.field,0),E=this.getAABBBounds(e[T]);!E.empty()&&(e[T].attribute[n.field]=this.updateChildPos(C,e[T].attribute[n.field],E["".concat(n.field,"1")])),A+=r[T].mainLen}else for(var B=o.idx-a+1,R=(n.len-o.mainLen)/(2*B-2),M=0,P=a;P<=o.idx;P++){var O=M+(e[P],n.field,0),I=this.getAABBBounds(e[P]);!I.empty()&&(e[P].attribute[n.field]=this.updateChildPos(O,e[P].attribute[n.field],I["".concat(n.field,"1")])),M+=r[P].mainLen+2*R}else if("center"===i)for(var L=(n.len-o.mainLen)/2,D=a;D<=o.idx;D++){var F=L+(e[D],n.field,0),j=this.getAABBBounds(e[D]);!j.empty()&&(e[D].attribute[n.field]=this.updateChildPos(F,e[D].attribute[n.field],j["".concat(n.field,"1")])),L+=r[D].mainLen}}},{key:"layoutCross",value:function(t,e,i,n,r,a,o){for(var s,u=o;u<=a.idx;u++){var l=t[u],h=l.attribute.alignSelf;h&&"auto"!==h||(h=e);var c=this.getAABBBounds(l),d=null!==(s=n[h])&&void 0!==s?s:n["flex-start"];"flex-end"===h?!c.empty()&&(l.attribute[i.field]=this.updateChildPos(d-r[u].crossLen+(i.field,0),l.attribute[i.field],c["".concat(i.field,"1")])):"center"===h?!c.empty()&&(l.attribute[i.field]=this.updateChildPos(d-r[u].crossLen/2+(i.field,0),l.attribute[i.field],c["".concat(i.field,"1")])):!c.empty()&&(l.attribute[i.field]=this.updateChildPos(d+(i.field,0),l.attribute[i.field],c["".concat(i.field,"1")]))}}},{key:"activate",value:function(t){var e=this;this.pluginService=t,Vn.graphicService.hooks.onAttributeUpdate.tap(this.key,(function(t){t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===e.pluginService.stage&&e.tryLayout(t,!1)})),Vn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(function(t,i,n,r){t.glyphHost&&(t=t.glyphHost),i&&i===e.pluginService.stage&&t.isContainer&&!e.skipBoundsTrigger&&Jv.copy(r)})),Vn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(function(t,i,n,r,a){i&&i===e.pluginService.stage&&t.isContainer&&!e.skipBoundsTrigger&&(Jv.equals(n)||e.tryLayout(t,!1))})),Vn.graphicService.hooks.onSetStage.tap(this.key,(function(t){t.glyphHost&&(t=t.glyphHost),e.tryLayout(t,!1)}))}},{key:"deactivate",value:function(t){var e=this;Vn.graphicService.hooks.onAttributeUpdate.taps=Vn.graphicService.hooks.onAttributeUpdate.taps.filter((function(t){return t.name!==e.key})),Vn.graphicService.hooks.beforeUpdateAABBBounds.taps=Vn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),Vn.graphicService.hooks.afterUpdateAABBBounds.taps=Vn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),Vn.graphicService.hooks.onSetStage.taps=Vn.graphicService.hooks.onSetStage.taps.filter((function(t){return t.name!==e.key}))}}])}();var Qv=Symbol.for("MathPickerContribution"),tp=Symbol.for("MathArcPicker"),ep=Symbol.for("MathAreaPicker"),ip=Symbol.for("MathCirclePicker"),np=Symbol.for("MathImagePicker"),rp=Symbol.for("MathLinePicker"),ap=Symbol.for("MathPathPicker"),op=Symbol.for("MathRectPicker"),sp=Symbol.for("MathSymbolPicker"),up=Symbol.for("MathTextPicker"),lp=Symbol.for("MathPolygonPicker"),hp=Symbol.for("MathGlyphPicker"),cp=Symbol.for("CanvasArcPicker"),dp=Symbol.for("CanvasArc3dPicker"),fp=Symbol.for("CanvasAreaPicker"),vp=Symbol.for("CanvasCirclePicker"),pp=Symbol.for("CanvasImagePicker"),gp=Symbol.for("CanvasLinePicker"),yp=Symbol.for("CanvasPathPicker"),mp=Symbol.for("CanvasRectPicker"),kp=Symbol.for("CanvasRect3dPicker"),_p=Symbol.for("CanvasSymbolPicker"),bp=Symbol.for("CanvasTextPicker"),xp=Symbol.for("CanvasPolygonPicker"),Sp=Symbol.for("CanvasPyramid3dPicker"),wp=Symbol.for("CanvasRichTextPicker"),Ap=Symbol.for("CanvasGlyphPicker"),Tp=Symbol.for("CanvasGroupPicker"),Cp=Symbol.for("CanvasPickerContribution"),Ep=function(t,e){var i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},Bp=function(t,e){var i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)},Rp=function(t){function i(t){var n,r,a,s,u,l,h,c,d,v,p,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,i),(n=e(this,i)).cachedEvents=[],n.startPoints=[],n.processEvent={},n.throttleTimer=0,n.emitThrottles=[],n.lastTapTarget=null,n.onStart=function(t){n.reset(),n.startTime=jr.now();var e=f(n),i=e.cachedEvents,r=e.startPoints;t&&i.push(t.clone()),r.length=i.length;for(var a=0;a<i.length;a++){var o=i[a],s={x:o.x,y:o.y};r[a]=s}if(1!==r.length)n.startDistance=Bp(r[0],r[1]),n.center=function(t){var e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};for(var i=0,n=0,r=0;r<e;)i+=t[r].x,n+=t[r].y,r++;return{x:Math.round(i/e),y:Math.round(n/e)}}([r[0],r[1]]);else{var u=i[0];n.pressTimeout=setTimeout((function(){u.direction="none",u.deltaX=0,u.deltaY=0,u.points=r,n.triggerStartEvent("press",u),n.triggerEvent("press",u),n.eventType="press",n.direction="none"}),n.config.press.time)}},n.onMove=function(t){n.clearPressTimeout();var e=f(n),i=e.startPoints,r=e.cachedEvents;if(i.length){for(var a=t.clone(),o=a.x,s=a.y,u=a.pointerId,l=0,h=r.length;l<h;l++)if(u===r[l].pointerId){r[l]=a;break}var c={x:o,y:s},d=r.map((function(t){return{x:t.x,y:t.y}})),v=jr.now();if(n.prevMoveTime=n.lastMoveTime,n.prevMovePoint=n.lastMovePoint,n.lastMoveTime=v,n.lastMovePoint=c,1===i.length){var p=i[0],g=o-p.x,y=s-p.y,m=n.direction||Ep(p,c);n.direction=m;var k=n.getEventType(c);return a.direction=m,a.deltaX=g,a.deltaY=y,a.points=d,n.triggerStartEvent(k,a),void n.triggerEvent(k,a)}var _=f(n).startDistance,b=Bp(d[0],d[1]);a.scale=b/_,a.center=n.center,a.points=d,n.triggerStartEvent("pinch",a),n.triggerEvent("pinch",a)}},n.onEnd=function(t){var e=t.clone(),i=f(n),r=i.cachedEvents,a=i.startPoints,o=r.map((function(t){return{x:t.x,y:t.y}}));if(e.points=o,n.triggerEndEvent(e),1===r.length){var s=jr.now(),u=n.lastMoveTime;if(s-u<100){var l=u-(n.prevMoveTime||n.startTime);if(l>0){var h=n.prevMovePoint||a[0],c=n.lastMovePoint||a[0],d=Bp(h,c),v=d/l;v>n.config.swipe.velocity&&d>n.config.swipe.threshold&&(e.velocity=v,e.direction=Ep(h,c),n.triggerEvent("swipe",e))}}s-n.lastTapTime<n.config.tap.interval&&t.target===n.lastTapTarget?n.tapCount++:n.tapCount=1,n.lastTapTime=s,n.lastTapTarget=t.target,1===n.tapCount?n.triggerEvent("tap",e):2===n.tapCount&&(n.triggerEvent("doubletap",e),n.tapCount=0)}for(var p=0,g=r.length;p<g;p++)if(r[p].pointerId===e.pointerId){r.splice(p,1),a.splice(p,1);break}n.reset(),r.length>0&&n.onStart()},n.element=t,n.tapCount=0,n.lastTapTime=0,n.config={press:{time:null!==(a=null===(r=null==g?void 0:g.press)||void 0===r?void 0:r.time)&&void 0!==a?a:251,threshold:null!==(u=null===(s=null==g?void 0:g.press)||void 0===s?void 0:s.threshold)&&void 0!==u?u:9},swipe:{threshold:null!==(h=null===(l=null==g?void 0:g.swipe)||void 0===l?void 0:l.threshold)&&void 0!==h?h:10,velocity:null!==(d=null===(c=null==g?void 0:g.swipe)||void 0===c?void 0:c.velocity)&&void 0!==d?d:.3},tap:{interval:null!==(p=null===(v=null==g?void 0:g.tap)||void 0===v?void 0:v.interval)&&void 0!==p?p:300}},n.initEvents(),n}return h(i,t),u(i,[{key:"initEvents",value:function(){var t=this.element;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}},{key:"removeEvents",value:function(){var t=this.element;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}},{key:"release",value:function(){this.removeEvents(),this.element=null}},{key:"getEventType",value:function(t){var e,i=this.eventType,n=this.startTime,r=this.startPoints;return i||(e=jr.now()-n>this.config.press.time&&Bp(r[0],t)<this.config.press.threshold?"press":"pan",this.eventType=e,e)}},{key:"enable",value:function(t){this.processEvent[t]=!0}},{key:"isProcess",value:function(t){return this.processEvent[t]}},{key:"pushEvent",value:function(t,e){for(var i=this.emitThrottles,n={type:t,ev:e},r=0,a=i.length;r<a;r++)if(i[r].type===t)return void i.splice(r,1,n);i.push(n)}},{key:"clearPressTimeout",value:function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}},{key:"reset",value:function(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}},{key:"triggerEvent",value:function(t,e){var i=this;this.pushEvent(t,e);var n=this.throttleTimer,r=this.emitThrottles;n||(this.throttleTimer=Vn.global.getRequestAnimationFrame()((function(){for(var t=0,e=r.length;t<e;t++){var n=r[t],a=n.type,o=n.ev;i.emitEvent(a,o)}i.throttleTimer=0,i.emitThrottles.length=0})))}},{key:"triggerStartEvent",value:function(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent("".concat(t,"start"),e))}},{key:"triggerEndEvent",value:function(t){var e=this,i=this.processEvent;Object.keys(i).forEach((function(n){e.triggerEvent("".concat(n,"end"),t),"press"===n&&e.triggerEvent("".concat(n,"up"),t),delete i[n]}))}},{key:"emitEvent",value:function(t,e){var i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(var n=0,r=i.length;n<r&&!e.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,e,t);this.emit(t,e)}}])}(ht),Mp=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Pp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Op=[0,0,0],Ip=function(){return u((function t(e,i){o(this,t),this.fillAttributes=Object.assign(Object.assign({},Sn),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},An),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Tn),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;var n=e.nativeCanvas.getContext("2d");if(!n)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=n,this.canvas=e,this.matrix=new De(1,0,0,1,0,0),this.stack=[],this.dpr=i,this.applyedMatrix=new De(1,0,0,1,0,0),this._clearMatrix=new De(1,0,0,1,0,0),this.baseGlobalAlpha=1}),[{key:"fillStyle",get:function(){return this.nativeContext.fillStyle},set:function(t){this.nativeContext.fillStyle=t}},{key:"font",get:function(){return this.nativeContext.font},set:function(t){this.nativeContext.font=t}},{key:"globalAlpha",get:function(){return this.nativeContext.globalAlpha},set:function(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}},{key:"lineCap",get:function(){return this.nativeContext.lineCap},set:function(t){this.nativeContext.lineCap=t}},{key:"lineDashOffset",get:function(){return this.nativeContext.lineDashOffset},set:function(t){this.nativeContext.lineDashOffset=t}},{key:"lineJoin",get:function(){return this.nativeContext.lineJoin},set:function(t){this.nativeContext.lineJoin=t}},{key:"lineWidth",get:function(){return this.nativeContext.lineWidth},set:function(t){this.nativeContext.lineWidth=t}},{key:"miterLimit",get:function(){return this.nativeContext.miterLimit},set:function(t){this.nativeContext.miterLimit=t}},{key:"shadowBlur",get:function(){return this.nativeContext.shadowBlur},set:function(t){this.nativeContext.shadowBlur=t}},{key:"shadowColor",get:function(){return this.nativeContext.shadowColor},set:function(t){this.nativeContext.shadowColor=t}},{key:"shadowOffsetX",get:function(){return this.nativeContext.shadowOffsetX},set:function(t){this.nativeContext.shadowOffsetX=t}},{key:"shadowOffsetY",get:function(){return this.nativeContext.shadowOffsetY},set:function(t){this.nativeContext.shadowOffsetY=t}},{key:"strokeStyle",get:function(){return this.nativeContext.strokeStyle},set:function(t){this.nativeContext.strokeStyle=t}},{key:"textAlign",get:function(){return this.nativeContext.textAlign},set:function(t){this.nativeContext.textAlign=t}},{key:"textBaseline",get:function(){return this.nativeContext.textBaseline},set:function(t){this.nativeContext.textBaseline=t}},{key:"inuse",get:function(){return!!this._inuse},set:function(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}},{key:"reset",value:function(){this.stack.length&&te.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new De(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getContext",value:function(){return this.nativeContext}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return ys.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}},{key:"restore",value:function(){this.nativeContext.restore(),this.stack.length>0&&(ys.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(ys.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,i,n){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,i,n,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(s*t,s*e,s*i,s*n,s*r,s*a),o&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}},{key:"transform",value:function(t,e,i,n,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,a),o&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t*Math.PI/180;this.rotate(i,e)}},{key:"rotateAbout",value:function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.disableBeginPath||this.nativeContext.beginPath()}},{key:"clip",value:function(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}},{key:"arc",value:function(t,e,i,n,r,a,o){if(o=o||0,this.camera){var s=[];!function(t,e,i,n,r,a,o,s){if(s)for(;i>e;)i-=me;else for(;i<e;)i+=me;for(var u=pe/3*(i>e?1:-1),l=e,h=l;h!==i;){h=u>0?Math.min(h+u,i):Math.max(h+u,i);var c=Math.abs(h-l),d=4*Math.tan(c/4)/3,f=h<l?-1:1,v=Math.cos(l),p=Math.sin(l),g=Math.cos(h),y=Math.sin(h),m=v*a+n,k=p*o+r,_=g*a+n,b=y*o+r,x=a*d*f,S=o*d*f;t.push([m-x*p,k+S*v,_+x*y,b-S*g,_,b]),l=h}}(s,n,r,t,e,i,i,a);for(var u=0;u<s.length;++u){var l=s[u];this.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5],o)}}else this.nativeContext.arc(t,e,i,n,r,a)}},{key:"arcTo",value:function(t,e,i,n,r){this.nativeContext.arcTo(t,e,i,n,r)}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a,o){if(o=o||0,this.camera){var s=o,u=o;this.modelMatrix&&(vs(Op,[t,e,o],this.modelMatrix),t=Op[0],e=Op[1],s=Op[2],vs(Op,[i,n,o],this.modelMatrix),i=Op[0],n=Op[1],u=Op[2],vs(Op,[r,a,o],this.modelMatrix),r=Op[0],a=Op[1],o=Op[2]);var l=this.camera.vp(r,a,o);r=l.x,a=l.y,t=(l=this.camera.vp(t,e,s)).x,e=l.y,i=(l=this.camera.vp(i,n,u)).x,n=l.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,a)}},{key:"closePath",value:function(){this.nativeContext.closePath()}},{key:"ellipse",value:function(t,e,i,n,r,a,o,s){null==s?this.nativeContext.ellipse(t,e,i,n,r,a,o):this.nativeContext.ellipse(t,e,i,n,r,a,o,s)}},{key:"lineTo",value:function(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(vs(Op,[t,e,i],this.modelMatrix),t=Op[0],e=Op[1],i=Op[2]);var n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.lineTo(t,e)}},{key:"moveTo",value:function(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(vs(Op,[t,e,i],this.modelMatrix),t=Op[0],e=Op[1],i=Op[2]);var n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,i,n,r){if(r=r||0,this.camera){var a=r;this.modelMatrix&&(vs(Op,[t,e,r],this.modelMatrix),t=Op[0],e=Op[1],a=Op[2],vs(Op,[i,n,r],this.modelMatrix),i=Op[0],n=Op[1],r=Op[2]);var o=this.camera.vp(i,n,r);i=o.x,n=o.y,t=(o=this.camera.vp(t,e,a)).x,e=o.y}this.nativeContext.quadraticCurveTo(t,e,i,n)}},{key:"rect",value:function(t,e,i,n,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+i,e,r),this.lineTo(t+i,e+n,r),this.lineTo(t,e+n,r),this.closePath()):this.nativeContext.rect(t,e,i,n)}},{key:"createImageData",value:function(){var t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}},{key:"createLinearGradient",value:function(t,e,i,n){return this.nativeContext.createLinearGradient(t,e,i,n)}},{key:"createPattern",value:function(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}},{key:"createRadialGradient",value:function(t,e,i,n,r,a){return this.nativeContext.createRadialGradient(t,e,i,n,r,a)}},{key:"createConicGradient",value:function(t,e,i,n){var r,a=!1,o=this;return{stops:[],addColorStop:function(t,e){this.stops.push([t,e]),a=!0},GetPattern:function(s,u,l){return a&&(l||(l=n-i),r=function(t,e,i,n,r,a,o,s,u){var l=Math.floor(180*r/Math.PI),h=Yo.GetCanvas(),c=Yo.GetCtx();if(!c)return null;var d=Zo.GetSize(s),f=Zo.GetSize(u),v=Zo.Get(e,i,n,a,o,d,f);if(v)return v;var p=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(f-n,2),Math.pow(i,2)+Math.pow(f-n,2)))),g=l+1,y=r/Math.max(1,g-1),m=qo.getInstance().GetOrCreate(i,n,d,f,e,g),k=2*Math.PI*p/360;h.width=d,h.height=f,c.setTransform(1,0,0,1,0,0),c.clearRect(0,0,d,f),c.translate(i,n),c.rotate(a);for(var _=0,b=g-1;_<b&&!(a+_*y>o);_++){var x=m.getColor(_);c.beginPath(),c.rotate(y),c.moveTo(0,0),c.lineTo(p,-2*k),c.lineTo(p,0),c.fillStyle=x,c.closePath(),c.fill()}var S=c.getImageData(0,0,d,f);return h.width=S.width,h.height=S.height,c.putImageData(S,0,0),(v=t.createPattern(h,"no-repeat"))&&Zo.Set(e,i,n,a,o,v,d,f),v}(o,this.stops,t,e,l,i,n,s,u),a=!1),r}}}},{key:"fill",value:function(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}},{key:"fillRect",value:function(t,e,i,n){this.nativeContext.fillRect(t,e,i,n)}},{key:"clearRect",value:function(t,e,i,n){this.nativeContext.clearRect(t,e,i,n)}},{key:"project",value:function(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(vs(Op,[t,e,i],this.modelMatrix),t=Op[0],e=Op[1],i=Op[2]);var n=this.camera.vp(t,e,i);t=n.x,e=n.y}return{x:t,y:e}}},{key:"view",value:function(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(vs(Op,[t,e,i],this.modelMatrix),t=Op[0],e=Op[1],i=Op[2]),this.camera.view(t,e,i)):[t,e,i]}},{key:"fillText",value:function(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(vs(Op,[e,i,n],this.modelMatrix),e=Op[0],i=Op[1],n=Op[2]);var r=this.camera.vp(e,i,n);e=r.x,i=r.y}this.nativeContext.fillText(t,e,i)}},{key:"getImageData",value:function(t,e,i,n){return this.nativeContext.getImageData(t,e,i,n)}},{key:"getLineDash",value:function(){return this.nativeContext.getLineDash()}},{key:"isPointInPath",value:function(t,e){return this.nativeContext.isPointInPath(t,e)}},{key:"isPointInStroke",value:function(t,e){return this.nativeContext.isPointInStroke(t,e)}},{key:"measureText",value:function(t){var e,i,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vn.global.measureTextMethod;if(!r||"native"===r)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=Vn.graphicUtil.createTextMeasureInstance({},{},(function(){return n.canvas.nativeCanvas})));var a=null!==(e=this.fontFamily)&&void 0!==e?e:Tn.fontFamily,o=null!==(i=this.fontSize)&&void 0!==i?i:Tn.fontSize;return this.mathTextMeasure.textSpec.fontFamily===a&&this.mathTextMeasure.textSpec.fontSize===o||(this.mathTextMeasure.textSpec.fontFamily=a,this.mathTextMeasure.textSpec.fontSize=o,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,r)}},{key:"putImageData",value:function(t,e,i){this.nativeContext.putImageData(t,e,i)}},{key:"setLineDash",value:function(t){var e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}},{key:"stroke",value:function(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}},{key:"strokeRect",value:function(t,e,i,n){this.nativeContext.strokeRect(t,e,i,n)}},{key:"strokeText",value:function(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(vs(Op,[e,i,n],this.modelMatrix),e=Op[0],i=Op[1],n=Op[2]);var r=this.camera.vp(e,i,n);e=r.x,i=r.y}this.nativeContext.strokeText(t,e,i)}},{key:"drawImage",value:function(){var t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}},{key:"setCommonStyle",value:function(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,i,n,r[0]);var a=Object.create(r[0]);return r.forEach((function(t,e){0!==e&&Object.assign(a,t)})),this._setCommonStyle(t,e,i,n,a)}return this._setCommonStyle(t,e,i,n,r)}},{key:"_setCommonStyle",value:function(t,e,i,n,r){var a=this.nativeContext;r||(r=this.fillAttributes);var o=e.fillOpacity,s=void 0===o?r.fillOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u,h=e.fill,c=void 0===h?r.fill:h;a.globalAlpha=s*l*this.baseGlobalAlpha,s>1e-12&&l>1e-12&&(a.fillStyle=Bs(this,c,t,i,n))}},{key:"setShadowBlendStyle",value:function(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);var n=Object.create(i[0]);return i.forEach((function(t,e){0!==e&&Object.assign(n,t)})),this._setShadowBlendStyle(t,e,n)}return this._setShadowBlendStyle(t,e,i)}},{key:"_setShadowBlendStyle",value:function(t,e,i){var n=this.nativeContext;i||(i=this.fillAttributes);var r=e.opacity,a=void 0===r?i.opacity:r,o=e.shadowBlur,s=void 0===o?i.shadowBlur:o,u=e.shadowColor,l=void 0===u?i.shadowColor:u,h=e.shadowOffsetX,c=void 0===h?i.shadowOffsetX:h,d=e.shadowOffsetY,f=void 0===d?i.shadowOffsetY:d,v=e.blur,p=void 0===v?i.blur:v,g=e.globalCompositeOperation,y=void 0===g?i.globalCompositeOperation:g;a<=1e-12||(s||c||f?(n.shadowBlur=s*this.dpr,n.shadowColor=l,n.shadowOffsetX=c*this.dpr,n.shadowOffsetY=f*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),p?(n.filter="blur(".concat(p,"px)"),this._clearFilterStyle=!0):this._clearFilterStyle&&(n.filter="blur(0px)",this._clearFilterStyle=!1),y?(n.globalCompositeOperation=y,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(n.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}},{key:"setStrokeStyle",value:function(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,i,n,r[0]);var a=Object.create(r[0]);return r.forEach((function(t,e){0!==e&&Object.assign(a,t)})),this._setStrokeStyle(t,e,i,n,a)}return this._setStrokeStyle(t,e,i,n,r)}},{key:"_setStrokeStyle",value:function(t,e,i,n,r){var a=this.nativeContext;r||(r=this.strokeAttributes);var o=e.strokeOpacity,s=void 0===o?r.strokeOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u;if(a.globalAlpha=s*l*this.baseGlobalAlpha,s>1e-12&&l>1e-12){var h=e.lineWidth,c=void 0===h?r.lineWidth:h,d=e.stroke,f=void 0===d?r.stroke:d,v=e.lineJoin,p=void 0===v?r.lineJoin:v,g=e.lineDash,y=void 0===g?r.lineDash:g,m=e.lineCap,k=void 0===m?r.lineCap:m,_=e.miterLimit,b=void 0===_?r.miterLimit:_;a.lineWidth=Es(this,c,this.dpr),a.strokeStyle=Bs(this,f,t,i,n),a.lineJoin=p,y&&a.setLineDash(y),a.lineCap=k,a.miterLimit=b}}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e,i){var n=this.nativeContext;e||(e=this.textAttributes);var r=t.scaleIn3d,a=void 0===r?e.scaleIn3d:r;t.font?n.font=t.font:n.font=ti(t,e,a&&this.camera&&this.camera.getProjectionScale(i));var o=t.fontFamily,s=void 0===o?e.fontFamily:o,u=t.fontSize,l=void 0===u?e.fontSize:u;this.fontFamily=s,this.fontSize=l,n.textAlign="left",n.textBaseline="alphabetic"}},{key:"setTextStyle",value:function(t,e,i){var n,r,a=this.nativeContext;e||(e=this.textAttributes),t.font?a.font=t.font:a.font=ti(t,e,this.camera&&this.camera.getProjectionScale(i));var o=t.fontFamily,s=void 0===o?e.fontFamily:o,u=t.fontSize,l=void 0===u?e.fontSize:u;this.fontFamily=s,this.fontSize=l,a.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,a.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}},{key:"setClearMatrix",value:function(t,e,i,n,r,a){this._clearMatrix.setValue(t,e,i,n,r,a)}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}},{key:"release",value:function(){this.stack.forEach((function(t){return ys.free(t)})),this.stack.length=0}}])}();Ip.env="browser",Ip=Mp([L(),Pp("design:paramtypes",[Object,Number])],Ip);var Lp=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Dp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fp=function(t){function i(t){return o(this,i),e(this,i,[t])}return h(i,t),u(i,[{key:"init",value:function(t){var e=t.container;if("string"==typeof e){var i=Vn.global.getElementById(e);i&&(this._container=i)}else this._container=e;this._context=new Ip(this,this._dpr),this.initStyle()}},{key:"initStyle",value:function(){if(this.controled){var t=this.nativeCanvas;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}}},{key:"hide",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}},{key:"show",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}},{key:"applyPosition",value:function(){var t=this._nativeCanvas;t.style.position="absolute",t.style.top="".concat(this._y,"px"),t.style.left="".concat(this._x,"px")}},{key:"resetStyle",value:function(t){if(this.controled){var e=t.width,i=void 0===e?this._displayWidth:e,n=t.height,r=void 0===n?this._displayHeight:n,a=t.dpr,o=void 0===a?this._dpr:a,s=t.x,u=void 0===s?this._x:s,l=t.y,h=void 0===l?this._y:l,c=this.nativeCanvas;c.width=i*o,c.height=r*o,!c.style||this.setCanvasStyle(c,u,h,i,r),t.id&&(c.id=t.id),this.visiable||this.hide()}}},{key:"setCanvasStyle",value:function(t,e,i,n,r){this.controled&&(t.style.width="".concat(n,"px"),t.style.height="".concat(r,"px"))}},{key:"toDataURL",value:function(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}},{key:"resize",value:function(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width="".concat(t,"px"),this._nativeCanvas.style.height="".concat(e,"px")),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}}])}(Uf);function jp(t,e){return new x((function(i){i(sr).toDynamicValue((function(){return function(e){return new t(e)}})).whenTargetNamed(t.env),i(ur).toDynamicValue((function(){return function(t,i){return new e(t,i)}})).whenTargetNamed(e.env)}))}Fp.env="browser";var Np=jp(Fp=Lp([L(),Dp("design:paramtypes",[Object])],Fp),Ip),zp=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Up=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gp=function(t,e){return function(i,n){e(i,n,t)}},Wp=function(t){function i(t,n,r){var a;return o(this,i),(a=e(this,i,[r])).contributions=t,a.drawContribution=n,a.pickItemInterceptorContributions=r,a.global.hooks.onSetEnv.tap("canvas-picker-service",(function(t,e,i){a.configure(i,e)})),a.configure(a.global,a.global.env),a.pickerMap=new Map,a.init(),a}return h(i,t),u(i,[{key:"init",value:function(){var t=this;this.contributions.getContributions().forEach((function(e){t.pickerMap.set(e.numberType,e)})),p(c(i.prototype),"_init",this).call(this)}},{key:"configure",value:function(t,e){this.pickCanvas=cr.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}},{key:"pickItem",value:function(t,e,i,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(var r=0;r<this.InterceptorContributions.length;r++){var a=this.InterceptorContributions[r];if(a.beforePickItem){var o=a.beforePickItem(t,this,e,n,{parentMatrix:i});if(o)return o}}var s=this.pickerMap.get(t.numberType);if(!s)return null;var u=s.contains(t,e,n),l=u?t:null,h={graphic:l,params:u};if(l)return h;if(this.InterceptorContributions.length)for(var c=0;c<this.InterceptorContributions.length;c++){var d=this.InterceptorContributions[c];if(d.afterPickItem){var f=d.afterPickItem(t,this,e,n,{parentMatrix:i});if(f)return f}}return h}}])}(tv);Wp=zp([L(),Gp(0,O($)),Gp(0,D(Cp)),Gp(1,O(Nl)),Gp(2,O($)),Gp(2,D(Id)),Up("design:paramtypes",[Object,Object,Object])],Wp);var Vp=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Hp=function(){return u((function t(){o(this,t),this.type="group",this.numberType=lo}),[{key:"contains",value:function(t,e,i){return!1}}])}();Hp=Vp([L()],Hp);var Kp=new x((function(t,e,i,n){Kp.__vloaded||(Kp.__vloaded=!0,t(Tp).to(Hp).inSingletonScope(),t(Cp).toService(Tp),tt(t,Cp))}));Kp.__vloaded=!1;var Xp=Kp,Yp=new x((function(t,e,i,n){i(Wp)||t(Wp).toSelf().inSingletonScope(),i(nh)?n(nh).toService(Wp):t(nh).toService(Wp)}));var qp,Zp=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Jp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$p=qp=function(t){function i(){var t;return o(this,i),(t=e(this,i)).type="browser",t._canvasIsIntersecting=!0,t.global=Vn.global,t.viewBox=new Oe,t.modelMatrix=new De(1,0,0,1,0,0),t}return h(i,t),u(i,[{key:"container",get:function(){return this.canvas.nativeCanvas.parentElement}},{key:"getTitle",value:function(){return this.canvas.id&&this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return this.canvas.nativeCanvas.getBoundingClientRect()}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}},{key:"postInit",value:function(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}},{key:"isElementVisible",value:function(t){var e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>n)}},{key:"observerCanvas",value:function(){var t=this;this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);var e=new IntersectionObserver((function(e,i){e.forEach((function(e){t._canvasIsIntersecting!==e.isIntersecting?(t._canvasIsIntersecting=e.isIntersecting,t._onVisibleChangeCb&&t._onVisibleChangeCb(e.isIntersecting)):t._canvasIsIntersecting=e.isIntersecting}))}));e&&e.observe(this.canvas.nativeCanvas)}},{key:"createWindowByConfig",value:function(t){var e,i=this.global.createCanvas({width:t.width,height:t.height});if(!(e="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement()))throw new Error("发生错误,containerId可能传入有误");t.offscreen?e=null:e.appendChild(i);var n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,container:e,id:qp.GenerateCanvasId(),canvasControled:!0};this.canvas=new Fp(n)}},{key:"createWindowByCanvas",value:function(t){var e,i;if("string"==typeof t.canvas){if(!(i=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");var n=t.width,r=t.height;if(null==n||null==r||!t.canvasControled){var a=i.getBoundingClientRect();n=a.width,r=a.height}var o=t.dpr;null==o&&(o=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/n),this.canvas=new Fp({width:n,height:r,dpr:o,nativeCanvas:i,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){this.canvas.release()}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return this.canvas.nativeCanvas.dispatchEvent(t)}},{key:"getStyle",value:function(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}},{key:"setStyle",value:function(t){this.canvas.nativeCanvas.style=t}},{key:"getBoundingClientRect",value:function(){var t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}},{key:"isVisible",value:function(t){return this._canvasIsIntersecting}},{key:"onVisibleChange",value:function(t){this._onVisibleChangeCb=t}},{key:"getTopLeft",value:function(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}}],[{key:"GenerateCanvasId",value:function(){return"".concat(qp.idprefix,"_").concat(qp.prefix_count++)}}])}(Kf);$p.env="browser",$p.idprefix="visactor_window",$p.prefix_count=0,$p=qp=Zp([L(),Jp("design:paramtypes",[])],$p);var Qp=new x((function(t){t($p).toSelf(),t(pr).toDynamicValue((function(t){return t.container.get($p)})).whenTargetNamed($p.env)})),tg=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},eg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ig=function(){return u((function t(e){o(this,t),this.dom=e}),[{key:"x1",get:function(){return this.dom.getBoundingClientRect().left}},{key:"x2",get:function(){return this.dom.getBoundingClientRect().right}},{key:"y1",get:function(){return this.dom.getBoundingClientRect().top}},{key:"y2",get:function(){return this.dom.getBoundingClientRect().bottom}},{key:"width",get:function(){return this.dom.getBoundingClientRect().width}},{key:"height",get:function(){return this.dom.getBoundingClientRect().height}}])}();function ng(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=document.createElement("img");if(i.crossOrigin="anonymous",e){var n=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(n)}return i.src=t,i.complete?Promise.resolve(i):new Promise((function(t,e){i.onload=function(){t(i)},i.onerror=function(){e(new Error("加载失败"))}}))}var rg=function(t){function i(){var t;o(this,i),(t=e(this,i)).type="browser",t.supportEvent=!0;try{t.supportsTouchEvents="ontouchstart"in globalThis,t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsTouchEvents=!1,t.supportsPointerEvents=!1,t.supportsPointerEvents=!1}return t.applyStyles=!0,t}return h(i,t),u(i,[{key:"mapToCanvasPoint",value:function(t,e){var i,n,r=0,a=0,o=0,s=0;if(t.changedTouches){var u=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};o=r=u.clientX||0,s=a=u.clientY||0}else r=t.clientX||0,a=t.clientY||0,o=t.offsetX||0,s=t.offsetY||0;if(e){var l,h,c=r,d=a,f=e.getBoundingClientRect(),v=null===(n=e.getNativeHandler)||void 0===n?void 0:n.call(e).nativeCanvas;return v&&(l=f.width/v.offsetWidth,h=f.height/v.offsetHeight),{x:(c-f.left)/(At(l)?l:1),y:(d-f.top)/(At(h)?h:1)}}return{x:o,y:s}}},{key:"getNativeAABBBounds",value:function(t){var e=t;if("string"==typeof t&&((e=(new DOMParser).parseFromString(t,"text/html").firstChild).lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){var i=e.getBoundingClientRect();return new ig(i)}return new Oe}},{key:"removeDom",value:function(t){return t.parentElement.removeChild(t),!0}},{key:"updateDom",value:function(t,e){var i=e.width,n=e.height,r=e.style;return r&&(_t(r)?t.setAttribute("style",r):Object.keys(r).forEach((function(e){t.style[e]=r[e]}))),null!=i&&(t.style.width="".concat(i,"px")),null!=n&&(t.style.height="".concat(n,"px")),!0}},{key:"createDom",value:function(t){var e=t.tagName,i=void 0===e?"div":e,n=t.parent,r=document.createElement(i);if(this.updateDom(r,t),n){var a=_t(n)?this.getElementById(n):n;a&&a.appendChild&&a.appendChild(r)}return r}},{key:"loadImage",value:function(t){return ng(t,!1).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadSvg",value:function(t){return ng(t,!0).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"createCanvas",value:function(t){var e,i,n=document.createElement("canvas");t.id&&(n.id=null!==(e=t.id)&&void 0!==e?e:b.GenAutoIncrementId().toString());var r=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(n.style.width="".concat(t.width,"px"),n.style.height="".concat(t.height,"px"),n.width=t.width*r,n.height=t.height*r),n}},{key:"createOffscreenCanvas",value:function(t){var e,i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}},{key:"releaseCanvas",value:function(t){var e;(e="string"==typeof t?document.getElementById(t):t)&&e.parentElement&&e.parentElement.removeChild(e)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getRequestAnimationFrame",value:function(){return window.requestAnimationFrame}},{key:"getCancelAnimationFrame",value:function(){return window.cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,i){return document.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return document.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return document.dispatchEvent(t)}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"getDocument",value:function(){return document}},{key:"release",value:function(){}},{key:"getElementTop",value:function(t,e){for(var i=t.offsetTop,n=t.offsetParent;null!==n;)i+=n.offsetTop,n=n.offsetParent;return i}},{key:"getElementLeft",value:function(t,e){for(var i=t.offsetLeft,n=t.offsetParent;null!==n;)i+=n.offsetLeft,n=n.offsetParent;return i}},{key:"getElementTopLeft",value:function(t,e){for(var i=t.offsetTop,n=t.offsetLeft,r=t.offsetParent;null!==r;)i+=r.offsetTop,n+=r.offsetLeft,r=r.offsetParent;return{top:i,left:n}}}])}(Wf);rg=tg([L(),eg("design:paramtypes",[])],rg);var ag=new x((function(t){ag.isBrowserBound||(ag.isBrowserBound=!0,t(rg).toSelf().inSingletonScope(),t(it).toService(rg))}));function og(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];og.__loaded||(og.__loaded=!0,t.load(ag),t.load(Np),t.load(Qp),e&&function(t){t.load(Xp),t.load(Yp)}(t))}ag.isBrowserBound=!1,og.__loaded=!1;var sg=function(){return u((function t(){o(this,t)}),[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=t.getGraphicTheme();n.highPerformanceSave();var a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,l+=h.y,n.setTransformForCurrent()}else s=0,l=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,s,l,{},null,(function(t,i,n){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Es(n,a+o,n.dpr),c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}])}(),ug=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},lg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hg=function(t,e){return function(i,n){e(i,n,t)}},cg=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="arc",n.numberType=ro,n}return h(i,t),u(i)}(sg);cg=ug([L(),hg(0,O(xl)),lg("design:paramtypes",[Object])],cg);var dg=!1,fg=new x((function(t,e,i,n){dg||(dg=!0,t(tp).to(cg).inSingletonScope(),t(Qv).toService(tp))})),vg=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},pg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gg=function(t,e){return function(i,n){e(i,n,t)}},yg=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="area",n.numberType=oo,n}return h(i,t),u(i)}(sg);yg=vg([L(),gg(0,O(wl)),pg("design:paramtypes",[Object])],yg);var mg=!1,kg=new x((function(t,e,i,n){mg||(mg=!0,t(ep).to(yg).inSingletonScope(),t(Qv).toService(ep))})),_g=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},bg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xg=function(t,e){return function(i,n){e(i,n,t)}},Sg=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="circle",n.numberType=so,n}return h(i,t),u(i)}(sg);Sg=_g([L(),xg(0,O(Al)),bg("design:paramtypes",[Object])],Sg);var wg=!1,Ag=new x((function(t,e,i,n){wg||(wg=!0,t(ip).to(Sg).inSingletonScope(),t(Qv).toService(ip))})),Tg=function(){return u((function t(){o(this,t),this.type="glyph",this.numberType=uo}),[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!(null!=i?i:{}).pickContext)return!1;var n=null==i?void 0:i.pickerService;if(n){var r=!1;return t.getSubGraphic().forEach((function(t){if(!r){var a=n.pickItem(t,e,null,i);r=!(!a||!a.graphic)}})),r}return!1}}])}(),Cg=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Eg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bg=function(t,e){return function(i,n){e(i,n,t)}},Rg=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n}return h(i,t),u(i)}(Tg);Rg=Cg([L(),Bg(0,O(Fl)),Eg("design:paramtypes",[Object])],Rg);var Mg=!1,Pg=new x((function(t,e,i,n){Mg||(Mg=!0,t(hp).to(Rg).inSingletonScope(),t(Rg).toService(hp))})),Og=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Ig=function(){return u((function t(){o(this,t),this.type="image",this.numberType=ho}),[{key:"contains",value:function(t,e,i){return!!(null!=i?i:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}])}();Ig=Og([L()],Ig);var Lg=!1,Dg=new x((function(t,e,i,n){Lg||(Lg=!0,t(np).to(Ig).inSingletonScope(),t(Ig).toService(np))})),Fg=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},jg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ng=function(t,e){return function(i,n){e(i,n,t)}},zg=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="line",n.numberType=co,n}return h(i,t),u(i)}(sg);zg=Fg([L(),Ng(0,O(El)),jg("design:paramtypes",[Object])],zg);var Ug=!1,Gg=new x((function(t,e,i,n){Ug||(Ug=!0,t(rp).to(zg).inSingletonScope(),t(Qv).toService(rp))})),Wg=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Vg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hg=function(t,e){return function(i,n){e(i,n,t)}},Kg=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="polygon",n.numberType=vo,n}return h(i,t),u(i)}(sg);Kg=Wg([L(),Hg(0,O(Rl)),Vg("design:paramtypes",[Object])],Kg);var Xg=!1,Yg=new x((function(t,e,i,n){Xg||(Xg=!0,t(lp).to(Kg).inSingletonScope(),t(Qv).toService(lp))})),qg=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Zg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jg=function(t,e){return function(i,n){e(i,n,t)}},$g=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="path",n.numberType=fo,n}return h(i,t),u(i)}(sg);$g=qg([L(),Jg(0,O(Bl)),Zg("design:paramtypes",[Object])],$g);var Qg=!1,ty=new x((function(t,e,i,n){Qg||(Qg=!0,t(ap).to($g).inSingletonScope(),t(Qv).toService(ap))})),ey=new Oe,iy=function(){return u((function t(){o(this,t),this.type="rect",this.numberType=go}),[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=t.getGraphicTheme(),a=t.attribute.cornerRadius,o=void 0===a?r.cornerRadius:a,s=t.attribute,u=s.x,l=void 0===u?r.x:u,h=s.y,c=void 0===h?r.y:h;n.highPerformanceSave();var d=!0;if(t.transMatrix.onlyTranslate()){var f=t.getOffsetXY(r);l+=f.x,c+=f.y,n.setTransformForCurrent()}else l=0,c=0,d=!1,n.transformFromMatrix(t.transMatrix,!0);var v=!0;if(!d||t.shadowRoot||wt(o,!0)&&0!==o||bt(o)&&o.some((function(t){return 0!==t})))v=!1,this.canvasRenderer.drawShape(t,n,l,c,{},null,(function(t,i,n){return!!v||(v=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(v)return!0;var a=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Es(n,a+o,n.dpr),v=t.isPointInStroke(e.x,e.y)}));else{var p=t.attribute,g=p.fill,y=void 0===g?r.fill:g,m=p.stroke,k=void 0===m?r.stroke:m,_=p.lineWidth,b=void 0===_?r.lineWidth:_;if(y)v=!0;else if(k){var x=t.AABBBounds;ey.setValue(x.x1,x.y1,x.x2,x.y2),ey.expand(-b/2),v=!ey.containsPoint(e)}}return n.highPerformanceRestore(),v}}])}(),ny=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},ry=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ay=function(t,e){return function(i,n){e(i,n,t)}},oy=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n}return h(i,t),u(i)}(iy);oy=ny([L(),ay(0,O(Ml)),ry("design:paramtypes",[Object])],oy);var sy=!1,uy=new x((function(t,e,i,n){sy||(sy=!0,t(op).to(oy).inSingletonScope(),t(Qv).toService(op))})),ly=!1,hy=new x((function(t,e,i,n){ly||(ly=!0,t(np).to(Ig).inSingletonScope(),t(Ig).toService(np))})),cy=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},dy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fy=function(t,e){return function(i,n){e(i,n,t)}},vy=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="symbol",n.numberType=ko,n}return h(i,t),u(i)}(sg);vy=cy([L(),fy(0,O(Ol)),dy("design:paramtypes",[Object])],vy);var py=!1,gy=new x((function(t,e,i,n){py||(py=!0,t(sp).to(vy).inSingletonScope(),t(Qv).toService(sp))})),yy=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},my=function(){return u((function t(){o(this,t),this.type="text",this.numberType=_o}),[{key:"contains",value:function(t,e,i){return!!t.AABBBounds.containsPoint(e)}}])}();my=yy([L()],my);var ky=!1,_y=new x((function(t,e,i,n){ky||(ky=!0,t(up).to(my).inSingletonScope(),t(Qv).toService(up))})),by=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},xy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sy=function(t){function i(t,n){var r;o(this,i),r=e(this,i,[t,n]);var a=t.nativeCanvas.getContext("2d");if(!a)throw new Error("发生错误,获取2d上下文失败");return r.nativeContext=a,r.canvas=t,r.matrix=new De(1,0,0,1,0,0),r.stack=[],r.dpr=null!=n?n:1,r}return h(i,t),u(i,[{key:"release",value:function(){}}])}(Ip);Sy.env="node",Sy=by([L(),xy("design:paramtypes",[Object,Number])],Sy);var wy=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Ay=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ty=function(t){function i(t){return o(this,i),e(this,i,[t])}return h(i,t),u(i,[{key:"init",value:function(){this._context=new Sy(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}},{key:"release",value:function(){this._nativeCanvas.release&&ft(this._nativeCanvas.release)&&this._nativeCanvas.release()}}])}(Uf);Ty.env="node";var Cy=jp(Ty=wy([L(),Ay("design:paramtypes",[Object])],Ty),Sy),Ey=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},By=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ry=function(t,e){return function(i,n){e(i,n,t)}},My=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).global=t,n.type="node",n}return h(i,t),u(i,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return""}},{key:"getWH",value:function(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:b.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Ty(i)}},{key:"createWindowByCanvas",value:function(t){var e=t.canvas,i=t.width,n=t.height;null!=i&&null!=n&&t.canvasControled||(i=e.width,n=e.height),this.canvas=new Ty({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){this.canvas.release()}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"getImageBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}},{key:"addEventListener",value:function(t,e,i){}},{key:"dispatchEvent",value:function(t){return!0}},{key:"removeEventListener",value:function(t,e,i){}},{key:"getStyle",value:function(){}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){return null}},{key:"clearViewBox",value:function(t){}}])}(Kf);My.env="node",My=Ey([L(),Ry(0,O(nt)),By("design:paramtypes",[Object])],My);var Py=new x((function(t){t(My).toSelf(),t(pr).toDynamicValue((function(t){return t.container.get(My)})).whenTargetNamed(My.env)})),Oy=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Iy=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="node",t._lastTime=0,t.supportEvent=!1,t}return h(i,t),u(i,[{key:"configure",value:function(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}},{key:"getDynamicCanvasCount",value:function(){return 0}},{key:"getStaticCanvasCount",value:function(){return 999}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadImage",value:function(t){var e=this.pkg.loadImage;return e?e(t).then((function(t){return{loadState:t?"success":"fail",data:t}})).catch((function(){return{loadState:"fail",data:null}})):Promise.reject(new Error("node-canvas loadImage could not be found!"))}},{key:"loadSvg",value:function(t){var e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));var i=new e(t).render().asPng();return this.loadImage(i)}},{key:"createCanvas",value:function(t){return this.pkg.createCanvas(t.width,t.height)}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getRequestAnimationFrame",value:function(){return function(t){return ma.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){ma.clear(t)}}},{key:"addEventListener",value:function(t,e,i){}},{key:"removeEventListener",value:function(t,e,i){}},{key:"getElementById",value:function(t){return null}},{key:"getRootElement",value:function(){return null}},{key:"dispatchEvent",value:function(t){}},{key:"release",value:function(){}},{key:"createOffscreenCanvas",value:function(t){}}])}(Wf);Iy=Oy([L()],Iy);var Ly=new x((function(t){Ly.isNodeBound||(Ly.isNodeBound=!0,t(Iy).toSelf().inSingletonScope(),t(it).toService(Iy))}));function Dy(t){Dy.__loaded||(Dy.__loaded=!0,t.load(Ly),t.load(Cy),t.load(Py))}Ly.isNodeBound=!1,Dy.__loaded=!1;var Fy=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},jy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ny=function(t,e){return function(i,n){e(i,n,t)}},zy=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="arc",n.numberType=ro,n}return h(i,t),u(i)}(sg);zy=Fy([L(),Ny(0,O(xl)),jy("design:paramtypes",[Object])],zy);var Uy=!1,Gy=new x((function(t,e,i,n){Uy||(Uy=!0,t(cp).to(zy).inSingletonScope(),t(Cp).toService(cp))})),Wy=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Vy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hy=function(t,e){return function(i,n){e(i,n,t)}},Ky=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n}return h(i,t),u(i)}(iy);Ky=Wy([L(),Hy(0,O(Ml)),Vy("design:paramtypes",[Object])],Ky);var Xy=!1,Yy=new x((function(t,e,i,n){Xy||(Xy=!0,t(mp).to(Ky).inSingletonScope(),t(Cp).toService(mp))})),qy=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;n.highPerformanceSave();var r=t.getGraphicTheme(),a=this.transform(t,r,n),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,h=e;if(n.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,n,o,s,{},null,(function(t){return!!d||(d=t.isPointInPath(h.x,h.y))}),(function(t,e,i){if(d)return!0;var r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Es(n,r+a,n.dpr),d=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,n.modelMatrix!==l&&ms.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),d}}])}(As),Zy=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Jy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$y=function(t,e){return function(i,n){e(i,n,t)}},Qy=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="line",n.numberType=co,n}return h(i,t),u(i)}(qy);Qy=Zy([L(),$y(0,O(El)),Jy("design:paramtypes",[Object])],Qy);var tm=!1,em=new x((function(t,e,i,n){tm||(tm=!0,t(gp).to(Qy).inSingletonScope(),t(Cp).toService(gp))})),im=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},nm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rm=function(t,e){return function(i,n){e(i,n,t)}},am=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="area",n.numberType=oo,n}return h(i,t),u(i)}(sg);am=im([L(),rm(0,O(wl)),nm("design:paramtypes",[Object])],am);var om=!1,sm=new x((function(t,e,i,n){om||(om=!0,t(fp).to(am).inSingletonScope(),t(Cp).toService(fp))})),um=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"contains",value:function(t,e,i){var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=t.getGraphicTheme();n.highPerformanceSave();var a=this.transform(t,r,n),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,h=e;if(n.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,n,o,s,i,null,(function(t,e,i){return!!d||(d=t.isPointInPath(h.x,h.y))})),this.canvasRenderer.z=0,n.modelMatrix!==l&&ms.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),d}}])}(As),lm=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},hm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cm=function(t,e){return function(i,n){e(i,n,t)}},dm=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="symbol",n.numberType=ko,n}return h(i,t),u(i,[{key:"contains",value:function(t,e,i){var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();var a=t.getGraphicTheme(),o=this.transform(t,a,n),s=o.x,u=o.y,l=o.z,h=o.lastModelMatrix,c=e;if(n.camera){c=e.clone();var d=t.parent.globalTransMatrix;c.x=d.a*e.x+d.c*e.y+d.e,c.y=d.b*e.x+d.d*e.y+d.f}this.canvasRenderer.z=l;var f=!1;return this.canvasRenderer.drawShape(t,n,s,u,{},null,(function(t,e,i){return!!f||(f=t.isPointInPath(c.x,c.y))}),(function(t,e,i){if(f)return!0;var r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Es(n,r+a,n.dpr),f=t.isPointInStroke(c.x,c.y)})),this.canvasRenderer.z=0,n.modelMatrix!==h&&ms.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),f}}])}(um);dm=lm([L(),cm(0,O(Ol)),hm("design:paramtypes",[Object])],dm);var fm=!1,vm=new x((function(t,e,i,n){fm||(fm=!0,t(_p).to(dm).inSingletonScope(),t(Cp).toService(_p))})),pm=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},gm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ym=function(t,e){return function(i,n){e(i,n,t)}},mm=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="circle",n.numberType=so,n}return h(i,t),u(i)}(sg);mm=pm([L(),ym(0,O(Al)),gm("design:paramtypes",[Object])],mm);var km=!1,_m=new x((function(t,e,i,n){km||(km=!0,t(vp).to(mm).inSingletonScope(),t(Cp).toService(vp))})),bm=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},xm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sm=function(t,e){return function(i,n){e(i,n,t)}},wm=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="text",n.numberType=_o,n}return h(i,t),u(i,[{key:"contains",value:function(t,e,i){var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();var a=t.getGraphicTheme(),o=t.attribute.keepDirIn3d,s=!(void 0===o?a.keepDirIn3d:o),u=this.transform(t,a,n,s),l=u.x,h=u.y,c=u.z,d=u.lastModelMatrix;this.canvasRenderer.z=c;var f=e;if(n.camera){f=e.clone();var v=t.parent.globalTransMatrix;f.x=v.a*e.x+v.c*e.y+v.e,f.y=v.b*e.x+v.d*e.y+v.f}var p=!1;return this.canvasRenderer.drawShape(t,n,l,h,{},null,(function(e,i,n){if(p)return!0;var r=t.attribute,o=r.fontSize,s=void 0===o?a.fontSize:o,u=r.textBaseline,d=void 0===u?a.textBaseline:u,v=r.textAlign,g=void 0===v?a.textAlign:v,y=t.AABBBounds,m=y.height(),k=y.width(),_=ls(d,m,s),b=us(g,k);return e.rect(b+l,_+h,k,m,c),p=e.isPointInPath(f.x,f.y)}),(function(t,e,i){return p})),this.canvasRenderer.z=0,n.modelMatrix!==d&&ms.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),p}}])}(um);wm=bm([L(),Sm(0,O(Il)),xm("design:paramtypes",[Object])],wm);var Am=!1,Tm=new x((function(t,e,i,n){Am||(Am=!0,t(bp).to(wm).inSingletonScope(),t(Cp).toService(bp))})),Cm=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Em=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bm=function(t,e){return function(i,n){e(i,n,t)}},Rm=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="path",n.numberType=fo,n}return h(i,t),u(i)}(qy);Rm=Cm([L(),Bm(0,O(Bl)),Em("design:paramtypes",[Object])],Rm);var Mm=!1,Pm=new x((function(t,e,i,n){Mm||(Mm=!0,t(yp).to(Rm).inSingletonScope(),t(Cp).toService(yp))})),Om=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Im=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lm=function(t,e){return function(i,n){e(i,n,t)}},Dm=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="polygon",n.numberType=vo,n}return h(i,t),u(i)}(sg);Dm=Om([L(),Lm(0,O(Rl)),Im("design:paramtypes",[Object])],Dm);var Fm=!1,jm=new x((function(t,e,i,n){Fm||(Fm=!0,t(xp).to(Dm).inSingletonScope(),t(Cp).toService(xp))})),Nm=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},zm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Um=function(t,e){return function(i,n){e(i,n,t)}},Gm=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n}return h(i,t),u(i)}(Tg);Gm=Nm([L(),Um(0,O(Fl)),zm("design:paramtypes",[Object])],Gm);var Wm=!1,Vm=new x((function(t,e,i,n){Wm||(Wm=!0,t(Ap).to(Gm).inSingletonScope(),t(Cp).toService(Ap))})),Hm=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},Km=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xm=function(t,e){return function(i,n){e(i,n,t)}},Ym=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="richtext",this.numberType=mo}),[{key:"contains",value:function(t,e,i){return!!t.AABBBounds.containsPoint(e)}}])}();Ym=Hm([L(),Xm(0,O(Ll)),Km("design:paramtypes",[Object])],Ym);var qm=!1,Zm=new x((function(t,e,i,n){qm||(qm=!0,t(wp).to(Ym).inSingletonScope(),t(Cp).toService(wp))})),Jm=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},$m=function(){return u((function t(){o(this,t),this.type="image",this.numberType=ho}),[{key:"contains",value:function(t,e,i){return!!(null!=i?i:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}])}();$m=Jm([L()],$m);var Qm=!1,tk=new x((function(t,e,i,n){Qm||(Qm=!0,t(pp).to($m).inSingletonScope(),t(Cp).toService(pp))})),ek=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},ik=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nk=function(t,e){return function(i,n){e(i,n,t)}},rk=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="rect3d",n.numberType=yo,n.themeType="rect",n}return h(i,t),u(i)}(um);rk=ek([L(),nk(0,O(Pl)),ik("design:paramtypes",[Object])],rk);var ak=!1,ok=new x((function(t,e,i,n){ak||(ak=!0,t(kp).to(rk).inSingletonScope(),t(Cp).toService(kp))})),sk=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},uk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lk=function(t,e){return function(i,n){e(i,n,t)}},hk=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="arc3d",n.numberType=ao,n.themeType="arc",n}return h(i,t),u(i)}(um);hk=sk([L(),lk(0,O(Sl)),uk("design:paramtypes",[Object])],hk);var ck=!1,dk=new x((function(t,e,i,n){ck||(ck=!0,t(dp).to(hk).inSingletonScope(),t(Cp).toService(dp))})),fk=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},vk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pk=function(t,e){return function(i,n){e(i,n,t)}},gk=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).canvasRenderer=t,n.type="pyramid3d",n.numberType=po,n.themeType="polygon",n}return h(i,t),u(i)}(um);gk=fk([L(),pk(0,O(Dl)),vk("design:paramtypes",[Object])],gk);var yk=!1,mk=new x((function(t,e,i,n){yk||(yk=!0,t(Sp).to(gk).inSingletonScope(),t(Cp).toService(Sp))})),kk=Of();function _k(){_k.__loaded||(_k.__loaded=!0,qu.RegisterGraphicCreator("arc",Sd),or.load(ov),or.load(kk?Gy:fg))}_k.__loaded=!1;var bk=_k;function xk(){xk.__loaded||(xk.__loaded=!0,qu.RegisterGraphicCreator("arc3d",Ad),Yf(),Zf(),or.load(Gv),or.load(dk))}xk.__loaded=!1;var Sk=xk;function wk(){wk.__loaded||(wk.__loaded=!0,qu.RegisterGraphicCreator("area",_d),or.load(dv),or.load(kk?sm:kg))}wk.__loaded=!1;var Ak=wk;function Tk(){Tk.__loaded||(Tk.__loaded=!0,qu.RegisterGraphicCreator("circle",uh),or.load(gv),or.load(kk?_m:Ag))}Tk.__loaded=!1;var Ck=Tk;function Ek(){Ek.__loaded||(Ek.__loaded=!0,qu.RegisterGraphicCreator("glyph",nd),or.load(Tv),or.load(kk?Vm:Pg))}Ek.__loaded=!1;var Bk=Ek;function Rk(){Rk.__loaded||(Rk.__loaded=!0,qu.RegisterGraphicCreator("group",To))}Rk.__loaded=!1;var Mk=Rk;function Pk(){Pk.__loaded||(Pk.__loaded=!0,qu.RegisterGraphicCreator("image",ud),or.load(Ov),or.load(kk?tk:Dg))}Pk.__loaded=!1;var Ok=Pk;function Ik(){Ik.__loaded||(Ik.__loaded=!0,qu.RegisterGraphicCreator("line",qc),or.load(hv),or.load(kk?em:Gg))}Ik.__loaded=!1;var Lk=Ik;function Dk(){Dk.__loaded||(Dk.__loaded=!0,qu.RegisterGraphicCreator("path",yd),or.load(_v),or.load(kk?Pm:ty))}Dk.__loaded=!1;var Fk=Dk;function jk(){jk.__loaded||(jk.__loaded=!0,qu.RegisterGraphicCreator("polygon",Ed),or.load(xv),or.load(kk?jm:Yg))}jk.__loaded=!1;var Nk=jk;function zk(){zk.__loaded||(zk.__loaded=!0,qu.RegisterGraphicCreator("pyramid3d",Rd),Yf(),Zf(),or.load(Kv),or.load(mk))}zk.__loaded=!1;var Uk=zk;function Gk(){Gk.__loaded||(Gk.__loaded=!0,qu.RegisterGraphicCreator("rect",$c),or.load(uv),or.load(kk?Yy:uy))}Gk.__loaded=!1;var Wk=Gk;function Vk(){Vk.__loaded||(Vk.__loaded=!0,qu.RegisterGraphicCreator("rect3d",ed),or.load(jv),or.load(ok))}Vk.__loaded=!1;var Hk=Vk;function Kk(){Kk.__loaded||(Kk.__loaded=!0,qu.RegisterGraphicCreator("richtext",vd),or.load(Mv),or.load(kk?Zm:hy))}Kk.__loaded=!1;var Xk=Kk;function Yk(){Yk.__loaded||(Yk.__loaded=!0,Xv())}Yk.__loaded=!1;var qk=Yk;function Zk(){Zk.__loaded||(Zk.__loaded=!0,qu.RegisterGraphicCreator("symbol",Kc),or.load(vv),or.load(kk?vm:gy))}Zk.__loaded=!1;var Jk=Zk;function $k(){$k.__loaded||($k.__loaded=!0,qu.RegisterGraphicCreator("text",dh),or.load(mv),or.load(kk?Tm:_y))}$k.__loaded=!1;var Qk=$k;function t_(){t_.__loaded||(t_.__loaded=!0,qu.RegisterGraphicCreator("wrapText",ph))}t_.__loaded=!1;var e_=t_;_f(),Of()?og(or):function(){Pf();var t=Vn.global&&Vn.global.env;return t?"node"===t:!Tf}()&&Dy(or),bk(),Sk(),Ak(),Ck(),Bk(),Mk(),Ok(),Lk(),Fk(),Nk(),Uk(),Wk(),Hk(),Xk(),qk(),Jk(),Qk(),e_(),If.registerPlugin("FlexLayoutPlugin",$v),If.registerPlugin("ViewTransform3dPlugin",Zv),If.registerPlugin("HtmlAttributePlugin",Yv),If.registerPlugin("ReactAttributePlugin",qv),Yf(),Zf();var i_=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},n_=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||i_(t,"Boolean")},r_=function(t){return"function"==typeof t},a_=function(t){return null==t},o_=function(t){return null!=t},s_=function(t){var e=a(t);return null!==t&&"object"===e||"function"===e},u_=function(t){return"object"==a(t)&&null!==t},l_=function(t){if(!u_(t)||!i_(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},h_=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=a(t);return e?"string"===i:"string"===i||i_(t,"String")},c_=function(t){return Array.isArray?Array.isArray(t):i_(t,"Array")},d_=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},f_=function(t){return i_(t,"Date")},v_=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=a(t);return e?"number"===i:"number"===i||i_(t,"Number")};function p_(t){var e;if(!o_(t)||"object"!=a(t))return t;var i=c_(t),n=t.length;e=i?new Array(n):"object"==a(t)?{}:n_(t)||v_(t)||h_(t)?t:f_(t)?new Date(+t):void 0;var r=i?void 0:Object.keys(Object(t)),o=-1;if(e)for(;++o<(r||t).length;){var s=r?r[o]:o,u=t[s];e[s]=p_(u)}return e}function g_(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(t===e)return;if(o_(e)&&"object"==a(e)){var n=Object(e),r=[];for(var o in n)r.push(o);for(var s=r.length,u=-1;s--;){var l=r[++u];o_(n[l])&&"object"==a(n[l])?y_(t,e,l,i):m_(t,l,n[l])}}}}function y_(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t[i],o=e[i],s=e[i],u=!0;if(c_(o)){if(n)s=[];else if(c_(r))s=r;else if(d_(r)){s=new Array(r.length);for(var l=-1,h=r.length;++l<h;)s[l]=r[l]}}else l_(o)?(s=r,"function"!=typeof r&&"object"==a(r)||(s={})):u=!1;u&&g_(s,o,n),m_(t,i,s)}function m_(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function k_(t){for(var e=-1,i=arguments.length<=1?0:arguments.length-1;++e<i;)g_(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function __(t){return o_(t)?c_(t)?t:[t]:[]}var b_=function(){function t(e){o(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return u(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return c_(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return function(t,e,i){var n=e.x1,r=e.y1,a=e.x2,o=e.y2;i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f)):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*a+i.c*r+i.e,i.b*a+i.d*r+i.f),t.add(i.a*a+i.c*o+i.e,i.b*a+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f))}(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,i){var n=this.x1,r=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),u=Math.sin(t),l=e-e*s+i*u,h=i-e*u-i*s;return[s*n-u*r+l,u*n+s*r+h,s*n-u*o+l,u*n+s*o+h,s*a-u*r+l,u*a+s*r+h,s*a-u*o+l,u*a+s*o+h]}},{key:"scalePoints",value:function(t,e,i,n){return[t*this.x1+(1-t)*i,e*this.y1+(1-e)*n,t*this.x2+(1-t)*i,e*this.y2+(1-e)*n]}}])}();function x_(t){return{x:"x"in t?t.x:t.left,y:"y"in t?t.y:t.top,width:"width"in t?t.width:t.right-t.left,height:"height"in t?t.height:t.bottom-t.top}}class S_{get graphic(){return this._graphic}constructor(t,e){this.containsShapePoints=!1,this.type=t,this._character=e}getBounds(){return this._graphic.AABBBounds}release(){this._graphic&&(this._graphic.parent.removeChild(this._graphic),this._graphic=null)}getInitialAttributes(){return{x:0,y:0,width:120,height:80,angle:0,anchor:[60,40],lineWidth:2,stroke:"#000000",shapePoints:[]}}setAttributes(t){this._graphic&&this._graphic.setAttributes(t)}show(){this._graphic.setAttributes({visible:!0,visibleAll:!0})}hide(){this._graphic.setAttributes({visible:!1,visibleAll:!1})}getGraphicAttribute(){var t;return null===(t=this._graphic)||void 0===t?void 0:t.attribute}applyGraphicAttribute(t){this._graphic.setAttributes(this._transformAttributes(Object.assign({},t)))}getPositionData(){return{x:this._graphic.attribute.x,y:this._graphic.attribute.y,width:this._graphic.attribute.width,height:this._graphic.attribute.height,angle:this._graphic.attribute.angle,shapePoints:this._graphic.attribute.shapePoints}}applyLayoutData(t){this._graphic.setAttributes(this._transformAttributes(Object.assign(Object.assign({},x_(t)),{shapePoints:this._character.spec.options.shapePoints})))}getTextLayoutRatio(){return{left:0,right:1,top:0,bottom:1}}_transformAttributes(t){var e,i,n,r;const a=null!==(e=t.width)&&void 0!==e?e:null===(i=this._graphic)||void 0===i?void 0:i.attribute.width,o=null!==(n=t.height)&&void 0!==n?n:null===(r=this._graphic)||void 0===r?void 0:r.attribute.height,s=Object.assign({},t);return Object.keys(s).forEach((e=>{o_(t[e])||delete s[e]})),s.anchor=[a/2,o/2],s.scaleCenter=[a/2,o/2],s.x=0,s.y=0,s}}class w_ extends S_{getInitialAttributes(){return{x:0,y:0,symbolType:"M649.6 812.8l-114.976 114.944a32 32 0 0 1-45.248 0L374.4 812.8H128a64 64 0 0 1-64-64V160a64 64 0 0 1 64-64h768a64 64 0 0 1 64 64v588.8a64 64 0 0 1-64 64h-246.4z",angle:0,size:40,lineWidth:2,stroke:"pink"}}init(){var t,e;this._graphic||(this._graphic=Kc(Object.assign({},this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{})))),this._graphic.name=`graphic-qipao-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}}function A_(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}function T_(t,e,i,n){return new(i||(i=Promise))((function(r,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}u((n=n.apply(t,e||[])).next())}))}const C_=999999;class E_{get graphic(){return this._graphic}constructor(t){this.updateAttribute=t=>{t&&(this._graphic.setAttributes(this._transformTextAttributes(t)),this._updateGraphicCharacterSize())},this._character=t}getInitialAttributes(){return{visible:!0,x:0,y:0,textAlign:"center",textBaseline:"middle",textConfig:[],fontSize:16,graphicAlign:"center",graphicBaseline:"middle",ignoreBuf:!0,height:0,width:0,maxLineWidth:C_,heightLimit:C_}}show(){this._graphic.setAttributes({visible:!0})}hide(){this._graphic.setAttributes({visible:!1})}transformTextAttrsToRichTextConfig(){var t,e;const i=null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.text)&&void 0!==e?e:{};let n=i.textConfig;if((!n||!n.length)&&i.text){const t=Array.isArray(i.text)?i.text:[i.text];n=t.map(((e,i)=>({textAlign:"center",textBaseline:"middle",text:e+(i<t.length-1?"\n":"")})))}return n}init(){this._graphic=vd(this._transformTextAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),{textConfig:this.transformTextAttrsToRichTextConfig()}))),this._character.getGraphicParent().add(this._graphic)}applyGraphicAttribute(t){this._graphic.setAttributes(Object.assign({},t))}getGraphicAttribute(){var t;return null===(t=this._graphic)||void 0===t?void 0:t.attribute}applyLayoutData(t){const e=x_(t),i=this._character.getTextLayoutRatio(),n=this._graphic.attribute.graphicAlign,r=this._graphic.attribute.graphicBaseline,a=e.width*i.left,o=e.width*i.right,s=(a+o)/2,u=e.height*i.top,l=e.height*i.bottom,h=(u+l)/2;let c=s,d=h;switch(n){case"left":c=a;break;case"center":c=s;break;case"right":c=o}switch(r){case"top":d=u;break;case"middle":d=h;break;case"bottom":d=l}this._graphic.setAttributes(this._transformTextAttributes({x:c,y:d,textAlign:n,textBaseline:r,angle:e.angle,anchor:[e.width/2,e.height/2],scaleCenter:[e.width/2,e.height/2],maxWidth:e.width,maxHeight:e.height,heightLimit:this._character.graphic.getGraphicAttribute().isResized?l-u:C_}))}_updateGraphicCharacterSize(){this._character.graphic.getGraphicAttribute().isResized||this.applyLayoutData(this._character.graphic.getPositionData())}_transformTextAttributes(t){return t}}class B_{get spec(){return this._spec}get graphic(){return this._graphic}get option(){return this._option}constructor(t,e){this.type=t.type,this.id=t.id,this._spec=t,this._option=e}updateSpec(t){var e;t.position&&(this._spec.position=t.position),o_(t.zIndex)&&(this._spec.zIndex=t.zIndex),t.options&&(this._spec.options=k_(null!==(e=this._spec.options)&&void 0!==e?e:{},t.options))}setAttributes(t){throw new Error("请重载setAttributes函数")}tickTo(t){throw new Error("Method not implemented.")}init(){this._initRuntime(),this._parserSpec(),this._initGraphics()}reset(){this.clearCharacter(),this.init()}getPositionData(){}release(){this.graphic&&this.graphic.release&&this.graphic.release()}}const R_=$a();class M_ extends Ao{constructor(t){super(Object.assign(Object.assign({scaleX:1,scaleY:1,x:0,y:0,angle:0},t),{pickable:!1})),this.type="vstory-component-group",this.numberType=R_}}class P_ extends B_{constructor(){super(...arguments),this.graphicType="rect"}get spec(){return this._spec}get text(){return this._text}get textGraphic(){return this._text.graphic}get group(){return this._group}_parserSpec(){}_initGraphics(){this._group=new M_(Object.assign(Object.assign({},x_(this._spec.position)),{angle:this._spec.options.angle,zIndex:this._spec.zIndex})),this.option.graphicParent.add(this._group),this._graphic=this._createGraphic(),this._text=new E_(this),this._graphic.init(),this._text.init(),this._graphic.applyGraphicAttribute(this._spec.options.graphic),this._text.applyGraphicAttribute(this._spec.options.text),this._graphic.applyLayoutData(this._spec.position),this._text.applyLayoutData(this._spec.position),this.hide()}setAttributes(t){const{position:e}=t,i=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}(t,["position"]),n=Object.assign(Object.assign({},null!=e?e:{}),i);this.group.setAttributes(n),this._graphic.setAttributes(Object.assign(Object.assign({},n),{x:0,y:0,angle:0})),this._text.updateAttribute({})}_initRuntime(){}show(){this._group.setAttributes({visible:!0}),this._text.show(),this._graphic.show()}hide(){this._group.setAttributes({visible:!1}),this._text.hide(),this._graphic.hide()}getTextLayoutRatio(){return this._graphic.getTextLayoutRatio()}clearCharacter(){var t;null===(t=this._group)||void 0===t||t.parent.removeChild(this._group),this._group=null}getGraphicParent(){return this._group}getLayoutBounds(){return this._group.AABBBounds}checkEvent(t){var e;return!!(null!==(e=t.detailPath)&&void 0!==e?e:t.path).some((t=>t===this._group))&&{part:t.path[t.path.length-1]===this._graphic.graphic?"graphic":"text",graphicType:this.graphicType}}release(){this.option.graphicParent.removeChild(this._group)}}class O_ extends P_{constructor(){super(...arguments),this.graphicType="qipao"}_createGraphic(){return new w_("Qipao",this)}}class I_ extends S_{getInitialAttributes(){return{x:0,y:0,width:120,height:80,angle:0,anchor:[60,40],lineWidth:2,stroke:"#000000",shapePoints:[]}}init(){var t,e;this._graphic||(this._graphic=$c(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`graphic-rect-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}}var L_,D_,F_;!function(t){t.VCHART="VChart",t.RANKINGBAR="RankingBar"}(L_||(L_={})),function(t){t.RECT="Rect",t.SHAPE="Shape",t.LINE="Line",t.ARC="Arc",t.PATH="Path",t.TEXT="Text",t.QIPAO="Qipao",t.IMAGE="Image",t.TIMELINE="Timeline"}(D_||(D_={})),function(t){t.MARK_POINT="markPoint",t.TITLE="title"}(F_||(F_={}));class j_ extends P_{constructor(){super(...arguments),this.graphicType="rect"}_createGraphic(){return new I_(D_.RECT,this)}checkEvent(t){const e=super.checkEvent(t);return(!e||t.path[t.path.length-1]!==this._group)&&e}}class N_{static registerCharacter(t,e){N_.characterMap[t]=e}static createCharacter(t,e){const i=N_.characterMap[t.type];if(!i)return console.error("获取模板失败",t),null;const n=new i(t,e);return n.init(),n}static registerGraphic(t,e){N_.graphicMap[t]=e}static createGraphic(t,e){const i=N_.graphicMap[t];return i?new i(t,e):null}static registerDataParser(t,e){N_.dataParserMap[t]=e}static createDataParser(t,e){const i=N_.dataParserMap[t];return i?new i(t,e):null}static registerChartTemp(t,e){N_.chartTempMap[t]=e}static createChartTemp(t,e){const i=N_.chartTempMap[t];return i?new i(e):null}}function z_(t,e){const{x1:i,y1:n,x2:r,y2:a}=e,{x:o,y:s}=t;return o<=r&&o>=i&&s<=a&&s>=n}N_.characterMap={},N_.graphicMap={},N_.dataParserMap={},N_.chartTempMap={};const U_=$a();class G_ extends Ao{get vchart(){return this._vchart}get vProduct(){return this._vchart}_getVChartRootMarkBounds(){return this._vchart.getStage().defaultLayer.getChildByName("root").AABBBounds.clone()}doUpdateAABBBounds(t){if(!this._vchart)return super.doUpdateAABBBounds();const e=new b_;return e.x1=this.attribute.x,e.x2=this.attribute.x+this.attribute.width,e.y1=this.attribute.y,e.y2=this.attribute.y+this.attribute.height,e}constructor(t){var e;super(t),this.type="chart",this._globalViewBox={x1:0,y1:0,x2:100,y2:100},this._localViewBox={x1:0,y1:0,x2:100,y2:100},this._BoundsViewBox={x1:0,y1:0,x2:100,y2:100},this.drawTag=!1,this._boundsChangeTag=!0,this.numberType=U_,t.vchart?this._vchart=t.vchart:t.vchart=this._vchart=new t.ClassType(t.spec,Object.assign({renderCanvas:t.renderCanvas,mode:t.mode,modeParams:t.modeParams,canvasControled:!1,dpr:t.dpr,interactive:t.interactive,animation:!1,autoFit:!1,disableTriggerEvent:t.disableTriggerEvent,disableDirtyBounds:t.disableDirtyBounds,ticker:t.ticker,beforeRender:()=>{var t;if(!this.stage)return;const e=this._vchart.getStage();e._editor_needRender||(e.pauseRender(),null===(t=this.stage.dirtyBounds)||void 0===t||t.union(this.globalAABBBounds),this.stage.renderNextFrame())},afterRender:()=>{this._vchart&&this.stage&&(this._vchart.getStage()._editor_needRender=!1,this._vchart.getStage().stage.resumeRender())}},null!==(e=t.chartInitOptions)&&void 0!==e?e:{}));const i=this._vchart.getStage();i.stage.pauseRender(),this._vchart.renderSync(),i.stage.resumeRender(),i&&(i.background=!1),t.viewBox&&this.updateViewBox(t.viewBox)}pointInVChart(t,e){const i=this._vchart;if(!i)return!1;const n={x:0,y:0};return this.globalTransMatrix.transformPoint({x:t,y:e},n),z_(n,i.getStage().viewBox)}pointInViewBox(t,e){const i={x:0,y:0};return this.globalTransMatrix.transformPoint({x:t,y:e},i),z_(i,this._localViewBox)}updateSpec(t,e,i=!1,n=!1){this._boundsChangeTag=!0,e&&this.updateViewBox(e),this._vchart.updateSpecSync(t,i,{reuse:!1,morph:n}),this._updateViewBox()}updateViewBox(t){this._globalViewBox=Object.assign({},t),this._localViewBox={x1:0,y1:0,x2:t.x2-t.x1,y2:t.y2-t.y1},this._updateViewBox()}_updateViewBox(){if(!this._vchart)return;this._boundsChangeTag=!0;const t=this._getVChartRootMarkBounds();this._vchart.getStage().defaultLayer.translateTo(-t.x1,-t.y1),this._BoundsViewBox=t;const e=Object.assign({},this._globalViewBox);this.setAttributes({x:e.x1+t.x1,y:e.y1+t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this._localViewBox.x1=-t.x1,this._localViewBox.y1=-t.y1,this._localViewBox.x2+=-t.x1,this._localViewBox.y2+=-t.y1,e.x2-=e.x1,e.y2-=e.y1,e.x1=0,e.y1=0,this._vchart.resize(e.x2-e.x1,e.y2-e.y1),this._vchart.updateViewBox(e);const i=Object.assign({},t);i.x2-=i.x1,i.y2-=i.y1,i.x1=0,i.y1=0,this._vchart._compiler._view.renderer.setViewBox(i,!0)}release(){this._vchart&&this._vchart.release()}}const W_=Symbol.for("VStoryChartRender");let V_=class extends Gu{constructor(){super(...arguments),this.numberType=U_}drawShape(t,e,i,n,r,a,o,s){var u;const{baseOpacity:l=1}=t.attribute;if(l<=0)return;e.baseGlobalAlpha*=l,super.drawShape(t,e,i,n,r,a,o,s),e.baseGlobalAlpha/=l;const h=t.vchart.getStage(),c=h.window.getContext();c.baseGlobalAlpha*=l,h._editor_needRender=!0;const d=t.globalTransMatrix.clone(),f=t.stage.window.getViewBoxTransform().clone();f.multiply(d.a,d.b,d.c,d.d,d.e,d.f),h.window.setViewBoxTransform(f.a,f.b,f.c,f.d,f.e,f.f),null===(u=h.dirtyBounds)||void 0===u||u.clear(),h.render(),c.baseGlobalAlpha/=l}draw(t,e,i,n){this._draw(t,{},!1,i,n)}};V_=A_([L()],V_);class H_ extends S_{getInitialAttributes(){return{x:0,y:0,width:120,height:80,angle:0,fontSize:16,textAlign:"center",textBaseline:"middle",fill:"#000000",lineWidth:2,ignoreBuf:!0,stroke:!1,shapePoints:[]}}transformTextAttrsToRichTextConfig(){var t,e;const i=null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{};let n=i.textConfig;if((!n||!n.length)&&i.text){const t=Array.isArray(i.text)?i.text:[i.text];n=t.map(((e,n)=>({textAlign:i.textAlign,textBaseline:i.textBaseline,text:e+(n<t.length-1?"\n":"")})))}return n}init(){var t,e;this._graphic||(this._graphic=vd(this._transformAttributes(Object.assign(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}),{textConfig:this.transformTextAttrsToRichTextConfig()}))),this._graphic.name=`graphic-text-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}applyLayoutData(t){const{x:e,y:i,width:n,height:r,angle:a}=x_(t);this._graphic.setAttributes(this._transformAttributes({x:e,y:i,angle:a,width:n,height:r,maxLineWidth:n,heightLimit:r}))}}class K_ extends P_{constructor(){super(...arguments),this.graphicType="text"}_createGraphic(){return new H_(D_.TEXT,this)}}let X_=class{constructor(){this.type="chart",this.numberType=U_}contains(t,e,i){var n;const r=t.transMatrix.clone(),a=t.stage.window.getViewBoxTransform();r.multiply(a.a,a.b,a.c,a.d,a.e,a.f);const o={x:0,y:0};r.getInverse().transformPoint(e,o);const s=t.vchart.getStage();null===(n=s.dirtyBounds)||void 0===n||n.clear();return s.pick(o.x,o.y)}};X_=A_([L()],X_);class Y_ extends S_{getInitialAttributes(){return{x:0,y:0,points:[],angle:0,lineWidth:2,stroke:"#000000",shapePoints:[]}}init(){var t,e;this._graphic||(this._graphic=qc(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`graphic-line-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}}class q_ extends P_{constructor(){super(...arguments),this.graphicType="line"}_createGraphic(){return new Y_(D_.RECT,this)}}class Z_ extends S_{getInitialAttributes(){return{x:0,y:0,width:120,height:80,image:"",angle:0,anchor:[60,40],shapePoints:[]}}init(){var t,e;this._graphic||(this._graphic=ud(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`graphic-image-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}}class J_ extends P_{constructor(){super(...arguments),this.graphicType="image"}_createGraphic(){return new Z_(D_.IMAGE,this)}checkEvent(t){const e=super.checkEvent(t);return(!e||t.path[t.path.length-1]!==this._group)&&e}}class $_ extends S_{getInitialAttributes(){return{x:0,y:0,width:120,height:80,angle:0,anchor:[60,40],lineWidth:2,stroke:"#000000",shapePoints:[],symbolType:"circle"}}init(){var t,e;if(!this._graphic){const i=this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}));this._graphic=Kc(i),this._graphic.name=`graphic-symbol-${this._character.id}`,this._character.getGraphicParent().add(this._graphic)}}applyLayoutData(t){const e=this._transformAttributes(Object.assign(Object.assign({},x_(t)),{shapePoints:this._character.spec.options.shapePoints}));e.size=Math.min(e.width,e.height),this._graphic.setAttributes(e)}_transformAttributes(t){const e=super._transformAttributes(t),{width:i,height:n}=t;return e.x=i/2,e.y=n/2,e}}class Q_ extends P_{constructor(){super(...arguments),this.graphicType="shape"}_createGraphic(){return new $_(D_.SHAPE,this)}setAttributes(t){this.group.setAttributes(Object.assign(Object.assign({},t),{x:t.x-t.width/2,y:t.y-t.height/2})),this._graphic.setAttributes(Object.assign(Object.assign({},t),{x:t.width/2,y:t.height/2,angle:0,size:Math.min(t.width,t.height)})),this._text.updateAttribute({})}checkEvent(t){const e=super.checkEvent(t);return(!e||t.path[t.path.length-1]!==this._group)&&e}}function tb(t,e,i){return!!i&&(o_(i.usrId)?t.id===i.usrId:!!o_(i.specIndex)&&("all"===i.specIndex||e===i.specIndex))}var eb,ib,nb=function(t){return t};!function(t){t["desktop-browser"]="desktop-browser",t["mobile-browser"]="mobile-browser",t.node="node",t.worker="worker",t.miniApp="miniApp",t.wx="wx",t.tt="tt",t.harmony="harmony",t["desktop-miniApp"]="desktop-miniApp",t.lynx="lynx"}(eb||(eb={})),function(t){t.cartesianAxis="cartesianAxis",t.cartesianBandAxis="cartesianAxis-band",t.cartesianLinearAxis="cartesianAxis-linear",t.cartesianTimeAxis="cartesianAxis-time",t.cartesianLogAxis="cartesianAxis-log",t.cartesianSymlogAxis="cartesianAxis-symlog",t.polarAxis="polarAxis",t.polarBandAxis="polarAxis-band",t.polarLinearAxis="polarAxis-linear",t.crosshair="crosshair",t.cartesianCrosshair="cartesianCrosshair",t.polarCrosshair="polarCrosshair",t.dataZoom="dataZoom",t.geoCoordinate="geoCoordinate",t.indicator="indicator",t.discreteLegend="discreteLegend",t.continuousLegend="continuousLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend",t.mapLabel="mapLabel",t.markLine="markLine",t.markArea="markArea",t.markPoint="markPoint",t.polarMarkLine="polarMarkLine",t.polarMarkArea="polarMarkArea",t.polarMarkPoint="polarMarkPoint",t.geoMarkPoint="geoMarkPoint",t.tooltip="tooltip",t.title="title",t.player="player",t.scrollBar="scrollBar",t.label="label",t.totalLabel="totalLabel",t.brush="brush",t.poptip="poptip",t.customMark="customMark"}(ib||(ib={}));var rb,ab=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return ub.apply(void 0,[Dt(t)].concat(i))};function ob(t,e,i){var n=e[i];if(void 0===n)t[i]=null;else if(gt(n))for(var r in gt(t[i])||(t[i]={}),n)ob(t[i],n,r);else t[i]=n}function sb(t,e){if(gt(e)&&t!==e)for(var i in e)ob(t,e,i)}function ub(t){t||(t={});for(var e=-1,i=arguments.length<=1?0:arguments.length-1;++e<i;)sb(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1]);return t}!function(t){t.DSV="dsv",t.TREE="tree",t.GEO="geo",t.BYTE="bytejson",t.HEX="hex",t.GRAPH="graph",t.TABLE="table",t.GEO_GRATICULE="geo-graticule"}(rb||(rb={}));var lb=function(t,e){var i,n;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;var r=e.fields,a=t[0],o={},s=[],u=function(e){if(Object.prototype.hasOwnProperty.call(r,e)){var u,l=r[e];if(!l.type){var h=a;e in a||(h=null!==(i=t.find((function(t){return e in t})))&&void 0!==i?i:a),l.type="number"==typeof h[e]?"linear":"ordinal"}if("number"==typeof l.sortIndex&&(u={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},s.push(u)),(null===(n=l.domain)||void 0===n?void 0:n.length)>0)if("ordinal"===l.type){l._domainCache={},o[e]=l;var c={};l.domain.forEach((function(t,e){c[t]=e,l._domainCache[t]=e})),u&&(u.sortIndex=c,u.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(o[e]=l)}};for(var l in r)u(l);return Object.keys(o).length>0&&(t=t.filter((function(t){for(var e in o){var i=o[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),s.sort((function(t,e){return t.index-e.index})),t.sort((function(t,e){return function(t,e,i){for(var n=0;n<i.length;n++){var r=i[n],a=0;if("ordinal"===r.type?(void 0===r.sortIndex[e[r.key]]&&(r.sortIndex[e[r.key]]=r.sortIndexCount++),void 0===r.sortIndex[t[r.key]]&&(r.sortIndex[t[r.key]]=r.sortIndexCount++),a=r.sortIndex[t[r.key]]-r.sortIndex[e[r.key]]):"linear"===r.type&&(a=t[r.key]-e[r.key]),r.sortReverse&&(a=-a),0!==a)return a}return 0}(t,e,s)})),t};var hb={},cb={};function db(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function fb(t){var e=Object.create(null),i=[];return t.forEach((function(t){for(var n in t)n in e||i.push(e[n]=n)})),i}function vb(t,e){var i=t+"",n=i.length;return n<e?new Array(e-n+1).join(0)+i:i}function pb(t){var e,i=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+vb(-e,6):e>9999?"+"+vb(e,6):vb(e,4))+"-"+vb(t.getUTCMonth()+1,2)+"-"+vb(t.getUTCDate(),2)+(a?"T"+vb(i,2)+":"+vb(n,2)+":"+vb(r,2)+"."+vb(a,3)+"Z":r?"T"+vb(i,2)+":"+vb(n,2)+":"+vb(r,2)+"Z":n||i?"T"+vb(i,2)+":"+vb(n,2)+"Z":"")}function gb(t){var e=new RegExp('["'+t+"\n\r]"),i=t.charCodeAt(0);function n(t,e){var n,r=[],a=t.length,o=0,s=0,u=a<=0,l=!1;function h(){if(u)return cb;if(l)return l=!1,hb;var e,n,r=o;if(34===t.charCodeAt(r)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?u=!0:10===(n=t.charCodeAt(o++))?l=!0:13===n&&(l=!0,10===t.charCodeAt(o)&&++o),t.slice(r+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(n=t.charCodeAt(e=o++)))l=!0;else if(13===n)l=!0,10===t.charCodeAt(o)&&++o;else if(n!==i)continue;return t.slice(r,e)}return u=!0,t.slice(r,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(n=h())!==cb;){for(var c=[];n!==hb&&n!==cb;)c.push(n),n=h();e&&null==(c=e(c,s++))||r.push(c)}return r}function r(e,i){return e.map((function(e){return i.map((function(t){return o(e[t])})).join(t)}))}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?pb(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var i,r,a=n(t,(function(t,n){if(i)return i(t,n-1);r=t,i=e?function(t,e){var i=db(t);return function(n,r){return e(i(n),r,t)}}(t,e):db(t)}));return a.columns=r||[],a},parseRows:n,format:function(e,i){return null==i&&(i=fb(e)),[i.map(o).join(t)].concat(r(e,i)).join("\n")},formatBody:function(t,e){return null==e&&(e=fb(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}var yb=gb(",").parse,mb=gb("\t").parse,kb={delimiter:","},_b=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(arguments.length>2?arguments[2]:void 0).type=rb.DSV;var i=ab(kb,e).delimiter;if(!_t(i))throw new TypeError("Invalid delimiter: must be a string!");return gb(i).parse(t)},bb=function(t){return(arguments.length>2?arguments[2]:void 0).type=rb.DSV,yb(t)},xb=function(t){return(arguments.length>2?arguments[2]:void 0).type=rb.DSV,mb(t)},Sb=function(t,e,i){var n=!dt(null==e?void 0:e.dependencyUpdate)||(null==e?void 0:e.dependencyUpdate);if(!t||!bt(t))throw new TypeError("Invalid data: must be DataView array!");return bt(i.rawData)&&i.rawData.forEach((function(t){t.target&&(t.target.removeListener("change",i.reRunAllTransform),t.target.removeListener("markRunning",i.markRunning))})),n&&t.forEach((function(t){t.target.addListener("change",i.reRunAllTransform),t.target.addListener("markRunning",i.markRunning)})),t},wb=0;function Ab(){return wb>1e8&&(wb=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+wb++}var Tb=function(){return u((function t(e){var i,n;o(this,t),this.options=e,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new ht,n=(null==e?void 0:e.name)?e.name:Ab("dataset"),this.name=n,this._logger=null!==(i=null==e?void 0:e.logger)&&void 0!==i?i:te.getInstance()}),[{key:"setLogger",value:function(t){this._logger=t}},{key:"getDataView",value:function(t){return this.dataViewMap[t]}},{key:"setDataView",value:function(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error("Error: dataView ".concat(t," 之前已存在,请重新命名"))),this.dataViewMap[t]=e}},{key:"removeDataView",value:function(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}},{key:"registerParser",value:function(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn("Warn: transform ".concat(t," 之前已注册,执行覆盖逻辑"))),this.parserMap[t]=e}},{key:"removeParser",value:function(t){this.parserMap[t]=null,delete this.parserMap[t]}},{key:"getParser",value:function(t){return this.parserMap[t]||this.parserMap.default}},{key:"registerTransform",value:function(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn("Warn: transform ".concat(t," 之前已注册,执行覆盖逻辑"))),this.transformMap[t]=e}},{key:"removeTransform",value:function(t){this.transformMap[t]=null,delete this.transformMap[t]}},{key:"getTransform",value:function(t){return this.transformMap[t]}},{key:"multipleDataViewAddListener",value:function(t,e,i){this._callMap||(this._callMap=new Map);var n=this._callMap.get(i);n||(n=function(){t.some((function(t){return t.isRunning}))||i()}),t.forEach((function(t){t.target.addListener(e,n)})),this._callMap.set(i,n)}},{key:"allDataViewAddListener",value:function(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}},{key:"multipleDataViewRemoveListener",value:function(t,e,i){if(this._callMap){var n=this._callMap.get(i);n&&t.forEach((function(t){t.target.removeListener(e,n)})),this._callMap.delete(i)}}},{key:"multipleDataViewUpdateInParse",value:function(t){var e=this;t.forEach((function(t){var i;return null===(i=e.getDataView(t.name))||void 0===i?void 0:i.markRunning()})),t.forEach((function(t){var i;return null===(i=e.getDataView(t.name))||void 0===i?void 0:i.parseNewData(t.data,t.options)}))}},{key:"multipleDataViewUpdateInRawData",value:function(t){var e=this;t.forEach((function(t){var i;return null===(i=e.getDataView(t.name))||void 0===i?void 0:i.markRunning()})),t.forEach((function(t){var i;return null===(i=e.getDataView(t.name))||void 0===i?void 0:i.updateRawData(t.data,t.options)}))}},{key:"destroy",value:function(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}])}(),Cb="_data-view-diff-rank",Eb=function(){function t(e,i){var n,r=this;o(this,t),this.dataSet=e,this.options=i,this.isDataView=!0,this.target=new ht,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return r.isRunning=!0,r.resetTransformData(),r.transformsArr.forEach((function(e){r.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),r.isLastTransform(e)&&r.diffLastData()})),r.isRunning=!1,!1!==t.emitMessage&&r.target.emit("change",[]),r},this.markRunning=function(){r.isRunning=!0,r.target.emit("markRunning",[])},n=(null==i?void 0:i.name)?i.name:Ab("dataview"),this.name=n,(null==i?void 0:i.history)&&(this.history=i.history,this.historyData=[]),this.dataSet.setDataView(n,this),this.setFields(null==i?void 0:i.fields)}return u(t,[{key:"parse",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.isRunning=!0,n&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);var r=this.cloneParseData(t,e);if(null==e?void 0:e.type){var a=(null!==(i=this.dataSet.getParser(e.type))&&void 0!==i?i:this.dataSet.getParser("bytejson"))(r,e.options,this);this.rawData=r,this.parserData=a,this.history&&this.historyData.push(r,a),this.latestData=a}else this.parserData=r,this.rawData=r,this.history&&this.historyData.push(r),this.latestData=r;return this.isRunning=!1,n&&this.target.emit("afterParse",[]),this}},{key:"transform",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){var i=!0;if("fields"===t.type){this._fields=t.options.fields;var n=this.transformsArr.findIndex((function(e){return e.type===t.type}));n>=0&&(i=!1,this.transformsArr[n].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){var r=this.isLastTransform(t);this.executeTransform(t),r&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}},{key:"isLastTransform",value:function(t){return this.transformsArr[this.transformsArr.length-1]===t}},{key:"sortTransform",value:function(){this.transformsArr.length>=2&&this.transformsArr.sort((function(t,e){var i,n;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(n=e.level)&&void 0!==n?n:0)}))}},{key:"executeTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0},i=e.pushHistory,n=e.emitMessage,r=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(r),this.latestData=r,!1!==n&&this.target.emit("change",[])}},{key:"resetTransformData",value:function(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}},{key:"enableDiff",value:function(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}},{key:"disableDiff",value:function(){this._diffData=!1,this._diffMap=null,this._diffRank=null}},{key:"resetDiff",value:function(){this._diffMap=new Map,this._diffRank=0}},{key:"diffLastData",value:function(){var t,e=this;if(this._diffData&&this.latestData.forEach&&(null===(t=this._diffKeys)||void 0===t?void 0:t.length)){var i,n=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((function(t){t[Cb]=n,e._diffMap.set(e._diffKeys.reduce((function(e,i){return e+t[i]}),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((function(t){t[Cb]=n,i=e._diffKeys.reduce((function(e,i){return e+t[i]}),""),e._diffMap.get(i)?e.latestDataAUD.update.push(t):e.latestDataAUD.add.push(t),e._diffMap.set(i,t)})),this._diffMap.forEach((function(t,i){t[Cb]<n&&(e.latestDataAUD.del.push(t),e._diffMap.delete(i))}));this._diffRank=n}}},{key:"cloneParseData",value:function(e,i){var n=!1;return e instanceof t||!0!==(null==i?void 0:i.clone)||(n=!0),n?Dt(e):e}},{key:"parseNewData",value:function(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}},{key:"updateRawData",value:function(t,e){var i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}},{key:"getFields",value:function(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}},{key:"setFields",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?zt({},this._fields,t):t;var i=this.transformsArr.find((function(t){return"fields"===t.type}));!vt(this._fields)&&vt(i)?(this.dataSet.registerTransform("fields",lb),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}},{key:"destroy",value:function(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}])}(),Bb=function(t,e){return ft(Mb.warnHandler)&&Mb.warnHandler.call(null,t,e),e?te.getInstance().warn("[VChart warn]: ".concat(t),e):te.getInstance().warn("[VChart warn]: ".concat(t))},Rb=function(t,e,i){if(!ft(Mb.errorHandler))throw new Error(t);Mb.errorHandler.call(null,t,e)},Mb={silent:!1,warnHandler:!1,errorHandler:!1},Pb=Of();function Ob(t){return("desktop-browser"===t||"mobile-browser"===t)&&Pb}function Ib(t){return Lb(t)||"mobile-browser"===t}function Lb(t){return t.includes("miniApp")||"lynx"===t||"wx"===t||"harmony"===t}var Db=0;function Fb(){return Db>=9999999&&(Db=0),Db++}function jb(t){return!(!t||0===t.length)&&!vt(t[0])&&!vt(t[0].dataId)&&bt(t[0].fields)}var Nb,zb=function(t){return function(e){return Ot(e,t)}},Ub=function(t){return t},Gb=function(t){te.getInstance().error(t)},Wb=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(ft(t))return t;var n=function(t){var e,i,n,r=[],a=t.length,o=null,s=0,u="";t+="";var l=function(){r.push(u+t.substring(e,i)),u="",e=i+1};for(e=0,i=0;i<a;i+=1)if("\\"===(n=t[i]))u+=t.substring(e,i),u+=t.substring(++i,++i),e=i;else if(n===o)l(),o=null,s=-1;else{if(o)continue;e===s&&'"'===n||e===s&&"'"===n?(e=i+1,o=n):"."!==n||s?"["===n?(i>e&&l(),s=e=i+1):"]"===n&&(s||Gb("Access path missing open bracket: "+t),s>0&&l(),s=0,e=i+1):i>e?l():e=i+1}return s&&Gb("Access path missing closing bracket: "+t),o&&Gb("Access path missing closing quote: "+t),i>e&&(i+=1,l()),r}(t),r=1===n.length?n[0]:t;return function(t,e,i){return t.fields=e||[],t.fname=i,t}((i&&i.get||zb)(n),[r],e||r)},Vb=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(bt(t)){var n=t.map((function(t){return Wb(t,e,i)}));return function(t){return n.map((function(e){return e(t)}))}}return Wb(t,e,i)},Hb=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"],Kb=function(t){function i(t,n){var r;return o(this,i),r=e(this,i,[t]),(null==n?void 0:n.mode)&&(r.mode=n.mode,r.setMode(n.mode)),(null==n?void 0:n.skipDefault)&&(r.skipDefault=!0),r.setTheme({common:{strokeBoundsBuffer:0}}),r.attribute=t,r.onSetStage((function(){r.render(),r.bindEvents()})),r}return h(i,t),u(i,[{key:"setAttribute",value:function(t,e,i){mt(this.attribute[t])&&mt(e)&&!ft(this.attribute[t])&&!ft(e)?zt(this.attribute[t],e):this.attribute[t]=e,Hb.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}},{key:"setAttributes",value:function(t,e){var i=Object.keys(t);this._mergeAttributes(t,i),i.every((function(t){return Hb.includes(t)}))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}},{key:"_mergeAttributes",value:function(t,e){vt(e)&&(e=Object.keys(t));for(var i=0;i<e.length;i++){var n=e[i];!mt(this.attribute[n])||ft(this.attribute[n])||ft(t[n])?this.attribute[n]=t[n]:zt(this.attribute[n],t[n])}}},{key:"bindEvents",value:function(){}},{key:"_getNodeId",value:function(t){var e;return"".concat(null!==(e=this.id)&&void 0!==e?e:this._uid,"-").concat(this.name,"-").concat(t)}},{key:"_dispatchEvent",value:function(t,e){var i,n=new Fr(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}])}(Ao);!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Nb||(Nb={})),l(l(l(l({},Nb.selectedReverse,{}),Nb.selected,{}),Nb.hover,{}),Nb.hoverReverse,{});var Xb,Yb={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},qb={poptip:zt({},Yb)};!function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(Xb||(Xb={}));var Zb={};function Jb(t){switch(t){case Xb.Linear:case Xb.Log:case Xb.Pow:case Xb.Sqrt:case Xb.Symlog:case Xb.Time:return!0;default:return!1}}function $b(t){return!!Zb[t]}function Qb(t){switch(t){case Xb.Ordinal:case Xb.Point:case Xb.Band:return!0;default:return!1}}function tx(t){return t}function ex(t,e){if(t=Number(t),e=Number(e),e-=t)return function(i){return(i-t)/e};var i=Number.isNaN(e)?NaN:.5;return function(){return i}}function ix(t,e,i){var n,r,a=t[0],o=t[1],s=e[0],u=e[1];return o<a?(n=ex(o,a),r=i(u,s)):(n=ex(a,o),r=i(s,u)),function(t){return r(n(t))}}function nx(t,e,i){var n;return n=1===t?t+2*i:t-e+2*i,t?n>0?n:1:0}function rx(t,e){var i=(t[1]-t[0])/(e[1]-e[0]),n=t[0]-i*e[0];return[n,i+n]}function ax(t,e,i){var n=Math.min(t.length,e.length)-1,r=new Array(n),a=new Array(n),o=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<n;)r[o]=ex(t[o],t[o+1]),a[o]=i(e[o],e[o+1]);return function(e){var i=ee(t,e,1,n)-1;return a[i](r[i](e))}}Object.values(Xb).forEach((function(t){Zb[t]=!0}));var ox=function(){return u((function t(){o(this,t),this._rangeFactorStart=null,this._rangeFactorEnd=null}),[{key:"_calculateWholeRange",value:function(t){return this._wholeRange?this._wholeRange:pt(this._rangeFactorStart)&&pt(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=rx(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}},{key:"rangeFactor",value:function(t,e,i){return t?(2===t.length&&t.every((function(t){return t>=0&&t<=1}))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):pt(this._rangeFactorStart)&&pt(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}},{key:"rangeFactorStart",value:function(t,e){var i;return vt(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!vt(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}},{key:"rangeFactorEnd",value:function(t,e){var i;return vt(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!vt(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}},{key:"generateFishEyeTransform",value:function(){var t;if(this._fishEyeOptions){var e=this._fishEyeOptions,i=e.distortion,n=void 0===i?2:i,r=e.radiusRatio,a=void 0===r?.1:r,o=e.radius,s=this.range(),u=s[0],l=s[s.length-1],h=Math.min(u,l),c=Math.max(u,l),d=ue(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,h,c),f=vt(o)?(c-h)*a:o,v=Math.exp(n);v=v/(v-1)*f;var p=n/f;this._fishEyeTransform=function(t){var e=Math.abs(t-d);if(e>=f)return t;if(e<=1e-6)return d;var i=v*(1-Math.exp(-e*p))/e*.75+.25;return d+(t-d)*i}}else this._fishEyeTransform=null}},{key:"unknown",value:function(t){return arguments.length?(this._unknown=t,this):this._unknown}},{key:"get",value:function(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}])}(),sx=Symbol("implicit"),ux=function(t){function i(){var t;return o(this,i),(t=e(this,i)).type=Xb.Ordinal,t._index=new Map,t._domain=[],t._ordinalRange=[],t._unknown=sx,t}return h(i,t),u(i,[{key:"specified",value:function(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}},{key:"_getSpecifiedValue",value:function(t){if(this._specified)return this._specified[t]}},{key:"clone",value:function(){var t=(new i).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}},{key:"calculateVisibleDomain",value:function(t){return pt(this._rangeFactorStart)&&pt(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}},{key:"scale",value:function(t){var e="".concat(t),i=this._getSpecifiedValue(e);if(void 0!==i)return i;var n=this._index.get(e);if(!n){if(this._unknown!==sx)return this._unknown;n=this._domain.push(t),this._index.set(e,n)}var r=this._ordinalRange[(n-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(r):r}},{key:"invert",value:function(t){for(var e=0;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}},{key:"domain",value:function(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;var e,i=_(t);try{for(i.s();!(e=i.n()).done;){var n=e.value,r="".concat(n);this._index.has(r)||this._index.set(r,this._domain.push(n))}}catch(t){i.e(t)}finally{i.f()}return this}},{key:"range",value:function(t){if(!t)return this._ordinalRange.slice();var e=Array.from(t);return this._ordinalRange=e,this}},{key:"index",value:function(t){var e;return this._index&&null!==(e=this._index.get("".concat(t)))&&void 0!==e?e:-1}}])}(ox);function lx(t,e,i,n){for(var r=[],a=t;a<=e;)r.push(a),a+=i;return n&&r.reverse(),r}function hx(t,e,i,n){var r,a;if(e=Math.floor(+e),t=Math.floor(+t),!(i=Math.floor(+i)))return[];if(t===e)return[t];if(r=e<t){var o=t;t=e,e=o}var s=le(1,e-t+1)(i);if(a=Math.floor((e-t+1)/s),!n)for(;Math.ceil((e-t+1)/a)>i&&s>1;)s-=1,a=Math.floor((e-t)/s);return lx(t,e,a,r)}var cx=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).type=Xb.Band,n._range=[0,1],n._step=void 0,n._bandwidth=void 0,n._isFixed=!1,n._round=!1,n._paddingInner=0,n._paddingOuter=0,n._align=.5,n._unknown=void 0,delete n.unknown,n.rescale(t),n}return h(i,t),u(i,[{key:"rescale",value:function(t,e){if(t)return this;this._wholeRange=null;var n=this._calculateWholeRange(this._range,e),r=p(c(i.prototype),"domain",this).call(this).length,a=n[1]<n[0],o=n[Number(a)-0],s=n[1-Number(a)],u=nx(r,this._paddingInner,this._paddingOuter);return this._step=(s-o)/Math.max(1,u||1),this._round&&(this._step=Math.floor(this._step)),o+=(s-o-this._step*(r-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(o=Math.round(o),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:a,start:a?o+this._step*(r-1):o,count:r},this.generateFishEyeTransform(),this}},{key:"scale",value:function(t){if(this._bandRangeState){var e="".concat(t),i=this._getSpecifiedValue(e);if(void 0!==i)return i;var n=this._index.get(e);if(!n){if(this._unknown!==sx)return this._unknown;n=this._domain.push(t),this._index.set(e,n)}var r=this._bandRangeState,a=r.count,o=r.start+(n-1)%a*(r.reverse?-1:1)*this._step;return this._fishEyeTransform?this._fishEyeTransform(o):o}}},{key:"_calculateWholeRange",value:function(t,e){if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){var n;if(pt(this._rangeFactorStart)&&pt(this._rangeFactorEnd)&&2===t.length){var r=rx(t,[this._rangeFactorStart,this._rangeFactorEnd]);n=Math.abs(r[1]-r[0])}else n=Math.abs(t[1]-t[0]);var a=function(t,e,i,n,r){var a=nx(t,i,n),o=e/Math.max(1,a||1);r&&(o=Math.floor(o));var s=o*(1-i);return r&&(s=Math.round(s)),s}(p(c(i.prototype),"domain",this).call(this).length,n,this._paddingInner,this._paddingOuter,this._round);a<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):a>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=a,this._isFixed=!1)}if(this.isBandwidthFixed()){var o=(g=p(c(i.prototype),"domain",this).call(this).length,y=this._bandwidth,m=this._paddingInner,k=this._paddingOuter,1===m&&(m=0),nx(g,m,k)*(y/(1-m))*Math.sign(t[1]-t[0])),s=Math.min((t[1]-t[0])/o,1);if(pt(this._rangeFactorStart)&&pt(this._rangeFactorEnd)){if(o>0){var u=t[0]-o*this._rangeFactorStart,l=u+o;this._wholeRange=[u,l]}else{var h=t[1]+o*(1-this._rangeFactorEnd),d=h-o;this._wholeRange=[d,h]}var f=this._rangeFactorStart+s<=1,v=this._rangeFactorEnd-s>=0;"rangeFactorStart"===e&&f?this._rangeFactorEnd=this._rangeFactorStart+s:"rangeFactorEnd"===e&&v?this._rangeFactorStart=this._rangeFactorEnd-s:t[0]<=t[1]?f?this._rangeFactorEnd=this._rangeFactorStart+s:v?this._rangeFactorStart=this._rangeFactorEnd-s:(this._rangeFactorStart=0,this._rangeFactorEnd=s):v?this._rangeFactorStart=this._rangeFactorEnd-s:f?this._rangeFactorEnd=this._rangeFactorStart+s:(this._rangeFactorStart=1-s,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=s,this._wholeRange=[t[0],t[0]+o];return this._wholeRange}var g,y,m,k;return p(c(i.prototype),"_calculateWholeRange",this).call(this,t)}},{key:"calculateWholeRangeSize",value:function(){var t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}},{key:"calculateVisibleDomain",value:function(t){var e=this._domain;if(pt(this._rangeFactorStart)&&pt(this._rangeFactorEnd)&&e.length){var i=this._getInvertIndex(t[0]),n=this._getInvertIndex(t[1]);return e.slice(Math.min(i,n),Math.max(i,n)+1)}return e}},{key:"domain",value:function(t,e){return t?(p(c(i.prototype),"domain",this).call(this,t),this.rescale(e)):p(c(i.prototype),"domain",this).call(this)}},{key:"range",value:function(t,e){return t?(this._range=[Zt(t[0]),Zt(t[1])],this.rescale(e)):this._range}},{key:"rangeRound",value:function(t,e){return this._range=[Zt(t[0]),Zt(t[1])],this._round=!0,this.rescale(e)}},{key:"ticks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return-1===t?e:hx(0,e.length-1,t,!1).map((function(t){return e[t]}))}},{key:"tickData",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.ticks(e).map((function(e,i){return{index:i,tick:e,value:(t.scale(e)-t._range[0]+t._bandwidth/2)/(t._range[1]-t._range[0])}}))}},{key:"forceTicks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return hx(0,e.length-1,t,!0).filter((function(t){return t<e.length})).map((function(t){return e[t]}))}},{key:"stepTicks",value:function(t){var e=this.calculateVisibleDomain(this._range);return function(t,e,i){var n;if(i=le(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+i)),n=e<t){var r=t;t=e,e=r}return lx(t,e,i,n)}(0,e.length-1,t).map((function(t){return e[t]}))}},{key:"_getInvertIndex",value:function(t){var e=0,i=this.step()/2,n=this.bandwidth()/2,r=this._domain.length,a=this.range(),o=a[0]>a[a.length-1];for(e=0;e<r;e++){var s=this.scale(this._domain[e])+n;if(0===e&&(!o&&!ae(t,s+i)||o&&!oe(t,s-i)))break;if(e===r-1)break;if(!oe(t,s-i)&&!ae(t,s+i))break}return e>=0&&e<=r-1?e:r-1}},{key:"invert",value:function(t){return this._domain[this._getInvertIndex(t)]}},{key:"padding",value:function(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}},{key:"paddingInner",value:function(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}},{key:"paddingOuter",value:function(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}},{key:"step",value:function(){return this._step}},{key:"round",value:function(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}},{key:"align",value:function(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}},{key:"rangeFactor",value:function(t,e){return t?(p(c(i.prototype),"rangeFactor",this).call(this,t),this.rescale(e)):p(c(i.prototype),"rangeFactor",this).call(this)}},{key:"rangeFactorStart",value:function(t,e){return vt(t)?p(c(i.prototype),"rangeFactorStart",this).call(this):(p(c(i.prototype),"rangeFactorStart",this).call(this,t),this.rescale(e,"rangeFactorStart"))}},{key:"rangeFactorEnd",value:function(t,e){return vt(t)?p(c(i.prototype),"rangeFactorEnd",this).call(this):(p(c(i.prototype),"rangeFactorEnd",this).call(this,t),this.rescale(e,"rangeFactorEnd"))}},{key:"bandwidth",value:function(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}},{key:"maxBandwidth",value:function(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}},{key:"minBandwidth",value:function(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}},{key:"fishEye",value:function(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}},{key:"isBandwidthFixed",value:function(){return this._isFixed&&!!this._bandwidth}},{key:"_isBandwidthFixedByUser",value:function(){return this._isFixed&&this._userBandwidth&&wt(this._userBandwidth)}},{key:"clone",value:function(){var t,e,n;return new i(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(n=this._maxBandwidth)&&void 0!==n?n:"auto")}}])}(ux),dx=function(t,e){var i=t.r,n=e.r,r=t.g,a=e.g,o=t.b,s=e.b,u=t.opacity,l=e.opacity;return function(t){var e=Math.round(i*(1-t)+n*t),h=Math.round(r*(1-t)+a*t),c=Math.round(o*(1-t)+s*t);return new Ze(e,h,c,u*(1-t)+l*t)}};function fx(t,e){var i,n=a(e);if(vt(e)||"boolean"===n)return function(){return e};if("number"===n)return de(t,e);if("string"===n){if(i=qe.parseColorString(e)){var r=dx(qe.parseColorString(t),i);return function(t){return r(t).formatRgb()}}return de(Number(t),Number(e))}return e instanceof Ze?dx(t,e):e instanceof qe?dx(t.color,e.color):e instanceof Date?function(t,e){var i=t.valueOf(),n=e.valueOf(),r=new Date;return function(t){return r.setTime(i*(1-t)+n*t),r}}(t,e):de(Number(t),Number(e))}var vx=function(t){function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tx,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tx;return o(this,i),(t=e(this,i))._unknown=void 0,t.transformer=n,t.untransformer=r,t._forceAlign=!0,t._domain=[0,1],t._range=[0,1],t._clamp=tx,t._piecewise=ix,t._interpolate=fx,t}return h(i,t),u(i,[{key:"calculateVisibleDomain",value:function(t){var e;return pt(this._rangeFactorStart)&&pt(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}},{key:"fishEye",value:function(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}},{key:"scale",value:function(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));var i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}},{key:"invert",value:function(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),de)),this._clamp(this.untransformer(this._input(t)))}},{key:"domain",value:function(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;var n=Array.from(t,Zt);return this._domain=n,this.rescale(e)}},{key:"range",value:function(t,e){if(!t)return this._range.slice();var i=Array.from(t);return this._range=i,this.rescale(e)}},{key:"rangeRound",value:function(t,e){var i=Array.from(t);return this._range=i,this._interpolate=fe,this.rescale(e)}},{key:"rescale",value:function(t){var e;if(t)return this;var i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,n=i.length,r=this._range.length,a=Math.min(n,r);if(n&&n<r&&this._forceAlign){for(var o=r-n+1,s=i[n-1],u=n>=2?(s-i[n-2])/o:0,l=1;l<=o;l++)i[n-2+l]=s-u*(o-l);a=r}return this._autoClamp&&(this._clamp=le(i[0],i[a-1])),this._piecewise=a>2?ax:ix,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}},{key:"clamp",value:function(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:tx),this.rescale(i)):this._clamp!==tx}},{key:"interpolate",value:function(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}},{key:"ticks",value:function(){return[]}},{key:"tickData",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=this.ticks(e);return(null!=i?i:[]).map((function(e,i){return{index:i,tick:e,value:(t.scale(e)-t._range[0])/(t._range[1]-t._range[0])}}))}},{key:"rangeFactor",value:function(t,e){return t?(p(c(i.prototype),"rangeFactor",this).call(this,t),this._output=this._input=null,this):p(c(i.prototype),"rangeFactor",this).call(this)}},{key:"rangeFactorStart",value:function(t,e){return vt(t)?p(c(i.prototype),"rangeFactorStart",this).call(this):(p(c(i.prototype),"rangeFactorStart",this).call(this,t),this._output=this._input=null,this)}},{key:"rangeFactorEnd",value:function(t,e){return vt(t)?p(c(i.prototype),"rangeFactorEnd",this).call(this):(p(c(i.prototype),"rangeFactorEnd",this).call(this,t),this._output=this._input=null,this)}},{key:"forceAlignDomainRange",value:function(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}])}(ox),px=Math.sqrt(50),gx=Math.sqrt(10),yx=Math.sqrt(2),mx=[1,2,5,10],kx=function(t,e,i){var n=1,r=t,a=Math.floor((e-1)/2),o=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?r=0:t<0&&t>=-Number.MIN_VALUE?r=-(e-1):!i&&o<1?n=Sx(o).step:(i||o>1)&&(r=Math.floor(t)-a*n),n>0?(t>0?r=Math.max(r,0):t<0&&(r=Math.min(r,-(e-1)*n)),function(t,e,i){pt(e)||(e=t,t=0),pt(i)||(i=1);for(var n=-1,r=0|Math.max(0,Math.ceil((e-t)/i)),a=new Array(r);++n<r;)a[n]=t+n*i;return a}(0,e).map((function(t){return r+t*n}))):t>0?bx(0,-(e-1)/n,n):bx((e-1)/n,0,n)},_x=se((function(t,e,i,n){var r,a,o,s,u=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((r=e<t)&&(a=t,t=e,e=a),s=wx(t,e,i).step,!isFinite(s))return[];if(s>0){var l=Math.round(t/s),h=Math.round(e/s);for(l*s<t&&++l,h*s>e&&--h,o=new Array(a=h-l+1);++u<a;)o[u]=(l+u)*s}else if(s<0&&(null==n?void 0:n.noDecimals)){s=1;var c=Math.ceil(t),d=Math.floor(e);if(!(c<=d))return[];for(o=new Array(a=d-c+1);++u<a;)o[u]=c+u}else{s=-s;var f=Math.round(t*s),v=Math.round(e*s);for(f/s<t&&++f,v/s>e&&--v,o=new Array(a=v-f+1);++u<a;)o[u]=(f+u)/s}return r&&o.reverse(),o})),bx=function(t,e,i){var n,r,a=-1;if(i>0){var o=Math.floor(t/i),s=Math.ceil(e/i);for((o+1)*i<t&&++o,(s-1)*i>e&&--s,r=new Array(n=s-o+1);++a<n;)r[a]=(o+a)*i}else{i=-i;var u=Math.floor(t*i),l=Math.ceil(e*i);for((u+1)/i<t&&++u,(l-1)/i>e&&--l,r=new Array(n=l-u+1);++a<n;)r[a]=(u+a)/i}return r},xx=se((function(t,e,i,n){var r,a,o;if(i=+i,(t=+t)==(e=+e))return kx(t,i,null==n?void 0:n.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return kx(t,i,null==n?void 0:n.noDecimals);(r=e<t)&&(o=t,t=e,e=o);var s=wx(t,e,i),u=s.step;if(!isFinite(u))return[];if(u>0){for(var l=1,h=s.power,c=10===s.gap?2*Math.pow(10,h):1*Math.pow(10,h);l<=5&&(a=bx(t,e,u)).length>i+1&&i>2;)u+=c,l+=1;i>2&&a.length<i-1&&(a=function(t,e,i){var n,r=t[0],a=t[t.length-1],o=e-t.length;if(a<=0){var s=[];for(n=o;n>=1;n--)s.push(r-n*i);return s.concat(t)}if(r>=0){for(n=1;n<=o;n++)t.push(a+n*i);return t}var u=[],l=[];for(n=1;n<=o;n++)n%2==0?u=[r-Math.floor(n/2)*i].concat(u):l.push(a+Math.ceil(n/2)*i);return u.concat(t).concat(l)}(a,i,u))}else(null==n?void 0:n.noDecimals)&&u<0&&(u=1),a=bx(t,e,u);return r&&a.reverse(),a})),Sx=function(t){var e=Math.floor(Math.log(t)/Math.LN10),i=t/Math.pow(10,e),n=mx[0];return i>=px?n=mx[3]:i>=gx?n=mx[2]:i>=yx&&(n=mx[1]),e>=0?{step:n*Math.pow(10,e),gap:n,power:e}:{step:-Math.pow(10,-e)/n,gap:n,power:e}};function wx(t,e,i){var n=(e-t)/Math.max(0,i);return Sx(n)}function Ax(t,e,i){var n;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(n=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(n))return[];for(var r=new Array(i),a=0;a<i;a++)r[a]=t+a*n;return r}function Tx(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=0,a=t.length-1,o=t[r],s=t[a],u=10;for(s<o&&(i=o,o=s,s=i,i=r,r=a,a=i);u-- >0;){if((i=wx(o,s,n).step)===e)return t[r]=o,t[a]=s,t;if(i>0)o=Math.floor(o/i)*i,s=Math.ceil(s/i)*i;else{if(!(i<0))break;o=Math.ceil(o*i)/i,s=Math.floor(s*i)/i}e=i}}var Cx=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type=Xb.Linear,t}return h(i,t),u(i,[{key:"clone",value:function(){return(new i).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}},{key:"tickFormat",value:function(){return function(){}}},{key:"d3Ticks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0,i=this.calculateVisibleDomain(this._range);return _x(i[0],i[i.length-1],t,e)}},{key:"ticks",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1?arguments[1]:void 0;if(ft(null==i?void 0:i.customTicks))return i.customTicks(this,e);if(pt(this._rangeFactorStart)&&pt(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(e,i);var n=null!==(t=this._niceDomain)&&void 0!==t?t:this._domain,r=this._domain,a=n[0],o=n[n.length-1],s=xx(r[0],r[r.length-1],e,i);if(!s.length)return s;if(this._domainValidator)s=s.filter(this._domainValidator);else if((s[0]!==a||s[s.length-1]!==o)&&this._niceType){var u=n.slice();if("all"===this._niceType?(u[0]=s[0],u[u.length-1]=s[s.length-1],this._niceDomain=u,this.rescale()):"min"===this._niceType&&s[0]!==a?(u[0]=s[0],this._niceDomain=u,this.rescale()):"max"===this._niceType&&s[s.length-1]!==o&&(u[u.length-1]=s[s.length-1],this._niceDomain=u,this.rescale()),"all"!==this._niceType){var l=Math.min(u[0],u[u.length-1]),h=Math.max(u[0],u[u.length-1]);s=s.filter((function(t){return t>=l&&t<=h}))}}return s}},{key:"forceTicks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return Ax(e[0],e[e.length-1],t)}},{key:"stepTicks",value:function(t){var e=this.calculateVisibleDomain(this._range);return function(t,e,i){var n,r,a=-1;if(i=+i,(r=(e=+e)<(t=+t))&&(n=t,t=e,e=n),!isFinite(i)||e-t<=i)return[t];for(var o=Math.floor((e-t)/i+1),s=new Array(o);++a<o;)s[a]=t+a*i;return r&&s.reverse(),s}(e[0],e[e.length-1],t)}},{key:"nice",value:function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=arguments.length>1?arguments[1]:void 0,r=this._domain,a=[];if(n){var o=function(t,e){var i=wt(e.forceMin),n=wt(e.forceMax),r=null,a=[],o=null,s=i&&n?function(t){return t>=e.forceMin&&t<=e.forceMax}:i?function(t){return t>=e.forceMin}:n?function(t){return t<=e.forceMax}:null;return i?a[0]=e.forceMin:wt(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(a[0]=e.min),n?a[1]=e.forceMax:wt(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(a[1]=e.max),wt(a[0])&&wt(a[1])?((o=t.slice())[0]=a[0],o[o.length-1]=a[1]):r=wt(a[0])||wt(a[1])?wt(a[0])?"max":"min":"all",{niceType:r,niceDomain:o,niceMinMax:a,domainValidator:s}}(r,n);if(a=o.niceMinMax,this._domainValidator=o.domainValidator,this._niceType=o.niceType,o.niceDomain)return this._niceDomain=o.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){var s=Tx(r.slice(),i);"min"===this._niceType?s[s.length-1]=null!==(t=a[1])&&void 0!==t?t:s[s.length-1]:"max"===this._niceType&&(s[0]=null!==(e=a[0])&&void 0!==e?e:s[0]),this._niceDomain=s,this.rescale()}return this}},{key:"niceMin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="min";var e=this._domain[this._domain.length-1],i=Tx(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}},{key:"niceMax",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="max";var e=this._domain[0],i=Tx(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}])}(vx),Ex=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[!1])).type=Xb.Point,n._padding=0,n.paddingInner(1,t),n.padding=n.paddingOuter,n.paddingInner=void 0,n.paddingOuter=void 0,n}return h(i,t),u(i)}(cx),Bx=function(){function t(){o(this,t),this.type=Xb.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}return u(t,[{key:"unknown",value:function(t){return arguments.length?(this._unknown=t,this):this._unknown}},{key:"scale",value:function(t){return!vt(t)&&At(+t)?this._range[ee(this._domain,t,0,this.n)]:this._unknown}},{key:"invertExtent",value:function(t){var e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}},{key:"domain",value:function(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}},{key:"range",value:function(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}},{key:"clone",value:function(){return(new t).domain(this._domain).range(this._range).unknown(this._unknown)}}])}();Mk(),Qk(),Jk(),Lk();var Rx,Mx,Px=function(t){function i(t,n){var r;return o(this,i),(r=e(this,i,[(null==n?void 0:n.skipDefault)?t:zt({},i.defaultAttributes,t)])).name="timeline",r}return h(i,t),u(i,[{key:"render",value:function(){var t=this,e=this.attribute,i=e.width,n=e.lineStyle,r=e.activeLineStyle,a=e.symbolStyle,o=e.activeSymbolStyle,s=e.labelStyle,u=e.activeLabelStyle,l=e.times,h=e.pointLayoutMode,c=e.labelSpace,d=e.clipRange,f=e.animation;if(l&&l.length){var v=(bt(a.size)?a.size[1]:a.size)||0,p=(bt(o.size)?o.size[1]:o.size)||0,g=Math.max(n.lineWidth||0,r.lineWidth||0,v,p),y=g/2,m={y:y,points:[{x:0,y:0},{x:i,y:0}]};this._line=this.createOrUpdateChild("line-axes",Object.assign(Object.assign({},n),m),"line"),this._activeLine=this.createOrUpdateChild("active-line-axes",Object.assign(Object.assign(Object.assign({},r),m),{clipRange:d}),"line");var k=i*d,_=this.createOrUpdateChild("symbol-group",{y:y},"group"),b=1===l.length?i:"space-between"===h?i/(l.length-1):i/l.length,x="space-between"===h?0:b/2;this._timesPercent=l.map((function(t,e){return(x+b*e)/i})),l.forEach((function(e,n){var r=t._timesPercent[n]*i;_.createOrUpdateChild(e.label,Object.assign(Object.assign({},a),{x:r}),"symbol")})),this._symbolGroup=_;var S=g+c,w=this.createOrUpdateChild("label-group",{y:S},"group");l.forEach((function(e,n){var r=t._timesPercent[n]*i;w.createOrUpdateChild(e.label,Object.assign(Object.assign({},s),{x:r,text:e.label}),"text")})),this._labelGroup=w;var A=function(t,e){t.forEachChildren((function(t){if(t.currentStates){var i=t.currentStates;t.clearStates(),t.useStates(i,!1)}t.states={active:e},t.attribute.x<=k&&t.useStates(["active"],f)}))};A(w,u),A(_,o)}}},{key:"appearAnimate",value:function(t){var e=t.duration,i=void 0===e?1e3:e,n=t.easing,r=void 0===n?"quadOut":n,a=this.attribute,o=a.activeLabelStyle,s=a.activeSymbolStyle,u=i/1e3,l=500*u,h=200*u,c=100*u,d=90*u,f=100*u,v=600*u;if(this._line&&(this._line.setAttributes({clipRange:0}),this._line.animate().to({clipRange:1},l,r)),this._activeLine&&(this._activeLine.setAttributes({opacity:0}),this._activeLine.animate().wait(500).to({opacity:1},h,r)),this._symbolGroup){var p=this._symbolGroup.count-1,g=u*(1===p?0:400/(p-1)),y=u*(1===p?0:240/(p-1));this._symbolGroup.forEachChildren((function(t,e){var i={};Object.keys(s).forEach((function(e){i[e]=t.attribute[e]})),t.setAttributes({opacity:0}),t.animate().wait(f+g*e).to({opacity:1},c,r),t.animate().wait(v+y*e).to(Object.assign({},s),d,r).to(Object.assign({},i),d,r)}))}if(this._labelGroup){var m=this._labelGroup.count-1,k=u*(1===m?0:400/(m-1)),_=u*(1===m?0:240/(m-1));this._labelGroup.forEachChildren((function(t,e){var i={};Object.keys(o).forEach((function(e){i[e]=t.attribute[e]})),t.setAttributes({opacity:0}),t.animate().wait(f+k*e).to({opacity:1},c,r),t.animate().wait(v+_*e).to(Object.assign({dy:10},o),d,r).to(Object.assign({dy:0},i),d,r)}))}}},{key:"goto",value:function(t,e){var i=this.attribute.clipRange,n=this.attribute.animation;if(t>0){if(i>=1)return;i<0&&(i=0)}else{if(i<=0)return;i>1&&(i=1)}i!==this.attribute.clipRange&&this.setAttributes({clipRange:i});for(var r=0;r<this._timesPercent.length&&!(i<this._timesPercent[r]);r++);var a=t>0?this._timesPercent[r]||1:this._timesPercent[r-1]||0;if(n){var o=e.duration,s=void 0===o?1e3:o,u=e.easing,l=void 0===u?"quadOut":u;this.animate().to({clipRange:a},s,l)}else this.setAttributes({clipRange:a})}},{key:"forward",value:function(t){this.goto(1,t)}},{key:"backward",value:function(t){this.goto(-1,t)}}])}(Kb);function Ox(t,e){var i=Ix(t),n=Ix(e),r=Math.asin((t.x*e.y-e.x*t.y)/i/n),a=Math.acos((t.x*e.x+t.y*e.y)/i/n);return r<0?-a:a}function Ix(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:0,y:0};return Re.distancePP(t,e)}Px.defaultAttributes={labelSpace:10,pointLayoutMode:"space-around",animation:!0,symbolStyle:{fill:"black",size:12,symbolType:"circle"},activeSymbolStyle:{fill:"orange",size:16},lineStyle:{lineDash:[2,2],lineCap:"butt",stroke:"black",lineWidth:2},activeLineStyle:{stroke:"orange",lineWidth:4},labelStyle:{fontSize:12,fill:"black",textAlign:"center",textBaseline:"top"},activeLabelStyle:{fontSize:14,fill:"orange"},clipRange:0},function(t){t.area="area",t.line="line",t.bar="bar",t.bar3d="bar3d",t.rangeColumn="rangeColumn",t.rangeColumn3d="rangeColumn3d",t.rangeArea="rangeArea",t.dot="dot",t.geo="geo",t.link="link",t.map="map",t.pie="pie",t.pie3d="pie3d",t.radar="radar",t.rose="rose",t.scatter="scatter",t.circularProgress="circularProgress",t.wordCloud="wordCloud",t.wordCloud3d="wordCloud3d",t.funnel="funnel",t.funnel3d="funnel3d",t.linearProgress="linearProgress",t.boxPlot="boxPlot",t.sankey="sankey",t.gaugePointer="gaugePointer",t.gauge="gauge",t.treemap="treemap",t.sunburst="sunburst",t.circlePacking="circlePacking",t.waterfall="waterfall",t.heatmap="heatmap",t.correlation="correlation",t.liquid="liquid",t.venn="venn",t.mosaic="mosaic"}(Rx||(Rx={})),function(t){t.label="label",t.point="point",t.line="line",t.area="area",t.bar="bar",t.bar3d="bar3d",t.boxPlot="boxPlot",t.outlier="outlier",t.circlePacking="circlePacking",t.group="group",t.gridBackground="gridBackground",t.grid="grid",t.dot="dot",t.title="title",t.subTitle="subTitle",t.symbol="symbol",t.funnel="funnel",t.funnel3d="funnel3d",t.transform="transform",t.transform3d="transform3d",t.transformLabel="transformLabel",t.outerLabel="outerLabel",t.outerLabelLine="outerLabelLine",t.pin="pin",t.pinBackground="pinBackground",t.pointer="pointer",t.segment="segment",t.track="track",t.cell="cell",t.cellBackground="cellBackground",t.link="link",t.arrow="arrow",t.pie="pie",t.pie3d="pie3d",t.labelLine="labelLine",t.progress="progress",t.minLabel="minLabel",t.maxLabel="maxLabel",t.rose="rose",t.node="node",t.sunburst="sunburst",t.nonLeaf="nonLeaf",t.leaf="leaf",t.nonLeafLabel="nonLeafLabel",t.leaderLine="leaderLine",t.stackLabel="stackLabel",t.word="word",t.fillingWord="fillingWord",t.wordMask="wordMask",t.nodePoint="nodePoint",t.ripplePoint="ripplePoint",t.centerPoint="centerPoint",t.centerLabel="centerLabel",t.barBackground="barBackground",t.lineLabel="lineLabel",t.areaLabel="areaLabel",t.liquidGroup="liquidGroup",t.liquid="liquid",t.liquidBackground="liquidBackground",t.liquidOutline="liquidOutline",t.circle="circle",t.overlap="overlap",t.overlapLabel="overlapLabel"}(Mx||(Mx={}));var Lx={primaryFontColor:"titleFontColor",tertiaryFontColor:"labelFontColor",axisLabelFontColor:"axisFontColor",axisMarkerFontColor:"labelReverseFontColor",dataZoomHandleStrokeColor:"dataZoomHandlerStrokeColor",sliderHandleColor:"dataZoomHandlerFillColor",sliderRailColor:"dataZoomBackgroundColor",sliderTrackColor:"dataZoomSelectedColor",playerControllerColor:"dataZoomSelectedColor",popupBackgroundColor:"tooltipBackgroundColor",hoverBackgroundColor:"axisGridColor"},Dx={titleFontColor:"primaryFontColor",labelFontColor:"tertiaryFontColor",axisFontColor:"axisLabelFontColor",labelReverseFontColor:"axisMarkerFontColor",dataZoomHandlerStrokeColor:"dataZoomHandleStrokeColor",dataZoomHandlerFillColor:"sliderHandleColor",dataZoomBackgroundColor:"sliderRailColor",dataZoomSelectedColor:"sliderTrackColor",tooltipBackgroundColor:"popupBackgroundColor"};function Fx(t,e){var i;if(!t)return[];var n=Gx(t,e);if(!n||bt(n))return null!==(i=n)&&void 0!==i?i:[];if(gt(n)){var r=n.dataScheme;return r?Ux(r)?r.map((function(i){return Object.assign(Object.assign({},i),{scheme:i.scheme.map((function(i){return zx(i)?Nx(t,i,e):i})).filter(pt)})})):r.map((function(i){return zx(i)?Nx(t,i,e):i})).filter(pt):[]}return[]}function jx(t,e){var i,n;return Ux(t)?null!==(n=null===(i=t.find((function(t){return pt(t.isAvailable)?ft(t.isAvailable)?t.isAvailable(e):!!t.isAvailable:!pt(t.maxDomainLength)||(null==e?void 0:e.length)<=t.maxDomainLength})))||void 0===i?void 0:i.scheme)&&void 0!==n?n:t[t.length-1].scheme:t}function Nx(t,e,i){var n,r=Gx(t,i);if(r){var a,o=r.palette;if(gt(o)&&(a=null!==(n=function(t,e){var i=Lx[e];if(i&&t[i])return t[i];if(t[e])return t[e];var n=Dx[e];return n?t[n]:void 0}(o,e.key))&&void 0!==n?n:e.default),a){if(vt(e.a)&&vt(e.l)||!_t(a))return a;var s=new qe(a);if(pt(e.l)){var u=s.color,l=Ne(u.r,u.g,u.b),h=je(l.h,l.s,e.l),c=new qe("rgb(".concat(h.r,", ").concat(h.g,", ").concat(h.b,")"));c.setOpacity(s.color.opacity),s=c}return pt(e.a)&&s.setOpacity(e.a),s.toRGBA()}}}function zx(t){return t&&"palette"===t.type&&!!t.key}function Ux(t){return!(!bt(t)||0===t.length)&&t.every((function(t){return pt(t.scheme)}))}function Gx(t,e){var i,n,r,a=(null!=e?e:{}).type;if(!e||vt(a))r=null==t?void 0:t.default;else{var o=function(t){var e,i;return t.type===Rx.sankey?null!==(e=t.direction)&&void 0!==e?e:"horizontal":null!==(i=t.direction)&&void 0!==i?i:"vertical"}(e);r=null!==(n=null!==(i=null==t?void 0:t["".concat(a,"_").concat(o)])&&void 0!==i?i:null==t?void 0:t[a])&&void 0!==n?n:null==t?void 0:t.default}return r}var Wx=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"range",value:function(t){return t?(this._range=t,this._resetRange(),this):p(c(i.prototype),"range",this).call(this)}},{key:"domain",value:function(t){return t?(p(c(i.prototype),"domain",this).call(this,t),this._resetRange(),this):p(c(i.prototype),"domain",this).call(this)}},{key:"_resetRange",value:function(){if(Ux(this._range)){var t=jx(this._range,this._domain);p(c(i.prototype),"range",this).call(this,t)}else p(c(i.prototype),"range",this).call(this,this._range)}}])}(ux),Vx={linear:Cx,band:cx,point:Ex,ordinal:ux,threshold:Bx,colorOrdinal:Wx};function Hx(t){var e=Vx[t];return e?new e:null}function Kx(t){return!!_t(t)&&!!t.endsWith("%")&&function(t){return null!=t&&""!==t&&(!!wt(t)||+t==+t)}(t.substring(0,t.length-1))}function Xx(t,e,i){var n,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return wt(t)?t:Kx(t)?Number(t.substring(0,t.length-1))*e/100:ft(t)?t(i):gt(t)?e*(null!==(n=t.percent)&&void 0!==n?n:0)+(null!==(r=t.offset)&&void 0!==r?r:0):a}function Yx(t,e,i){var n,r,a,o,s={top:0,bottom:0,left:0,right:0};return Object.values(t).every((function(t){return wt(t)}))?(s.top=null!==(n=t.top)&&void 0!==n?n:0,s.right=null!==(r=t.right)&&void 0!==r?r:0,s.bottom=null!==(a=t.bottom)&&void 0!==a?a:0,s.left=null!==(o=t.left)&&void 0!==o?o:0,s):([{orients:["left","right"],size:e.width},{orients:["top","bottom"],size:e.height}].forEach((function(e){e.orients.forEach((function(n){s[n]=Xx(t[n],e.size,i)}))})),s)}function qx(t){var e,i={};return bt(t)?(vt(t[0])||(i.top=i.left=i.bottom=i.right=t[0]),vt(t[1])||(i.left=i.right=t[1]),vt(t[2])||(i.bottom=t[2]),vt(t[3])||(i.left=t[3]),i):wt(t)||Kx(t)||ft(t)||gt(e=t)&&("percent"in e||"offset"in e)?(i.top=i.left=i.bottom=i.right=t,i):gt(t)?i=Object.assign({},t):i}function Zx(t,e,i){return i?{x:t.x+e.x,y:t.y+e.y}:t}var Jx=[{maxDomainLength:10,scheme:["#1664FF","#1AC6FF","#FF8A00","#3CC780","#7442D4","#FFC400","#304D77","#B48DEB","#009488","#FF7DDA"]},{scheme:["#1664FF","#B2CFFF","#1AC6FF","#94EFFF","#FF8A00","#FFCE7A","#3CC780","#B9EDCD","#7442D4","#DDC5FA","#FFC400","#FAE878","#304D77","#8B959E","#B48DEB","#EFE3FF","#009488","#59BAA8","#FF7DDA","#FFCFEE"]}],$x={default:{dataScheme:Jx,palette:{backgroundColor:"#ffffff",borderColor:"#e3e5e8",shadowColor:"rgba(33,37,44,0.1)",hoverBackgroundColor:"#f1f2f5",sliderRailColor:"#f1f3f4",sliderHandleColor:"#ffffff",sliderTrackColor:"#0040ff",popupBackgroundColor:"#ffffff",primaryFontColor:"#21252c",secondaryFontColor:"#606773",tertiaryFontColor:"#89909d",axisLabelFontColor:"#89909d",disableFontColor:"#bcc1cb",axisMarkerFontColor:"#ffffff",axisGridColor:"#f1f2f5",axisDomainColor:"#d9dde4",dataZoomHandleStrokeColor:"#aeb5be",dataZoomChartColor:"#c9ced8",playerControllerColor:"#0040ff",scrollBarSliderColor:"rgba(0,0,0,0.3)",axisMarkerBackgroundColor:"#21252c",markLabelBackgroundColor:"#f1f2f5",markLineStrokeColor:"#606773",dangerColor:"#e33232",warningColor:"#ffc528",successColor:"#07a35a",infoColor:"#3073f2",discreteLegendPagerTextColor:"rgb(51, 51, 51)",discreteLegendPagerHandlerColor:"rgb(47, 69, 84)",discreteLegendPagerHandlerDisableColor:"rgb(170, 170, 170)",emptyCircleColor:"#e3e5e8"}}},Qx=function(t){var e={label:{style:{fill:"white",textBaseline:"middle",lineWidth:2}},outerLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"}},line:{style:{stroke:{type:"palette",key:"axisDomainColor"}}}},transformLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle"}}};return e[t?"transform3d":"transform"]={style:{fill:{type:"palette",key:"axisGridColor"}}},e},tS=Qx(),eS=Qx(!0),iS="M1 0 C1 0.55228 0.55228 1 0 1 C-0.552285 1 -1 0.55228 -1 0 C-1 -0.552285 -0.552285 -1 0 -1 C0.55228 -1 1 -0.552285 1 0Z",nS="__VCHART",rS=500,aS=500,oS={scatter:{point:{style:{size:8,symbolType:"circle",lineWidth:0,fillOpacity:.8}},label:{visible:!1,offset:5,position:"top",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},line:{label:{visible:!1,position:"top",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},area:{label:{visible:!1,offset:5,position:"top",style:{stroke:{type:"palette",key:"backgroundColor"},lineWidth:2}},point:{style:{symbolType:"circle"}},seriesMark:"area"},bar:{label:{visible:!1,position:"outside",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}},pie:{outerRadius:.6,pie:{style:{fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside",style:{fontWeight:"normal",stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1}},innerLabel:{style:{lineWidth:2}},emptyCircle:{style:{fill:{type:"palette",key:"emptyCircleColor"},fillOpacity:1}}},pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}},map:{defaultFillColor:"#f3f3f3",area:{style:{lineWidth:.5,strokeOpacity:1,stroke:"black",fillOpacity:1}},label:{interactive:!1,style:{fontSize:{type:"token",key:"l6FontSize"},lineHeight:{type:"token",key:"l6LineHeight"},textBaseline:"middle",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},stroke:{type:"palette",key:"backgroundColor"}}}},radar:{label:{visible:!1,offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},dot:{dot:{style:{size:10,fillOpacity:1}},symbol:{style:{size:10}},title:{style:{textAlign:"left",textBaseline:"middle",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},subTitle:{style:{textAlign:"left",textBaseline:"top",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},link:{arrow:{style:{size:10}}},wordCloud:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},funnel:tS,funnel3d:eS,linearProgress:{bandWidth:30,progress:{style:{fillOpacity:1}},track:{style:{fill:"#E7EBED",fillOpacity:1}}},circularProgress:{outerRadius:.8,innerRadius:.6,progress:{style:{fillOpacity:1}},track:{style:{fillOpacity:.2}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},waterfall:{seriesFieldName:{total:"total",increase:"increase",decrease:"decrease"},leaderLine:{style:{stroke:"black",lineWidth:1,lineDash:[4,4]}},stackLabel:{visible:!0,offset:12,position:"withChange",style:{fill:"black",fontSize:{type:"token",key:"l4FontSize"}}},label:{visible:!1,offset:12,position:"inside",style:{lineWidth:2}}},gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},gaugePointer:{pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:iS,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:iS,fill:"#ddd"}}},treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}},sunburst:{innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},rangeColumn:{label:{visible:!1,offset:5,position:"inside",style:{lineWidth:2,fill:{type:"palette",key:"axisMarkerFontColor"}},minLabel:{position:"end"},maxLabel:{position:"start"}}},circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},heatmap:{cell:{style:{shape:"square",fillOpacity:1}},cellBackground:{visible:!1}},sankey:{link:{style:{fillOpacity:.15,round:!0}}},rose:{rose:{style:{fillOpacity:1}},label:{style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"},textAlign:"center",textBaseline:"middle"}}},boxPlot:{boxPlot:{style:{lineWidth:1}},label:{style:{lineWidth:2}}},correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}},liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}},venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},sS={label:{space:8},title:{space:8},maxHeight:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},uS=Object.assign(Object.assign({},sS),{label:{space:0}}),lS=function(t){return{area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}},hS={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:lS(!1),startHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:lS(!0)},cS=function(t,e){return{fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},dS={title:{visible:!0,autoLimit:!1,autoFit:!1,style:cS("l1FontSize","primaryFontColor")},content:{visible:!0,style:cS("l2FontSize","tertiaryFontColor")}},fS={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},vS=function(t){var e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},fS),{rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}}})},pS={horizontal:vS(!0),vertical:vS(!1)},gS=function(t){var e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},fS),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}}})},yS={horizontal:gS(!0),vertical:gS(!1)},mS={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},kS=function(t){return{visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}},_S={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:kS(!1),endSymbol:kS(!0),label:{refY:5,style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},bS={itemLine:{decorativeLine:{visible:!1},startSymbol:{size:5,visible:!0,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},line:{style:{stroke:{type:"palette",key:"markLineStrokeColor"}}}},itemContent:{offsetY:-50}};var xS={fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14,l1FontSize:32,l1LineHeight:"150%",l2FontSize:20,l2LineHeight:"140%",l3FontSize:16,l3LineHeight:"150%",l4FontSize:14,l4LineHeight:"150%",l5FontSize:12,l5LineHeight:"130%",l6FontSize:10,l6LineHeight:"120%"},SS={name:"light",background:{type:"palette",key:"backgroundColor"},padding:20,fontFamily:{type:"token",key:"fontFamily"},colorScheme:$x,token:xS,mark:{text:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1}}},markByName:{label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1,lineJoin:"bevel"}},area:{style:{fillOpacity:.2}},line:{style:{lineWidth:2,lineCap:"round",lineJoin:"round"}},point:{style:{size:8,stroke:{type:"palette",key:"backgroundColor"},lineWidth:1,fillOpacity:1}},word:{style:{fontSize:null}},fillingWord:{style:{fontSize:null}},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},circlePacking:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},funnel3d:{style:{stroke:!1}},barBackground:{visible:!1,style:{fill:{type:"palette",key:"primaryFontColor",a:.06},stroke:"transparent"}}},series:oS,component:{discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1},colorLegend:pS,sizeLegend:yS,axis:{domainLine:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,inside:!1,tickSize:4,alignWithLabel:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},subTick:{visible:!1,tickSize:2,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},label:{visible:!0,inside:!1,space:10,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}},title:{space:10,padding:0,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor"},fontWeight:"normal",fillOpacity:1}}},axisBand:{domainLine:{visible:!0},grid:{visible:!1},subGrid:{visible:!1},tick:{visible:!0},subTick:{visible:!1}},axisLinear:{domainLine:{visible:!1},grid:{visible:!0},subGrid:{visible:!1},tick:{visible:!1},subTick:{visible:!1}},axisX:sS,axisY:{label:{space:12,autoLimit:!0},title:{space:12,autoRotate:!0},maxWidth:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},axisZ:uS,axisAngle:{grid:{visible:!0,style:{lineDash:[6,6]}},label:{space:5}},axisRadius:{grid:{smooth:!0,visible:!0},subGrid:{smooth:!0,visible:!1}},markLine:_S,markArea:mS,markPoint:bS,polarMarkLine:_S,polarMarkArea:mS,polarMarkPoint:bS,geoMarkPoint:bS,tooltip:{offset:{x:10,y:10},panel:{padding:{top:10,left:10,right:10,bottom:10},backgroundColor:{type:"palette",key:"popupBackgroundColor"},border:{color:{type:"palette",key:"popupBackgroundColor"},width:0,radius:3},shadow:{x:0,y:4,blur:12,spread:0,color:{type:"palette",key:"shadowColor"}}},spaceRow:6,titleLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}},dataZoom:hS,crosshair:{trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}},player:{visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}},brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0},indicator:dS,title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}},mapLabel:{visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"red"}}},poptip:{visible:!0,position:"auto",padding:8,titleStyle:{fontSize:{type:"token",key:"l5FontSize"},fontWeight:"bold",fill:{type:"palette",key:"primaryFontColor"}},contentStyle:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"primaryFontColor"}},panel:{visible:!0,fill:{type:"palette",key:"popupBackgroundColor"},cornerRadius:3,lineWidth:0,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"},size:0,space:12}},totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}},scrollBar:{horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}}},animationThreshold:2e3},wS={name:"dark",colorScheme:{default:{dataScheme:Jx,palette:{backgroundColor:"#202226",borderColor:"#404349",shadowColor:"rgba(0,0,0,0.1)",hoverBackgroundColor:"#404349",sliderRailColor:"#404349",sliderHandleColor:"#202226",sliderTrackColor:"#4284FF",popupBackgroundColor:"#404349",primaryFontColor:"#fdfdfd",secondaryFontColor:"#bbbdc3",tertiaryFontColor:"#888c93",axisLabelFontColor:"#888c93",disableFontColor:"#55595f",axisMarkerFontColor:"#202226",axisGridColor:"#404349",axisDomainColor:"#4b4f54",dataZoomHandleStrokeColor:"#bbbdc3",dataZoomChartColor:"#55595F",playerControllerColor:"#4284FF",scrollBarSliderColor:"rgba(255,255,255,0.3)",axisMarkerBackgroundColor:"#fdfdfd",markLabelBackgroundColor:"#404349",markLineStrokeColor:"#bbbdc3",dangerColor:"#eb4b4b",warningColor:"#f0bd30",successColor:"#14b267",infoColor:"#4284ff",discreteLegendPagerTextColor:"#BBBDC3",discreteLegendPagerHandlerColor:"#BBBDC3",discreteLegendPagerHandlerDisableColor:"#55595F",emptyCircleColor:"#bbbdc3"}}},component:{dataZoom:{selectedBackground:{style:{fillOpacity:.4,outerBorder:{strokeOpacity:.4}}}}}},AS=function t(e,i,n){if(vt(i))return e;var r=i[0];return vt(r)?e:1===i.length?(e[r]=n,e):(vt(e[r])&&("number"==typeof i[1]?e[r]=[]:e[r]={}),t(e[r],i.slice(1),n))};function TS(t){for(var e=-1,i=arguments.length<=1?0:arguments.length-1;++e<i;){Ft(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0,!0)}return t}function CS(t,e,i,n){Object.keys(t).forEach((function(r){if(gt(e))e.type===r&&(bt(t[r])?t[r].length>=e.index&&(t[r][e.index]=n?TS({},t[r][e.index],i):i):t[r]=n?TS({},t[r],i):i);else if(bt(t[r])){var a=t[r].findIndex((function(t){return t.id===e}));a>=0&&(t[r][a]=n?TS({},t[r][a],i):i)}else t.id===e&&(t[r]=n?TS({},t[r],i):i)}))}var ES=function(){function t(){o(this,t)}return u(t,null,[{key:"registerChart",value:function(e,i){t._charts[e]=i}},{key:"registerSeries",value:function(e,i){t._series[e]=i}},{key:"registerComponent",value:function(e,i,n){t._components[e]={cmp:i,alwaysCheck:n}}},{key:"registerMark",value:function(e,i){t._marks[e]=i}},{key:"registerRegion",value:function(e,i){t._regions[e]=i}},{key:"registerTransform",value:function(e,i){t.transforms[e]=i}},{key:"registerLayout",value:function(e,i){t._layout[e]=i}},{key:"registerAnimation",value:function(e,i){t._animations[e]=i}},{key:"registerImplement",value:function(e,i){t._implements[e]=i}},{key:"registerChartPlugin",value:function(e,i){t._chartPlugin[e]=i}},{key:"registerComponentPlugin",value:function(e,i){t._componentPlugin[e]=i}},{key:"createChart",value:function(e,i,n){return t._charts[e]?new t._charts[e](i,n):null}},{key:"createChartSpecTransformer",value:function(e,i){if(!t._charts[e])return null;var n=t._charts[e];return new n.transformerConstructor(Object.assign({seriesType:n.seriesType},i))}},{key:"createRegion",value:function(e,i,n){return t._regions[e]?new t._regions[e](i,n):null}},{key:"createRegionSpecTransformer",value:function(e,i){return t._regions[e]?new t._regions[e].transformerConstructor(i):null}},{key:"createSeries",value:function(e,i,n){return t._series[e]?new t._series[e](i,n):null}},{key:"createSeriesSpecTransformer",value:function(e,i){return t._series[e]?new t._series[e].transformerConstructor(i):null}},{key:"createMark",value:function(e,i,n){if(!t._marks[e])return null;var r=new t._marks[e](i,n);return"group"===r.type&&r.setInteractive(!1),r}},{key:"getComponents",value:function(){return Object.values(t._components)}},{key:"getComponentInKey",value:function(e){return t._components[e].cmp}},{key:"getLayout",value:function(){return Object.values(t._layout)}},{key:"getLayoutInKey",value:function(e){return t._layout[e]}},{key:"getSeries",value:function(){return Object.values(t._series)}},{key:"getSeriesInType",value:function(e){return t._series[e]}},{key:"getRegionInType",value:function(e){return t._regions[e]}},{key:"getAnimationInKey",value:function(e){return t._animations[e]}},{key:"getImplementInKey",value:function(e){return t._implements[e]}},{key:"getSeriesMarkMap",value:function(e){return t._series[e]?t._series[e].mark:{}}},{key:"getChartPlugins",value:function(){return Object.values(t._chartPlugin)}},{key:"getComponentPlugins",value:function(){return Object.values(t._componentPlugin)}},{key:"getComponentPluginInType",value:function(e){return t._componentPlugin[e]}},{key:"registerFormatter",value:function(t){this._formatter=t}},{key:"getFormatter",value:function(){return this._formatter}}])}();function BS(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return TS.apply(void 0,[RS(t)].concat(y(i.map(RS))))}function RS(t){var e;if(!t)return t;var i=function(t){return t&&(t=Object.keys(t).reduce((function(e,i){var n=t[i];return e[i]=function(t){return bt(t)?{dataScheme:t}:t}(n),e}),{})),t}(t.colorScheme);return Object.assign({},t,{colorScheme:i,token:null!==(e=t.token)&&void 0!==e?e:{},series:Object.assign({},t.series)})}ES._charts={},ES._series={},ES._components={},ES._marks={},ES._regions={},ES._animations={},ES._implements={},ES._chartPlugin={},ES._componentPlugin={},ES.transforms={fields:lb,filter:function(t,e){var i=e.callback;return i&&(t=t.filter(i)),t},fold:function(t,e){for(var i=e.fields,n=e.key,r=e.value,a=e.retains,o=[],s=function(e){i.forEach((function(s){var u={};if(u[n]=s,u[r]=t[e][s],a)a.forEach((function(i){u[i]=t[e][i]}));else for(var l in t[e])-1===i.indexOf(l)&&(u[l]=t[e][l]);o.push(u)}))},u=0;u<t.length;u++)s(u);return o}},ES.dataParser={csv:bb,dsv:_b,tsv:xb},ES._layout={};var MS=["animationThreshold","colorScheme","name","padding"];function PS(t,e,i,n){if(!t)return t;e||(e=t.colorScheme),i||(i=t.token);var r={};return Object.keys(t).forEach((function(a){var o=t[a];MS.includes(a)?r[a]=o:mt(o)?zx(o)?r[a]=function(t,e,i){if(e&&zx(t)){var n=Nx(e,t,i);if(n)return n}return t}(o,e,n):function(t){return t&&"token"===t.type&&!!t.key}(o)?r[a]=function(t,e){return t&&e.key in t?t[e.key]:e.default}(i,o):r[a]=PS(o,e,i,n):r[a]=o})),r}var OS=l({},SS.name,SS),IS=SS.name,LS=new Map(Object.keys(OS).map((function(t){return[t,OS[t]]}))),DS=new Map(Object.keys(OS).map((function(t){return[t,PS(OS[t])]}))),FS=new Map(Object.keys(OS).map((function(t){return[t,t===IS]}))),jS=function(t,e){if(t){var i=zS(e);LS.set(t,i),DS.set(t,PS(i)),FS.set(t,!0)}},NS=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:IS,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return FS.has(t)&&!FS.get(t)&&jS(t,LS.get(t)),e?DS.get(t):LS.get(t)},zS=function(t){var e,i=null!==(e=t.type)&&void 0!==e?e:IS;return BS({},NS(i),t)},US=function(){function t(){o(this,t)}return u(t,null,[{key:"registerInstance",value:function(e){t.instances.set(e.id,e)}},{key:"unregisterInstance",value:function(e){t.instances.delete(e.id)}},{key:"getInstance",value:function(e){return t.instances.get(e)}},{key:"instanceExist",value:function(e){return t.instances.has(e)}},{key:"forEach",value:function(e){var i=arguments.length>2?arguments[2]:void 0,n=Kt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]);return t.instances.forEach((function(t,i,r){n.includes(i)||e(t,i,r)}),i)}}])}();US.instances=new Map;var GS=function(){function t(){o(this,t)}return u(t,null,[{key:"registerTheme",value:function(t,e){jS(t,e)}},{key:"getTheme",value:function(t){return NS(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1])}},{key:"removeTheme",value:function(t){return function(t){return LS.delete(t)&&DS.delete(t)&&FS.delete(t)}(t)}},{key:"themeExist",value:function(t){return function(t){return!!_t(t)&&LS.has(t)}(t)}},{key:"getDefaultTheme",value:function(){return t.themes.get(IS)}},{key:"setCurrentTheme",value:function(e){t.themeExist(e)&&(t._currentThemeName=e,US.forEach((function(t){return null==t?void 0:t.setCurrentTheme(e)})))}},{key:"getCurrentTheme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t.getTheme(t._currentThemeName,e)}},{key:"getCurrentThemeName",value:function(){return t._currentThemeName}}])}();function WS(t,e){return _t(t)?GS.themeExist(t)?GS.getTheme(t,e):{}:gt(t)?t:{}}function VS(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{data:function(t){return t}};if(!t)return t;if(t.constructor===Object){var i={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e[n]){i[n]=e[n](t[n]);continue}i[n]=VS(t[n],e)}return i}return bt(t)?t.map((function(t){return VS(t,e)})):t}function HS(t,e){if(!t)return t;if(mt(t)){var i={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(_t(t[n])&&e.getFunction(t[n])){i[n]=e.getFunction(t[n]);continue}i[n]=HS(t[n],e)}return i}return bt(t)?t.map((function(t){return HS(t,e)})):t}GS.themes=LS,GS._currentThemeName=IS;var KS,XS,YS,qS,ZS,JS,$S,QS,tw,ew,iw,nw,rw,aw,ow,sw=function(t,e,i){return function(t,e,i,n){return new ei(Object.assign({defaultFontParams:Object.assign({fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14},n),getTextBounds:i?void 0:Zu,specialCharSet:"-/: .,@%'\"~"+ei.ALPHABET_CHAR_SET+ei.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}(t,e,i,{fontFamily:xS.fontFamily,fontSize:xS.fontSize})};function uw(t,e){for(var i=0;i<e.length;i++){var n=e[i],r=lw(t,n.key);r?r.operations=y(new Set(r.operations.concat(n.operations))):t.push(n)}return t}function lw(t,e){return t.find((function(t){return t.key===e}))}!function(t){t.enter="enter",t.update="update",t.exit="exit",t.group="group",t.connectNulls="connectNulls"}(KS||(KS={})),function(t){t.enter="enter",t.update="update",t.exit="exit",t.unChange="unChange"}(XS||(XS={})),function(t){t.arc="arc",t.arc3d="arc3d",t.area="area",t.image="image",t.line="line",t.path="path",t.rect="rect",t.rect3d="rect3d",t.rule="rule",t.shape="shape",t.symbol="symbol",t.text="text",t.richtext="richtext",t.polygon="polygon",t.pyramid3d="pyramid3d",t.circle="circle",t.cell="cell",t.interval="interval",t.group="group",t.glyph="glyph",t.component="component",t.largeRects="largeRects",t.largeSymbols="largeSymbols"}(YS||(YS={})),function(t){t.axis="axis",t.grid="grid",t.legend="legend",t.slider="slider",t.label="label",t.datazoom="datazoom",t.player="player",t.title="title",t.scrollbar="scrollbar"}(qS||(qS={})),function(t){t[t.player=1]="player",t[t.rollUp=2]="rollUp",t[t.drillDown=3]="drillDown",t[t.slider=4]="slider",t[t.datazoom=5]="datazoom",t[t.legend=6]="legend",t[t.scrollbar=7]="scrollbar",t[t.brush=8]="brush",t[t.normal=9]="normal"}(ZS||(ZS={})),function(t){t.lineAxis="lineAxis",t.circleAxis="circleAxis"}(JS||(JS={})),function(t){t.lineAxisGrid="lineAxisGrid",t.circleAxisGrid="circleAxisGrid"}($S||($S={})),function(t){t.discreteLegend="discreteLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend"}(QS||(QS={})),function(t){t.lineCrosshair="lineCrosshair",t.rectCrosshair="rectCrosshair",t.sectorCrosshair="sectorCrosshair",t.circleCrosshair="circleCrosshair",t.polygonCrosshair="polygonCrosshair",t.ringCrosshair="ringCrosshair"}(tw||(tw={})),function(t){t.symbolLabel="symbolLabel",t.rectLabel="rectLabel",t.lineLabel="lineLabel",t.dataLabel="dataLabel"}(ew||(ew={})),function(t){t.continuousPlayer="continuousPlayer",t.discretePlayer="discretePlayer"}(iw||(iw={})),function(t){t.before="before",t.layouting="layouting",t.reevaluate="reevaluate",t.after="after"}(nw||(nw={})),function(t){t.BEFORE_EVALUATE_DATA="beforeEvaluateData",t.AFTER_EVALUATE_DATA="afterEvaluateData",t.BEFORE_EVALUATE_SCALE="beforeEvaluateScale",t.AFTER_EVALUATE_SCALE="afterEvaluateScale",t.BEFORE_PARSE_VIEW="beforeParseView",t.AFTER_PARSE_VIEW="afterParseView",t.BEFORE_TRANSFORM="beforeTransform",t.AFTER_TRANSFORM="afterTransform",t.BEFORE_CREATE_VRENDER_STAGE="beforeCreateVRenderStage",t.AFTER_CREATE_VRENDER_STAGE="afterCreateVRenderStage",t.BEFORE_CREATE_VRENDER_LAYER="beforeCreateVRenderLayer",t.AFTER_CREATE_VRENDER_LAYER="afterCreateVRenderLayer",t.BEFORE_STAGE_RESIZE="beforeStageResize",t.AFTER_STAGE_RESIZE="afterStageResize",t.BEFORE_VRENDER_DRAW="beforeVRenderDraw",t.AFTER_VRENDER_DRAW="afterVRenderDraw",t.BEFORE_MARK_JOIN="beforeMarkJoin",t.AFTER_MARK_JOIN="afterMarkJoin",t.BEFORE_MARK_UPDATE="beforeMarkUpdate",t.AFTER_MARK_UPDATE="afterMarkUpdate",t.BEFORE_MARK_STATE="beforeMarkState",t.AFTER_MARK_STATE="afterMarkState",t.BEFORE_MARK_ENCODE="beforeMarkEncode",t.AFTER_MARK_ENCODE="afterMarkEncode",t.BEFORE_DO_LAYOUT="beforeDoLayout",t.AFTER_DO_LAYOUT="afterDoLayout",t.BEFORE_MARK_LAYOUT_END="beforeMarkLayoutEnd",t.AFTER_MARK_LAYOUT_END="afterMarkLayoutEnd",t.BEFORE_DO_RENDER="beforeDoRender",t.AFTER_DO_RENDER="afterDoRender",t.BEFORE_MARK_RENDER_END="beforeMarkRenderEnd",t.AFTER_MARK_RENDER_END="afterMarkRenderEnd",t.BEFORE_CREATE_VRENDER_MARK="beforeCreateVRenderMark",t.AFTER_CREATE_VRENDER_MARK="afterCreateVRenderMark",t.BEFORE_ADD_VRENDER_MARK="beforeAddVRenderMark",t.AFTER_ADD_VRENDER_MARK="afterAddVRenderMark",t.AFTER_VRENDER_NEXT_RENDER="afterVRenderNextRender",t.BEFORE_ELEMENT_UPDATE_DATA="beforeElementUpdateData",t.AFTER_ELEMENT_UPDATE_DATA="afterElementUpdateData",t.BEFORE_ELEMENT_STATE="beforeElementState",t.AFTER_ELEMENT_STATE="afterElementState",t.BEFORE_ELEMENT_ENCODE="beforeElementEncode",t.AFTER_ELEMENT_ENCODE="afterElementEncode",t.ANIMATION_START="animationStart",t.ANIMATION_END="animationEnd",t.ELEMENT_ANIMATION_START="elementAnimationStart",t.ELEMENT_ANIMATION_END="elementAnimationEnd",t.ALL_ANIMATION_START="allAnimationStart",t.ALL_ANIMATION_END="allAnimationEnd"}(rw||(rw={})),function(t){t.signal="signal",t.data="data",t.scale="scale",t.coordinate="coordinate",t.mark="mark"}(aw||(aw={})),function(t){t.active="active",t.selected="selected",t.highlight="highlight",t.blur="blur"}(ow||(ow={}));var hw="__vgrammar_scene_item__",cw=[YS.line,YS.area],dw=[YS.arc3d,YS.rect3d,YS.pyramid3d],fw="key",vw=[{}],pw=["key"],gw="_mo_hide_";function yw(t,e){return Kt(t).reduce((function(t,i){var n=_t(i)?e.getGrammarById(i):i;return n&&t.push(n),t}),[])}function mw(t,e){if(vt(t))return[];if(function(t){return!ft(t)&&!!(null==t?void 0:t.signal)}(t)){var i=t.signal;if(_t(i))return Kt(e.getGrammarById(i));if("signal"===(null==i?void 0:i.grammarType))return[i]}else if(function(t){return!ft(t)&&!!(null==t?void 0:t.callback)}(t))return yw(t.dependency,e);return[]}function kw(t){return ft(t)||(null==t?void 0:t.signal)||!!(null==t?void 0:t.callback)}function _w(t,e,i,n){if(vt(t))return t;if(ft(t))return n?t.call(null,i,n,e):t.call(null,i,e);if(t.signal){var r=t.signal;return _t(r)?null==e?void 0:e[r]:r.output()}return t.callback?n?t.callback.call(null,i,n,e):t.callback.call(null,i,e):t}function bw(t,e){return xw(t)?t.output():e[t]}var xw=function(t){return t&&!vt(t.grammarType)},Sw=function(t){return ft(t)?t:function(e){return e[t]}};function ww(t){return!!(null==t?void 0:t.scale)}function Aw(t){return!!(null==t?void 0:t.field)}function Tw(t,e){if(!t)return[];var i=[];return t.scale&&(i=xw(t.scale)?[t.scale]:Kt(e.getScaleById(t.scale))),i.concat(mw(t,e))}function Cw(t,e){switch(e){case"line":return t.some((function(t){return["x","y","defined"].includes(t)}));case"area":return t.some((function(t){return["x","y","x1","y1","defined"].includes(t)}));case"largeRects":return t.some((function(t){return["x","y","width","y1"].includes(t)}));case"largeSymbols":return t.some((function(t){return["x","y"].includes(t)}))}return!1}function Ew(t,e,i,n,r){i&&(kw(i)?e.forEach((function(e){var r=_w(i,n,e.datum,t);Object.assign(e.nextAttrs,r)})):Object.keys(i).forEach((function(a){var o,s,u=i[a],l=r&&!function(t,e){if(["x","y","dx","dy"].includes(e))return!0;switch(t){case YS.arc:return["innerRadius","outerRadius","startAngle","endAngle"].includes(e);case YS.group:case YS.rect:case YS.image:return["width","height","y1"].includes(e);case YS.path:case YS.shape:return["path","customPath"].includes(e);case YS.line:return"defined"===e;case YS.area:return["x1","y1","defined"].includes(e);case YS.rule:return["x1","y1"].includes(e);case YS.symbol:return"size"===e;case YS.polygon:return"points"===e;case YS.text:return"text"===e}return!1}(t.mark.markType,a)?[e[0]]:e;if(ww(u)){var h=bw(u.scale,n),c=null!==(o=null==u?void 0:u.offset)&&void 0!==o?o:0,d=!vt(u.band)&&h.bandwidth?h.bandwidth()*u.band:null,f=_t(null==u?void 0:u.field),v=f?Vb(u.field):null,p=f?null:vt(null==u?void 0:u.value)?0:null===(s=h.scale)||void 0===s?void 0:s.call(h,u.value);l.forEach((function(t){var e;f&&(p=null===(e=h.scale)||void 0===e?void 0:e.call(h,v(t.datum))),t.nextAttrs[a]=wt(p)||wt(d)?p+c+d:p}))}else if(Aw(u)){var g=Vb(u.field);l.forEach((function(t){t.nextAttrs[a]=g(t.datum)}))}else l.forEach((function(e){e.nextAttrs[a]=_w(u,n,e.datum,t)}))})))}function Bw(t,e,i,n){if(!t)return null;if(kw(t))return _w(t,n,e,i);var r={};return Object.keys(t).forEach((function(a){var o,s,u,l=t[a];if(ww(l)){var h=bw(l.scale,n),c=null!==(o=null==l?void 0:l.offset)&&void 0!==o?o:0,d=!vt(l.band)&&h.bandwidth?h.bandwidth()*l.band:null,f=_t(null==l?void 0:l.field),v=f?Vb(l.field):null,p=f?null===(s=h.scale)||void 0===s?void 0:s.call(h,v(e)):vt(null==l?void 0:l.value)?0:null===(u=h.scale)||void 0===u?void 0:u.call(h,l.value);r[a]=wt(p)||wt(d)?p+c+d:p}else if(Aw(l)){var g=Vb(l.field);r[a]=g(e)}else r[a]=_w(l,n,e,i)})),r}var Rw=function(){return u((function t(e,i,n,r){o(this,t),this.channelEncoder={},this.marks=e,i&&this.registerChannelEncoder(i),n&&this.registerDefaultEncoder(n),this.progressiveChannels&&this.registerProgressiveChannels(r)}),[{key:"getMarks",value:function(){return this.marks}},{key:"registerChannelEncoder",value:function(t,e){return _t(t)?this.channelEncoder[t]=e:Object.assign(this.channelEncoder,t),this}},{key:"registerFunctionEncoder",value:function(t){return this.functionEncoder=t,this}},{key:"registerDefaultEncoder",value:function(t){return this.defaultEncoder=t,this}},{key:"registerProgressiveChannels",value:function(t){return this.progressiveChannels=Kt(t),this}},{key:"getChannelEncoder",value:function(){return this.channelEncoder}},{key:"getFunctionEncoder",value:function(){return this.functionEncoder}},{key:"getDefaultEncoder",value:function(){return this.defaultEncoder}},{key:"getProgressiveChannels",value:function(){return this.progressiveChannels}}])}(),Mw=function(){function t(){o(this,t)}return u(t,null,[{key:"registerPlotMarks",value:function(e,i){t._plotMarks[e]=i}},{key:"createPlotMark",value:function(e,i){return t._plotMarks[e]?new t._plotMarks[e](i):null}},{key:"registerMark",value:function(e,i){t._marks[e]=i}},{key:"createMark",value:function(e,i,n){return t._marks[e]?new t._marks[e](i,e,n):null}},{key:"hasMark",value:function(e){return!!t._marks[e]}},{key:"getMark",value:function(e){return t._marks[e]}},{key:"registerComponent",value:function(e,i){t._components[e]=i}},{key:"createComponent",value:function(e,i,n,r){var a=t._components[e];return a?new a(i,n,r):null}},{key:"hasComponent",value:function(e){return!!t._components[e]}},{key:"registerGraphicComponent",value:function(e,i){t._graphicComponents[e]=i}},{key:"createGraphicComponent",value:function(e,i,n){var r=t._graphicComponents[e];return r?r(i,n):null}},{key:"registerTransform",value:function(e,i,n){t._transforms[e]=Object.assign(i,{type:e,isBuiltIn:!!n})}},{key:"getTransform",value:function(e){return t._transforms[e]}},{key:"unregisterRuntimeTransforms",value:function(){Object.keys(t._transforms).forEach((function(e){t._transforms[e]&&!t._transforms[e].isBuiltIn&&(t._transforms[e]=null)}))}},{key:"registerGrammar",value:function(e,i,n){t._grammars[e]={grammarClass:i,specKey:null!=n?n:e}}},{key:"createGrammar",value:function(e,i,n){var r,a=null===(r=t._grammars[e])||void 0===r?void 0:r.grammarClass;return a?new a(i,n):null}},{key:"getGrammars",value:function(){return this._grammars}},{key:"getGlyph",value:function(e){return t._glyphs[e]}},{key:"createInteraction",value:function(e,i,n){var r=t._interactions[e];return r?new r(i,n):null}},{key:"hasInteraction",value:function(e){return!!t._interactions[e]}}])}();Mw._plotMarks={},Mw._marks={},Mw._components={},Mw._graphicComponents={},Mw._transforms={},Mw._grammars={},Mw._glyphs={},Mw._animations={},Mw._interactions={},Mw._graphics={},Mw._stageEventPlugins={},Mw.registerGlyph=function(t,e,i,n,r){return Mw._glyphs[t]=new Rw(e,i,n,r),Mw._glyphs[t]},Mw.registerAnimationType=function(t,e){Mw._animations[t]=e},Mw.getAnimationType=function(t){return Mw._animations[t]},Mw.registerInteraction=function(t,e){Mw._interactions[t]=e},Mw.registerGraphic=function(t,e){Mw._graphics[t]=e},Mw.getGraphicType=function(t){return Mw._graphics[t]},Mw.createGraphic=function(t,e){var i=Mw._graphics[t];return i?i(e):null},Mw.registerDefaultLayout=function(t){Mw.defaultLayout=t},Mw.getDefaultLayout=function(){return Mw.defaultLayout},Mw.registerStageEventPlugin=function(t,e){Mw._stageEventPlugins[t]=e},Mw.getStageEventPlugin=function(t){return Mw._stageEventPlugins[t]};function Pw(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Mw.getGraphicType(e)?Mw.createGraphic(e,n):Mw.createGraphicComponent(e,n,{skipDefault:null===(i=null==t?void 0:t.spec)||void 0===i?void 0:i.skipTheme});return r||te.getInstance().error("create ".concat(e," graphic failed!")),r}var Ow=function(t){t&&(t[hw]=null,t.release(),t.parent&&t.parent.removeChild(t))},Iw=["fillOpacity"],Lw=function(t,e,i){var n;return"fillOpacity"===e?(t.fillOpacity=null!==(n=i.fillOpacity)&&void 0!==n?n:1,["fillOpacity"]):[]};var Dw=l(l(l({rect3d:[{channels:["x","y","z","x1","y1","width","height","length"],transform:function(t,e,i){var n,r,a,o,s,u,l,h,c,d,f,v;At(e.width)||!At(e.x1)&&At(i.width)?(t.x=Math.min(null!==(n=i.x)&&void 0!==n?n:0,null!==(r=i.x1)&&void 0!==r?r:1/0),t.width=i.width):At(e.x1)||!At(e.width)&&At(i.x1)?(t.x=Math.min(i.x,i.x1),t.width=Math.abs(i.x1-i.x)):(t.x=Math.min(null!==(a=i.x)&&void 0!==a?a:0,null!==(o=i.x1)&&void 0!==o?o:1/0),t.width=i.width),At(e.height)||!At(e.y1)&&At(i.height)?(t.y=Math.min(null!==(s=i.y)&&void 0!==s?s:0,null!==(u=i.y1)&&void 0!==u?u:1/0),t.height=i.height):At(e.y1)||!At(e.height)&&At(i.y1)?(t.y=Math.min(i.y,i.y1),t.height=Math.abs(i.y1-i.y)):(t.y=Math.min(null!==(l=i.y)&&void 0!==l?l:0,null!==(h=i.y1)&&void 0!==h?h:1/0),t.height=i.height),At(e.length)||!At(e.z1)&&At(i.length)?(t.z=Math.min(null!==(c=i.z)&&void 0!==c?c:0,null!==(d=i.z1)&&void 0!==d?d:1/0),t.length=i.length):At(e.z1)||!At(e.length)&&At(i.z1)?(t.z=Math.min(i.z,i.z1),t.length=Math.abs(i.z1-i.z)):(t.z=Math.min(null!==(f=i.z)&&void 0!==f?f:0,null!==(v=i.z1)&&void 0!==v?v:1/0),t.length=i.length)},storedAttrs:"sizeAttrs"}]},YS.text,[{channels:["text","limit","autoLimit","maxLineWidth","textType"],transform:function(t,e,i){var n,r,a=null!==(n=i.limit)&&void 0!==n?n:1/0,o=null!==(r=i.autoLimit)&&void 0!==r?r:1/0,s=Math.min(a,o),u=mt(i.text)&&!vt(i.text.text),l=u?i.text.text:i.text;t.maxLineWidth=s===1/0?i.maxLineWidth:s,!u&&!i.textType||"rich"!==i.text.type&&"rich"!==i.textType?t.text=l:t.textConfig=l},storedAttrs:"limitAttrs"}]),YS.rule,[{channels:["x","y","x1","y1"],transform:function(t,e,i){var n=function(t){var e=t.x,i=t.y,n=t.x1,r=t.y1;return At(e)&&At(i)&&At(n)&&At(r)?[{x:e,y:i},{x:n,y:r}]:[]}(i);t.points=n,t.x=0,t.y=0},storedAttrs:"pointAttrs"}]),YS.symbol,[{channels:["shape","symbolType"],transform:function(t,e,i){var n;t.symbolType=null!==(n=e.shape)&&void 0!==n?n:e.symbolType}},{channels:["image","fill","background"],transform:function(t,e,i){e.image?(t.background=e.image,t.fill=!1):i.image?(t.background=i.image,t.fill=!1):(t.fill=i.fill,t.background=i.background)},storedAttrs:"imageAttrs"}]),Fw=function(t,e,i,n){var r={},a=e?Object.keys(e):[],o=_t(t)?Dw[t]:t;if(o&&o.length){var s=[];a.forEach((function(t){var a=!1;o.forEach((function(o,u){if(o.channels.includes(t)){if(!s[u])if(o.storedAttrs){var l=function(t,e,i,n,r,a){var o=r.getGraphicAttribute(t,!1,a);if(o)return e.forEach((function(t){t in n&&(o[t]=n[t])})),o;var s={};return e.forEach((function(t){s[t]=n[t]})),i[t]=s,s}(o.storedAttrs,o.channels,r,e,i,n);o.transform(r,e,l)}else o.transform(r,e,null);s[u]=!0,a=!0}})),a||(Iw.includes(t)?Lw(r,t,e):r[t]=e[t])}))}else a.forEach((function(t){Iw.includes(t)?Lw(r,t,e):r[t]=e[t]}));return r},jw=function(t,e,i){return!(!vt(t)||!vt(e))||!vt(t)&&!vt(e)&&("lineDash"===i?function(t,e){return t.length===e.length&&t.join("-")===e.join("-")}(t,e):"stroke"===i||"fill"===i?function(t,e){if(t===e)return!0;if(a(t)!=a(e))return!1;if(_t(t))return!1;if(t.gradient!==e.gradient)return!1;var i=Object.keys(t),n=Object.keys(e);return i.length===n.length&&i.every((function(i){return"stops"===i?function(t,e){var i,n;if(t===e)return!0;var r=null!==(i=t&&t.length)&&void 0!==i?i:0;return r===(null!==(n=e&&e.length)&&void 0!==n?n:0)&&0!==r&&t.every((function(t,i){return!t&&!e[i]||t&&e[i]&&t.color===e[i].color&&t.offset===e[i].offset}))}(t[i],e[i]):t[i]===e[i]}))}(t,e):t===e)},Nw=["stroke","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","lineWidth","miterLimit"],zw=["fill","fillOpacity","background","texture","texturePadding","textureSize","textureColor"].concat(Nw);function Uw(t,e,i){var n;if(!t||t.length<=1)return null;var r="area"===(null===(n=null==i?void 0:i.mark)||void 0===n?void 0:n.markType)?zw:Nw,a=[],o=null;return t.forEach((function(t,e){o&&r.every((function(e){return jw(o[e],t[e],e)}))||(a.length&&(a[a.length-1].endIndex=e),o=t,a.push({attrs:o,startIndex:e}))})),a.length>=2?a.map((function(t){var i=Gw(t.attrs);return i.points=e.slice(t.startIndex,vt(t.endIndex)?e.length:t.endIndex),i})):null}function Gw(t){var e={};if(!t)return e;var i=["x","y","x1","y1","defined","size","width","height","context"];return Object.keys(t).forEach((function(n){i.includes(n)||(e[n]=t[n])})),e}var Ww=function(){return u((function t(e){var i=this;o(this,t),this.data=null,this.states=[],this.diffState=XS.enter,this.isReserved=!1,this.runtimeStatesEncoder=null,this.items=[],this.getStateAttrs=function(t,e){var n,r,a,o,s=!vt(null===(n=i.runtimeStatesEncoder)||void 0===n?void 0:n[t]),u=s?Object.assign(Object.assign({},null===(r=i.mark.getSpec().encode)||void 0===r?void 0:r[t]),i.runtimeStatesEncoder[t]):null===(a=i.mark.getSpec().encode)||void 0===a?void 0:a[t];if(!u)return{};if(ft(u))return u(i.getDatum(),i,t,e);if(!s&&(null===(o=i.graphicItem.states)||void 0===o?void 0:o[t]))return i.graphicItem.states[t];var h=i.items.map((function(t){return Object.assign({},t,{nextAttrs:{}})}));Ew(i,h,u,i.mark.parameters());var c=i.transformElementItems(h,i.mark.markType);return i.graphicItem.states?i.graphicItem.states[t]||(i.graphicItem.states[t]=c):i.graphicItem.states=l({},t,c),c},this.mark=e}),[{key:"initGraphicItem",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.graphicItem){var i=this.mark.getAttributeTransforms();this.graphicItem=this.mark.addGraphicItem(i?Fw(i,e,this):e,this.groupKey),this.graphicItem&&(this.graphicItem[hw]=this,i&&(this.graphicItem.onBeforeAttributeUpdate=function(e){return t.mark?Fw(i,e,t):e}),this.clearGraphicAttributes(),this.mark.needAnimate()&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(Object.assign({},e)),this.setFinalGraphicAttributes(Object.assign({},e))))}}},{key:"updateGraphicItem",value:function(){var t;if(this.graphicItem){this.diffState===XS.exit?this.graphicItem.releaseStatus="willRelease":this.graphicItem.releaseStatus=void 0;var e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");e&&0!==e.length&&(this.graphicItem.stateAnimateConfig=e[0].originConfig)}}},{key:"getGraphicItem",value:function(){return this.graphicItem}},{key:"removeGraphicItem",value:function(){var t,e;this.graphicItem&&(null===(e=null===(t=this.graphicItem.animates)||void 0===t?void 0:t.forEach)||void 0===e||e.call(t,(function(t){return t.stop()}))),this.graphicItem&&(Ow(this.graphicItem),this.graphicItem[hw]=null,this.graphicItem=null)}},{key:"resetGraphicItem",value:function(){this.graphicItem&&(this.graphicItem=null)}},{key:"getBounds",value:function(){var t;return null===(t=this.graphicItem)||void 0===t?void 0:t.AABBBounds}},{key:"getStates",value:function(){return this.states}},{key:"updateData",value:function(t,e,i){var n,r=this;this.mark.emit(rw.BEFORE_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.data=e;var a=Sw(i);return this.items=e.map((function(t){return{datum:t,key:a(t),view:r.mark.view,nextAttrs:{}}})),this.groupKey=t,this.key=this.mark.isCollectionMark()?t:null===(n=this.items)||void 0===n?void 0:n[0].key,this.mark.emit(rw.AFTER_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.items}},{key:"state",value:function(t,e){var i,n=this.mark.isCollectionMark(),r=this.states,a=Kt(_w(t,e,this.getDatum(),this)),o=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;o&&a.length&&a.sort(o);var s=a.length!==r.length||a.some((function(t,e){return t!==r[e]}));this.states=a,!n&&s&&this.diffState===XS.unChange&&(this.diffState=XS.update)}},{key:"encodeGraphic",value:function(t){this.coordinateTransformEncode(this.items);var e=this.transformElementItems(this.items,this.mark.markType);t&&Object.assign(e,t),this.graphicItem?(this.graphicItem.clearStates(),this.graphicItem.states={},this.graphicItem.stateProxy=null,gw in this.graphicItem.attribute&&"visible"in e&&delete this.graphicItem.attribute[gw],this.applyGraphicAttributes(e)):this.initGraphicItem(e),this.diffState!==XS.enter&&this.diffState!==XS.update||!this.states.length||this.useStates(this.states),this.mark.markType===YS.shape&&(this.graphicItem.datum=this.items[0].datum),this.items.forEach((function(t){t.nextAttrs={}})),this._setCustomizedShape()}},{key:"_setCustomizedShape",value:function(){var t,e=this;if(this.graphicItem){var i=null===(t=this.mark.getSpec())||void 0===t?void 0:t.setCustomizedShape;i&&(this.graphicItem.pathProxy=function(t){return i(e.data,t,new kn)})}}},{key:"encodeItems",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0,r=this.mark.isCollectionMark(),a=e[KS.update],o=e[KS.enter],s=e[KS.exit],u=this.mark.isLargeMode()||r&&!this.mark.getSpec().enableSegments;this.diffState===XS.enter?(o&&Ew(this,t,o,n,u),a&&Ew(this,t,a,n,u)):this.diffState===XS.update?((r&&o||i)&&Ew(this,t,o,n,u),a&&Ew(this,t,a,n,u)):this.diffState===XS.exit&&s&&(i&&Ew(this,t,o,n,u),Ew(this,t,s,n,u))}},{key:"coordinateTransformEncode",value:function(t){if(this.mark.coord&&"arc"!==this.mark.markType&&!0!==this.mark.disableCoordinateTransform){var e=this.mark.coord.output();t.forEach((function(t){var i=t.nextAttrs,n=e.convert(i);Object.assign(i,n)}))}}},{key:"hasStateAnimation",value:function(){var t,e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");return e&&e.length>0}},{key:"clearStates",value:function(t){var e=dt(t)?t:this.hasStateAnimation();this.states=[],this.graphicItem&&this.graphicItem.clearStates(e),this.runtimeStatesEncoder&&(this.runtimeStatesEncoder={})}},{key:"_updateRuntimeStates",value:function(t,e){this.runtimeStatesEncoder||(this.runtimeStatesEncoder={}),this.runtimeStatesEncoder[t]=e}},{key:"hasState",value:function(t){return this.states&&t&&this.states.includes(t)}},{key:"updateStates",value:function(t){var e=this;if(!this.graphicItem)return!1;var i=this.states.slice(),n=this.mark.getSpec().encode,r=!1,a=!1;return Object.keys(t).forEach((function(o){var s;if(o){var u=t[o];if(gt(u)&&!Wt(u,null===(s=e.runtimeStatesEncoder)||void 0===s?void 0:s[o]))i.includes(o)?r=!0:i.push(o),e._updateRuntimeStates(o,u),a=!0;else if(u)!i.includes(o)&&(null==n?void 0:n[o])&&(i.push(o),a=!0);else if(i.length){var l=i.filter((function(t){return t!==o}));l.length!==i.length&&(a=!0,i=l),e.runtimeStatesEncoder&&e.runtimeStatesEncoder[o]&&(e.runtimeStatesEncoder[o]=null)}}})),r&&this.graphicItem.clearStates(),!!a&&(this.useStates(i),!0)}},{key:"addState",value:function(t,e){var i;if(!this.graphicItem)return!1;if(e&&_t(t)&&!Wt(e,null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t])){var n=this.states.slice();return n.includes(t)?this.graphicItem.clearStates():n.push(t),this._updateRuntimeStates(t,e),this.useStates(n),!0}var r=this.mark.getSpec().encode,a=Kt(t).reduce((function(t,e){return e&&!t.includes(e)&&(null==r?void 0:r[e])&&t.push(e),t}),this.states.slice());return a.length!==this.states.length&&(this.useStates(a),!0)}},{key:"removeState",value:function(t){var e=this;if(!this.graphicItem)return!1;var i=Kt(t);if(!i.length)return!1;var n=this.states.filter((function(t){return!i.includes(t)}));return n.length!==this.states.length&&(this.runtimeStatesEncoder&&i.forEach((function(t){e.runtimeStatesEncoder[t]=null})),this.useStates(n),!0)}},{key:"useStates",value:function(t,e){var i;if(!this.graphicItem)return!1;this.mark.emit(rw.BEFORE_ELEMENT_STATE,{states:t},this);var n=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;n&&t.sort(n),this.states=t;var r=dt(e)?e:this.hasStateAnimation();return this.graphicItem.stateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,r),this.mark.emit(rw.AFTER_ELEMENT_STATE,{states:t},this),!0}},{key:"diffAttributes",value:function(t){var e={},i=this.getFinalGraphicAttributes();for(var n in t)Lt(i,n)&&Wt(i[n],t[n])||(e[n]=t[n]);return e}},{key:"transformElementItems",value:function(t,e,i){var n,r,a,o,s,u=t[0];if(!u.nextAttrs||0===Object.keys(u.nextAttrs).length)return{};var l=u.nextAttrs;if(function(t){return[YS.line,YS.area,YS.largeRects,YS.largeSymbols].includes(t)}(e)&&t&&t.length&&vt(null===(n=u.nextAttrs)||void 0===n?void 0:n.points)&&(!0===i||Cw(Object.keys(u.nextAttrs),this.mark.markType))){var h=this.mark.getSpec(),c=this.getGraphicAttribute("points",!1),d=this.getGraphicAttribute("segments",!1),f=h.enableSegments,v=null===(r=this.mark.getSpec().encode)||void 0===r?void 0:r[KS.connectNulls],p=t.map((function(t){return t.nextAttrs})),g=this.mark.isProgressive();if(l=Gw(l),e===YS.line||e===YS.area){var y=function(t,e,i,n){return t&&t.length&&(1!==t.length||e)?t.some((function(t){return Cw(Object.keys(t.nextAttrs),"line")}))?t.map((function(t,e){var r,a=t.nextAttrs,o=null!==(r=null==i?void 0:i[e])&&void 0!==r?r:{},s=o.x,u=o.y,l=o.x1,h=o.y1,c=o.defined;return vt(a.x)&&(a.x=s),vt(a.y)&&(a.y=u),vt(a.defined)&&!1===c&&(a.defined=!1),a.context=t.key,n&&(vt(a.x1)&&(a.x1=l),vt(a.y1)&&(a.y1=h)),a})):null!=i?i:[]:[]}(t,!0,c,e===YS.area);if(g)l.segments=(null!==(s=null===(o=null===(a=this.graphicItem)||void 0===a?void 0:a.attribute)||void 0===o?void 0:o.segments)&&void 0!==s?s:[]).concat([{points:y}]);else if(v){if(l.segments=function(t,e,i){if(!t||t.length<=1)return null;var n,r,a=!!i&&i.mark.getSpec().enableSegments,o=[],s=null;if(t.forEach((function(t,i){(s=e[i])&&!1!==s.defined?(n||(r={items:[],points:[]},o.push(r)),r.points.push(s),r.items.push(t),!1===n&&(r.isConnect=!0,r={items:[],points:[]},o.push(r)),n=!0):n=!1})),(o=o.filter((function(t){return t.points.length>0}))).length>=2){var u=[];return o.forEach((function(t){if(t.isConnect)u.push({points:t.points,isConnect:!0});else{if(a){var e=Uw(t.items,t.points,i);if(e)return void e.forEach((function(t){u.push(t)}))}var n=Gw(t.items[0]);n.points=t.points,u.push(n)}})),u}return a?Uw(t,e,i):null}(p,y,this),l.segments&&l.segments.some((function(t){return t.isConnect}))){var m=Bw(v,this.getDatum(),this,this.mark.parameters());m&&l.segments.forEach((function(t){t.isConnect&&Object.assign(t,m)}))}l.points=y}else if(f){var k=y&&0!==y.length?y:function(t){return t?t.reduce((function(t,e){return t.concat(e.points)}),[]):null}(d),_=Uw(p,k,this);_?(l.segments=_,l.points=null):(l.segments=null,l.points=k),l=function(t,e){var i;if(!t||!t.segments||!t.segments.length)return t;var n="area"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.markType)?["fillOpacity","strokeOpacity"]:["strokeOpacity"],r={};return Object.keys(t).forEach((function(e){n.includes(e)||(r[e]=t[e])})),r}(l,this)}else l.points=y,l.segments=null}else e===YS.largeRects?l.points=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t||!t.length||1===t.length&&!e)return[];var n=new Float32Array(4*t.length);return t.forEach((function(t,e){var r,a,o,s,u=t.nextAttrs,l=null!==(r=u.x)&&void 0!==r?r:i[4*e],h=null!==(a=u.y)&&void 0!==a?a:i[4*e+1],c=null!==(o=u.width)&&void 0!==o?o:i[4*e+2],d=null!==(s=u.y1)&&void 0!==s?s:i[4*e+3];n[4*e]=l,n[4*e+1]=h,n[4*e+2]=c,n[4*e+3]=d-h})),n}(t,!0,c):e===YS.largeSymbols&&(l.points=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t||!t.length||1===t.length&&!e)return[];var n=new Float32Array(2*t.length);return t.forEach((function(t,e){var r,a,o=t.nextAttrs,s=null!==(r=o.x)&&void 0!==r?r:i[2*e],u=null!==(a=o.y)&&void 0!==a?a:i[2*e+1];n[2*e]=s,n[2*e+1]=u})),n}(t,!0,c))}return l}},{key:"applyGraphicAttributes",value:function(t){var e,i,n,r=this;if(!Pt(t))if(this.mark.needAnimate()){var a=this.diffAttributes(t),o=null!==(e=this.getPrevGraphicAttributes())&&void 0!==e?e:{},s=null!==(i=this.getFinalGraphicAttributes())&&void 0!==i?i:{};Object.keys(a).forEach((function(t){o[t]=r.getGraphicAttribute(t),s[t]=a[t]})),this.setNextGraphicAttributes(a),this.setPrevGraphicAttributes(o),this.setFinalGraphicAttributes(s);var u=((null===(n=this.mark.animate)||void 0===n?void 0:n.getElementAnimators(this))||[]).reduce((function(t,e){return Object.assign(t,e.getEndAttributes())}),{}),l=Object.assign({},u,s);this.graphicItem.setAttributes(l)}else this.graphicItem.setAttributes(t)}},{key:"getGraphicAttribute",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.graphicItem){if(i){var n,r=this.getPrevGraphicAttributes();if(!vt(n=Ot(r,t)))return n}var a=this.mark.getAttributeTransforms(),o=[t];if(a&&a.length){var s=a.find((function(e){return e.storedAttrs&&e.channels.includes(t)}));s&&(o=[s.storedAttrs,t])}return Ot(null===(e=this.graphicItem)||void 0===e?void 0:e.attribute,o)}}},{key:"setGraphicAttribute",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.graphicItem){var n=this.getFinalGraphicAttributes(),r=this.getPrevGraphicAttributes();i&&n&&(n[t]=e),r&&!Lt(r,t)&&(r[t]=this.graphicItem.attribute[t]),this.graphicItem.setAttribute(t,e)}}},{key:"setGraphicAttributes",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.graphicItem){var n=this.getFinalGraphicAttributes(),r=this.getPrevGraphicAttributes();Object.keys(t).forEach((function(a){n&&i&&(n[a]=t[a]),r&&!Lt(r,a)&&(r[a]=e.graphicItem.attribute[a])})),this.graphicItem.setAttributes(t)}}},{key:"getFinalGraphicAttributes",value:function(){return this.graphicItem.finalAttrs}},{key:"setFinalGraphicAttributes",value:function(t){this.graphicItem.finalAttrs=t}},{key:"getPrevGraphicAttributes",value:function(){return this.graphicItem.prevAttrs}},{key:"setPrevGraphicAttributes",value:function(t){this.graphicItem.prevAttrs=t}},{key:"getNextGraphicAttributes",value:function(){return this.graphicItem.nextAttrs}},{key:"getFinalAnimationAttribute",value:function(t){var e,i;return null!==(i=null===(e=this.getFinalGraphicAttributes())||void 0===e?void 0:e[t])&&void 0!==i?i:this.getGraphicAttribute(t)}},{key:"getFinalAnimationAttributes",value:function(){var t;return null!==(t=this.getFinalGraphicAttributes())&&void 0!==t?t:this.graphicItem.attribute}},{key:"setNextGraphicAttributes",value:function(t){this.graphicItem.nextAttrs=t}},{key:"clearChangedGraphicAttributes",value:function(){this.graphicItem&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null))}},{key:"clearGraphicAttributes",value:function(){this.graphicItem&&(this.graphicItem.prevAttrs&&this.setPrevGraphicAttributes(null),this.graphicItem.nextAttrs&&this.setNextGraphicAttributes(null),this.graphicItem.finalAttrs&&this.setFinalGraphicAttributes(null))}},{key:"remove",value:function(){this.graphicItem&&(Ow(this.graphicItem),this.graphicItem=null)}},{key:"release",value:function(){this.removeGraphicItem(),this.mark=null,this.data=null,this.items=null}},{key:"getItemAttribute",value:function(t){var e,i;if(null===(e=this.items)||void 0===e?void 0:e.length)return this.mark.isCollectionMark()?vt(t)?this.items.map((function(t){return t.nextAttrs})):this.items.map((function(e){var i;return null===(i=e.nextAttrs)||void 0===i?void 0:i[t]})):vt(t)?this.items[0].nextAttrs:null===(i=this.items[0].nextAttrs)||void 0===i?void 0:i[t]}},{key:"setItemAttributes",value:function(t){var e;(null===(e=this.items)||void 0===e?void 0:e.length)&&(this.mark.isCollectionMark()?bt(t)&&this.items.forEach((function(e,i){Object.assign(e.nextAttrs,t[i])})):Object.assign(this.items[0].nextAttrs,t))}},{key:"getItem",value:function(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.items)&&void 0!==t?t:[]:null===(e=this.items)||void 0===e?void 0:e[0]}},{key:"getDatum",value:function(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.data)&&void 0!==t?t:[]:null===(e=this.data)||void 0===e?void 0:e[0]}}])}(),Vw=function(){return u((function t(e,i){o(this,t),this.references=new Map,this.view=e,this.depend(null==i?void 0:i.dependency)}),[{key:"getStartState",value:function(){return null}},{key:"depend",value:function(t){var e=this;this.references.clear(),Kt(t).map((function(t){return _t(t)?e.view.getGrammarById(t):t})).filter((function(t){return!vt(t)})).forEach((function(t){var i;e.references.set(t,(null!==(i=e.references.get(t))&&void 0!==i?i:0)+1)}))}},{key:"parameters",value:function(){var t={};return this.references.forEach((function(e,i){pt(i.id())&&(t[i.id()]=i.output())})),t}},{key:"bind",value:function(){var t=this,e=this.getEvents();(null!=e?e:[]).forEach((function(e){e.type&&e.handler&&(bt(e.type)?e.type.forEach((function(i){i&&"none"!==i&&t.view.addEventListener(i,e.handler)})):"none"!==e.type&&t.view.addEventListener(e.type,e.handler))}))}},{key:"unbind",value:function(){var t=this,e=this.getEvents();(null!=e?e:[]).forEach((function(e){e.type&&e.handler&&(bt(e.type)?e.type.forEach((function(i){i&&"none"!==i&&t.view.removeEventListener(i,e.handler)})):"none"!==e.type&&t.view.removeEventListener(e.type,e.handler))}))}},{key:"start",value:function(t){}},{key:"reset",value:function(t){}},{key:"dispatchEvent",value:function(t,e){this.view.emit("".concat(this.type,":").concat(t),e),"start"===t&&this.options.onStart?this.options.onStart(e):"reset"===t&&this.options.onReset?this.options.onReset(e):"update"===t&&this.options.onUpdate?this.options.onUpdate(e):"end"===t&&this.options.onEnd&&this.options.onEnd(e)}}])}(),Hw=function(t,e){if(!e||!t)return null;var i={};return t.forEach((function(t){var n=t&&t.getSpec(),r=n&&n.encode;r&&e.forEach((function(e){e&&r[e]&&(i[e]||(i[e]=[]),i[e].push(t))}))})),i},Kw=function(t){function i(t,n){var r;return o(this,i),(r=e(this,i,[t,n])).type=i.type,r._resetType=[],r.clearPrevElements=function(){var t=r.options,e=t.state,i=t.reverseState;r._statedElements&&r._statedElements.length&&(r.clearAllStates(e,i),r.dispatchEvent("reset",{elements:r._statedElements,options:r.options}),r._statedElements=[])},r.handleStart=function(t){r.start(t.element)},r.handleReset=function(t){r.reset(t.element)},r.options=Object.assign({},i.defaultOptions,n),r._marks=t.getMarksBySelector(r.options.selector),r._stateMarks=Hw(r._marks,[r.options.state,r.options.reverseState]),r}return h(i,t),u(i,[{key:"getStartState",value:function(){return this.options.state}},{key:"getEvents",value:function(){var t=this,e=this.options.triggerOff,i=this.options.trigger,n=[{type:i,handler:this.handleStart}],r=function(t){var e=Kt(t),i=[],n=[];return e.forEach((function(t){"empty"===t?i.push("view"):_t(t)&&"none"!==t?t.includes("view:")?(n.push(t.replace("view:","")),i.push("view")):(n.push(t),i.push("self")):wt(t)&&i.push("timeout")})),{eventNames:n,resetType:i}}(e),a=r.eventNames,o=r.resetType;return a.forEach((function(e){e&&(bt(i)?!i.includes(e):e!==i)&&n.push({type:e,handler:t.handleReset})})),this._resetType=o,n}},{key:"start",value:function(t){var e=this,i=this.options,n=i.state,r=i.reverseState,a=i.isMultiple;if(t&&this._marks&&this._marks.includes(t.mark))if(t.hasState(n)){if(this._resetType.includes("self")){var o=this._statedElements&&this._statedElements.filter((function(e){return e!==t}));o&&o.length?this._statedElements=this.updateStates(o,this._statedElements,n,r):this.clearPrevElements()}}else this._timer&&clearTimeout(this._timer),t.addState(n),this._statedElements=this.updateStates(a&&this._statedElements?[].concat(y(this._statedElements),[t]):[t],this._statedElements,n,r),this.dispatchEvent("start",{elements:this._statedElements,options:this.options}),this._resetType.includes("timeout")&&(this._timer=setTimeout((function(){e.clearPrevElements()}),this.options.triggerOff));else this._resetType.includes("view")&&this._statedElements&&this._statedElements.length&&this.clearPrevElements()}},{key:"reset",value:function(t){if(this._statedElements&&this._statedElements.length){var e=t&&this._marks&&this._marks.includes(t.mark);(this._resetType.includes("view")&&!e||this._resetType.includes("self")&&e)&&this.clearPrevElements()}}}])}(Vw);Kw.type="element-select",Kw.defaultOptions={state:ow.selected,trigger:"click"};var Xw=function(t){function i(t,n){var r;return o(this,i),(r=e(this,i,[t,n])).type=i.type,r.handleStart=function(t){r.start(t.element)},r.handleReset=function(t){r.reset(t.element)},r.options=Object.assign({},i.defaultOptions,n),r._marks=t.getMarksBySelector(r.options.selector),r._stateMarks=Hw(r._marks,[r.options.highlightState,r.options.blurState]),r}return h(i,t),u(i,[{key:"getStartState",value:function(){return this.options.highlightState}},{key:"getEvents",value:function(){var t=this.options.triggerOff,e=[{type:this.options.trigger,handler:this.handleStart}],i=t;return _t(t)&&t.includes("view:")?(i=t.replace("view:",""),this._resetType="view"):this._resetType="self",e.push({type:i,handler:this.handleReset}),e}},{key:"clearPrevElements",value:function(){var t=this.options,e=t.highlightState,i=t.blurState;this._lastElement&&(this.clearAllStates(e,i),this.dispatchEvent("reset",{elements:[this._lastElement],options:this.options}),this._lastElement=null,this._statedElements=null)}},{key:"start",value:function(t){if(t&&this._marks&&this._marks.includes(t.mark)){var e=this.options,i=e.highlightState,n=e.blurState;if(this._lastElement===t)return;this._statedElements=this.updateStates([t],this._statedElements,i,n),this._lastElement=t,this.dispatchEvent("start",{elements:[t],options:this.options})}else this._lastElement&&"view"===this._resetType&&this.clearPrevElements()}},{key:"reset",value:function(t){if(this._statedElements&&this._statedElements.length){var e=t&&this._marks&&this._marks.includes(t.mark);"view"!==this._resetType||e?"self"===this._resetType&&e&&this.clearPrevElements():this.clearPrevElements()}}}])}(Vw);Xw.type="element-highlight",Xw.defaultOptions={highlightState:ow.highlight,blurState:ow.blur,trigger:"pointerover",triggerOff:"pointerout"};var Yw=function(){return u((function t(){o(this,t)}),[{key:"updateStates",value:function(t,e,i,n){return t&&t.length?(i&&n?e&&e.length?(this.toggleReverseStateOfElements(t,e,n),this.toggleStateOfElements(t,e,i)):this.addBothStateOfElements(t,i,n):i&&(e&&e.length?this.toggleStateOfElements(t,e,i):this.addStateOfElements(t,i)),t):null}},{key:"toggleReverseStateOfElements",value:function(t,e,i){var n=this;e.forEach((function(t){i&&n._stateMarks[i]&&n._stateMarks[i].includes(t.mark)&&t.addState(i)})),t.forEach((function(t){i&&n._stateMarks[i]&&n._stateMarks[i].includes(t.mark)&&t.removeState(i)}))}},{key:"toggleStateOfElements",value:function(t,e,i){var n=this;e.forEach((function(t){i&&n._stateMarks[i]&&n._stateMarks[i].includes(t.mark)&&t.removeState(i)})),t.forEach((function(t){i&&n._stateMarks[i]&&n._stateMarks[i].includes(t.mark)&&t.addState(i)}))}},{key:"addBothStateOfElements",value:function(t,e,i){var n=this;this._marks.forEach((function(r){var a=i&&n._stateMarks[i]&&n._stateMarks[i].includes(r),o=e&&n._stateMarks[e]&&n._stateMarks[e].includes(r);(a||o)&&r.elements.forEach((function(n){t&&t.includes(n)?o&&n.addState(e):a&&n.addState(i)}))}))}},{key:"addStateOfElements",value:function(t,e){var i=this;this._marks.forEach((function(n){var r=e&&i._stateMarks[e]&&i._stateMarks[e].includes(n);r&&n.elements.forEach((function(i){t&&t.includes(i)&&r&&i.addState(e)}))}))}},{key:"clearAllStates",value:function(t,e){var i=this;this._statedElements&&this._statedElements.length&&this._marks.forEach((function(n){e&&i._stateMarks[e]&&i._stateMarks[e].includes(n)&&n.elements.forEach((function(t){t.removeState(e)})),t&&i._stateMarks[t]&&i._stateMarks[t].includes(n)&&n.elements.forEach((function(e){i._statedElements.includes(e)&&e.removeState(t)}))}))}}])}(),qw=function(t,e){return xw(t)?t.output():t&&gt(t)?ft(t.callback)?function(i){return t.callback(i,e)}:ft(t.value)?t.value(e):t:t},Zw=function(t,e){return t?gt(t)?Object.keys(t).reduce((function(i,n){var r=t[n];return i[n]=qw(r,e),i}),{}):t.map((function(t){return qw(t,e)})):t},Jw=-1,$w=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).spec={},n.references=new Map,n.targets=[],n.transforms=[],n.view=t,n.uid=++Jw,n}return h(i,t),u(i,[{key:"parse",value:function(t){return this.id(t.id),this.name(t.name),this.depend(t.dependency),this}},{key:"depend",value:function(t){var e,i=this;if(null===(e=this.spec)||void 0===e?void 0:e.dependency){var n=Kt(this.spec.dependency).map((function(t){return _t(t)?i.view.getGrammarById(t):t}));this.detach(n)}this.spec.dependency=t;var r=Kt(t).map((function(t){return _t(t)?i.view.getGrammarById(t):t}));return this.attach(r),this.commit(),this}},{key:"addEventListener",value:function(t,e,i){var n=e;return i&&!1===i.trap||((n=e).raw=e),i&&i.target&&(n.target=i.target),this.on(t,n),this}},{key:"removeEventListener",value:function(t,e){return e?this.off(t,e):this.off(t),this}},{key:"emit",value:function(t){for(var e,n,r,a,o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];return null===(a=null===(r=this.view)||void 0===r?void 0:r.emit)||void 0===a||(e=a).call.apply(e,[r,t].concat(s)),(n=p(c(i.prototype),"emit",this)).call.apply(n,[this,t].concat(s))}},{key:"emitGrammarEvent",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return(e=p(c(i.prototype),"emit",this)).call.apply(e,[this,t].concat(r))}},{key:"evaluateTransform",value:function(t,e,i){if(!t||!t.length)return e;for(var n=e,r=0,a=t.length;r<a;){var o=t[r];this.emit(rw.BEFORE_TRANSFORM,o.type),n=o.transform(o.isRawOptions?o.options:Zw(o.options,i),n,i,this.view),r++,this.emit(rw.AFTER_TRANSFORM,o.type)}return n}},{key:"set",value:function(t){return!1}},{key:"id",value:function(t){return arguments.length?(this.view.grammars.unrecord(this),this._id=t,this.view.grammars.record(this),this):this._id}},{key:"name",value:function(t){return arguments.length?(this._name=t,this):this._name}},{key:"attach",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Kt(t).filter((function(t){return!vt(t)})).forEach((function(n){var r;vt(t)||(n.targets.includes(e)||n.targets.push(e),e.references.set(n,(null!==(r=e.references.get(n))&&void 0!==r?r:0)+i))})),this}},{key:"detach",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Kt(t).filter((function(t){return!vt(t)})).forEach((function(t){var n=e.references.get(t)-i;n>0?e.references.set(t,n-1):(e.references.delete(t),t.targets.includes(e)&&(t.targets=t.targets.filter((function(t){return t!==e}))))})),this}},{key:"detachAll",value:function(){var t=this;this.references.forEach((function(e,i){t.detach(i,e)}))}},{key:"link",value:function(t){this.grammarSource=t}},{key:"run",value:function(){var t,e=null===(t=this.grammarSource)||void 0===t?void 0:t.output(),i=this.parameters();return this.evaluate(e,i)}},{key:"commit",value:function(){this.view.commit(this)}},{key:"parameters",value:function(){var t={};return this.references.forEach((function(e,i){pt(i.id())&&(t[i.id()]=i.output())})),t}},{key:"getSpec",value:function(){return this.spec}},{key:"reuse",value:function(t){return this}},{key:"clear",value:function(){this.spec=null,this.view=null}},{key:"release",value:function(){this.clear()}},{key:"setFunctionSpec",value:function(t,e){return vt(this.spec[e])||this.detach(mw(this.spec[e],this.view)),this.spec[e]=t,this.attach(mw(t,this.view)),this.commit(),this}}])}(ht),Qw=function(t,e,i){var n,r;if("callback"===t&&ft(e))return{references:[],value:{callback:e,dependency:[]}};if(!vt(e.data)){var a=i.getDataById(e.data);return{references:[a],value:a}}if(!vt(e.customized)){var o=i.getCustomizedById(e.customized);return{references:[o],value:o}}if(!vt(e.scale)){var s=i.getScaleById(e.scale);return{references:[s],value:s}}if((r=e)&&(r.signal||r.callback)){var u=mw(e,i);return{references:u,value:e.callback?{value:e.callback,dependency:u}:null!==(n=null==u?void 0:u[0])&&void 0!==n?n:e}}return{value:e}},tA=function(t,e){var i=Mw.getTransform(t.type);if(i){var n={},r=[];return Object.keys(t).forEach((function(i){var a;if("type"!==i){var o=t[i];if("dependency"!==i){var s=function(t,e,i){if(vt(e))return{value:e};if(bt(e)){var n=e.map((function(e){return Qw(t,e,i)}));return{references:n.reduce((function(t,e){return e.references&&t.concat(e.references),t}),[]),value:n.map((function(t){return t.value}))}}return Qw(t,e,i)}(i,o,e);s&&((null===(a=s.references)||void 0===a?void 0:a.length)&&(r=r.concat(s.references)),n[i]=s.value)}else(null==o?void 0:o.length)&&(r=r.concat(yw(o,e)))}})),{markPhase:i.markPhase,transform:i.transform,canProgressive:i.canProgressive,type:i.type,options:n,references:r}}},eA=function(t,e){if(null==t?void 0:t.length){var i=[],n=[];return t.forEach((function(t){var r,a=tA(t,e);a&&((null===(r=a.references)||void 0===r?void 0:r.length)&&(n=n.concat(a.references)),i.push(a))})),{transforms:i,refs:n}}return null},iA={csv:bb,dsv:_b,tsv:xb,json:function(t){if(!_t(t))return Kt(t);try{return Kt(JSON.parse(t))}catch(t){return[]}}},nA=function(t){function i(t,n,r){var a;return o(this,i),(a=e(this,i,[t])).grammarType="data",a.spec={},a._dataIDKey="VGRAMMAR_DATA_ID_KEY_".concat(a.uid),a._loadTasks=[],a._postFilters=[],a.ingest=function(t){var e=function(t,e){if(vt(t))return t;if(ft(t))return t.call(null,e);if(t.signal){var i=t.signal;return _t(i)?null==e?void 0:e[i]:i.output()}return t.callback?t.callback.call(null,e):t}(t.format,a.parameters());return a._input=function(t,e){if(!e||!iA[e.type])return Kt(t);var i="dsv"===e.type?{delimiter:e.delimiter}:{};return iA[e.type](t,i,new Eb(new Tb))}(t.values,e),a._input},a.load=function(t){if(t.values)return a.ingest(t)},a.relay=function(t){return t[0]},a._loadTasks=[],vt(n)||a.values(n,r),a}return h(i,t),u(i,[{key:"parse",value:function(t){return p(c(i.prototype),"parse",this).call(this,t),this._isLoaded=!1,this.source(t.source,t.format,!1),this.url(t.url,t.format,!1),this.values(t.values,t.format,!1),this.transform(t.transform),this.parseLoad(t),this.commit(),this}},{key:"parseDataSource",value:function(t){var e=this,i=[],n=[],r=t.format?mw(t.format,this.view)[0]:null;if(r&&i.push(r),t.values){var a=mw(t.values,this.view)[0];a&&i.push(a),n.push({type:"ingest",transform:this.ingest,isRawOptions:!0,options:{values:t.values,format:t.format}})}else if(t.url){var o=mw(t.url,this.view)[0];o&&i.push(o),n.push({type:"load",transform:this.load,options:{url:null!=o?o:t.url,format:null!=r?r:t.format}})}else if(t.source){var s=[];Kt(t.source).forEach((function(t){var n=xw(t)?t:e.view.getDataById(t);n&&(i.push(n),s.push(n))})),s.length&&(n.push({type:"relay",transform:this.relay,options:s}),this.grammarSource=s[0])}return{transforms:n,refs:i}}},{key:"evaluate",value:function(t,e){this.view.emit(rw.BEFORE_EVALUATE_DATA);var i=this._isLoaded?this.transforms:this._loadTasks.concat(this.transforms);this.grammarSource&&(this._input=t);var n=this.evaluateTransform(i,this._input,e),r=this._evaluateFilter(n,e);return this.setValues(r),this._isLoaded=!0,this.view.emit(rw.AFTER_EVALUATE_DATA),this}},{key:"output",value:function(){return this._values}},{key:"getDataIDKey",value:function(){return this._dataIDKey}},{key:"values",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Object.assign({},this.spec,{values:t,format:e});return vt(t)||(n.url=void 0,n.source=void 0),i?this.parseLoad(n):this}},{key:"url",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Object.assign({},this.spec,{url:t,format:e});return vt(t)||(n.values=void 0,n.source=void 0),i?this.parseLoad(n):this}},{key:"source",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Object.assign({},this.spec,{source:t,format:e});return vt(t)||(n.values=void 0,n.url=void 0),i?this.parseLoad(n):this}},{key:"parseLoad",value:function(t){this.detach(this.parseDataSource(this.spec).refs),this.spec=t;var e=this.parseDataSource(this.spec);return this.attach(e.refs),this._loadTasks=e.transforms,this._isLoaded=!1,this.commit(),this}},{key:"setValues",value:function(t){var e=this;this._values=Kt(t).map((function(t,i){var n=t===Object(t)?t:{data:t};return n[e._dataIDKey]=i,n}))}},{key:"field",value:function(t){return this._values.map((function(e){return e[t]}))}},{key:"transform",value:function(t){var e=eA(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]),this.spec.transform=t;var i=eA(this.spec.transform,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.commit(),this}},{key:"getValue",value:function(){return this._values}},{key:"getInput",value:function(){return this._input}},{key:"addDataFilter",value:function(t){return this._postFilters=this._postFilters.concat(Kt(t)),this._postFilters.sort((function(t,e){var i,n;return(null!==(i=t.rank)&&void 0!==i?i:0)-(null!==(n=e.rank)&&void 0!==n?n:0)})),this}},{key:"removeDataFilter",value:function(t){var e=Kt(t);return this._postFilters=this._postFilters.filter((function(t){return!e.includes(t)})),this}},{key:"_evaluateFilter",value:function(t,e){return this._postFilters.reduce((function(t,i){return i.filter(t,e)}),t)}},{key:"reuse",value:function(t){return t.grammarType!==this.grammarType||(this._isLoaded=!1,this._values=t.output()),this}},{key:"clear",value:function(){p(c(i.prototype),"clear",this).call(this),this._input=null,this._values=null}}])}($w);function rA(t,e,i,n){for(var r,a,o=t[e];e>i&&(r=t[a=Math.floor((e-1)/2)],o&&r&&n(o,r)<0);)t[e]=r,e=a;return t[e]=o}function aA(t,e,i,n){for(var r,a=e,o=null!=i?i:t.length,s=t[e],u=2*e+1;u<o;)(r=u+1)<o&&n(t[u],t[r])>=0&&(u=r),t[e]=t[u],u=2*(e=u)+1;return t[e]=s,rA(t,e,a,n)}var oA=function(){return u((function t(e){o(this,t),this.compare=e,this.nodes=[]}),[{key:"size",value:function(){return this.nodes.length}},{key:"last",value:function(){return this.nodes[0]}},{key:"validate",value:function(){for(var t=this.nodes.length-1;t>0;t-=1){var e=Math.floor((t-1)/2);if(this.compare(this.nodes[e],this.nodes[t])>0)return!1}return!0}},{key:"push",value:function(t){if(this.nodes.includes(t)){var e=this.nodes.indexOf(t);return rA(this.nodes,e,0,this.compare),aA(this.nodes,e,null,this.compare)}return this.nodes.push(t),rA(this.nodes,this.nodes.length-1,0,this.compare)}},{key:"remove",value:function(t){if(this.nodes.includes(t)){var e=this.nodes.indexOf(t);this.nodes=this.nodes.slice(0,e).concat(this.nodes.slice(e+1)),rA(this.nodes,e,0,this.compare),aA(this.nodes,e,null,this.compare)}}},{key:"pop",value:function(){var t,e=this.nodes.pop();return this.nodes.length?(t=this.nodes[0],this.nodes[0]=e,aA(this.nodes,0,null,this.compare)):t=e,t}},{key:"clear",value:function(){this.nodes=[]}}])}(),sA=function(){return u((function t(e){o(this,t),this.list=[],this.ids={},this.idFunc=e||Ub}),[{key:"add",value:function(t){var e=this.idFunc(t);return this.ids[e]||(this.ids[e]=1,this.list.push(t)),this}},{key:"remove",value:function(t){var e=this.idFunc(t);return this.ids[e]&&(this.ids[e]=0,this.list=this.list.filter((function(e){return e!==t}))),this}},{key:"forEach",value:function(t,e){e?this.list.slice().reverse().forEach(t):this.list.forEach(t)}},{key:"filter",value:function(t){return this.list.filter(t)}},{key:"length",get:function(){return this.list.length}},{key:"getElementByIndex",value:function(t){return this.list[t]}}])}(),uA=function(){return u((function t(){o(this,t),this.grammars=[],this.logger=te.getInstance(),this._curRank=0,this._committed=new sA((function(t){return t.uid})),this._heap=new oA((function(t,e){return(null==t?void 0:t.qrank)-(null==e?void 0:e.qrank)})),this._beforeRunner=null,this._afterRunner=null,this._updateCounter=0,this._finishFirstRender=!1}),[{key:"add",value:function(t){if(t)return this._setRankOfGrammar(t),this.commit(t),!this.grammars.includes(t)&&(this.grammars.push(t),!0)}},{key:"remove",value:function(t){t&&(this._committed.remove(t),this._heap.remove(t),this.grammars=this.grammars.filter((function(e){return e!==t})))}},{key:"_setRankOfGrammar",value:function(t){t&&(t.rank=++this._curRank)}},{key:"_reRank",value:function(t){for(var e=this,i=[t];i.length;){var n=i.pop();this._setRankOfGrammar(n);var r=n.targets;r&&r.forEach((function(n){i.push(n),n===t&&e.logger.error("Cycle detected in dataflow graph.")}))}}},{key:"_enqueue",value:function(t){t&&(t.qrank=t.rank,this._heap.push(t))}},{key:"_logGrammarRunInfo",value:function(t){if(this.logger.canLogError()){var e=[{key:"id",value:t.id()},{key:"name",value:t.name()}].reduce((function(t,e,i){return vt(e.value)?t:"".concat(t).concat(i?" , ":"").concat(e.key,": ").concat(e.value)}),"");this.logger.debug("Run Operator: ",t,e)}}},{key:"hasCommitted",value:function(){return!!this._committed.length}},{key:"commit",value:function(t){return this._committed.add(t),this}},{key:"_beforeEvaluate",value:function(){var t=this;this.grammars.forEach((function(e){e.targets.some((function(t){return(null==t?void 0:t.rank)<(null==e?void 0:e.rank)}))&&t._reRank(e)})),this._committed.forEach((function(e){return t._enqueue(e)})),this._committed=new sA((function(t){return t.uid}))}},{key:"_enqueueTargets",value:function(t){var e=this;t.targets&&t.targets.length&&this._finishFirstRender&&t.targets.forEach((function(t){return e._enqueue(t)}))}},{key:"evaluate",value:function(){if(this._beforeRunner&&this._beforeRunner(this),!this._committed.length)return this.logger.info("Dataflow invoked, but nothing to do."),!1;this._updateCounter+=1;var t,e,i=0;for(this.logger.canLogInfo()&&(e=Date.now(),this.logger.debug("-- START PROPAGATION (".concat(this._updateCounter,") -----"))),this._beforeEvaluate();this._heap.size()>0;)(t=this._heap.pop())&&(t.rank===t.qrank?(t.run(),this._logGrammarRunInfo(t),this._enqueueTargets(t),i+=1):this._enqueue(t));return this.logger.canLogInfo()&&(e=Date.now()-e,this.logger.info("> ".concat(i," grammars updated; ").concat(e," ms"))),this._afterRunner&&this._afterRunner(this),this._finishFirstRender=!0,!0}},{key:"runBefore",value:function(t){this._beforeRunner=t}},{key:"runAfter",value:function(t){this._afterRunner=t}},{key:"release",value:function(){this._heap&&(this._heap.clear(),this._heap=null),this.logger=null,this._committed=null}}])}(),lA=function(t,e,i,n,r){!function t(a){if(r||!a||n&&!n(a)||i.call(null,a),a.markType===YS.group){var o=a[e];o&&o.forEach((function(e){t(e)}))}r&&(!a||n&&!n(a)||i.call(null,a))}(t)},hA=function(){return u((function t(e){var i=this;o(this,t),this.handleAfterNextRender=function(){i._stage&&!i._viewOptions.disableDirtyBounds&&i._stage.enableDirtyBounds(),i._view.emit(rw.AFTER_VRENDER_DRAW),i._view.emit(rw.AFTER_VRENDER_NEXT_RENDER)},this._view=e}),[{key:"initialize",value:function(t,e,i,n){return this._width=t,this._height=e,this._viewOptions=i,this._eventConfig=n,this.initStage(),this}},{key:"stage",value:function(){var t;return null!==(t=this._stage)&&void 0!==t?t:null}},{key:"gestureController",value:function(){var t;return null!==(t=this._gestureController)&&void 0!==t?t:null}},{key:"canvas",value:function(){return this._stage?this._stage.window.getNativeHandler().nativeCanvas:null}},{key:"context",value:function(){return this._stage?this._stage.window.getContext().nativeContext:null}},{key:"combineIncrementalLayers",value:function(){var t=this;return this._stage&&function(t){return Ya(this,void 0,void 0,n().mark((function e(){var i,r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=[],r=t.getChildren(),e.next=3,new Promise((function(t){Vn.global.getRequestAnimationFrame()((function(){t(null)}))}));case 3:return r.forEach((function(t){t.subLayers.size&&t.subLayers.forEach((function(t){t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&i.push(new Promise((function(e){t.drawContribution.hooks.completeDraw.tap("outWait",(function(){t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((function(t){return"outWait"!==t.name})),e(null)}))})))}))})),e.next=6,Promise.all(i);case 6:case"end":return e.stop()}}),e)})))}(this._stage).then((function(){t._stage&&t._stage.defaultLayer.combineSubLayer()})),this}},{key:"background",value:function(t){if(this._stage)return this._stage.background=t,this}},{key:"setDpr",value:function(t,e){var i,n;return null===(n=null===(i=this._stage)||void 0===i?void 0:i.setDpr)||void 0===n||n.call(i,t),e&&this.renderNextFrame(),this}},{key:"shouldResize",value:function(t,e){return t!==this._width||e!==this._height}},{key:"resize",value:function(t,e){return this._view.emit(rw.BEFORE_STAGE_RESIZE),this.shouldResize(t,e)&&(this._width=t,this._height=e,this._stage&&this._stage.resize(t,e)),this._view.emit(rw.AFTER_STAGE_RESIZE),this}},{key:"setViewBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this._stage?(!t||this._viewBox&&t.x1===this._viewBox.x1&&t.x2===this._viewBox.x2&&t.y1===this._viewBox.y1&&t.y2===this._viewBox.y2||(this._viewBox=t,this._stage.setViewBox(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1,e)),this):this}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._view.emit(rw.BEFORE_VRENDER_DRAW),this.initStage(),this._stage.disableDirtyBounds(),this._stage.afterNextRender(this.handleAfterNextRender),t&&(this._stage.render(),this._view.emit(rw.AFTER_VRENDER_DRAW)),this}},{key:"renderNextFrame",value:function(){return this.initStage(),this._stage.renderNextFrame(),this}},{key:"toCanvas",value:function(){return this._stage?this._stage.toCanvas():null}},{key:"preventRender",value:function(t){this._stage&&this._stage.preventRender(t)}},{key:"release",value:function(){var t;this._view.traverseMarkTree((function(t){t.release()})),this._dragController&&this._dragController.release(),this._gestureController&&this._gestureController.release(),this._stage!==(null===(t=this._viewOptions)||void 0===t?void 0:t.stage)&&this._stage.release(),this._stage=null,this._layer=null,this._dragController=null,this._gestureController=null}},{key:"createStage",value:function(){var t,e,i,n,r;this._view.emit(rw.BEFORE_CREATE_VRENDER_STAGE);var a=this._viewOptions,o=null!==(t=a.stage)&&void 0!==t?t:Ff({width:this._width,height:this._height,renderStyle:a.renderStyle,viewBox:a.viewBox,dpr:a.dpr,canvas:a.renderCanvas,canvasControled:a.canvasControled,container:a.container,title:a.rendererTitle,beforeRender:a.beforeRender,afterRender:a.afterRender,disableDirtyBounds:!0,autoRender:!0,pluginList:a.pluginList,enableHtmlAttribute:a.enableHtmlAttribute,optimize:a.optimize,ticker:a.ticker,supportsTouchEvents:a.supportsTouchEvents,supportsPointerEvents:a.supportsPointerEvents,ReactDOM:a.ReactDOM});(null===(e=a.options3d)||void 0===e?void 0:e.enable)&&o.set3dOptions(a.options3d),o.enableIncrementalAutoRender(),this._viewBox=a.viewBox,this._view.emit(rw.AFTER_CREATE_VRENDER_STAGE),this._view.emit(rw.BEFORE_CREATE_VRENDER_LAYER);var s=null!==(i=a.layer)&&void 0!==i?i:o.defaultLayer;if(this._view.emit(rw.AFTER_CREATE_VRENDER_LAYER),(null===(n=this._eventConfig)||void 0===n?void 0:n.drag)&&Mw.getStageEventPlugin("drag")&&(this._dragController=new(Mw.getStageEventPlugin("drag"))(o)),(null===(r=this._eventConfig)||void 0===r?void 0:r.gesture)&&Mw.getStageEventPlugin("gesture")){var u=gt(this._eventConfig.gesture)?this._eventConfig.gesture:{};this._gestureController=new(Mw.getStageEventPlugin("gesture"))(o,u)}return{stage:o,layer:s}}},{key:"initStage",value:function(){if(!this._stage){var t=this.createStage(),e=t.stage,i=t.layer;this._stage=e,this._layer=i;var n=this._view.background();this.background(n)}}}])}();function cA(t){return vt(t.offsetX)?vt(t.x)?t.changedTouches&&t.changedTouches.length?function(t){var e=t.changedTouches[0];return{canvasX:e.x,canvasY:e.y}}(t):{canvasX:0,canvasY:0}:function(t){return{canvasX:t.x,canvasY:t.y}}(t):function(t){return{canvasX:t.offsetX,canvasY:t.offsetY}}(t)}function dA(t,e){var i=["canvasX","canvasY"];return(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&(i.push("clientX"),i.push("clientY")),i.forEach((function(i){At(e[i])&&Object.defineProperty(t,i,{value:e[i],writable:!0})})),[e.canvasX,e.canvasY]}var fA="window",vA="view",pA="width",gA="height",yA="viewWidth",mA="viewHeight",kA="padding",_A="viewBox",bA="autoFit";function xA(t,e,i,n,r){r===fA&&function(t){["touches","changedTouches","targetTouches"].forEach((function(e){t[e]&&t[e].length&&Array.from(t[e]).forEach((function(t){dA(t,cA(t),!1)}))}));var e=cA(t);dA(t,e)}(e.changedTouches?e.changedTouches[0]:e);return e.element=i,e}var SA=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).grammarType="signal",t.spec={value:null,update:null},t}return h(i,t),u(i,[{key:"parse",value:function(t){return p(c(i.prototype),"parse",this).call(this,t),this.value(t.value),this.update(t.update),this.commit(),this}},{key:"evaluate",value:function(t,e){return this._signal=this.spec.update?_w(this.spec.update,e,this._signal):this.spec.value,this.spec.value=this._signal,this}},{key:"output",value:function(){return this._signal}},{key:"getValue",value:function(){return this.output()}},{key:"set",value:function(t){if(bt(t)&&bt(this.value)&&t.length===this.value.length){for(var e=0;e<t.length;e++)if(this.value[e]!==t[e])return this._signal=t,this.spec.value=t,!0;return!1}return this._signal!==t&&(this._signal=t,this.spec.value=t,!0)}},{key:"update",value:function(t){return vt(t)||this.value(void 0),this.setFunctionSpec(t,"update")}},{key:"value",value:function(t){return vt(t)||this.update(void 0),this.spec.value=t,this.commit(),this}},{key:"reuse",value:function(t){return t.grammarType!==this.grammarType||(this._signal=t.output()),this}},{key:"clear",value:function(){p(c(i.prototype),"clear",this).call(this),this._signal=null}}])}($w),wA=-1,AA=[pA,gA,kA,yA,mA,_A,bA],TA=function(t){var e,i,n,r;return wt(t)?{top:t,bottom:t,left:t,right:t}:{top:null!==(e=null==t?void 0:t.top)&&void 0!==e?e:0,bottom:null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0,left:null!==(n=null==t?void 0:t.left)&&void 0!==n?n:0,right:null!==(r=null==t?void 0:t.right)&&void 0!==r?r:0}},CA=function(t){var e,i=function t(e,i){var n,r;e.group=i;var a=null!==(n=e.id)&&void 0!==n?n:"VGRAMMAR_MARK_"+ ++wA;e.id=a,(null!==(r=e.marks)&&void 0!==r?r:[]).forEach((function(e){return t(e,a)}))};return(null!==(e=t.marks)&&void 0!==e?e:[]).forEach((function(t){return i(t,"root")})),t};function EA(t,e,i){var n=new Map;if(!t||0===t.length)return{keys:[],data:n};if(!e)return n.set(fw,i?t.slice().sort(i):t.slice()),{keys:pw,data:n};var r=Sw(e);if(1===t.length){var a=r(t[0]);return n.set(a,[t[0]]),{keys:[a],data:n}}var o=new Set;return t.forEach((function(t){var e,i=r(t),a=null!==(e=n.get(i))&&void 0!==e?e:[];a.push(t),n.set(i,a),o.add(i)})),i&&o.forEach((function(t){n.get(t).sort(i)})),{keys:Array.from(o),data:n}}var BA=function(){return u((function t(e,i,n){o(this,t),this.prevData=(null==e?void 0:e.length)?EA(e,null!=i?i:null,n):null}),[{key:"setCurrentData",value:function(t){this.currentData=t}},{key:"getCurrentData",value:function(){return this.currentData}},{key:"doDiff",value:function(){var t=this;if(this.callback)if(this.currentData&&this.prevData){var e=new Map(this.prevData.data);this.currentData.keys.forEach((function(i){t.callback(i,t.currentData.data.get(i),e.get(i)),e.delete(i)})),this.prevData.keys.forEach((function(i){e.has(i)&&t.callback(i,null,e.get(i))}))}else this.currentData?this.currentData.keys.forEach((function(e){t.callback(e,t.currentData.data.get(e),null)})):this.prevData&&this.prevData.keys.forEach((function(e){t.callback(e,null,t.prevData.data.get(e))}))}},{key:"setCallback",value:function(t){this.callback=t}},{key:"updateToCurrent",value:function(){this.prevData=this.currentData,this.currentData=null}},{key:"reset",value:function(){this.prevData=null}}])}();var RA=function(t){function i(t,n,r){var a;return o(this,i),(a=e(this,i,[t])).grammarType="mark",a.elements=[],a.elementMap=new Map,a.isUpdated=!0,a._isReentered=!1,a.differ=new BA([]),a.markType=n,a.spec.type=n,a.spec.encode={update:{}},a.spec.group=r,r&&(a.group=r,a.attach(r),r.appendChild(f(a))),a}return h(i,t),u(i,[{key:"parse",value:function(t){var e,n,r,a=this;if(p(c(i.prototype),"parse",this).call(this,t),this.spec.group){var o=_t(this.spec.group)?this.view.getMarkById(this.spec.group):this.spec.group;this.detach(o)}var s=_t(t.group)?this.view.getMarkById(t.group):t.group;return this.attach(s),this.join(null===(e=t.from)||void 0===e?void 0:e.data,t.key,t.sort,t.groupBy,t.groupSort),this.coordinate(t.coordinate),this.state(t.state,this.spec.stateSort),Object.keys(null!==(n=this.spec.encode)&&void 0!==n?n:{}).forEach((function(t){a.encodeState(t,{},!0)})),Object.keys(null!==(r=t.encode)&&void 0!==r?r:{}).forEach((function(e){a.encodeState(e,t.encode[e])})),this.animation(t.animation),this.animationState(t.animationState),this.morph(t.morph,t.morphKey,t.morphElementKey),this.layout(t.layout),this.configure(t),this.transform(t.transform),this.parseAddition(t),this.spec=t,this.markType=t.type,this.commit(),this}},{key:"parameters",value:function(){var t;return null!==(t=this._finalParameters)&&void 0!==t?t:p(c(i.prototype),"parameters",this).call(this)}},{key:"parseAddition",value:function(t){return this}},{key:"reuse",value:function(t){var e,i=this;if(t.grammarType!==this.grammarType)return this;var n=t;return this.markType=n.markType,this.coord=n.coord,this.elementMap=n.elementMap,this.elements=n.elements,this.elementMap.forEach((function(t){return t.mark=i})),this.differ=n.differ,null===(e=this.reuseAnimate)||void 0===e||e.call(this,n),this._context=n._context,this.graphicItem=n.graphicItem,this.graphicIndex=n.graphicIndex,this.graphicParent=n.graphicParent,this.needClear=n.needClear,this.isUpdated=n.isUpdated,this}},{key:"needLayout",value:function(){return!vt(this.spec.layout)}},{key:"handleLayoutEnd",value:function(){}},{key:"handleRenderEnd",value:function(){this.needClear&&(this.cleanExitElements(),this.elementMap.forEach((function(t){t.diffState===XS.exit?t.clearGraphicAttributes():t.clearChangedGraphicAttributes()})),this.differ.updateToCurrent(),this.needClear=!1)}},{key:"evaluateMainTasks",value:function(t,e){var i;if(this.needSkipBeforeLayout()&&this.view.getLayoutState()===nw.before)return this;var n=null===(i=this.view.renderer)||void 0===i?void 0:i.stage();this.init(n,e);var r=this.evaluateTransform(this._getTransformsBeforeJoin(),null!=t?t:vw,e),a=(null==r?void 0:r.progressive)?t:r;return this.evaluateGroup(a),this.renderContext=this.parseRenderContext(a,e),this.renderContext.progressive?(this.differ.reset(),this.elementMap.clear(),this.evaluateProgressive()):((null==r?void 0:r.progressive)&&(this.renderContext.parameters=e,this.renderContext.beforeTransformProgressive=r.progressive,a=r.progressive.output()),this.emit(rw.BEFORE_MARK_JOIN),this.evaluateJoin(a),this.emit(rw.AFTER_MARK_JOIN),this.emit(rw.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,e),this.emit(rw.AFTER_MARK_STATE),this.emit(rw.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),e),this.emit(rw.AFTER_MARK_ENCODE)),this.emit(rw.BEFORE_MARK_UPDATE),this.update(this.spec),this.emit(rw.AFTER_MARK_UPDATE),this}},{key:"evaluateGroup",value:function(t){if(this.markType!==YS.group){var e=EA(null!=t?t:vw,this.spec.groupBy,this.spec.groupSort),i=e.keys;this._groupKeys=i,this._groupEncodeResult=null,this.differ.setCurrentData(e)}}},{key:"_getTransformsAfterEncodeItems",value:function(){return this.transforms&&this.transforms.filter((function(t){return"afterEncodeItems"===t.markPhase}))}},{key:"_getTransformsAfterEncode",value:function(){return this.transforms&&this.transforms.filter((function(t){return vt(t.markPhase)||"afterEncode"===t.markPhase}))}},{key:"_getTransformsBeforeJoin",value:function(){return this.transforms?this.transforms.filter((function(t){return"beforeJoin"===t.markPhase})):[]}},{key:"evaluate",value:function(t,e){var i;return this.evaluateMainTasks(t,e),(null===(i=this.renderContext)||void 0===i?void 0:i.progressive)||this.evaluateTransform(this._getTransformsAfterEncode(),this.elements,e),this}},{key:"output",value:function(){return this}},{key:"join",value:function(t,e,i,n,r){return this.grammarSource&&(this.detach(this.grammarSource),this.grammarSource=null),this.spec.from=null,vt(t)||(_t(t)?this.grammarSource=this.view.getDataById(t):this.grammarSource=t,this.spec.from={data:t},this.attach(this.grammarSource)),this.spec.key=e,this.spec.sort=i,this.spec.groupBy=n,this.spec.groupSort=r,this.commit(),this}},{key:"coordinate",value:function(t){return _t(t)?this.coord=this.view.getCoordinateById(t):this.coord=t,this.attach(this.coord),this.commit(),this}},{key:"state",value:function(t,e){return this.spec.stateSort=e,this.setFunctionSpec(t,"state")}},{key:"encode",value:function(t,e,i){return this.encodeState(XS.update,t,e,i)}},{key:"encodeState",value:function(t,e,i,n){var r=this;if(t===XS.enter&&(this._isReentered=!0),this.spec.encode[t]){var a=this.spec.encode[t];if(kw(a))this.detach(Tw(a,this.view));else{var o=_t(e);o&&n||!o&&i?(Object.keys(a).forEach((function(t){r.detach(Tw(a[t],r.view))})),this.spec.encode[t]={}):o?this.detach(Tw(a[e],this.view)):Object.keys(e).forEach((function(t){r.detach(Tw(a[t],r.view))}))}}return e&&(this.spec.encode[t]||(this.spec.encode[t]={}),_t(e)?(this.spec.encode[t][e]=i,this.attach(Tw(i,this.view))):kw(e)?(this.spec.encode[t]=e,this.attach(Tw(e,this.view))):e&&(Object.assign(this.spec.encode[t],e),Object.values(e).forEach((function(t){r.attach(Tw(t,r.view))})))),this.commit(),this}},{key:"_getEncoders",value:function(){var t;return null!==(t=this.spec.encode)&&void 0!==t?t:{}}},{key:"animation",value:function(t){return this.spec.animation=t,this}},{key:"animationState",value:function(t){return this.setFunctionSpec(t,"animationState")}},{key:"layout",value:function(t){return this.spec.layout=t,this.commit(),this}},{key:"morph",value:function(t,e,i){return this.spec.morph=t,this.spec.morphKey=e,this.spec.morphElementKey=i,this}},{key:"transform",value:function(t){var e=eA(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]);var i=eA(t,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.spec.transform=t,this.commit(),this}},{key:"configure",value:function(t){var e=this,i=["clip","clipPath","zIndex","interactive","context","setCustomizedShape","large","largeThreshold","progressiveStep","progressiveThreshold","support3d","morph","morphKey","morphElementKey","attributeTransforms","skipTheme","enableSegments","stateSort"];return null===t?(i.forEach((function(t){vt(e.spec[t])||(e.spec[t]=void 0)})),this):(i.forEach((function(i){vt(t[i])||(e.spec[i]=t[i])})),this)}},{key:"context",value:function(t){return this.spec.context=t,this._context=t,this}},{key:"isCollectionMark",value:function(){return cw.includes(this.markType)}},{key:"needAnimate",value:function(){var t;return!(null===(t=this.renderContext)||void 0===t?void 0:t.progressive)&&!vt(this.spec.animation)}},{key:"getAllElements",value:function(){var t=this,e=this.elements.slice();return this.elementMap.forEach((function(t){t.diffState!==XS.exit||e.includes(t)||e.push(t)})),this.spec.sort&&e.sort((function(e,i){return t.spec.sort(e.getDatum(),i.getDatum())})),e}},{key:"getScales",value:function(){var t={};return this.references.forEach((function(e,i){i.grammarType===aw.scale&&(t[i.id()]=i.output())})),t}},{key:"getScalesByChannel",value:function(){var t=this.spec.encode;if(!t)return{};var e={},i=this.parameters();return Object.keys(t).forEach((function(n){var r=t[n];r&&!kw(r)&&Object.keys(r).forEach((function(t){ww(r[t])&&(e[t]=bw(r[t].scale,i))}))})),e}},{key:"getFieldsByChannel",value:function(){var t=this.spec.encode;if(!t)return{};var e={};return Object.keys(t).forEach((function(i){var n=t[i];kw(n)||Object.keys(n).forEach((function(t){Aw(n[t])&&(e[t]=n[t].field)}))})),e}},{key:"init",value:function(t,e){var i,n,r,a,o,s=this;if(this._delegateEvent||(this._delegateEvent=function(t,e){var i,n=null===(i=t.target)||void 0===i?void 0:i[hw];if((null==n?void 0:n.mark)===s){var r=xA(s.view,t,n,0,vA);s.emitGrammarEvent(e,r,n)}},this.initEvent()),null===(i=this.initAnimate)||void 0===i||i.call(this,this.spec),!this.group){var u=bw(this.spec.group,e);this.group=u,u&&u.appendChild(this)}var l=this.group?this.group.getGroupGraphicItem():t.defaultLayer,h=null!==(a=null===(r=null===(n=this.group)||void 0===n?void 0:n.children)||void 0===r?void 0:r.indexOf(this))&&void 0!==a?a:0;if(this.markType!==YS.group){if(!this.graphicItem){var c=Pw(this,YS.group,{pickable:!1,zIndex:null!==(o=this.spec.zIndex)&&void 0!==o?o:0});(this.spec.support3d||dw.includes(this.markType))&&c.setMode("3d"),c.name="".concat(this.id()||this.markType),this.graphicItem=c}this.graphicParent=this.graphicItem,!l||this.graphicIndex===h&&this.graphicItem.parent===l||l.insertIntoKeepIdx(this.graphicItem,h)}else this.graphicParent=l;this.graphicIndex=h}},{key:"update",value:function(t){var e;if(this._context=this.spec.context,this.isUpdated=!0,this.renderContext.progressive||null===(e=this.updateAnimate)||void 0===e||e.call(this,t),this.markType!==YS.group){if(vt(t.zIndex)||this.graphicItem.setAttribute("zIndex",t.zIndex),vt(t.clip)||this.graphicItem.setAttribute("clip",t.clip),!vt(t.clipPath)){var i=bt(t.clipPath)?t.clipPath:t.clipPath(this.elements);i&&i.length?this.graphicItem.setAttribute("path",i):this.graphicItem.setAttributes({path:i,clip:!1})}this.elementMap.forEach((function(t){t.updateGraphicItem()}))}else this.elementMap.forEach((function(t){t.updateGraphicItem()}))}},{key:"createElement",value:function(){return new Ww(this)}},{key:"evaluateJoin",value:function(t){var e,i,n,r,a=this;this.needClear=!0;var o=Sw(null!==(n=null!==(e=this.spec.key)&&void 0!==e?e:null===(i=this.grammarSource)||void 0===i?void 0:i.getDataIDKey())&&void 0!==n?n:function(){return fw}),s=Sw(null!==(r=this.spec.groupBy)&&void 0!==r?r:function(){return fw}),u=this.spec.sort,l=this.isCollectionMark(),h=new Set(this.elements.filter((function(t){return t.diffState===XS.enter}))),c=[];this.differ.setCallback((function(t,e,i){var n,r,u=t;if(vt(e))(r=a.elementMap.get(u))&&(r.diffState=XS.exit);else if(vt(i)){if((r=a.elementMap.has(u)?a.elementMap.get(u):a.createElement()).diffState===XS.exit){r.diffState=XS.enter;var d=null===(n=a.animate)||void 0===n?void 0:n.getElementAnimators(r,XS.exit);d&&d.forEach((function(t){return t.stop("start")}))}r.diffState=XS.enter;var f=l?t:s(e[0]);r.updateData(f,e,o),a.elementMap.set(u,r),c.push(r)}else if(r=a.elementMap.get(u)){r.diffState=XS.update;var v=l?t:s(e[0]);r.updateData(v,e,o),c.push(r)}h.delete(r)}));var d=null!=t?t:vw;l||this.differ.setCurrentData(EA(d,(function(t){return"".concat(s(t),"-").concat(o(t))}),void 0)),this.differ.doDiff(),h.forEach((function(t){a.elementMap.delete(l?t.groupKey:"".concat(t.groupKey,"-").concat(t.key)),t.remove(),t.release()})),this.elements=c,u&&this.elements.length>=2&&this.elements.sort((function(t,e){return u(t.getDatum(),e.getDatum())}))}},{key:"evaluateState",value:function(t,e,i){e&&t.forEach((function(t){t.state(e,i)}))}},{key:"evaluateGroupEncode",value:function(t,e,i){if(this._groupKeys&&e){var n={};return this._groupKeys.forEach((function(r){var a=t.find((function(t){return t.groupKey===r}));a&&(n[r]=Bw(e,a.items&&a.items[0]&&a.items[0].datum,a,i))})),this._groupEncodeResult=n,n}}},{key:"getChannelsFromConfig",value:function(t){var e=this.spec;return vt(e.interactive)?null:{pickable:e.interactive}}},{key:"evaluateEncode",value:function(t,e,i,n){var r=this,a=this.getChannelsFromConfig();if(e){this.emit(rw.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);var o=n?null:this.evaluateGroupEncode(t,e[KS.group],i);t.forEach((function(t){r.markType===YS.glyph&&r._groupEncodeResult?t.items.forEach((function(e){e.nextAttrs=Object.assign(e.nextAttrs,a,r._groupEncodeResult[t.groupKey])})):(null==o?void 0:o[t.groupKey])&&!r.isCollectionMark()?t.items.forEach((function(e){e.nextAttrs=Object.assign(e.nextAttrs,a,o[t.groupKey])})):a&&t.items.forEach((function(t){t.nextAttrs=Object.assign(t.nextAttrs,a)})),t.encodeItems(t.items,e,r._isReentered,i),r.isCollectionMark()&&(null==o?void 0:o[t.groupKey])&&pt(o[t.groupKey].defined)&&(t.items.forEach((function(e){e.nextAttrs.defined=o[t.groupKey].defined})),delete o[t.groupKey].defined)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((function(t){t.encodeGraphic(r.isCollectionMark()?null==o?void 0:o[t.groupKey]:null)})),this.emit(rw.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((function(t){t.initGraphicItem(a)}))}},{key:"addGraphicItem",value:function(t,e,i){var n,r=null!=i?i:Pw(this,this.markType,t);if(r){if(null===(n=this.renderContext)||void 0===n?void 0:n.progressive){var a;if(this._groupKeys){var o=this._groupKeys.indexOf(e);o>=0&&(a=this.graphicParent.getChildAt(o))}else a=this.graphicParent.at(0);this.isCollectionMark()?(r.incremental=1,a.appendChild(r)):a.incrementalAppendChild(r)}else this.graphicParent.appendChild(r);return r}}},{key:"parseRenderContext",value:function(t,e){var i=this,n=this.markType!==YS.group&&this.spec.progressiveStep>0&&this.spec.progressiveThreshold>0&&this.spec.progressiveStep<this.spec.progressiveThreshold,r=this.spec.large&&this.spec.largeThreshold>0&&t.length>=this.spec.largeThreshold;if(n){var a=this.differ.getCurrentData();return a&&a.keys&&a.keys.some((function(t){return a.data.get(t).length>i.spec.progressiveThreshold}))?{large:r,parameters:e,progressive:{data:t,step:this.spec.progressiveStep,currentIndex:0,totalStep:a.keys.reduce((function(t,e){return Math.max(Math.ceil(a.data.get(e).length/i.spec.progressiveStep),t)}),1),groupedData:a.data}}:{large:r}}return{large:r}}},{key:"isProgressive",value:function(){return this.renderContext&&(!!this.renderContext.progressive||!!this.renderContext.beforeTransformProgressive)}},{key:"isDoingProgressive",value:function(){return this.renderContext&&(this.renderContext.progressive&&this.renderContext.progressive.currentIndex<this.renderContext.progressive.totalStep||this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.unfinished())}},{key:"clearProgressive",value:function(){this.renderContext&&this.renderContext.progressive&&(this.elements=[],this.graphicParent.children.forEach((function(t){t.incrementalClearChild()})),this.graphicParent.removeAllChild()),this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.release(),this.renderContext=null}},{key:"restartProgressive",value:function(){this.renderContext&&this.renderContext.progressive&&(this.renderContext.progressive.currentIndex=0)}},{key:"evaluateJoinProgressive",value:function(){var t,e,i,n=this,r=this.renderContext.progressive.currentIndex,a=Sw(null!==(i=null!==(t=this.spec.key)&&void 0!==t?t:null===(e=this.grammarSource)||void 0===e?void 0:e.getDataIDKey())&&void 0!==i?i:function(){return fw}),o=[];if(this.isCollectionMark())return this._groupKeys.forEach((function(t,e){var i=n.renderContext.progressive.groupedData.get(t),s=n.renderContext.progressive.step,u=i.slice(r*s,(r+1)*s);if(0===r){var l=n.createElement();l.diffState=XS.enter,l.updateData(t,u,a),o.push(l)}else{var h=n.elements[e];h.updateData(t,u,a),o.push(h)}})),o;var s={};return this._groupKeys.forEach((function(t){var e=n.renderContext.progressive.groupedData.get(t),i=n.renderContext.progressive.step,u=e.slice(r*i,(r+1)*i),l=[];u.forEach((function(e){var i=n.createElement();i.diffState=XS.enter,i.updateData(t,[e],a),l.push(i),o.push(i)})),s[t]=l})),{groupElements:s,elements:o}}},{key:"evaluateEncodeProgressive",value:function(t,e,i){var n=this.renderContext.progressive.currentIndex;if(0===n){if(this.evaluateEncode(t,e,i),0===n&&this._groupEncodeResult&&!this.isCollectionMark()&&this.markType!==YS.glyph){var r=t[0],a=r.getGraphicItem(),o=null==a?void 0:a.parent;o&&this._groupEncodeResult[r.groupKey]&&o.setTheme({common:this._groupEncodeResult[r.groupKey]})}}else this.evaluateEncode(t,e,i,!0)}},{key:"evaluateProgressive",value:function(){var t,e,i,n=this;if(null===(t=this.renderContext)||void 0===t?void 0:t.beforeTransformProgressive){this.renderContext.beforeTransformProgressive.progressiveRun();var r=this.renderContext.beforeTransformProgressive.output();return this.emit(rw.BEFORE_MARK_JOIN),this.evaluateJoin(r),this.emit(rw.AFTER_MARK_JOIN),this.emit(rw.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,this.renderContext.parameters),this.emit(rw.AFTER_MARK_STATE),this.emit(rw.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),this.renderContext.parameters),void this.emit(rw.AFTER_MARK_ENCODE)}if(null===(e=this.renderContext)||void 0===e?void 0:e.progressive){var a=this.renderContext.parameters;this.emit(rw.BEFORE_MARK_JOIN);var o=this.evaluateJoinProgressive(),s=Array.isArray(o)?o:o.elements;if(this.emit(rw.AFTER_MARK_JOIN),0===this.renderContext.progressive.currentIndex?(this.graphicParent.removeAllChild(),this._groupKeys.forEach((function(t){var e=Pw(n,YS.group,{pickable:!1,zIndex:n.spec.zIndex});e.incremental=n.renderContext.progressive.step,n.graphicParent.appendChild(e)})),this.elements=s):this.elements=this.elements.concat(s),this.emit(rw.BEFORE_MARK_STATE),this.evaluateState(s,this.spec.state,a),this.emit(rw.AFTER_MARK_STATE),this.emit(rw.BEFORE_MARK_ENCODE),Array.isArray(o))this.evaluateEncodeProgressive(s,this._getEncoders(),a);else{var u=o.groupElements;Object.keys(u).forEach((function(t){n.evaluateEncodeProgressive(u[t],n._getEncoders(),a)}))}this.emit(rw.AFTER_MARK_ENCODE);var l=null===(i=this._getTransformsAfterEncode())||void 0===i?void 0:i.filter((function(t){return!0===t.canProgressive}));(null==l?void 0:l.length)&&this.evaluateTransform(l,this.elements,a),this.renderContext.progressive.currentIndex+=1}}},{key:"isLargeMode",value:function(){return this.renderContext&&this.renderContext.large}},{key:"cleanExitElements",value:function(){var t=this;this.elementMap.forEach((function(e,i){e.diffState!==XS.exit||e.isReserved||(t.elementMap.delete(i),e.remove(),e.release())}))}},{key:"getGroupGraphicItem",value:function(){if(this.elements&&this.elements[0]&&this.elements[0].getGraphicItem)return this.elements[0].getGraphicItem()}},{key:"getBounds",value:function(){var t;return this.graphicItem?this.graphicItem.AABBBounds:null===(t=this.getGroupGraphicItem())||void 0===t?void 0:t.AABBBounds}},{key:"getMorphConfig",value:function(){var t;return{morph:null!==(t=this.spec.morph)&&void 0!==t&&t,morphKey:this.spec.morphKey,morphElementKey:this.spec.morphElementKey}}},{key:"getAttributeTransforms",value:function(){var t;return null!==(t=this.spec.attributeTransforms)&&void 0!==t?t:Dw[this.markType]}},{key:"getContext",value:function(){return this._context}},{key:"needSkipBeforeLayout",value:function(){var t,e;if(!0===(null===(t=this.spec.layout)||void 0===t?void 0:t.skipBeforeLayouted))return!0;for(var i=this.group;i;){if(!0===(null===(e=i.getSpec().layout)||void 0===e?void 0:e.skipBeforeLayouted))return!0;i=i.group}return!1}},{key:"initEvent",value:function(){if(this._delegateEvent){var t=this.view.renderer.stage();t&&t.on("*",this._delegateEvent)}}},{key:"releaseEvent",value:function(){if(this._delegateEvent){var t=this.view.renderer.stage();t&&t.off("*",this._delegateEvent)}}},{key:"clear",value:function(){var t;this.releaseEvent(),this.transforms=null,this.elementMap=null,this.elements=null,this.graphicItem=null,this.animate=null,null===(t=this.group)||void 0===t||t.removeChild(this),this.group=null,p(c(i.prototype),"clear",this).call(this)}},{key:"prepareRelease",value:function(){var t;null===(t=this.animate)||void 0===t||t.stop(),this.elementMap.forEach((function(t){return t.diffState=XS.exit})),this._finalParameters=this.parameters()}},{key:"release",value:function(){this.releaseEvent(),this.elements.forEach((function(t){return t.release()})),this.elementMap.clear(),this._finalParameters=null,this.animate&&this.animate.release(),this.graphicItem&&Ow(this.graphicItem),this.detachAll(),p(c(i.prototype),"release",this).call(this)}}])}($w),MA=function(t){function i(t,n){var r;return o(this,i),(r=e(this,i,[t,YS.group,n])).children=[],r}return h(i,t),u(i,[{key:"parseRenderContext",value:function(){return{large:!1}}},{key:"appendChild",value:function(t){return this.children.push(t),this}},{key:"removeChild",value:function(t){return this.children=this.children.filter((function(e){return e!==t})),this}},{key:"includesChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!this.children.includes(t)||!!e&&this.children.some((function(e){return e.markType===YS.group&&e.includesChild(t,!0)}))}},{key:"updateLayoutChildren",value:function(){return this.children.length?(this.layoutChildren||(this.layoutChildren=[]),this.layoutChildren=this.children.filter((function(t){return t.needLayout()})),this):this}},{key:"getAttributeTransforms",value:function(){return Dw.rect}},{key:"evaluateJoin",value:function(t){if(!this.elements.length){var e=this.createElement();e.updateData(fw,vw,(function(){return""})),this.elements=[e],this.elementMap.set(fw,e)}}},{key:"getChannelsFromConfig",value:function(t){var e=this.spec,i={};if(vt(e.clip)||(i.clip=e.clip),vt(e.zIndex)||(i.zIndex=e.zIndex),!vt(e.clipPath)){var n=ft(e.clipPath)?e.clipPath([t]):e.clipPath;n&&n.length?i.path=n:(i.path=null,i.clip=!1)}return vt(e.interactive)||(i.pickable=e.interactive),i}},{key:"evaluateGroupEncode",value:function(t,e,i){var n,r=this.elements[0],a={};return Ew(r,[Object.assign({},null===(n=r.items)||void 0===n?void 0:n[0],{nextAttrs:a})],e,i),this._groupEncodeResult=a,a}},{key:"evaluateEncode",value:function(t,e,i,n){var r=this,a=this.getChannelsFromConfig();if(e){this.emit(rw.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);var o=n?null:this.evaluateGroupEncode(t,e[KS.group],i);t.forEach((function(t){t.items.forEach((function(t){t.nextAttrs=Object.assign(t.nextAttrs,a,o)})),t.encodeItems(t.items,e,r._isReentered,i)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((function(t){t.encodeGraphic()})),this.emit(rw.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((function(t){t.initGraphicItem(a)}))}},{key:"addGraphicItem",value:function(t,e,i){var n=null!=i?i:Pw(this,this.markType,t);if(n)return this.emit(rw.BEFORE_ADD_VRENDER_MARK,{graphicItem:n}),n.name="".concat(this.id()||this.markType),this.graphicParent.insertIntoKeepIdx(n,this.graphicIndex),this.emit(rw.AFTER_ADD_VRENDER_MARK,{graphicItem:n}),n}}])}(RA),PA=function(){return u((function t(e,i){o(this,t),this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}},this._size=0,this._mapKey=_t(e)?function(t){return t[e]}:e,this._warning=i}),[{key:"record",value:function(t){var e,i,n=t.grammarType,r=this._mapKey(t);return this._grammarMap[n]?(this._grammars[n].push(t),vt(r)||(this._grammarMap[n][r]?null===(e=this._warning)||void 0===e||e.call(this,r,t):this._grammarMap[n][r]=t)):(this._grammars.customized.push(t),vt(r)||(this._grammarMap.customized[r]?null===(i=this._warning)||void 0===i||i.call(this,r,t):this._grammarMap.customized[r]=t)),this._size+=1,this}},{key:"unrecord",value:function(t){var e=t.grammarType,i=this._mapKey(t);return this._grammarMap[e]?(this._grammars[e]=this._grammars[e].filter((function(e){return e!==t})),vt(i)||this._grammarMap[e][i]!==t||delete this._grammarMap[e][i]):(this._grammars.customized=this._grammars.customized.filter((function(e){return e!==t})),vt(i)||this._grammarMap.customized[i]!==t||delete this._grammarMap.customized[i]),this._size-=1,this}},{key:"size",value:function(){return this._size}},{key:"getSignal",value:function(t){var e;return null!==(e=this._grammarMap.signal[t])&&void 0!==e?e:null}},{key:"getData",value:function(t){var e;return null!==(e=this._grammarMap.data[t])&&void 0!==e?e:null}},{key:"getScale",value:function(t){var e;return null!==(e=this._grammarMap.scale[t])&&void 0!==e?e:null}},{key:"getCoordinate",value:function(t){var e;return null!==(e=this._grammarMap.coordinate[t])&&void 0!==e?e:null}},{key:"getMark",value:function(t){var e;return null!==(e=this._grammarMap.mark[t])&&void 0!==e?e:null}},{key:"getCustomized",value:function(t){var e;return null!==(e=this._grammarMap.customized[t])&&void 0!==e?e:null}},{key:"getGrammar",value:function(t){return this._grammarMap.data[t]?this._grammarMap.data[t]:this._grammarMap.signal[t]?this._grammarMap.signal[t]:this._grammarMap.scale[t]?this._grammarMap.scale[t]:this._grammarMap.coordinate[t]?this._grammarMap.coordinate[t]:this._grammarMap.mark[t]?this._grammarMap.mark[t]:this._grammarMap.customized[t]?this._grammarMap.customized[t]:null}},{key:"getAllSignals",value:function(){return this._grammars.signal}},{key:"getAllData",value:function(){return this._grammars.data}},{key:"getAllScales",value:function(){return this._grammars.scale}},{key:"getAllCoordinates",value:function(){return this._grammars.coordinate}},{key:"getAllMarks",value:function(){return this._grammars.mark}},{key:"getAllCustomized",value:function(){return this._grammars.customized}},{key:"traverse",value:function(t){var e;Object.values(null!==(e=this._grammars)&&void 0!==e?e:{}).forEach((function(e){return(null!=e?e:[]).forEach((function(e){t.call(null,e)}))}))}},{key:"find",value:function(t){var e=null;return this.traverse((function(i){return!0===t.call(null,i)&&(e=i,!0)})),e}},{key:"filter",value:function(t){var e=[];return this.traverse((function(i){!0===t.call(null,i)&&e.push(i)})),e}},{key:"clear",value:function(){this._size=0,this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}}}},{key:"release",value:function(){this._size=0,this._grammars=null,this._grammarMap=null}}])}(),OA=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments))._markNodes=[],t}return h(i,t),u(i,[{key:"record",value:function(t){if(p(c(i.prototype),"record",this).call(this,t),"mark"===t.grammarType){var e=t,n={mark:e,parent:null,children:[]};this._markNodes.forEach((function(t){var i=t.mark;i.markType===YS.group&&i.includesChild(e,!1)?(t.children.push(n),n.parent=t):e.markType===YS.group&&e.includesChild(i,!1)&&(n.children.push(t),t.parent=n)})),this._markNodes.push(n)}return this}},{key:"unrecord",value:function(t){if(p(c(i.prototype),"unrecord",this).call(this,t),"mark"===t.grammarType){var e=t,n=this._markNodes.find((function(t){return t.mark===e}));this._markNodes.forEach((function(t){t.mark.markType===YS.group&&t.children.includes(n)?(t.children=t.children.filter((function(t){return t!==n})),n.parent=null):e.markType===YS.group&&n.children.includes(t)&&(n.children=n.children.filter((function(e){return e!==t})),t.parent=null)})),this._markNodes=this._markNodes.filter((function(t){return t!==n}))}return this}},{key:"getAllMarkNodes",value:function(){return this._markNodes}},{key:"clear",value:function(){p(c(i.prototype),"clear",this).call(this),this._markNodes=[]}},{key:"release",value:function(){p(c(i.prototype),"release",this).call(this),this._markNodes=null}}])}(PA),IA=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"addGraphicItem",value:function(t,e){var n=t&&t.limitAttrs,r=Pw(this,n&&("rich"===n.textType||n.text&&"rich"===n.text.type)?YS.richtext:YS.text,t);return p(c(i.prototype),"addGraphicItem",this).call(this,t,e,r)}},{key:"release",value:function(){p(c(i.prototype),"release",this).call(this)}}])}(RA);IA.markType=YS.text;var LA={axis:{label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#89909d",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],start:{x:0,y:0},end:{x:100,y:0},x:0,y:0},circleAxis:{title:{space:4,padding:[0,0,0,0],textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1},text:"theta"},label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#6F6F6F",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],startAngle:0,endAngle:2*Math.PI,radius:100,innerRadius:0,center:{x:0,y:0},x:0,y:0},grid:{style:{stroke:"#f1f2f5"}},circleGrid:{style:{stroke:"#f1f2f5"}},discreteLegend:{layout:"vertical",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:10,spaceRow:10,shape:{space:4,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",stroke:"#D8D8D8",fillOpacity:.5}}},label:{space:4,style:{fontSize:12,fill:"black",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",fillOpacity:.5}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"},state:{selectedHover:{fillOpacity:.7,fill:"gray"},unSelectedHover:{fillOpacity:.2,fill:"gray"}}},focus:!1,focusIconStyle:{size:10,fill:"#333",cursor:"pointer"},visible:!0,padding:{top:2,bottom:2,left:2,right:2}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!1,items:[{index:0,id:"",label:"",shape:{fill:"#6690F2",stroke:"#6690F2",symbolType:"circle"}}]},colorLegend:{title:{visible:!1,text:""},colors:[],layout:"horizontal",railWidth:200,railHeight:8,railStyle:{cornerRadius:5}},sizeLegend:{title:{visible:!1,text:""},trackStyle:{fill:"#ccc"},layout:"horizontal",align:"bottom",railWidth:200,railHeight:6,min:0,max:1,value:[0,1]},lineCrosshair:{start:{x:0,y:0},end:{x:0,y:0}},rectCrosshair:{start:{x:0,y:0},end:{x:0,y:0},rectStyle:{width:10,height:10}},sectorCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:Math.PI/6},circleCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI},polygonCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI,sides:6},slider:{layout:"horizontal",railWidth:200,railHeight:10,railStyle:{cornerRadius:5},range:{draggableTrack:!0},startText:{visible:!0,text:"",space:8},endText:{visible:!0,text:"",space:8},min:0,max:1,value:[0,1]},dataLabel:{size:{width:400,height:400},dataLabels:[]},pointLabel:{data:[{text:"",fill:"#606773",data:{}}],overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},lineLabel:{type:"line",data:[{text:"",data:{}}],position:"start",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},areaLabel:{type:"area",data:[{text:"",data:{}}],position:"end",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},rectLabel:{type:"rect",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},symbolLabel:{type:"symbol",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{avoidBaseMark:!0,size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},arcLabel:{type:"arc",data:[{text:"",fill:"#606773",data:{}}],width:800,height:600,position:"outside",zIndex:302},lineDataLabel:{type:"line-data",data:[{text:""}],position:"top",overlap:{avoidBaseMark:!1,clampForce:!1},smartInvert:!1},datazoom:{orient:"bottom",showDetail:"auto",brushSelect:!0,start:0,end:1,position:{x:0,y:0},size:{width:500,height:40},previewData:[]},continuousPlayer:{},discretePlayer:{},tooltip:{},title:{textStyle:{fill:"#21252c"},subtextStyle:{fill:"#606773"}},scrollbar:{width:12,height:12,padding:[2,2],railStyle:{fill:"rgba(0, 0, 0, .1)"}}},DA={symbol:{shape:"circle",size:8},text:{fontSize:14,fill:"#000000"}},FA=Object.assign({},LA);FA.axis=Object.assign({},FA.axis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),FA.circleAxis=Object.assign({},FA.circleAxis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),FA.grid=Object.assign({},FA.grid,{style:{stroke:"#404349"}}),FA.circleGrid=Object.assign({},FA.circleGrid,{style:{stroke:"#404349"}}),FA.rectLabel=Object.assign({},FA.rectLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),FA.lineLabel=Object.assign({},FA.lineLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),FA.symbolLabel=Object.assign({},FA.symbolLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),FA.title=Object.assign({},FA.title,{textStyle:{fill:"#fdfdfd"},subtextStyle:{fill:"#888c93"}});var jA={name:"dark",padding:5,background:"#202226",palette:{default:["#5383F4","#7BCF8E","#FF9D2C","#FFDB26","#7568D9","#80D8FB","#1857A3","#CAB0E8","#FF8867","#B9E493","#2CB4A8","#B9E4E3"]},marks:DA,components:FA},NA={name:"default",padding:5,palette:{default:["#6690F2","#70D6A3","#B4E6E2","#63B5FC","#FF8F62","#FFDC83","#BCC5FD","#A29BFE","#63C4C7","#F68484"]},marks:DA,components:LA},zA=function(){function t(){o(this,t)}return u(t,null,[{key:"registerTheme",value:function(e,i){e&&t._themes.set(e,i)}},{key:"unregisterTheme",value:function(e){t._themes.delete(e)}},{key:"getTheme",value:function(e){return t._themes.get(e)}},{key:"getDefaultTheme",value:function(){return t.getTheme("default")}}])}();zA._themes=new Map,zA.registerTheme("default",NA),zA.registerTheme("dark",jA);var UA,GA,WA,VA=function(t){function i(t,n,r,a){var s;return o(this,i),(s=e(this,i,[t,YS.component,r]))._componentDatum=l({},fw,0),s.componentType=n,s.spec.type="component",s.spec.componentType=n,s.mode=a,s._updateComponentEncoders(),s}return h(i,t),u(i,[{key:"configureComponent",value:function(t){return this.spec.componentConfig=t,this.commit(),this}},{key:"addGraphicItem",value:function(t,e,i){var n=null!=i?i:Mw.createGraphicComponent(this.componentType,t,{mode:this.mode,skipDefault:this.spec.skipTheme});return n&&(this.emit(rw.BEFORE_ADD_VRENDER_MARK,{graphicItem:n}),this.graphicParent.appendChild(n),this.emit(rw.AFTER_ADD_VRENDER_MARK,{graphicItem:n})),n}},{key:"join",value:function(t){return p(c(i.prototype),"join",this).call(this,t,fw)}},{key:"encodeState",value:function(t,e,n){return p(c(i.prototype),"encodeState",this).call(this,t,e,n),this._updateComponentEncoders(),this}},{key:"parseRenderContext",value:function(){return{large:!1}}},{key:"_prepareRejoin",value:function(){this._componentDatum[fw]+=1}},{key:"evaluateJoin",value:function(t){return this.spec.key=fw,t?(t[fw]=this._componentDatum[fw],this._componentDatum=t):this._componentDatum=l({},fw,this._componentDatum[fw]),p(c(i.prototype),"evaluateJoin",this).call(this,[this._componentDatum])}},{key:"_updateComponentEncoders",value:function(){this._encoders=this.spec.encode}},{key:"_getEncoders",value:function(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}}])}(RA),HA=Symbol.for("key"),KA=function(){return u((function t(){o(this,t)}),[{key:"diffGrammar",value:function(t,e){return function(t,e,i){var n={enter:[],exit:[],update:[]},r=new BA(t,i);return r.setCallback((function(t,e,i){vt(e)?n.exit.push({prev:i[0]}):vt(i)?n.enter.push({next:e[0]}):n.update.push({next:e[0],prev:i[0]})})),r.setCurrentData(EA(e,i)),r.doDiff(),n}(t,e,(function(t){var e;return null!==(e=t.id())&&void 0!==e?e:Symbol()}))}},{key:"diffMark",value:function(t,e,i){var n={enter:[],exit:[],update:[]},r=[],a=[];t.forEach((function(t){t.markType!==YS.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?r.push(t):n.exit.push({prev:[t]})})),e.forEach((function(t){t.markType!==YS.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?a.push(t):n.enter.push({next:[t]})}));var o=this.diffUpdateByGroup(r,a,(function(t){return t.getMorphConfig().morphKey}),(function(t){return t.getMorphConfig().morphKey}));r=o.prev,a=o.next,n.update=n.update.concat(o.update);var s=this.diffUpdateByGroup(r,a,(function(t){return t.id()}),(function(t){return t.id()}));r=s.prev,a=s.next,n.update=n.update.concat(s.update);var u=EA(r,(function(t){var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)})),l=EA(a,(function(t){var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)}));return Object.keys(l).forEach((function(t){var e=u.data.get(t),i=l.data.get(t);if(e&&i){for(var o=0;o<Math.max(e.length,i.length);o+=1){var s=e[o],h=i[o];s&&h?n.update.push({prev:[s],next:[h]}):s?n.exit.push({prev:[s]}):h&&n.enter.push({next:[h]})}r=r.filter((function(t){return!e.includes(t)})),a=a.filter((function(t){return!i.includes(t)}))}})),r.forEach((function(t){return n.exit.push({prev:[t]})})),a.forEach((function(t){return n.enter.push({next:[t]})})),n}},{key:"diffUpdateByGroup",value:function(t,e,i,n){var r=EA(t,(function(t){var e;return null!==(e=i(t))&&void 0!==e?e:HA})),a=EA(e,(function(t){var e;return null!==(e=n(t))&&void 0!==e?e:HA})),o=t,s=e,u=[];return a.keys.forEach((function(t){if(t!==HA){var e=r.data.get(t),i=a.data.get(t);e&&i&&(u.push({prev:e,next:i}),o=o.filter((function(t){return!e.includes(t)})),s=s.filter((function(t){return!i.includes(t)})))}})),{prev:o,next:s,update:u}}}])}(),XA=function(t){function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,i),(t=e(this,i))._observer=null,t._onResize=ce((function(){var e=t._getContainerSize();e&&t.resize(e.width,e.height)}),100),t.delegateEvent=function(e,i){var n,r=null===(n=e.target)||void 0===n?void 0:n[hw],a=xA(f(t),e,r,0,vA);t.emit(i,a,r)},t.handleProgressiveFrame=function(){t._progressiveMarks.length&&t._progressiveMarks.forEach((function(t){t.isDoingProgressive()&&t.evaluateProgressive()})),t.doPreProgressive()},t._config=r,t._options=Object.assign({mode:"browser"},n),t.initialize(),t}return h(i,t),u(i,[{key:"getGrammarById",value:function(t){return this.grammars.getGrammar(t)}},{key:"getSignalById",value:function(t){return this.grammars.getSignal(t)}},{key:"getDataById",value:function(t){return this.grammars.getData(t)}},{key:"getScaleById",value:function(t){return this.grammars.getScale(t)}},{key:"getCoordinateById",value:function(t){return this.grammars.getCoordinate(t)}},{key:"getMarkById",value:function(t){return this.grammars.getMark(t)}},{key:"getCustomizedById",value:function(t){return this.grammars.getCustomized(t)}},{key:"getGrammarsByName",value:function(t){return this.grammars.filter((function(e){return e.name()===t}))}},{key:"getGrammarsByType",value:function(t){return this.grammars.filter((function(e){return e.grammarType===t}))}},{key:"getMarksByType",value:function(t){return this.grammars.getAllMarks().filter((function(e){return e.markType===t}))}},{key:"getMarksByName",value:function(t){return this.grammars.getAllMarks().filter((function(e){return e.name()===t}))}},{key:"getMarksBySelector",value:function(t){var e=this;if(!t)return null;var i=Kt(t),n=[];return i.forEach((function(t){if(xw(t))n.push(t);else if("#"!==t[0]){var i="@"===t[0]?e.getMarksByName(t.slice(1)):YS[t]?e.getMarksByType(t):null;i&&i.length&&i.forEach((function(t){n.push(t)}))}else{var r=e.getMarkById(t.slice(1));r&&n.push(r)}})),n}},{key:"updateSignal",value:function(t,e){_t(t)&&(t=this.getSignalById(t)),t.set(e),this.commit(t)}},{key:"signal",value:function(t,e){var i=new SA(this);return arguments.length>=1&&i.value(t),arguments.length>=2&&i.update(e),this.grammars.record(i),this._dataflow.add(i),i}},{key:"data",value:function(t){var e=new nA(this,t);return this.grammars.record(e),this._dataflow.add(e),e}},{key:"scale",value:function(t){var e=Mw.createGrammar("scale",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}},{key:"coordinate",value:function(t){var e=Mw.createGrammar("coordinate",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}},{key:"mark",value:function(t,e,i){var n,r=_t(e)?this.getMarkById(e):e;switch(t){case YS.group:n=new MA(this,r);break;case YS.glyph:var a=Mw.getMark(YS.glyph);a&&(n=new a(this,null==i?void 0:i.glyphType,r));break;case YS.component:n=Mw.hasComponent(null==i?void 0:i.componentType)?Mw.createComponent(null==i?void 0:i.componentType,this,r,null==i?void 0:i.mode):new VA(this,null==i?void 0:i.componentType,r,null==i?void 0:i.mode);break;case YS.text:n=new IA(this,t,r);break;default:n=Mw.hasMark(t)?Mw.createMark(t,this,r):new RA(this,t,r)}return this.grammars.record(n),this._dataflow.add(n),n}},{key:"group",value:function(t){return this.mark(YS.group,t)}},{key:"glyph",value:function(t,e){return this.mark(YS.glyph,e,{glyphType:t})}},{key:"component",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"2d";return this.mark(YS.component,e,{componentType:t,mode:i})}},{key:"axis",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2d";return this.mark(YS.component,t,{componentType:qS.axis,mode:e})}},{key:"grid",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2d";return this.mark(YS.component,t,{componentType:qS.grid,mode:e})}},{key:"legend",value:function(t){return this.mark(YS.component,t,{componentType:qS.legend})}},{key:"slider",value:function(t){return this.mark(YS.component,t,{componentType:qS.slider})}},{key:"label",value:function(t){return this.mark(YS.component,t,{componentType:qS.label})}},{key:"datazoom",value:function(t){return this.mark(YS.component,t,{componentType:qS.datazoom})}},{key:"player",value:function(t){return this.mark(YS.component,t,{componentType:qS.player})}},{key:"title",value:function(t){return this.mark(YS.component,t,{componentType:qS.title})}},{key:"scrollbar",value:function(t){return this.mark(YS.component,t,{componentType:qS.scrollbar})}},{key:"customized",value:function(t,e){var i=Mw.createGrammar(t,this,null==e?void 0:e.type);if(i)return i.parse(e),this.grammars.record(i),this._dataflow.add(i),i}},{key:"addGrammar",value:function(t){return this.grammars.find((function(e){return e.uid===t.uid}))||(this.grammars.record(t),this._dataflow.add(t),t.parse(t.getSpec()),this._needBuildLayoutTree=!0),this}},{key:"removeGrammar",value:function(t){var e=_t(t)?this.getGrammarById(t):t;return e&&this.grammars.find((function(t){return t.uid===e.uid}))?("mark"===e.grammarType&&e.prepareRelease(),this._cachedGrammars.record(e),this._dataflow.remove(e),this.grammars.unrecord(e),this._needBuildLayoutTree=!0,this):this}},{key:"removeAllGrammars",value:function(){var t=this;return this.grammars.traverse((function(e){"signal"===e.grammarType&&AA.includes(e.id())||"mark"===e.grammarType&&"root"===e.id()||t.removeGrammar(e)})),this}},{key:"removeAllGraphicItems",value:function(){return this.traverseMarkTree((function(t){t.graphicItem&&(Ow(t.graphicItem),t.elementMap.forEach((function(t){t.resetGraphicItem()})),t.graphicItem=null)})),this}},{key:"parseSpec",value:function(t){var e,i,n,r,a,o,s,u,l=this;if(this.emit(rw.BEFORE_PARSE_VIEW),this._spec=t,CA(t),t.theme?this.theme(t.theme):this.theme(zA.getDefaultTheme()),t.width&&this.width(t.width),t.height&&this.height(t.height),this.padding(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this._options.padding)&&void 0!==i?i:this._theme.padding),!this.width()||!this.height()){var h=this._getContainerSize();h&&(this.updateSignal(pA,h.width),this.updateSignal(gA,h.height))}(null===(n=t.signals)||void 0===n?void 0:n.length)&&t.signals.forEach((function(t){l.signal().parse(t)})),(null===(r=t.data)||void 0===r?void 0:r.length)&&t.data.forEach((function(t){l.data(null).parse(t)})),(null===(a=t.coordinates)||void 0===a?void 0:a.length)&&t.coordinates.forEach((function(t){var e;null===(e=l.coordinate(t.type))||void 0===e||e.parse(t)})),(null===(o=t.scales)||void 0===o?void 0:o.length)&&t.scales.forEach((function(t){var e;null===(e=l.scale(t.type))||void 0===e||e.parse(t)}));var c=Mw.getGrammars();return Object.keys(c).forEach((function(e){var i=c[e].specKey;t[i]&&t[i].length&&t[i].forEach((function(t){l.customized(e,t)}))})),t.marks&&t.marks.length&&t.marks.forEach((function(t){l.parseMarkSpec(t)})),t.events&&t.events.length&&t.events.forEach((function(t){var e;null===(e=l.event)||void 0===e||e.call(l,t)})),t.interactions&&t.interactions.length&&t.interactions.forEach((function(t){l.interaction(t.type,t)})),!1===t.animation?null===(s=this.animate)||void 0===s||s.disable():null===(u=this.animate)||void 0===u||u.enable(),this.emit(rw.AFTER_PARSE_VIEW),this._needBuildLayoutTree=!0,this._layoutState=nw.before,this}},{key:"updateSpec",value:function(t){return this.removeAllInteractions(),this.removeAllGrammars(),this.parseSpec(t)}},{key:"parseBuiltIn",value:function(){var t=this;(function(t,e,i){var n,r,a,o,s;return[{id:pA,value:null!==(n=t[pA])&&void 0!==n?n:0},{id:gA,value:null!==(r=t[gA])&&void 0!==r?r:0},{id:kA,value:TA(null!==(o=null!==(a=t[kA])&&void 0!==a?a:e[kA])&&void 0!==o?o:null==i?void 0:i.padding)},{id:yA,update:{callback:function(t,e){var i=TA(e[kA]);return e[pA]-i.left-i.right},dependency:[pA,kA]}},{id:mA,update:{callback:function(t,e){var i=TA(e[kA]);return e[gA]-i.top-i.bottom},dependency:[gA,kA]}},{id:_A,update:{callback:function(t,e){var i=TA(e[kA]);return(t||new Pe).setValue(i.left,i.top,i.left+e[yA],i.top+e[mA])},dependency:[yA,mA,kA]}},{id:bA,value:null!==(s=t[bA])&&void 0!==s?s:e[bA]}]})(this._options,this._config,this.getCurrentTheme()).forEach((function(e){var i=t.signal().parse(e);e.value&&i.set(e.value)})),this.parseMarkSpec({id:"root",type:"group",encode:{enter:{x:0,y:0},update:{width:{signal:"width"},height:{signal:"height"}}}}),this.rootMark=this.getMarkById("root")}},{key:"parseMarkSpec",value:function(t){var e,i=this,n=t.type===YS.glyph?{glyphType:t.glyphType}:t.type===YS.component?{componentType:t.componentType,mode:t.mode}:null;this.mark(t.type,t.group,n).parse(t),null===(e=t.marks)||void 0===e||e.forEach((function(t){i.parseMarkSpec(t)}))}},{key:"theme",value:function(t){var e,i,n,r,a,o;_t(t)?this._theme=null!==(e=zA.getTheme(t))&&void 0!==e?e:zA.getDefaultTheme():this._theme=t;var s=null!==(i=this._spec)&&void 0!==i?i:{},u=s.background,l=s.padding;return this._theme?(this.background(null!==(n=null!=u?u:this._options.background)&&void 0!==n?n:this._theme.background),this.padding(null!==(r=null!=l?l:this._options.padding)&&void 0!==r?r:this._theme.padding),null===(o=null===(a=this.renderer.stage())||void 0===a?void 0:a.setTheme)||void 0===o||o.call(a,Object.assign({},this._theme.marks))):(this.background(null!=u?u:this._options.background),this.padding(null!=l?l:this._options.padding)),this}},{key:"getCurrentTheme",value:function(){return this._theme}},{key:"setCurrentTheme",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.theme(t),this.grammars.getAllMarks().forEach((function(t){t.commit()})),e?(this.evaluate(),this.renderer.render(!0)):this._dataflow.evaluate(),this}},{key:"background",value:function(t){return arguments.length?(this._background=t,this.renderer.background(t),t):this._background}},{key:"width",value:function(t){var e=this.getSignalById(pA);return arguments.length?(this._options.width=t,this.updateSignal(e,t),t):e.output()}},{key:"height",value:function(t){var e=this.getSignalById(gA);return arguments.length?(this._options.height=t,this.updateSignal(e,t),t):e.output()}},{key:"viewWidth",value:function(t){var e=this.getSignalById(yA);if(arguments.length){var i=this.padding();return this.width(t+i.left+i.right),t}return e.output()}},{key:"viewHeight",value:function(t){var e=this.getSignalById(mA);if(arguments.length){var i=this.padding();return this.height(t+i.top+i.bottom),t}return e.output()}},{key:"padding",value:function(t){var e=this.getSignalById(kA);if(arguments.length){var i=TA(t);return this.updateSignal(e,i),i}return TA(e.output())}},{key:"autoFit",value:function(t){var e=this.getSignalById(bA);return arguments.length?(this.updateSignal(e,t),t):e.output()}},{key:"getViewBox",value:function(){var t=this.getSignalById(_A);return null==t?void 0:t.output()}},{key:"updateLayoutTag",value:function(){return this._layoutState=nw.before,this}},{key:"getLayoutState",value:function(){return this._layoutState}},{key:"buildLayoutTree",value:function(){var t={},e=[];this.traverseMarkTree((function(i){t[i.id()]=!0,i.group&&t[i.group.id()]||e.push(i),i.markType===YS.group&&i.updateLayoutChildren()}),(function(t){return t.needLayout()})),this._layoutMarks=e}},{key:"doLayout",value:function(){var t,e=this._options.doLayout||Mw.getDefaultLayout();e&&(null===(t=this._layoutMarks)||void 0===t?void 0:t.length)&&(this.emit(rw.BEFORE_DO_LAYOUT),e(this._layoutMarks,this._options,this),this.emit(rw.AFTER_DO_LAYOUT))}},{key:"handleLayoutEnd",value:function(){this.emit(rw.BEFORE_MARK_LAYOUT_END),this._layoutMarks.forEach((function(t){lA(t,"layoutChildren",(function(t){t.handleLayoutEnd()}),(function(e){return e!==t}))})),this.emit(rw.AFTER_MARK_LAYOUT_END)}},{key:"handleRenderEnd",value:function(){this.emit(rw.BEFORE_MARK_RENDER_END),lA(this.rootMark,"children",(function(t){t.handleRenderEnd()})),this.emit(rw.AFTER_MARK_RENDER_END)}},{key:"commit",value:function(t){return this._dataflow.commit(t),this}},{key:"run",value:function(t){return this.evaluate(t),this}},{key:"doRender",value:function(t){this.emit(rw.BEFORE_DO_RENDER),this.renderer&&(!this._progressiveMarks&&this.animate?this.animate.animate():this.traverseMarkTree((function(t){t.cleanExitElements()}),null,!0),this.renderer.render(t),this.handleRenderEnd()),this.emit(rw.AFTER_DO_RENDER)}},{key:"evaluate",value:function(t){var e,i,n=function(t){var e,i,n,r,a,o=null!=t?t:{},s=o.reuse,u=void 0===s||s,l=o.morph,h=void 0===l||l,c=o.morphAll,d=void 0!==c&&c,f=o.animation,v=void 0===f?{}:f,p=o.enableExitAnimation,g=void 0===p||p;return{reuse:u,morph:h,morphAll:d,animation:{easing:null!==(e=v.easing)&&void 0!==e?e:"quintInOut",delay:null!==(i=v.delay)&&void 0!==i?i:0,duration:null!==(n=v.duration)&&void 0!==n?n:1e3,oneByOne:null!==(r=v.oneByOne)&&void 0!==r&&r,splitPath:null!==(a=v.splitPath)&&void 0!==a?a:null},enableExitAnimation:g}}(t),r=this._cachedGrammars.size()>0;r&&(this.reuseCachedGrammars(n),this.detachCachedGrammar());var a=this._resizeRenderer(),o=this._dataflow.hasCommitted();return r||o||this._layoutState||a?(this.clearProgressive(),this._dataflow.evaluate(),this._needBuildLayoutTree&&(this.buildLayoutTree(),this._needBuildLayoutTree=!1),this._layoutState&&(this._layoutState=nw.layouting,this.doLayout(),this._dataflow.hasCommitted()&&(this._layoutState=nw.reevaluate,this._dataflow.evaluate()),this._layoutState=nw.after,(null===(e=this._layoutMarks)||void 0===e?void 0:e.length)&&this.handleLayoutEnd()),this._layoutState=null,this.findProgressiveMarks(),this._resizeRenderer(),null===(i=this.morph)||void 0===i||i.call(this,n),this.releaseCachedGrammars(n),this.doRender(!0),this.doPreProgressive(),this):this}},{key:"reuseCachedGrammars",value:function(t){var e=this;if(t.reuse){var i=function(t){t.next.reuse(t.prev),t.prev.detachAll(),t.prev.clear(),e._cachedGrammars.unrecord(t.prev)};this._differ.diffGrammar(this._cachedGrammars.getAllSignals(),this.grammars.getAllSignals().filter((function(t){return!AA.includes(t.id())}))).update.forEach(i),this._differ.diffGrammar(this._cachedGrammars.getAllData(),this.grammars.getAllData()).update.forEach(i),this._differ.diffGrammar(this._cachedGrammars.getAllScales(),this.grammars.getAllScales()).update.forEach(i),this._differ.diffGrammar(this._cachedGrammars.getAllCoordinates(),this.grammars.getAllCoordinates()).update.forEach(i)}this._differ.diffMark(this._cachedGrammars.getAllMarks(),this.grammars.getAllMarks().filter((function(t){return"root"!==t.id()})),t).update.forEach((function(i){var n,r=1===i.prev.length&&1===i.next.length&&i.prev[0].markType===i.next[0].markType,a=i.prev.every((function(t){return t.getMorphConfig().morph}))&&i.next.every((function(t){return t.getMorphConfig().morph}));r&&t.reuse?(i.next[0].reuse(i.prev[0]),i.prev[0].detachAll(),i.prev[0].clear(),e._cachedGrammars.unrecord(i.prev[0])):(t.morph&&a||t.morphAll)&&(null===(n=e.addMorphMarks)||void 0===n||n.call(e,{prev:i.prev,next:i.next}))}))}},{key:"detachCachedGrammar",value:function(){this._cachedGrammars.traverse((function(t){var e,i;if(t.detachAll(),"mark"===t.grammarType){var n=t;null===(i=null===(e=n.group)||void 0===e?void 0:e.removeChild)||void 0===i||i.call(e,n)}}))}},{key:"releaseCachedGrammars",value:function(t){var e=this;this._cachedGrammars.traverse((function(t){"mark"!==t.grammarType&&t.release()}));var i=this._cachedGrammars.getAllMarkNodes();i.forEach((function(i){var n;null===(n=i.mark.animate)||void 0===n||n.stop(),t.enableExitAnimation&&e.animate&&e.animate.animateAddition(i.mark)}));var n=function t(e){if(e.mark.view&&(!e.mark.animate||0===e.mark.animate.getAnimatorCount())&&(!e.children||0===e.children.length)){e.mark.release();var i=e.parent;i&&(e.parent.children=e.parent.children.filter((function(t){return t!==e})),e.parent=null,t(i))}};i.forEach((function(t){var e=t.mark;e.animate&&0===e.animate.getAnimatorCount()?n(t):e.addEventListener("animationEnd",(function(){e.animate&&0===e.animate.getAnimatorCount()&&n(t)}))})),this._cachedGrammars.clear()}},{key:"runAfter",value:function(t){var e=this;return this._dataflow.runAfter((function(){t.call(null,e)})),this}},{key:"runBefore",value:function(t){var e=this;return this._dataflow.runBefore((function(){t.call(null,e)})),this}},{key:"getImageBuffer",value:function(){var t,e;if("node"===this._options.mode){var i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t);return i?(i.render(),i.window.getImageBuffer()):(this.logger.error(new ReferenceError("render is not defined")),null)}this.logger.error(new TypeError("getImageBuffer() now only support node environment."))}},{key:"traverseMarkTree",value:function(t,e,i){return lA(this.rootMark,"children",t,e,i),this}},{key:"_bindResizeEvent",value:function(){var t,e,i,n,r,a;if(this.autoFit()){var o=null===(r=null===(n=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===n?void 0:n.getContainer)||void 0===r?void 0:r.call(n);if(o){var s=window.ResizeObserver;this._observer=new s(this._onResize),null===(a=this._observer)||void 0===a||a.observe(o)}window.addEventListener("resize",this._onResize)}}},{key:"_unBindResizeEvent",value:function(){this.autoFit()&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}},{key:"_getContainerSize",value:function(){var t,e,i,n,r,a,o,s,u,l,h,c=null===(r=null===(n=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===n?void 0:n.getContainer)||void 0===r?void 0:r.call(n);if(c){var d=ii(c),f=d.width,v=d.height;return{width:null!==(s=null!==(o=null===(a=this._spec)||void 0===a?void 0:a.width)&&void 0!==o?o:this._options.width)&&void 0!==s?s:f,height:null!==(h=null!==(l=null===(u=this._spec)||void 0===u?void 0:u.height)&&void 0!==l?l:this._options.height)&&void 0!==h?h:v}}return null}},{key:"resize",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=!1;return t!==this.width()&&(n=!0,this.updateSignal(pA,t)),e!==this.height()&&(n=!0,this.updateSignal(gA,e)),n&&(i?this.evaluate():this._dataflow.evaluate()),this}},{key:"_resizeRenderer",value:function(){var t=this.width(),e=this.height();return!!this.renderer.shouldResize(t,e)&&(this.renderer.resize(t,e),this.emit("resize",{},{width:t,height:e}),!0)}},{key:"interaction",value:function(t,e){var i=Mw.createInteraction(t,this,e);return i&&(i.bind(),this._boundInteractions||(this._boundInteractions=[]),this._boundInteractions.push(i)),i}},{key:"removeInteraction",value:function(t,e){if(this._boundInteractions){var i=this._boundInteractions.filter((function(i){var n;return vt(e)?_t(t)?i.type===t:t?i===t:void 0:(null===(n=i.options)||void 0===n?void 0:n.id)===e}));i.length&&i.forEach((function(t){t.unbind()}))}return this}},{key:"removeAllInteractions",value:function(){return this._boundInteractions&&(this._boundInteractions.forEach((function(t){t.unbind()})),this._boundInteractions=null),this}},{key:"initializeEventConfig",value:function(t){var e=Object.assign({defaults:{}},t),i=function(t,e){e.forEach((function(e){bt(t[e])&&(t[e]=t[e].reduce((function(t,e){return t[e]=!0,t}),{}))}))};return i(e.defaults,["prevent","allow"]),i(e,[vA,fA]),e}},{key:"initEvent",value:function(){var t=this.renderer.stage();t&&t.on("*",this.delegateEvent)}},{key:"releaseStageEvent",value:function(){var t=this.renderer.stage();t&&t.off("*",this.delegateEvent)}},{key:"addEventListener",value:function(t,e,i){var n=e;return i&&!1===i.trap||((n=e).raw=e),i&&i.target&&(n.target=i.target),this.on(t,n),this}},{key:"removeEventListener",value:function(t,e){return e?this.off(t,e):this.off(t),this}},{key:"initializeRenderer",value:function(){var t=this._options.width,e=this._options.height;this.renderer=new hA(this),this.renderer.initialize(t,e,this._options,this._eventConfig).background(this._background)}},{key:"initialize",value:function(){var t,e,i,n=this;this.grammars=new PA((function(t){return t.id()}),(function(t,e){return n.logger.warn("Grammar id '".concat(t,"' has been occupied"),e)})),this._cachedGrammars=new OA((function(t){return t.id()})),this._options.logger&&te.setInstance(this._options.logger),this.logger=te.getInstance(null!==(t=this._options.logLevel)&&void 0!==t?t:0),this._dataflow=new uA,this.animate=null===(e=this.initAnimate)||void 0===e?void 0:e.call(this,this),this._differ=new KA,this._options.hooks&&(Object.keys(this._options.hooks).forEach((function(t){n.on(t,n._options.hooks[t])})),this.hooks=this._options.hooks),this.container=null,this.renderer=null,this._eventListeners=[],this._eventConfig=this.initializeEventConfig(this._options.eventConfig),this._theme=this._options.disableTheme?null:zA.getDefaultTheme(),this.parseBuiltIn(),(i=this._options).mode&&bf.setEnv(i.mode,i.modeParams||{}),this.initializeRenderer(),this._eventConfig.disable||this.initEvent(),this._bindResizeEvent(),this._needBuildLayoutTree=!0,this._layoutState=nw.before,this.theme(this._theme)}},{key:"pauseProgressive",value:function(){return!1}},{key:"resumeProgressive",value:function(){return!1}},{key:"restartProgressive",value:function(){return!1}},{key:"findProgressiveMarks",value:function(){var t=[];return this.traverseMarkTree((function(e){t.push(e)}),(function(t){return t.markType!==YS.group&&t.isProgressive()})),t.length?(this._progressiveMarks=t,this.renderer&&this.renderer.combineIncrementalLayers(),t):(this._progressiveMarks=null,null)}},{key:"doPreProgressive",value:function(){if(this._progressiveMarks&&this._progressiveMarks.some((function(t){return t.isDoingProgressive()}))){var t=bf.getRequestAnimationFrame();this._progressiveRafId=t(this.handleProgressiveFrame)}}},{key:"clearProgressive",value:function(){this._progressiveRafId&&bf.getCancelAnimationFrame()(this._progressiveRafId),this._progressiveMarks&&this._progressiveMarks.length&&(this._progressiveMarks.forEach((function(t){t.clearProgressive()})),this._progressiveMarks=null)}},{key:"release",value:function(){var t,e,i,n;this.removeAllInteractions(),this.releaseStageEvent(),this._unBindResizeEvent(),this.clearProgressive(),Mw.unregisterRuntimeTransforms(),te.setInstance(null),null===(t=this.animate)||void 0===t||t.stop(),this.grammars.release(),this._cachedGrammars.release(),this._dataflow.release(),this._dataflow=null,null===(i=null===(e=this.renderer)||void 0===e?void 0:e.release)||void 0===i||i.call(e),this.renderer=null,this._boundInteractions=null,this.removeAllListeners(),null===(n=this._eventListeners)||void 0===n||n.forEach((function(t){t.source.removeEventListener(t.type,t.handler)})),this._eventListeners=null}}],[{key:"useRegisters",value:function(t){t.forEach((function(t){t()}))}}])}(ht),YA=["pointerdown","pointerup","pointerupoutside","pointertap","pointerover","pointermove","pointerenter","pointerleave","pointerout","mousedown","mouseup","mouseupoutside","rightdown","rightup","rightupoutside","click","dblclick","mousemove","mouseover","mouseout","mouseenter","mouseleave","wheel","touchstart","touchend","touchendoutside","touchmove","touchcancel","tap","dragstart","drag","dragenter","dragleave","dragover","dragend","drop","pan","panstart","panend","press","pressup","pressend","pinch","pinchstart","pinchend","swipe"];!function(t){t.initialized="initialized",t.rendered="rendered",t.renderFinished="renderFinished",t.animationFinished="animationFinished",t.regionSeriesDataFilterOver="regionSeriesDataFilterOver",t.afterInitData="afterInitData",t.afterInitEvent="afterInitEvent",t.afterInitMark="afterInitMark",t.rawDataUpdate="rawDataUpdate",t.viewDataFilterOver="viewDataFilterOver",t.viewDataUpdate="viewDataUpdate",t.viewDataStatisticsUpdate="viewDataStatisticsUpdate",t.markDeltaYUpdate="markDeltaYUpdate",t.viewDataLabelUpdate="viewDataLabelUpdate",t.scaleDomainUpdate="scaleDomainUpdate",t.scaleUpdate="scaleUpdate",t.dataZoomChange="dataZoomChange",t.drill="drill",t.layoutStart="layoutStart",t.layoutEnd="layoutEnd",t.layoutRectUpdate="layoutRectUpdate",t.playerPlay="playerPlay",t.playerPause="playerPause",t.playerEnd="playerEnd",t.playerChange="playerChange",t.playerForward="playerForward",t.playerBackward="playerBackward",t.scrollBarChange="scrollBarChange",t.brushStart="brushStart",t.brushChange="brushChange",t.brushEnd="brushEnd",t.brushClear="brushClear",t.legendSelectedDataChange="legendSelectedDataChange",t.legendFilter="legendFilter",t.legendItemClick="legendItemClick",t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.tooltipShow="tooltipShow",t.tooltipHide="tooltipHide",t.tooltipRelease="tooltipRelease",t.afterResize="afterResize",t.afterRender="afterRender",t.afterLayout="afterLayout"}(UA||(UA={})),function(t){t.chart="chart",t.window="window",t.canvas="canvas"}(GA||(GA={})),function(t){t.vchart="vchart",t.chart="chart",t.model="model",t.mark="mark"}(WA||(WA={}));var qA=function(t,e,i,n){var r,a,o=Qb(e.getScale().type),s=[],u=_(e.getOption().getChart().getSeriesInIndex(e.getSpecInfo().seriesIndexes));try{var l=function(){var u=a.value;if(u.coordinate===i){var l=Kt(n(u)),h=null===(r=u.getViewData())||void 0===r?void 0:r.latestData;if(l&&h)if(o){var c=[],d=[];h.forEach((function(e,i){var n;(null===(n=e[l[0]])||void 0===n?void 0:n.toString())===(null==t?void 0:t.toString())&&(c.push(e),d.push(i))})),s.push({series:u,datum:c,key:ZA(u,d)})}else if(pt(l[1])){var f=[],v=[];h.forEach((function(e,i){var n;((null===(n=e[l[0]])||void 0===n?void 0:n.toString())===(null==t?void 0:t.toString())||pt(e[l[0]])&&pt(e[l[1]])&&t>=e[l[0]]&&t<e[l[1]])&&(f.push(e),v.push(i))})),s.push({series:u,datum:f,key:ZA(u,v)})}else{var p=e.getSpec().tooltipFilterRange,g=At(p)?[-p,p]:p,y=[],m=[];if(g)h.forEach((function(e,i){if(pt(e[l[0]])){var n=e[l[0]]-t;n>=g[0]&&n<=g[1]&&(y.push(e),m.push(i))}}));else{var k=1/0,_=0;h.forEach((function(e,i){if(pt(e[l[0]])){var n=Math.abs(e[l[0]]-t),r=Math.sign(e[l[0]]-t);n<k?(k=n,y=[e],m=[i],_=r):n===k&&r===_&&(y.push(e),m.push(i))}}))}s.push({series:u,datum:y,key:ZA(u,m)})}}};for(u.s();!(a=u.n()).done;)l()}catch(t){u.e(t)}finally{u.f()}return s},ZA=function(t,e){return"".concat(t.id,"_").concat(e.join("_"))},JA=function(t,e,i){var n=t.getAllComponents().filter((function(n){return"axes"===n.specKey&&e(n)&&function(t,e,i){var n=t.getRegionsInIds(Kt(e.layout.layoutBindRegionID));return null==n?void 0:n.some((function(t){var e=t.getLayoutRect(),n=t.getLayoutStartPoint();return function(t,e,i){return t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y}(i,{x:n.x,y:n.y},{x:e.width+n.x,y:e.height+n.y})}))}(t,n,i)}));return n.length?n:null},$A=function(t,e){if(!t)return null;var i=e.x,n=e.y,r=JA(t,(function(t){return"angle"===t.getOrient()}),e),a=JA(t,(function(t){return"radius"===t.getOrient()}),e),o=[],s=function(t){return t.getDimensionField()[0]};return r&&r.forEach((function(t){var e,r=t.getScale();if(r&&Qb(r.type)){var u=r.domain(),l=r.range(),h=t.getCenter(),c={x:i-t.getLayoutStartPoint().x-h.x,y:n-t.getLayoutStartPoint().y-h.y},d=Ox({x:1,y:0},c);d=function(t,e){var i=2*Math.PI,n=function(t,e){var i;if(0!==t.length){for(var n=t[0],r=1;r<t.length;r++){var a=t[r];(null!==(i=null==e?void 0:e(a,n))&&void 0!==i?i:a-n<0)&&(n=a)}return n}}(e),r=function(t,e){var i;if(0!==t.length){for(var n=t[0],r=1;r<t.length;r++){var a=t[r];(null!==(i=null==e?void 0:e(a,n))&&void 0!==i?i:a-n>0)&&(n=a)}return n}}(e);return t<n?t+=Math.ceil((n-t)/i)*i:t>r&&(t-=Math.ceil((t-r)/i)*i),t}(d,l);var f=Ix(c),v=null===(e=a[0])||void 0===e?void 0:e.getScale(),p=null==v?void 0:v.range();if((d-(null==l?void 0:l[0]))*(d-(null==l?void 0:l[1]))>0||(f-(null==p?void 0:p[0]))*(f-(null==p?void 0:p[1]))>0)return;var g=t.invert(d);if(vt(g))return;var y=u.findIndex((function(t){return(null==t?void 0:t.toString())===g.toString()}));y<0&&(y=void 0);var m=qA(g,t,"polar",s);o.push({index:y,value:g,position:r.scale(g),axis:t,data:m})}})),a&&a.forEach((function(t){var e,a=t.getScale(),u=null==a?void 0:a.range();if(a&&Qb(a.type)){var l=t.getCenter(),h={x:i-t.getLayoutStartPoint().x-l.x,y:n-t.getLayoutStartPoint().y-l.y},c=Ox({x:1,y:0},h);c<-Math.PI/2&&(c=2*Math.PI+c);var d=Ix(h),f=null===(e=r[0])||void 0===e?void 0:e.getScale(),v=null==f?void 0:f.range();if((c-(null==v?void 0:v[0]))*(c-(null==v?void 0:v[1]))>0||(d-(null==u?void 0:u[0]))*(d-(null==u?void 0:u[1]))>0)return;var p=a.invert(d);if(vt(p))return;var g=a.domain().findIndex((function(t){return(null==t?void 0:t.toString())===p.toString()}));g<0&&(g=void 0);var y=qA(p,t,"polar",s);o.push({index:g,value:p,position:a.scale(p),axis:t,data:y})}})),o.length?o:null};function QA(t){return"bottom"===t||"top"===t}var tT,eT=function(t){return t.fieldX[0]},iT=function(t){return t.fieldY[0]},nT=function(t){var e;return[t.fieldX[0],null!==(e=t.fieldX2)&&void 0!==e?e:t.fieldX[1]]},rT=function(t){var e;return[t.fieldY[0],null!==(e=t.fieldY2)&&void 0!==e?e:t.fieldY[1]]},aT=function(t,e){return t?e?eT:nT:e?iT:rT},oT=function(t,e,i,n){var r=t.getScale(),a=e-t.getLayoutStartPoint()[i];if((a-r.range()[0])*(a-r.range()[1])>0)return null;var o=r.invert(a);return sT(t,o,n)},sT=function(t,e,i){var n=t.getScale();if(vt(e))return null;var r=n.domain().findIndex((function(t){return(null==t?void 0:t.toString())===e.toString()}));r<0&&(r=void 0);var a=qA(e,t,"cartesian",null!=i?i:QA(t.getOrient())?eT:iT);return{index:r,value:e,position:n.scale(e),axis:t,data:a}},uT=function(){return u((function t(e,i){o(this,t),this._eventDispatcher=e,this._mode=i}),[{key:"chart",get:function(){var t,e;return this._chart||(this._chart=null===(e=(t=this._eventDispatcher.globalInstance).getChart)||void 0===e?void 0:e.call(t)),this._chart}},{key:"register",value:function(t,e){var i,n;(null!==(n=null===(i=this.chart)||void 0===i?void 0:i.getOption().onError)&&void 0!==n?n:Rb)("Method not implemented.")}},{key:"unregister",value:function(){var t,e;(null!==(e=null===(t=this.chart)||void 0===t?void 0:t.getOption().onError)&&void 0!==e?e:Rb)("Method not implemented.")}},{key:"getTargetDimensionInfo",value:function(t,e){var i,n,r=null!==(i=function(t,e,i){var n,r;if(!t)return null;var a=e.x,o=e.y,s=null!==(n=JA(t,(function(t){return QA(t.getOrient())}),e))&&void 0!==n?n:[],u=null!==(r=JA(t,(function(t){return"left"===(e=t.getOrient())||"right"===e;var e}),e))&&void 0!==r?r:[],l=new Set,h=new Set,c=new Set;[s,u].forEach((function(t){return t.forEach((function(t){Qb(t.getScale().type)?l.add(t):h.add(t),i&&t.getSpec().hasDimensionTooltip&&c.add(t)}))}));var d=[],f=function(t){var e="x"===t,i=e?a:o;(e?s:u).forEach((function(n){if(c.size>0){if(c.has(n)){var r=oT(n,i,t,aT(e,Qb(n.getScale().type)));r&&d.push(r)}}else{var a=l.size>0;if((a?l:h).has(n)){var o=oT(n,i,t,aT(e,a));o&&d.push(o)}}}))};return"horizontal"===t.getSpec().direction?(f("y"),0===d.length&&f("x")):(f("x"),0===d.length&&f("y")),d.length?d:null}(this.chart,{x:t,y:e}))&&void 0!==i?i:[],a=null!==(n=$A(this.chart,{x:t,y:e}))&&void 0!==n?n:[],o=[].concat(r,a);return 0===o.length?null:o}},{key:"dispatch",value:function(t,e){var i,n=null===(i=this.chart)||void 0===i?void 0:i.getAllComponents().filter((function(t){return"axes"===t.specKey&&(!(null==e?void 0:e.filter)||e.filter(t))})),r=n.filter((function(t){return Qb(t.getScale().type)})),a=r.length?r:n.filter((function(t){var e=t.getOrient();return QA(e)||"angle"===e})),o=[];return a.forEach((function(e){var i=sT(e,t);i&&o.push(i)})),this._callback.call(null,{action:"enter",dimensionInfo:o}),o}}])}(),lT=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).onClick=function(e){if(e){var i=e.event.viewX,n=e.event.viewY,r=t.getTargetDimensionInfo(i,n);r&&t._callback.call(null,Object.assign(Object.assign({},e),{action:"click",dimensionInfo:r.slice()}))}},t}return h(i,t),u(i,[{key:"register",value:function(t,e){this._callback=e.callback,this._eventDispatcher.register("pointertap",{query:Object.assign(Object.assign({},e.query),{source:GA.chart}),callback:this.onClick})}},{key:"unregister",value:function(){this._eventDispatcher.unregister("pointertap",{query:null,callback:this.onClick})}}])}(uT),hT=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments))._cacheDimensionInfo=null,t.onMouseMove=function(e){if(e){var i=e.event.viewX,n=e.event.viewY,r=t.getTargetDimensionInfo(i,n);null===r&&null!==t._cacheDimensionInfo?(t._callback.call(null,Object.assign(Object.assign({},e),{action:"leave",dimensionInfo:t._cacheDimensionInfo.slice()})),t._cacheDimensionInfo=r):null===r||null!==t._cacheDimensionInfo&&r.length===t._cacheDimensionInfo.length&&!r.some((function(e,i){return n=e,r=t._cacheDimensionInfo[i],!(n===r||!vt(n)&&!vt(r)&&n.value===r.value&&(null===(a=n.axis)||void 0===a?void 0:a.id)===(null===(o=r.axis)||void 0===o?void 0:o.id));var n,r,a,o}))?null!==r&&t._callback.call(null,Object.assign(Object.assign({},e),{action:"move",dimensionInfo:r.slice()})):(t._callback.call(null,Object.assign(Object.assign({},e),{action:"enter",dimensionInfo:r.slice()})),t._cacheDimensionInfo=r)}},t.onMouseOut=function(e){e&&(t._callback.call(null,Object.assign(Object.assign({},e),{action:"leave",dimensionInfo:t._cacheDimensionInfo?t._cacheDimensionInfo.slice():[]})),t._cacheDimensionInfo=null)},t}return h(i,t),u(i,[{key:"register",value:function(t,e){this._callback=e.callback,this._eventDispatcher.register("pointermove",{query:Object.assign(Object.assign({},e.query),{source:GA.chart}),callback:this.onMouseMove}),this._eventDispatcher.register("pointerout",{query:Object.assign(Object.assign({},e.query),{source:GA.canvas}),callback:this.onMouseOut}),Ib(this._mode)&&this._eventDispatcher.register("pointerdown",{query:Object.assign(Object.assign({},e.query),{source:GA.chart}),callback:this.onMouseMove})}},{key:"unregister",value:function(){this._eventDispatcher.unregister("pointermove",{query:null,callback:this.onMouseMove}),Ib(this._mode)&&this._eventDispatcher.unregister("pointerdown",{query:null,callback:this.onMouseMove})}}])}(uT);!function(t){t.dimensionHover="dimensionHover",t.dimensionClick="dimensionClick"}(tT||(tT={}));var cT=l(l({},tT.dimensionHover,hT),tT.dimensionClick,lT),dT=function(){return u((function t(e,i){o(this,t),this._composedEventMap=new Map,this._eventDispatcher=e,this._mode=i}),[{key:"getComposedEventMap",value:function(){return this._composedEventMap}},{key:"on",value:function(t,e,i){var n="function"==typeof e?{query:null,callback:e}:{query:e,callback:i};if(cT[t]){var r=new cT[t](this._eventDispatcher,this._mode);r.register(t,n),this._composedEventMap.set(i,{eventType:t,event:r})}else this._eventDispatcher.register(t,n);return this}},{key:"off",value:function(t,e,i){var n,r,a=null!=i?i:e;if(cT[t])if(a)null===(n=this._composedEventMap.get(a))||void 0===n||n.event.unregister(),this._composedEventMap.delete(a);else{var o,s=_(this._composedEventMap.entries());try{for(s.s();!(o=s.n()).done;){var u=o.value;u[1].eventType===t&&(null===(r=this._composedEventMap.get(u[0]))||void 0===r||r.event.unregister(),this._composedEventMap.delete(u[0]))}}catch(t){s.e(t)}finally{s.f()}}else if(a){var l={callback:a,query:null,filter:{nodeName:null,type:t,level:null,source:e.source,markName:null,filter:null,userId:null}};this._eventDispatcher.unregister(t,l)}else this._eventDispatcher.unregister(t);return this}},{key:"emit",value:function(t,e,i){return this._eventDispatcher.dispatch(t,e,i),this}},{key:"prevent",value:function(t,e){return this._eventDispatcher.prevent(t,e),this}},{key:"allow",value:function(t){return this._eventDispatcher.allow(t),this}},{key:"release",value:function(){this._eventDispatcher.clear(),this._composedEventMap.clear()}}])}(),fT=function(){return u((function t(){o(this,t),this._map=new Map,this._levelNodes=new Map,this._levelNodes.set(WA.vchart,[]),this._levelNodes.set(WA.chart,[]),this._levelNodes.set(WA.model,[]),this._levelNodes.set(WA.mark,[])}),[{key:"addHandler",value:function(t,e){var i,n={level:e,handler:t};return null===(i=this._levelNodes.get(e))||void 0===i||i.push(n),this._map.set(t.callback,n),this}},{key:"removeHandler",value:function(t){var e=this._map.get(t.callback);if(!e)return this;this._map.delete(t.callback);var i=this._levelNodes.get(e.level),n=null==i?void 0:i.findIndex((function(e){return e.handler.callback===t.callback}));return void 0!==n&&n>=0&&(null==i||i.splice(n,1)),this}},{key:"preventHandler",value:function(t){return t&&(t.prevented=!0),this}},{key:"allowHandler",value:function(t){return t&&(t.prevented=!1),this}},{key:"getHandlers",value:function(t){var e;return(null===(e=this._levelNodes.get(t))||void 0===e?void 0:e.map((function(t){return t.handler})))||[]}},{key:"getAllHandlers",value:function(){return Array.from(this._map.values()).map((function(t){return t.handler}))||[]}},{key:"getCount",value:function(){return this._map.size}},{key:"release",value:function(){this._map.clear(),this._levelNodes.clear()}}])}(),vT={cartesianAxis:"axis","cartesianAxis-band":"axis","cartesianAxis-linear":"axis","cartesianAxis-time":"axis",polarAxis:"axis","polarAxis-band":"axis","polarAxis-linear":"axis",discreteLegend:"legend",continuousLegend:"legend",colorLegend:"legend",sizeLegend:"legend",label:"label",markLine:"markLine",markArea:"markArea",markPoint:"markPoint",polarMarkLine:"polarMarkLine",polarMarkArea:"polarMarkArea",polarMarkPoint:"polarMarkPoint",geoMarkPoint:"geoMarkPoint"},pT=function(){return u((function t(e,i){var n=this;o(this,t),this._viewBubbles=new Map,this._windowBubbles=new Map,this._canvasBubbles=new Map,this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this._onDelegate=function(t){var e,i=n.globalInstance.getChart(),r=pt(t.modelId)&&(null==i?void 0:i.getModelById(t.modelId))||void 0,a=pt(t.markId)&&(null==i?void 0:i.getMarkById(t.markId))||null,o=new Map,s=null===(e=t.item)||void 0===e?void 0:e.mark;for(s&&pt(s.id())&&o.set(s.id(),t.item);null==s?void 0:s.elements;){var u=s.id();pt(u)&&!o.has(u)&&o.set(u,s.elements[0]),s=s.group}var l={event:t.event,item:t.item,datum:t.datum,source:t.source,itemMap:o,chart:i,model:r,mark:null!=a?a:void 0,node:Ot(t.event,"target")};n.dispatch(t.type,l)},this._onDelegateInteractionEvent=function(t){var e=n.globalInstance.getChart(),i=t.event,r=null;i.elements&&(r=i.elements);var a={event:t.event,chart:e,items:r,datums:r&&r.map((function(t){return t.getDatum()}))};n.dispatch(t.type,a)},this.globalInstance=e,this._compiler=i}),[{key:"register",value:function(t,e){var i,n,r,a,o;this._parseQuery(e);var s=this.getEventBubble((null===(i=e.filter)||void 0===i?void 0:i.source)||GA.chart),u=this.getEventListeners((null===(n=e.filter)||void 0===n?void 0:n.source)||GA.chart);if(s.get(t)||s.set(t,new fT),s.get(t).addHandler(e,null===(r=e.filter)||void 0===r?void 0:r.level),this._isValidEvent(t)&&!u.has(t)){var l=this._onDelegate.bind(this);this._compiler.addEventListener(null===(a=e.filter)||void 0===a?void 0:a.source,t,l),u.set(t,l)}else if(this._isInteractionEvent(t)&&!u.has(t)){var h=this._onDelegateInteractionEvent.bind(this);this._compiler.addEventListener(null===(o=e.filter)||void 0===o?void 0:o.source,t,h),u.set(t,h)}return this}},{key:"unregister",value:function(t,e){var i,n,r,a,o=!1,s=this.getEventBubble((null===(i=null==e?void 0:e.filter)||void 0===i?void 0:i.source)||GA.chart),u=this.getEventListeners((null===(n=null==e?void 0:e.filter)||void 0===n?void 0:n.source)||GA.chart);if(e){var l=s.get(t);null==l||l.removeHandler(e),0===(null==l?void 0:l.getCount())&&(null==l||l.release(),s.delete(t),o=!0),(null===(r=null==e?void 0:e.wrappedCallback)||void 0===r?void 0:r.cancel)&&e.wrappedCallback.cancel()}else{var h=s.get(t);null==h||h.release(),s.delete(t),o=!0}if(o&&this._isValidEvent(t)){var c=u.get(t);this._compiler.removeEventListener((null===(a=null==e?void 0:e.filter)||void 0===a?void 0:a.source)||GA.chart,t,c),u.delete(t)}return this}},{key:"dispatch",value:function(t,e,i){var n=this.getEventBubble(e.source||GA.chart).get(t);if(!n)return this;var r=!1;if(i){var a=n.getHandlers(i);r=this._invoke(a,t,e)}else for(var o=[WA.mark,WA.model,WA.chart,WA.vchart],s=0;!r&&s<o.length;)r=this._invoke(n.getHandlers(o[s]),t,e),s++;return this}},{key:"prevent",value:function(t,e){var i=this;return["canvas","chart","window"].forEach((function(n){var r=i.getEventBubble(n).get(t);r&&r.getAllHandlers().forEach((function(t){e&&t.callback===e||r.preventHandler(t)}))})),this}},{key:"allow",value:function(t){var e=this;return["canvas","chart","window"].forEach((function(i){var n=e.getEventBubble(i).get(t);n&&n.getAllHandlers().forEach((function(t){return n.allowHandler(t)}))})),this}},{key:"clear",value:function(){var t=this;[GA.chart,GA.window,GA.canvas].forEach((function(e){var i,n=t.getEventListeners(e),r=_(n.entries());try{for(r.s();!(i=r.n()).done;){var a=i.value;t._compiler.removeEventListener(e,a[0],a[1])}}catch(t){r.e(t)}finally{r.f()}n.clear()})),[this._viewBubbles,this._windowBubbles,this._canvasBubbles].forEach((function(t){var e,i=_(t.values());try{for(i.s();!(e=i.n()).done;){e.value.release()}}catch(t){i.e(t)}finally{i.f()}t.clear()}))}},{key:"release",value:function(){this.clear(),this.globalInstance=null,this._compiler=null}},{key:"_filter",value:function(t,e,i){var n,r,a;if(ft(t.filter)&&!t.filter(i))return!1;if(t.nodeName&&Ot(i,"node.name")!==t.nodeName)return!1;if(t.markName&&(null===(n=null==i?void 0:i.mark)||void 0===n?void 0:n.name)!==t.markName)return!1;var o=null===(r=i.model)||void 0===r?void 0:r.type;return vT[o]&&(o=vT[o]),!(t.type&&o!==t.type||"mark"===t.level&&!t.type&&!(null==i?void 0:i.mark)||"model"===t.level&&!t.type&&!(null==i?void 0:i.model)||pt(t.userId)&&(null===(a=i.model)||void 0===a?void 0:a.userId)!==t.userId)}},{key:"_prepareParams",value:function(t,e){if(t.markName&&e.mark&&e.itemMap){var i=e.mark.getProductId(),n=e.itemMap.get(i),r=null==n?void 0:n.getDatum();return Object.assign(Object.assign({},e),{item:n,datum:r})}return Object.assign({},e)}},{key:"_invoke",value:function(t,e,i){var n=this;return t.map((function(t){var r,a,o,s=t.filter;if(!t.prevented&&(!t.query||n._filter(s,e,i))){var u=(t.wrappedCallback||t.callback).call(null,n._prepareParams(s,i)),l=null!=u?u:null===(r=t.query)||void 0===r?void 0:r.consume;return l&&(null===(a=i.event)||void 0===a||a.stopPropagation(),null===(o=i.event)||void 0===o||o.preventDefault()),!!l}})).some((function(t){return!0===t}))}},{key:"_getQueryLevel",value:function(t){return t?t.level?t.level:pt(t.id)?WA.model:WA.vchart:WA.vchart}},{key:"_parseQuery",value:function(t){var e,i=t.query;(null==i?void 0:i.throttle)?t.wrappedCallback=function(t,e,i){var n=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return gt(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),ce(t,e,{leading:n,trailing:r,maxWait:e})}(t.callback,i.throttle):(null==i?void 0:i.debounce)&&(t.wrappedCallback=ce(t.callback,i.debounce));var n=this._getQueryLevel(i),r=null,a=GA.chart,o=null,s=null,u=null;return(null==i?void 0:i.nodeName)&&(o=i.nodeName),(null==i?void 0:i.markName)&&(s=i.markName),!(null==i?void 0:i.type)||n!==WA.model&&n!==WA.mark||(r=i.type),(null==i?void 0:i.source)&&(a=i.source),pt(null==i?void 0:i.id)&&(u=null==i?void 0:i.id,n=WA.model),t.filter={level:n,markName:s,type:r,source:a,nodeName:o,userId:u,filter:null!==(e=null==i?void 0:i.filter)&&void 0!==e?e:null},t}},{key:"getEventBubble",value:function(t){switch(t){case GA.chart:return this._viewBubbles;case GA.window:return this._windowBubbles;case GA.canvas:return this._canvasBubbles;default:return this._viewBubbles}}},{key:"getEventListeners",value:function(t){switch(t){case GA.chart:return this._viewListeners;case GA.window:return this._windowListeners;case GA.canvas:return this._canvasListeners;default:return this._viewListeners}}},{key:"_isValidEvent",value:function(t){return YA.includes(t)||Object.values(rw).includes(t)}},{key:"_isInteractionEvent",value:function(t){var e;return t&&(e=t.split(":")[0])&&Mw.hasInteraction(e)}}])}();function gT(t,e,i){t.getTransform(e)||t.registerTransform(e,i)}function yT(t,e,i){t.getParser(e)||t.registerParser(e,i)}var mT=new Map;function kT(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.latestData instanceof Eb&&(e=!1),e?Dt(t.latestData):t.latestData.slice()}var _T,bT,xT,ST=function(t,e){return 0===t.length?[]:1===t.length?kT(t[0],null==e?void 0:e.deep):t.map((function(t){return kT(t,null==e?void 0:e.deep)}))};function wT(t,e){var i,n,r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(t instanceof Eb)return t;var s,u=t.id,l=t.values,h=void 0===l?[]:l,c=t.fromDataIndex,d=t.fromDataId,f=t.transforms,v=void 0===f?[]:f,p=t.parser?Dt(t.parser):{clone:!0},g=Dt(t.fields);p.clone=!(!1===p.clone);var y=a.find((function(t){return t.name===u}));if(y)s=y;else{var m={name:u};if(g&&(m.fields=g),s=new Eb(e,m),"string"==typeof d){var k=a.find((function(t){return t.name===d}));if(!k)return(null!==(i=o.onError)&&void 0!==i?i:Rb)("no data matches fromDataId ".concat(d)),null;s.parse([k],{type:"dataview"}),s.transform({type:"copyDataView"})}else if("number"==typeof c){var _=a[c];if(!_)return(null!==(n=o.onError)&&void 0!==n?n:Rb)("no data matches fromDataIndex ".concat(c)),null;s.parse([_],{type:"dataview"}),s.transform({type:"copyDataView"})}else Array.isArray(h)?s.parse(h,p):!_t(h)||p&&!["csv","dsv","tsv"].includes(p.type)?(s.parse([]),Bb("values should be array")):s.parse(h,null!==(r=p)&&void 0!==r?r:{type:"csv"});v&&v.length&&v.forEach((function(t){e.getTransform(t.type)&&s.transform(t)}))}return s}function AT(t,e,i){t&&(e.fields&&t.setFields(e.fields,i),t.parseNewData(e.values,e.parser))}function TT(t){switch(t){case eb["desktop-browser"]:case eb["mobile-browser"]:return"browser";case eb.node:case eb.worker:return"node";case eb.miniApp:case eb["desktop-miniApp"]:return"feishu";case eb.lynx:return"lynx";case eb.wx:return"wx";case eb.tt:return"tt";case eb.harmony:return"harmony"}return"browser"}!function(t){t[t.copyDataView=-10]="copyDataView",t[t.treemapFilter=-8]="treemapFilter",t[t.treemapFlatten=-7]="treemapFlatten",t[t.dotObjFlat=-7]="dotObjFlat",t[t.linkDotInfo=-7]="linkDotInfo",t[t.sankeyLayout=-7]="sankeyLayout",t[t.dataZoomFilter=-6]="dataZoomFilter",t[t.legendFilter=-5]="legendFilter"}(_T||(_T={})),function(t){t.appear="appear",t.disappear="disappear",t.enter="enter",t.update="update",t.state="state",t.exit="exit",t.normal="normal",t.none="none"}(bT||(bT={})),function(t){t.data="data",t.signal="signal",t.mark="mark"}(xT||(xT={}));var CT,ET,BT=function(){return u((function t(e,i){var n=this;o(this,t),this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this.isInited=!1,this._released=!1,this._model=l(l(l({},xT.signal,{}),xT.data,{}),xT.mark,{}),this._compileChart=null,this.handleStageRender=function(){var t,e;null===(e=null===(t=n._compileChart)||void 0===t?void 0:t.getEvent())||void 0===e||e.emit(UA.afterRender,{chart:n._compileChart})},this._container=e,this._option=i}),[{key:"getVGrammarView",value:function(){return this._view}},{key:"getModel",value:function(){return this._model}},{key:"getRenderer",value:function(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer}},{key:"getCanvas",value:function(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.canvas()}},{key:"getStage",value:function(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.stage()}},{key:"initView",value:function(){var t,e,i,n,r=this;if(!this._released&&(this.isInited=!0,!this._view)){var a=new te(null!==(t=this._option.logLevel)&&void 0!==t?t:Jt.Error);(null===(e=this._option)||void 0===e?void 0:e.onError)&&a.addErrorHandler((function(){for(var t,e,i,n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];null===(i=null===(e=r._option)||void 0===e?void 0:e.onError)||void 0===i||(t=i).call.apply(t,[e].concat(a))})),this._view=new XA(Object.assign(Object.assign({width:this._width,height:this._height,container:null!==(i=this._container.dom)&&void 0!==i?i:null,renderCanvas:null!==(n=this._container.canvas)&&void 0!==n?n:null,hooks:this._option.performanceHook},this._option),{mode:TT(this._option.mode),autoFit:!1,eventConfig:{gesture:Ib(this._option.mode),disable:!1===this._option.interactive},doLayout:function(){var t;null===(t=r._compileChart)||void 0===t||t.onLayout(r._view)},logger:a,logLevel:a.level()})),this._setCanvasStyle(),this.getStage().hooks.afterRender.tap("chart-event",this.handleStageRender),!1!==this._option.interactive&&this._viewListeners.forEach((function(t){var e;null===(e=r._view)||void 0===e||e.addEventListener(t.type,t.callback)}))}}},{key:"_setCanvasStyle",value:function(){if(this._view&&this._container.dom&&!_t(this._container.dom)){this._container.dom.style.display="block",this._container.dom.style.position="relative";var t=this.getCanvas();t&&(t.style.display="block")}}},{key:"compileInteractions",value:function(){var t,e=this;if(this._view.removeAllInteractions(),null===(t=this._interactions)||void 0===t?void 0:t.length){var i={};this._interactions.forEach((function(t){var n;if(t.regionId){var r="".concat(t.regionId,"-").concat(t.type,"-").concat(null!==(n=t.id)&&void 0!==n?n:""),a=i[r];i[r]=a?Object.assign(Object.assign(Object.assign({},a),t),{selector:[].concat(y(a.selector),y(t.selector))}):t}else e._view.interaction(t.type,t)})),Object.keys(i).forEach((function(t){var n=e._view.interaction(i[t].type,i[t]);if(e._compileChart){var r=e._compileChart.getRegionsInIds([i[t].regionId])[0];r&&r.interaction.addVgrammarInteraction(n.getStartState(),n)}}))}}},{key:"compile",value:function(t,e){if(!this._released){var i=t.chart;this._compileChart=i,this.initView(),this._view&&(i.compile(),i.afterCompile(),this.updateDepend(),this.compileInteractions())}}},{key:"clearNextRender",value:function(){return!!this._nextRafId&&(bf.getCancelAnimationFrame()(this._nextRafId),this._nextRafId=null,!0)}},{key:"clear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.chart;this.clearNextRender(),i.clear(),this.releaseGrammar(e)}},{key:"renderNextTick",value:function(t){var e=this;this._released||this._nextRafId||(this._nextRafId=bf.getRequestAnimationFrame()((function(){e._nextRafId=null,e.render(t)})))}},{key:"render",value:function(t){var e,i;this._released||(this.initView(),this._view&&(null===(e=this._view)||void 0===e||e.run(t),this.clearNextRender()&&(null===(i=this._view)||void 0===i||i.run(t))))}},{key:"updateViewBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._view&&this._view.renderer.setViewBox(t,e)}},{key:"resize",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this._view&&(this._width=t,this._height=e,this._view.resize(t,e),i&&this.render({morph:!1}))}},{key:"setBackground",value:function(t){var e;null===(e=this._view)||void 0===e||e.background(t)}},{key:"setSize",value:function(t,e){this._width=t,this._height=e,this._view&&(this._view.width(t),this._view.height(e))}},{key:"setViewBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._view&&this._view.renderer.setViewBox(t,e)}},{key:"addEventListener",value:function(t,e,i){var n,r;if(!1!==this._option.interactive)if(t===GA.chart){var a=function(n,r){var a,o,s,u=null!==(o=null===(a=null==r?void 0:r.mark)||void 0===a?void 0:a.getContext())&&void 0!==o?o:{},l=pt(u.modelId)?u.modelId:null,h=pt(u.markId)?u.markId:null,c=pt(u.modelUserId)?u.modelUserId:null,d=pt(u.markUserId)?u.markUserId:null,f={event:n,type:e,source:t,item:r,datum:(null===(s=null==r?void 0:r.getDatum)||void 0===s?void 0:s.call(r))||null,markId:h,modelId:l,markUserId:d,modelUserId:c};i.call(null,f)}.bind(this);this._viewListeners.set(i,{type:e,callback:a}),null===(n=this._view)||void 0===n||n.addEventListener(e,a)}else if(t===GA.window){var o=function(n){var r={event:n,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,r)}.bind(this);this._windowListeners.set(i,{type:e,callback:o});var s=this._getGlobalThis();null==s||s.addEventListener(e,o)}else if(t===GA.canvas){var u=function(n){var r={event:n,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,r)}.bind(this);this._canvasListeners.set(i,{type:e,callback:u});var l=null===(r=this.getStage())||void 0===r?void 0:r.window;null==l||l.addEventListener(e,u)}}},{key:"removeEventListener",value:function(t,e,i){var n,r,a,o,s;if(!1!==this._option.interactive)if(t===GA.chart){var u=null===(n=this._viewListeners.get(i))||void 0===n?void 0:n.callback;u&&(null===(r=this._view)||void 0===r||r.removeEventListener(e,u)),this._viewListeners.delete(i)}else if(t===GA.window){var l=this._getGlobalThis(),h=null===(a=this._windowListeners.get(i))||void 0===a?void 0:a.callback;h&&(null==l||l.removeEventListener(e,h)),this._windowListeners.delete(i)}else if(t===GA.canvas){var c=null===(o=this.getStage())||void 0===o?void 0:o.window,d=null===(s=this._canvasListeners.get(i))||void 0===s?void 0:s.callback;c&&d&&(null==c||c.removeEventListener(e,d)),this._canvasListeners.delete(i)}}},{key:"releaseEvent",value:function(){var t=this.getStage();t&&t.hooks.afterRender.unTap("chart-event",this.handleStageRender),this._viewListeners.clear(),this._windowListeners.clear(),this._canvasListeners.clear()}},{key:"release",value:function(){var t;this.clearNextRender(),this.releaseEvent(),this._option=this._container=null,this._releaseModel(),null===(t=this._view)||void 0===t||t.release(),this._view=null,this.isInited=!1,this._compileChart=null,this._released=!0}},{key:"releaseGrammar",value:function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._releaseModel(),i&&(null===(t=this._view)||void 0===t||t.removeAllGraphicItems()),null===(e=this._view)||void 0===e||e.removeAllGrammars()}},{key:"_releaseModel",value:function(){var t=this;Object.keys(this._model).forEach((function(e){Object.values(t._model[e]).forEach((function(t){Object.values(t).forEach((function(t){t.removeProduct(!0)}))})),t._model[e]={}}))}},{key:"addGrammarItem",value:function(t){var e=t.getProduct();if(!vt(e)){var i=e.id(),n=t.grammarType;vt(this._model[n][i])&&(this._model[n][i]={}),this._model[n][i][t.id]=t}}},{key:"removeGrammarItem",value:function(t,e){var i,n=t.getProduct();if(!vt(n)){var r=n.id(),a=t.grammarType,o=this._model[a][r];pt(o)&&(delete o[t.id],0===Object.keys(o).length&&delete this._model[a][r]),e||null===(i=this._view)||void 0===i||i.removeGrammar(n)}}},{key:"addInteraction",value:function(t){this._interactions||(this._interactions=[]),this._interactions.push(t)}},{key:"removeInteraction",value:function(t){this._interactions&&(this._interactions=this._interactions.filter((function(e){return e.seriesId!==t})))}},{key:"updateDepend",value:function(t){return pt(t)&&t.length>0?t.every((function(t){return t.updateDepend()})):(Object.values(this._model).forEach((function(t){Object.values(t).forEach((function(t){var e=Object.values(t),i=e[0].getProduct(),n=e.reduce((function(t,e){return e.getDepend().length>0?t.concat(e.getDepend()):t}),[]).filter((function(t){return!!t})).map((function(t){return t.getProduct()}));i.depend(n)}))})),!0)}},{key:"_getGlobalThis",value:function(){var t;return Ob(this._option.mode)?globalThis:null===(t=this.getStage())||void 0===t?void 0:t.window}}])}(),RT=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}u((n=n.apply(t,e||[])).next())}))};function MT(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vchart",e=arguments.length>1?arguments[1]:void 0,i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("target","_blank"),i.setAttribute("download","".concat(t,".png")),i.dispatchEvent(new MouseEvent("click"))}function PT(t){return new Promise((function(e){t.convertToBlob().then((function(t){var i=new FileReader;i.readAsDataURL(t),i.onload=function(){e(i.result)}}))}))}function OT(t,e){var i;return RT(this,void 0,void 0,n().mark((function r(){return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t){n.next=2;break}return n.abrupt("return","");case 2:if(n.prev=2,!(void 0!==OffscreenCanvas&&t instanceof OffscreenCanvas)){n.next=5;break}return n.abrupt("return",PT(t));case 5:n.next=10;break;case 7:n.prev=7,n.t0=n.catch(2),(null!==(i=null==e?void 0:e.onError)&&void 0!==i?i:Rb)("getCanvasDataURL error : ".concat(n.t0.toString()));case 10:return n.abrupt("return",t.toDataURL());case 11:case"end":return n.stop()}}),r,null,[[2,7]])})))}function IT(t,e,i){var n,r=t.width,a=t.height;if(pt(r)&&pt(a))return{width:r,height:a};var o=i.width,s=i.height,u=e.container,l=e.canvas;if(u){var h=ii(u,i.width,i.height);o=h.width,s=h.height}else if(l&&Ob(e.mode)){var c=ii(_t(l)?bf.getElementById(l):l,i.width,i.height);o=c.width,s=c.height}else if(Lb(e.mode)&&(null===(n=e.modeParams)||void 0===n?void 0:n.domref)){var d=e.modeParams.domref;o=d.width,s=d.height}return{width:o=null!=r?r:o,height:s=null!=a?a:s}}function LT(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=function(e){return i.reduce((function(t,i){return t||(null==i?void 0:i[e])}),t[e])};return Object.assign(t,{change:r("change"),reCompile:r("reCompile"),reMake:r("reMake"),reRender:r("reRender"),reSize:r("reSize"),reTransformSpec:r("reTransformSpec"),changeTheme:r("changeTheme"),changeBackground:r("changeBackground")}),t}!function(t){t.STATE_NORMAL="normal",t.STATE_HOVER="hover",t.STATE_HOVER_REVERSE="hover_reverse",t.STATE_DIMENSION_HOVER="dimension_hover",t.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",t.STATE_SELECTED="selected",t.STATE_SELECTED_REVERSE="selected_reverse",t.STATE_SANKEY_EMPHASIS="selected",t.STATE_SANKEY_EMPHASIS_REVERSE="blur"}(CT||(CT={})),function(t){t.STATE_HOVER_REVERSE="hover_reverse",t.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",t.STATE_SELECTED_REVERSE="selected_reverse"}(ET||(ET={}));var DT=function(){function t(){o(this,t),this._children=[],this._markNameMap={},this._infoMap=new Map}return u(t,[{key:"getMarkNameMap",value:function(){return this._markNameMap}},{key:"addMark",value:function(e,i){vt(e)||(this._children.push(e),this._markNameMap[e.name]=e,this._infoMap.set(e,zt({},t.defaultMarkInfo,i)))}},{key:"removeMark",value:function(t){var e=this._children.findIndex((function(e){return e.name===t}));e>=0&&(this._infoMap.delete(this._children[e]),delete this._markNameMap[t],this._children.splice(e,1))}},{key:"clear",value:function(){this._children=[],this._markNameMap={},this._infoMap.clear()}},{key:"forEach",value:function(t){this._children.forEach(t)}},{key:"includes",value:function(t,e){return this._children.includes(t,e)}},{key:"get",value:function(t){return isNaN(Number(t))?this._markNameMap[t]:this._children[t]}},{key:"getMarks",value:function(){return this._children.slice()}},{key:"getMarksInType",value:function(t){var e=Kt(t);return this._children.filter((function(t){return e.includes(t.type)}))}},{key:"getMarkInId",value:function(t){return this._children.find((function(e){return e.id===t}))}},{key:"getMarkWithInfo",value:function(t){var e=this;return this._children.find((function(i){return Object.keys(t).every((function(n){return t[n]===e._infoMap.get(i)[n]}))}))}}])}();DT.defaultMarkInfo={};var FT=function(){return u((function t(e){var i=this;o(this,t),this._marks=new DT,this._markReverse=new DT,this.onHover=function(t){switch(t.action){case"enter":i.interaction.getEventElement(CT.STATE_DIMENSION_HOVER).forEach((function(t){return i.interaction.addEventElement(CT.STATE_DIMENSION_HOVER_REVERSE,t)})),i.interaction.clearEventElement(CT.STATE_DIMENSION_HOVER,!1),i.getEventElement(t).forEach((function(t){return i.interaction.addEventElement(CT.STATE_DIMENSION_HOVER,t)})),i.interaction.reverseEventElement(CT.STATE_DIMENSION_HOVER);break;case"leave":i.interaction.clearEventElement(CT.STATE_DIMENSION_HOVER,!0),t=null}},this._option=e,this.event=this._option.model.getOption().getChart().getEvent(),this.interaction=e.interaction,this.initConfig(e.mode)}),[{key:"hover",get:function(){return this._hover}},{key:"select",get:function(){return this._select}},{key:"setStateKeys",value:function(t){}},{key:"registerMark",value:function(t){Pt(t.stateStyle[CT.STATE_DIMENSION_HOVER])||this._marks.addMark(t),Pt(t.stateStyle[CT.STATE_DIMENSION_HOVER_REVERSE])||this._markReverse.addMark(t)}},{key:"init",value:function(){this.initEvent()}},{key:"release",value:function(){this.releaseEvent()}},{key:"initEvent",value:function(){this.event.on(tT.dimensionHover,this.onHover)}},{key:"releaseEvent",value:function(){this.event.release()}},{key:"initConfig",value:function(t){}},{key:"getEventElement",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return t.dimensionInfo.forEach((function(t){t.data.forEach((function(t){(i?e._markReverse:e._marks).getMarks().filter((function(e){return e.model===t.series&&e.getVisible()})).forEach((function(e){var r=e.getProduct();if(r&&r.elements){var a=r.elements.filter((function(e){var n,r=e.getDatum();return n=bt(r)?r.every((function(e,i){return e===t.datum[i]})):t.datum.some((function(t){return t===r})),i?!n:n}));n.push.apply(n,y(a))}}))}))})),n}}])}();var jT={};Object.values(CT).forEach((function(t){jT[t]=!0}));var NT=l(l(l({},CT.STATE_HOVER,CT.STATE_HOVER_REVERSE),CT.STATE_SELECTED,CT.STATE_SELECTED_REVERSE),CT.STATE_DIMENSION_HOVER,CT.STATE_DIMENSION_HOVER_REVERSE);function zT(t){return NT[t]}var UT,GT,WT,VT=function(){return u((function t(){o(this,t),this._stateMarks=new Map,this._stateElements=new Map,this._vgrammarInteractions=new Map,this._disableTriggerEvent=!1}),[{key:"addVgrammarInteraction",value:function(t,e){t&&(this._vgrammarInteractions.get(t)?this._vgrammarInteractions.get(t).push(e):this._vgrammarInteractions.set(t,[e]))}},{key:"setDisableActiveEffect",value:function(t){this._disableTriggerEvent=t}},{key:"registerMark",value:function(t,e){var i;this._stateMarks.has(t)||this._stateMarks.set(t,[]),null===(i=this._stateMarks.get(t))||void 0===i||i.push(e)}},{key:"getStateMark",value:function(t){return this._stateMarks.get(t)}},{key:"filterEventMark",value:function(t,e){var i;return!(!t.mark||!(null===(i=this._stateMarks.get(e))||void 0===i?void 0:i.includes(t.mark)))}},{key:"getEventElement",value:function(t){var e;return null!==(e=this._stateElements.get(t))&&void 0!==e?e:[]}},{key:"getEventElementData",value:function(t){return this.getEventElement(t).map((function(t){return t.getDatum()}))}},{key:"exchangeEventElement",value:function(t,e){var i,n=this;if(!this._disableTriggerEvent){var r=zT(t);null===(i=this._stateElements.get(t))||void 0===i||i.forEach((function(e){e.removeState(t),r&&n.addEventElement(r,e)})),e.getStates().includes(t)||(e.addState(t),r&&e.removeState(r)),this._stateElements.set(t,[e])}}},{key:"removeEventElement",value:function(t,e){var i,n;if(!this._disableTriggerEvent){e.removeState(t);var r=null!==(n=null===(i=this._stateElements.get(t))||void 0===i?void 0:i.filter((function(t){return t!==e})))&&void 0!==n?n:[];this._stateElements.set(t,r);var a=zT(t);a&&(0===r.length?this.clearEventElement(a,!1):this.addEventElement(a,e))}}},{key:"addEventElement",value:function(t,e){var i;if(!this._disableTriggerEvent){e.getStates().includes(t)||e.addState(t);var n=null!==(i=this._stateElements.get(t))&&void 0!==i?i:[];n.push(e),this._stateElements.set(t,n)}}},{key:"clearEventElement",value:function(t,e){var i;if(!this._disableTriggerEvent&&(null===(i=this._stateElements.get(t))||void 0===i||i.forEach((function(e){e.removeState(t)})),this._stateElements.set(t,[]),e)){var n=zT(t);n&&this.clearEventElement(n,!1)}}},{key:"reverseEventElement",value:function(t){var e=this;if(!this._disableTriggerEvent){var i=zT(t);if(i){var n=this.getStateMark(i);if(n){var r=this.getEventElement(t);r.length&&(this.getEventElement(i).length||(1===r.length?n.forEach((function(t){t.getProduct().elements.filter((function(t){return t!==r[0]})).forEach((function(t){e.addEventElement(i,t)}))})):n.forEach((function(t){t.getProduct().elements.filter((function(t){return!r.includes(t)})).forEach((function(t){e.addEventElement(i,t)}))}))))}}}}},{key:"startInteraction",value:function(t,e){var i=this._vgrammarInteractions.get(t);i&&i.forEach((function(t){t.start(e)}))}},{key:"resetInteraction",value:function(t,e){var i=this._vgrammarInteractions.get(t);i&&i.forEach((function(t){t.reset(e)}))}}],[{key:"markStateEnable",value:function(t,e){return!Pt(t.stateStyle[e])}}])}();!function(t){t[t.Axis_Grid=50]="Axis_Grid",t[t.CrossHair_Grid=100]="CrossHair_Grid",t[t.Region=450]="Region",t[t.Mark=300]="Mark",t[t.Node=400]="Node",t[t.Axis=100]="Axis",t[t.MarkLine=500]="MarkLine",t[t.MarkArea=100]="MarkArea",t[t.MarkPoint=500]="MarkPoint",t[t.DataZoom=500]="DataZoom",t[t.ScrollBar=500]="ScrollBar",t[t.Player=500]="Player",t[t.Legend=500]="Legend",t[t.CrossHair=500]="CrossHair",t[t.Indicator=500]="Indicator",t[t.Title=500]="Title",t[t.Label=500]="Label",t[t.Brush=500]="Brush",t[t.CustomMark=500]="CustomMark",t[t.Interaction=700]="Interaction"}(UT||(UT={})),function(t){t[t.Indicator=10]="Indicator",t[t.Region=20]="Region",t[t.Axis=30]="Axis",t[t.DataZoom=40]="DataZoom",t[t.Player=40]="Player",t[t.ScrollBar=40]="ScrollBar",t[t.Legend=50]="Legend",t[t.Title=70]="Title",t[t.CustomMark=70]="CustomMark"}(GT||(GT={})),function(t){t[t.Default=0]="Default",t[t.Theme=1]="Theme",t[t.Chart=2]="Chart",t[t.Base_Series=3]="Base_Series",t[t.Series=4]="Series",t[t.Mark=5]="Mark",t[t.User_Chart=6]="User_Chart",t[t.User_Series=7]="User_Series",t[t.User_Mark=8]="User_Mark",t[t.User_SeriesStyle=9]="User_SeriesStyle",t[t.Built_In=99]="Built_In"}(WT||(WT={}));var HT=function(){return u((function t(e){o(this,t),this._option=e,this.getCompiler=this._option.getCompiler}),[{key:"getOption",value:function(){return this._option}},{key:"getVGrammarView",value:function(){var t;return null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView()}},{key:"release",value:function(){this._option=null,this.getCompiler=null}}])}(),KT=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).id=Fb(),t._compiledProductId=null,t._depend=[],t}return h(i,t),u(i,[{key:"getProduct",value:function(){if(pt(this._product))return this._product;var t=this.getVGrammarView(),e=this.getProductId();return pt(e)&&pt(t)&&(this._product=this._lookupGrammar(e)),this._product}},{key:"getProductId",value:function(){var t;return null!==(t=this._compiledProductId)&&void 0!==t?t:this.generateProductId()}},{key:"getDepend",value:function(){return this._depend}},{key:"setDepend",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._depend=e}},{key:"compile",value:function(t){this._compileProduct(t),this._afterCompile(t)}},{key:"_afterCompile",value:function(t){var e;pt(this._product)&&(null===(e=this.getCompiler())||void 0===e||e.addGrammarItem(this))}},{key:"updateDepend",value:function(){if(pt(this._product)){var t=this.getDepend().map((function(t){return t.getProduct()})).filter(pt);return this._product.depend(t),t.length===this.getDepend().length}return!1}},{key:"release",value:function(){this.removeProduct(),p(c(i.prototype),"release",this).call(this),this._depend=[]}},{key:"removeProduct",value:function(t){this.getCompiler().removeGrammarItem(this,t),this._product=null,this._compiledProductId=null}}])}(HT),XT=function(t){function i(t,n,r,a){var s;return o(this,i),(s=e(this,i,[t])).grammarType=xT.signal,s.name=n,s._value=r,s._updateFunc=a,s}return h(i,t),u(i,[{key:"getValue",value:function(){return this._value}},{key:"getUpdateFunc",value:function(){return this._updateFunc}},{key:"updateSignal",value:function(t,e){this._value=t,this._updateFunc=e,this.compile()}},{key:"_compileProduct",value:function(){var t=this.getVGrammarView();if(t){if(!this.getProduct()){var e=this.getProductId();this._product=t.signal().id(e),this._compiledProductId=e}pt(this._value)&&this._product.value(this._value),pt(this._updateFunc)&&this._product.update(this._updateFunc)}}},{key:"generateProductId",value:function(){return this.name}},{key:"_lookupGrammar",value:function(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getSignalById(t)}}])}(KT),YT=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments))._signalMap={},t}return h(i,t),u(i,[{key:"getSignalMap",value:function(){return this._signalMap}},{key:"getSignal",value:function(t){return this._signalMap[t]}},{key:"updateSignal",value:function(t,e,i){this._signalMap[t]?this._signalMap[t].updateSignal(e,i):(this._signalMap[t]=new XT(this._option,t,e,i),this._signalMap[t].compile())}},{key:"compile",value:function(){Object.values(this._signalMap).forEach((function(t){t.compile()}))}},{key:"release",value:function(){p(c(i.prototype),"release",this).call(this),Object.values(this._signalMap).forEach((function(t){t.release()})),this._signalMap={}}}])}(HT),qT=function(t){function i(t){var n;return o(this,i),n=e(this,i,[t]),t.stateKeyToSignalName?n.stateKeyToSignalName=t.stateKeyToSignalName:n.stateKeyToSignalName=function(){return"state_signal"},n.initStateMap(),n}return h(i,t),u(i,[{key:"getStateMap",value:function(){return this._stateMap}},{key:"_getDefaultStateMap",value:function(){return{}}},{key:"initStateMap",value:function(t){this._stateMap=null!=t?t:this._getDefaultStateMap()}},{key:"compile",value:function(t){var e=this,i=null!=t?t:this._stateMap;Object.keys(i).forEach((function(t){var n=e.stateKeyToSignalName(t),r=i[t];e.updateSignal(n,r)}))}},{key:"updateState",value:function(t,e){if(t&&(zt(this._stateMap,t),this.compile(t),!e))return this.getCompiler().renderNextTick()}}])}(YT),ZT=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).id=Fb(),t.stateKeyToSignalName=function(e){return"".concat(nS,"_animate_").concat(t.id,"_").concat(e)},t}return h(i,t),u(i,[{key:"getAnimationStateSignalName",value:function(){return this.stateKeyToSignalName("animationState")}},{key:"updateAnimateState",value:function(t,e){t===bT.update?this.updateState({animationState:{callback:function(t,e){return e.diffState}}},e):t===bT.appear?this.updateState({animationState:{callback:function(t,e){return"exit"===e.diffState?bT.none:bT.appear}}},e):this.updateState({animationState:{callback:function(e,i){return t}}},e)}},{key:"_getDefaultStateMap",value:function(){return{animationState:{callback:function(t,e){return"exit"===e.diffState?bT.exit:"update"===e.diffState?bT.update:bT.appear}}}}}])}(qT),JT=function(){return u((function t(e){o(this,t),this._option=e,this.type=e.type}),[{key:"_initTheme",value:function(t,e){return this._theme=this.getTheme(t,e),this._mergeThemeToSpec(t,e)}},{key:"getTheme",value:function(t,e){}},{key:"transformSpec",value:function(t,e,i){this._transformSpecBeforeMergingTheme(t,e,i);var n=this._initTheme(t,e);return this._transformSpecAfterMergingTheme(n.spec,e,i),n}},{key:"_transformSpecBeforeMergingTheme",value:function(t,e,i){}},{key:"_transformSpecAfterMergingTheme",value:function(t,e,i){}},{key:"_mergeThemeToSpec",value:function(t,e){var i=this._theme;if(this._shouldMergeThemeToSpec()){var n=this._getDefaultSpecFromChart(e),r=function(t){return TS({},i,n,t)};return bt(t)?{spec:t.map((function(t){return r(t)})),theme:i}:{spec:r(t),theme:i}}return{spec:t,theme:i}}},{key:"_shouldMergeThemeToSpec",value:function(){return!0}},{key:"_getDefaultSpecFromChart",value:function(t){}}])}(),$T=function(t){function i(t,n){var r,a;return o(this,i),(r=e(this,i,[n])).transformerConstructor=JT,r.type="null",r.modelType="null",r.userId=void 0,r._data=null,r._layout=null,r.specKey="",r._marks=new DT,r._lastLayoutRect=null,r.id=Fb(),r.userId=t.id,r._spec=t,r.effect={},r.event=new dT(n.eventDispatcher,n.mode),null===(a=n.map)||void 0===a||a.set(r.id,f(r)),r}return h(i,t),u(i,[{key:"getSpec",value:function(){return this._spec||{}}},{key:"getSpecPath",value:function(){var t;return null===(t=this._option)||void 0===t?void 0:t.specPath}},{key:"getSpecInfoPath",value:function(){var t,e,i;return null!==(e=null===(t=this._option)||void 0===t?void 0:t.specInfoPath)&&void 0!==e?e:null===(i=this._option)||void 0===i?void 0:i.specPath}},{key:"getData",value:function(){return this._data}},{key:"layout",get:function(){return this._layout}},{key:"getOption",value:function(){return this._option}},{key:"getMarks",value:function(){var t,e;return null!==(e=null===(t=this._marks)||void 0===t?void 0:t.getMarks())&&void 0!==e?e:[]}},{key:"getMarkNameMap",value:function(){var t;return null===(t=this._marks)||void 0===t?void 0:t.getMarkNameMap()}},{key:"getMarkSet",value:function(){return this._marks}},{key:"getChart",value:function(){return this._option.getChart()}},{key:"_theme",get:function(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.theme}},{key:"_releaseEvent",value:function(){this.event.release()}},{key:"created",value:function(){this.setAttrFromSpec()}},{key:"init",value:function(t){}},{key:"afterInit",value:function(){}},{key:"getVisible",value:function(){var t;return!1!==(null===(t=this._spec)||void 0===t?void 0:t.visible)}},{key:"onLayoutStart",value:function(t,e,i){var n;null===(n=this._layout)||void 0===n||n.onLayoutStart(t,e,i)}},{key:"onLayoutEnd",value:function(t){var e;null===(e=this._layout)||void 0===e||e.onLayoutEnd(t),this.getMarks().forEach((function(t){return t.updateLayoutState(!0,!0)}))}},{key:"onEvaluateEnd",value:function(t){}},{key:"onDataUpdate",value:function(){}},{key:"beforeRelease",value:function(){}},{key:"release",value:function(){var t;this._releaseEvent(),this._spec=void 0,this.getMarks().forEach((function(t){return t.release()})),null===(t=this._data)||void 0===t||t.release(),this._data=null,this._marks.clear(),p(c(i.prototype),"release",this).call(this)}},{key:"updateSpec",value:function(t){var e=this._compareSpec(t,this._spec);return this._spec=t,e}},{key:"_compareSpec",value:function(t,e){return{change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1}}},{key:"reInit",value:function(t){t&&(this._spec=t),this.setAttrFromSpec()}},{key:"updateLayoutAttribute",value:function(){}},{key:"setAttrFromSpec",value:function(){var t;null===(t=this._layout)||void 0===t||t.setAttrFromSpec(this._spec,this._option.getChartViewRect())}},{key:"_convertMarkStyle",value:function(t){return Object.assign({},t)}},{key:"setMarkStyle",value:function(t,e,i,n){pt(t)&&pt(e)&&t.setStyle(this._convertMarkStyle(e),i,n)}},{key:"initMarkStyleWithSpec",value:function(t,e,i){var n=this;if(pt(t)&&pt(e)){var r=e.style,a=e.state,o=Object.assign({},e);r&&(o.style=this._convertMarkStyle(r)),a&&(o.state={},Object.keys(a).forEach((function(t){o.state[t]=n._convertMarkStyle(a[t])}))),t.initStyleWithSpec(o,i)}}},{key:"stateKeyToSignalName",value:function(t,e){var i="".concat(nS,"_").concat(this.modelType,"_").concat(this.type,"_").concat(this.id,"_").concat(t);return e&&(i+="_".concat(e)),i}},{key:"compileData",value:function(){var t;null===(t=this._data)||void 0===t||t.compile()}},{key:"compileMarks",value:function(t){this.getMarks().forEach((function(e){e.compile({group:t})}))}},{key:"_createMark",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.type,n=t.name,r=ES.createMark(i,n,Object.assign({model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._option.globalScale},e));return null==r||r.created(),r}},{key:"_getDataIdKey",value:function(){}},{key:"getColorScheme",value:function(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}},{key:"getSpecInfo",value:function(){var t,e,i;return function(t,e,i){if(!vt(e))return Ot(t,e,i)}(null!==(i=null===(e=(t=this._option).getSpecInfo)||void 0===e?void 0:e.call(t))&&void 0!==i?i:{},this.getSpecInfoPath())}},{key:"getSpecIndex",value:function(){var t=this.getSpecPath();if(!(null==t?void 0:t.length))return 0;var e=Number(t[t.length-1]);return isNaN(e)?0:e}}])}(HT),QT=function(){return u((function t(e,i){var n,r=this;o(this,t),this.layoutClip=!1,this.autoIndent=!1,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:0,height:0},this._layoutRectLevelMap={width:0,height:0},this._minWidth=null,this._maxWidth=null,this._minHeight=null,this._maxHeight=null,this._lastComputeRect=null,this._lastComputeOutBounds={x1:0,x2:0,y1:0,y2:0},this.getLayoutRect=function(){return r._layoutRect},this.layoutType="normal",this._layoutOrient="left",this.layoutPaddingLeft=0,this.layoutPaddingTop=0,this.layoutPaddingRight=0,this.layoutPaddingBottom=0,this.layoutOffsetX=0,this.layoutOffsetY=0,this.layoutLevel=GT.Region,this._model=e,this._option=i,this.layoutLevel=i.layoutLevel,this.layoutType=i.layoutType,i.layoutOrient&&(this.layoutOrient=i.layoutOrient),this._spec=null===(n=null==e?void 0:e.getSpec)||void 0===n?void 0:n.call(e)}),[{key:"getSpec",value:function(){return this._spec||{}}},{key:"getLayoutStartPoint",value:function(){return this._layoutStartPoint}},{key:"layoutRectLevelMap",get:function(){return this._layoutRectLevelMap}},{key:"minWidth",get:function(){return this._minWidth},set:function(t){this._minWidth=t}},{key:"maxWidth",get:function(){return this._maxWidth},set:function(t){this._maxWidth=t}},{key:"minHeight",get:function(){return this._minHeight},set:function(t){this._minHeight=t}},{key:"maxHeight",get:function(){return this._maxHeight},set:function(t){this._maxHeight=t}},{key:"getLastComputeOutBounds",value:function(){return this._lastComputeOutBounds}},{key:"layoutOrient",get:function(){return this._layoutOrient},set:function(t){this._layoutOrient=t}},{key:"model",get:function(){return this._model}},{key:"type",get:function(){return this._model.type}},{key:"_setLayoutAttributeFromSpec",value:function(t,e){var i,n,r,a;if(this._spec&&!1!==this._spec.visible){var o=Yx(qx(t.padding),e,e);this.layoutPaddingLeft=o.left,this.layoutPaddingRight=o.right,this.layoutPaddingTop=o.top,this.layoutPaddingBottom=o.bottom,this._minHeight=vt(t.minHeight)?null!==(i=this._minHeight)&&void 0!==i?i:null:Xx(t.minHeight,e.height,e),this._maxHeight=vt(t.maxHeight)?null!==(n=this._maxHeight)&&void 0!==n?n:null:Xx(t.maxHeight,e.height,e),this._minWidth=vt(t.minWidth)?null!==(r=this._minWidth)&&void 0!==r?r:null:Xx(t.minWidth,e.width,e),this._maxWidth=vt(t.maxWidth)?null!==(a=this._maxWidth)&&void 0!==a?a:null:Xx(t.maxWidth,e.width,e),t.width&&this.setLayoutRect({width:Xx(t.width,e.width,e)},{width:9}),t.height&&this.setLayoutRect({height:Xx(t.height,e.height,e)},{height:9}),vt(t.offsetX)||(this.layoutOffsetX=Xx(t.offsetX,e.width,e)),vt(t.offsetY)||(this.layoutOffsetY=Xx(t.offsetY,e.height,e)),t.alignSelf&&(this.alignSelf=t.alignSelf)}}},{key:"setAttrFromSpec",value:function(t,e){var i,n,r,a;this._spec=t,this.layoutType=null!==(i=t.layoutType)&&void 0!==i?i:this.layoutType,this.layoutLevel=null!==(n=t.layoutLevel)&&void 0!==n?n:this.layoutLevel,this.layoutOrient=null!==(r=t.orient)&&void 0!==r?r:this.layoutOrient,this._setLayoutAttributeFromSpec(t,e),this.layoutClip=null!==(a=t.clip)&&void 0!==a?a:this.layoutClip}},{key:"onLayoutStart",value:function(t,e,i){this._setLayoutAttributeFromSpec(this._spec,e)}},{key:"onLayoutEnd",value:function(t){}},{key:"_getAbsoluteSpecValue",value:function(t){var e=this,i={top:null,bottom:null,left:null,right:null};return["top","bottom","left","right"].forEach((function(n){vt(e._spec[n])||(i[n]=Xx(e._spec[n],"top"===n||"bottom"===n?t.height:t.width,t))})),i}},{key:"absoluteLayoutInRect",value:function(t){var e=this._getAbsoluteSpecValue(t),i=e.top,n=e.bottom,r=e.left,a=e.right,o={width:t.width-this.layoutPaddingLeft-this.layoutPaddingRight,height:t.height-this.layoutPaddingTop-this.layoutPaddingBottom};vt(r)||(o.width-=r),vt(a)||(o.width-=a),vt(i)||(o.height-=i),vt(n)||(o.height-=n),this.setLayoutRect(o);var s=this.computeBoundsInRect(this.getLayoutRect()),u=s.width,l=s.height;this.setLayoutRect({width:u,height:l});var h={x:t.x,y:t.y};!0===this._spec.center?(h.x=t.x+.5*t.width-.5*u,h.y=t.y+.5*t.height-.5*l):(vt(r)?vt(a)||(h.x=t.x+t.width-this.layoutPaddingRight-a-u):h.x=t.x+r+this.layoutPaddingLeft,vt(i)?vt(n)||(h.y=t.y+t.height-this.layoutPaddingBottom-n-l):h.y=t.y+i+this.layoutPaddingTop),this.setLayoutStartPosition(h)}},{key:"setLayoutStartPosition",value:function(t){var e,i;this._option.transformLayoutPosition&&(t=this._option.transformLayoutPosition(t)),At(t.x)&&(this._layoutStartPoint.x=t.x),At(t.y)&&(this._layoutStartPoint.y=t.y),null===(i=(e=this._model).afterSetLayoutStartPoint)||void 0===i||i.call(e,this._layoutStartPoint)}},{key:"setLayoutRect",value:function(t,e){var i,n,r,a,o=t.width,s=t.height;At(o)&&(null!==(i=null==e?void 0:e.width)&&void 0!==i?i:0)>=this._layoutRectLevelMap.width&&(this._layoutRect.width=o,this._layoutRectLevelMap.width=null!==(n=null==e?void 0:e.width)&&void 0!==n?n:0),At(s)&&(null!==(r=null==e?void 0:e.height)&&void 0!==r?r:0)>=this._layoutRectLevelMap.height&&(this._layoutRect.height=s,this._layoutRectLevelMap.height=null!==(a=null==e?void 0:e.height)&&void 0!==a?a:0),this.setRectInSpec(this._layoutRect)}},{key:"getLayout",value:function(){return{x:this._layoutStartPoint.x,y:this._layoutStartPoint.y,width:this._layoutRect.width,height:this._layoutRect.height}}},{key:"mergeLayoutRect",value:function(t){var e={width:t.width,height:t.height};return this._layoutRectLevelMap.width>0&&(e.width=this._layoutRect.width),this._layoutRectLevelMap.height>0&&(e.height=this._layoutRect.height),e}},{key:"getOrientPosAttribute",value:function(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"x":"y"}},{key:"getOrientSizeAttribute",value:function(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"width":"height"}},{key:"changeBoundsBySetting",value:function(t){return this._layoutRectLevelMap.width>0&&(t.x2=t.x1+this._layoutRect.width),this._layoutRectLevelMap.height>0&&(t.y2=t.y1+this._layoutRect.height),t.x1-=this._layoutStartPoint.x,t.x2-=this._layoutStartPoint.x,t.y1-=this._layoutStartPoint.y,t.y2-=this._layoutStartPoint.y,t}},{key:"setRectInSpec",value:function(t){var e=Object.assign({},t);return this._layoutRectLevelMap.width<9?(vt(this._minWidth)||(e.width=Math.max(e.width,this._minWidth)),vt(this._maxWidth)||(e.width=Math.min(e.width,this._maxWidth))):e.width=this._layoutRect.width,this._layoutRectLevelMap.height<9?(vt(this._minHeight)||(e.height=Math.max(e.height,this._minHeight)),vt(this._maxHeight)||(e.height=Math.min(e.height,this._maxHeight))):e.height=this._layoutRect.height,e}},{key:"computeBoundsInRect",value:function(t){if(this._lastComputeRect=t,!("region-relative"!==this.layoutType&&"region-relative-overlap"!==this.layoutType||(9!==this._layoutRectLevelMap.width||"left"!==this.layoutOrient&&"right"!==this.layoutOrient)&&(9!==this._layoutRectLevelMap.height||"bottom"!==this.layoutOrient&&"top"!==this.layoutOrient)))return this._layoutRect;var e=Object.assign({},this._model.getBoundsInRect(this.setRectInSpec(t),t));this.changeBoundsBySetting(e),this.autoIndent&&e.x2-e.x1>0&&e.y2-e.y1>0&&(this._lastComputeOutBounds.x1=Math.ceil(-e.x1),this._lastComputeOutBounds.x2=Math.ceil(e.x2-t.width),this._lastComputeOutBounds.y1=Math.ceil(-e.y1),this._lastComputeOutBounds.y2=Math.ceil(e.y2-t.height));var i=this.setRectInSpec(function(t,e){return t?{width:Math.ceil(Math.min(t.x2-t.x1,e.width)),height:Math.ceil(Math.min(t.y2-t.y1,e.height))}:{width:0,height:0}}(e,t));return this._option.transformLayoutRect&&(i=this._option.transformLayoutRect(i)),i}},{key:"getModelId",value:function(){return this._model.id}},{key:"getModelVisible",value:function(){return this._model.getVisible()}}])}(),tC=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).layoutType="normal",t.layoutLevel=0,t.layoutZIndex=0,t._forceLayoutTag=!1,t._layout=null,t._orient=null,t._layoutRect={width:0,height:0},t._layoutStartPos={x:0,y:0},t._isLayout=!0,t.getGraphicBounds=function(){return t._layout?{x1:t._layout.getLayoutStartPoint().x,y1:t._layout.getLayoutStartPoint().y,x2:t._layout.getLayoutStartPoint().x+t._layout.getLayoutRect().width,y2:t._layout.getLayoutStartPoint().y+t._layout.getLayoutRect().height}:{x1:0,x2:0,y1:0,y2:0}},t._transformLayoutRect=null,t._transformLayoutPosition=null,t}return h(i,t),u(i,[{key:"layoutOrient",get:function(){return this._orient},set:function(t){this._orient=t,this._layout&&(this._layout.layoutOrient=t)}},{key:"initLayout",value:function(){"none"!==this.layoutType&&(this._layout=new QT(this,{layoutType:this.layoutType,layoutLevel:this.layoutLevel,layoutOrient:this._orient,transformLayoutRect:this._transformLayoutRect,transformLayoutPosition:this._transformLayoutPosition}),this._orient&&"radius"!==this._orient&&"angle"!==this._orient&&this._layout&&(this._layout.layoutOrient=this._orient))}},{key:"onLayoutStart",value:function(t,e,n){this._isLayout=!0,p(c(i.prototype),"onLayoutStart",this).call(this,t,e,n)}},{key:"onLayoutEnd",value:function(t){p(c(i.prototype),"onLayoutEnd",this).call(this,t),this.updateLayoutAttribute();var e=this.getLayoutRect();!this._forceLayoutTag&&Wt(this._lastLayoutRect,e)||(this._lastLayoutRect=Object.assign({},e)),this._forceLayoutTag=!1,this._isLayout=!1}},{key:"afterSetLayoutStartPoint",value:function(t){}},{key:"_forceLayout",value:function(){var t;this._isLayout||(this._forceLayoutTag=!0,null===(t=this._option.globalInstance.getChart())||void 0===t||t.setLayoutTag(!0))}},{key:"getLayoutStartPoint",value:function(){return this._layout?this._layout.getLayoutStartPoint():this._layoutStartPos}},{key:"setLayoutStartPosition",value:function(t){return this._layout?this._layout.setLayoutStartPosition(t):this._layoutStartPos=zt(this._layoutStartPos,t)}},{key:"getLayoutRect",value:function(){return this._layout?this._layout.getLayoutRect():this._layoutRect}},{key:"setLayoutRect",value:function(t,e){return this._layout?this._layout.setLayoutRect(t):this._lastLayoutRect=zt(this._layoutRect,t)}},{key:"getLastComputeOutBounds",value:function(){var t;return null===(t=this._layout)||void 0===t?void 0:t.getLastComputeOutBounds()}},{key:"setAttrFromSpec",value:function(){var t,e,n,r,a;p(c(i.prototype),"setAttrFromSpec",this).call(this),this.layoutClip=null!==(t=this._spec.clip)&&void 0!==t?t:this.layoutClip,this.layoutZIndex=null!==(e=this._spec.zIndex)&&void 0!==e?e:this.layoutZIndex,this.layoutType=null!==(n=this._spec.layoutType)&&void 0!==n?n:this.layoutType,this._orient=null!==(r=this._spec.orient)&&void 0!==r?r:this._orient,this.layoutLevel=null!==(a=this._spec.layoutLevel)&&void 0!==a?a:this.layoutLevel}}])}($T),eC=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"_initTheme",value:function(t,e){return{spec:t,theme:this._theme}}}])}(JT),iC=function(t){function i(t,n){var r,a;return o(this,i),(r=e(this,i,[t,n])).transformerConstructor=eC,r.modelType="region",r.specKey="region",r.type=i.type,r._series=[],r.layoutType="region",r.layoutZIndex=UT.Region,r.interaction=new VT,r.seriesDataFilterOver=function(){r.event.emit(UA.regionSeriesDataFilterOver,{model:f(r),chart:r.getChart()}),r._series.forEach((function(t){t.getViewDataFilter()&&t.reTransformViewData()}))},r.getBoundsInRect=function(){return{x1:r._layout.getLayoutStartPoint().x,y1:r._layout.getLayoutStartPoint().y,x2:r._layout.getLayoutStartPoint().x+r._layout.getLayoutRect().width,y2:r._layout.getLayoutStartPoint().y+r._layout.getLayoutRect().height}},r.userId=t.id,r.coordinate=null!==(a=t.coordinate)&&void 0!==a?a:"cartesian",r._option.animation&&(r.animate=new ZT({getCompiler:n.getCompiler})),r.interaction.setDisableActiveEffect(r._option.disableTriggerEvent),r}return h(i,t),u(i,[{key:"getMaxWidth",value:function(){return this._layout.maxWidth}},{key:"setMaxWidth",value:function(t){this._layout.maxWidth=t}},{key:"getMaxHeight",value:function(){return this._layout.maxHeight}},{key:"setMaxHeight",value:function(t){this._layout.maxHeight=t}},{key:"getGroupMark",value:function(){return this._groupMark}},{key:"getInteractionMark",value:function(){return this._interactionMark}},{key:"getStackInverse",value:function(){return!0===this._spec.stackInverse}},{key:"getStackSort",value:function(){return!0===this._spec.stackSort}},{key:"_getClipDefaultValue",value:function(){var t,e,i,n,r=this._option.getChart().getSpec(),a=null===(e=null===(t=r.dataZoom)||void 0===t?void 0:t.some)||void 0===e?void 0:e.call(t,(function(t){var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"filter")})),o=null===(n=null===(i=r.scrollBar)||void 0===i?void 0:i.some)||void 0===n?void 0:n.call(i,(function(t){var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"axis")}));return!(!a&&!o)||this._layout.layoutClip}},{key:"created",value:function(){var t,e=this;this.initLayout(),p(c(i.prototype),"created",this).call(this);var n=null!==(t=this._spec.clip)&&void 0!==t?t:this._getClipDefaultValue();this._groupMark=this._createGroupMark("regionGroup",this.userId,this.layoutZIndex),this._interactionMark=this._createGroupMark("regionInteractionGroup",this.userId+"_interaction",UT.Interaction),Pt(this._spec.style)||(this._backgroundMark=this._createMark({type:"rect",name:"regionBackground"}),n&&(this._foregroundMark=this._createMark({type:"rect",name:"regionForeground"})),[this._backgroundMark,this._foregroundMark].forEach((function(t){t&&(t.created(),e.setMarkStyle(t,{width:function(){return e.getLayoutRect().width},height:function(){return e.getLayoutRect().height}},"normal",WT.Built_In),e._groupMark.addMark(t))})),this._backgroundMark&&this._backgroundMark.setZIndex(0),this._foregroundMark&&this._foregroundMark.setZIndex(UT.Mark+1)),this.createTrigger()}},{key:"_createGroupMark",value:function(t,e,i){var n,r,a=this,o=this._createMark({type:"group",name:t});o.setUserId(e),o.setZIndex(i);var s=null!==(n=this._spec.clip)&&void 0!==n?n:this._getClipDefaultValue();return this.setMarkStyle(o,{x:function(){return a.getLayoutStartPoint().x},y:function(){return a.getLayoutStartPoint().y},width:function(){return a.getLayoutRect().width},height:function(){return a.getLayoutRect().height},clip:s},"normal",WT.Built_In),this.setMarkStyle(o,{cornerRadius:null===(r=this._spec.style)||void 0===r?void 0:r.cornerRadius},"normal",WT.User_Mark),this._marks.addMark(o),o}},{key:"init",value:function(t){p(c(i.prototype),"init",this).call(this,t),this.initMark(),this.initSeriesDataflow(),this.initInteraction(),this.initTrigger()}},{key:"initMark",value:function(){this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}},{key:"_initBackgroundMarkStyle",value:function(){var t,e;this._backgroundMark&&(this.setMarkStyle(this._backgroundMark,Object.assign({fillOpacity:(null===(t=this._spec.style)||void 0===t?void 0:t.fill)?1:0},this._spec.style),"normal",WT.User_Mark),(null!==(e=this._spec.clip)&&void 0!==e?e:this._getClipDefaultValue())&&this.setMarkStyle(this._backgroundMark,{strokeOpacity:0},"normal",WT.Built_In))}},{key:"_initForegroundMarkStyle",value:function(){this._foregroundMark&&this.setMarkStyle(this._foregroundMark,Object.assign(Object.assign({},this._spec.style),{fillOpacity:0}),"normal",WT.User_Mark)}},{key:"_compareSpec",value:function(t,e){var n=p(c(i.prototype),"_compareSpec",this).call(this,t,e);return Wt(null==e?void 0:e.style,null==t?void 0:t.style)||(n.reMake=!0),n}},{key:"reInit",value:function(t){p(c(i.prototype),"reInit",this).call(this,t),this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}},{key:"addSeries",value:function(t){t&&(this._series.includes(t)||this._series.push(t))}},{key:"removeSeries",value:function(t){if(t){var e=this._series.findIndex((function(e){return e===t}));e>=0&&this._series.splice(e,1)}}},{key:"getSeries",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._series.filter((function(e){var i,n;return(!t.name||(null==e?void 0:e.name)===t.name)&&(!t.userId||Kt(t.userId).includes(e.userId))&&(!pt(t.specIndex)||Kt(t.specIndex).includes(e.getSpecIndex()))&&(!t.id||e.id===t.id)&&(!t.type||e.type===t.type)&&(!t.coordinateType||e.coordinate===t.coordinateType)&&(!t.dataName||(null===(n=null===(i=e.getRawData)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.name)===t.dataName)}))}},{key:"getSeriesInName",value:function(t){return this.getSeries({name:t})[0]}},{key:"getSeriesInUserId",value:function(t){return this.getSeries({userId:t})[0]}},{key:"getSeriesInId",value:function(t){return this.getSeries({id:t})[0]}},{key:"getSeriesInType",value:function(t){return this.getSeries({type:t})}},{key:"getSeriesInCoordinateType",value:function(t){return this.getSeries({coordinateType:t})}},{key:"getSeriesInDataName",value:function(t){return this.getSeries({dataName:t})}},{key:"onRender",value:function(t){}},{key:"initSeriesDataflow",value:function(){var t=this._series.map((function(t){var e;return null!==(e=t.getViewDataFilter())&&void 0!==e?e:t.getViewData()})).filter((function(t){return!!t}));this._option.dataSet.multipleDataViewAddListener(t,"change",this.seriesDataFilterOver)}},{key:"release",value:function(){p(c(i.prototype),"release",this).call(this),this._series=[]}},{key:"createTrigger",value:function(){var t=Object.assign(Object.assign({},this._option),{model:this,interaction:this.interaction});this._trigger=new FT(t)}},{key:"initTrigger",value:function(){var t=this;this._series.forEach((function(e){e.getMarksWithoutRoot().forEach((function(e){t._trigger.registerMark(e)}))})),this._trigger.init()}},{key:"initInteraction",value:function(){var t=this;this._option.disableTriggerEvent||this._series.forEach((function(e){e.getMarksWithoutRoot().forEach((function(e){for(var i in ET)Pt(e.stateStyle[ET[i]])||t.interaction.registerMark(ET[i],e)}))}))}},{key:"compileMarks",value:function(t){var e=this;this.getMarks().forEach((function(i){var n;i.compile({group:t}),null===(n=i.getProduct())||void 0===n||n.configure({context:{model:e}}).layout((function(t,e,i,n){}))}))}},{key:"compile",value:function(){var t;null===(t=this.animate)||void 0===t||t.compile(),this.compileMarks()}},{key:"onLayoutEnd",value:function(t){this._series.forEach((function(e){return e.onLayoutEnd(t)})),p(c(i.prototype),"onLayoutEnd",this).call(this,t)}}])}(tC);function nC(t){var e=[],i=[],n=[];return t.forEach((function(t){vt(t.getSpec().position)||"start"===t.getSpec().position?e.push(t):"middle"===t.getSpec().position?i.push(t):"end"===t.getSpec().position&&n.push(t)})),{startItems:e,endItems:n,middleItems:i}}function rC(t,e,i){e?t.forEach((function(t){var e=Xt(t),n=e.getLayoutStartPoint().y+e.getLayoutRect().height-t[0].getLayoutStartPoint().y,r=(i-n)/2;t.forEach((function(t){t.setLayoutStartPosition({x:t.getLayoutStartPoint().x,y:t.getLayoutStartPoint().y+r})}))})):t.forEach((function(t){var e=Xt(t),n=e.getLayoutStartPoint().x+e.getLayoutRect().width-t[0].getLayoutStartPoint().x,r=(i-n)/2;t.forEach((function(t){t.setLayoutStartPosition({x:t.getLayoutStartPoint().x+r,y:t.getLayoutStartPoint().y})}))}))}function aC(t,e,i,n){var r;t.forEach((function(t,a){t.length>1&&(r=i[a],t.forEach((function(t){if(t.alignSelf&&"start"!==t.alignSelf){var i=t.getLayoutStartPoint(),a="middle"===t.alignSelf?.5:1,o=e?r-(t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight):r-(t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom);e?t.setLayoutStartPosition({x:i.x+n*o*a,y:i.y}):t.setLayoutStartPosition({x:i.x,y:i.y+n*o*a})}})))}))}function oC(t,e,i,n,r){if(t.length){var a=0,o="right"===r,s=o?-1:1,u=o?e.rightCurrent:e.leftCurrent,l=e.topCurrent,h=[],c=[],d=[];t.forEach((function(t){var n=e.getItemComputeLayoutRect(t),r=t.computeBoundsInRect(n);t.setLayoutRect(r);var f=r.height+t.layoutPaddingTop+t.layoutPaddingBottom,v=r.width+t.layoutPaddingLeft+t.layoutPaddingRight,p=o?-r.width-t.layoutPaddingRight:t.layoutPaddingLeft;t.setLayoutStartPosition({x:u+t.layoutOffsetX+p,y:l+t.layoutOffsetY+t.layoutPaddingTop}),(l+=f)>i&&c.length?(d.push(a),u+=s*a,a=v,l=e.topCurrent+f,t.setLayoutStartPosition({x:u+t.layoutOffsetX+p,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),h.push(c),c=[t]):(a=Math.max(a,v),c.push(t))})),d.push(a),h.push(c),aC(h,!0,d,s),n&&rC(h,!0,i),o?e.rightCurrent=u+s*a:e.leftCurrent=u+s*a}}function sC(t,e,i,n){if(t.length){var r=0,a="right"===n,o=a?-1:1,s=a?e.rightCurrent:e.leftCurrent,u=e.bottomCurrent,l=[],h=[],c=[];t.forEach((function(t){var i=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(i);t.setLayoutRect(n);var d=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,f=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,v=a?-n.width-t.layoutPaddingRight:t.layoutPaddingLeft;u<d&&h.length?(c.push(r),s+=o*r,r=f,u=e.bottomCurrent,t.setLayoutStartPosition({x:s+t.layoutOffsetX+v,y:u+t.layoutOffsetY-n.height-t.layoutPaddingBottom}),l.push(h),h=[t]):(t.setLayoutStartPosition({x:s+t.layoutOffsetX+v,y:u+t.layoutOffsetY-n.height-t.layoutPaddingBottom}),r=Math.max(r,f),u-=d,h.push(t))})),c.push(r),l.push(h),aC(l,!0,c,o),a?e.rightCurrent=s+o*r:e.leftCurrent=s+o*r}}function uC(t,e,i,n,r){if(t.length){var a="top"===r,o=a?1:-1,s=0,u=e.leftCurrent,l=a?e.topCurrent:e.bottomCurrent,h=[],c=[],d=[];t.forEach((function(t){var n=e.getItemComputeLayoutRect(t),r=t.computeBoundsInRect(n);t.setLayoutRect(r);var f=r.height+t.layoutPaddingTop+t.layoutPaddingBottom,v=r.width+t.layoutPaddingLeft+t.layoutPaddingRight,p=a?t.layoutPaddingTop:-r.height-t.layoutPaddingBottom;t.setLayoutStartPosition({x:u+t.layoutOffsetX+t.layoutPaddingLeft,y:l+t.layoutOffsetY+p}),(u+=v)>i&&c.length?(d.push(s),u=e.leftCurrent+v,l+=o*s,s=f,t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:l+t.layoutOffsetY+p}),h.push(c),c=[t]):(s=Math.max(s,f),c.push(t))})),d.push(s),h.push(c),aC(h,!1,d,o),n&&rC(h,!1,i),a?e.topCurrent=l+o*s:e.bottomCurrent=l+o*s}}function lC(t,e,i,n){if(t.length){var r="top"===n,a=r?1:-1,o=0,s=e.rightCurrent,u=r?e.topCurrent:e.bottomCurrent,l=[],h=[],c=[];t.forEach((function(t){var i=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(i);t.setLayoutRect(n);var c=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,d=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,f=r?t.layoutPaddingTop:-n.height-t.layoutPaddingBottom;s<d&&h.length?(s=e.rightCurrent,u+=a*o,o=c,t.setLayoutStartPosition({x:e.rightCurrent+t.layoutOffsetX-n.width-t.layoutPaddingRight,y:u+t.layoutOffsetY+f}),l.push(h),h=[t]):(h.push(t),t.setLayoutStartPosition({x:s+t.layoutOffsetX-n.width-t.layoutPaddingRight,y:u+t.layoutOffsetY+f}),o=Math.max(o,c),s-=d)})),c.push(o),l.push(h),aC(l,!1,c,a),r?e.topCurrent=u+a*o:e.bottomCurrent=u+a*o}}iC.type="region",iC.transformerConstructor=eC,iC.specKey="region";var hC=function(){return u((function t(e,i){o(this,t),this.leftCurrent=0,this.topCurrent=0,this.rightCurrent=0,this.bottomCurrent=0,this._onError=null==i?void 0:i.onError}),[{key:"_layoutInit",value:function(t,e,i,n){this._chartLayoutRect=i,this._chartViewBox=n,this.leftCurrent=i.x,this.topCurrent=i.y,this.rightCurrent=i.x+i.width,this.bottomCurrent=i.height+i.y,e.sort((function(t,e){return e.layoutLevel-t.layoutLevel}))}},{key:"_layoutNormalItems",value:function(t){this.layoutNormalInlineItems(t.filter((function(t){return"normal-inline"===t.layoutType}))),this.layoutNormalItems(t.filter((function(t){return"normal"===t.layoutType})))}},{key:"_groupItems",value:function(t){var e=t.filter((function(t){return"region"===t.layoutType})),i=t.filter((function(t){return"region-relative"===t.layoutType})),n=t.filter((function(t){return"region-relative-overlap"===t.layoutType})),r=i.concat(n),a={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}};return n.forEach((function(t){a[t.layoutOrient].items.push(t)})),{regionItems:e,relativeItems:i,relativeOverlapItems:n,allRelatives:r,overlapItems:a}}},{key:"layoutItems",value:function(t,e,i,n){this._layoutInit(t,e,i,n),this._layoutNormalItems(e);var r={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},a=this._groupItems(e),o=a.regionItems,s=a.relativeItems,u=a.relativeOverlapItems,l=a.allRelatives,h=a.overlapItems;this.layoutRegionItems(o,s,u,h),this._processAutoIndent(o,s,u,h,l,r),this.layoutAbsoluteItems(e.filter((function(t){return"absolute"===t.layoutType})))}},{key:"_processAutoIndent",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}},r=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;if(r.some((function(t){return t.autoIndent}))){var o=this._checkAutoIndent(r,a),s=o.top,u=o.bottom,l=o.left,h=o.right;(s||u||l||h)&&(this.topCurrent=a.top+s,this.bottomCurrent=a.bottom-u,this.leftCurrent=a.left+l,this.rightCurrent=a.right-h,this.layoutRegionItems(t,e,i,n))}}},{key:"layoutNormalItems",value:function(t){var e=this;t.forEach((function(t){var i=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(i);t.setLayoutRect(n),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),e.leftCurrent+=n.width+t.layoutPaddingLeft+t.layoutPaddingRight):"top"===t.layoutOrient?(t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),e.topCurrent+=n.height+t.layoutPaddingTop+t.layoutPaddingBottom):"right"===t.layoutOrient?(t.setLayoutStartPosition({x:e.rightCurrent+t.layoutOffsetX-n.width-t.layoutPaddingRight,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),e.rightCurrent-=n.width+t.layoutPaddingLeft+t.layoutPaddingRight):"bottom"===t.layoutOrient&&(t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingRight,y:e.bottomCurrent+t.layoutOffsetY-n.height-t.layoutPaddingBottom}),e.bottomCurrent-=n.height+t.layoutPaddingTop+t.layoutPaddingBottom)}))}},{key:"layoutNormalInlineItems",value:function(t){var e=t.filter((function(t){return"left"===t.layoutOrient})),i=t.filter((function(t){return"right"===t.layoutOrient})),n=t.filter((function(t){return"top"===t.layoutOrient})),r=t.filter((function(t){return"bottom"===t.layoutOrient})),a=this._chartLayoutRect.width+this._chartLayoutRect.x,o=this._chartLayoutRect.height+this._chartLayoutRect.y;e.length&&function(t,e,i){var n=nC(t),r=n.startItems,a=n.middleItems,o=n.endItems;r.length&&oC(r,e,i,!1,"left"),a.length&&oC(a,e,i,!0,"left"),o.length&&sC(o,e,0,"left")}(e,this,o),n.length&&function(t,e,i){var n=nC(t),r=n.startItems,a=n.middleItems,o=n.endItems;r.length&&uC(r,e,i,!1,"top"),a.length&&uC(a,e,i,!0,"top"),o.length&&lC(o,e,0,"top")}(n,this,a),i.length&&function(t,e,i){var n=nC(t),r=n.startItems,a=n.middleItems,o=n.endItems;r.length&&oC(r,e,i,!1,"right"),a.length&&oC(a,e,i,!0,"right"),o.length&&sC(o,e,0,"right")}(i,this,o),r.length&&function(t,e,i){var n=nC(t),r=n.startItems,a=n.middleItems,o=n.endItems;r.length&&uC(r,e,i,!1,"bottom"),a.length&&uC(a,e,i,!0,"bottom"),o.length&&lC(o,e,0,"bottom")}(r,this,a)}},{key:"_layoutRelativeOverlap",value:function(t,e){var i=this;e.items.forEach((function(t){var n=i.getItemComputeLayoutRect(t),r=t.computeBoundsInRect(n);e.rect.width=Math.max(r.width+t.layoutPaddingLeft+t.layoutPaddingRight,e.rect.width),e.rect.height=Math.max(r.height+t.layoutPaddingTop+t.layoutPaddingBottom,e.rect.height)})),e.items.forEach((function(n){n.setLayoutRect(e.rect),"left"===t?n.setLayoutStartPosition({x:i.leftCurrent+n.layoutOffsetX}):"right"===t?n.setLayoutStartPosition({x:i.rightCurrent-e.rect.width+n.layoutOffsetX}):"top"===t?n.setLayoutStartPosition({x:i.topCurrent+n.layoutOffsetY}):n.setLayoutStartPosition({x:i.bottomCurrent-e.rect.height+n.layoutOffsetY})})),"left"===t?this.leftCurrent+=e.rect.width:"right"===t?this.rightCurrent-=e.rect.width:"top"===t?this.topCurrent+=e.rect.height:this.bottomCurrent-=e.rect.height}},{key:"_layoutRelativeItem",value:function(t,e){var i=t.computeBoundsInRect(e);"left"===t.layoutOrient||"right"===t.layoutOrient?t.setLayoutRect({width:i.width}):t.setLayoutRect({height:i.height}),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"right"===t.layoutOrient?(this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight,t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX+t.layoutPaddingLeft})):"top"===t.layoutOrient?(t.setLayoutStartPosition({y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"bottom"===t.layoutOrient&&(this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom,t.setLayoutStartPosition({y:this.bottomCurrent+t.layoutOffsetY+t.layoutPaddingTop}))}},{key:"_layoutRegionItem",value:function(t,e,i){var n=this,r=Math.max(Math.min.apply(Math,[e].concat(y(t.map((function(t){var e;return null!==(e=t.maxWidth)&&void 0!==e?e:Number.MAX_VALUE}))))),0),a=Math.max(Math.min.apply(Math,[i].concat(y(t.map((function(t){var e;return null!==(e=t.maxHeight)&&void 0!==e?e:Number.MAX_VALUE}))))),0);return t.forEach((function(t){var e=r-t.layoutPaddingLeft-t.layoutPaddingRight,i=a-t.layoutPaddingTop-t.layoutPaddingBottom;t.setLayoutRect({width:e,height:i}),t.setLayoutStartPosition({x:n.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:n.topCurrent+t.layoutOffsetY+t.layoutPaddingTop})})),{regionHeight:a,regionWidth:r}}},{key:"layoutRegionItems",value:function(t,e,i){var n=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}},a=(this.rightCurrent,this.leftCurrent),o=(this.bottomCurrent,this.topCurrent);e.filter((function(t){return"left"===t.layoutOrient||"right"===t.layoutOrient})).forEach((function(t){n._layoutRelativeItem(t,n.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("left",r.left),this._layoutRelativeOverlap("right",r.right),a=this.rightCurrent-this.leftCurrent,e.filter((function(t){return"top"===t.layoutOrient||"bottom"===t.layoutOrient})).forEach((function(t){n._layoutRelativeItem(t,n.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("top",r.top),this._layoutRelativeOverlap("bottom",r.bottom),o=this.bottomCurrent-this.topCurrent;var s=this._layoutRegionItem(t,a,o),u=s.regionWidth,l=s.regionHeight;e.concat(i).forEach((function(e){if(["left","right"].includes(e.layoutOrient)){var i=n.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({height:i.getLayoutRect().height}),e.setLayoutStartPosition({y:i.getLayoutStartPoint().y+e.layoutOffsetY+e.layoutPaddingTop}),"right"===e.layoutOrient&&e.setLayoutStartPosition({x:e.getLayoutStartPoint().x+u-a})}else if(["top","bottom"].includes(e.layoutOrient)){var r=n.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({width:r.getLayoutRect().width}),e.setLayoutStartPosition({x:r.getLayoutStartPoint().x+e.layoutOffsetX+e.layoutPaddingLeft}),"bottom"===e.layoutOrient&&e.setLayoutStartPosition({y:e.getLayoutStartPoint().y+l-o})}}))}},{key:"layoutAbsoluteItems",value:function(t){var e=this;t.forEach((function(t){t.absoluteLayoutInRect(e._chartLayoutRect)}))}},{key:"filterRegionsWithID",value:function(t,e){var i,n=t.find((function(t){return t.getModelId()===e}));return n||(null!==(i=this._onError)&&void 0!==i?i:Rb)("can not find target region item, invalid id"),n}},{key:"getItemComputeLayoutRect",value:function(t){return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight,height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom}}},{key:"_checkAutoIndent",value:function(t,e){var i=this,n={top:0,left:0,bottom:0,right:0};return t.forEach((function(t){if(t.getModelVisible()&&t.autoIndent){var r="left"===t.layoutOrient||"right"===t.layoutOrient,a=t.getLastComputeOutBounds(),o=i._getOutInLayout(a,t,e);r?(n.top=Math.max(n.top,o.top),n.bottom=Math.max(n.bottom,o.bottom)):(n.left=Math.max(n.left,o.left),n.right=Math.max(n.right,o.right))}})),n}},{key:"_getOutInLayout",value:function(t,e,i){var n=e.getLayoutStartPoint(),r=n.x,a=n.y,o=e.getLayoutRect(),s=o.width,u=o.height;return{left:i.left-(r-t.x1),right:r+s+t.x2-i.right,top:i.top-(a-t.y1),bottom:a+u+t.y2-i.bottom}}}])}();hC.type="base";var cC=["linear","radial","conical"],dC={linear:{x0:0,y0:0,x1:1,y1:1},radial:{x0:0,y0:0,x1:1,y1:1,r0:0,r1:1},conical:{x:.5,y:.5,startAngle:0,endAngle:2*Math.PI}},fC=["line","area","trail"];function vC(t){return fC.includes(t)}var pC=function(t){function i(t,n){var r;return o(this,i),(r=e(this,i,[t]))._stateInfoList=[],r._mark=n,r}return h(i,t),u(i,[{key:"getStateInfoList",value:function(){return this._stateInfoList}},{key:"_getDefaultStateMap",value:function(){return{markUpdateRank:1}}},{key:"getStateInfo",value:function(t){return this._stateInfoList.find((function(e){return e.stateValue===t}))}},{key:"addStateInfo",value:function(t){if(!this.getStateInfo(t.stateValue)){t.level=t.level||0;for(var e=!0,i=0;i<this._stateInfoList.length;i++){var n=this._stateInfoList[i].level;if(n&&n>t.level){this._stateInfoList.splice(i,0,t),e=!1;break}}e&&this._stateInfoList.push(t)}}},{key:"_clearStateBeforeSet",value:function(t){t.datums=null,t.items=null,t.fields=null,t.filter=null}},{key:"changeStateInfo",value:function(t){var e=this.getStateInfo(t.stateValue);if(e){if(void 0!==t.datums&&(this._clearStateBeforeSet(e),e.datums=t.datums,e.datumKeys=t.datumKeys),void 0!==t.items&&(this._clearStateBeforeSet(e),e.items=t.items),void 0!==t.fields)if(this._clearStateBeforeSet(e),null===t.fields)e.fields=t.fields;else for(var i in e.fields=e.fields||{},t.fields){var n=t.fields[i];e.fields[i]=e.fields[i]||{};var r=e.fields[i];pt(n.domain)&&(r.domain=n.domain),pt(n.type)&&(r.type=n.type)}t.filter&&(this._clearStateBeforeSet(e),e.filter=t.filter)}else this.addStateInfo(t)}},{key:"clearStateInfo",value:function(t){var e=this;t.forEach((function(t){e.getStateInfo(t)&&e.changeStateInfo({stateValue:t,datumKeys:null,datums:null,fields:null,items:null,filter:null,cache:{}})}))}},{key:"checkOneState",value:function(t,e,i,n){var r;n=dt(vC)?n:!t.mark||vC(t.mark.markType);var a=!1,o=!1;if(pt(i.datums)&&i.datums.length>0)a=this.checkDatumState(i,e,n),o=!0;else if(i.items)a=null!==(r=this.checkItemsState(i,t))&&void 0!==r&&r,o=!0;else if(i.fields)a=this.checkFieldsState(i,e,t,n),o=!0;else if(!a&&i.filter){var s={mark:this._mark,renderNode:t,type:t.mark.markType};a=i.filter(e,s),o=!0}return o?a?"in":"out":"skip"}},{key:"checkState",value:function(t,e){for(var i=t.getStates().filter((function(t){return function(t){return!!jT[t]}(t)})).map((function(t){return[t,10]})),n=!t.mark||vC(t.mark.markType),r=0;r<this._stateInfoList.length;r++){var a=this._stateInfoList[r],o=this.checkOneState(t,e,a,n);"skip"!==o&&"in"===o&&i.push([a.stateValue,a.level])}return i.map((function(t){return t[0]}))}},{key:"checkDatumState",value:function(t,e,i){var n=!1,r=i?e[0]:e;if(bt(t.datums)){var a=t.datumKeys||Object.keys(t.datums[0]).filter((function(t){return!t.startsWith(nS)}));n=t.datums.some((function(t){return i&&bt(null==t?void 0:t.items)?a.every((function(e){var i,n;return(null===(n=null===(i=null==t?void 0:t.items)||void 0===i?void 0:i[0])||void 0===n?void 0:n[e])===(null==r?void 0:r[e])})):a.every((function(e){return(null==t?void 0:t[e])===(null==r?void 0:r[e])}))}))}else n=gt(t.datums)?(t.datumKeys||Object.keys(t.datums).filter((function(t){return!t.startsWith(nS)}))).every((function(e){var n,a;return i?(null===(n=t.datums.items)||void 0===n?void 0:n[0][e])===r[e]:(null===(a=t.datums)||void 0===a?void 0:a[e])===r[e]})):e===t.datums;return n}},{key:"checkItemsState",value:function(t,e){var i;return null===(i=t.items)||void 0===i?void 0:i.includes(e)}},{key:"checkFieldsState",value:function(t,e,i,n){var r,a=this,o=!0,s=function(){var s=t.fields[u],l=s.type,h=s.domain,c=n?null===(r=e[0])||void 0===r?void 0:r[u]:e[u];if(Jb(l)&&h.length>1){if(a.checkLinearFieldState(h,u,e,i,n))return o=!1,0;o=!0}else{if(!h.some((function(t){return t===c})))return o=!1,0;o=!0}};for(var u in t.fields)if(0===s())break;return o}},{key:"checkLinearFieldState",value:function(t,e,i,n,r){var a,o=r?null===(a=i[0])||void 0===a?void 0:a[e]:i[e];return o<t[0]||o>t[t.length-1]}},{key:"updateLayoutState",value:function(t){return this._stateMap.markUpdateRank++,this.updateState({markUpdateRank:this._stateMap.markUpdateRank},t)}},{key:"compileState",value:function(t,e){var i=this;t.state({callback:function(t,e){return i.checkState(e,t)}},e)}}])}(qT),gC=function(t){function i(t){var n;return o(this,i),(n=e(this,i,[t]))._mark=t.mark,n}return h(i,t),u(i,[{key:"setCompiledProductId",value:function(t){this._compiledProductId=t}},{key:"generateProductId",value:function(){var t=p(c(i.prototype),"generateProductId",this).call(this);return pt(t)?t:"".concat(nS,"_markData_").concat(this._mark.id)}},{key:"_compileProduct",value:function(){var t,e=null===(t=this._data)||void 0===t?void 0:t.latestData;vt(e)||pt(this.getProduct())||this._initProduct(e)}}])}(function(t){function i(t,n){var r;return o(this,i),(r=e(this,i,[t])).grammarType=xT.data,r._data=null,r._data=n,r}return h(i,t),u(i,[{key:"getDataView",value:function(){return this._data}},{key:"setDataView",value:function(t){this._data=t}},{key:"getLatestData",value:function(){var t;return null===(t=this._data)||void 0===t?void 0:t.latestData}},{key:"release",value:function(){p(c(i.prototype),"release",this).call(this),this._data=null}},{key:"updateData",value:function(t){var e=this.getProduct(),i=this.getLatestData();if(e&&i&&(e.values(i),!t))return this.getCompiler().renderNextTick()}},{key:"_compileProduct",value:function(){var t=this.getLatestData();vt(t)||(vt(this.getProduct())?this._initProduct(t):this._product.values(t))}},{key:"_initProduct",value:function(t){var e,i,n=this.getVGrammarView();if(n&&t){var r=this.getProductId();this._product=null===(i=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.call(n,t))||void 0===i?void 0:i.id(r),this._compiledProductId=r}}},{key:"generateProductId",value:function(){var t;return"".concat(null===(t=this.getDataView())||void 0===t?void 0:t.name)}},{key:"_lookupGrammar",value:function(t){var e,i;return null===(i=null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getDataById)||void 0===i?void 0:i.call(e,t)}}])}(KT)),yC=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i},mC=function(t){function i(t,n,r){var a;return o(this,i),(a=e(this,i,[t])).grammarType=xT.mark,a.type=void 0,a.name="mark",a._interactive=!0,a._zIndex=UT.Mark,a._visible=!0,a.stateStyle={},a._unCompileChannel={},a._skipBeforeLayouted=!1,a._morph=!1,a.name=n,a.model=r,a.key=t.key,a.state=new pC(Object.assign(Object.assign({},t),{stateKeyToSignalName:a.stateKeyToSignalName.bind(f(a))}),f(a)),a._option.support3d&&a.setSupport3d(!0),a._option.skipTheme&&a.setSkipTheme(!0),a._event=new dT(r.getOption().eventDispatcher,r.getOption().mode),a}return h(i,t),u(i,[{key:"getSkipTheme",value:function(){return this._skipTheme}},{key:"setSkipTheme",value:function(t){this._skipTheme=t}},{key:"getSupport3d",value:function(){return this._support3d}},{key:"setSupport3d",value:function(t){this._support3d=t}},{key:"getFacet",value:function(){return this._facet}},{key:"setFacet",value:function(t){this._facet=t}},{key:"getInteractive",value:function(){return this._interactive}},{key:"setInteractive",value:function(t){this._interactive=t}},{key:"getZIndex",value:function(){return this._zIndex}},{key:"setZIndex",value:function(t){this._zIndex=t}},{key:"getVisible",value:function(){return this._visible}},{key:"setVisible",value:function(t){this._visible=t}},{key:"getUserId",value:function(){return this._userId}},{key:"setUserId",value:function(t){pt(t)&&(this._userId=t)}},{key:"getDataView",value:function(){var t;return null===(t=this._data)||void 0===t?void 0:t.getDataView()}},{key:"setDataView",value:function(t,e){vt(this._data)&&this.initMarkData(Object.assign(Object.assign({},this._option),{mark:this})),pt(e)&&this._data.setCompiledProductId(e),this._data.setDataView(t)}},{key:"getData",value:function(){return this._data}},{key:"setData",value:function(t){this._data=t}},{key:"hasState",value:function(t){return t in this.state.getStateMap()}},{key:"getState",value:function(t){return this.state.getStateMap()[t]}},{key:"getAnimationConfig",value:function(){return this._animationConfig}},{key:"setAnimationConfig",value:function(t){this._animationConfig=t}},{key:"setSkipBeforeLayouted",value:function(t){this._skipBeforeLayouted=t}},{key:"getSkipBeforeLayouted",value:function(){return this._skipBeforeLayouted}},{key:"getMorph",value:function(){return this._morph}},{key:"setMorph",value:function(t){this._morph=t}},{key:"getMorphKey",value:function(){return this._morphKey}},{key:"setMorphKey",value:function(t){this._morphKey=t}},{key:"getMorphElementKey",value:function(){return this._morphElementKey}},{key:"setMorphElementKey",value:function(t){this._morphElementKey=t}},{key:"getGroupKey",value:function(){return this._groupKey}},{key:"setGroupKey",value:function(t){this._groupKey=t}},{key:"getProgressiveConfig",value:function(){return this._progressiveConfig}},{key:"setProgressiveConfig",value:function(t){this._progressiveConfig=t}},{key:"setCustomizedShapeCallback",value:function(t){this._setCustomizedShape=t}},{key:"setEnableSegments",value:function(t){this._enableSegments=t}},{key:"getClip",value:function(){return this._clip}},{key:"setClip",value:function(t){this._clip=t}},{key:"setStateSortCallback",value:function(t){this._stateSort=t}},{key:"setTransform",value:function(t){this._transform=t}},{key:"initMarkData",value:function(t){this._data=new gC(t)}},{key:"stateKeyToSignalName",value:function(t){return"".concat(nS,"_").concat(this.type,"_").concat(this.id,"_").concat(t)}},{key:"getAttribute",value:function(t,e,i,n){}},{key:"_compileProduct",value:function(t){var e=this.getProduct();this.getVisible()?pt(e)||this.getCompiler().isInited&&(this._initProduct(null==t?void 0:t.group),vt(this._product)||(this.compileSignal(),this.compileData(),this.compileState(),this.compileEncode(),this.compileAnimation(),this.compileContext(),this.compileTransform())):pt(e)&&this.removeProduct()}},{key:"_initProduct",value:function(t){var e=this.getVGrammarView(),i=this.getProductId();this._product=e.mark(this.type,null!=t?t:e.rootMark).id(i),this._compiledProductId=i}},{key:"generateProductId",value:function(){return this._userId?"".concat(this._userId):"".concat(this.name,"_").concat(this.id)}},{key:"compileData",value:function(){var t;if(!vt(this._data)){this._data.compile();var e=this._data.getProduct();pt(this._product)&&pt(e)&&this._product.join(e,this.key,void 0,null!==(t=this._groupKey)&&void 0!==t?t:this._facet)}}},{key:"updateStaticEncode",value:function(){if(this._product){var t=this._separateStyle(),e=t.enterStyles,i=t.updateStyles;this._product.encodeState("group",e,!0),this._product.encode(i,!0)}}},{key:"_separateStyle",value:function(){var t=this,e=this.stateStyle,i=CT.STATE_NORMAL,n=e[i],r=(yC(e,["symbol"==a(i)?i:i+""]),this._option.noSeparateStyle?null:{}),o={};return Object.keys(n).forEach((function(e){t._unCompileChannel[e]||(t._option.noSeparateStyle||function(t,e,i){var n,r=null===(n=e[t])||void 0===n?void 0:n.style;return!!function(t,e){return("fill"===t||"stroke"===t)&&(null==e?void 0:e.gradient)&&(null==e?void 0:e.stops)}(t,r)||!!ft(r)||!(!(null==r?void 0:r.scale)||r.field===i)}(e,n,t.getFacet())?o[e]={callback:t.compileCommonAttributeCallback(e,"normal"),dependency:[t.stateKeyToSignalName("markUpdateRank")]}:r[e]=t.compileCommonAttributeCallback(e,"normal"))})),{enterStyles:r,updateStyles:o}}},{key:"compileEncode",value:function(){var t=this,e=this.stateStyle,i=CT.STATE_NORMAL,n=(e[i],yC(e,["symbol"==a(i)?i:i+""])),r=this._separateStyle(),o=r.enterStyles,s=r.updateStyles;this._product.encode(s,!0),this._product.encodeState("group",o,!0),Object.keys(n).forEach((function(e){var i={};Object.keys(n[e]).forEach((function(n){t._unCompileChannel[n]||(i[n]={callback:t.compileCommonAttributeCallback(n,e),dependency:[t.stateKeyToSignalName("markUpdateRank")]})})),t._product.encodeState(e,i,!0)})),this._skipBeforeLayouted&&this._product.layout({skipBeforeLayouted:this._skipBeforeLayouted})}},{key:"compileState",value:function(){this.state.compileState(this._product,this._stateSort)}},{key:"compileAnimation",value:function(){var t,e,i,n,r=this;if(this._animationConfig){var a;if("component"===this.type)a=null===(t=this.model.animate)||void 0===t?void 0:t.getAnimationStateSignalName();else{var o=null===(i=(e=this.model).getRegion)||void 0===i?void 0:i.call(e);a=null===(n=null==o?void 0:o.animate)||void 0===n?void 0:n.getAnimationStateSignalName()}this._product.animation(this._animationConfig),this._product.animationState({callback:function(t,e,i){var n;return null===(n=i[a])||void 0===n?void 0:n.callback(t,e)},dependency:a}),this._animationConfig.normal&&(this._animationConfig.appear?this._event.on(rw.ANIMATION_END,(function(t){var e=t.event;e.mark===r.getProduct()&&e.animationState===bT.appear&&r.runAnimationByState(bT.normal)})):this._event.on(rw.AFTER_DO_RENDER,(function(){r.runAnimationByState(bT.normal)})))}}},{key:"compileContext",value:function(){var t={interactive:this.getInteractive(),zIndex:this.getZIndex(),context:{markId:this.id,modelId:this.model.id,markUserId:this._userId,modelUserId:this.model.userId},skipTheme:this.getSkipTheme(),support3d:this.getSupport3d(),enableSegments:!!this._enableSegments,clip:!!this._clip||!1!==this._clip&&void 0,clipPath:this._clip||void 0};this._progressiveConfig&&(t.progressiveStep=this._progressiveConfig.progressiveStep,t.progressiveThreshold=this._progressiveConfig.progressiveThreshold,t.large=this._progressiveConfig.large,t.largeThreshold=this._progressiveConfig.largeThreshold),t.morph=this._morph,t.morphKey=this._morphKey,t.morphElementKey=this._morphElementKey,this._setCustomizedShape&&(t.setCustomizedShape=this._setCustomizedShape),this._product.configure(t)}},{key:"compileSignal",value:function(){this.state.compile()}},{key:"_computeAttribute",value:function(t,e){return function(t,e){}}},{key:"compileCommonAttributeCallback",value:function(t,e){var i=this._computeAttribute(t,e),n={mark:null,parent:null,element:null};return function(t,e){return n.mark=e.mark,n.parent=e.mark.group,n.element=e,i(t,n)}}},{key:"compileTransform",value:function(){var t;(null===(t=this._transform)||void 0===t?void 0:t.length)&&this.getProduct().transform(this._transform)}},{key:"_lookupGrammar",value:function(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getMarkById(t)}},{key:"updateState",value:function(t,e){return this.state.updateState(t,e)}},{key:"updateLayoutState",value:function(t,e){return e&&this.getMarks().length>0&&this.getMarks().forEach((function(t){return t.state.updateLayoutState(!0)})),this.state.updateLayoutState(t)}},{key:"updateMarkState",value:function(t){var e=this;if(this._product){var i=this.state.getStateInfo(t);this._product.elements.forEach((function(n){"in"===e.state.checkOneState(n,n.getDatum(),i)?n.addState(t):n.removeState(t)}))}}},{key:"getMarks",value:function(){return[]}},{key:"runAnimationByState",value:function(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.runAnimationByState(t)}},{key:"stopAnimationByState",value:function(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.stopAnimationByState(t)}},{key:"pauseAnimationByState",value:function(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.pauseAnimationByState(t)}},{key:"resumeAnimationByState",value:function(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.resumeAnimationByState(t)}},{key:"getProductElements",value:function(){var t=this.getProduct();if(t)return t.elements}},{key:"release",value:function(){p(c(i.prototype),"release",this).call(this),this.state.release()}}])}(KT),kC=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i},_C=function(t){function i(t,n){var r,a;return o(this,i),(r=e(this,i,[n,t,n.model]))._extensionChannel={},r._computeExChannel={},r._attributeContext=n.attributeContext,null===(a=n.map)||void 0===a||a.set(r.id,f(r)),r}return h(i,t),u(i,[{key:"created",value:function(){this._initStyle()}},{key:"initStyleWithSpec",value:function(t,e){t&&(pt(t.id)&&(this._userId=t.id),dt(t.interactive)&&(this._interactive=t.interactive),pt(t.zIndex)&&this.setZIndex(t.zIndex),dt(t.visible)&&this.setVisible(t.visible),this._initSpecStyle(t,this.stateStyle,e))}},{key:"_transformStyleValue",value:function(t,e){if(t.scale){var i=t.scale,n=i.range();return i.range(n.map(e)),t}return"function"==typeof t?function(){return e(t.apply(void 0,arguments))}:e(t)}},{key:"convertAngleToRadian",value:function(t){return this._transformStyleValue(t,Ie)}},{key:"isUserLevel",value:function(t){return[WT.User_Mark,WT.User_Series,WT.User_Chart,WT.User_SeriesStyle].includes(t)}},{key:"setStyle",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.stateStyle;if(!vt(t)){void 0===r[i]&&(r[i]={});var a=this.isUserLevel(n);Object.keys(t).forEach((function(o){var s=t[o];vt(s)||(s=e._filterAttribute(o,s,i,n,a,r),e.setAttribute(o,s,i,n,r))}))}}},{key:"getStyle",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";return null===(e=this.stateStyle[i][t])||void 0===e?void 0:e.style}},{key:"_filterAttribute",value:function(t,e,i,n,r){var a=this;arguments.length>5&&void 0!==arguments[5]||this.stateStyle;var o=this._styleConvert(e);if(r)switch(t){case"angle":o=this.convertAngleToRadian(o);break;case"innerPadding":case"outerPadding":o=this._transformStyleValue(o,(function(t){return-t}));break;case"curveType":o=this._transformStyleValue(o,(function(t){return e=t,i=a._option.model.direction,"monotone"===e?"horizontal"===i?"monotoneY":"monotoneX":e;var e,i}))}return o}},{key:"setReferer",value:function(t,e,i){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.stateStyle;if(t)if(e&&i){var a=null!==(n=r[i])&&void 0!==n?n:l({},e,{});r[i][e]=Object.assign(Object.assign({},a[e]),{referer:t})}else Object.entries(r).forEach((function(e){var i=g(e,2),n=i[0],a=i[1];Object.entries(a).forEach((function(e){var i=g(e,2),a=i[0];i[1],r[n][a].referer=t}))}))}},{key:"setPostProcess",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";(null===(i=this.stateStyle[n])||void 0===i?void 0:i[t])&&(this.stateStyle[n][t].postProcess=e)}},{key:"getAttribute",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",n=arguments.length>3?arguments[3]:void 0;return this._computeAttribute(t,i)(e,n)}},{key:"setAttribute",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.stateStyle;void 0===a[n]&&(a[n]={}),void 0===a[n][t]&&(a[n][t]={level:r,style:e,referer:void 0});var o=null===(i=a[n][t])||void 0===i?void 0:i.level;pt(o)&&o<=r&&TS(a[n][t],{style:e,level:r}),"normal"!==n&&t in this._extensionChannel&&this._extensionChannel[t].forEach((function(t){void 0===a[n][t]&&(a[n][t]=a.normal[t])}))}},{key:"_getDefaultStyle",value:function(){return{visible:!0,x:0,y:0}}},{key:"_styleConvert",value:function(t){if(!t)return t;if($b(t.type)||t.scale){var e=function(t,e){if("scale"in t&&t.scale)return _t(t.scale)&&(null==e?void 0:e.globalScale)?e.globalScale.registerMarkAttributeScale(t,e.seriesId):t.scale;var i=Hx(t.type);return i&&function(t,e){t&&e&&(e.domain&&t.domain(e.domain),e.range&&t.range(e.range),e.specified&&t.specified&&t.specified(e.specified))}(i,t),i}(t,{globalScale:this._option.globalScale,seriesId:this._option.seriesId});if(e)return{scale:e,field:t.field,changeDomain:t.changeDomain}}return t}},{key:"_computeAttribute",value:function(t,e){var i,n=this,r=null===(i=this.stateStyle[e])||void 0===i?void 0:i[t];r||(r=this.stateStyle.normal[t]);var a=this._computeStateAttribute(r,t,e),o=ft(null==r?void 0:r.postProcess),s=t in this._computeExChannel;if(o&&s){var u=this._computeExChannel[t];return function(i,o){var s=a(i,o);return s=r.postProcess(s,i,n._attributeContext,o,n.getDataView()),u(t,i,e,o,s)}}if(o)return function(t,e){return r.postProcess(a(t,e),t,n._attributeContext,e,n.getDataView())};if(s){var l=this._computeExChannel[t];return function(i,n){return l(t,i,e,n,a(i,n))}}return a}},{key:"_computeStateAttribute",value:function(t,e,i){var n,r=this;return t?t.referer?t.referer._computeAttribute(e,i):t.style?"function"==typeof t.style?function(e,i){return t.style(e,r._attributeContext,i,r.getDataView())}:cC.includes(t.style.gradient)?this._computeGradientAttr(t.style):["outerBorder","innerBorder"].includes(e)?this._computeBorderAttr(t.style):$b(null===(n=t.style.scale)||void 0===n?void 0:n.type)?function(e,i){return t.style.scale.scale(e[t.style.field])}:function(e,i){return t.style}:function(e,i){return t.style}:function(t,e){}}},{key:"_initStyle",value:function(){var t=this._getDefaultStyle();this.setStyle(t,"normal",0)}},{key:"_initSpecStyle",value:function(t,e,i){var n=this;t.style&&this.setStyle(t.style,"normal",WT.User_Mark,e);var r=t.state;r&&Object.keys(r).forEach((function(t){var i=r[t];if("style"in i){var a=i.style,o={stateValue:t};"level"in i&&(o.level=i.level),"filter"in i&&(o=ft(i.filter)?Object.assign({filter:i.filter},o):Object.assign(Object.assign({},i.filter),o)),n.state.addStateInfo(o),n.setStyle(a,t,WT.User_Mark,e)}else n.setStyle(i,t,WT.User_Mark,e)}))}},{key:"_computeGradientAttr",value:function(t){var e,i,n=this,r=t.gradient,a=t.scale,o=t.field,s=kC(t,["gradient","scale","field"]),u=a,l=o;if(!(a&&o||"series"!==this.model.modelType)){var h=this.model.getColorAttribute(),c=h.scale,d=h.field;a||(u=c),l||(l=d)}var f=jx(Fx(this.model.getColorScheme(),"series"===this.model.modelType?null===(i=(e=this.model).getSpec)||void 0===i?void 0:i.call(e):void 0),this.model.getDefaultColorDomain()),v=Object.assign(Object.assign({},dC[r]),s);return function(t,e){var i={},a=n.getDataView();return Object.keys(v).forEach((function(r){var o=v[r];"stops"===r?i.stops=o.map((function(i){var r=i.opacity,o=i.color,s=i.offset,h=null!=o?o:null==u?void 0:u.scale(t[l]);return ft(o)&&(h=o(t,n._attributeContext,e,a)),pt(r)&&(h=qe.SetOpacity(h,r)),{offset:ft(s)?s(t,n._attributeContext,e,a):s,color:h||f[0]}})):ft(o)?i[r]=o(t,n._attributeContext,e,a):i[r]=o})),i.gradient=r,i}}},{key:"_computeBorderAttr",value:function(t){var e=this,i=t.scale,n=t.field,r=kC(t,["scale","field"]);return function(t,a){var o,s,u,l={};if(Object.keys(r).forEach((function(i){var n=r[i];ft(n)?l[i]=n(t,e._attributeContext,a,e.getDataView()):l[i]=n})),"stroke"in l)cC.includes(null===(u=r.stroke)||void 0===u?void 0:u.gradient)&&(l.stroke=e._computeGradientAttr(r.stroke)(t,a));else{var h=jx(Fx(e.model.getColorScheme(),"series"===e.model.modelType?null===(s=(o=e.model).getSpec)||void 0===s?void 0:s.call(o):void 0),e.model.getDefaultColorDomain()),c=i,d=n;if(!(i&&n||"series"!==e.model.modelType)){var f=e.model.getColorAttribute(),v=f.scale,p=f.field;i||(c=v),d||(d=p),l.stroke=(null==c?void 0:c.scale(t[d]))||h[0]}}return l}}}])}(mC),bC=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type=i.type,t._marks=[],t}return h(i,t),u(i,[{key:"getMarks",value:function(){return this._marks}},{key:"_getDefaultStyle",value:function(){return Object.assign({},p(c(i.prototype),"_getDefaultStyle",this).call(this))}},{key:"isMarkExist",value:function(t){return void 0!==this._marks.find((function(e){return e.id===t.id||e.name===t.name}))}},{key:"addMark",value:function(t){return this.isMarkExist(t)?(Bb("Mark already exists, add mark failed."),!1):(this._marks.push(t),!0)}},{key:"removeMark",value:function(t){var e=this._marks.findIndex((function(e){return e.id===t.id||e.name===t.name}));return-1===e?(Bb("Mark does not exists, removeMark failed."),!1):(this._marks.splice(e,1),!0)}},{key:"getMarkInType",value:function(t){return this._marks.filter((function(e){return e.type===t}))}},{key:"getMarkInId",value:function(t){return this._marks.find((function(e){return e.id===t}))}},{key:"getMarkInName",value:function(t){return this._marks.find((function(e){return e.name===t}))}},{key:"_compileProduct",value:function(t){var e=this;p(c(i.prototype),"_compileProduct",this).call(this,t),this._product.configure({zIndex:this.getZIndex()}),(null==t?void 0:t.ignoreChildren)||this.getMarks().forEach((function(t){t.getProduct()&&t.removeProduct(),t.compile({group:e._product})}))}}])}(_C);bC.type="group";var xC={measureText:function(t,e,i,n){return sw(e,i,n).measure(t)}},SC=function(){function t(){o(this,t),this.functions={}}return u(t,[{key:"registerFunction",value:function(t,e){t&&e&&(this.functions[t]=e)}},{key:"unregisterFunction",value:function(t){t&&delete this.functions[t]}},{key:"getFunction",value:function(t){return this.functions[t]||null}},{key:"getFunctionNameList",value:function(){return Object.keys(this.functions)}}],[{key:"instance",value:function(){return t.instance_||(t.instance_=new t),t.instance_}}])}(),wC=function(t){function i(t){var n;return o(this,i),(n=e(this,i)).globalInstance=t,n}return h(i,t),u(i,[{key:"onInit",value:function(t){var e=this;this._plugins.forEach((function(i){i.onInit&&i.onInit(e,t)}))}},{key:"onBeforeResize",value:function(t,e){var i=this;this._plugins.forEach((function(n){n.onBeforeResize&&n.onBeforeResize(i,t,e)}))}},{key:"onAfterChartSpecTransform",value:function(t,e){var i=this;this._plugins.forEach((function(n){n.onAfterChartSpecTransform&&n.onAfterChartSpecTransform(i,t,e)}))}},{key:"onBeforeInitChart",value:function(t,e){var i=this;this._plugins.forEach((function(n){n.onBeforeInitChart&&n.onBeforeInitChart(i,t,e)}))}},{key:"releaseAll",value:function(){p(c(i.prototype),"releaseAll",this).call(this),this.globalInstance=null}}])}(function(){return u((function t(){o(this,t),this.id=Fb(),this._plugins=[]}),[{key:"add",value:function(t){var e=this;if(!t||0===t.length)return null;var i=[];return t.forEach((function(t){e._plugins.find((function(e){return e.id===t.id}))?Bb("不要重复添加相同的plugin"):(e._plugins.push(t),i.push(t),t.onAdd&&t.onAdd(e))})),i}},{key:"load",value:function(t){var e=this.add(t);e&&e.length&&this.activate(t)}},{key:"activate",value:function(t){t.length&&t.forEach((function(t){t.init&&t.init()}))}},{key:"get",value:function(t){return this._plugins.find((function(e){return e.id===t}))}},{key:"getAll",value:function(){return this._plugins.slice()}},{key:"release",value:function(t){var e=this.get(t);e&&(e.release(this),this._plugins=this._plugins.filter((function(t){return t!==e})))}},{key:"releaseAll",value:function(){var t=this;this._plugins.forEach((function(e){e.release(t)})),this._plugins=[]}},{key:"clear",value:function(t){var e=this.get(t);e&&e.clear(this)}},{key:"clearAll",value:function(){var t=this;this._plugins.forEach((function(e){var i;null===(i=e.clear)||void 0===i||i.call(e,t)}))}}])}()),AC=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}u((n=n.apply(t,e||[])).next())}))},TC=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i},CC=function(){function t(e,i){var n,r,a,s,u,l,h=this;o(this,t),this.id=Fb(),this._userEvents=[],this._autoSize=!0,this._option={mode:eb["desktop-browser"],onError:function(t){throw new Error(t)},optimize:{disableCheckGraphicWidthOutRange:!0}},this._observer=null,this._context={},this._onResize=ce((function(){h._doResize()}),100),this._renderSync=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=h;return h._beforeRender(e)?(null===(t=h._compiler)||void 0===t||t.render(e.morphConfig),h._afterRender(),i):i},this._updateSpec=function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0,a=h._spec,o={reTransformSpec:!1,change:!1,reMake:!1,reCompile:!1,reSize:!1,changeTheme:!1};if(h._setNewSpec(t,n)){Wt(a.theme,h._spec.theme)?Wt(h._spec.background,a.background)||(o.reMake=!0,o.changeBackground=!0):o.changeTheme=!0;var s=h._shouldChartResize(a);if(o.reSize=s,null===(i=null===(e=h._compiler)||void 0===e?void 0:e.getVGrammarView())||void 0===i||i.updateLayoutTag(),h._spec.type!==a.type)return o.reMake=!0,o.reTransformSpec=!0,o.change=!0,o.changeTheme=!0,o;h._initChartSpec(h._spec,"render");var u=LT(h._chart.updateSpec(h._spec),o);return r?Object.assign(Object.assign({},u),r):u}},this._option=zt(this._option,{animation:!1!==e.animation},i),this._onError=null===(n=this._option)||void 0===n?void 0:n.onError;var c=this._option,d=c.dom,f=c.renderCanvas,v=c.mode,p=c.stage,g=c.poptip,y=TC(c,["dom","renderCanvas","mode","stage","poptip"]),m=Ob(v);m?og(or):"node"===v&&Dy(or),m&&d&&(this._container=_t(d)?bf.getElementById(d):d),f&&(this._canvas=f),p&&(this._stage=p),"node"===v||this._container||this._canvas||this._stage?(this._viewBox=this._option.viewBox,this._currentThemeName=GS.getCurrentThemeName(),this._setNewSpec(e),this._updateCurrentTheme(),this._currentSize=this.getCurrentSize(),this._compiler=new BT({dom:null!==(a=this._container)&&void 0!==a?a:"none",canvas:f},Object.assign(Object.assign({mode:this._option.mode,stage:p,pluginList:!1!==g?["poptipForText"]:[]},y),{background:this._getBackground(),onError:this._onError})),this._compiler.setSize(this._currentSize.width,this._currentSize.height),this._eventDispatcher=new pT(this,this._compiler),this._event=new dT(this._eventDispatcher,v),this._compiler.initView(),this._setFontFamilyTheme(null===(s=this._currentTheme)||void 0===s?void 0:s.fontFamily),this._initDataSet(this._option.dataSet),this._autoSize=!!m&&(null===(l=null!==(u=e.autoFit)&&void 0!==u?u:this._option.autoFit)||void 0===l||l),this._bindResizeEvent(),this._bindVGrammarViewEvent(),this._initChartPlugin(),US.registerInstance(this)):null===(r=this._option)||void 0===r||r.onError("please specify container or renderCanvas!")}return u(t,[{key:"getSpec",value:function(){return this._spec}},{key:"getSpecInfo",value:function(){return this._specInfo}},{key:"getDataSet",value:function(){return this._dataSet}},{key:"_setNewSpec",value:function(t,e){return!!t&&(_t(t)&&(t=JSON.parse(t)),e&&this._originalSpec&&(t=TS({},this._originalSpec,t)),this._originalSpec=t,this._spec=this._getSpecFromOriginalSpec(),!0)}},{key:"_getSpecFromOriginalSpec",value:function(){var t,e=VS(this._originalSpec);return e.data=null!==(t=e.data)&&void 0!==t?t:[],e}},{key:"_initChartSpec",value:function(e,i){var n,r;t.getFunctionList()&&t.getFunctionList().length&&(e=HS(e,t)),this._spec=e,this._chartSpecTransformer||(this._chartSpecTransformer=ES.createChartSpecTransformer(this._spec.type,this._getChartOption(this._spec.type))),null===(n=this._chartSpecTransformer)||void 0===n||n.transformSpec(this._spec),this._chartPluginApply("onAfterChartSpecTransform",this._spec,i),this._specInfo=null===(r=this._chartSpecTransformer)||void 0===r?void 0:r.transformModelSpec(this._spec),this._chartPluginApply("onAfterModelSpecTransform",this._spec,this._specInfo,i)}},{key:"_updateSpecInfo",value:function(){var t;this._chartSpecTransformer||(this._chartSpecTransformer=ES.createChartSpecTransformer(this._spec.type,this._getChartOption(this._spec.type))),this._specInfo=null===(t=this._chartSpecTransformer)||void 0===t?void 0:t.createSpecInfo(this._spec)}},{key:"_initChart",value:function(t){var e,i,n;if(this._compiler)if(this._chart)null===(i=this._option)||void 0===i||i.onError("chart is already initialized");else{var r=ES.createChart(t.type,t,this._getChartOption(t.type));r?(this._chart=r,this._chart.setCanvasRect(this._currentSize.width,this._currentSize.height),this._chart.created(),this._chart.init(),this._event.emit(UA.initialized,{chart:r,vchart:this})):null===(n=this._option)||void 0===n||n.onError("init chart fail")}else null===(e=this._option)||void 0===e||e.onError("compiler is not initialized")}},{key:"_releaseData",value:function(){this._dataSet&&(this._dataSet.dataViewMap={},this._dataSet=null)}},{key:"_bindVGrammarViewEvent",value:function(){var t=this;this._compiler&&(this._compiler.getVGrammarView().addEventListener(rw.ALL_ANIMATION_END,(function(){t._event.emit(UA.animationFinished,{chart:t._chart,vchart:t})})),this._compiler.getVGrammarView().addEventListener(rw.AFTER_VRENDER_NEXT_RENDER,(function(){t._event.emit(UA.renderFinished,{chart:t._chart,vchart:t})})))}},{key:"_bindResizeEvent",value:function(){var t;if(this._autoSize){if(this._container){var e=window.ResizeObserver;e&&(this._observer=new e(this._onResize),null===(t=this._observer)||void 0===t||t.observe(this._container))}window.addEventListener("resize",this._onResize)}}},{key:"_unBindResizeEvent",value:function(){this._autoSize&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}},{key:"getCurrentSize",value:function(){var t,e,i,n;return IT(this._spec,{container:this._container,canvas:this._canvas,mode:this._getMode(),modeParams:this._option.modeParams},{width:null!==(e=null===(t=this._currentSize)||void 0===t?void 0:t.width)&&void 0!==e?e:rS,height:null!==(n=null===(i=this._currentSize)||void 0===i?void 0:i.height)&&void 0!==n?n:aS})}},{key:"_doResize",value:function(){var t=this.getCurrentSize(),e=t.width,i=t.height;this._currentSize.width===e&&this._currentSize.height===i||(this._currentSize={width:e,height:i},this.resizeSync(e,i))}},{key:"_initDataSet",value:function(t){for(var e in this._dataSet=t instanceof Tb?t:new Tb,yT(this._dataSet,"dataview",Sb),yT(this._dataSet,"array",nb),gT(this._dataSet,"copyDataView",ST),ES.transforms)gT(this._dataSet,e,ES.transforms[e]);for(var i in ES.dataParser)yT(this._dataSet,i,ES.dataParser[i])}},{key:"updateCustomConfigAndRerender",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this._isReleased&&t)return ft(t)&&(t=t()),t.reAnimate&&(this.stopAnimation(),this._updateAnimateState(!0)),this._reCompile(t),e?this._renderSync(i):this._renderAsync(i)}},{key:"_updateCustomConfigAndRecompile",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!t&&(this._reCompile(t),this._beforeRender(e))}},{key:"_reCompile",value:function(t,e){var i,n,r,a,o,s,u,l,h,c,d=this;if(t.reMake)this._releaseData(),this._initDataSet(),this._chartSpecTransformer=null,null===(i=this._chart)||void 0===i||i.release(),this._chart=null,t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(n=this._currentTheme)||void 0===n?void 0:n.fontFamily)):t.changeBackground&&(null===(r=this._compiler)||void 0===r||r.setBackground(this._getBackground())),null===(a=this._compiler)||void 0===a||a.releaseGrammar(!1===(null===(o=this._option)||void 0===o?void 0:o.animation)||!1===(null===(s=this._spec)||void 0===s?void 0:s.animation)),this._userEvents.forEach((function(t){var e;return null===(e=d._event)||void 0===e?void 0:e.on(t.eType,t.query,t.handler)})),t.reSize&&this._doResize();else if(t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(u=this._currentTheme)||void 0===u?void 0:u.fontFamily)):t.changeBackground&&(null===(l=this._compiler)||void 0===l||l.setBackground(this._getBackground())),t.reCompile&&(null===(h=this._compiler)||void 0===h||h.clear({chart:this._chart,vChart:this},!this._option.animation||!this._spec.animation),null===(c=this._compiler)||void 0===c||c.compile({chart:this._chart,vChart:this},{})),t.reSize){var f=this.getCurrentSize(),v=f.width,p=f.height;this._chart.onResize(v,p,!1),this._compiler.resize(v,p,!1)}}},{key:"_beforeRender",value:function(){var t,e,i,n,r,a,o,s,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._isReleased)return!1;if(this._chart)return!0;var l=u.transformSpec,h=u.actionSource;return l&&this._initChartSpec(this._spec,"render"),this._chartPluginApply("onBeforeInitChart",this._spec,h),null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeInitializeChart)||void 0===e||e.call(t),this._initChart(this._spec),null===(n=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterInitializeChart)||void 0===n||n.call(i),!(!this._chart||!this._compiler||(null===(a=null===(r=this._option.performanceHook)||void 0===r?void 0:r.beforeCompileToVGrammar)||void 0===a||a.call(r),this._compiler.compile({chart:this._chart,vChart:this},{performanceHook:this._option.performanceHook}),null===(s=null===(o=this._option.performanceHook)||void 0===o?void 0:o.afterCompileToVGrammar)||void 0===s||s.call(o),0))}},{key:"_afterRender",value:function(){return!this._isReleased&&(this._updateAnimateState(),this._event.emit(UA.rendered,{chart:this._chart,vchart:this}),!0)}},{key:"renderSync",value:function(t){return this._renderSync({morphConfig:t,transformSpec:!0,actionSource:"render"})}},{key:"renderAsync",value:function(t){return AC(this,void 0,void 0,n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._renderAsync({morphConfig:t,transformSpec:!0,actionSource:"render"}));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"_renderAsync",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return AC(this,void 0,void 0,n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._renderSync(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"_updateAnimateState",value:function(t){var e,i;if(this._option.animation){var n=t?bT.appear:bT.update;null===(e=this._chart)||void 0===e||e.getAllRegions().forEach((function(t){var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(n,!0)})),null===(i=this._chart)||void 0===i||i.getAllComponents().forEach((function(t){var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(n,!0)}))}}},{key:"release",value:function(){var t,e,i,n;(null===(t=this._onResize)||void 0===t?void 0:t.cancel)&&this._onResize.cancel(),this._chartPluginApply("releaseAll"),this._chartPlugin=null,this._chartSpecTransformer=null,null===(e=this._chart)||void 0===e||e.release(),null===(i=this._eventDispatcher)||void 0===i||i.release(),null===(n=this._compiler)||void 0===n||n.release(),this._unBindResizeEvent(),this._releaseData(),this._onError=null,this._onResize=null,this._container=null,this._currentTheme=null,this._option=null,this._chart=null,this._compiler=null,this._spec=null,this._specInfo=null,this._originalSpec=null,this._userEvents=null,this._event=null,this._eventDispatcher=null,this._isReleased=!0,US.unregisterInstance(this)}},{key:"updateData",value:function(t,e,i,r){return AC(this,void 0,void 0,n().mark((function a(){return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.updateDataSync(t,e,i,r));case 1:case"end":return n.stop()}}),a,this)})))}},{key:"_updateDataById",value:function(t,e,i){var n=this._spec.data.find((function(e){return e.name===t||e.id===t}));n?n.id===t?n.values=e:n.name===t&&n.parse(e,i):bt(e)?this._spec.data.push({id:t,values:e}):this._spec.data.push(e)}},{key:"updateDataInBatches",value:function(t){return AC(this,void 0,void 0,n().mark((function e(){var i=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._chart?(this._chart.updateFullData(t.map((function(t){return{id:t.id,values:t.data,parser:t.options}}))),this._chart.updateGlobalScaleDomain(),this._compiler.render(),this):(this._spec.data=Kt(this._spec.data),t.forEach((function(t){var e=t.id,n=t.data,r=t.options;i._updateDataById(e,n,r)})),this));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"updateDataSync",value:function(t,e,i,n){return vt(this._dataSet)?this:this._chart?((null==n?void 0:n.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateData(t,e,!0,i),this._compiler.render(),this):(this._spec.data=Kt(this._spec.data),this._updateDataById(t,e,i),this)}},{key:"updateFullDataSync",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;if(this._chart)return(null==n?void 0:n.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateFullData(t),i&&this._compiler.render(),this;var r=Kt(this._spec.data);return Kt(t).forEach((function(t){var i,n=t.id,a=t.values,o=t.parser,s=t.fields,u=r.find((function(t){return t.name===n}));if(u)u instanceof Eb?(u.setFields(Dt(s)),u.parse(a,Dt(o))):(u.values=a,pt(o)&&(u.parser=o),pt(s)&&(u.fields=s));else{var l=wT(t,e._dataSet,r,{onError:null===(i=e._option)||void 0===i?void 0:i.onError});bt(e._spec.data)&&e._spec.data.push(l)}})),this}},{key:"updateFullData",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return AC(this,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.updateFullDataSync(t,e));case 1:case"end":return i.stop()}}),i,this)})))}},{key:"updateSpec",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return AC(this,void 0,void 0,n().mark((function a(){var o;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(o=this._updateSpec(t,e,r))){n.next=7;break}return n.next=4,this.updateCustomConfigAndRerender(o,!1,{morphConfig:i,transformSpec:o.reTransformSpec,actionSource:"updateSpec"});case 4:n.t0=this,n.next=8;break;case 7:n.t0=this;case 8:return n.abrupt("return",n.t0);case 9:case"end":return n.stop()}}),a,this)})))}},{key:"updateSpecSync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=this._updateSpec(t,e,n);return r?(this.updateCustomConfigAndRerender(r,!0,{morphConfig:i,transformSpec:r.reTransformSpec,actionSource:"updateSpec"}),this):this}},{key:"updateSpecAndRecompile",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this._updateSpec(t,e);return this._updateCustomConfigAndRecompile(n,Object.assign({actionSource:"updateSpecAndRecompile"},i))}},{key:"updateModelSpec",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return AC(this,void 0,void 0,n().mark((function a(){var o;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e&&this._spec){n.next=2;break}return n.abrupt("return",this);case 2:if(_t(e)&&(e=JSON.parse(e)),ft(t)||CS(this._spec,t,e,i),!this._chart){n.next=6;break}if(!(o=this._chart.getModelInFilter(t))){n.next=6;break}return n.abrupt("return",this._updateModelSpec(o,e,!1,i,r));case 6:return n.abrupt("return",this);case 7:case"end":return n.stop()}}),a,this)})))}},{key:"updateModelSpecSync",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0;if(!e||!this._spec)return this;if(_t(e)&&(e=JSON.parse(e)),ft(t)||CS(this._spec,t,e,i),this._chart){var r=this._chart.getModelInFilter(t);if(r)return this._updateModelSpec(r,e,!0,i,n)}return this}},{key:"_updateModelSpec",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>4?arguments[4]:void 0;arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&(e=TS({},t.getSpec(),e));var r=t.updateSpec(e);return t.reInit(e),(r.change||r.reCompile||r.reMake||r.reSize||r.reRender)&&this._chart.reDataFlow(),this.updateCustomConfigAndRerender(r,i,{morphConfig:n,transformSpec:!1,actionSource:"updateModelSpec"})}},{key:"resize",value:function(t,e){return AC(this,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.resizeSync(t,e));case 1:case"end":return i.stop()}}),i,this)})))}},{key:"resizeSync",value:function(t,e){var i,n;return this._beforeResize(t,e)?(null===(n=(i=this._compiler).resize)||void 0===n||n.call(i,t,e),this._afterResize()):this}},{key:"_beforeResize",value:function(t,e){var i,n,r,a;if(!this._chart||!this._compiler)return!1;var o=this._chart.getCanvasRect();return!(o&&o.width===t&&o.height===e||(this._chartPluginApply("onBeforeResize",t,e),null===(n=null===(i=this._option.performanceHook)||void 0===i?void 0:i.beforeResizeWithUpdate)||void 0===n||n.call(i),this._chart.onResize(t,e,!1),null===(a=null===(r=this._option.performanceHook)||void 0===r?void 0:r.afterResizeWithUpdate)||void 0===a||a.call(r),0))}},{key:"_afterResize",value:function(){return this._isReleased||this._event.emit(UA.afterResize,{chart:this._chart}),this}},{key:"updateViewBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this._chart&&this._compiler?(this._viewBox=t,this._chart.updateViewBox(t,i),i&&(this._compiler.render(),this._chart.onEvaluateEnd()),this._compiler.updateViewBox(t,e),this):this}},{key:"on",value:function(t,e,i){var n;this._userEvents&&(this._userEvents.push({eType:t,query:"function"==typeof e?null:e,handler:"function"==typeof e?e:i}),null===(n=this._event)||void 0===n||n.on(t,e,i))}},{key:"off",value:function(t,e){var i,n=this;if(this._userEvents&&0!==this._userEvents.length)if(e){var r=this._userEvents.findIndex((function(i){return i.eType===t&&i.handler===e}));r>=0&&(this._userEvents.splice(r,1),null===(i=this._event)||void 0===i||i.off(t,e))}else this._userEvents.forEach((function(e){var i;e.eType===t&&(null===(i=n._event)||void 0===i||i.off(t,e.handler))})),this._userEvents=this._userEvents.filter((function(e){return e.eType!==t}))}},{key:"updateState",value:function(t,e){this._chart&&this._chart.updateState(t,e)}},{key:"setSelected",value:function(t,e,i){this._chart&&this._chart.setSelected(t,e,i)}},{key:"setHovered",value:function(t,e,i){this._chart&&this._chart.setHovered(t,e,i)}},{key:"clearState",value:function(t){this._chart&&this._chart.clearState(t)}},{key:"clearSelected",value:function(){this._chart&&this._chart.clearSelected()}},{key:"clearHovered",value:function(){this._chart&&this._chart.clearHovered()}},{key:"_updateCurrentTheme",value:function(t){var e,i,n,r,a,o,s,u,l=this._option.theme,h=null===(e=this._spec)||void 0===e?void 0:e.theme,c=null===(i=this._spec)||void 0===i?void 0:i.type;if(t&&(this._currentThemeName=t),Pt(l)&&Pt(h))s=WS(this._currentThemeName,!0),this._currentTheme=BS({},s,null===(a=s.chart)||void 0===a?void 0:a[c]);else if(_t(l)&&(!h||_t(h))||_t(h)&&(!l||_t(l))){var d=BS({},s=WS(this._currentThemeName,!0),null===(n=s.chart)||void 0===n?void 0:n[c],WS(l,!0),WS(h,!0));this._currentTheme=d}else{var f=BS({},s=WS(this._currentThemeName),null===(r=s.chart)||void 0===r?void 0:r[c],WS(l),WS(h));this._currentTheme=PS(f)}u=Ot(this._currentTheme,"component.poptip"),zt(qb.poptip,Yb,u),null===(o=this._compiler)||void 0===o||o.setBackground(this._getBackground())}},{key:"_shouldChartResize",value:function(t){var e,i,n=!1;vt(this._spec.width)?!vt(t.width)&&(this._spec.width=t.width):this._spec.width!==t.width&&(n=!0),vt(this._spec.height)?!vt(t.height)&&(this._spec.height=t.height):this._spec.height!==t.height&&(n=!0);var r=this._autoSize;return this._autoSize=!!Ob(this._option.mode)&&(null===(i=null!==(e=this._spec.autoFit)&&void 0!==e?e:this._option.autoFit)||void 0===i||i),this._autoSize!==r&&(n=!0),n}},{key:"_getBackground",value:function(){return("string"==typeof this._spec.background||gt(this._spec.background)&&this._spec.background.gradient?this._spec.background:null)||this._currentTheme.background||this._option.background}},{key:"getCurrentTheme",value:function(){return WS(this._currentThemeName)}},{key:"getCurrentThemeName",value:function(){return this._currentThemeName}},{key:"setCurrentTheme",value:function(t){var e;return AC(this,void 0,void 0,n().mark((function i(){var r;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(GS.themeExist(t)){i.next=2;break}return i.abrupt("return",this);case 2:return r=this._setCurrentTheme(t),this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),i.next=6,this.updateCustomConfigAndRerender(r,!1,{transformSpec:!1,actionSource:"setCurrentTheme"});case 6:return i.abrupt("return",this);case 7:case"end":return i.stop()}}),i,this)})))}},{key:"setCurrentThemeSync",value:function(t){var e;if(!GS.themeExist(t))return this;var i=this._setCurrentTheme(t);return this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),this.updateCustomConfigAndRerender(i,!0,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}},{key:"_setCurrentTheme",value:function(t){var e;return this._updateCurrentTheme(t),this._initChartSpec(this._getSpecFromOriginalSpec(),"setCurrentTheme"),null===(e=this._chart)||void 0===e||e.setCurrentTheme(),{change:!0,reMake:!1}}},{key:"_setFontFamilyTheme",value:function(t){var e;t&&(null===(e=this.getStage())||void 0===e||e.setTheme({text:{fontFamily:t}}))}},{key:"_getTooltipComponent",value:function(){var t;return null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(ib.tooltip)[0]}},{key:"setTooltipHandler",value:function(t){var e,i;this._context.tooltipHandler=t;var n=this._getTooltipComponent();n&&(null===(i=null===(e=n.tooltipHandler)||void 0===e?void 0:e.release)||void 0===i||i.call(e),n.tooltipHandler=t)}},{key:"getTooltipHandlerByUser",value:function(){var t;return null===(t=this._context)||void 0===t?void 0:t.tooltipHandler}},{key:"getTooltipHandler",value:function(){var t=this._getTooltipComponent();return t?t.tooltipHandler:this._context.tooltipHandler}},{key:"showTooltip",value:function(t,e){var i,n=this._getTooltipComponent();return null!==(i=pt(t)&&"none"!==(null==n?void 0:n.showTooltip(t,e)))&&void 0!==i&&i}},{key:"hideTooltip",value:function(){var t,e=this._getTooltipComponent();return null!==(t=null==e?void 0:e.hideTooltip())&&void 0!==t&&t}},{key:"getLegendDataById",value:function(t){var e,i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getLegendData():[]}},{key:"getLegendDataByIndex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(ib.discreteLegend);return i&&i[e]?i[e].getLegendData():[]}},{key:"getLegendSelectedDataById",value:function(t){var e,i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getSelectedData():[]}},{key:"getLegendSelectedDataByIndex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(ib.discreteLegend);return i&&i[e]?i[e].getSelectedData():[]}},{key:"setLegendSelectedDataById",value:function(t,e){var i,n=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);n&&n.setSelectedData(e)}},{key:"setLegendSelectedDataByIndex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0,n=null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(ib.discreteLegend);n&&n[e]&&n[e].setSelectedData(i)}},{key:"getDataURL",value:function(){var t;return AC(this,void 0,void 0,n().mark((function e(){var i,r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.getStage(),!this._chart||!i){e.next=7;break}return i.render(),r=this._chart.getCanvas(),e.next=6,OT(r,{onError:this._onError});case 6:return e.abrupt("return",e.sent);case 7:return e.abrupt("return",(null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined")),null));case 8:case"end":return e.stop()}}),e,this)})))}},{key:"exportImg",value:function(t){var e,i;return AC(this,void 0,void 0,n().mark((function r(){var a;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(Ob(this._option.mode)){n.next=2;break}return n.abrupt("return",void(null===(e=this._option)||void 0===e||e.onError(new TypeError("non-browser environment can not export img"))));case 2:return n.next=4,this.getDataURL();case 4:(a=n.sent)?MT(t,a):null===(i=this._option)||void 0===i||i.onError(new ReferenceError("render is not defined"));case 6:case"end":return n.stop()}}),r,this)})))}},{key:"exportCanvas",value:function(){var t,e=this.getStage();if(this._chart&&e)return e.toCanvas();null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined"))}},{key:"getImageBuffer",value:function(){var t,e;if("node"===this._option.mode){var i=this.getStage();return i?(i.render(),i.window.getImageBuffer()):(null===(e=this._option)||void 0===e||e.onError(new ReferenceError("render is not defined")),null)}null===(t=this._option)||void 0===t||t.onError(new TypeError("getImageBuffer() now only support node environment."))}},{key:"setLayout",value:function(t){var e;this._option.layout=t,null===(e=this._chart)||void 0===e||e.setLayout(t)}},{key:"reLayout",value:function(){var t;null===(t=this._chart)||void 0===t||t.setLayoutTag(!0)}},{key:"getCompiler",value:function(){return this._compiler}},{key:"getChart",value:function(){return this._chart}},{key:"getStage",value:function(){return this._compiler.getStage()}},{key:"getCanvas",value:function(){var t;return null===(t=this._compiler)||void 0===t?void 0:t.getCanvas()}},{key:"getContainer",value:function(){var t,e;return pt(this._container)?this._container:(e=_t(this._canvas)?bf.getElementById(this._canvas):this._canvas,pt(e)?e.parentElement:null===(t=this.getCanvas())||void 0===t?void 0:t.parentElement)}},{key:"getComponents",value:function(){return this._chart.getAllComponents()}},{key:"getScale",value:function(t){var e,i=null===(e=this._chart)||void 0===e?void 0:e.getGlobalScale();return null==i?void 0:i.getScale(t)}},{key:"setDimensionIndex",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null===(e=this._chart)||void 0===e?void 0:e.setDimensionIndex(t,i)}},{key:"stopAnimation",value:function(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.stop()}},{key:"pauseAnimation",value:function(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.pause()}},{key:"resumeAnimation",value:function(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.resume()}},{key:"convertDatumToPosition",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;if(!this._chart)return null;if(Pt(t))return null;var a,o=i.seriesId,s=i.seriesIndex,u=void 0===s?0:s;if(pt(o)?a=this._chart.getSeriesInUserId(o):pt(u)&&(a=null===(e=this._chart.getSeriesInIndex([u]))||void 0===e?void 0:e[0]),a){var l,h=Object.keys(t),c=a.getViewData().latestData.find((function(e){return h.every((function(i){return e[i]==t[i]}))})),d=a.getRegion().getLayoutStartPoint();return(l=c?a.dataToPosition(c,r):a.dataToPosition(t,r))?Zx(l,d,n):null}return null}},{key:"convertValueToPosition",value:function(t,e){var i,n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this._chart||vt(t)||Pt(e))return null;if(!bt(t)){var a,o=e.axisId,s=e.axisIndex;if(pt(o)?a=this._chart.getComponentsByKey("axes").find((function(t){return t.userId===o})):pt(s)&&(a=null===(i=this._chart.getComponentsByKey("axes"))||void 0===i?void 0:i[s]),!a)return Bb("Please check whether the `axisId` or `axisIndex` is set!"),null;var u=null==a?void 0:a.valueToPosition(t);if(r){var l=a.getLayoutStartPoint(),h=a.getOrient();return u+("bottom"===h||"top"===h?l.x:l.y)}return u}var c,d=e.seriesId,f=e.seriesIndex;return pt(d)?c=this._chart.getSeriesInUserId(d):pt(f)&&(c=null===(n=this._chart.getSeriesInIndex([f]))||void 0===n?void 0:n[0]),c?Zx(c.valueToPosition(t[0],t[1]),c.getRegion().getLayoutStartPoint(),r):(Bb("Please check whether the `seriesId` or `seriesIndex` is set!"),null)}},{key:"getFunction",value:function(t){return SC.instance().getFunction(t)}},{key:"registerFunction",value:function(t,e){t&&e&&SC.instance().registerFunction(t,e)}},{key:"unregisterFunction",value:function(t){t&&SC.instance().unregisterFunction(t)}},{key:"getFunctionList",value:function(){return SC.instance().getFunctionNameList()}},{key:"setRuntimeSpec",value:function(t){this._spec=t,this._updateSpecInfo()}},{key:"updateIndicatorDataById",value:function(t,e){var i,n=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);n&&n.updateDatum(e)}},{key:"updateIndicatorDataByIndex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0,n=null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(ib.indicator);n&&n[e]&&n[e].updateDatum(i)}},{key:"geoZoomByIndex",value:function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,a=null===(t=this._chart)||void 0===t?void 0:t.getRegionsInQuerier({regionIndex:i})[0],o=null===(e=this._chart)||void 0===e?void 0:e.getComponentsByType(ib.geoCoordinate),s=null==o?void 0:o.find((function(t){var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));s&&s.dispatchZoom(n,r)}},{key:"geoZoomById",value:function(t,e,i){var n,r,a=null===(n=this._chart)||void 0===n?void 0:n.getRegionsInQuerier({regionId:t})[0],o=null===(r=this._chart)||void 0===r?void 0:r.getComponentsByType(ib.geoCoordinate),s=null==o?void 0:o.find((function(t){var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));s&&s.dispatchZoom(e,i)}},{key:"_initChartPlugin",value:function(){var t=ES.getChartPlugins();t.length>0&&(this._chartPlugin=new wC(this),this._chartPlugin.load(t.map((function(t){return new t}))),this._chartPluginApply("onInit",this._spec))}},{key:"_chartPluginApply",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];this._chartPlugin&&this._chartPlugin[t]&&this._chartPlugin[t].apply(this._chartPlugin,i)}},{key:"_getMode",value:function(){return this._option.mode||eb["desktop-browser"]}},{key:"_getChartOption",value:function(t){var e=this;return{type:t,globalInstance:this,eventDispatcher:this._eventDispatcher,dataSet:this._dataSet,container:this._container,canvas:this._canvas,map:new Map,mode:this._getMode(),modeParams:this._option.modeParams,getCompiler:function(){return e._compiler},performanceHook:this._option.performanceHook,viewBox:this._viewBox,animation:this._option.animation,getTheme:function(){var t;return null!==(t=e._currentTheme)&&void 0!==t?t:{}},getSpecInfo:function(){var t;return null!==(t=e._specInfo)&&void 0!==t?t:{}},layout:this._option.layout,onError:this._onError,disableTriggerEvent:!0===this._option.disableTriggerEvent}}}],[{key:"useRegisters",value:function(t){t.forEach((function(t){"function"==typeof t?t():console.error("Invalid function:",t)}))}},{key:"useChart",value:function(t){t.forEach((function(t){return ES.registerChart(t.type,t)}))}},{key:"useSeries",value:function(t){t.forEach((function(t){return ES.registerSeries(t.type,t)}))}},{key:"useComponent",value:function(t){t.forEach((function(t){return ES.registerComponent(t.type,t)}))}},{key:"useMark",value:function(t){t.forEach((function(t){var e;return ES.registerMark(null!==(e=t.constructorType)&&void 0!==e?e:t.type,t)}))}},{key:"useLayout",value:function(t){t.forEach((function(t){return ES.registerLayout(t.type,t)}))}},{key:"registerDataSetTransform",value:function(t,e){ES.registerTransform(t,e)}},{key:"registerFunction",value:function(t,e){t&&e&&SC.instance().registerFunction(t,e)}},{key:"unregisterFunction",value:function(t){t&&SC.instance().unregisterFunction(t)}},{key:"getFunction",value:function(t){return t?SC.instance().getFunction(t):null}},{key:"getFunctionList",value:function(){return SC.instance().getFunctionNameList()}},{key:"registerMap",value:function(t,e,i){var n=ES.getImplementInKey("registerMap");n&&n(t,e,i)}},{key:"unregisterMap",value:function(t){var e=ES.getImplementInKey("unregisterMap");e&&e(t)}},{key:"getMap",value:function(t){return e=t,mT.get(e);var e}},{key:"hideTooltip",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];US.forEach((function(t){var e;return null===(e=null==t?void 0:t.hideTooltip)||void 0===e?void 0:e.call(t)}),t)}},{key:"getLogger",value:function(){return te.getInstance()}}])}();CC.InstanceManager=US,CC.ThemeManager=GS,CC.globalConfig={uniqueTooltip:!0},CC.Utils=xC,CC.vglobal=bf,ES.registerRegion("region",iC),ES.registerLayout("base",hC),qk(),Mk(),Mw.registerGraphic(YS.group,To),ES.registerMark(bC.type,bC),XA.useRegisters([function(){Mw.registerStageEventPlugin("gesture",Rp)}]),Ht(Xw,Yw),Mw.registerInteraction(Xw.type,Xw),Ht(Kw,Yw),Mw.registerInteraction(Kw.type,Kw),jS(wS.name,wS),te.getInstance(Jt.Error);var EC=function(){return u((function t(e,i){o(this,t),this._dataArr=[],this._onError=i,this._dataSet=e}),[{key:"dataList",get:function(){return this._dataArr}},{key:"parseData",value:function(t){this._dataArr=[];for(var e=Kt(t),i=0;i<e.length;i++)this._dataArr.push(wT(e[i],this._dataSet,this._dataArr,{onError:this._onError}))}},{key:"updateData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Kt(t);return!(e&&n.length!==this._dataArr.length||(this._dataValueForEach(n,(function(t,e){e.markRunning()})),this._dataValueForEach(n,(function(t,e){AT(e,t,i)})),0))}},{key:"_dataValueForEach",value:function(t,e){var i=this;t.forEach((function(t,n){if(!(t instanceof Eb)){var r=i.getSeriesData(t.id,n);r&&e(t,r,n)}}))}},{key:"getSeriesData",value:function(t,e){var i,n;if(!this._dataArr.length)return null;if("string"==typeof t){var r=this._dataArr.filter((function(e){return e.name===t}));return r[0]?r[0]:(null===(i=this._onError)||void 0===i||i.call(this,"no data matches dataId ".concat(t,"!")),null)}return"number"==typeof e?this._dataArr[e]?this._dataArr[e]:(null===(n=this._onError)||void 0===n||n.call(this,"no data matches dataIndex ".concat(e,"!")),null):this._dataArr[0]}}])}(),BC=function(){return u((function t(e,i){var n=this;o(this,t),this._scaleSpecMap=new Map,this._scaleMap=new Map,this._modelScaleSpecMap=new Map,this._markAttributeScaleMap=new Map,this._spec=null,this._chart=null,this.getStatisticalFields=function(t){var e=[];return n._scaleSpecMap.forEach((function(i,n){jb(i.domain)&&i.domain.forEach((function(n){n.dataId===t&&n.fields.forEach((function(t){uw(e,[{key:t,operations:Jb(i.type)?["max","min"]:["values"]}])}))}))})),n._markAttributeScaleMap.forEach((function(i,r){var a=n.getScale(r);i.forEach((function(i){n._getSeriesBySeriesId(i.seriesId).getRawData().name===t&&i.field&&uw(e,[{key:i.field,operations:Jb(a.type)?["max","min"]:["values"]}])}))})),e},this._spec=e,this._chart=i,this._setAttrFromSpec()}),[{key:"_createFromSpec",value:function(t){if(!t.id)return null;var e=this._scaleMap.get(t.id);return e||(e="ordinal"===t.type&&"color"===t.id?Hx("colorOrdinal"):Hx(t.type)),e?(bt(t.range)&&e.range(t.range),bt(t.domain)&&(jb(t.domain)||e.domain(t.domain)),t.specified&&e.specified&&e.specified(t.specified),e):null}},{key:"_setAttrFromSpec",value:function(){var t,e=this;if(null===(t=this._spec)||void 0===t?void 0:t.length){var i=new Map,n=new Map;this._spec.forEach((function(t){var r=e._createFromSpec(t);r&&(i.set(t.id,r),n.set(t.id,t))})),this._modelScaleSpecMap.forEach((function(t){var r=e._createFromSpec(t);r&&(i.set(t.id,r),n.set(t.id,t))})),this._scaleSpecMap=n,this._scaleMap=i}}},{key:"updateSpec",value:function(t){var e=this,i={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(Wt(t,this._spec))return i;i.change=!0;for(var n,r=function(){var n=t[a],r=e._scaleMap.get(n.id);if(!r)return{v:(i.reMake=!0,i)};var o=e._spec.find((function(t){return t.id===n.id}));return o.id?o.type!==n.type?{v:(i.reMake=!0,i)}:(n.range&&!Wt(n.range,r.range())&&(r.range(n.range),i.reRender=!0),jb(n.domain)?i.reRender=!0:Wt(n.domain,r.domain())||(r.domain(n.domain),i.reRender=!0),void e._scaleSpecMap.set(n.id,n)):{v:(i.reMake=!0,i)}},a=0;a<t.length;a++)if(n=r())return n.v;return this._spec=t,i}},{key:"registerModelScale",value:function(t){var e=this._createFromSpec(t);e&&(this._modelScaleSpecMap.set(t.id,t),this._scaleSpecMap.set(t.id,t),this._scaleMap.set(t.id,e))}},{key:"removeModelScale",value:function(t){var e=this;this._modelScaleSpecMap.forEach((function(i){t(i)&&(e._modelScaleSpecMap.delete(i.id),e._scaleSpecMap.delete(i.id),e._scaleMap.delete(i.id))}))}},{key:"getScale",value:function(t){return this._scaleMap.get(t)}},{key:"getScaleSpec",value:function(t){return this._scaleSpecMap.get(t)}},{key:"_getSeriesByRawDataId",value:function(t){for(var e=this._chart.getAllSeries(),i=0;i<e.length;i++){var n=e[i];if(n.getRawData().name===t)return n}return null}},{key:"_getSeriesBySeriesId",value:function(t){for(var e=this._chart.getAllSeries(),i=0;i<e.length;i++){var n=e[i];if(n.id===t)return n}return null}},{key:"updateScaleDomain",value:function(t){var e=this;this._scaleSpecMap.forEach((function(i,n){var r=e._scaleMap.get(n);if(r){if(!jb(i.domain))return i.domain&&0!==i.domain.length||r.domain(t),void e._updateMarkScale(n,r,r.domain().slice());var a;a=Jb(i.type)?[null,null]:new Set,i.domain.forEach((function(t){var n=e._getSeriesByRawDataId(t.dataId);if(n){var r=Jb(i.type);t.fields.forEach((function(t){var e=n.getRawDataStatisticsByField(t,r);e&&(r?(vt(a[0])?a[0]=e.min:a[0]=Math.min(e.min,a[0]),vt(a[1])?a[1]=e.max:a[1]=Math.max(e.max,a[1])):e.values.forEach((function(t){a.add(t)})))}))}}));var o=a;Jb(i.type)||(a=Array.from(a)),r.domain(a),e._updateMarkScale(n,r,o)}}))}},{key:"_updateMarkScale",value:function(t,e,i){var n=this,r=this._markAttributeScaleMap.get(t);r&&0!==r.length&&r.forEach((function(t){if(t.field&&t.markScale&&t.markScale!==e)if(vt(t.changeDomain)||"none"===t.changeDomain||vt(t.seriesId))Jb(e.type)?t.markScale.domain(i):e.domain(Array.from(i));else{var r=n._getSeriesBySeriesId(t.seriesId),a=Jb(e.type),o=r.getRawDataStatisticsByField(t.field,a);if(!Pt(o))return"expand"===t.changeDomain?(a?(i[0]=Math.min(i[0],o.min),i[1]=Math.max(i[1],o.max)):(o.values.forEach((function(t){i.add(t)})),i=Array.from(i)),void t.markScale.domain(i)):void("replace"!==t.changeDomain||(a?t.markScale.domain([o.min,o.max]):t.markScale.domain(o.values)));Jb(e.type)?t.markScale.domain(i):e.domain(Array.from(i))}}))}},{key:"registerMarkAttributeScale",value:function(t,e){var i=this._scaleMap.get(t.scale),n=this._markAttributeScaleMap.get(t.scale);n||(n=[],this._markAttributeScaleMap.set(t.scale,n));var r=i;return(vt(t.field)||!vt(t.changeDomain)&&"none"!==t.changeDomain&&!vt(e))&&(r=i.clone()),n.push(Object.assign(Object.assign({},t),{seriesId:e,markScale:r})),r}}])}(),RC=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i},MC=function(t){function i(t,n){var r,a,s,u,l;return o(this,i),(r=e(this,i,[n])).type="chart",r.id=Fb(),r._regions=[],r._series=[],r._components=[],r._layoutRect={x:0,y:0,width:rS,height:aS},r._viewRect={width:rS,height:aS},r._viewBox={x1:0,y1:0,x2:rS,y2:aS},r._layoutTag=!0,r._idMap=new Map,r.state={layoutUpdateRank:1},r.padding={top:0,left:0,right:0,bottom:0},r.getAllSeries=function(){var t;return null!==(t=r._series)&&void 0!==t?t:[]},r.getRegionsInIndex=function(t){return t&&0!==t.length?r._regions.filter((function(e,i){return t.includes(i)})):[r._regions[0]]},r.getAllRegions=function(){return r._regions},r.getRegionsInIds=function(t){return t?r._regions.filter((function(e){return t.includes(e.id)})):[]},r.getRegionsInQuerier=function(t){return t?r._regions.filter((function(e,i){return Kt(t).some((function(t){return pt(t.regionId)&&t.regionId===e.userId||t.regionIndex===i}))})):r._regions},r.getRegionsInUserId=function(t){if(t)return r._regions.find((function(e){return e.userId===t}))},r.getRegionsInUserIdOrIndex=function(t,e){return r.getAllRegions().filter((function(i){return(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex())}))},r.getComponents=function(){return r._components},r.getSeriesInIndex=function(t){return t&&0!==t.length?r._series.filter((function(e,i){return t.includes(i)})):[r._series[0]]},r.getSeriesInIds=function(t){return t?r._series.filter((function(e){return t.includes(e.id)})):[]},r.getSeriesInUserId=function(t){if(t)return r._series.find((function(e){return e.userId===t}))},r.getSeriesInUserIdOrIndex=function(t,e){return r.getAllSeries().filter((function(i){return(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex())}))},r.getComponentByIndex=function(t,e){var i=r._components.filter((function(e){return(e.specKey||e.type)===t}));if(i&&0!==i.length)return i[e]},r.getComponentsByKey=function(t){return r._components.filter((function(e){return(e.specKey||e.type)===t}))},r.getComponentByUserId=function(t){var e=r._components.find((function(e){return e.userId===t}));if(e)return e},r.getComponentsByType=function(t){return r._components.filter((function(e){return e.type===t}))},r._paddingSpec=qx(null!==(a=t.padding)&&void 0!==a?a:n.getTheme().padding),r._event=new dT(n.eventDispatcher,n.mode),r._dataSet=n.dataSet,r._chartData=new EC(r._dataSet,null===(s=r._option)||void 0===s?void 0:s.onError),r._modelOption=Object.assign(Object.assign({},n),{mode:r._option.mode,map:r._idMap,getChartLayoutRect:function(){return r._layoutRect},getChartViewRect:function(){return r._viewRect},getChart:function(){return f(r)},globalScale:r._globalScale,onError:null===(u=r._option)||void 0===u?void 0:u.onError,disableTriggerEvent:!0===(null===(l=r._option)||void 0===l?void 0:l.disableTriggerEvent),getSeriesData:r._chartData.getSeriesData.bind(r._chartData)}),r._spec=t,r}return h(i,t),u(i,[{key:"getSpec",value:function(){return this._spec}},{key:"setSpec",value:function(t){this._spec=t}},{key:"getOption",value:function(){return this._option}},{key:"getLayoutRect",value:function(){return this._layoutRect}},{key:"getViewRect",value:function(){return this._viewRect}},{key:"getLayoutTag",value:function(){return this._layoutTag}},{key:"setLayoutTag",value:function(t,e){var i,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this._layoutTag=t,(null===(i=this.getCompiler())||void 0===i?void 0:i.getVGrammarView())&&(this.getCompiler().getVGrammarView().updateLayoutTag(),t&&n&&this.getCompiler().renderNextTick(e)),this._layoutTag}},{key:"getGlobalScale",value:function(){return this._globalScale}},{key:"getEvent",value:function(){return this._event}},{key:"chartData",get:function(){return this._chartData}},{key:"created",value:function(){this._transformer=new this.transformerConstructor(Object.assign(Object.assign({},this._option),{type:this.type,seriesType:this.seriesType})),this._chartData.parseData(this._spec.data),this._createGlobalScale(),this._createBackground(),this._createLayout(),this._transformer.forEachRegionInSpec(this._spec,this._createRegion.bind(this)),this._transformer.forEachSeriesInSpec(this._spec,this._createSeries.bind(this)),this._transformer.forEachComponentInSpec(this._spec,this._createComponent.bind(this),this._option.getSpecInfo())}},{key:"init",value:function(){var t,e,i=this;null===(t=this._beforeInit)||void 0===t||t.call(this),this._regions.forEach((function(t){return t.init({})})),this._series.forEach((function(t){return t.init({})})),this._components.forEach((function(t){return t.init({dataSet:i._dataSet})})),this._initEvent(),null===(e=this._initStack)||void 0===e||e.call(this),this.reDataFlow()}},{key:"reDataFlow",value:function(){this._series.forEach((function(t){var e;return null===(e=t.getRawData())||void 0===e?void 0:e.markRunning()})),this._series.forEach((function(t){return t.fillData()})),this.updateGlobalScaleDomain()}},{key:"onResize",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n={width:t,height:e};this._canvasRect=n,this._updateLayoutRect(this._option.viewBox),this.setLayoutTag(!0,null,i)}},{key:"updateViewBox",value:function(t,e){this._option.viewBox=t,this._updateLayoutRect(t),this.setLayoutTag(!0,null,e)}},{key:"_createBackground",value:function(){var t=this,e=this._spec.background;if(e&&"object"==a(e)&&!pt(e.gradient)){var i=function(t,e){if(!t||!mt(t))return t;var i={};return Object.keys(t).forEach((function(n){var r=t[n],a=!1;e.forEach((function(t){(_t(t)&&t===n||t instanceof RegExp&&n.match(t))&&(a=!0)})),a||(i[n]=r)})),i}(e,["x","y","width","height","x1","y1","image"]);i.background=e.image,this._backgroundMark=ES.createMark("group","chart-background",{model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._globalScale}),this._backgroundMark.created(),this._backgroundMark.setStyle(Object.assign(Object.assign({},i),{x:function(){return t._viewBox.x1},y:function(){return t._viewBox.y1},width:function(){return t._viewBox.x2-t._viewBox.x1},height:function(){return t._viewBox.y2-t._viewBox.y1}}))}}},{key:"_createRegion",value:function(t,e){if(t){var i=e.spec,n=RC(e,["spec"]),r=new t(i,Object.assign(Object.assign({},this._modelOption),n));r&&(r.created(),this._regions.push(r))}}},{key:"_createSeries",value:function(t,e){if(t){var i,n=e.spec,r=RC(e,["spec"]);if(pt(n.regionId)?i=this.getRegionsInUserId(n.regionId):pt(n.regionIndex)&&(i=this.getRegionsInIndex([n.regionIndex])[0]),i||(i=this._regions[0])){var a=new t(n,Object.assign(Object.assign(Object.assign({},this._modelOption),r),{type:n.type,region:i,globalScale:this._globalScale,sourceDataList:this._chartData.dataList}));a&&(a.created(),this._series.push(a),i.addSeries(a))}}}},{key:"getSeriesById",value:function(t){return this._series.find((function(e){return e.id===t}))}},{key:"_createComponent",value:function(t,e){var i=t.createComponent(e,Object.assign(Object.assign({},this._modelOption),{type:t.type,getAllRegions:this.getAllRegions,getRegionsInIndex:this.getRegionsInIndex,getRegionsInIds:this.getRegionsInIds,getRegionsInUserIdOrIndex:this.getRegionsInUserIdOrIndex,getAllSeries:this.getAllSeries,getSeriesInIndex:this.getSeriesInIndex,getSeriesInIds:this.getSeriesInIds,getSeriesInUserIdOrIndex:this.getSeriesInUserIdOrIndex,getAllComponents:this.getComponents,getComponentByIndex:this.getComponentByIndex,getComponentByUserId:this.getComponentByUserId,getComponentsByKey:this.getComponentsByKey,getComponentsByType:this.getComponentsByType}));i&&(i.created(),this._components.push(i))}},{key:"getAllComponents",value:function(){return this._components}},{key:"getAllModels",value:function(){return[].concat(this.getAllSeries(),this.getAllComponents(),this.getAllRegions())}},{key:"getModelInFilter",value:function(t){if(_t(t))return this.getAllModels().find((function(e){return e.userId===t}));if(ft(t))return this.getAllModels().find((function(e){return t(e)}));var e=0;return this.getAllModels().find((function(i){var n;if((null!==(n=i.specKey)&&void 0!==n?n:i.type)===t.type){if(e===t.index)return!0;e++}return!1}))}},{key:"_createLayout",value:function(){this._updateLayoutRect(this._option.viewBox),this._initLayoutFunc()}},{key:"setLayout",value:function(t){this._option.layout=t,this._initLayoutFunc()}},{key:"_initLayoutFunc",value:function(){var t,e,i;if(this._layoutFunc=this._option.layout,!this._layoutFunc){var n=!1;(this._spec.zField||this._spec.series&&this._spec.series.some((function(t){return t.zField})))&&(n=!0);var r=ES.getLayoutInKey(null!==(e=null===(t=this._spec.layout)||void 0===t?void 0:t.type)&&void 0!==e?e:n?"layout3d":"base");if(r){var a=new r(this._spec.layout,{onError:null===(i=this._option)||void 0===i?void 0:i.onError});this._layoutFunc=a.layoutItems.bind(a)}}}},{key:"layout",value:function(t){var e,i,n,r;if(null===(i=null===(e=this._option.performanceHook)||void 0===e?void 0:e.beforeLayoutWithSceneGraph)||void 0===i||i.call(e),this.getLayoutTag()){this._event.emit(UA.layoutStart,{chart:this,vchart:this._option.globalInstance}),this.onLayoutStart(t);var a=this.getLayoutElements();this._layoutFunc(this,a,this._layoutRect,this._viewBox),this._event.emit(UA.afterLayout,{elements:a,chart:this}),this.setLayoutTag(!1),this.onLayoutEnd(t),this._event.emit(UA.layoutEnd,{chart:this,vchart:this._option.globalInstance})}null===(r=null===(n=this._option.performanceHook)||void 0===n?void 0:n.afterLayoutWithSceneGraph)||void 0===r||r.call(n)}},{key:"onLayoutStart",value:function(t){var e=this;this.getAllModels().forEach((function(i){return i.onLayoutStart(e._layoutRect,e._viewRect,t)}))}},{key:"onLayoutEnd",value:function(t){this.getAllModels().forEach((function(e){"series"!==e.modelType&&e.onLayoutEnd(t)}))}},{key:"onEvaluateEnd",value:function(t){[].concat(y(this._components),y(this._regions),y(this._series)).forEach((function(e){return e.onEvaluateEnd(t)}))}},{key:"getLayoutElements",value:function(){return this.getAllModels().map((function(t){return t.layout})).filter((function(t){return!!t}))}},{key:"getModelById",value:function(t){var e=this._idMap.get(t);if(e&&e instanceof $T)return e}},{key:"getModelByUserId",value:function(t){var e=this.getSeriesInUserId(t);if(e)return e;var i=this.getRegionsInUserId(t);return i||(this.getComponentByUserId(t)||void 0)}},{key:"getAllMarks",value:function(){return Array.from(this._idMap.values()).filter((function(t){return t&&t instanceof _C}))}},{key:"getMarkById",value:function(t){var e=this._idMap.get(t);if(e&&e instanceof _C)return e}},{key:"updateData",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,r=this._dataSet.getDataView(t);r&&(r.markRunning(),r.parseNewData(e,n)),i&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((function(t){return t.onDataUpdate()}))}},{key:"updateFullData",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Kt(t).forEach((function(t){var i=e._dataSet.getDataView(t.id);i&&i.markRunning()})),Kt(t).forEach((function(t){var i=e._dataSet.getDataView(t.id);i&&AT(i,t,!0)})),i&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((function(t){return t.onDataUpdate()}))}},{key:"onRender",value:function(t){}},{key:"setCanvasRect",value:function(t,e){this._canvasRect={width:t,height:e}}},{key:"getCanvasRect",value:function(){return this._canvasRect||(this._canvasRect=IT(this._spec,this._option,{width:rS,height:aS})),this._canvasRect}},{key:"getSeriesData",value:function(t,e){return this._chartData.getSeriesData(t,e)}},{key:"_transformSpecScale",value:function(){var t,e=this._spec.scales?y(this._spec.scales):[],i=e.find((function(t){return"color"===t.id})),n=this.getColorScheme();if(!i&&(i={type:"ordinal",id:"color",domain:null,range:null},e.push(i),this._spec.color)){var r=this._spec.color;if(bt(r))i.range=r;else{var a=r;Object.prototype.hasOwnProperty.call(a,"type")&&(i.type=a.type),Object.prototype.hasOwnProperty.call(a,"domain")&&(i.domain=a.domain),Object.prototype.hasOwnProperty.call(a,"range")&&(i.range=a.range),Object.prototype.hasOwnProperty.call(a,"specified")&&(i.specified=a.specified)}}return(null===(t=i.range)||void 0===t?void 0:t.length)||(i.range=Fx(n),i.rangeTheme=!0),e}},{key:"_createGlobalScale",value:function(){this._globalScale=new BC(this._transformSpecScale(),this),this._modelOption.globalScale=this._globalScale}},{key:"updateGlobalScaleDomain",value:function(){var t=new Set;this._series.forEach((function(e){var i=e.getSeriesKeys();i&&i.forEach((function(e){return t.add(e)}))}));var e=Array.from(t);this._globalScale.updateScaleDomain(e)}},{key:"updateGlobalScale",value:function(t){LT(t,this._globalScale.updateSpec(this._transformSpecScale()))}},{key:"updateGlobalScaleTheme",value:function(){var t=this._globalScale.getScaleSpec("color"),e=this.getColorScheme();t.rangeTheme&&(t.range=Fx(e),this._globalScale.getScale("color").range(t.range))}},{key:"updateSpec",value:function(t){var e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(this.setLayoutTag(!0,null,!1),t.type!==this.type)return e.reMake=!0,e;var i=Object.keys(this._spec).sort(),n=Object.keys(t).sort();if(JSON.stringify(i)!==JSON.stringify(n))return e.reMake=!0,e;for(var r=0;r<i.length;r++){var a=i[r];if(bt(this._spec[a])&&this._spec[a].length!==t[a].length)return e.reMake=!0,e}var o=this._spec;return this._spec=t,this.updateChartConfig(e,o),e.reMake||(this.updateGlobalScale(e),e.reMake||(this.updateRegionSpec(e),e.reMake||(this.updateComponentSpec(e),e.reMake||(this.updateSeriesSpec(e),e.reMake||(this.reInit(),this.updateDataSpec(),this.updateGlobalScaleDomain()))))),e}},{key:"updateChartConfig",value:function(t,e){var i,n;this._paddingSpec=qx(null!==(i=this._spec.padding)&&void 0!==i?i:null===(n=this._option)||void 0===n?void 0:n.getTheme().padding),this._updateLayoutRect(this._viewBox)}},{key:"updateDataSpec",value:function(){this._spec.data&&this._chartData.updateData(this._spec.data,!1,!0)}},{key:"updateRegionSpec",value:function(t){var e,i=this;(null===(e=this._spec)||void 0===e?void 0:e.region)&&(this._spec.region.length===this._regions.length?this._regions.forEach((function(e){LT(t,e.updateSpec(i._spec.region[e.getSpecIndex()]))})):t.reMake=!0)}},{key:"updateComponentSpec",value:function(t){var e=this,i={};for(var n in this._components.forEach((function(n){var r,a;if(n.type!==ib.label&&n.type!==ib.totalLabel){var o=n.specKey||n.type,s=null!==(r=e._spec[o])&&void 0!==r?r:{};bt(s)?(i[o]=i[o]||{specCount:s.length,componentCount:0},i[o].componentCount++,LT(t,n.updateSpec(null!==(a=s[n.getSpecIndex()])&&void 0!==a?a:{},s))):LT(t,n.updateSpec(s))}})),i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];r.componentCount!==r.specCount&&(t.reMake=!0)}}},{key:"updateSeriesSpec",value:function(t){var e=this;this._spec.series.length===this._series.length?this._series.forEach((function(i){var n=e._spec.series[i.getSpecIndex()];LT(t,i.updateSpec(n))})):t.reMake=!0}},{key:"getCanvas",value:function(){var t,e;return null!==(e=null===(t=this.getCompiler())||void 0===t?void 0:t.getCanvas())&&void 0!==e?e:null}},{key:"_updateLayoutRect",value:function(t){var e=this.getCanvasRect();if(t){this._viewBox=t;var i=t.x1,n=void 0===i?0:i,r=t.y1,a=void 0===r?0:r;e={width:t.x2-n,height:t.y2-a}}else this._viewBox={x1:0,y1:0,x2:e.width,y2:e.height};this._viewRect=e,this.padding=Yx(this._paddingSpec,e,e),this._layoutRect.width=e.width-this.padding.left-this.padding.right,this._layoutRect.height=e.height-this.padding.top-this.padding.bottom,this._layoutRect.x=this.padding.left,this._layoutRect.y=this.padding.top,this._event.emit(UA.layoutRectUpdate,{chart:this})}},{key:"setCurrentTheme",value:function(){this.updateChartConfig({change:!0,reMake:!1},this._spec),this.setLayoutTag(!0,null,!1),this.updateGlobalScaleTheme(),this.reInit()}},{key:"reInit",value:function(){[].concat(y(this._regions),y(this._series),y(this._components)).forEach((function(t){var e=t.getSpecInfo();e&&e.spec&&t.reInit(e.spec)}))}},{key:"clear",value:function(){this.getAllModels().forEach((function(t){var e;return null===(e=t.clear)||void 0===e?void 0:e.call(t)}))}},{key:"compile",value:function(){this.compileBackground(),this.compileLayout(),this.compileRegions(),this.compileSeries(),this.compileComponents()}},{key:"afterCompile",value:function(){this.getAllRegions().forEach((function(t){var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllSeries().forEach((function(t){var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllComponents().forEach((function(t){var e;null===(e=t.afterCompile)||void 0===e||e.call(t)}))}},{key:"compileLayout",value:function(){var t=this.getCanvasRect(),e=t.width,i=t.height;this.getCompiler().setSize(e,i)}},{key:"compileBackground",value:function(){var t;this._backgroundMark&&(this._backgroundMark.compile(),null===(t=this._backgroundMark.getProduct())||void 0===t||t.configure({context:{model:this}}).layout((function(){})))}},{key:"compileRegions",value:function(){var t,e,i,n;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeRegionCompile)||void 0===e||e.call(t),this.getAllRegions().forEach((function(t){t.compile()})),null===(n=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterRegionCompile)||void 0===n||n.call(i)}},{key:"compileSeries",value:function(){var t,e,i,n;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeSeriesCompile)||void 0===e||e.call(t),this.getAllSeries().forEach((function(t){t.compile()})),null===(n=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterSeriesCompile)||void 0===n||n.call(i)}},{key:"compileComponents",value:function(){var t,e,i,n;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeComponentCompile)||void 0===e||e.call(t),this.getAllComponents().forEach((function(t){t.compile()})),null===(n=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterComponentCompile)||void 0===n||n.call(i)}},{key:"release",value:function(){[].concat(y(this._components),y(this._regions),y(this._series)).forEach((function(t){t.beforeRelease()})),p(c(i.prototype),"release",this).call(this),this.clear(),[].concat(y(this._components),y(this._regions),y(this._series)).forEach((function(t){t.release()})),this._components=this._regions=this._series=[],this._spec={},this._dataSet=this._globalScale=this._layoutFunc=null,this._layoutTag=!1,this._idMap.clear()}},{key:"onLayout",value:function(t){var e=t.rootMark;this.layout({group:e,srView:t})}},{key:"updateState",value:function(t,e){var i=this.getAllSeries(),n=function(n){if(Pt(t[n]))return 1;var r=t[n],a={stateValue:n};a=ft(r.filter)?Object.assign({filter:r.filter},a):Object.assign(Object.assign({},r.filter),a),r.level&&(a.level=r.level),i.forEach((function(t){t.getMarks().forEach((function(i){i.stateStyle[n]&&(e&&!e(t,i,n)||(i.state.changeStateInfo(a),i.updateMarkState(n)))}))}))};for(var r in t)n(r)}},{key:"setSelected",value:function(t,e,i){this._setStateInDatum(CT.STATE_SELECTED,!0,t,e,i)}},{key:"setHovered",value:function(t,e,i){this._setStateInDatum(CT.STATE_HOVER,!0,t,e,i)}},{key:"clearState",value:function(t){this.getAllRegions().forEach((function(e){e.interaction.clearEventElement(t,!0),e.interaction.resetInteraction(t,null)}))}},{key:"clearSelected",value:function(){this.clearState(CT.STATE_SELECTED)}},{key:"clearHovered",value:function(){this.clearState(CT.STATE_HOVER)}},{key:"_initEvent",value:function(){var t=this;[UA.dataZoomChange,UA.scrollBarChange].forEach((function(e){t._event.on(e,(function(e){e.value,t._disableMarkAnimation(["exit","update"]);t._event.on(rw.AFTER_MARK_RENDER_END,(function e(){t._enableMarkAnimation(["exit","update"]),t._event.off(rw.AFTER_MARK_RENDER_END,e)}))}))}))}},{key:"_enableMarkAnimation",value:function(t){this.getAllMarks().forEach((function(e){var i=e.getProduct();i&&i.animate&&i.animate.enableAnimationState(t)}))}},{key:"_disableMarkAnimation",value:function(t){this.getAllMarks().forEach((function(e){var i=e.getProduct();i&&i.animate&&i.animate.disableAnimationState(t)}))}},{key:"_setStateInDatum",value:function(t,e,i,n,r){var a=(i=i?Kt(i):null)?Object.keys(i[0]):null;this.getRegionsInQuerier(r).forEach((function(r){i?(r.getSeries().forEach((function(e){e.getMarks().forEach((function(o){if(o.getProduct()&&(!n||ft(n)&&n(e,o))){var s=o.getProduct().isCollectionMark(),u=o.getProduct().elements,l=[];if(s)l=u.filter((function(t){var e=t.getDatum();i.every((function(t,i){return a.every((function(n){return t[n]==e[i][n]}))}))}));else if(i.length>1){var h=i.slice();l=u.filter((function(t){if(0===h.length)return!1;var e=t.getDatum(),i=h.findIndex((function(t){return a.every((function(i){return t[i]==e[i]}))}));return i>=0&&(h.splice(i,1),!0)}))}else{var c=u.find((function(t){return a.every((function(e){return i[0][e]==t.getDatum()[e]}))}));c&&(l=[c])}l.forEach((function(e){r.interaction.startInteraction(t,e)}))}}))})),e&&r.interaction.reverseEventElement(t)):r.interaction.clearEventElement(t,!0)}))}},{key:"setDimensionIndex",value:function(t,e){var i,n,r,a,o=null;Array.from(this._event.getComposedEventMap().values()).forEach((function(i){var n=i.eventType,r=i.event;if(n===tT.dimensionHover||n===tT.dimensionClick){var a=r.dispatch(t,e);(null==a?void 0:a.length)&&(o=a)}}));var s=vt(t)||!o||o.every((function(t){return Qb(t.axis.getScale().type)&&vt(t.index)}));if(!1!==e.tooltip){var u=this.getComponentsByType(ib.tooltip)[0];if(null==u?void 0:u.getVisible())if(s)null===(n=(i=u).hideTooltip)||void 0===n||n.call(i);else{var l={};o.forEach((function(t){var e=t.axis,i=t.value,n=t.data,r="left"===e.getOrient()||"right"===e.getOrient();n.forEach((function(t){var e,n,a,o=r?t.series.fieldY[0]:t.series.fieldX[0];l[o]=null!==(a=null===(n=null===(e=t.datum)||void 0===e?void 0:e[0])||void 0===n?void 0:n[o])&&void 0!==a?a:i}))})),u.showTooltip(l,e.showTooltipOption)}}if(!1!==e.crosshair){var h=this.getComponentsByType(ib.cartesianCrosshair)[0];h&&h.clearAxisValue&&h.setAxisValue&&(s?(null===(r=h.clearAxisValue)||void 0===r||r.call(h),null===(a=h.hide)||void 0===a||a.call(h)):o.forEach((function(t){var e=t.axis,i=t.value;h.clearAxisValue(),h.setAxisValue(i,e),h.layoutByValue()})))}}},{key:"getColorScheme",value:function(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}}])}(HT),PC=function(t,e){var i,n=t.spec,r=n.regionId,a=n.regionIndex;if(pt(r)){var o=Kt(r);return null===(i=e.region)||void 0===i?void 0:i.filter((function(t){var e=t.spec;return o.includes(e.id)}))}if(pt(a))return Kt(a).map((function(t){var i;return null===(i=e.region)||void 0===i?void 0:i[t]})).filter(pt)},OC=function(){return u((function t(e){o(this,t),this._option=e,this.type=e.type,this.seriesType=e.seriesType}),[{key:"initChartSpec",value:function(t){return this.transformSpec(t),this.transformModelSpec(t)}},{key:"transformSpec",value:function(t){t.region&&0!==t.region.length||(t.region=[{}]),void 0===t.tooltip&&(t.tooltip={}),pt(t.stackInverse)&&t.region.forEach((function(e){!pt(e.stackInverse)&&(e.stackInverse=t.stackInverse)})),pt(t.stackSort)&&t.region.forEach((function(e){!pt(e.stackSort)&&(e.stackSort=t.stackSort)}))}},{key:"transformModelSpec",value:function(t){var e=this;return this.createSpecInfo(t,(function(i,n,r){var a=n.spec,o=n.specPath,s=n.specInfoPath,u=n.type,l=new i.transformerConstructor(Object.assign(Object.assign({},e._option),{type:u})).transformSpec(a,t,r);AS(t,o,l.spec),AS(r,null!=s?s:o,Object.assign(Object.assign({},n),l))}))}},{key:"createSpecInfo",value:function(t,e){var i,n,r=this;e||(e=function(e,i,n){var a=i.spec,o=i.specPath,s=i.specInfoPath,u=i.type,l=new e.transformerConstructor(Object.assign(Object.assign({},r._option),{type:u}));AS(n,null!=s?s:o,Object.assign(Object.assign({},i),{theme:l.getTheme(a,t)}))});var a={};return this.forEachRegionInSpec(t,e,a),this.forEachSeriesInSpec(t,e,a),null===(i=a.series)||void 0===i||i.forEach((function(t,e){var i,n,r=(null!==(n=null!==(i=PC(t,a))&&void 0!==i?i:a.region)&&void 0!==n?n:[])[0];r&&(r.seriesIndexes||(r.seriesIndexes=[]),r.seriesIndexes.push(e),t.regionIndexes=r.regionIndexes.slice())})),this.forEachComponentInSpec(t,e,a),Object.values(null!==(n=a.component)&&void 0!==n?n:{}).forEach((function(t){return t.forEach((function(t,e){var i,n,r;if(t){if(!t.regionIndexes){var o=null!==(n=null!==(i=PC(t,a))&&void 0!==i?i:a.region)&&void 0!==n?n:[];t.regionIndexes=o.map((function(t){return t.regionIndexes[0]}))}if(!t.seriesIndexes){var s=function(t,e){var i,n=t.spec,r=n.seriesId,a=n.seriesIndex;if(pt(r)){var o=Kt(r);return null===(i=e.series)||void 0===i?void 0:i.filter((function(t){var e=t.spec;return o.includes(e.id)}))}if(pt(a))return Kt(a).map((function(t){var i;return null===(i=e.series)||void 0===i?void 0:i[t]})).filter(pt)}(t,a);if(s)t.seriesIndexes=s.map((function(t){return t.seriesIndexes[0]}));else{var u=new Set;(null!==(r=t.regionIndexes)&&void 0!==r?r:[]).forEach((function(t){var e,i,n=null===(e=a.region)||void 0===e?void 0:e[t];null===(i=null==n?void 0:n.seriesIndexes)||void 0===i||i.forEach((function(t){return u.add(t)}))})),t.seriesIndexes=Array.from(u)}}}}))})),a}},{key:"_isValidSeries",value:function(t){return!0}},{key:"_getDefaultSeriesSpec",value:function(t){var e,i,n,r;return{dataKey:t.dataKey,hover:t.hover,select:t.select,label:t.label,seriesStyle:t.seriesStyle,animation:null!==(e=t.animation)&&void 0!==e?e:this._option.animation,animationThreshold:null!==(i=t.animationThreshold)&&void 0!==i?i:null===(r=(n=this._option).getTheme)||void 0===r?void 0:r.call(n).animationThreshold,animationAppear:t.animationAppear,animationDisappear:t.animationDisappear,animationEnter:t.animationEnter,animationUpdate:t.animationUpdate,animationExit:t.animationExit,animationNormal:t.animationNormal,animationState:t.animationState,extensionMark:t.extensionMark,large:t.large,largeThreshold:t.largeThreshold,progressiveStep:t.progressiveStep,progressiveThreshold:t.progressiveThreshold,background:t.seriesBackground,invalidType:t.invalidType,seriesField:t.seriesField,morph:t.morph,interactions:t.interactions}}},{key:"forEachRegionInSpec",value:function(t,e,i){var n;return(null!==(n=t.region)&&void 0!==n?n:[]).map((function(t,n){return e(ES.getRegionInType("region"),{spec:t,specPath:["region",n],type:"region",regionIndexes:[n]},i)}))}},{key:"forEachSeriesInSpec",value:function(t,e,i){var n;return(null!==(n=t.series)&&void 0!==n?n:[]).map((function(t,n){return e(ES.getSeriesInType(t.type),{spec:t,specPath:["series",n],type:t.type,seriesIndexes:[n]},i)}))}},{key:"forEachComponentInSpec",value:function(t,e,i){for(var n,r,a,o,s,u,l,h=[],c=ES.getComponents(),d=[],f=0;f<c.length;f++){var v=c[f],p=v.cmp,g=v.alwaysCheck;p.type.startsWith(ib.cartesianAxis)?o=p:p.type.startsWith(ib.polarAxis)?s=p:p.type===ib.geoCoordinate?u=p:(g||t[null!==(n=p.specKey)&&void 0!==n?n:p.type])&&(p.type===ib.tooltip?l=p:d.push(p))}var y=!1;if(o){var m=o.getSpecInfo(t,i);(null==m?void 0:m.length)>0&&(y=!0,m.forEach((function(t){var n=ES.getComponentInKey(t.type);h.push(e(n,t,i))})))}if(s&&!y){var k=s.getSpecInfo(t,i);(null==k?void 0:k.length)>0&&(y=!0,k.forEach((function(t){var n=ES.getComponentInKey(t.type);h.push(e(n,t,i))})))}return u&&!y&&(null===(r=u.getSpecInfo(t,i))||void 0===r||r.forEach((function(t){h.push(e(u,t,i))}))),d.forEach((function(n){var r;null===(r=n.getSpecInfo(t,i))||void 0===r||r.forEach((function(t){h.push(e(n,t,i))}))})),null===(a=null==l?void 0:l.getSpecInfo(t,i))||void 0===a||a.forEach((function(t){h.push(e(l,t,i))})),h}},{key:"transformSeriesSpec",value:function(t){var e=this,i=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((function(t){e._isValidSeries(t.type)&&Object.keys(i).forEach((function(e){e in t||(t[e]=i[e])}))})):t.series=[i]}},{key:"_findBandAxisBySeries",value:function(t,e,i){var n="horizontal"===(null==t?void 0:t.direction)?["left","right"]:["top","bottom"];return i.find((function(i){if(!n.includes(i.orient))return!1;if(pt(i.seriesId)){if(Kt(i.seriesId).includes(null==t?void 0:t.id))return!0}else if(pt(i.seriesIndex)){if(Kt(i.seriesIndex).includes(e))return!0}else if("band"===i.type)return!0;return!0}))}},{key:"_applyAxisBandSize",value:function(t,e,i){var n=i.barMaxWidth,r=i.barMinWidth,a=i.barWidth,o=i.barGapInGroup,s=!1;wt(r)?(t.minBandSize=r,s=!0):wt(a)?(t.minBandSize=a,s=!0):wt(n)&&(t.minBandSize=n,s=!0),s&&(t.bandSizeLevel=Number.MAX_VALUE,t.bandSizeExtend={extend:e,gap:bt(o)?o[o.length-1]:o})}}])}();class IC extends B_{get specProcess(){return this._specProcess}get dataTempTransform(){return this._specProcess.dataTempTransform}get chartType(){var t;return null===(t=this._specProcess.dataTempTransform.specTemp)||void 0===t?void 0:t.getChartType()}get tempType(){var t;return null===(t=this._specProcess.dataTempTransform.specTemp)||void 0===t?void 0:t.type}constructor(t,e){super(t,e),this._runtime=[],this.onSpecReady=()=>{var t;console.log("onSpecReady !"),this._runtime.forEach((t=>{var e;return null===(e=t.onSpecReady)||void 0===e?void 0:e.call(t)})),null===(t=this._specProcess.dataTempTransform.specTemp)||void 0===t||t.standardizedSpec(this._specProcess.getVisSpec(),{character:this}),this._updateVisactorSpec(),this._afterRender()},this._initSpecProcess()}_initRuntime(){}clearConfig(t){}show(){this._graphic.setAttribute("visibleAll",!0)}hide(){this._graphic.setAttribute("visibleAll",!1)}getGraphicParent(){return this._graphic}getViewBoxFromSpec(){const t=x_(this._spec.position);return{layout:t,viewBox:{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}}getLayoutBounds(){const{viewBox:t}=this.getViewBoxFromSpec();return t}tickTo(t){}release(){var t,e;this._specProcess.release(),null===(e=null===(t=this._graphic)||void 0===t?void 0:t.parent)||void 0===e||e.removeChild(this._graphic),this._specProcess=this._graphic=null}}class LC{get dataTempTransform(){return this._dataTempTransform}constructor(t,e,i){this._onSpecReadyCall=null,this._character=null,this.emitter=new ht,this._dataUpdateSuccess=t=>{this.emitter.emit("beforeTempChange"),this._characterSpec.options.data=this._dataTempTransform.dataParser.getSave(),this.emitter.emit("afterDataChange")},this._tempUpdateSuccess=(t,e)=>{const i=!1!==(null==t?void 0:t.triggerHistory);this.emitter.emit("beforeTempChange",i,e),this._characterSpec.type=this._dataTempTransform.specTemp.type,this.emitter.emit("afterTempChange",e)},this._dataTempUpdateSuccess=(t,e)=>{const i=!1!==(null==t?void 0:t.triggerHistory);this.emitter.emit("beforeTempChange",i,e),this._characterSpec.options.data=this._dataTempTransform.dataParser.getSave(),this._characterSpec.type=this._dataTempTransform.specTemp.type,this.emitter.emit("afterTempChange",e)},this.transformSpec=()=>{this._visSpec=this._dataTempTransform.getBaseSpec(),this._mergeConfig(),this._onSpecReadyCall()},this._character=t,this._dataTempTransform=new e({character:t,specProcess:this}),this._onSpecReadyCall=i,this._dataTempTransform.emitter.on("specReady",this.transformSpec),this._dataTempTransform.emitter.on("tempUpdate",this._tempUpdateSuccess),this._dataTempTransform.emitter.on("dataUpdate",this._dataUpdateSuccess)}getVisSpec(){return this._visSpec}getCharacterSpec(){return this._characterSpec}release(){this._onSpecReadyCall=null,this._dataTempTransform.release(),this._dataTempTransform=null,this._characterSpec=null,this._visSpec=null,this._character=null}getCharacterType(){return this._characterSpec.type}}const DC={type:null,zIndex:0,id:"",position:void 0,options:{data:null,theme:null,color:null,layout:{viewBox:{x:0,y:0,width:0,height:0},data:[]},marker:{markLine:[],markArea:[]},markStyle:null}};class FC extends LC{constructor(){super(...arguments),this._characterSpec=p_(DC)}updateConfig(t){this._characterSpec=t,this._dataTempTransform.updateChartTemp(this._characterSpec.type)}_mergeConfig(){}}class jC{get specTemp(){return this._specTemp}get nextTemp(){return this._nextTemp}constructor({specProcess:t,character:e}){this._state="alive",this._specTemp=null,this._nextTemp=null,this._changeType="none",this._updateOption={},this.emitter=new ht,this._character=e,this._specProcess=t}_setNoHistoryState(){this._updateOption=this._updateOption||{},this._updateOption.triggerHistory&&(this._updateOption.saveData=!0,this._updateOption.triggerHistory=!1)}updateChartTemp(t){if(this._createNextTemp(t)){if(this._changeType="temp",this._checkEnable(this._nextTemp)){const t=this._specTemp;this._setTempToNext(),this.emitter.emit("tempUpdate",this._updateOption,{currentTemp:t,nextTemp:this._specTemp}),this.emitter.emit("specReady")}this._changeType="none"}}_setTempToNext(){var t;null===(t=this._specTemp)||void 0===t||t.clear(),this._specTemp=this._nextTemp,this._nextTemp=null}_createNextTemp(t){var e,i;return t===(null===(e=this._specTemp)||void 0===e?void 0:e.type)?(console.warn("same temp type:",t),!1):(null===(i=this._nextTemp)||void 0===i||i.clear(),this._nextTemp=N_.createChartTemp(t,this._specProcess.getCharacterSpec()),!!this._nextTemp)}_checkEnable(t){return!!t&&!!t.checkDataEnable(this._specProcess.getCharacterSpec().options.data)}getBaseSpec(){return this._specTemp.getSpec(this._specProcess.getCharacterSpec().options.data,{character:this._character})}release(){var t,e;this._state="release",null===(t=this._specTemp)||void 0===t||t.clear(),null===(e=this._nextTemp)||void 0===e||e.clear(),this.emitter.removeAllListeners(),this.emitter=this._specTemp=null}}class NC extends jC{get specTemp(){return this._specTemp}get nextTemp(){return this._nextTemp}}function zC(t){return{type:t.type,model:t,specKey:t.specKey,specIndex:t.getSpecIndex()}}const UC={check:(t,e)=>{var i;return null===(i=t.name)||void 0===i?void 0:i.startsWith("seriesGroup_")},modelInfo:(t,e,i,n)=>{const r=+e.name.split("_")[2],a=+i[n+1].name.split("_")[1],o=t.getChart().getSeriesInIds([r])[0],s=i[i.length-1].__vgrammar_scene_item__.data;return{type:"seriesMark",model:o,mark:o.getMarkInId(a),specKey:o.specKey,specIndex:o.getSpecIndex(),datum:s}}},GC={check:(t,e)=>"axis"===t.name||"axis-grid"===t.name,modelInfo:(t,e,i,n)=>{const r=t.getChart().getAllComponents().filter((t=>"axes"===t.specKey));let a=i.find((t=>"axis"===t.name));if(a){return zC(r.find((t=>t._axisMark.getProduct().graphicItem===a.parent)))}if(a=i.find((t=>"axis-grid"===t.name)),a){return zC(r.find((t=>t._gridMark.getProduct().graphicItem===a.parent)))}return null}},WC={MarkLine:!0,MarkArea:!0,MarkPoint:!0,MarkArcLine:!0,MarkArcArea:!0},VC={markPoint:!0,markLine:!0,markArea:!0},HC={check:(t,e)=>!!WC[t.constructor.name],modelInfo:(t,e,i)=>{const n=e.id.split("-")[0];let r;if(VC[n]){const i=+e.id.split("-")[1];r=t.getChart().getAllComponents().find((t=>t.id===i))}else{const i=e.id;r=t.getChart().getAllComponents().find((t=>t.userId===i))}return zC(r)}},KC={check:(t,e)=>"data-label"===t.name,modelInfo:(t,e,i,n)=>{const r=+i[n-1].name.split("_")[1],a=t.getChart().getAllComponents().find((t=>("label"===t.type||"totalLabel"===t.type)&&t.getMarks().some((t=>t.id===r))));return Object.assign(Object.assign({},zC(a)),{datum:i[i.length-1].attribute.data})}};function XC(t,e){return{check:(e,i)=>e.constructor.name===t,modelInfo:(t,i,n,r)=>zC(t.getChart().getAllComponents().find((t=>t.type===e)))}}const YC=XC("DiscreteLegend","discreteLegend"),qC=XC("ColorContinuousLegend","colorLegend"),ZC=XC("SizeContinuousLegend","sizeLegend"),JC=XC("ScrollBar","scrollBar"),$C=XC("Title","title"),QC=XC("ContinuousPlayer","player"),tE=XC("DiscretePlayer","player"),eE=[UC,GC,YC,qC,ZC,HC,JC,KC,$C,QC,tE];function iE(t,e){const i=e.detailPath[e.detailPath.length-1];if(!i)return null;const n=null==i?void 0:i[i.length-1];return n?nE(t,n,i,0):null}function nE(t,e,i,n){const r=eE.find((t=>t.check(e,i)));return r?r.modelInfo(t,e,i,n):n>=i.length-1?null:nE(t,i[n+1],i,n+1)}class rE extends IC{constructor(){super(...arguments),this.visActorType="chart"}get spec(){return this._spec}_initSpecProcess(){this._specProcess=new FC(this,NC,this.onSpecReady)}_initRuntime(){rE.RunTime.forEach((t=>{this._runtime.push(new t(this))}))}_parserSpec(){this._specProcess.updateConfig(this._spec)}_initGraphics(){var t,e;const{spec:i,viewBox:n}=this._getChartOption();this._graphic=new G_(Object.assign(Object.assign({renderCanvas:this._option.canvas.getCanvas(),spec:i,ClassType:CC,vchart:null,zIndex:this._spec.zIndex,mode:"desktop-browser",dpr:window.devicePixelRatio,interactive:!1,autoRender:!1,disableDirtyBounds:!0,viewBox:n,ticker:this._option.canvas.getStage().ticker,visibleAll:!1},null!==(t=this._spec.options.panel)&&void 0!==t?t:{}),{chartInitOptions:k_({animation:!0,disableTriggerEvent:!0,performanceHook:{afterInitializeChart:()=>{var t,e;null===(e=null===(t=this.specProcess.dataTempTransform)||void 0===t?void 0:t.specTemp)||void 0===e||e.afterInitializeChart({character:this}),this._runtime.forEach((t=>{var e;return null===(e=t.afterInitializeChart)||void 0===e?void 0:e.call(t)}))},afterVRenderDraw:()=>{this._runtime.forEach((t=>{var e;return null===(e=t.afterVRenderDraw)||void 0===e?void 0:e.call(t)}))}}},null!==(e=this._spec.options.initOption)&&void 0!==e?e:{})})),this.option.graphicParent.add(this._graphic)}setAttributes(t){t.position&&(this._spec.position=t.position,this._graphic.updateViewBox(this.getViewBoxFromSpec().viewBox))}getViewBoxFromSpec(){const t=x_(this._spec.position);return{layout:t,viewBox:{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}}_getChartOption(){var t;const{layout:e,viewBox:i}=this.getViewBoxFromSpec(),n=p_(null!==(t=this._specProcess.getVisSpec())&&void 0!==t?t:this._spec.options.spec);return n.width=e.width,n.height=e.height,{viewBox:i,spec:n}}_afterRender(){}_updateVisactorSpec(){var t;null===(t=this._graphic)||void 0===t||t.updateSpec(this._specProcess.getVisSpec())}clearCharacter(){this._graphic.vProduct.release(),this._graphic.parent.removeChild(this._graphic)}tickTo(t){this._ticker.tickAt(t)}checkEvent(t){var e;if(!(null!==(e=t.detailPath)&&void 0!==e?e:t.path).some((t=>t===this._graphic)))return!1;const i=t.detailPath[t.detailPath.length-1],n=iE(this._graphic.vProduct,t);if(!n)return!!this._graphic.pointInViewBox(t.canvasX,t.canvasY)&&{part:"null",graphic:null,modelInfo:null,graphicType:"null"};const r=null==i?void 0:i[i.length-1];return{part:n.type,modelInfo:n,graphic:r,graphicType:r.type}}release(){this.option.graphicParent.removeChild(this._graphic),this._graphic.release&&this._graphic.release()}_reflow(){if(!this._graphic)return void this._initGraphics();const{spec:t}=this._getChartOption();this._graphic.updateSpec(t)}}rE.type="CharacterChart",rE.RunTime=[class{constructor(t){this.type="ComponentSpec",this._character=t}onSpecReady(){const t=this._character.specProcess.getVisSpec(),e=this._character.specProcess.getCharacterSpec().options;if(!e)return;const i=e.componentSpec;null==i||i.forEach((e=>{"axes"===e.specKey?this._mergeAxesSpec(t,e):this._mergeComponentSpec(t,e,e.specKey)}))}_mergeAxesSpec(t,e){this._mergeComponentSpec(t,e,"axes",((t,i,n)=>t.orient===e.matchInfo.orient))}_mergeComponentSpec(t,e,i,n){t[i]||(t[i]=[]);const r=t[i].find(((t,i)=>!!tb(t,i,e.matchInfo)||!!n&&n(t,i,e)));r?k_(r,e.spec):t[i].push(e.spec)}afterInitializeChart(){}afterVRenderDraw(){}},class{constructor(t){this.type="CommonSpec",this._character=t}onSpecReady(){const t=this._character.specProcess.getVisSpec(),e=this._character.specProcess.getCharacterSpec().options;e&&k_(t,{color:e.color,theme:e.theme,padding:e.padding,title:e.title})}},class{constructor(t){this.type="SeriesSpec",this._character=t}onSpecReady(){var t,e;const i=this._character.specProcess.getVisSpec(),n=this._character.specProcess.getCharacterSpec().options;n&&(i.series||1!==(null===(t=n.seriesSpec)||void 0===t?void 0:t.length)?null===(e=n.seriesSpec)||void 0===e||e.forEach((t=>{if(!i.series)return void(i.series=[Object.assign({},t.spec)]);const e=i.series.find(((e,i)=>tb(e,i,t.matchInfo)));e?k_(e,t.spec):i.series.push(Object.assign({},t.spec))})):k_(i,n.seriesSpec[0].spec))}afterInitializeChart(){}afterVRenderDraw(){}}];class aE{clear(){}getChartType(){return this.type}afterInitializeChart(t){}standardizedSpec(t,e){}}const oE="VChart",sE="RankingBar";class uE extends aE{constructor(){super(...arguments),this.type=uE.type}checkDataEnable(t,e){return!0}getSpec(t,e){return e.character.spec.options.spec}}uE.type=oE,N_.registerChartTemp(uE.type,uE);class lE extends rE{}var hE;lE.type="VChart",function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP"}(hE||(hE={}));let cE=class extends pl{constructor(){super(...arguments),this.type="vstory-component-group",this.numberType=R_}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{wipeDirection:a,wipeRatio:o,wipeColor:s,wipeBlur:u}=t.attribute,l=isFinite(o);let h,c,d,f;if(l){const e=t.AABBBounds;a===hE.LEFT_TO_RIGHT?(h=e.x1,c=e.y1,d=h+e.width()*o,f=e.height()+c):a===hE.RIGHT_TO_LEFT?(d=e.x1,c=e.y1,h=d-e.width()*o,f=e.height()+c):a===hE.TOP_TO_BOTTOM?(h=e.x1,c=e.y1,d=h+e.width(),f=e.height()*o+c):a===hE.BOTTOM_TO_TOP&&(h=e.x1,f=e.y1,d=h+e.width(),c=f-e.height()*o),r.save(),r.setTransformForCurrent(),r.beginPath(),r.rect(h,c,d-h,f-c),r.clip()}super.draw(t,e,i,n),l&&r.restore()}};cE=A_([L()],cE);class dE extends S_{getInitialAttributes(){return{x:0,y:0,clipRange:0,activeSymbolStyle:{size:26},activeLineStyle:{lineWidth:1.5}}}init(){var t,e;this._graphic||(this._graphic=new Px(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`timeline-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}applyLayoutData(t){const{x:e,y:i,width:n,height:r,angle:a}=x_(t);this._graphic.setAttributes(this._transformAttributes({x:e,y:i,angle:a,width:n,height:r}))}}class fE extends P_{constructor(){super(...arguments),this.graphicType="timeline"}_createGraphic(){return new dE(D_.TIMELINE,this)}}var vE=function(t){function i(){return o(this,i),e(this,i,arguments)}return h(i,t),u(i,[{key:"transformSpec",value:function(t){var e=function(t){var e=t.xField,i=t.yField,n=t.timeField,r=t.data,a=t.topN,o=void 0===a?10:a,s=t.icon,u=new Set,l=new Map;return r.sort((function(t,i){return Number(i[e])-Number(t[e])})),r.forEach((function(t){var e=t[n];pt(e)&&u.add(e),l.has(e)||l.set(e,[]);var r=l.get(e);if(r.length<o){var a=Object.assign({},t);s&&s[a[i]]&&(a.icon=s[a[i]]),r.push(a)}})),{timeData:l,timeNodes:Array.from(u).sort()}}(t),n=e.timeData,r=e.timeNodes,a=t.interval,o=t.xField,s=t.yField,u=t.color,l=t.icon,h=t.iconPosition,d=t.iconShape,f=t.timeLabel,v=t.label,g=t.nameLabel,y=t.xAxis,m=t.yAxis,k=a||1e3,_=Math.min(k,500);if(t.type="common",t.data=[{id:"timeData",values:n.get(r[0])},{id:"time",values:[{time:r[0]}]}],t.color={specified:Object.assign({},u)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:s,xField:o,seriesField:s,extensionMark:[],label:pE(v,Object.assign(Object.assign({},g),{yField:s}))}],t.axes=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={orient:"left",type:"band",inverse:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid}},n={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid},innerOffset:{right:"10%"}};return t.label&&(n.label=t.label),[i,n]}(y,m),t.player={type:"continuous",auto:!0,loop:!1,interval:k,specs:r.map((function(t){return{data:[{id:"timeData",values:n.get(t)},{id:"time",values:[{time:t}]}]}}))},t.tooltip={visible:!1},t.customMark=[],function(t,e){var i=e.interval,n=e.exchangeDuration;t.animationAppear=!1,t.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:i},{channel:["y"],easing:"circInOut",duration:n}],axis:{duration:i,easing:"linear"}},t.animationEnter={bar:[{type:"moveIn",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:function(t,e,i){return{y:i.groupHeight+e.getBounds().height()}}}}]},t.animationExit={bar:[{type:"moveOut",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(t,{interval:k,exchangeDuration:_}),f&&!1===f.visible||t.customMark.push(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:function(t){return t.time},x:function(t,e){var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:function(t,e){var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},t)}}(f.style)),l){var b=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"bar-end",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"circle",i=arguments.length>2?arguments[2]:void 0,n=i.interval,r=i.exchangeDuration;return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:function(t,e){var i,n,r=e.vchart,a=null===(i=r.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(r&&a){var o=null!==(n=a.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return Math.max(o-4,0)}return 10},background:function(t){return t.icon},x:function(e,i){var n,r,a=i.vchart,o=null===(n=a.getChart())||void 0===n?void 0:n.getSeriesInIndex(0)[0];if(a&&o){var s=null!==(r=o.getYAxisHelper().getBandwidth(0))&&void 0!==r?r:0;return"bar-start"===t?s/2:"axis"===t?-s/2:o.dataToPositionX(e)-s/2}},y:function(t,e){var i,n,r=e.vchart,a=null===(i=r.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(r&&a){var o=null!==(n=a.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return a.dataToPositionY(t)+o/2}},scaleY:"rect"===e?1.2:1},animationUpdate:gE(n,r),animationEnter:[{type:"moveIn",duration:r,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:function(t,e,i){return{y:i.groupHeight+e.getBounds().height()}}}}],animationExit:[{type:"moveOut",duration:r,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(h,d,{interval:k,exchangeDuration:_});t.series[0].extensionMark.push(b)}p(c(i.prototype),"transformSpec",this).call(this,t)}}])}(OC);function pE(){var t,e,i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,o=[];return!1!==r.visible&&o.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},r.style),smartInvert:{fillStrategy:(null===(t=r.style)||void 0===t?void 0:t.fill)?"null":void 0,strokeStrategy:(null===(e=r.style)||void 0===e?void 0:e.stroke)?"null":void 0}}),a.visible&&o.push({visible:!0,overlap:!1,style:Object.assign({},a.style),smartInvert:{fillStrategy:(null===(i=a.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(n=a.style)||void 0===n?void 0:n.stroke)?"null":void 0},position:"bar-end"===a.position?"inside-right":"inside-left",formatter:"{".concat(a.yField,"}")}),o}function gE(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}var yE=function(t){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="rankingBar",t.transformerConstructor=vE,t}return h(i,t),u(i,[{key:"init",value:function(){this.isValid()&&p(c(i.prototype),"init",this).call(this)}},{key:"isValid",value:function(){var t,e,i,n,r=this._spec,a=r.xField,o=r.yField,s=r.timeField,u=r.data;return a&&o&&s?!!u||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}])}(MC);yE.type="rankingBar",yE.view="singleDefault",yE.transformerConstructor=vE;class mE extends aE{constructor(){super(...arguments),this.type=mE.type}checkDataEnable(t,e){return!0}getSpec(t,e){return e.character.spec.options.spec}}mE.type=sE,N_.registerChartTemp(mE.type,mE),CC.useChart([yE]);class kE extends rE{}kE.type="RankingBar",_f(),og(or),bf.setEnv("browser");class _E{getStage(){return this._stage}getCanvas(){return this._canvas}get container(){return this._container}constructor(t,e){this._story=t,this._container=e,this._initCanvas()}_initCanvas(){const t=document.createElement("canvas");t.width=this._container.clientWidth*window.devicePixelRatio,t.height=this._container.clientHeight*window.devicePixelRatio,t.style.width=this._container.clientWidth+"px",t.style.height=this._container.clientHeight+"px",t.style.position="absolute",t.id=`_visactor_story_canvas_${this._story.id}`,this._container.appendChild(t),this._canvas=t;const e=Ff({canvas:this._canvas,width:this._canvas.clientWidth,height:this._canvas.clientHeight,canvasControled:!0,autoRender:!0,disableDirtyBounds:!0,ticker:new qr([]),pluginList:["RichTextEditPlugin"],dpr:window.devicePixelRatio,event:{clickInterval:300}});this._stage=e}getEventDetail(t){const e=this._story.getCharacters();let i,n;return Object.keys(this._story.getCharacters()).find((r=>{const a=e[r],o=a.checkEvent(t);return!!o&&(i=o,n=a,!0)})),{character:n,characterInfo:i}}release(){this._stage.release()}}class bE{constructor(t){this._characters={},this._story=t}getCharacters(){return this._characters}getCharactersById(t){return this._characters[t]||null}addCharacter(t){const e={story:this._story,canvas:this._story.canvas,graphicParent:this._story.canvas.getStage().defaultLayer};return t.id?(this._characters[t.id]||(this._characters[t.id]=N_.createCharacter(t,e)),this._characters[t.id]):null}initCharacters(t){this.releaseOldCharacters(),this._characters={};const e={story:this._story,canvas:this._story.canvas,graphicParent:this._story.canvas.getStage().defaultLayer};t.forEach((t=>{t.id&&(this._characters[t.id]||(this._characters[t.id]=N_.createCharacter(t,e)))}))}releaseOldCharacters(){Object.keys(this._characters).forEach((t=>{this._characters[t].release()}))}}const xE={warn:"color: orange;",error:"color: red;",info:"color: blue;"};function SE(t,...e){console.log(`%c[${t.toUpperCase()}] ${e}`,xE[t])}class wE{constructor(t,e){return wE._instance||(this.init(t,e),wE._instance=this),wE._instance}init(t,e){if(this._processorMap=new Map,e)for(const t in e)SE("info",`register ${t} processor.`),this.registerProcessor(t,e[t]);this._story=t}getActInfo(t,e){const i=this._story.getCharactersById(t);if(!i)return SE("error",`获取character失败,请检查 ${t} 是否绑定到一个合法的character`),null;const n=this.getProcessor(i.spec.type,e.action);return n?n.getStartTimeAndDuration(e,i):(SE("error",`获取processor失败,请检查 ${i.spec.type} 是否支持 ${e.action}`),null)}registerProcessor(t,e){return!!this._processorMap&&(this._processorMap.set(t,e),!0)}getProcessorList(t){return this._processorMap&&this._processorMap.get(t)}getProcessor(t,e){var i;return this._processorMap&&(null===(i=this._processorMap.get(t))||void 0===i?void 0:i[e])}doAction(t,e,i,n){const r=this.getProcessor(t,e);if(r){SE("info",`Execute action => ${e}, character => ${t}`);const a=r.run(i,n);return SE("info","Action Executed:",a),a}SE("error",`Action not found: character => ${t}, action => ${e} `)}release(){wE._instance=null,this._processorMap&&(this._processorMap.clear(),this._processorMap=null)}}wE._instance=null;const AE="appear",TE="disappear",CE="style",EE="moveTo",BE="scaleTo",RE="state",ME="bounce",PE="update",OE="add";class IE{getStartTime(t){return this.getStartTimeAndDuration(t).startTime}getDuration(t){return this.getStartTimeAndDuration(t).duration}getStartTimeAndDuration(t){return{startTime:0,duration:0}}run(t,e){}}function LE(t){return t.getGraphicParent()}function DE(t){return t.getGraphicParent().getChildren()}function FE(t,e){return"chart"===t._graphic.type||"move"===e?[LE(t)]:DE(t)}const jE=(t,e)=>t&&e.duration&&e.duration>0;function NE(t,e,i){UE(LE(t),e,!0)}function zE(t,e,i){UE(LE(t),e,!1)}function UE(t,e,i){var n,r,a;if(!jE(t,e))return!1;const{fade:o={}}=e;null!==(n=o.opacity)&&void 0!==n||e.opacity;const s=null!==(r=o.duration)&&void 0!==r?r:e.duration,u=null!==(a=o.easing)&&void 0!==a?a:e.easing,l=t.attribute.baseOpacity,h=i?{from:0,to:null!=l?l:1}:{from:null!=l?l:1,to:0};return t.setAttributes({baseOpacity:h.from}),t.animate().to({baseOpacity:h.to},s,u),!0}function GE(t,e,i){FE(t,i).forEach((t=>VE(t,e,!0)))}function WE(t,e,i){FE(t,i).forEach((t=>VE(t,e,!1)))}function VE(t,e,i){var n,r,a,o;if(!jE(t,e))return!1;const{scale:s={}}=e,u=null!==(r=null!==(n=s.ratio)&&void 0!==n?n:e.ratio)&&void 0!==r?r:1,l=null!==(a=s.duration)&&void 0!==a?a:e.duration,h=null!==(o=s.easing)&&void 0!==o?o:e.easing,c=t.attribute.scaleX,d=t.attribute.scaleY,f=i?{fromX:0,fromY:0,toX:null!=c?c:u,toY:null!=d?d:u}:{fromX:null!=c?c:u,fromY:null!=d?d:u,toX:0,toY:0};return t.setAttributes({scaleX:f.fromX,scaleY:f.fromY}),t.animate().to({scaleX:f.toX,scaleY:f.toY},l,h),!0}const HE={right:0,left:1,top:2,bottom:3};function KE(t,e,i){YE(LE(t),e,!0)}function XE(t,e,i){YE(LE(t),e,!1)}function YE(t,e,i){var n,r,a,o;if(!jE(t,e))return!1;const{wipe:s={}}=e,u=null!==(r=null!==(n=s.from)&&void 0!==n?n:e.from)&&void 0!==r?r:"right",l=null!==(a=s.duration)&&void 0!==a?a:e.duration,h=null!==(o=s.easing)&&void 0!==o?o:e.easing;let c=0,d=1;return i||([c,d]=[d,c]),t.setAttributes({wipeDirection:HE[u],wipeRatio:c}),t.animate().to({wipeRatio:d},l,h).onEnd((()=>{t.setAttributes({wipeRatio:d})})),!0}function qE(t,e,i){!function(t,e){var i,n,r,a;if(!jE(t,e))return!1;const{move:o={}}=e,s=null!==(i=o.pos)&&void 0!==i?i:e.pos,u=null!==(n=o.duration)&&void 0!==n?n:e.duration,l=null!==(r=o.easing)&&void 0!==r?r:e.easing,h=null===(a=o.isVariableSpeed)||void 0===a||a;let c=t.attribute.x,d=t.attribute.y;const f=Math.abs(t.AABBBounds.x2-t.AABBBounds.x1),v=Math.abs(t.AABBBounds.y2-t.AABBBounds.y1);if(h)switch(s){case"right":c=t.parent.width;break;case"left":c=-f;break;case"bottom":d=t.parent.height+v;break;case"top":d=-v}else{const e=Math.max(t.parent.width,t.parent.height);switch(s){case"right":c+=e;break;case"left":c+=-e;break;case"bottom":d+=e;break;case"top":d+=-e}}t.animate().to({x:c,y:d},u,l).onEnd((()=>{t.setAttributes({visible:!1,visibleAll:!1})}))}(LE(t),e)}function ZE(t,e,i){!function(t,e){var i,n,r,a,o;if(!jE(t,e))return!1;const{move:s={}}=e,u=null!==(n=null!==(i=s.pos)&&void 0!==i?i:e.pos)&&void 0!==n?n:1,l=null!==(r=s.duration)&&void 0!==r?r:e.duration,h=null!==(a=s.easing)&&void 0!==a?a:e.easing,c=null===(o=s.isVariableSpeed)||void 0===o||o,d=Math.abs(t.AABBBounds.x2-t.AABBBounds.x1),f=Math.abs(t.AABBBounds.y2-t.AABBBounds.y1);let v=t.attribute.x,p=t.attribute.y;if(c)switch(u){case"right":v=t.parent.width;break;case"left":v=-d;break;case"bottom":p=t.parent.height+f;break;case"top":p=-f;break;case"top-right":p=-f,v=t.parent.width;break;case"top-left":p=-f,v=-d;break;case"bottom-left":p=t.parent.height+f,v=-d;break;case"bottom-right":p=t.parent.height+f,v=t.parent.width}else{const e=Math.max(t.parent.width,t.parent.height);switch(u){case"right":v+=e;break;case"left":v+=-e;break;case"bottom":p+=e;break;case"top":p+=-e;break;case"top-right":v+=e,p+=-e;break;case"top-left":v+=-e,p+=-e;break;case"bottom-left":p+=e,v+=-e;break;case"bottom-right":v+=e,p+=e}}t.animate().from({x:v,y:p},l,h)}
2
+ /*!
3
+ * paths 3.12.5
4
+ * https://gsap.com
5
+ *
6
+ * Copyright 2008-2024, GreenSock. All rights reserved.
7
+ * Subject to the terms at https://gsap.com/standard-license or for
8
+ * Club GSAP members, the agreement issued with that membership.
9
+ * @author: Jack Doyle, jack@greensock.com
10
+ */(LE(t),e)}let JE=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,$E=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/gi,QE=Math.PI/180,tB=Math.sin,eB=Math.cos,iB=Math.abs,nB=Math.sqrt,rB=1e5,aB=t=>Math.round(t*rB)/rB||0;function oB(t,e,i,n,r,a,o,s,u){if(t===s&&e===u)return;i=iB(i),n=iB(n);let l=r%360*QE,h=eB(l),c=tB(l),d=Math.PI,f=2*d,v=(t-s)/2,p=(e-u)/2,g=h*v+c*p,y=-c*v+h*p,m=g*g,k=y*y,_=m/(i*i)+k/(n*n);_>1&&(i=nB(_)*i,n=nB(_)*n);let b=i*i,x=n*n,S=(b*x-b*k-x*m)/(b*k+x*m);S<0&&(S=0);let w=(a===o?-1:1)*nB(S),A=w*(i*y/n),T=w*(-n*g/i),C=(t+s)/2+(h*A-c*T),E=(e+u)/2+(c*A+h*T),B=(g-A)/i,R=(y-T)/n,M=(-g-A)/i,P=(-y-T)/n,O=B*B+R*R,I=(R<0?-1:1)*Math.acos(B/nB(O)),L=(B*P-R*M<0?-1:1)*Math.acos((B*M+R*P)/nB(O*(M*M+P*P)));isNaN(L)&&(L=d),!o&&L>0?L-=f:o&&L<0&&(L+=f),I%=f,L%=f;let D,F=Math.ceil(iB(L)/(f/4)),j=[],N=L/F,z=4/3*tB(N/2)/(1+eB(N/2)),U=h*i,G=c*i,W=c*-n,V=h*n;for(D=0;D<F;D++)g=eB(r=I+D*N),y=tB(r),B=eB(r+=N),R=tB(r),j.push(g-z*y,y+z*g,B+z*R,R-z*B,B,R);for(D=0;D<j.length;D+=2)g=j[D],y=j[D+1],j[D]=g*U+y*W+C,j[D+1]=g*G+y*V+E;return j[D-2]=s,j[D-1]=u,j}
11
+ /*!
12
+ * CustomEase 3.12.5
13
+ * https://gsap.com
14
+ *
15
+ * @license Copyright 2008-2024, GreenSock. All rights reserved.
16
+ * Subject to the terms at https://gsap.com/standard-license or for
17
+ * Club GSAP members, the agreement issued with that membership.
18
+ * @author: Jack Doyle, jack@greensock.com
19
+ */
20
+ let sB,uB,lB=()=>sB||"undefined"!=typeof window&&(sB=window.gsap)&&sB.registerPlugin&&sB,hB=()=>{sB=lB(),sB?(sB.registerEase("_CE",pB.create),uB=1):console.warn("Please gsap.registerPlugin(CustomEase)")},cB=t=>~~(1e3*t+(t<0?-.5:.5))/1e3,dB=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,fB=/[cLlsSaAhHvVtTqQ]/g,vB=function(t,e,i,n,r,a,o,s,u,l,h){let c,d=(t+i)/2,f=(e+n)/2,v=(i+r)/2,p=(n+a)/2,g=(r+o)/2,y=(a+s)/2,m=(d+v)/2,k=(f+p)/2,_=(v+g)/2,b=(p+y)/2,x=(m+_)/2,S=(k+b)/2,w=o-t,A=s-e,T=Math.abs((i-o)*A-(n-s)*w),C=Math.abs((r-o)*A-(a-s)*w);return l||(l=[{x:t,y:e},{x:o,y:s}],h=1),l.splice(h||l.length-1,0,{x:x,y:S}),(T+C)*(T+C)>u*(w*w+A*A)&&(c=l.length,vB(t,e,d,f,m,k,x,S,u,l,h),vB(x,S,_,b,g,y,o,s,u,l,h+1+(l.length-c))),l};class pB{constructor(t,e,i){uB||hB(),this.id=t,this.setData(e,i)}setData(t,e){e=e||{};let i,n,r,a,o,s,u,l,h,c=(t=t||"0,0,1,1").match(dB),d=1,f=[],v=[],p=e.precision||1,g=p<=1;if(this.data=t,(fB.test(t)||~t.indexOf("M")&&t.indexOf("C")<0)&&(c=function(t){let e,i,n,r,a,o,s,u,l,h,c,d,f,v,p,g=(t+"").replace($E,(t=>{let e=+t;return e<1e-4&&e>-1e-4?0:e})).match(JE)||[],y=[],m=0,k=0,_=2/3,b=g.length,x=0,S="ERROR: malformed path: "+t,w=function(t,e,i,n){h=(i-t)/3,c=(n-e)/3,s.push(t+h,e+c,i-h,n-c,i,n)};if(!t||!isNaN(g[0])||isNaN(g[1]))return console.log(S),y;for(e=0;e<b;e++)if(f=a,isNaN(g[e])?(a=g[e].toUpperCase(),o=a!==g[e]):e--,n=+g[e+1],r=+g[e+2],o&&(n+=m,r+=k),e||(u=n,l=r),"M"===a)s&&(s.length<8?y.length-=1:x+=s.length),m=u=n,k=l=r,s=[n,r],y.push(s),e+=2,a="L";else if("C"===a)s||(s=[0,0]),o||(m=k=0),s.push(n,r,m+1*g[e+3],k+1*g[e+4],m+=1*g[e+5],k+=1*g[e+6]),e+=6;else if("S"===a)h=m,c=k,"C"!==f&&"S"!==f||(h+=m-s[s.length-4],c+=k-s[s.length-3]),o||(m=k=0),s.push(h,c,n,r,m+=1*g[e+3],k+=1*g[e+4]),e+=4;else if("Q"===a)h=m+(n-m)*_,c=k+(r-k)*_,o||(m=k=0),m+=1*g[e+3],k+=1*g[e+4],s.push(h,c,m+(n-m)*_,k+(r-k)*_,m,k),e+=4;else if("T"===a)h=m-s[s.length-4],c=k-s[s.length-3],s.push(m+h,k+c,n+(m+1.5*h-n)*_,r+(k+1.5*c-r)*_,m=n,k=r),e+=2;else if("H"===a)w(m,k,m=n,k),e+=1;else if("V"===a)w(m,k,m,k=n+(o?k-m:0)),e+=1;else if("L"===a||"Z"===a)"Z"===a&&(n=u,r=l,s.closed=!0),("L"===a||iB(m-n)>.5||iB(k-r)>.5)&&(w(m,k,n,r),"L"===a&&(e+=2)),m=n,k=r;else if("A"===a){if(v=g[e+4],p=g[e+5],h=g[e+6],c=g[e+7],i=7,v.length>1&&(v.length<3?(c=h,h=p,i--):(c=p,h=v.substr(2),i-=2),p=v.charAt(1),v=v.charAt(0)),d=oB(m,k,+g[e+1],+g[e+2],+g[e+3],+v,+p,(o?m:0)+1*h,(o?k:0)+1*c),e+=i,d)for(i=0;i<d.length;i++)s.push(d[i]);m=s[s.length-2],k=s[s.length-1]}else console.log(S);return e=s.length,e<6?(y.pop(),e=0):s[0]===s[e-2]&&s[1]===s[e-1]&&(s.closed=!0),y.totalPoints=x+e,y}(t)[0]),i=c.length,4===i)c.unshift(0,0),c.push(1,1),i=8;else if((i-2)%6)throw"Invalid CustomEase";for(0==+c[0]&&1==+c[i-2]||((t,e,i)=>{i||0===i||(i=Math.max(+t[t.length-1],+t[1]));let n,r=-1*+t[0],a=-i,o=t.length,s=1/(+t[o-2]+r),u=-e||(Math.abs(+t[o-1]-+t[1])<.01*(+t[o-2]-+t[0])?(t=>{let e,i=t.length,n=1e20;for(e=1;e<i;e+=6)+t[e]<n&&(n=+t[e]);return n})(t)+a:+t[o-1]+a);for(u=u?1/u:-s,n=0;n<o;n+=2)t[n]=(+t[n]+r)*s,t[n+1]=(+t[n+1]+a)*u})(c,e.height,e.originY),this.segment=c,a=2;a<i;a+=6)n={x:+c[a-2],y:+c[a-1]},r={x:+c[a+4],y:+c[a+5]},f.push(n,r),vB(n.x,n.y,+c[a],+c[a+1],+c[a+2],+c[a+3],r.x,r.y,1/(2e5*p),f,f.length-1);for(i=f.length,a=0;a<i;a++)u=f[a],l=f[a-1]||u,(u.x>l.x||l.y!==u.y&&l.x===u.x||u===l)&&u.x<=1?(l.cx=u.x-l.x,l.cy=u.y-l.y,l.n=u,l.nx=u.x,g&&a>1&&Math.abs(l.cy/l.cx-f[a-2].cy/f[a-2].cx)>2&&(g=0),l.cx<d&&(l.cx?d=l.cx:(l.cx=.001,a===i-1&&(l.x-=.001,d=Math.min(d,.001),g=0)))):(f.splice(a--,1),i--);if(i=1/d+1|0,o=1/i,s=0,u=f[0],g){for(a=0;a<i;a++)h=a*o,u.nx<h&&(u=f[++s]),n=u.y+(h-u.x)/u.cx*u.cy,v[a]={x:h,cx:o,y:n,cy:0,nx:9},a&&(v[a-1].cy=n-v[a-1].y);v[i-1].cy=f[f.length-1].y-n}else{for(a=0;a<i;a++)u.nx<a*o&&(u=f[++s]),v[a]=u;s<f.length-1&&(v[a-1]=f[f.length-2])}return this.ease=t=>{let e=v[t*i|0]||v[i-1];return e.nx<t&&(e=e.n),e.y+(t-e.x)/e.cx*e.cy},this.ease.custom=this,this.id&&sB&&sB.registerEase(this.id,this.ease),this}getSVGData(t){return pB.getSVGData(this,t)}static create(t,e,i){return new pB(t,e,i).ease}static register(t){sB=t,hB()}static get(t){return sB.parseEase(t)}static getSVGData(t,e){let i,n,r,a,o,s,u,l,h,c,d=(e=e||{}).width||100,f=e.height||100,v=e.x||0,p=(e.y||0)+f,g=sB.utils.toArray(e.path)[0];if(e.invert&&(f=-f,p=0),"string"==typeof t&&(t=sB.parseEase(t)),t.custom&&(t=t.custom),t instanceof pB)i=function(t){"number"==typeof t[0]&&(t=[t]);let e,i,n,r,a="",o=t.length;for(i=0;i<o;i++){for(r=t[i],a+="M"+aB(r[0])+","+aB(r[1])+" C",e=r.length,n=2;n<e;n++)a+=aB(r[n++])+","+aB(r[n++])+" "+aB(r[n++])+","+aB(r[n++])+" "+aB(r[n++])+","+aB(r[n])+" ";r.closed&&(a+="z")}return a}(function(t,e,i,n,r,a,o){let s,u,l,h,c,d=t.length;for(;--d>-1;)for(s=t[d],u=s.length,l=0;l<u;l+=2)h=s[l],c=s[l+1],s[l]=h*e+c*n+a,s[l+1]=h*i+c*r+o;return t._dirty=1,t}([t.segment],d,0,0,-f,v,p));else{for(i=[v,p],u=Math.max(5,200*(e.precision||1)),a=1/u,u+=2,l=5/u,h=cB(v+a*d),c=cB(p+t(a)*-f),n=(c-p)/(h-v),r=2;r<u;r++)o=cB(v+r*a*d),s=cB(p+t(r*a)*-f),(Math.abs((s-c)/(o-h)-n)>l||r===u-1)&&(i.push(h,c),n=(s-c)/(o-h)),h=o,c=s;i="M"+i.join(",")}return g&&g.setAttribute("d",i),i}}lB()&&sB.registerPlugin(pB);class gB extends Qr{constructor(t,e,i,n,r){super(t,e,i,n,r);const{dy:a=20,customEase:o}=r||{};this.dy=a,o&&(this.customEase=o)}getEndProps(){return this.to}getFromProps(){return this.from}onBind(){this.target&&this.target.setAttributes(this.from)}onUpdate(t,e,i){const n=this.customEase?this.customEase(e):e;i.dy=-this.dy*n}}function yB(t){var e;return null!==(e=Array.isArray(t.payload)?t.payload[0]:t.payload)&&void 0!==e?e:{}}class mB extends IE{constructor(){super(),this.name="appearOrDisAppear"}getStartTimeAndDuration(t){var e;const{startTime:i=0}=t,{startTime:n=0,duration:r=0}=null!==(e=yB(t).animation)&&void 0!==e?e:{};return{startTime:i+n,duration:r}}run(t,e){const{animation:i}=yB(e),{effect:n="fade"}=null!=i?i:{};__(n).forEach((n=>{const r=this.getEffectFunc(n,"appear"===e.action);r&&r(t,i,n)}))}getEffectFunc(t,e){switch(t){case"scale":return e?GE:WE;case"wipe":return e?KE:XE;case"fade":return e?NE:zE;case"move":return e?ZE:qE}return NE}}class kB extends IE{constructor(){super()}getStartTimeAndDuration(t){var e;const{startTime:i=0}=t,{startTime:n=0,duration:r=0}=null!==(e=yB(t).animation)&&void 0!==e?e:{};return{startTime:i+n,duration:r}}run(t,e){const{animation:i,graphic:n,text:r}=yB(e),{duration:a,easing:o}=i,s=DE(t)[0],u=DE(t)[1];s&&n&&s.animate().to(n,a,o),u&&r&&s.animate().to(r,a,o)}}class _B extends IE{constructor(){super()}getStartTimeAndDuration(t){var e;const{startTime:i=0}=t,{startTime:n=0,duration:r=0}=null!==(e=yB(t).animation)&&void 0!==e?e:{};return{startTime:i+n,duration:r}}run(t,e){const{animation:i,destination:n}=yB(e);!function(t,e,i){const n=LE(t);if(n){const{duration:t,easing:r}=e;i&&n.animate().to(i,t,r)}}(t,i,n)}}class bB extends IE{constructor(){super()}getStartTimeAndDuration(t){var e;const{startTime:i=0}=t,{startTime:n=0,duration:r=0}=null!==(e=yB(t).animation)&&void 0!==e?e:{};return{startTime:i+n,duration:r}}run(t,e){const{animation:i,scale:n}=yB(e);!function(t,e,i){const n=LE(t);if(n){const{duration:t,easing:r}=e;i&&n.animate().to(i,t,r)}}(t,i,n)}}class xB extends IE{constructor(){super()}getStartTimeAndDuration(t){var e;const{startTime:i=0}=t,{startTime:n=0,duration:r=0}=null!==(e=yB(t).animation)&&void 0!==e?e:{};return{startTime:i+n,duration:r}}run(t,e){const i=yB(e),{animation:n}=i;!function(t,e,i){const n=LE(t);if(n){const{duration:t,easing:r}=e,{dy:a}=i;let{customEase:o}=i;const{y1:s,y2:u}=n.AABBBounds,l=Math.abs(s-u),h=null!=o?o:"M0,0 C0,0 0.058,1 0.2,1 0.346,1 0.41,0 0.53,0 0.559,0 0.681,-0.002 0.702,0.011 0.788,0.065 0.774,0.212 0.853,0.212 0.928,0.212 1,0 1,0 ";o=pB.create("bounce",h,{}),n.animate().play(new gB({},{},t,r,{dy:null!=a?a:.2*l,customEase:o}))}}(t,n,i)}}class SB extends mB{constructor(){super()}}const wB=(t,e,i)=>{const{duration:n,easing:r}=e,{disappear:a}=i,o=t.attribute.baseOpacity,s=a?{from:null!=o?o:1,to:0}:{from:0,to:null!=o?o:1};t.setAttributes({baseOpacity:s.from}),t.animate().to({baseOpacity:s.to},n,r)},AB=(t,e,i)=>{const{duration:n,easing:r}=e,{disappear:a,orient:o="width"}=i,s=(t=t.getChildAt(0)).AABBBounds.width(),u=t.AABBBounds.height();if("width"===o){const e=a?{from:s,to:0}:{from:0,to:s};t.setAttributes({width:e.from,height:u,clip:!0}),t.animate().to({width:e.to},n,r)}else{const e=a?{from:u,to:0}:{from:0,to:u};t.setAttributes({width:2*s,height:e.from,clip:!0}),t.animate().to({height:e.to},n,r)}},TB=(t,e,i)=>"grow"===e.effect?AB(t,e,i):wB(t,e,i);const CB=(t,e,i)=>{const{duration:n,easing:r}=e,{disappear:a}=i,o=a?{from:1,to:0}:{from:0,to:1};t.getElementsByType("text").forEach((t=>{t.setAttributes({scaleX:o.from,scaleY:o.from}),t.animate().to({scaleX:o.to,scaleY:o.to},n,r)})),t.getElementsByType("richtext").forEach((t=>{t.setAttributes({scaleX:o.from,scaleY:o.from}),t.animate().to({scaleX:o.to,scaleY:o.to},n,r)}))},EB=(t,e,i)=>{const{duration:n,easing:r}=e,{disappear:a}=i,o=a?{from:1,to:0}:{from:0,to:1};t.getElementsByType("text").forEach((t=>{t.setAttributes({opacity:o.from}),t.animate().to({opacity:o.to},n,r)})),t.getElementsByType("richtext").forEach((t=>{t.setAttributes({opacity:o.from}),t.animate().to({opacity:o.to},n,r)}))},BB=(t,e,i)=>{const{duration:n,easing:r}=e,{disappear:a}=i,o=a?{from:1,to:0}:{from:1,to:1};t.setAttributes({baseOpacity:o.from}),t.animate().to({baseOpacity:o.to},n,r)},RB=(t,e,i)=>{const{duration:n,loop:r,oneByOne:a,easing:o}=e,{disappear:s}=i;return{type:s?"growRadiusOut":"growRadiusIn",duration:n,loop:r,oneByOne:a,easing:o}},MB=(t,e,i)=>{const{duration:n,loop:r,oneByOne:a,easing:o}=e,{disappear:s}=i;return{type:s?"growAngleOut":"growAngleIn",duration:n,loop:r,oneByOne:a,easing:o,options:{overall:!0}}},PB=(t,e,i)=>{const{duration:n,loop:r,oneByOne:a,easing:o}=e,{disappear:s}=i;return{type:s?"fadeOut":"fadeIn",duration:n,loop:r,oneByOne:a,easing:o}},OB=(t,e,i,n)=>{const{duration:r,loop:a,oneByOne:o,easing:s}=e,{disappear:u}=n;return{type:u?i[1]:i[0],duration:r,loop:a,oneByOne:o,easing:s}},IB=(t,e,i)=>{const{duration:n,loop:r,oneByOne:a,easing:o}=e,{disappear:s}=i;return{type:s?"fadeOut":"fadeIn",duration:n,loop:r,oneByOne:a,easing:o}},LB=(t,e,i={center:!1,disappear:!1})=>{var n;const{duration:r,loop:a,oneByOne:o,easing:s}=e,{center:u,disappear:l}=i,h=null!==(n=t.getChart().getSpec().direction)&&void 0!==n?n:"vertical",c=t.getChart().getSpec().xField,d=t.getChart().getSpec().yField,[f,v]=DB(t);return{type:l?u?"growCenterOut":"growHeightOut":u?"growCenterIn":"growHeightIn",duration:r,loop:a,oneByOne:o,easing:s,options:(t,e,i)=>{const n=null==t?void 0:t["vertical"===h?d:c];return"vertical"===h?{overall:null==v?void 0:v.getScale(0).scale(0),orient:n>0?"negative":"positive"}:{overall:null==f?void 0:f.getScale(0).scale(0),orient:n>0?"negative":"positive"}}}};const DB=t=>{const e=t.getChart().getComponentsByKey("axes"),i=e.find((t=>{if(function(t){return"bottom"===t||"top"===t}(t.getOrient()))return!0})),n=e.find((t=>{if(function(t){return"left"===t||"right"===t}(t.getOrient()))return!0}));return[i,n]},FB={appear:{rect:(t,e,i)=>{switch(e.effect){case"grow":return LB(t,e,Object.assign(Object.assign({},i),{center:!1}));case"centerGrow":return LB(t,e,Object.assign(Object.assign({},i),{center:!0}));default:return IB(0,e,Object.assign({},i))}},line:(t,e,i)=>"grow"===e.effect?OB(0,e,["clipIn","clipOut"],i):IB(0,e,i),symbol:(t,e,i)=>"grow"===e.effect?OB(0,e,["scaleIn","scaleOut"],i):IB(0,e,i),text:(t,e,i)=>"grow"===e.effect?OB(0,e,["scaleIn","scaleOut"],i):IB(0,e,i),arc:(t,e,i)=>{switch(e.effect){case"grow":case"growRadius":return RB(t,e,i);case"growAngle":return MB(t,e,i);default:return PB(t,e,i)}},legends:TB,label:(t,e,i)=>{switch(e.effect){case"grow":return CB(t,e,i);case"followGraphic":return BB(t,e,i);default:return EB(t,e,i)}},axis:(t,e,i)=>"grow"===e.effect?function(t,e,i){var n;const r=null===(n=t.name)||void 0===n?void 0:n.includes("grid");r?function(t,e,i){t&&AB(t,e,i)}(t,e,i):function(t,e,i){const{duration:n,easing:r}=e,{disappear:a,direction:o="positive",orient:s}=i,u=t.getElementsByName("axis-line")[0],l=t.getElementsByName("axis-tick-container")[0],h=t.getElementsByName("axis-label-container")[0];if(u&&u.childrenCount>0){const t="height"===s&&("positive"===o||a),e=u.getElementsByType("line")[0];if(e){t&&e.setAttributes({points:e.attribute.points.reverse()});const i=a?{from:{clipRange:1},to:{clipRange:0}}:{from:{clipRange:0},to:{clipRange:1}};e.setAttributes(i.from),e.animate().to(i.to,n,r).onEnd((()=>{t&&e.setAttributes({points:e.attribute.points.reverse()})}))}}const c=a?{from:{opacity:1},to:{opacity:0}}:{from:{opacity:0},to:{opacity:1}};if(l&&l.childrenCount>0){const t=a,e=l.getElementsByType("line");t&&e.reverse(),e.forEach(((i,a)=>{i.setAttributes(c.from),i.animate().wait(n/e.length*a).to(c.to,n/e.length,r).onEnd((()=>{t&&e.reverse()}))}))}if(h&&h.childrenCount>0){const t=a,e=h.getElementsByType("text");t&&e.reverse(),e.forEach(((i,a)=>{i.setAttributes(c.from),i.animate().wait(n/e.length*a).to(c.to,n/e.length,r).onEnd((()=>{t&&e.reverse()}))}))}}(t,e,i)}(t,e,i):wB(t,e,i),title:TB,chart:(t,e,i)=>"grow"===e.effect?((t,e,i)=>{const{duration:n,easing:r}=e,{disappear:a}=i,o=t.attribute.scaleX,s=t.attribute.scaleY,u=a?{fromX:null!=o?o:1,fromY:null!=s?s:1,toX:0,toY:0}:{fromX:0,fromY:0,toX:null!=o?o:1,toY:null!=s?s:1};t.setAttributes({scaleX:u.fromX,scaleY:u.fromY}),t.animate().to({scaleX:u.toX,scaleY:u.toY},n,r)})(t,e,i):wB(t,e,i)}};class jB extends IE{selectBySelector(t,e){let i=!1,n=e.getChart().getAllSeries(),r=e.getChart().getAllComponents();return t.split(" ").forEach((t=>{if("*"===t)i=!0;else if(/:not\(([^)]+)\)/.test(t)){const e=/:not\(([^)]+)\)/.exec(t)[1],i=this.selectByNameOrType(n,r,e,!1);n=i.seriesList,r=i.componentsList}else{const e=this.selectByNameOrType(n,r,t);n=e.seriesList,r=e.componentsList}})),{chart:i,seriesList:n,componentsList:r}}selectByNameOrType(t,e,i,n=!0){return"#"===i?this.selectByName(t,e,i,n):this.selectByType(t,e,i,n)}selectByName(t,e,i,n=!0){const r=i.substring(1);return{seriesList:t.filter((t=>t.name===r===n)),componentsList:e.filter((t=>t.name===r===n))}}selectByType(t,e,i,n=!0){return{seriesList:t.filter((t=>(t.type===i||t.specKey===i)===n)),componentsList:e.filter((t=>(t.type===i||t.specKey===i)===n))}}getStartTimeAndDuration(t){const{startTime:e=0}=t;let i=1/0,n=-1/0;__(t.payload).forEach((t=>{var e;const{startTime:r=0,duration:a=0}=null!==(e=null==t?void 0:t.animation)&&void 0!==e?e:{};i=Math.min(null!=r?r:0,i),n=Math.max(r+a,n)}));let r=e+i,a=n-i;return isFinite(r)||(r=0),isFinite(a)||(a=0),{startTime:r,duration:a}}}class NB extends jB{constructor(){super()}run(t,e){const i=t.graphic._vchart,n=new Set,r=new Set;let a=!1;__(e.payload).reverse().forEach((o=>{var s;const{chart:u,seriesList:l,componentsList:h}=this.selectBySelector(null!==(s=o.selector)&&void 0!==s?s:"*",i);!a&&u&&this.chartVisibility(t.graphic,e.action,o);l.filter((t=>!n.has(t))).forEach((t=>{this.commonSeriesAppear(i,t,e.action,o)}));h.filter((t=>!r.has(t))).forEach((t=>{this.componentAppear(i,t,e.action,o)})),a=a||u,l.forEach((t=>n.add(t))),h.forEach((t=>r.add(t)))}))}chartVisibility(t,e,i){const n=FB.appear.chart,r=NB.fadePayload;this.runTransformFunc(t,n,e,i,r)}componentAppear(t,e,i,n){"label"===e.specKey?this.labelComponentAppear(t,e,i,n):"legends"===e.specKey?this.legendsComponentAppear(t,e,i,n):"axes"===e.specKey?this.axisComponentAppear(t,e,i,n):"title"===e.specKey&&this.titleComponentAppear(t,e,i,n)}labelComponentAppear(t,e,i,n){const r=e.getVRenderComponents(),a=FB.appear.label,o=NB.defaultPayload;r.forEach((t=>{this.runTransformFunc(t,a,i,n,o)}))}legendsComponentAppear(t,e,i,n){const r=e.getVRenderComponents(),a=FB.appear.legends,o=NB.fadePayload;r.forEach((t=>{this.runTransformFunc(t,a,i,n,o)}))}axisComponentAppear(t,e,i,n){var r;const a=e.getVRenderComponents(),o=a[0];if(!o)return;const s=a[1],u=null===(r=o.attribute)||void 0===r?void 0:r.orient;"angle"===u||"radius"===u?this.polarAxisAppear(o,s,i,n):this.cartesianAxisAppear(o,s,i,n)}cartesianAxisAppear(t,e,i,n){var r,a,o;const s=null===(r=t.attribute)||void 0===r?void 0:r.orient,u="left"===s||"right"===s?"height":"width",l="left"===s||"right"===s?"width":"height",h=function(t,e){if(!t)return 1;let i=!0,n=!0;for(let r=0;r<t.length-1;r++)t[r][e]>t[r+1][e]&&(i=!1),t[r][e]<t[r+1][e]&&(n=!1);return i?1:n?-1:void 0}((null!==(o=null===(a=t.attribute)||void 0===a?void 0:a.items)&&void 0!==o?o:[[]])[0],"value")<0?"positive":"negative",c=FB.appear.axis,d=NB.defaultPayload;t&&this.runTransformFunc(t,c,i,n,d,{orient:u,direction:h}),e&&this.runTransformFunc(e,c,i,n,d,{orient:l,direction:h})}polarAxisAppear(t,e,i,n){var r;null===(r=t.attribute)||void 0===r||r.items;const a=FB.appear.axis,o=NB.fadePayload;t&&this.runTransformFunc(t,a,i,n,o),e&&this.runTransformFunc(e,a,i,n,o,{})}titleComponentAppear(t,e,i,n){const r=e.getVRenderComponents(),a=FB.appear.title,o=NB.fadePayload;r.forEach((t=>{this.runTransformFunc(t,a,i,n,o)}))}runTransformFunc(t,e,i,n,r={},a={}){if(t&&e){e(t,k_({},r,n).animation,Object.assign({disappear:"disappear"===i},a))}}commonSeriesAppear(t,e,i,n){const r=e.getMarksWithoutRoot();r.length&&r.forEach(((r,a)=>{const o=NB[`${r.type}Payload`],s=k_({},r_(o)?o(e.type):o||{},n),u=r.getProduct(),l=FB.appear[r.type],h=l&&l(t,s.animation,{index:a,disappear:"disappear"===i});u&&u.animate&&u.animate.run(h||{})}))}}NB.rectPayload=t=>({animation:{effect:"treemap"===t?"centerGrow":"grow",duration:2e3,easing:"cubicOut",oneByOne:!1,loop:!1}}),NB.defaultPayload={animation:{effect:"grow",duration:2e3,easing:"cubicOut",oneByOne:!1,loop:!1}},NB.fadePayload={animation:{effect:"fade",duration:2e3,easing:"cubicOut",oneByOne:!1,loop:!1}},NB.arcPayload={animation:{effect:"growAngle",duration:2e3,easing:"cubicOut",oneByOne:!1,loop:!1}},NB.linePayload=NB.defaultPayload,NB.symbolPayload=NB.defaultPayload,NB.textPayload=NB.defaultPayload;class zB extends mB{constructor(){super()}}class UB extends mB{constructor(){super()}}class GB extends mB{constructor(){super()}}Xv();class WB extends Qr{getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){const t=this.target.attachShadow(),e=this.target.getComputedAttribute("fontSize");this.target.attribute.textConfig;const i=qc({x:0,y:0,dy:-e/2,points:[{x:0,y:0},{x:0,y:e}],stroke:"black",lineWidth:1});t.add(i),this.targetTextConfig=p_(this.target.attribute.textConfig||[])}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){var n,r,a;if(!1===this.valid)return;const o=this.targetTextConfig.reduce(((t,e)=>t+e.text?e.text.toString().length:1),0)*e,s=[];let u=0;this.targetTextConfig.forEach((t=>{if(u>=o)return;const e=t.text?t.text.toString().length:1;u+e<o?(s.push(t),u+=e):(s.push(Object.assign(Object.assign({},t),{text:t.text.substr(0,o-u)})),u=o)})),this.target.setAttributes({textConfig:s});const l=this.target.getFrameCache();if(!l.lines||!l.lines.length)return;const h=l.lines[l.lines.length-1],c=l.left+h.left+h.actualWidth,d=l.top+h.top,f=(null===(r=null===(n=h.paragraphs)||void 0===n?void 0:n[h.paragraphs.length-1])||void 0===r?void 0:r.fontSize)||h.height,v=null===(a=this.target.shadowRoot)||void 0===a?void 0:a.at(0);let p=0;"center"===h.textAlign?p=-h.actualWidth/2:"right"===h.textAlign&&(p=-h.actualWidth),v.setAttributes({x:c+p,y:d,points:[{x:0,y:0},{x:0,y:f}]})}}function VB(t){return t.getGraphicParent()}function HB(t,e){return"chart"===t._graphic.type||"move"===e?[VB(t)]:function(t){return t.getGraphicParent().getChildren()}(t)}function KB(t,e,i){HB(t,i).forEach((t=>YB(t,e,!0)))}function XB(t,e,i){HB(t,i).forEach((t=>YB(t,e,!1)))}function YB(t,e,i){if(t&&("text"===t.type||"richtext"===t.type)){const{duration:n,easing:r}=e,{text:a}=t.attribute;if(h_(a)){let e="",o=a;i||([e,o]=[o,e]),t.animate().play(new WB({text:e},{text:o},n,r))}}}class qB extends mB{constructor(){super()}getEffectFunc(t,e){return"typewriter"===t?e?KB:XB:super.getEffectFunc(t,e)}}function ZB(t,e,i){HB(t,i).forEach((t=>function(t,e){if(t&&"text"!==t.type&&"richtext"!==t.type){const{duration:i,easing:n}=e;t.appearAnimate({duration:i,easing:n})}}(t,e)))}class JB extends mB{constructor(){super(),this.name="appearOrDisAppear"}getEffectFunc(t="default",e){return"default"===t?ZB:super.getEffectFunc(t,e)}}function $B(t,e,i){HB(t,i).forEach((t=>function(t,e){if(t&&"text"!==t.type&&"richtext"!==t.type){const{duration:i,easing:n}=e;t.forward({duration:i,easing:n})}}(t,e)))}function QB(t,e,i){HB(t,i).forEach((t=>function(t,e){if(t&&"text"!==t.type&&"richtext"!==t.type){const{duration:i,easing:n}=e;t.backward({duration:i,easing:n})}}(t,e)))}function tR(t,e,i){if(!e)return!1;const{index:n}=i;return!(!o_(n)||n===e.getMaxIndex())&&(t.changePlayerIndex(e.getDataIndex()),!0)}const eR={VChart:{[AE]:new NB,[TE]:new NB,[ME]:new xB,[PE]:new class extends jB{constructor(){super()}run(t,e){const i=t.graphic._vchart;if(!i)return;const{payload:n}=e,{id:r,data:a,values:o}=n;if(o)i.updateDataSync(r,o);else{const t=p_(i._dataSet.getDataView(r).rawData);(c_(a)?a:[a]).forEach((e=>{const{sourceValue:i,targetValue:n}=e,r=t.findIndex((t=>((t,e)=>{for(const i in e)if(e.hasOwnProperty(i)&&(!t.hasOwnProperty(i)||t[i]!==e[i]))return!1;return!0})(t,i)));-1!==r&&t.splice(r,1,n)})),i.updateDataSync(r,t)}}},[OE]:new class extends jB{constructor(){super()}run(t,e){const i=t.graphic._vchart;if(!i)return;const{payload:n}=e,{id:r,values:a}=n,o=p_(i._dataSet.getDataView(r).rawData),s=c_(a)?a:[a];o.push(...s),i.updateDataSync(r,o)}}},RankingBar:{[AE]:new NB,[TE]:new NB,[ME]:new xB,play:new class extends IE{constructor(){super(),this.duration=0,this.interval=0,this.count=0,this.done=!1,this.forward=t=>{o_(this.start)||(this.start=t,this.vrenderPlayer.play());const e=(t-this.start)/this.duration,i=Math.floor(Math.min(e*this.count,this.count));if(!(i<this.count-1))return this.start=void 0,this.prevIndex=void 0,void bf.getCancelAnimationFrame()(this.rafId);if(this.prevIndex!==i){tR(this.vchartPlayer,this.vrenderPlayer,{index:i,progress:e})&&(this.prevIndex=i)}else tR(this.vchartPlayer,this.vrenderPlayer,{progress:e});this.rafId=bf.getRequestAnimationFrame()(this.forward.bind(this))}}getStartTimeAndDuration(t,e){var i,n,r,a,o,s,u,l;const{startTime:h=0}=t,{startTime:c=0}=null!==(n=null===(i=t.payload)||void 0===i?void 0:i.animation)&&void 0!==n?n:{},d=e.graphic._vchart,f=null!==(a=null===(r=null==d?void 0:d.getSpec())||void 0===r?void 0:r.interval)&&void 0!==a?a:0,v=null!==(l=null===(u=null===(s=null===(o=null==d?void 0:d.getSpec())||void 0===o?void 0:o.player)||void 0===s?void 0:s.specs)||void 0===u?void 0:u.length)&&void 0!==l?l:0,p=f*v,g=h+c;return this.duration=p,this.interval=f,this.count=v,{startTime:g,duration:p}}run(t,e){const i=t.graphic._vchart;if(!i)return;const n=i.getComponents().find((t=>"player"===t.type));if(!n)return;const r=n.getVRenderComponents()[0];r&&(this.vchartPlayer=n,this.vrenderPlayer=r,this.rafId=bf.getRequestAnimationFrame()(this.forward.bind(this)))}}}},iR={[D_.RECT]:{[AE]:new UB,[TE]:new UB,[CE]:new kB,[EE]:new _B,[BE]:new bB,[ME]:new xB},[D_.LINE]:{[AE]:new zB,[TE]:new zB,[CE]:new kB,[EE]:new _B,[BE]:new bB,[ME]:new xB},[D_.SHAPE]:{[AE]:new GB,[TE]:new GB,[CE]:new kB,[EE]:new _B,[BE]:new bB,[ME]:new xB},[D_.IMAGE]:{[AE]:new SB,[TE]:new SB,[CE]:new kB,[EE]:new _B,[BE]:new bB,[ME]:new xB},[D_.TEXT]:{[AE]:new qB,[TE]:new qB,[CE]:new kB,[EE]:new _B,[BE]:new bB,[ME]:new xB},[D_.TIMELINE]:{[AE]:new JB,[TE]:new JB,[CE]:new kB,[EE]:new _B,[BE]:new bB,[RE]:new class extends mB{constructor(){super(),this.name="state"}getEffectFunc(t="forward",e){switch(t){case"forward":return $B;case"backward":return QB}return $B}},[ME]:new xB}},nR=Object.assign(Object.assign({},eR),iR);class rR{constructor(t,e,i,n){this.startTime=t,this.duration=e,this.actionSpec=i,this.characterId=n}}class aR{constructor(t){this._actionProcessor=t,this._runnedAct=new Set}init(t){this.clearState(),this.initActs(t)}clearState(){this._runnedAct.clear()}getTotalTime(){return this._actsInfo.reduce(((t,e)=>Math.max(t,e.startTime+e.duration)),0)}findActByTime(t){if(this.getTotalTime()<=0)return{actInfo:this._actsInfo[0],t:0};for(let e=0;e<this._actsInfo.length;e++){const i=this._actsInfo[e];if(i.startTime<=t&&i.startTime+i.duration>t)return{actInfo:i,t:t-i.startTime}}return{actInfo:this._actsInfo[this._actsInfo.length-1],t:t-this._actsInfo[this._actsInfo.length-1].startTime}}getActionsInRange(t,e){this.findActByTime(t);const{actInfo:i,t:n}=this.findActByTime(e),r=[];return i.sceneInfoList.forEach((t=>{const{startTime:e}=t;t.actionList.forEach((t=>{e+t.startTime<=n&&(this._runnedAct.has(t)||(this._runnedAct.add(t),r.push(t)))}))})),r}initActs(t){let e=0;this._actsInfo=t.map((t=>{const i=this._getActInfo(t,e);return e+=i.duration,i}))}_getActInfo(t,e){let i=0;const n=t.scenes.map((t=>{var e;const n=this._getSceneInfo(t,i+(null!==(e=t.delay)&&void 0!==e?e:0));return i=n.startTime+n.duration,n})),r=n.reduce(((t,e)=>Math.min(e.startTime,t)),0);return{startTime:e,duration:r+n.reduce(((t,e)=>Math.max(e.startTime+e.duration,t)),0)-r,id:t.id,sceneInfoList:n}}_getSceneInfo(t,e){let i=0;const n=[];t.actions.forEach(((t,e)=>{let r=1/0,a=-1/0;t.characterActions.forEach((e=>{(h_(t.characterId)?[t.characterId]:t.characterId).forEach((t=>{const i=this._actionProcessor.getActInfo(t,e);if(!i)return;const o=new rR(i.startTime,i.duration,e,t);r=Math.max(Math.min(o.startTime,r),0),a=Math.max(o.startTime+o.duration,a),n.push(o)}))})),i=e?Math.max(a,i):a}));return{startTime:e,duration:i,id:t.id,actionList:n}}}class oR{constructor(){this.rafIdx=0,this.speed=1,this._tick=t=>{if(!this.running)return;const e=Date.now();this.rafIdx=requestAnimationFrame((()=>this._tick(e))),this.cb&&this.cb((0===t?0:e-t)*this.speed)}}start(t){this.stop(),this.cb=t,this.running=!0,this._tick(0)}stop(){this.rafIdx&&cancelAnimationFrame(this.rafIdx),this.rafIdx=0,this.running=!1}}class sR extends ht{set speed(t){this._scheduler&&(this._ticker.speed=t)}get speed(){return this._ticker?this._ticker.speed:1}constructor(t,e){var i,n;super(),this._story=t,this._ticker=new oR,this._currTime=0;const r=this._story.canvas.getStage(),a=null!==(i=null==e?void 0:e.scaleX)&&void 0!==i?i:1,o=null!==(n=null==e?void 0:e.scaleY)&&void 0!==n?n:1;r.window.setViewBoxTransform(a,0,0,o,0,0),this._actionProcessor=new wE(t,nR),this._scheduler=new aR(this._actionProcessor)}initActs(t){this._scheduler.init(t)}reset(){this._scheduler.clearState(),this._story.canvas.getStage().getTimeline().clear(),this._currTime=0}tickTo(t){const e=this._currTime;e>t&&this.reset();const i=this._scheduler.getActionsInRange(e,t),n=new Set;i.forEach((t=>{const e=this._story.getCharactersById(t.characterId);n.add(e),this._actionProcessor.doAction(e.spec.type,t.actionSpec.action,e,t.actionSpec)})),n.forEach((t=>{t.show()})),this._currTime=t;const r=this._story.canvas.getStage();r.ticker.tickAt(t),r.render()}play(){this._ticker.stop(),this._currTime=0,this.reset();const t=this._story.canvas.getStage();t.ticker.start(!0),t.getTimeline().resume(),this._ticker.start((t=>{let e=this._currTime+t;const i=this._scheduler.getTotalTime();e>=i?(e=i,this.tickTo(e),this._ticker.stop(),this.emit("onstop")):this.tickTo(e)}))}encodeToVideo(t,e){return T_(this,void 0,void 0,(function*(){return null}))}pause(){this._ticker.stop()}resume(){this._ticker._tick(this._currTime)}release(){}}Mf.remTimeline($r);class uR{get canvas(){return this._canvas}get player(){return this._player}constructor(t,e){this.id="test-mvp_"+uR._id_++,this._canvas=new _E(this,h_(e.dom)?document.getElementById(e.dom):e.dom),this._player=new sR(this,e.playerOption),this._characterTree=new bE(this),t&&this.load(t)}load(t){this._spec=t,t&&(this._characterTree.initCharacters(t.characters),this._player.initActs(t.acts))}getCharacters(){return this._characterTree.getCharacters()}getCharactersById(t){return this._characterTree.getCharactersById(t)}play(t=!0){this._spec&&this.load(this._spec),this._player.play(),t&&this._player.once("onstop",(()=>{this.play(t)}))}pause(){this._player.pause()}encodeToVideo(t,e,i){return T_(this,void 0,void 0,(function*(){return this._player.encodeToVideo(e,i)}))}getPlayer(){return this._player}release(){this._player.release(),this._canvas.release()}}uR._id_=0;const lR=new x((t=>{t(V_).toSelf().inSingletonScope(),t(W_).toService(V_),t(Tl).toService(W_),t(X_).to(X_).inSingletonScope(),t(Cp).toService(X_),t(cE).toSelf().inSingletonScope(),t(Tl).toService(cE)})),hR=new x((t=>{t(rv).toSelf(),t(zd).toService(rv)}));let cR=!1;function dR(){cR||(cR=!0,N_.registerCharacter(lE.type,lE),N_.registerCharacter(kE.type,kE),N_.registerCharacter(D_.RECT,j_),N_.registerCharacter(D_.TEXT,K_),N_.registerCharacter(D_.QIPAO,O_),N_.registerCharacter(D_.LINE,q_),N_.registerCharacter(D_.IMAGE,J_),N_.registerCharacter(D_.SHAPE,Q_),N_.registerCharacter(D_.TIMELINE,fE),or.load(lR),or.load(hR))}dR();const fR={pointerup:!0,click:!0,pointerdown:!0,dblclick:!0};var vR;t.EditActionEnum=void 0,(vR=t.EditActionEnum||(t.EditActionEnum={})).singleSelection="singleSelect",vR.multipleSelection="multipleSelect",vR.unSelection="unSelect",vR.pointerOverCharacter="pointerOverCharacter",vR.pointerOutCharacter="pointerOutCharacter",vR.richTextPluginEdit="richTextPluginEdit";const pR={mousemove:!0,mouseout:!0,mouseover:!0},gR={pointerover:!0,pointerout:!0,pointermove:!0};class yR{get actionInProgress(){return this._actionInProgress}constructor(t){this.story=t,this.emitter=new ht,this._actionInProgress=null,this.lastOverGraphic=null,this.richTextPluginEvent()}richTextPluginEvent(){this.story.canvas.getStage().pluginService.findPluginsByName("RichTextEditPlugin")[0].registerUpdateListener(((e,i)=>{this.emitter.emit(t.EditActionEnum.richTextPluginEdit,{type:e,p:i})}))}onStoryEvent(e,i){if(pR[i])return;if(i.endsWith("capture"))return;if(this.processOverEvent(e,i),e.detailPath&&e.path[e.path.length-1]!==e.detailPath[e.path.length-1]&&delete e.detailPath,!fR[i])return this.dispatchAction({type:i,event:e});const{characterInfo:n,character:r}=this.story.canvas.getEventDetail(e);"click"===i&&r?i=t.EditActionEnum.singleSelection:"pointerdown"!==i||r||(i=t.EditActionEnum.unSelection),this.dispatchAction({type:i,characterId:null==r?void 0:r.id,character:r,event:e,detail:n})}processOverEvent(e,i){var n;if(!gR[i])return;const{characterInfo:r,character:a}=this.story.canvas.getEventDetail(e);let o=e.path[e.path.length-1];const s=e.detailPath;if(s){const t=s[s.length-1];c_(t)&&(o=t[t.length-1])}let u=null;if("pointerover"===i)a&&(u=t.EditActionEnum.pointerOverCharacter);else if("pointerout"===i)this.lastOverGraphic&&a&&a===this.lastOverGraphic.character&&o&&o===this.lastOverGraphic.detailTarget&&(u=t.EditActionEnum.pointerOutCharacter);else{if(!this.lastOverGraphic)return;if(a!==this.lastOverGraphic.character)u=t.EditActionEnum.pointerOutCharacter;else{if(o===this.lastOverGraphic.detailTarget)return;this.dispatchAction({type:t.EditActionEnum.pointerOutCharacter,characterId:null===(n=this.lastOverGraphic.character)||void 0===n?void 0:n.id,character:this.lastOverGraphic.character,event:e,detail:this.lastOverGraphic.characterInfo}),u=t.EditActionEnum.pointerOverCharacter}}u&&(this.dispatchAction({type:u,characterId:null==a?void 0:a.id,character:a,event:e,detail:r}),u===t.EditActionEnum.pointerOverCharacter?this.lastOverGraphic={characterInfo:r,character:a,detailTarget:o}:u===t.EditActionEnum.pointerOutCharacter&&(this.lastOverGraphic=null))}dispatchAction(t){this.emitter.emit("dispatchAction",t)}}class mR{static registerEditComponent(t,e){mR.componentConstructorMap[t]=e}constructor(t){this.story=t,this._componentMap={},this.emitter=new ht,this.editAction=new yR(t),this.editAction.emitter.on("dispatchAction",this.onAction.bind(this)),this.story.canvas.getStage().addEventListener("*",this.onStoryEvent.bind(this)),this._initEditGroup(),this._initComponent()}_initEditGroup(){this._editGroup=To({}),this._editGroup.name="edit_group";const t=this.story.canvas.getStage().createLayer();t.add(this._editGroup),this._overGraphicGroup=To({}),this._overGraphicGroup.name="over_group",t.add(this._overGraphicGroup)}getEditGroup(){return this._editGroup}_initComponent(){this._componentMap={},Object.keys(mR.componentConstructorMap).forEach((t=>{this._componentMap[t]=new mR.componentConstructorMap[t](this)})),this._componentList=Object.values(this._componentMap).sort(((t,e)=>t.level-e.level)).reverse()}onStoryEvent(t,e){if(t.path.find((t=>t===this._editGroup||t===this._overGraphicGroup))){if(!t.path[t.path.length-1].isContainer)return}this.editAction.onStoryEvent(t,e)}onAction(e){if(this._currentComponent){if(this._currentComponent.checkAction(e))return;e.type===t.EditActionEnum.unSelection&&this.stopEdit()}for(let t=0;t<this._componentList.length;t++){const i=this._componentList[t];if(i.checkAction(e))return this.stopEdit(),void(this._currentComponent=i)}}startEdit(t){this.dispatchEditAction("startEdit",t)}dispatchEditAction(t,e){this.emitter.emit(t,e)}triggerEditWithEvent(t){}triggerEditWithComponent(t,e){}stopEdit(){var t;null===(t=this._currentComponent)||void 0===t||t.editEnd(),this._currentComponent=null}release(){var t,e;null===(e=null===(t=this.story.canvas)||void 0===t?void 0:t.getStage)||void 0===e||e.call(t).removeEventListener("*",this.onStoryEvent)}showOverGraphic(t,e=!0){e&&this._overGraphicGroup.removeAllChild(!0),this._overGraphicGroup.add(t)}}mR.componentConstructorMap={};const kR=["seriesId","text"];function _R(t,e,i,n,r={ignoreIdMatch:!1}){if(!a_(t.id)){const i=t.id===e.id;if(i||!0!==r.ignoreIdMatch)return i}return t.specKey===i&&t.specIndex===n}function bR(t,e,i=!1){if(e){if(t===e)return;if(o_(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];o_(n[a])&&"object"==typeof n[a]?xR(t,e,a,i):SR(t,a,n[a])}}}}function xR(t,e,i,n=!1){const r=t[i],a=e[i];let o=e[i],s=!0;if(kR.includes(i))s=!1;else if(c_(a)){if(n||!r)o=[];else if(c_(r))o=r;else if(d_(r)&&!h_(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)o[t]=r[t]}}else l_(a)?(o=null!=r?r:{},"function"!=typeof r&&"object"==typeof r||(o={})):s=!1;s&&bR(o,a,n),SR(t,i,o)}function SR(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}dR(),t.Edit=mR,t.Story=uR,t.axisMarkPick=GC,t.colorLegendMarkPick=qC,t.continuousPlayerMarkPick=QC,t.discreteLegendMarkPick=YC,t.discretePlayerMarkPick=tE,t.findChartSpec=function(t,e){const i=e[t.specKey];return i?c_(i)?i.find(((e,i)=>_R(t,e,t.specKey,i))):s_(i)&&_R(t,i,t.specKey,0)?i:null:null},t.getChartModelWithEvent=iE,t.getGraphicModelMark=nE,t.getLayoutFromWidget=x_,t.isModelInfoMatchSpec=_R,t.labelMarkPick=KC,t.markerMarkPick=HC,t.mergeSpec=function(t,...e){let i=-1;const n=e.length;for(;++i<n;){bR(t,e[i],!1)}return t},t.registerCharacter=dR,t.scrollBarMarkPick=JC,t.seriesMarkPick=UC,t.sizeLegendMarkPick=ZC,t.titleBarMarkPick=$C}));