@antv/g-lite 2.1.0-alpha.0 → 2.1.1

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 (293) hide show
  1. package/dist/index.esm.js +12802 -13120
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +12826 -13130
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.umd.min.js +17 -1
  6. package/dist/index.umd.min.js.map +1 -1
  7. package/package.json +7 -4
  8. package/{dist → types}/AbstractRenderer.d.ts +1 -0
  9. package/types/AbstractRenderer.d.ts.map +1 -0
  10. package/{dist → types}/Canvas.d.ts +1 -0
  11. package/types/Canvas.d.ts.map +1 -0
  12. package/{dist → types}/camera/Camera.d.ts +1 -0
  13. package/types/camera/Camera.d.ts.map +1 -0
  14. package/{dist → types}/camera/Landmark.d.ts +1 -0
  15. package/types/camera/Landmark.d.ts.map +1 -0
  16. package/{dist → types}/camera/index.d.ts +1 -0
  17. package/types/camera/index.d.ts.map +1 -0
  18. package/{dist → types}/camera/interfaces.d.ts +1 -0
  19. package/types/camera/interfaces.d.ts.map +1 -0
  20. package/{dist → types}/components/Cullable.d.ts +1 -0
  21. package/types/components/Cullable.d.ts.map +1 -0
  22. package/{dist → types}/components/Geometry.d.ts +1 -0
  23. package/types/components/Geometry.d.ts.map +1 -0
  24. package/{dist → types}/components/RBushNode.d.ts +1 -0
  25. package/types/components/RBushNode.d.ts.map +1 -0
  26. package/{dist → types}/components/Renderable.d.ts +1 -0
  27. package/types/components/Renderable.d.ts.map +1 -0
  28. package/{dist → types}/components/Sortable.d.ts +1 -0
  29. package/types/components/Sortable.d.ts.map +1 -0
  30. package/{dist → types}/components/Transform.d.ts +1 -0
  31. package/types/components/Transform.d.ts.map +1 -0
  32. package/{dist → types}/components/index.d.ts +1 -0
  33. package/types/components/index.d.ts.map +1 -0
  34. package/{dist → types}/css/CSS.d.ts +1 -0
  35. package/types/css/CSS.d.ts.map +1 -0
  36. package/{dist → types}/css/CSSProperty.d.ts +1 -0
  37. package/types/css/CSSProperty.d.ts.map +1 -0
  38. package/{dist → types}/css/CSSStyleValuePool.d.ts +1 -0
  39. package/types/css/CSSStyleValuePool.d.ts.map +1 -0
  40. package/{dist → types}/css/StyleValueRegistry.d.ts +1 -0
  41. package/types/css/StyleValueRegistry.d.ts.map +1 -0
  42. package/{dist → types}/css/cssom/CSSColorValue.d.ts +1 -0
  43. package/types/css/cssom/CSSColorValue.d.ts.map +1 -0
  44. package/{dist → types}/css/cssom/CSSGradientValue.d.ts +1 -0
  45. package/types/css/cssom/CSSGradientValue.d.ts.map +1 -0
  46. package/{dist → types}/css/cssom/CSSKeywordValue.d.ts +1 -0
  47. package/types/css/cssom/CSSKeywordValue.d.ts.map +1 -0
  48. package/{dist → types}/css/cssom/CSSNumericValue.d.ts +1 -0
  49. package/types/css/cssom/CSSNumericValue.d.ts.map +1 -0
  50. package/{dist → types}/css/cssom/CSSRGB.d.ts +1 -0
  51. package/types/css/cssom/CSSRGB.d.ts.map +1 -0
  52. package/{dist → types}/css/cssom/CSSStyleValue.d.ts +2 -1
  53. package/types/css/cssom/CSSStyleValue.d.ts.map +1 -0
  54. package/{dist → types}/css/cssom/index.d.ts +1 -0
  55. package/types/css/cssom/index.d.ts.map +1 -0
  56. package/{dist → types}/css/cssom/types.d.ts +1 -0
  57. package/types/css/cssom/types.d.ts.map +1 -0
  58. package/{dist → types}/css/index.d.ts +1 -0
  59. package/types/css/index.d.ts.map +1 -0
  60. package/{dist → types}/css/interfaces.d.ts +1 -0
  61. package/types/css/interfaces.d.ts.map +1 -0
  62. package/{dist → types}/css/parser/color.d.ts +1 -0
  63. package/types/css/parser/color.d.ts.map +1 -0
  64. package/{dist → types}/css/parser/dimension.d.ts +1 -0
  65. package/types/css/parser/dimension.d.ts.map +1 -0
  66. package/{dist → types}/css/parser/filter.d.ts +1 -0
  67. package/types/css/parser/filter.d.ts.map +1 -0
  68. package/{dist → types}/css/parser/gradient.d.ts +1 -0
  69. package/types/css/parser/gradient.d.ts.map +1 -0
  70. package/{dist → types}/css/parser/index.d.ts +1 -0
  71. package/types/css/parser/index.d.ts.map +1 -0
  72. package/{dist → types}/css/parser/numeric.d.ts +1 -0
  73. package/types/css/parser/numeric.d.ts.map +1 -0
  74. package/{dist → types}/css/parser/path.d.ts +1 -0
  75. package/types/css/parser/path.d.ts.map +1 -0
  76. package/{dist → types}/css/parser/points.d.ts +1 -0
  77. package/types/css/parser/points.d.ts.map +1 -0
  78. package/{dist → types}/css/parser/transform-origin.d.ts +1 -0
  79. package/types/css/parser/transform-origin.d.ts.map +1 -0
  80. package/{dist → types}/css/parser/transform.d.ts +1 -0
  81. package/types/css/parser/transform.d.ts.map +1 -0
  82. package/{dist → types}/css/parser/types.d.ts +1 -0
  83. package/types/css/parser/types.d.ts.map +1 -0
  84. package/{dist → types}/css/properties/CSSPropertyAngle.d.ts +1 -0
  85. package/types/css/properties/CSSPropertyAngle.d.ts.map +1 -0
  86. package/{dist → types}/css/properties/CSSPropertyClipPath.d.ts +1 -0
  87. package/types/css/properties/CSSPropertyClipPath.d.ts.map +1 -0
  88. package/{dist → types}/css/properties/CSSPropertyColor.d.ts +2 -1
  89. package/types/css/properties/CSSPropertyColor.d.ts.map +1 -0
  90. package/{dist → types}/css/properties/CSSPropertyFilter.d.ts +1 -0
  91. package/types/css/properties/CSSPropertyFilter.d.ts.map +1 -0
  92. package/{dist → types}/css/properties/CSSPropertyLengthOrPercentage.d.ts +1 -0
  93. package/types/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -0
  94. package/{dist → types}/css/properties/CSSPropertyLengthOrPercentage12.d.ts +1 -0
  95. package/types/css/properties/CSSPropertyLengthOrPercentage12.d.ts.map +1 -0
  96. package/{dist → types}/css/properties/CSSPropertyLengthOrPercentage14.d.ts +1 -0
  97. package/types/css/properties/CSSPropertyLengthOrPercentage14.d.ts.map +1 -0
  98. package/{dist → types}/css/properties/CSSPropertyMarker.d.ts +1 -0
  99. package/types/css/properties/CSSPropertyMarker.d.ts.map +1 -0
  100. package/{dist → types}/css/properties/CSSPropertyNumber.d.ts +1 -0
  101. package/types/css/properties/CSSPropertyNumber.d.ts.map +1 -0
  102. package/{dist → types}/css/properties/CSSPropertyOffsetDistance.d.ts +1 -0
  103. package/types/css/properties/CSSPropertyOffsetDistance.d.ts.map +1 -0
  104. package/{dist → types}/css/properties/CSSPropertyOpacity.d.ts +1 -0
  105. package/types/css/properties/CSSPropertyOpacity.d.ts.map +1 -0
  106. package/{dist → types}/css/properties/CSSPropertyPath.d.ts +1 -0
  107. package/types/css/properties/CSSPropertyPath.d.ts.map +1 -0
  108. package/{dist → types}/css/properties/CSSPropertyPoints.d.ts +1 -0
  109. package/types/css/properties/CSSPropertyPoints.d.ts.map +1 -0
  110. package/{dist → types}/css/properties/CSSPropertyShadowBlur.d.ts +1 -0
  111. package/types/css/properties/CSSPropertyShadowBlur.d.ts.map +1 -0
  112. package/{dist → types}/css/properties/CSSPropertyText.d.ts +1 -0
  113. package/types/css/properties/CSSPropertyText.d.ts.map +1 -0
  114. package/{dist → types}/css/properties/CSSPropertyTextTransform.d.ts +1 -0
  115. package/types/css/properties/CSSPropertyTextTransform.d.ts.map +1 -0
  116. package/{dist → types}/css/properties/CSSPropertyTransform.d.ts +1 -0
  117. package/types/css/properties/CSSPropertyTransform.d.ts.map +1 -0
  118. package/{dist → types}/css/properties/CSSPropertyTransformOrigin.d.ts +1 -0
  119. package/types/css/properties/CSSPropertyTransformOrigin.d.ts.map +1 -0
  120. package/{dist → types}/css/properties/CSSPropertyZIndex.d.ts +1 -0
  121. package/types/css/properties/CSSPropertyZIndex.d.ts.map +1 -0
  122. package/{dist → types}/css/properties/index.d.ts +1 -0
  123. package/types/css/properties/index.d.ts.map +1 -0
  124. package/{dist → types}/display-objects/Circle.d.ts +1 -0
  125. package/types/display-objects/Circle.d.ts.map +1 -0
  126. package/{dist → types}/display-objects/CustomElement.d.ts +1 -0
  127. package/types/display-objects/CustomElement.d.ts.map +1 -0
  128. package/{dist → types}/display-objects/DisplayObject.d.ts +2 -1
  129. package/types/display-objects/DisplayObject.d.ts.map +1 -0
  130. package/{dist → types}/display-objects/Ellipse.d.ts +1 -0
  131. package/types/display-objects/Ellipse.d.ts.map +1 -0
  132. package/{dist → types}/display-objects/Fragment.d.ts +1 -0
  133. package/types/display-objects/Fragment.d.ts.map +1 -0
  134. package/{dist → types}/display-objects/Group.d.ts +1 -0
  135. package/types/display-objects/Group.d.ts.map +1 -0
  136. package/{dist → types}/display-objects/HTML.d.ts +1 -0
  137. package/types/display-objects/HTML.d.ts.map +1 -0
  138. package/{dist → types}/display-objects/Image.d.ts +1 -0
  139. package/types/display-objects/Image.d.ts.map +1 -0
  140. package/{dist → types}/display-objects/Line.d.ts +1 -0
  141. package/types/display-objects/Line.d.ts.map +1 -0
  142. package/{dist → types}/display-objects/Path.d.ts +1 -0
  143. package/types/display-objects/Path.d.ts.map +1 -0
  144. package/{dist → types}/display-objects/Polygon.d.ts +1 -0
  145. package/types/display-objects/Polygon.d.ts.map +1 -0
  146. package/{dist → types}/display-objects/Polyline.d.ts +1 -0
  147. package/types/display-objects/Polyline.d.ts.map +1 -0
  148. package/{dist → types}/display-objects/Rect.d.ts +1 -0
  149. package/types/display-objects/Rect.d.ts.map +1 -0
  150. package/{dist → types}/display-objects/Text.d.ts +3 -2
  151. package/types/display-objects/Text.d.ts.map +1 -0
  152. package/{dist → types}/display-objects/constants.d.ts +1 -0
  153. package/types/display-objects/constants.d.ts.map +1 -0
  154. package/{dist → types}/display-objects/index.d.ts +1 -0
  155. package/types/display-objects/index.d.ts.map +1 -0
  156. package/{dist → types}/dom/CustomElementRegistry.d.ts +1 -0
  157. package/types/dom/CustomElementRegistry.d.ts.map +1 -0
  158. package/{dist → types}/dom/CustomEvent.d.ts +1 -0
  159. package/types/dom/CustomEvent.d.ts.map +1 -0
  160. package/{dist → types}/dom/Document.d.ts +1 -0
  161. package/types/dom/Document.d.ts.map +1 -0
  162. package/{dist → types}/dom/Element.d.ts +1 -1
  163. package/types/dom/Element.d.ts.map +1 -0
  164. package/{dist → types}/dom/EventTarget.d.ts +1 -0
  165. package/types/dom/EventTarget.d.ts.map +1 -0
  166. package/{dist → types}/dom/FederatedEvent.d.ts +1 -0
  167. package/types/dom/FederatedEvent.d.ts.map +1 -0
  168. package/{dist → types}/dom/FederatedMouseEvent.d.ts +1 -0
  169. package/types/dom/FederatedMouseEvent.d.ts.map +1 -0
  170. package/{dist → types}/dom/FederatedPointerEvent.d.ts +1 -0
  171. package/types/dom/FederatedPointerEvent.d.ts.map +1 -0
  172. package/{dist → types}/dom/FederatedWheelEvent.d.ts +1 -0
  173. package/types/dom/FederatedWheelEvent.d.ts.map +1 -0
  174. package/{dist → types}/dom/MutationEvent.d.ts +1 -0
  175. package/types/dom/MutationEvent.d.ts.map +1 -0
  176. package/{dist → types}/dom/Node.d.ts +1 -1
  177. package/types/dom/Node.d.ts.map +1 -0
  178. package/{dist → types}/dom/index.d.ts +1 -0
  179. package/types/dom/index.d.ts.map +1 -0
  180. package/{dist → types}/dom/interfaces.d.ts +2 -1
  181. package/types/dom/interfaces.d.ts.map +1 -0
  182. package/{dist → types}/global-runtime.d.ts +1 -0
  183. package/types/global-runtime.d.ts.map +1 -0
  184. package/{dist → types}/index.d.ts +1 -0
  185. package/types/index.d.ts.map +1 -0
  186. package/{dist → types}/plugins/CullingPlugin.d.ts +1 -0
  187. package/types/plugins/CullingPlugin.d.ts.map +1 -0
  188. package/{dist → types}/plugins/DirtyCheckPlugin.d.ts +1 -0
  189. package/types/plugins/DirtyCheckPlugin.d.ts.map +1 -0
  190. package/{dist → types}/plugins/EventPlugin.d.ts +1 -0
  191. package/types/plugins/EventPlugin.d.ts.map +1 -0
  192. package/{dist → types}/plugins/FrustumCullingStrategy.d.ts +1 -0
  193. package/types/plugins/FrustumCullingStrategy.d.ts.map +1 -0
  194. package/{dist → types}/plugins/PrepareRendererPlugin.d.ts +1 -0
  195. package/types/plugins/PrepareRendererPlugin.d.ts.map +1 -0
  196. package/{dist → types}/services/ContextService.d.ts +1 -0
  197. package/types/services/ContextService.d.ts.map +1 -0
  198. package/{dist → types}/services/EventService.d.ts +1 -0
  199. package/types/services/EventService.d.ts.map +1 -0
  200. package/{dist → types}/services/OffscreenCanvasCreator.d.ts +5 -0
  201. package/types/services/OffscreenCanvasCreator.d.ts.map +1 -0
  202. package/{dist → types}/services/RenderingContext.d.ts +1 -0
  203. package/types/services/RenderingContext.d.ts.map +1 -0
  204. package/{dist → types}/services/RenderingService.d.ts +1 -0
  205. package/types/services/RenderingService.d.ts.map +1 -0
  206. package/{dist → types}/services/SceneGraphSelector.d.ts +1 -0
  207. package/types/services/SceneGraphSelector.d.ts.map +1 -0
  208. package/{dist → types}/services/SceneGraphService.d.ts +1 -0
  209. package/types/services/SceneGraphService.d.ts.map +1 -0
  210. package/{dist → types}/services/TextService.d.ts +1 -0
  211. package/types/services/TextService.d.ts.map +1 -0
  212. package/{dist → types}/services/aabb/CircleUpdater.d.ts +1 -0
  213. package/types/services/aabb/CircleUpdater.d.ts.map +1 -0
  214. package/{dist → types}/services/aabb/EllipseUpdater.d.ts +1 -0
  215. package/types/services/aabb/EllipseUpdater.d.ts.map +1 -0
  216. package/{dist → types}/services/aabb/GroupUpdater.d.ts +1 -0
  217. package/types/services/aabb/GroupUpdater.d.ts.map +1 -0
  218. package/{dist → types}/services/aabb/HTMLUpdater.d.ts +1 -0
  219. package/types/services/aabb/HTMLUpdater.d.ts.map +1 -0
  220. package/{dist → types}/services/aabb/LineUpdater.d.ts +1 -0
  221. package/types/services/aabb/LineUpdater.d.ts.map +1 -0
  222. package/{dist → types}/services/aabb/PathUpdater.d.ts +1 -0
  223. package/types/services/aabb/PathUpdater.d.ts.map +1 -0
  224. package/{dist → types}/services/aabb/PolylineUpdater.d.ts +1 -0
  225. package/types/services/aabb/PolylineUpdater.d.ts.map +1 -0
  226. package/{dist → types}/services/aabb/RectUpdater.d.ts +1 -0
  227. package/types/services/aabb/RectUpdater.d.ts.map +1 -0
  228. package/{dist → types}/services/aabb/TextUpdater.d.ts +1 -0
  229. package/types/services/aabb/TextUpdater.d.ts.map +1 -0
  230. package/{dist → types}/services/aabb/index.d.ts +1 -0
  231. package/types/services/aabb/index.d.ts.map +1 -0
  232. package/{dist → types}/services/aabb/interfaces.d.ts +1 -0
  233. package/types/services/aabb/interfaces.d.ts.map +1 -0
  234. package/{dist → types}/services/index.d.ts +1 -0
  235. package/types/services/index.d.ts.map +1 -0
  236. package/{dist → types}/services/interfaces.d.ts +1 -0
  237. package/types/services/interfaces.d.ts.map +1 -0
  238. package/{dist → types}/shapes/AABB.d.ts +1 -0
  239. package/types/shapes/AABB.d.ts.map +1 -0
  240. package/{dist → types}/shapes/Frustum.d.ts +1 -0
  241. package/types/shapes/Frustum.d.ts.map +1 -0
  242. package/{dist → types}/shapes/Plane.d.ts +1 -0
  243. package/types/shapes/Plane.d.ts.map +1 -0
  244. package/{dist → types}/shapes/Point.d.ts +1 -0
  245. package/types/shapes/Point.d.ts.map +1 -0
  246. package/{dist → types}/shapes/Rectangle.d.ts +1 -0
  247. package/types/shapes/Rectangle.d.ts.map +1 -0
  248. package/{dist → types}/shapes/index.d.ts +1 -0
  249. package/types/shapes/index.d.ts.map +1 -0
  250. package/{dist → types}/types.d.ts +19 -0
  251. package/types/types.d.ts.map +1 -0
  252. package/{dist → types}/utils/assert.d.ts +1 -0
  253. package/types/utils/assert.d.ts.map +1 -0
  254. package/{dist → types}/utils/canvas.d.ts +1 -0
  255. package/types/utils/canvas.d.ts.map +1 -0
  256. package/{dist → types}/utils/dom.d.ts +1 -0
  257. package/types/utils/dom.d.ts.map +1 -0
  258. package/{dist → types}/utils/error.d.ts +1 -0
  259. package/types/utils/error.d.ts.map +1 -0
  260. package/{dist → types}/utils/event.d.ts +1 -0
  261. package/types/utils/event.d.ts.map +1 -0
  262. package/{dist → types}/utils/fragment.d.ts +1 -0
  263. package/types/utils/fragment.d.ts.map +1 -0
  264. package/{dist → types}/utils/gradient.d.ts +1 -0
  265. package/types/utils/gradient.d.ts.map +1 -0
  266. package/{dist → types}/utils/index.d.ts +1 -0
  267. package/types/utils/index.d.ts.map +1 -0
  268. package/{dist → types}/utils/math.d.ts +1 -0
  269. package/types/utils/math.d.ts.map +1 -0
  270. package/{dist → types}/utils/memoize.d.ts +1 -0
  271. package/types/utils/memoize.d.ts.map +1 -0
  272. package/{dist → types}/utils/path.d.ts +1 -0
  273. package/types/utils/path.d.ts.map +1 -0
  274. package/{dist → types}/utils/pointer-events.d.ts +1 -0
  275. package/types/utils/pointer-events.d.ts.map +1 -0
  276. package/{dist → types}/utils/raf.d.ts +2 -1
  277. package/types/utils/raf.d.ts.map +1 -0
  278. package/{dist → types}/utils/tapable/AsyncParallelHook.d.ts +1 -0
  279. package/types/utils/tapable/AsyncParallelHook.d.ts.map +1 -0
  280. package/{dist → types}/utils/tapable/AsyncSeriesWaterfallHook.d.ts +1 -0
  281. package/types/utils/tapable/AsyncSeriesWaterfallHook.d.ts.map +1 -0
  282. package/{dist → types}/utils/tapable/Hook.d.ts +1 -0
  283. package/types/utils/tapable/Hook.d.ts.map +1 -0
  284. package/{dist → types}/utils/tapable/SyncHook.d.ts +1 -0
  285. package/types/utils/tapable/SyncHook.d.ts.map +1 -0
  286. package/{dist → types}/utils/tapable/SyncWaterfallHook.d.ts +1 -0
  287. package/types/utils/tapable/SyncWaterfallHook.d.ts.map +1 -0
  288. package/{dist → types}/utils/tapable/index.d.ts +1 -0
  289. package/types/utils/tapable/index.d.ts.map +1 -0
  290. package/{dist → types}/utils/text.d.ts +1 -0
  291. package/types/utils/text.d.ts.map +1 -0
  292. package/{dist → types}/utils/transform-mat4.d.ts +1 -0
  293. package/types/utils/transform-mat4.d.ts.map +1 -0
@@ -1,2 +1,18 @@
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).G={})}(this,(function(t){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(o,Math.floor(r+(s-u)*l/s+h)),a)}var p=t[r],f=i,d=o;for(n(t,i,r),a(t[o],p)>0&&n(t,i,o);d>f;){for(n(t,f,d),f++,d--;0>a(t[f],p);)f++;for(;a(t[d],p)>0;)d--}0===a(t[i],p)?n(t,i,d):n(t,++d,o),d>r||(i=d+1),r>d||(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;n>o;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function v(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,o){for(var a=[n,r];a.length;)if((r=a.pop())-(n=a.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;e.children.length>o;o++){var a=e.children[o],s=e.leaf?r(a):a;v(t,s)&&(e.leaf?n.push(a):y(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(v(t,o)){if(e.leaf||y(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),u=[],c=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=c.pop(),i=!0),a.leaf){var l=o(t,a.children,e);if(-1!==l)return a.children.splice(l,1),u.push(a),this._condense(u),this}i||a.leaf||!y(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(u.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(s>=o)return a(i=m(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(o/Math.pow(s,(r=Math.ceil(Math.log(o)/Math.log(s)))-1))),(i=m([])).leaf=!1,i.height=r;var u=Math.ceil(o/s),c=u*Math.ceil(Math.sqrt(s));g(t,e,n,c,this.compareMinX);for(var l=e;n>=l;l+=c){var h=Math.min(l+c-1,n);g(t,l,h,u,this.compareMinY);for(var p=l;h>=p;p+=u)i.children.push(this._build(t,p,Math.min(p+u-1,h),r-1))}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;e.children.length>s;s++){var u=e.children[s],c=h(u),l=f(t,u)-c;o>l?(o=l,i=i>c?c:i,a=u):l===o&&i>c&&(i=c,a=u)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),u(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;n-e>=a;a++){var u=s(t,0,a,this.toBBox),c=s(t,a,n,this.toBBox),l=d(u,c),p=h(u)+h(c);i>l?(i=l,r=a,o=o>p?p:o):l===i&&o>p&&(o=p,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:l,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),c=p(o)+p(a),l=e;n-e>l;l++){var h=t.children[l];u(o,t.leaf?i(h):h),c+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];u(a,t.leaf?i(d):d),c+=p(a)}return c},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()}(e);var n=e.exports,r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o,a,s=function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};function u(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);r.length>i;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function c(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function l(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&i[3]>s[1])){a.label=s[1];break}if(6===s[0]&&i[1]>a.label){a.label=i[1],i=s;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function h(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function f(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;o>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError,t.Shape=void 0,(o=t.Shape||(t.Shape={})).GROUP="g",o.FRAGMENT="fragment",o.CIRCLE="circle",o.ELLIPSE="ellipse",o.IMAGE="image",o.RECT="rect",o.LINE="line",o.POLYLINE="polyline",o.POLYGON="polygon",o.TEXT="text",o.PATH="path",o.HTML="html",o.MESH="mesh",t.ClipSpaceNearZ=void 0,(a=t.ClipSpaceNearZ||(t.ClipSpaceNearZ={}))[a.ZERO=0]="ZERO",a[a.NEGATIVE_ONE=1]="NEGATIVE_ONE";var d=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),y=function(){function e(e){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.plugins=[],this.config=s({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},e)}return e.prototype.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},e.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.prototype.getPlugins=function(){return this.plugins},e.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(t){Object.assign(this.config,t)},e}(),v={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+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 a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;f>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(p=1,u=Array(h-1);h>p;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(v);var m=v.exports,g=1e-6,x="undefined"!=typeof Float32Array?Float32Array:Array;function E(){var t=new x(9);return x!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function b(){var t=new x(16);return x!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function M(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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}function T(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,y,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=p,t[12]=f,t[13]=d,t[14]=y,t[15]=v,t}function S(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 P(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function w(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],m=e[15],g=n*s-r*a,x=n*u-i*a,E=n*c-o*a,b=r*u-i*s,M=r*c-o*s,T=i*c-o*u,S=l*y-h*d,P=l*v-p*d,w=l*m-f*d,N=h*v-p*y,C=h*m-f*y,k=p*m-f*v,A=g*k-x*C+E*N+b*w-M*P+T*S;return A?(t[0]=(s*k-u*C+c*N)*(A=1/A),t[1]=(i*C-r*k-o*N)*A,t[2]=(y*T-v*M+m*b)*A,t[3]=(p*M-h*T-f*b)*A,t[4]=(u*w-a*k-c*P)*A,t[5]=(n*k-i*w+o*P)*A,t[6]=(v*E-d*T-m*x)*A,t[7]=(l*T-p*E+f*x)*A,t[8]=(a*C-s*w+c*S)*A,t[9]=(r*w-n*C-o*S)*A,t[10]=(d*M-y*E+m*g)*A,t[11]=(h*E-l*M-f*g)*A,t[12]=(s*P-a*N-u*S)*A,t[13]=(n*N-r*P+i*S)*A,t[14]=(y*x-d*b-v*g)*A,t[15]=(l*b-h*x+p*g)*A,t):null}function N(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];return(e*a-n*o)*(h*v-p*y)-(e*s-r*o)*(l*v-p*d)+(e*u-i*o)*(l*y-h*d)+(n*s-r*a)*(c*v-p*f)-(n*u-i*a)*(c*y-h*f)+(r*u-i*s)*(c*d-l*f)}function C(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],m=e[14],g=e[15],x=n[0],E=n[1],b=n[2],M=n[3];return t[0]=x*r+E*s+b*h+M*y,t[1]=x*i+E*u+b*p+M*v,t[2]=x*o+E*c+b*f+M*m,t[3]=x*a+E*l+b*d+M*g,t[4]=(x=n[4])*r+(E=n[5])*s+(b=n[6])*h+(M=n[7])*y,t[5]=x*i+E*u+b*p+M*v,t[6]=x*o+E*c+b*f+M*m,t[7]=x*a+E*l+b*d+M*g,t[8]=(x=n[8])*r+(E=n[9])*s+(b=n[10])*h+(M=n[11])*y,t[9]=x*i+E*u+b*p+M*v,t[10]=x*o+E*c+b*f+M*m,t[11]=x*a+E*l+b*d+M*g,t[12]=(x=n[12])*r+(E=n[13])*s+(b=n[14])*h+(M=n[15])*y,t[13]=x*i+E*u+b*p+M*v,t[14]=x*o+E*c+b*f+M*m,t[15]=x*a+E*l+b*d+M*g,t}function k(t,e,n){var r,i,o,a,s,u,c,l,h,p,f,d,y=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*m+e[12],t[13]=e[1]*y+e[5]*v+e[9]*m+e[13],t[14]=e[2]*y+e[6]*v+e[10]*m+e[14],t[15]=e[3]*y+e[7]*v+e[11]*m+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*v+h*m+e[12],t[13]=i*y+u*v+p*m+e[13],t[14]=o*y+c*v+f*m+e[14],t[15]=a*y+l*v+d*m+e[15]),t}function A(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];return 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]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t}function R(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],p=e[11];return 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]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-p*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+p*i,t}function O(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function L(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function I(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],c=Math.hypot(a,s,u);return g>c?null:(a*=c=1/c,s*=c,u*=c,r=Math.sin(e),t[0]=a*a*(o=1-(i=Math.cos(e)))+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function D(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function G(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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 F(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,p=r*c,f=i*u,d=i*c,y=o*c,v=a*s,m=a*u,g=a*c;return t[0]=1-(f+y),t[1]=h+g,t[2]=p-m,t[3]=0,t[4]=h-g,t[5]=1-(l+y),t[6]=d+v,t[7]=0,t[8]=p+m,t[9]=d-v,t[10]=1-(l+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function U(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function B(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function V(t,e){var n=new x(3);B(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,c=e[4]*r,l=e[5]*i,h=e[6]*o,p=e[8]*r,f=e[9]*i,d=e[10]*o,y=a+l+d,v=0;return y>0?(t[3]=.25*(v=2*Math.sqrt(y+1)),t[0]=(h-f)/v,t[1]=(p-u)/v,t[2]=(s-c)/v):a>l&&a>d?(t[3]=(h-f)/(v=2*Math.sqrt(1+a-l-d)),t[0]=.25*v,t[1]=(s+c)/v,t[2]=(p+u)/v):l>d?(t[3]=(p-u)/(v=2*Math.sqrt(1+l-a-d)),t[0]=(s+c)/v,t[1]=.25*v,t[2]=(h+f)/v):(t[3]=(s-c)/(v=2*Math.sqrt(1+d-a-l)),t[0]=(p+u)/v,t[1]=(h+f)/v,t[2]=.25*v),t}function j(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,f=o*l,d=o*h,y=a*l,v=a*h,m=s*h,g=u*c,x=u*l,E=u*h,b=r[0],M=r[1],T=r[2],S=i[0],P=i[1],w=i[2],N=(1-(y+m))*b,C=(f+E)*b,k=(d-x)*b,A=(f-E)*M,R=(1-(p+m))*M,O=(v+g)*M,L=(d+x)*T,I=(v-g)*T,D=(1-(p+y))*T;return t[0]=N,t[1]=C,t[2]=k,t[3]=0,t[4]=A,t[5]=R,t[6]=O,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+S-(N*S+A*P+L*w),t[13]=n[1]+P-(C*S+R*P+I*w),t[14]=n[2]+w-(k*S+O*P+D*w),t[15]=1,t}function Y(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,p=i*a,f=i*s,d=i*u,y=o*a,v=o*s,m=o*u;return t[0]=1-h-d,t[1]=l+m,t[2]=p-v,t[3]=0,t[4]=l-m,t[5]=1-c-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function X(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function H(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return 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*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var z=H;function W(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return 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]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t}function q(t,e,n,r){var i,o,a,s,u,c,l,h,p,f,d=e[0],y=e[1],v=e[2],m=r[0],x=r[1],E=r[2],b=n[0],M=n[1],T=n[2];return g>Math.abs(d-b)&&g>Math.abs(y-M)&&g>Math.abs(v-T)?S(t):(f=1/Math.hypot(l=d-b,h=y-M,p=v-T),(f=Math.hypot(i=x*(p*=f)-E*(h*=f),o=E*(l*=f)-m*p,a=m*h-x*l))?(i*=f=1/f,o*=f,a*=f):(i=0,o=0,a=0),(f=Math.hypot(s=h*a-p*o,u=p*i-l*a,c=l*o-h*i))?(s*=f=1/f,u*=f,c*=f):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=p,t[11]=0,t[12]=-(i*d+o*y+a*v),t[13]=-(s*d+u*y+c*v),t[14]=-(l*d+h*y+p*v),t[15]=1,t)}function Z(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var $=C,K=Object.freeze({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],m=e[15];return t[0]=s*(p*m-f*v)-h*(u*m-c*v)+y*(u*f-c*p),t[1]=-(r*(p*m-f*v)-h*(i*m-o*v)+y*(i*f-o*p)),t[2]=r*(u*m-c*v)-s*(i*m-o*v)+y*(i*c-o*u),t[3]=-(r*(u*f-c*p)-s*(i*f-o*p)+h*(i*c-o*u)),t[4]=-(a*(p*m-f*v)-l*(u*m-c*v)+d*(u*f-c*p)),t[5]=n*(p*m-f*v)-l*(i*m-o*v)+d*(i*f-o*p),t[6]=-(n*(u*m-c*v)-a*(i*m-o*v)+d*(i*c-o*u)),t[7]=n*(u*f-c*p)-a*(i*f-o*p)+l*(i*c-o*u),t[8]=a*(h*m-f*y)-l*(s*m-c*y)+d*(s*f-c*h),t[9]=-(n*(h*m-f*y)-l*(r*m-o*y)+d*(r*f-o*h)),t[10]=n*(s*m-c*y)-a*(r*m-o*y)+d*(r*c-o*s),t[11]=-(n*(s*f-c*h)-a*(r*f-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*v-p*y)-l*(s*v-u*y)+d*(s*p-u*h)),t[13]=n*(h*v-p*y)-l*(r*v-i*y)+d*(r*p-i*h),t[14]=-(n*(s*v-u*y)-a*(r*v-i*y)+d*(r*u-i*s)),t[15]=n*(s*p-u*h)-a*(r*p-i*h)+l*(r*u-i*s),t},clone:function(t){var e=new x(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:M,create:b,determinant:N,equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],p=t[10],f=t[11],d=t[12],y=t[13],v=t[14],m=t[15],x=e[0],E=e[1],b=e[2],M=e[3],T=e[4],S=e[5],P=e[6],w=e[7],N=e[8],C=e[9],k=e[10],A=e[11],R=e[12],O=e[13],L=e[14],I=e[15];return!(Math.abs(n-x)>g*Math.max(1,Math.abs(n),Math.abs(x))||Math.abs(r-E)>g*Math.max(1,Math.abs(r),Math.abs(E))||Math.abs(i-b)>g*Math.max(1,Math.abs(i),Math.abs(b))||Math.abs(o-M)>g*Math.max(1,Math.abs(o),Math.abs(M))||Math.abs(a-T)>g*Math.max(1,Math.abs(a),Math.abs(T))||Math.abs(s-S)>g*Math.max(1,Math.abs(s),Math.abs(S))||Math.abs(u-P)>g*Math.max(1,Math.abs(u),Math.abs(P))||Math.abs(c-w)>g*Math.max(1,Math.abs(c),Math.abs(w))||Math.abs(l-N)>g*Math.max(1,Math.abs(l),Math.abs(N))||Math.abs(h-C)>g*Math.max(1,Math.abs(h),Math.abs(C))||Math.abs(p-k)>g*Math.max(1,Math.abs(p),Math.abs(k))||Math.abs(f-A)>g*Math.max(1,Math.abs(f),Math.abs(A))||Math.abs(d-R)>g*Math.max(1,Math.abs(d),Math.abs(R))||Math.abs(y-O)>g*Math.max(1,Math.abs(y),Math.abs(O))||Math.abs(v-L)>g*Math.max(1,Math.abs(v),Math.abs(L))||Math.abs(m-I)>g*Math.max(1,Math.abs(m),Math.abs(I)))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&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]},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},fromQuat:Y,fromQuat2:function(t,e){var n=new x(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+l*r+u*o-c*i)/h,n[1]=2*(u*a+l*i+c*r-s*o)/h,n[2]=2*(c*a+l*o+s*i-u*r)/h):(n[0]=2*(s*a+l*r+u*o-c*i),n[1]=2*(u*a+l*i+c*r-s*o),n[2]=2*(c*a+l*o+s*i-u*r)),F(t,e,n),t},fromRotation:I,fromRotationTranslation:F,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,p=i*c,f=i*l,d=o*c,y=o*l,v=a*l,m=s*u,g=s*c,x=s*l,E=r[0],b=r[1],M=r[2];return t[0]=(1-(d+v))*E,t[1]=(p+x)*E,t[2]=(f-g)*E,t[3]=0,t[4]=(p-x)*b,t[5]=(1-(h+v))*b,t[6]=(y+m)*b,t[7]=0,t[8]=(f+g)*M,t[9]=(y-m)*M,t[10]=(1-(h+d))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:j,fromScaling:L,fromTranslation:O,fromValues:function(t,e,n,r,i,o,a,s,u,c,l,h,p,f,d,y){var v=new x(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=c,v[10]=l,v[11]=h,v[12]=p,v[13]=f,v[14]=d,v[15]=y,v},fromXRotation:D,fromYRotation:G,fromZRotation:_,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},getRotation:V,getScaling:B,getTranslation:U,identity:S,invert:w,lookAt:q,mul:$,multiply:C,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},ortho:z,orthoNO:H,orthoZO:W,perspective:X,perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},perspectiveNO:X,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},rotate:function(t,e,n,r){var i,o,a,s,u,c,l,h,p,f,d,y,v,m,x,E,b,M,T,S,P,w,N,C,k=r[0],A=r[1],R=r[2],O=Math.hypot(k,A,R);return g>O?null:(k*=O=1/O,A*=O,R*=O,i=Math.sin(n),u=e[1],c=e[2],l=e[3],p=e[5],f=e[6],d=e[7],v=e[9],m=e[10],x=e[11],T=k*A*(a=1-(o=Math.cos(n)))-R*i,S=A*A*a+o,P=R*A*a+k*i,w=k*R*a+A*i,N=A*R*a-k*i,C=R*R*a+o,t[0]=(s=e[0])*(E=k*k*a+o)+(h=e[4])*(b=A*k*a+R*i)+(y=e[8])*(M=R*k*a-A*i),t[1]=u*E+p*b+v*M,t[2]=c*E+f*b+m*M,t[3]=l*E+d*b+x*M,t[4]=s*T+h*S+y*P,t[5]=u*T+p*S+v*P,t[6]=c*T+f*S+m*P,t[7]=l*T+d*S+x*P,t[8]=s*w+h*N+y*C,t[9]=u*w+p*N+v*C,t[10]=c*w+f*N+m*C,t[11]=l*w+d*N+x*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:A,rotateY:R,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],p=e[7];return 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]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t},scale:function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},set:T,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:Z,subtract:Z,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],p=a-n[2],f=l*l+h*h+p*p;f>0&&(l*=f=1/Math.sqrt(f),h*=f,p*=f);var d=u*p-c*h,y=c*l-s*p,v=s*h-u*l;return(f=d*d+y*y+v*v)>0&&(d*=f=1/Math.sqrt(f),y*=f,v*=f),t[0]=d,t[1]=y,t[2]=v,t[3]=0,t[4]=h*v-p*y,t[5]=p*d-l*v,t[6]=l*y-h*d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},translate:k,transpose:P});function Q(){var t=new x(3);return x!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function J(t){return Math.hypot(t[0],t[1],t[2])}function tt(t,e,n){var r=new x(3);return r[0]=t,r[1]=e,r[2]=n,r}function et(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function nt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function rt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function it(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ot(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function at(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function st(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ut(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function ct(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function lt(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return g*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&g*Math.max(1,Math.abs(r),Math.abs(a))>=Math.abs(r-a)&&g*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var ht=it,pt=J;function ft(){var t=new x(4);return x!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function dt(t,e,n,r){var i=new x(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function yt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function vt(){var t=new x(4);return x!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function mt(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function gt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function xt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function Et(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var o=Math.sin(e*=i),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}Q(),function(){var t=ft()}();var bt=dt,Mt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Tt=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},St=gt,Pt=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};function wt(){var t=new x(2);return x!=Float32Array&&(t[0]=0,t[1]=0),t}Q(),tt(1,0,0),tt(0,1,0),vt(),vt(),E(),function(){var t=wt()}();var Nt,Ct=rt,kt=et,At=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},Rt=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Ot=ot,Lt=ht,It=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){kt(this.center,t),kt(this.halfExtents,e),Lt(this.min,this.center,this.halfExtents),Ct(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){Ct(this.center,e,t),Ot(this.center,this.center,.5),Lt(this.halfExtents,e,t),Ot(this.halfExtents,this.halfExtents,.5),kt(this.min,t),kt(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,p=i-u,f=i+u,d=o-c,y=o+c,v=e.center,m=v[0],g=v[1],x=v[2],E=e.halfExtents,b=E[0],M=E[1],T=E[2],S=m-b,P=m+b,w=g-M,N=g+M,C=x-T,k=x+T;l>S&&(l=S),P>h&&(h=P),p>w&&(p=w),N>f&&(f=N),d>C&&(d=C),k>y&&(y=k),n[0]=.5*(l+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-l),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=l,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),m=Math.abs(u),g=Math.abs(c),x=Math.abs(l),E=Math.abs(h),b=Math.abs(p),M=Math.abs(f),T=Math.abs(d);n[0]=e[12]+a*i[0]+s*i[1]+u*i[2],n[1]=e[13]+c*i[0]+l*i[1]+h*i[2],n[2]=e[14]+p*i[0]+f*i[1]+d*i[2],r[0]=y*o[0]+v*o[1]+m*o[2],r[1]=g*o[0]+x*o[1]+E*o[2],r[2]=b*o[0]+M*o[1]+T*o[2],Lt(this.min,n,r),Ct(this.max,n,r)},t.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=At([0,0,0],this.getMin(),e.getMin()),i=Rt([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?kt([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?kt([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),Dt=function(){function t(t,e){this.distance=t||0,this.normal=e||tt(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return st(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/pt(this.normal);ot(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&function(t,e,n,r){var i=e[0],o=e[1],a=e[2];t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a)}(n,t,e,i),o},t}();t.Mask=void 0,(Nt=t.Mask||(t.Mask={}))[Nt.OUTSIDE=4294967295]="OUTSIDE",Nt[Nt.INSIDE=0]="INSIDE",Nt[Nt.INDETERMINATE=2147483647]="INDETERMINATE";var Gt=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Dt)}return t.prototype.extractFromVPMatrix=function(t){var e=p(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],y=e[12],v=e[13],m=e[14],g=e[15];nt(this.planes[0].normal,o-n,c-a,d-l),this.planes[0].distance=g-y,nt(this.planes[1].normal,o+n,c+a,d+l),this.planes[1].distance=g+y,nt(this.planes[2].normal,o+r,c+s,d+h),this.planes[2].distance=g+v,nt(this.planes[3].normal,o-r,c-s,d-h),this.planes[3].distance=g-v,nt(this.planes[4].normal,o-i,c-u,d-f),this.planes[4].distance=g-m,nt(this.planes[5].normal,o+i,c+u,d+f),this.planes[5].distance=g+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),_t=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Ft=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.applyTransform=function(e,n){var r=dt(e.x,e.y,0,1),i=dt(e.x+e.width,e.y,0,1),o=dt(e.x,e.y+e.height,0,1),a=dt(e.x+e.width,e.y+e.height,0,1),s=ft(),u=ft(),c=ft(),l=ft();yt(s,r,n),yt(u,i,n),yt(c,o,n),yt(l,a,n);var h=Math.min(s[0],u[0],c[0],l[0]),p=Math.min(s[1],u[1],c[1],l[1]);return t.fromRect({x:h,y:p,width:Math.max(s[0],u[0],c[0],l[0])-h,height:Math.max(s[1],u[1],c[1],l[1])-p})},t.prototype.toJSON=function(){},t}(),Ut="Method not implemented.",Bt="Use document.documentElement instead.",Vt=function(t){return"function"==typeof t},jt=function(t){return null==t},Yt={}.toString,Xt=function(t,e){return Yt.call(t)==="[object "+e+"]"},Ht=function(t){return Array.isArray?Array.isArray(t):Xt(t,"Array")},zt=function(t){if(Ht(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},Wt=function(t){if(Ht(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},qt=function(t){return Xt(t,"String")},Zt=function(t,e,n){return e>t?e:t>n?n:t},$t=function(t){return Xt(t,"Number")},Kt=1e-5;function Qt(t,e,n){return void 0===n&&(n=Kt),n>Math.abs(t-e)}var Jt=function(t,e){return(t%e+e)%e},te=function(t){return Xt(t,"Boolean")},ee=function(t){return void 0===t},ne={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function re(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var ie={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function oe(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return ie[e]===t.length-1&&"achlmqstvz".includes(e)}))}function ae(t){return oe(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function se(t){return ae(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function ue(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ie[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,ie[n]))),ie[n]););}function ce(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function le(t){return t>=48&&57>=t||43===t||45===t||46===t}function he(t){return t>=48&&57>=t}function pe(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),he(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&he(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&he(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;he(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!he(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&he(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function fe(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function de(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=ie[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,fe(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?pe(t):ce(t),t.err.length)return;t.data.push(t.param),fe(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,fe(t))}if(t.index>=t.max)break;if(!le(n.charCodeAt(t.index)))break}ue(t)}else ue(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var ye=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function ve(t){if(ae(t))return[].concat(t);var e=function(t){if(oe(t))return[].concat(t);var e=new ye(t);for(fe(e);e.max>e.index&&!e.err.length;)de(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function me(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].concat(s)}else if("T"===n){var h=2*r-e.qx,p=2*i-e.qy;e.qx=h,e.qy=p,u=["Q",h,p].concat(s)}else if("Q"===n){var f=s[1];e.qx=s[0],e.qy=f}return u}function ge(t){if(se(t))return[].concat(t);for(var e=ve(t),n=s({},ne),r=0;e.length>r;r+=1){e[r]=me(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function xe(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Ee(t,e,n,r,i,o,a,s,u,c){var l,h,p,f,d,y=t,v=e,m=n,g=r,x=s,E=u,b=120*Math.PI/180,M=Math.PI/180*(+i||0),T=[];if(c)h=c[0],p=c[1],f=c[2],d=c[3];else{v=(l=xe(y,v,-M)).y;var S=((y=l.x)-(x=(l=xe(x,E,-M)).x))/2,P=(v-(E=l.y))/2,w=S*S/(m*m)+P*P/(g*g);w>1&&(m*=w=Math.sqrt(w),g*=w);var N=m*m,C=g*g,k=(o===a?-1:1)*Math.sqrt(Math.abs((N*C-N*P*P-C*S*S)/(N*P*P+C*S*S)));f=k*m*P/g+(y+x)/2,h=Math.asin(((v-(d=k*-g*S/m+(v+E)/2))/g*1e9>>0)/1e9),p=Math.asin(((E-d)/g*1e9>>0)/1e9),0>(h=f>y?Math.PI-h:h)&&(h=2*Math.PI+h),0>(p=f>x?Math.PI-p:p)&&(p=2*Math.PI+p),a&&h>p&&(h-=2*Math.PI),!a&&p>h&&(p-=2*Math.PI)}var A=p-h;if(Math.abs(A)>b){var R=p,O=x,L=E;T=Ee(x=f+m*Math.cos(p=h+b*(a&&p>h?1:-1)),E=d+g*Math.sin(p),m,g,i,0,a,O,L,[p,R,f,d])}A=p-h;var I=Math.cos(h),D=Math.sin(h),G=Math.cos(p),_=Math.sin(p),F=Math.tan(A/4),U=4/3*m*F,B=4/3*g*F,V=[y,v],j=[y+U*D,v-B*I],Y=[x+U*_,E-B*G],X=[x,E];if(j[0]=2*V[0]-j[0],j[1]=2*V[1]-j[1],c)return j.concat(Y,X,T);for(var H=[],z=0,W=(T=j.concat(Y,X,T)).length;W>z;z+=1)H[z]=z%2?xe(T[z-1],T[z],M).y:xe(T[z],T[z+1],M).x;return H}function be(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var Me=function(t,e,n,r){return f(f([],be([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Te(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],p=l[1],f=e.x1,d=e.y1,y=e.x,v=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=p,t;case"A":return n=[f,d].concat(l),["C"].concat(Ee(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=p,n=[f,d].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(Me(f,d,h,p));case"Z":return f===y&&d===v?["C",f,d,y,v,y,v]:["C"].concat(Me(f,d,y,v))}return t}function Se(t,e){if(void 0===e&&(e=!1),function(t){return se(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=ge(t),a=s({},ne),u=[],c="",l=o.length,h=[],p=0;l>p;p+=1){o[p]&&(c=o[p][0]),u[p]=c;var f=Te(o[p],a);o[p]=f,re(o,u,p),l=o.length,"Z"===c&&h.push(p),a.x1=+(r=o[p])[(i=r.length)-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,h]:o}function Pe(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function we(t,e,n,r,i){var o=Pe([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=be([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Ne(t,e){var n=t.x,r=t.y,i=e.x,o=e.y;return(0>n*o-r*i?-1:1)*Math.acos((n*i+r*o)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))))}function Ce(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,p=Math.cos,f=Math.sqrt,d=Math.PI,y=l(n),v=l(r),m=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===v)return we(t,e,s,u,c).point;var g=(t-s)/2,x=(e-u)/2,E={x:p(m)*g+h(m)*x,y:-h(m)*g+p(m)*x},b=Math.pow(E.x,2)/Math.pow(y,2)+Math.pow(E.y,2)/Math.pow(v,2);b>1&&(y*=f(b),v*=f(b));var M=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(E.y,2)-Math.pow(v,2)*Math.pow(E.x,2))/(Math.pow(y,2)*Math.pow(E.y,2)+Math.pow(v,2)*Math.pow(E.x,2)),T=(o!==a?1:-1)*f(M=0>M?0:M),S=T*(y*E.y/v),P=T*(-v*E.x/y),w=p(m)*S-h(m)*P+(t+s)/2,N=h(m)*S+p(m)*P+(e+u)/2,C={x:(E.x-S)/y,y:(E.y-P)/v},k=Ne({x:1,y:0},C),A=Ne(C,{x:(-E.x-S)/y,y:(-E.y-P)/v});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var R=k+(A%=2*d)*c,O=y*p(R),L=v*h(R);return{x:p(m)*O-h(m)*L+w,y:h(m)*O+p(m)*L+N}}function ke(t,e,n,r,i,o,a,s,u,c,l){var h,p=l.bbox,f=void 0===p||p,d=l.length,y=void 0===d||d,v=l.sampleSize,m=void 0===v?30:v,g="number"==typeof c,x=t,E=e,b=0,M=[x,E,b],T=[x,E],S={x:0,y:0},P=[{x:x,y:E}];g&&0>=c&&(S={x:x,y:E});for(var w=0;m>=w;w+=1){if(x=(h=Ce(t,e,n,r,i,o,a,s,u,w/m)).x,E=h.y,f&&P.push({x:x,y:E}),y&&(b+=Pe(T,[x,E])),T=[x,E],g&&b>=c&&c>M[2]){var N=(b-c)/(b-M[2]);S={x:T[0]*(1-N)+M[0]*N,y:T[1]*(1-N)+M[1]*N}}M=[x,E,b]}return g&&c>=b&&(S={x:s,y:u}),{length:b,point:S,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function Ae(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function Re(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,p=void 0===h||h,f=c.length,d=void 0===f||f,y=c.sampleSize,v=void 0===y?10:y,m="number"==typeof u,g=t,x=e,E=0,b=[g,x,E],M=[g,x],T={x:0,y:0},S=[{x:g,y:x}];m&&0>=u&&(T={x:g,y:x});for(var P=0;v>=P;P+=1){if(g=(l=Ae(t,e,n,r,i,o,a,s,P/v)).x,x=l.y,p&&S.push({x:g,y:x}),d&&(E+=Pe(M,[g,x])),M=[g,x],m&&E>=u&&u>b[2]){var w=(E-u)/(E-b[2]);T={x:M[0]*(1-w)+b[0]*w,y:M[1]*(1-w)+b[1]*w}}b=[g,x,E]}return m&&u>=E&&(T={x:a,y:s}),{length:E,point:T,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function Oe(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Le(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,p=void 0===h||h,f=s.sampleSize,d=void 0===f?10:f,y="number"==typeof a,v=t,m=e,g=0,x=[v,m,g],E=[v,m],b={x:0,y:0},M=[{x:v,y:m}];y&&0>=a&&(b={x:v,y:m});for(var T=0;d>=T;T+=1){if(v=(u=Oe(t,e,n,r,i,o,T/d)).x,m=u.y,l&&M.push({x:v,y:m}),p&&(g+=Pe(E,[v,m])),E=[v,m],y&&g>=a&&a>x[2]){var S=(g-a)/(g-x[2]);b={x:E[0]*(1-S)+x[0]*S,y:E[1]*(1-S)+x[1]*S}}x=[v,m,g]}return y&&a>=g&&(b={x:i,y:o}),{length:g,point:b,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function Ie(t,e,n){for(var r,i,o,a,s,u,c,l,h,p=ge(t),f="number"==typeof e,d=[],y=0,v=0,m=0,g=0,x=[],E=[],b=0,M={x:0,y:0},T=M,S=M,P=M,w=0,N=0,C=p.length;C>N;N+=1)d=(c="M"===(l=(h=p[N])[0]))?d:[y,v].concat(h.slice(1)),c?(T=M={x:m=h[1],y:g=h[2]},b=0,f&&.001>e&&(P=M)):"L"===l?(b=(r=we(d[0],d[1],d[2],d[3],(e||0)-w)).length,M=r.min,T=r.max,S=r.point):"A"===l?(b=(i=ke(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-w,n||{})).length,M=i.min,T=i.max,S=i.point):"C"===l?(b=(o=Re(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-w,n||{})).length,M=o.min,T=o.max,S=o.point):"Q"===l?(b=(a=Le(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-w,n||{})).length,M=a.min,T=a.max,S=a.point):"Z"===l&&(b=(s=we((d=[y,v,m,g])[0],d[1],d[2],d[3],(e||0)-w)).length,M=s.min,T=s.max,S=s.point),f&&e>w&&w+b>=e&&(P=S),E.push(T),x.push(M),w+=b,y=(u="Z"!==l?h.slice(-2):[m,g])[0],v=u[1];return f&&e>=w&&(P={x:y,y:v}),{length:w,point:P,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function De(t){return function(t){var e=0,n=0,r=0;return Se(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,p,f=t.slice(1);return r=3*(((p=f[5])-(a=n))*((s=f[0])+(c=f[2]))-((h=f[4])-(o=e))*((u=f[1])+(l=f[3]))+u*(o-c)-s*(a-l)+p*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function Ge(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Re(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=be(n,r,e),s=be(r,i,e),u=be(i,o,e),c=be(a,s,e),l=be(s,u,e),h=be(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function _e(t,e,n){var r=Ge(t),i=Ge(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[c,l],f=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:_e(y[0],y[1],h)}function Fe(t){return void 0===t?0:t>360||-360>t?t%360:t}var Ue=Q();function Be(t,e,n,r){return void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=!0),Array.isArray(t)&&3===t.length?r?(i=t,(o=new x(3))[0]=i[0],o[1]=i[1],o[2]=i[2],o):et(Ue,t):$t(t)?r?tt(t,e,n):nt(Ue,t,e,n):r?tt(t[0],t[1]||e,t[2]||n):nt(Ue,t[0],t[1]||e,t[2]||n);var i,o}var Ve=Math.PI/180;function je(t){return t*Ve}var Ye=180/Math.PI;function Xe(t){return t*Ye}function He(t){return 360*t}var ze=Math.PI/2;function We(t,e){return 16===e.length?function(t,e){var n,r,i=p(B(Q(),e),3),o=i[0],a=i[1],s=i[2],u=Math.asin(-e[2]/o);return ze>u?u>-ze?(n=Math.atan2(e[6]/a,e[10]/s),r=Math.atan2(e[1]/o,e[0]/o)):(r=0,n=-Math.atan2(e[4]/a,e[5]/a)):(r=0,n=Math.atan2(e[4]/a,e[5]/a)),t[0]=n,t[1]=u,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=ze,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-ze,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function qe(t,e,n,r,i){var o,a,s,u,c,l,h,p,f,d,y=Math.cos(t),v=Math.sin(t);return o=r*y,a=i*v,s=0,u=-r*v,c=i*y,l=0,h=e,p=n,f=1,(d=new x(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=p,d[8]=f,d}function Ze(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);if(0>e*i-n*r&&(i>e?o=-o:a=-a),o){var s=1/o;e*=s,n*=s}if(a){var u=1/a;r*=u,i*=u}var c=Xe(Math.atan2(n,e));return[t[6],t[7],o,a,c]}var $e,Ke,Qe,Je=b(),tn=b(),en=ft(),nn=[Q(),Q(),Q()],rn=Q();function on(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}t.CameraType=void 0,($e=t.CameraType||(t.CameraType={}))[$e.ORBITING=0]="ORBITING",$e[$e.EXPLORING=1]="EXPLORING",$e[$e.TRACKING=2]="TRACKING",t.CameraTrackingMode=void 0,(Ke=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Ke.DEFAULT=0]="DEFAULT",Ke[Ke.ROTATIONAL=1]="ROTATIONAL",Ke[Ke.TRANSLATIONAL=2]="TRANSLATIONAL",Ke[Ke.CINEMATIC=3]="CINEMATIC",t.CameraProjectionMode=void 0,(Qe=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Qe.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Qe[Qe.PERSPECTIVE=1]="PERSPECTIVE";var an,sn,un={UPDATED:"updated"},cn=2e-4,ln=function(){function e(){this.clipSpaceNearZ=t.ClipSpaceNearZ.NEGATIVE_ONE,this.eventEmitter=new m,this.matrix=b(),this.right=tt(1,0,0),this.up=tt(0,1,0),this.forward=tt(0,0,1),this.position=tt(0,0,1),this.focalPoint=tt(0,0,0),this.distanceVector=tt(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=b(),this.projectionMatrixInverse=b(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new Gt,this.orthoMatrix=b()}return e.prototype.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getDollyingStep=function(){return this.dollyingStep},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.getView=function(){return this.view},e.prototype.setEnableUpdate=function(t){this.enableUpdate=t},e.prototype.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},e.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.prototype.getViewTransform=function(){return w(b(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,e){var n=O(b(),[t,e,0]);this.jitteredProjectionMatrix=C(b(),n,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setProjectionMatrix=function(t){this.projectionMatrix=t},e.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},e.prototype.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},e.prototype.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=tt(a.x-r,a.y-i,0),u=st(s,this.right)/J(this.right),c=st(s,this.up)/J(this.up),l=p(this.getPosition(),2),h=l[0],f=l[1],d=p(this.getFocalPoint(),2),y=d[0],v=d[1];return this.setPosition(h-u,f-c),this.setFocalPoint(y-u,v-c),this},e.prototype.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(je(.5*this.fov))/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var u,c,l=2*o,h=n-e,p=r-i,f=l/p,d=(n+e)/h,y=(r+i)/p,v=a-o,m=a*o;s?(u=-a/v,c=-m/v):(u=-(a+o)/v,c=-2*m/v),t[0]=l/h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=y,t[10]=u,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,c,c+u,a-s,a,e,this.far,this.clipSpaceNearZ===t.ClipSpaceNearZ.ZERO),w(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.prototype.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,p=l-u,f=l+u,d=h+c,y=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var v=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(p+=v*this.view.offsetX)+v*this.view.width,y=(d-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===t.ClipSpaceNearZ.NEGATIVE_ONE?z(this.projectionMatrix,p,f,d,y,o,a):W(this.projectionMatrix,p,f,d,y,o,a),w(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=Be(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.prototype.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i=tt(0,1,0);if(this.focalPoint=Be(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=it(Q(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=J(o),s=Xe(Math.asin(n/a)),u=90+Xe(Math.atan2(r,e)),c=b();R(c,c,je(u)),A(c,c,je(s)),i=ct(Q(),[0,1,0],c)}return w(this.matrix,q(b(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.prototype.getDistance=function(){return this.distance},e.prototype.getDistanceVector=function(){return this.distanceVector},e.prototype.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,cn>this.distance&&(this.distance=cn),this.dollyingStep=this.distance/100;var e=Q(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},e.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},e.prototype.setMinDistance=function(t){return this.minDistance=t,this},e.prototype.setAzimuth=function(e){return this.azimuth=Fe(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getAzimuth=function(){return this.azimuth},e.prototype.setElevation=function(e){return this.elevation=Fe(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getElevation=function(){return this.elevation},e.prototype.setRoll=function(e){return this.roll=Fe(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getRoll=function(){return this.roll},e.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},e.prototype.computeMatrix=function(){var e=mt(vt(),[0,0,1],je(this.roll));S(this.matrix);var n=mt(vt(),[1,0,0],je((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=mt(vt(),[0,1,0],je((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=gt(vt(),r,n);i=gt(vt(),i,e);var o=Y(b(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(k(this.matrix,this.matrix,this.focalPoint),C(this.matrix,this.matrix,o),k(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(k(this.matrix,this.matrix,this.position),C(this.matrix,this.matrix,o))},e.prototype._setPosition=function(t,e,n){this.position=Be(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},e.prototype._getAxes=function(){et(this.right,Be(yt(ft(),[1,0,0,0],this.matrix))),et(this.up,Be(yt(ft(),[0,1,0,0],this.matrix))),et(this.forward,Be(yt(ft(),[0,0,1,0],this.matrix))),at(this.right,this.right),at(this.up,this.up),at(this.forward,this.forward)},e.prototype._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=J(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Xe(Math.asin(n/i)),this.azimuth=Xe(Math.atan2(-e,-r))):(this.elevation=-Xe(Math.asin(n/i)),this.azimuth=-Xe(Math.atan2(-e,-r)))},e.prototype._getPosition=function(){et(this.position,Be(yt(ft(),[0,0,0,1],this.matrix))),this._getDistance()},e.prototype._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=E(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),rt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=it(Q(),this.focalPoint,this.position),this.distance=J(this.distanceVector),this.dollyingStep=this.distance/100},e.prototype._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=mt(vt(),[0,0,1],-this.roll*Math.PI/180);j(this.orthoMatrix,n,tt((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),tt(this.zoom,this.zoom,1),e)}},e.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=C(b(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(un.UPDATED)}},e.prototype.rotate=function(t,e,n){throw Error(Ut)},e.prototype.pan=function(t,e){throw Error(Ut)},e.prototype.dolly=function(t){throw Error(Ut)},e.prototype.createLandmark=function(t,e){throw Error(Ut)},e.prototype.gotoLandmark=function(t,e){throw Error(Ut)},e.prototype.cancelLandmarkAnimation=function(){throw Error(Ut)},e}();t.Strategy=void 0,(an=t.Strategy||(t.Strategy={}))[an.Standard=0]="Standard",t.SortReason=void 0,(sn=t.SortReason||(t.SortReason={}))[sn.ADDED=0]="ADDED",sn[sn.REMOVED=1]="REMOVED",sn[sn.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED";var hn,pn={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ft(0,0,0,0)};function fn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function dn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function yn(){}t.PropertySyntax=void 0,(hn=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",hn.COLOR="<color>",hn.PAINT="<paint>",hn.NUMBER="<number>",hn.ANGLE="<angle>",hn.OPACITY_VALUE="<opacity-value>",hn.SHADOW_BLUR="<shadow-blur>",hn.LENGTH="<length>",hn.PERCENTAGE="<percentage>",hn.LENGTH_PERCENTAGE="<length> | <percentage>",hn.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",hn.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",hn.LIST_OF_POINTS="<list-of-points>",hn.PATH="<path>",hn.FILTER="<filter>",hn.Z_INDEX="<z-index>",hn.OFFSET_DISTANCE="<offset-distance>",hn.DEFINED_PATH="<defined-path>",hn.MARKER="<marker>",hn.TRANSFORM="<transform>",hn.TRANSFORM_ORIGIN="<transform-origin>",hn.TEXT="<text>",hn.TEXT_TRANSFORM="<text-transform>";var vn,mn,gn,xn,En=.7,bn=1/En,Mn="\\s*([+-]?\\d+)\\s*",Tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Pn=/^#([0-9a-f]{3,8})$/,wn=RegExp(`^rgb\\(${Mn},${Mn},${Mn}\\)$`),Nn=RegExp(`^rgb\\(${Sn},${Sn},${Sn}\\)$`),Cn=RegExp(`^rgba\\(${Mn},${Mn},${Mn},${Tn}\\)$`),kn=RegExp(`^rgba\\(${Sn},${Sn},${Sn},${Tn}\\)$`),An=RegExp(`^hsl\\(${Tn},${Sn},${Sn}\\)$`),Rn=RegExp(`^hsla\\(${Tn},${Sn},${Sn},${Tn}\\)$`),On={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 Ln(){return this.rgb().formatHex()}function In(){return this.rgb().formatRgb()}function Dn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Pn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Gn(e):3===n?new Fn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?_n(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?_n(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=wn.exec(t))?new Fn(e[1],e[2],e[3],1):(e=Nn.exec(t))?new Fn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Cn.exec(t))?_n(e[1],e[2],e[3],e[4]):(e=kn.exec(t))?_n(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=An.exec(t))?Xn(e[1],e[2]/100,e[3]/100,1):(e=Rn.exec(t))?Xn(e[1],e[2]/100,e[3]/100,e[4]):On.hasOwnProperty(t)?Gn(On[t]):"transparent"===t?new Fn(NaN,NaN,NaN,0):null}function Gn(t){return new Fn(t>>16&255,t>>8&255,255&t,1)}function _n(t,e,n,r){return r>0||(t=e=n=NaN),new Fn(t,e,n,r)}function Fn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Un(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}`}function Bn(){const t=Vn(this.opacity);return`${1===t?"rgb(":"rgba("}${jn(this.r)}, ${jn(this.g)}, ${jn(this.b)}${1===t?")":`, ${t})`}`}function Vn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function jn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Yn(t){return(16>(t=jn(t))?"0":"")+t.toString(16)}function Xn(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new zn(t,e,n,r)}function Hn(t){if(t instanceof zn)return new zn(t.h,t.s,t.l,t.opacity);if(t instanceof yn||(t=Dn(t)),!t)return new zn;if(t instanceof zn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new zn(a,s,u,t.opacity)}function zn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Wn(t){return 0>(t=(t||0)%360)?t+360:t}function qn(t){return Math.max(0,Math.min(1,t||0))}function Zn(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}function $n(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new($n.Cache||Map),n}fn(yn,Dn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ln,formatHex:Ln,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Hn(this).formatHsl()},formatRgb:In,toString:In}),fn(Fn,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof yn||(i=Dn(i)),i?new Fn((i=i.rgb()).r,i.g,i.b,i.opacity):new Fn):new Fn(t,e,n,null==r?1:r);var i}),dn(yn,{brighter(t){return new Fn(this.r*(t=null==t?bn:Math.pow(bn,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new Fn(this.r*(t=null==t?En:Math.pow(En,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Fn(jn(this.r),jn(this.g),jn(this.b),Vn(this.opacity))},displayable(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Un,formatHex:Un,formatHex8:function(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}${Yn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Bn,toString:Bn})),fn(zn,(function(t,e,n,r){return 1===arguments.length?Hn(t):new zn(t,e,n,null==r?1:r)}),dn(yn,{brighter(t){return new zn(this.h,this.s,this.l*(t=null==t?bn:Math.pow(bn,t)),this.opacity)},darker(t){return new zn(this.h,this.s,this.l*(t=null==t?En:Math.pow(En,t)),this.opacity)},rgb(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new Fn(Zn(240>t?t+120:t-240,r,n),Zn(t,r,n),Zn(120>t?t+240:t-120,r,n),this.opacity)},clamp(){return new zn(Wn(this.h),qn(this.s),qn(this.l),Vn(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=Vn(this.opacity);return`${1===t?"hsl(":"hsla("}${Wn(this.h)}, ${100*qn(this.s)}%, ${100*qn(this.l)}%${1===t?")":`, ${t})`}`}})),$n.Cache=Map,t.UnitType=void 0,(vn=t.UnitType||(t.UnitType={}))[vn.kUnknown=0]="kUnknown",vn[vn.kNumber=1]="kNumber",vn[vn.kPercentage=2]="kPercentage",vn[vn.kEms=3]="kEms",vn[vn.kPixels=4]="kPixels",vn[vn.kRems=5]="kRems",vn[vn.kDegrees=6]="kDegrees",vn[vn.kRadians=7]="kRadians",vn[vn.kGradians=8]="kGradians",vn[vn.kTurns=9]="kTurns",vn[vn.kMilliseconds=10]="kMilliseconds",vn[vn.kSeconds=11]="kSeconds",vn[vn.kInteger=12]="kInteger",function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(mn||(mn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(gn||(gn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(xn||(xn={}));var Kn,Qn=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(Kn||(Kn={}));var Jn,tr=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Qn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},er=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},nr=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},rr=function(){function e(){}return e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds},e.prototype.toString=function(){return this.buildCSSText(gn.kNo,xn.kNo,"")},e.prototype.isNumericValue=function(){return this.getType()>=Kn.kUnitType&&this.getType()<=Kn.kClampType},e}(),ir=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return i(e,t),e.prototype.getType=function(){return Kn.kColorType},e.prototype.to=function(t){return this},e}(rr);t.GradientType=void 0,(Jn=t.GradientType||(t.GradientType={}))[Jn.Constant=0]="Constant",Jn[Jn.LinearGradient=1]="LinearGradient",Jn[Jn.RadialGradient=2]="RadialGradient";var or=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return i(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return Kn.kColorType},e}(rr),ar=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return i(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return Kn.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(rr),sr=function(e){return function(e){switch(e){case mn.kUNumber:return t.UnitType.kNumber;case mn.kULength:return t.UnitType.kPixels;case mn.kUPercent:return t.UnitType.kPercentage;case mn.kUTime:return t.UnitType.kSeconds;case mn.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return mn.kUNumber;case t.UnitType.kPercentage:return mn.kUPercent;case t.UnitType.kPixels:return mn.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return mn.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return mn.kUAngle;default:return mn.kUOther}}(e))},ur=function(e){function n(n,r){void 0===r&&(r=t.UnitType.kNumber);var i,o=e.call(this)||this;return i="string"==typeof r?tr(r):r,o.unit=i,o.value=n,o}return i(n,e),n.prototype.clone=function(){return new n(this.value,this.unit)},n.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},n.prototype.getType=function(){return Kn.kUnitType},n.prototype.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=sr(this.unit);if(r!==sr(e)||r===t.UnitType.kUnknown)return null;var i=er(this.unit)/er(e);return new n(this.value*i,e)},n.prototype.buildCSSText=function(e,n,r){var i,o,a;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var s=this.value,u=nr(this.unit);if(-999999>s||s>999999){var c=nr(this.unit);!Number.isFinite(s)||Number.isNaN(s)?(void 0===(a=c)&&(a=""),i=(Number.isFinite(o=s)?"NaN":o>0?"infinity":"-infinity")+a):i=s+(c||"")}else i="".concat(s).concat(u)}return r+=i},n}(rr),cr=new ur(0,"px");new ur(1,"px");var lr=new ur(0,"deg"),hr=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return i(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(ir),pr=new ar("unset"),fr={"":pr,unset:pr,initial:new ar("initial"),inherit:new ar("inherit")},dr=new hr(0,0,0,0,!0),yr=new hr(0,0,0,0),vr=$n((function(t,e,n,r){return new hr(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),mr=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new ur(e,n)};function gr(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new ur(50,"%");var xr=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-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/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw Error(e+": "+t)}function r(){var t=f(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,u)||o("repeating-radial-gradient",t.repeatingRadialGradient,u)||o("conic-gradient",t.conicGradient,u)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(x(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:f(d)}}))}function a(e,r){var i=x(e);if(i){x(t.startCall)||n("Missing (");var o=r(i);return x(t.endCall)||n("Missing )"),o}}function s(){return g("directional",t.sideOrCorner,1)||g("angular",t.angleValue,1)}function u(){var n,r,i=c();return i&&((n=[]).push(i),r=e,x(t.comma)&&((i=c())?n.push(i):e=r)),n}function c(){var t=function(){var t=g("shape",/^(circle)/i,0);t&&(t.style=m()||l());return t}()||function(){var t=g("shape",/^(ellipse)/i,0);t&&(t.style=v()||l());return t}();if(t)t.at=h();else{var e=l();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=p();r&&(t={type:"default-radial",at:r})}}return t}function l(){return g("extent-keyword",t.extentKeywords,1)}function h(){if(g("position",/^at/,0)){var t=p();return t||n("Missing positioning value"),t}}function p(){var t={x:v(),y:v()};if(t.x||t.y)return{type:"position",value:t}}function f(e){var r=e(),i=[];if(r)for(i.push(r);x(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function d(){var e=g("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:f(y)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:f(y)}}))||g("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=v(),e}function y(){return x(t.number)[1]}function v(){return g("%",t.percentageValue,1)||g("position-keyword",t.positionKeywords,1)||m()}function m(){return g("px",t.pixelValue,1)||g("em",t.emValue,1)}function g(t,e,n){var r=x(e);if(r)return{type:t,value:r[n]}}function x(t){var n=/^[\n\r\t\s]+/.exec(e);n&&E(n[0].length);var r=t.exec(e);return r&&E(r[0].length),r}function E(t){e=e.substring(t)}return function(t){return e=t,r()}}();var Er=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,br=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Mr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Tr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Sr={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},Pr=$n((function(t){return mr("angular"===t.type?Number(t.value):Sr[t.value]||0,"deg")})),wr=$n((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:mr(e,r),cy:mr(n,i)}})),Nr=$n((function(e){var n;if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return xr(e).map((function(e){var n=e.type,r=e.orientation,i=e.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;i>s;s++){var u=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!jt(u)&&!jt(a)){for(var c=1;s-o>c;c++)t[o+c].length={type:"%",value:"".concat(a+(Number(u)-a)*c/(s-o))};o=s,a=Number(u)}}}(i);var o,a=i.map((function(t){return{offset:mr(Number(t.length.value),"%"),color:gr(t)}}));if("linear-gradient"===n)return new or(t.GradientType.LinearGradient,{angle:r?Pr(r):lr,steps:a});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var s=wr(r[0].at),u=s.cx,c=s.cy,l=void 0;if(r[0].style){var h=r[0].style,p=h.type,f=h.value;"extent-keyword"===p?(fr[o=f]||(fr[o]=new ar(o)),l=fr[o]):l=mr(f,p)}return new or(t.GradientType.RadialGradient,{cx:u,cy:c,size:l,steps:a})}}));var r=e[0];if("("===e[1]||"("===e[2])if("l"===r){var i=Er.exec(e);if(i){var o=(null===(n=i[2].match(Tr))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return[new or(t.GradientType.LinearGradient,{angle:mr(parseFloat(i[1]),"deg"),steps:o.map((function(t){var e=p(t,2),n=e[1];return{offset:mr(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===r){var a=function(t){var e,n=br.exec(t);if(n){var r=(null===(e=n[4].match(Tr))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:mr(50,"%"),cy:mr(50,"%"),steps:r.map((function(t){var e=p(t,2),n=e[1];return{offset:mr(100*Number(e[0]),"%"),color:n}}))}}return null}(e);if(a){if(!qt(a))return[new or(t.GradientType.RadialGradient,a)];e=a}}else if("p"===r)return function(t){var e=Mr.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(e)}));function Cr(t){return t&&!!t.image}function kr(t){return t&&!jt(t.r)&&!jt(t.g)&&!jt(t.b)}var Ar=$n((function(t){if(Cr(t))return s({repetition:"repeat"},t);if(jt(t)&&(t=""),"transparent"===t)return yr;if("currentColor"===t)t="black";else if("none"===t)return dr;var e=Nr(t);if(e)return e;var n=Dn(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),vr.apply(void 0,f([],p(r),!1))}));function Rr(t,e){if(kr(t)&&kr(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(Zt(e[n],0,255));return e[3]=Zt(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Or(t,e){if(jt(e))return mr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return mr(Number(e),"px");if("deg".search(t)>=0)return mr(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return mr(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Lr=function(t){return Or(/px/g,t)},Ir=$n(Lr);$n((function(t){return Or(RegExp("%","g"),t)}));var Dr=function(t){return $t(t)||isFinite(Number(t))?mr(Number(t)||0,"px"):Or(RegExp("px|%|em|rem","g"),t)},Gr=$n(Dr),_r=function(t){return Or(/deg|rad|grad|turn/g,t)},Fr=$n(_r);function Ur(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=sr(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=nr(t.unit)):(ur.isLength(t.unit)||ur.isLength(e.unit))&&(a=jr(t,i,n),s=jr(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Br(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=Xe(Number(e.value)):e.unit===t.UnitType.kTurns?n=He(Number(e.value)):e.value&&(n=e.value),n}function Vr(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):qt(t)?n=t.split(" ").map((function(t){return Number(t)})):$t(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function jr(e,n,r,i){if(void 0===i&&(i=!1),e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var o=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds();return(i?o.min[n]:0)+e.value/100*o.halfExtents[n]*2}return 0}var Yr=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Xr(t){return""+t}var Hr=function(t){return mr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},zr=$n(Hr);function Wr(t,e){return[t,e,Xr]}function qr(t,e){return function(n,r){return[n,r,function(n){return Xr(Zt(n,t,e))}]}}function Zr(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function $r(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Kr(t,e){var n=Math.min.apply(Math,f([],p(t),!1)),r=Math.min.apply(Math,f([],p(e),!1));return{x:n,y:r,width:Math.max.apply(Math,f([],p(t),!1))-n,height:Math.max.apply(Math,f([],p(e),!1))-r}}function Qr(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Jr(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function ti(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,l=[o,a],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var p=s+h;a>o?p>o&&a>p&&l.push(p):p>a&&o>p&&l.push(p)}for(h=0;l.length>h;h++){var f=Qr(t,0,n,r,i,l[h]);u>f&&(u=f),f>c&&(c=f)}var d=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,v=-1/0,m=[o,a];for(h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var g=d+h;a>o?g>o&&a>g&&m.push(g):g>a&&o>g&&m.push(g)}for(h=0;m.length>h;h++){var x=Jr(0,e,n,r,i,m[h]);y>x&&(y=x),x>v&&(v=x)}return{x:u,y:y,width:c-u,height:v-y}}function ei(t,e,n,r){return $r(t,e,n,r)}function ni(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function ri(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function ii(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(Qt(s,0))Qt(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;Qt(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function oi(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=ii(t,n,i,a),h=ii(e,r,o,s),p=0;l.length>p;p++)u.push(ri(t,n,i,a,l[p]));for(p=0;h.length>p;p++)c.push(ri(e,r,o,s,h[p]));return Kr(u,c)}function ai(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=$r(r[0],r[1],i[0],i[1])}return e}(t)}function si(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function ui(t,e,n){var r=t+n-2*e;if(Qt(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function ci(t,e,n,r,i,o){var a=ui(t,n,i)[0],s=ui(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(si(t,n,i,a)),void 0!==s&&c.push(si(e,r,o,s)),Kr(u,c)}function li(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Ie(t.parsedStyle.d.absolutePath,void 0,s(s({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function hi(t,e){return t[0]===e[0]&&t[1]===e[1]}function pi(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((o+a-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(o)*Math.sqrt(a)));if(!s||0===Math.sin(s)||Qt(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),c=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(c-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function fi(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}$n((function(t){return qt(t)?t.split(" ").map(zr):t.map(zr)}));var di=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},yi=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=je(r=Jt(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,l=(t.y-a.y)/2,h={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},p=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);p>1&&(e*=Math.sqrt(p),n*=Math.sqrt(p));var f=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),d=(i!==o?1:-1)*Math.sqrt(f=0>f?0:f),y=d*(e*h.y/n),v=d*(-n*h.x/e),m={x:Math.cos(u)*y-Math.sin(u)*v+(t.x+a.x)/2,y:Math.sin(u)*y+Math.cos(u)*v+(t.y+a.y)/2},g={x:(h.x-y)/e,y:(h.y-v)/n},x=di({x:1,y:0},g),E=di(g,{x:(-h.x-y)/e,y:(-h.y-v)/n});!o&&E>0?E-=2*Math.PI:o&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*s,M=e*Math.cos(b),T=n*Math.sin(b);return{x:Math.cos(u)*M-Math.sin(u)*T+m.x,y:Math.sin(u)*M+Math.cos(u)*T+m.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function vi(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,c=r.arcFlag,l=r.sweepFlag,h=yi({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),p=yi({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=p.x-h.x,d=p.y-h.y,y=Math.sqrt(f*f+d*d);return{x:-f/y,y:-d/y}}function mi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function gi(t,e){return mi(t)*mi(e)?(t[0]*e[0]+t[1]*e[1])/(mi(t)*mi(e)):1}function xi(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(gi(t,e))}function Ei(t,e){var n=e[1],r=e[2],i=Jt(je(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,p=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,f=h*h/(n*n)+p*p/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var d=n*n*(p*p)+r*r*(h*h),y=d?Math.sqrt((n*n*(r*r)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var v=r?y*n*p/r:0,m=n?y*-r*h/n:0,g=(s+c)/2+Math.cos(i)*v-Math.sin(i)*m,x=(u+l)/2+Math.sin(i)*v+Math.cos(i)*m,E=[(h-v)/n,(p-m)/r],b=[(-1*h-v)/n,(-1*p-m)/r],M=xi([1,0],E),T=xi(E,b);return gi(E,b)>-1||(T=Math.PI),1>gi(E,b)||(T=0),0===a&&T>0&&(T-=2*Math.PI),1===a&&0>T&&(T+=2*Math.PI),{cx:g,cy:x,rx:hi(t,[c,l])?0:n,ry:hi(t,[c,l])?0:r,startAngle:M,endAngle:M+T,xRotation:i,arcFlag:o,sweepFlag:a}}function bi(t,e,n,r){var i=.5522847498307936,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var Mi=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=ge(t)}catch(n){e=ge(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&hi([r[1],r[2]],o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=Ei(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&hi(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var f=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===c)l.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]];else if("T"===c){var d=fi((v=e[s-1]).currentPoint,f);"Q"===v.command?(l.command="Q",l.startTangent=[f[0]-d[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]):(l.command="TL",l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===c){var y=[u[3],u[4]];l.startTangent=[f[0]-(m=[u[1],u[2]])[0],f[1]-m[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[m[0]-y[0],m[1]-y[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[y[0]-m[0],y[1]-m[1]])}else if("S"===c){var v,m=fi((v=e[s-1]).currentPoint,f);y=[u[1],u[2]],"C"===v.command?(l.command="C",l.startTangent=[f[0]-m[0],f[1]-m[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="SQ",l.startTangent=[f[0]-y[0],f[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var g=vi(l,0),x=g.x,E=g.y,b=vi(l,1,!1),M=b.x,T=b.y;l.startTangent=[x,E],l.endTangent=[M,T]}e.push(l)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=(y=t[o]).currentPoint,s=y.params,u=y.prePoint,c=void 0;switch(y.command){case"Q":c=ci(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=oi(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var l=y.arcParams;c=ti(l.cx,l.cy,l.rx,l.ry,l.xRotation,l.startAngle,l.endAngle);break;default:n.push(a[0]),r.push(a[1])}c&&(y.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===y.command||"M"===y.command)&&y.prePoint&&y.nextPoint&&i.push(y)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var h=Wt(n),p=Wt(r),f=zt(n),d=zt(r);if(0===i.length)return{x:h,y:p,width:f-h,height:d-p};for(o=0;i.length>o;o++){var y;(a=(y=i[o]).currentPoint)[0]===h?h-=pi(y,e).xExtra:a[0]===f&&(f+=pi(y,e).xExtra),a[1]===p?p-=pi(y,e).yExtra:a[1]===d&&(d+=pi(y,e).yExtra)}return{x:h,y:p,width:f-h,height:d-p}}(a,0),u=s.x,c=s.y,l=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(h)?h:0}}},Ti=$n(Mi);function Si(t){return qt(t)?Ti(t):Mi(t)}function Pi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Se(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Se(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=_e(r,i));var a,s,u,c,l,h,p,f,d=De(o[0])!==De(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):o[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[d,(u=o[1],c=d,l=u.length-1,h=[],p=0,f=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),f.forEach((function(t,e){u.slice(1).forEach((function(t,n){p+=Pe(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=p,p=0})),f[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function wi(t,e){return[t.points,e.points,function(t){return t}]}var Ni=null,Ci=/\s*(\w+)\(([^)]*)\)/g;function ki(t){return function(e){var n=0;return t.map((function(t){return t===Ni?e[n++]:t}))}}function Ai(t){return t}var Ri={matrix:["NNNNNN",[Ni,Ni,0,0,Ni,Ni,0,0,0,0,1,0,Ni,Ni,0,1],Ai],matrix3d:["NNNNNNNNNNNNNNNN",Ai],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ki([Ni,Ni,new ur(1)]),Ai],scaleX:["N",ki([Ni,new ur(1),new ur(1)]),ki([Ni,new ur(1)])],scaleY:["N",ki([new ur(1),Ni,new ur(1)]),ki([new ur(1),Ni])],scaleZ:["N",ki([new ur(1),new ur(1),Ni])],scale3d:["NNN",Ai],skew:["Aa",null,Ai],skewX:["A",null,ki([Ni,lr])],skewY:["A",null,ki([lr,Ni])],translate:["Tt",ki([Ni,Ni,cr]),Ai],translateX:["T",ki([Ni,cr,cr]),ki([Ni,cr])],translateY:["T",ki([cr,Ni,cr]),ki([cr,Ni])],translateZ:["L",ki([cr,cr,Ni])],translate3d:["TTL",Ai]};function Oi(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],o=i[0],a=i.slice(1);if("translate"===o||"skew"===o?1===a.length&&a.push(0):"scale"===o&&1===a.length&&a.push(a[0]),!Ri[o])return[];var s=a.map((function(t){return mr(t)}));e.push({t:o,d:s})}return e}function Li(t){if(Array.isArray(t))return Oi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Ci.lastIndex=0;e=Ci.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Ri[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(a.length>s.length)return[];for(var u=[],c=0;s.length>c;c++){var l=a[c],h=s[c],p=void 0;if(void 0===(p=l?{A:function(t){return"0"===t.trim()?lr:Fr(t)},N:zr,T:Gr,L:Ir}[h.toUpperCase()](l):{a:lr,n:u[0],t:cr}[h]))return[];u.push(p)}if(n.push({t:i,d:u}),Ci.lastIndex===t.length)return n}return[]}function Ii(t){if(Array.isArray(t))return Oi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Ci.lastIndex=0;e=Ci.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Ri[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(a.length>s.length)return[];for(var u=[],c=0;s.length>c;c++){var l=a[c],h=s[c],p=void 0;if(void 0===(p=l?{A:function(t){return"0"===t.trim()?lr:_r(t)},N:Hr,T:Dr,L:Lr}[h.toUpperCase()](l):{a:lr,n:u[0],t:cr}[h]))return[];u.push(p)}if(n.push({t:i,d:u}),Ci.lastIndex===t.length)return n}return[]}function Di(t){var e,n,r,i;switch(t.t){case"rotateX":return i=je(Br(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=je(Br(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=je(Br(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=je(Br(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var l=je(Br(t.d[0])),h=je(Br(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=je(Br(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=je(Br(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=jr(t.d[0],0,null)||0,n=jr(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=jr(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=jr(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=jr(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=jr(t.d[0],0,null)||0,n=jr(t.d[1],0,null)||0,r=jr(t.d[2],0,null)||0,1];case"perspective":var p=jr(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,p?-1/p:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function Gi(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function _i(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(Je,t))return!1;if(M(tn,Je),tn[3]=0,tn[7]=0,tn[11]=0,tn[15]=1,1e-8>Math.abs(N(tn)))return!1;var a,s,u=Je[3],c=Je[7],l=Je[11],h=Je[12],p=Je[13],f=Je[14],d=Je[15];if(0!==u||0!==c||0!==l){if(en[0]=u,en[1]=c,en[2]=l,en[3]=d,!w(tn,tn))return!1;P(tn,tn),yt(i,en,tn)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=p,e[2]=f,(a=nn)[0][0]=(s=Je)[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=J(nn[0]),at(nn[0],nn[0]),r[0]=st(nn[0],nn[1]),on(nn[1],nn[1],nn[0],1,-r[0]),n[1]=J(nn[1]),at(nn[1],nn[1]),r[0]/=n[1],r[1]=st(nn[0],nn[2]),on(nn[2],nn[2],nn[0],1,-r[1]),r[2]=st(nn[1],nn[2]),on(nn[2],nn[2],nn[1],1,-r[2]),n[2]=J(nn[2]),at(nn[2],nn[2]),r[1]/=n[2],r[2]/=n[2],ut(rn,nn[1],nn[2]),0>st(nn[0],rn))for(var y=0;3>y;y++)n[y]*=-1,nn[y][0]*=-1,nn[y][1]*=-1,nn[y][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+nn[0][0]-nn[1][1]-nn[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-nn[0][0]+nn[1][1]-nn[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-nn[0][0]-nn[1][1]+nn[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+nn[0][0]+nn[1][1]+nn[2][2],0)),nn[2][1]>nn[1][2]&&(o[0]=-o[0]),nn[0][2]>nn[2][0]&&(o[1]=-o[1]),nn[1][0]>nn[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Di).reduce(Gi)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Fi=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(s=0;3>s;s++)for(var u=0;3>u;u++)a[3][s]+=e[u]*a[u][s];var c=i[0],l=i[1],h=i[2],p=i[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(l*l+h*h),f[0][1]=2*(c*l-h*p),f[0][2]=2*(c*h+l*p),f[1][0]=2*(c*l+h*p),f[1][1]=1-2*(c*c+h*h),f[1][2]=2*(l*h-c*p),f[2][0]=2*(c*h-l*p),f[2][1]=2*(l*h+c*p),f[2][2]=1-2*(c*c+l*l),a=t(a,f);var d,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(y[2][1]=r[2],a=t(a,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],a=t(a,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],a=t(a,y)),s=0;3>s;s++)for(u=0;3>u;u++)a[s][u]*=n[s];return 0==(d=a)[0][2]&&0==d[0][3]&&0==d[1][2]&&0==d[1][3]&&0==d[2][0]&&0==d[2][1]&&1==d[2][2]&&0==d[2][3]&&0==d[3][2]&&1==d[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function Ui(t){return t.toFixed(6).replace(".000000","")}function Bi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=_i(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=_i(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=Zt(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return Fi(t[0],t[1],t[2],e,t[4]).map(Ui).join(",")}])}function Vi(t){return t.replace(/[XY]/,"")}function ji(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function Yi(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?mr(a):mr(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length)u=[(g=Bi(t,e))[0]],c=[g[1]],l=[["matrix",[g[2]]]];else for(o=0;t.length>o;o++){var h=t[o].t,p=e[o].t,f=t[o].d,d=e[o].d,y=Ri[h],v=Ri[p],m=void 0;if(s=p,"perspective"===(a=h)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var g=Bi([t[o]],[e[o]]);u.push(g[0]),c.push(g[1]),l.push(["matrix",[g[2]]])}else{if(h===p)m=h;else if(y[2]&&v[2]&&Vi(h)===Vi(p))m=Vi(h),f=y[2](f),d=v[2](d);else{if(!y[1]||!v[1]||ji(h)!==ji(p)){u=[(g=Bi(t,e))[0]],c=[g[1]],l=[["matrix",[g[2]]]];break}m=ji(h),f=y[1](f),d=v[1](d)}for(var x=[],E=[],b=[],M=0;f.length>M;M++){g=Ur(f[M],d[M],n,!1,M);x[M]=g[0],E[M]=g[1],b.push(g[2])}u.push(x),c.push(E),l.push([m,b])}}if(r){var T=u;u=c,c=T}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var Xi=$n((function(t){if(qt(t)){if("text-anchor"===t)return[mr(0,"px"),mr(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Gr(Hi(e[0])),Gr(Hi(e[1]))]}return[mr(t[0]||0,"px"),mr(t[1]||0,"px")]}));function Hi(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var zi=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:t.PropertySyntax.PATH,p:50},{n:"points",int:!0,l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],Wi=zi.filter((function(t){return!!t.l})).map((function(t){return t.n})),qi={},Zi=function(){function e(t){var e=this;this.runtime=t,zi.forEach((function(t){e.registerMetadata(t)}))}return e.prototype.registerMetadata=function(t){f([t.n],p(t.a||[]),!1).forEach((function(e){qi[e]=t}))},e.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},e.prototype.processProperties=function(e,n,r){void 0===r&&(r={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0}),Object.assign(e.attributes,n);var i=e.parsedStyle.clipPath,o=e.parsedStyle.offsetPath;Object.assign(e.parsedStyle,n);var a,u=!!r.forceUpdateGeometry;!u&&Wi.some((function(t){return t in n}))&&(u=!0),n.fill&&(e.parsedStyle.fill=Ar(n.fill)),n.stroke&&(e.parsedStyle.stroke=Ar(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=Ar(n.shadowColor)),n.filter&&(e.parsedStyle.filter=function(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Yr.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Or(/deg|rad|grad|turn|px|%/g,t)||Ar(t)}))}),n.lastIndex===t.length)return r}return[]}(n.filter)),jt(n.radius)||(e.parsedStyle.radius=Vr(n.radius,4)),jt(n.lineDash)||(e.parsedStyle.lineDash=Vr(n.lineDash,2)),n.points&&(e.parsedStyle.points={points:qt(a=n.points)?a.split(" ").map((function(t){var e=p(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):a,totalLength:0,segments:[]}),""===n.d&&(e.parsedStyle.d=s({},pn)),n.d&&(e.parsedStyle.d=Si(n.d)),n.textTransform&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TEXT_TRANSFORM].calculator(null,null,{value:n.textTransform},e,null),ee(n.clipPath)||this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.DEFINED_PATH].calculator("clipPath",i,n.clipPath,e,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.DEFINED_PATH].calculator("offsetPath",o,n.offsetPath,e,this.runtime),n.transform&&(e.parsedStyle.transform=Li(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=Xi(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.MARKER].calculator("",n.markerMid,n.markerMid,null,null)),jt(n.zIndex)||this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.Z_INDEX].postProcessor(e),jt(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.OFFSET_DISTANCE].postProcessor(e),n.transform&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TRANSFORM].postProcessor(e),n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[t.PropertySyntax.TRANSFORM_ORIGIN].postProcessor(e),u&&(e.geometry.dirty=!0,e.renderable.boundsDirty=!0,e.renderable.renderBoundsDirty=!0,r.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(e))},e.prototype.updateGeometry=function(e){var n=e.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new It),i.renderBounds||(i.renderBounds=new It);var o=e.parsedStyle,a=r.update(o,e),s=a.cx,u=void 0===s?0:s,c=a.cy,l=void 0===c?0:c,h=a.cz,p=void 0===h?0:h,f=a.hwidth,d=void 0===f?0:f,y=a.hheight,v=void 0===y?0:y,m=a.hdepth,g=void 0===m?0:m,x=[Math.abs(d),Math.abs(v),g],E=o.stroke,b=o.lineWidth,M=void 0===b?1:b,T=o.increasedLineWidthForHitTesting,S=void 0===T?0:T,P=o.shadowType,w=void 0===P?"outer":P,N=o.shadowColor,C=o.filter,k=void 0===C?[]:C,A=o.transformOrigin,R=[u,l,p];if(i.contentBounds.update(R,x),E&&!E.isNone){var O=((M||0)+(S||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);x[0]+=O,x[1]+=O}if(i.renderBounds.update(R,x),N&&w&&"inner"!==w){var L=i.renderBounds,I=L.min,D=L.max,G=o.shadowBlur||0,_=o.shadowOffsetX||0,F=o.shadowOffsetY||0,U=D[0]+G+_,B=I[1]-G+F,V=D[1]+G+F;I[0]=Math.min(I[0],I[0]-G+_),D[0]=Math.max(D[0],U),I[1]=Math.min(I[1],B),D[1]=Math.max(D[1],V),i.renderBounds.setMinMax(I,D)}k.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,rt(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,p=c[1]-s+a,f=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],p),l[1]=Math.max(l[1],f),i.renderBounds.setMinMax(c,l)}})),e.geometry.dirty=!1;var j=0>v,Y=(0>d?-1:1)*(A?jr(A[0],0,e,!0):0),X=(j?-1:1)*(A?jr(A[1],1,e,!0):0);(Y||X)&&e.setOrigin(Y,X)}},e.prototype.updateSizeAttenuation=function(e,n){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=(e.style.rawLineWidth||1)/n,e.nodeName===t.Shape.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=(e.style.rawR||1)/n)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===t.Shape.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))},e}(),$i=function(){function t(){this.mixer=Wr}return t.prototype.calculator=function(t,e,n,r){return Br(n)},t}(),Ki=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof ar&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),Qi=function(){function t(){this.parser=Ar,this.mixer=Rr}return t.prototype.calculator=function(t,e,n,r){return n instanceof ar?"none"===n.value?dr:yr:n},t}(),Ji=function(){function t(){}return t.prototype.calculator=function(t,e,n){return n instanceof ar?[]:n},t}();function to(t){var e=t.parsedStyle.fontSize;return jt(e)?null:e}var eo=function(){function e(){this.mixer=Wr}return e.prototype.calculator=function(e,n,r,i,o){var a;if($t(r))return r;if(!ur.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode)if(s=to(i.parentNode))return s*=r.value;return 0}if(r.unit===t.UnitType.kRems){var s;if(null===(a=null==i?void 0:i.ownerDocument)||void 0===a?void 0:a.documentElement)if(s=to(i.ownerDocument.documentElement))return s*=r.value;return 0}},e}(),no=function(){function t(){this.mixer=Zr}return t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),ro=function(){function t(){this.mixer=Zr}return t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),io=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof ar&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),oo=function(){function t(){this.mixer=Wr}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ao=function(){function e(){this.mixer=qr(0,1)}return e.prototype.calculator=function(t,e,n){return n.value},e.prototype.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var o=r.getPoint(n.offsetDistance);o&&e.setLocalPosition(o.x,o.y)}}},e}(),so=function(){function t(){this.mixer=qr(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),uo=function(){function t(){this.parser=Si,this.mixer=Pi}return t.prototype.calculator=function(t,e,n){return n instanceof ar&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ft(0,0,0,0)}:n},t}(),co=function(){this.mixer=wi},lo=function(t){function e(){var e=t.apply(this,f([],p(arguments),!1))||this;return e.mixer=qr(0,1/0),e}return i(e,t),e}(eo),ho=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof ar?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),po=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),fo=new WeakMap;function yo(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;fo.has(r)?fo.get(r).destroy(n):fo.set(r,e)}}var vo="undefined"!=typeof window&&void 0!==window.document;function mo(t){return!!t.getAttribute}function go(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function xo(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function Eo(t,e){if(vo)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var bo={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Mo="object"==typeof performance&&performance.now?performance:Date;function To(e){return e.nodeName===t.Shape.FRAGMENT||e.getRootNode().nodeName===t.Shape.FRAGMENT}var So=1,Po="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},wo=Date.now(),No={},Co=Date.now(),ko=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Co,r=n>16?0:16-n,i=So++;return No[i]=t,Object.keys(No).length>1||setTimeout((function(){Co=e;var t=No;No={},Object.keys(t).forEach((function(e){return t[e](Po.performance&&"function"==typeof Po.performance.now?Po.performance.now():Date.now()-wo)}))}),r),i},Ao=function(t){delete No[t]},Ro=function(t){return"string"!=typeof t?ko:""===t?Po.requestAnimationFrame:Po[t+"RequestAnimationFrame"]},Oo=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Ro(t)})),Lo=Ro(Oo),Io=function(t){return"string"!=typeof t?Ao:""===t?Po.cancelAnimationFrame:Po[t+"CancelAnimationFrame"]||Po[t+"CancelRequestAnimationFrame"]}(Oo);Po.requestAnimationFrame=Lo,Po.cancelAnimationFrame=Io;var Do=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,f([],p(t),!1))})))},t}(),Go=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return c(this,void 0,void 0,(function(){var e,n,r;return l(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,f([],p(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return this.callbacks.length-1>n?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),_o=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),Fo=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;this.callbacks.length-1>e;e++){t=(0,this.callbacks[e])(t)}return t}return null},t}(),Uo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Bo=/([\"\'])[^\'\"]+\1/;function Vo(t,e,n){return S(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var jo=b(),Yo=b(),Xo={scale:function(t){L(jo,[t[0].value,t[1].value,1])},scaleX:function(t){L(jo,[t[0].value,1,1])},scaleY:function(t){L(jo,[1,t[0].value,1])},scaleZ:function(t){L(jo,[1,1,t[0].value])},scale3d:function(t){L(jo,[t[0].value,t[1].value,t[2].value])},translate:function(t){O(jo,[t[0].value,t[1].value,0])},translateX:function(t){O(jo,[t[0].value,0,0])},translateY:function(t){O(jo,[0,t[0].value,0])},translateZ:function(t){O(jo,[0,0,t[0].value])},translate3d:function(t){O(jo,[t[0].value,t[1].value,t[2].value])},rotate:function(t){_(jo,je(Br(t[0])))},rotateX:function(t){D(jo,je(Br(t[0])))},rotateY:function(t){G(jo,je(Br(t[0])))},rotateZ:function(t){_(jo,je(Br(t[0])))},rotate3d:function(t){I(jo,je(Br(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){Vo(jo,je(t[0].value),je(t[1].value))},skewX:function(t){Vo(jo,je(t[0].value),0)},skewY:function(t){Vo(jo,0,je(t[0].value))},matrix:function(t){T(jo,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){T.apply(K,f([jo],p(t.map((function(t){return t.value}))),!1))}},Ho=tt(1,1,1),zo=Q(),Wo={translate:function(t,e){Qa.sceneGraphService.setLocalScale(t,Ho,!1),Qa.sceneGraphService.setLocalEulerAngles(t,zo,void 0,void 0,!1),Qa.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Qa.sceneGraphService.dirtifyLocal(t,t.transformable)}};function qo(t,e){if(t.length){if(1===t.length&&Wo[t[0].t])return void Wo[t[0].t](e,t[0].d);for(var n=S(Yo),r=0;t.length>r;r++){var i=t[r],o=Xo[i.t];o&&(o(i.d),$(n,n,jo))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var Zo=function(){function t(){this.parser=Ii,this.mixer=Yi}return t.prototype.calculator=function(t,e,n,r){return n instanceof ar?[]:n},t.prototype.postProcessor=function(t){qo(t.parsedStyle.transform,t)},t}(),$o=function(){function e(){}return e.prototype.postProcessor=function(e){var n=e.parsedStyle.transformOrigin;n[0].unit===t.UnitType.kPixels&&n[1].unit===t.UnitType.kPixels?e.setOrigin(n[0].value,n[1].value):e.getGeometryBounds()},e}(),Ko=function(){function e(){}return e.prototype.calculator=function(t,e,n,r){return n.value},e.prototype.postProcessor=function(e){if(e.parentNode){var n=e.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=t.SortReason.Z_INDEX_CHANGED)}},e}(),Qo=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=t.cy,i=t.r,o=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:o,hheight:o}},t}(),Jo=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=t.cy,i=t.rx,o=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===o?0:o}},t}(),ta=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i),u=(a-o)/2,c=(Math.max(n,i)-s)/2;return{cx:o+u,cy:s+c,hwidth:u,hheight:c}},t}(),ea=function(){function t(){}return t.prototype.update=function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}},t}(),na=function(){function t(){}return t.prototype.update=function(t){if(t.points&&Ht(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,f([],p(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,f([],p(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,f([],p(e.map((function(t){return t[1]}))),!1)),o=(r-n)/2,a=(Math.max.apply(Math,f([],p(e.map((function(t){return t[1]}))),!1))-i)/2;return{cx:n+o,cy:i+a,hwidth:o,hheight:a}}return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),ra=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.src,s=t.width,u=t.height,c=void 0===s?0:s,l=void 0===u?0:u;return a&&!qt(a)&&(c||(t.width=c=a.width),l||(t.height=l=a.height)),{cx:r+c/2,cy:o+l/2,hwidth:c/2,hheight:l/2}},t}(),ia=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){return t.text},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=void 0===o?"start":o,s=t.lineWidth,u=void 0===s?1:s,c=t.textBaseline,l=void 0===c?"alphabetic":c,h=t.dx,p=void 0===h?0:h,f=t.dy,d=void 0===f?0:f,y=t.x,v=void 0===y?0:y,m=t.y,g=void 0===m?0:m;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var x=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,E=this.globalRuntime.textService.measureText(i,t,x);t.metrics=E;var b=E.width/2,M=E.height/2,T=v+b;"center"===a||"middle"===a?T+=u/2-b:"right"!==a&&"end"!==a||(T+=u-2*b);var S=g-M;return"middle"===l?S+=M:"top"===l||"hanging"===l?S+=2*M:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(S+=0),p&&(T+=p),d&&(S+=d),{cx:T,cy:S,hwidth:b,hheight:M}},t}(),oa=function(){function t(){}return t.prototype.update=function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),aa=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=t.y,i=t.width,o=void 0===i?0:i,a=t.height,s=void 0===a?0:a;return{cx:(void 0===n?0:n)+o/2,cy:(void 0===r?0:r)+s/2,hwidth:o/2,hheight:s/2}},t}();var sa,ua=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new _t,this.page=new _t,this.canvas=new _t,this.viewport=new _t,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw Error(Ut)},t}(),ca=function(t){function e(){var e=t.apply(this,f([],p(arguments),!1))||this;return e.client=new _t,e.movement=new _t,e.offset=new _t,e.global=new _t,e.screen=new _t,e}return i(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw Error(Ut)},e}(ua),la=function(t){function e(){var e=t.apply(this,f([],p(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return i(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(ca),ha=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(ca),pa=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return i(e,t),e}(ua),fa=new WeakMap,da=function(){function t(){this.emitter=new m}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r,i,o=!1,a=!1;te(n)?o=n:n&&(o=void 0!==(r=n.capture)&&r,a=void 0!==(i=n.once)&&i),o&&(t+="capture"),e=Vt(e)?e:e.handleEvent;var s=Vt(e)?void 0:e;return a?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){if(!this.emitter)return this;(te(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=Vt(e)?e:null==e?void 0:e.handleEvent;var r=Vt(e)?void 0:e;return this.emitter.off(t,e,r),this},t.prototype.emit=function(t,e){this.dispatchEvent(new pa(t,e))},t.prototype.dispatchEvent=function(t,e){var n;void 0===e&&(e=!1);var r=fa.get(this);if(r||(r=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&fa.set(this,r),r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],e||(t.target=this),t.manager.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),ya=function(e){function n(){var t=e.call(this)||this;return t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return i(n,e),n.isNode=function(t){return!!t.childNodes},Object.defineProperty(n.prototype,"textContent",{get:function(){var e,n,r="";this.nodeName===t.Shape.TEXT&&(r+=this.style.text);try{for(var i=h(this.childNodes),o=i.next();!o.done;o=i.next()){var a=o.value;r+=a.nodeName===t.Shape.TEXT?a.nodeValue:a.textContent}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t)})),this.nodeName===t.Shape.TEXT&&(this.style.text="".concat(e))},enumerable:!1,configurable:!0}),n.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},n.prototype.hasChildNodes=function(){return this.childNodes.length>0},n.prototype.isDefaultNamespace=function(t){throw Error(Ut)},n.prototype.lookupNamespaceURI=function(t){throw Error(Ut)},n.prototype.lookupPrefix=function(t){throw Error(Ut)},n.prototype.normalize=function(){throw Error(Ut)},n.prototype.isEqualNode=function(t){return this===t},n.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(n.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),n.prototype.compareDocumentPosition=function(t){var e;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(e=r.parentNode)&&void 0!==e?e:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,u=s===o?a:o;if(s[s.length-u.length]===u[0])return s===o?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],p=s[c+l];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===o?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===o?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},n.prototype.contain=function(t){return this.contains(t)},n.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},n.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},n.prototype.forEach=function(t){if(!1!==t(this))for(var e=this.childNodes,n=e.length,r=0;n>r;r++)e[r].forEach(t)},n.DOCUMENT_POSITION_DISCONNECTED=1,n.DOCUMENT_POSITION_PRECEDING=2,n.DOCUMENT_POSITION_FOLLOWING=4,n.DOCUMENT_POSITION_CONTAINS=8,n.DOCUMENT_POSITION_CONTAINED_BY=16,n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,n}(da),va=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new m,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=b(),this.tmpVec3=Q(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=Mo.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.dispatchEvent(i,2===i.button?"rightup":"mouseup")}var o=n.trackingData(t.pointerId),a=n.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!i.composedPath().includes(a)){for(var u=a;u&&!i.composedPath().includes(u);){if(i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside")}ya.isNode(u)&&(u=u.parentNode)}delete o.pressTargetsByButton[t.button],s=u}if(s){var c=n.clonePointerEvent(i,"click");c.target=s,c.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:r});var l=o.clicksByButton[t.button];l.target===c.target&&n.context.renderingContext.root.ownerDocument.defaultView.dblClickSpeed>r-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=r,c.detail=l.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==c.pointerType&&"touch"!==c.pointerType||n.dispatchEvent(c,"click"),n.dispatchEvent(c,"pointertap")),n.freeEvent(c)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a=n.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",o||void 0);if(n.dispatchEvent(a,"pointerout"),r&&n.dispatchEvent(a,"mouseout"),!e.composedPath().includes(o)){var s=n.createPointerEvent(t,"pointerleave",o||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),ya.isNode(s.target)&&(s.target=s.target.parentNode);n.freeEvent(s)}n.freeEvent(a)}if(o!==e.target){var u=n.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var c=o&&ya.isNode(o)&&o.parentNode;c&&c!==(ya.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&c!==e.target;)c=c.parentNode;if(!c||c===(ya.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var l=n.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==o&&l.target!==(ya.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),r&&n.notifyTarget(l,"mouseenter"),ya.isNode(l.target)&&(l.target=l.target.parentNode);n.freeEvent(l)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(ya.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),ya.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(ya.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),ya.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),ya.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.getScale=function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,o=r.offsetHeight;i&&o&&(e=t.width/i,n=t.height/o)}return{scaleX:e,scaleY:n,bbox:t}},t.prototype.client2Viewport=function(t){var e=this.getScale(),n=e.bbox;return new _t((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)},t.prototype.viewport2Client=function(t){var e=this.getScale(),n=e.bbox;return new _t((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=C(this.tmpMatrix,u,s),l=nt(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return ct(l,l,c),new _t(l[0],l[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=C(this.tmpMatrix,n,r),o=nt(this.tmpVec3,t.x,t.y,0);ct(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new _t((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.addEventMapping=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}))},t.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)},t.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],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){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(r=i+1;n.length>r;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)ya.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t,e){var n=null==e?void 0:e.target;if((null==n?void 0:n.shadowRoot)&&(n=e.composedPath()[0]),n){if(n===t)return!0;if(t&&t.contains)return t.contains(n)}return!!(null==e?void 0:e.composedPath)&&e.composedPath().indexOf(t)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=h(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=this.nativeHTMLMap.get(i.value);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(la);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i),a=this.context.contextService.getDomElement();return i.target=null!=n?n:o||this.isNativeEventFromCanvas(a,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(ha);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(ha);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(la);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},t.prototype.copyPointerData=function(t,e){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},t.prototype.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=Mo.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},t.prototype.freeEvent=function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},t.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},t.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||ya.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=mo(e)&&e.getAttribute("cursor");if(n)return n;e=ya.isNode(e)&&e.parentNode}},t}(),ma=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||Qa.offscreenCanvas)this.canvas=t||Qa.offscreenCanvas,this.context=this.canvas.getContext("2d",s({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",s({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",s({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();t.RenderReason=void 0,(sa=t.RenderReason||(t.RenderReason={}))[sa.CAMERA_CHANGED=0]="CAMERA_CHANGED",sa[sa.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",sa[sa.NONE=2]="NONE";var ga,xa=function(){function e(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new _o,initAsync:new Do,dirtycheck:new Fo,cull:new Fo,beginFrame:new _o,beforeRender:new _o,render:new _o,afterRender:new _o,endFrame:new _o,destroy:new _o,pick:new Go,pickSync:new Fo,pointerDown:new _o,pointerUp:new _o,pointerMove:new _o,pointerOut:new _o,pointerOver:new _o,pointerWheel:new _o,pointerCancel:new _o,click:new _o}}return e.prototype.init=function(t){var e=this,n=s(s({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()}))},e.prototype.getStats=function(){return this.stats},e.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},e.prototype.render=function(e,n,r){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var o=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(o.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),o.renderReasons.size&&this.inited){o.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===o.renderReasons.size&&o.renderReasons.has(t.RenderReason.CAMERA_CHANGED),s=!e.disableRenderHooks||!(e.disableRenderHooks&&a);s&&this.renderDisplayObject(o.root,e,o),this.hooks.beginFrame.call(n),s&&o.renderListCurrentFrame.forEach((function(t){i.hooks.beforeRender.call(t),i.hooks.render.call(t),i.hooks.afterRender.call(t)})),this.hooks.endFrame.call(n),o.renderListCurrentFrame=[],o.renderReasons.clear(),r()}},e.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(o){var a=i.enableCulling?this.hooks.cull.call(o,this.context.camera):o;a&&(this.stats.rendered++,n.renderListCurrentFrame.push(a))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var s=t.sortable;s.dirty&&(this.sort(t,s),s.dirty=!1,s.dirtyChildren=[],s.dirtyReason=void 0),(s.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},e.prototype.sort=function(e,n){n.sorted&&n.dirtyReason!==t.SortReason.Z_INDEX_CHANGED?n.dirtyChildren.forEach((function(t){if(-1===e.childNodes.indexOf(t)){var r=n.sorted.indexOf(t);0>r||n.sorted.splice(r,1)}else if(0===n.sorted.length)n.sorted.push(t);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>go(t[i],e)?n=i+1:r=i}return n}(n.sorted,t);n.sorted.splice(i,0,t)}})):n.sorted=e.childNodes.slice().sort(go)},e.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Ea=/\[\s*(.*)=(.*)\s*\]/,ba=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(Ea),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return jt(n)?"":n.toString?""+n:""},t}();t.ElementEvent=void 0,(ga=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",ga.DESTROY="destroy",ga.ATTR_MODIFIED="DOMAttrModified",ga.INSERTED="DOMNodeInserted",ga.REMOVED="removed",ga.MOUNTED="DOMNodeInsertedIntoDocument",ga.UNMOUNTED="DOMNodeRemovedFromDocument",ga.BOUNDS_CHANGED="bounds-changed",ga.CULLED="culled";var Ma=function(t){function e(e,n,r,i,o,a,s,u){var c=t.call(this,null)||this;return c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return i(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(ua);function Ta(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var Sa,Pa,wa,Na=new Ma(t.ElementEvent.REPARENT,null,"","","",0,"",""),Ca=wt(),ka=Q(),Aa=tt(1,1,1),Ra=b(),Oa=wt(),La=Q(),Ia=b(),Da=vt(),Ga=Q(),_a=vt(),Fa=Q(),Ua=Q(),Ba=Q(),Va=b(),ja=vt(),Ya=vt(),Xa=vt(),Ha={affectChildren:!0},za=function(){function e(e){this.runtime=e,this.pendingEvents=new Map,this.boundsChangedEvent=new pa(t.ElementEvent.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap}return e.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},e.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},e.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},e.prototype.attach=function(e,n,r){var i,o=!1;e.parentNode&&(o=e.parentNode!==n,this.detach(e));var a=e.nodeName===t.Shape.FRAGMENT,s=To(n);e.parentNode=n;var u=a?e.childNodes:[e];$t(r)?u.forEach((function(t){n.childNodes.splice(r,0,t),t.parentNode=n})):u.forEach((function(t){n.childNodes.push(t),t.parentNode=n}));var c=n.sortable;if(((null===(i=null==c?void 0:c.sorted)||void 0===i?void 0:i.length)||e.parsedStyle.zIndex)&&(-1===c.dirtyChildren.indexOf(e)&&c.dirtyChildren.push(e),c.dirty=!0,c.dirtyReason=t.SortReason.ADDED),!s){if(a)this.dirtifyFragment(e);else{var l=e.transformable;l&&this.dirtifyWorld(e,l)}o&&e.dispatchEvent(Na)}},e.prototype.detach=function(e){var n,r;if(e.parentNode){var i=e.transformable,o=e.parentNode.sortable;((null===(n=null==o?void 0:o.sorted)||void 0===n?void 0:n.length)||(null===(r=e.style)||void 0===r?void 0:r.zIndex))&&(-1===o.dirtyChildren.indexOf(e)&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=t.SortReason.REMOVED);var a=e.parentNode.childNodes.indexOf(e);a>-1&&e.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(e,i),e.parentNode=null}},e.prototype.getOrigin=function(t){return t.getGeometryBounds(),t.transformable.origin},e.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},e.prototype.rotate=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=tt(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var o=Da;Et(o,e[0],e[1],e[2]);var a=this.getRotation(t),s=this.getRotation(t.parentNode);Mt(Xa,s),xt(Xa,Xa),gt(o,Xa,o),gt(i.localRotation,o,a),Pt(i.localRotation,i.localRotation),this.dirtifyLocal(t,i)}else this.rotateLocal(t,e)},e.prototype.rotateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=tt(e,n,r));var i=t.transformable;Et(Ya,e[0],e[1],e[2]),St(i.localRotation,i.localRotation,Ya),this.dirtifyLocal(t,i)},e.prototype.setEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=tt(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Et(i.localRotation,e[0],e[1],e[2]);var o=this.getRotation(t.parentNode);Mt(ja,xt(Da,o)),St(i.localRotation,i.localRotation,ja),this.dirtifyLocal(t,i)}else this.setLocalEulerAngles(t,e)},e.prototype.setLocalEulerAngles=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=tt(e,n,r));var o=t.transformable;Et(o.localRotation,e[0],e[1],e[2]),i&&this.dirtifyLocal(t,o)},e.prototype.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=tt(e,n,r));var i=t.transformable;lt(e,ka)||(!function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,p=i*h-o*l,f=o*c-r*h,d=r*l-i*c,y=2*n[3];l*=y,h*=y,f*=2,d*=2,t[0]=a+(c*=y)+(p*=2),t[1]=s+l+f,t[2]=u+h+d}(e,e,i.localRotation),rt(i.localPosition,i.localPosition,e),this.dirtifyLocal(t,i))},e.prototype.setPosition=function(t,e){var n,r=t.transformable;if(Ba[0]=e[0],Ba[1]=e[1],Ba[2]=null!==(n=e[2])&&void 0!==n?n:0,!lt(this.getPosition(t),Ba)){if(et(r.position,Ba),null!==t.parentNode&&t.parentNode.transformable)M(Va,t.parentNode.transformable.worldTransform),w(Va,Va),ct(r.localPosition,Ba,Va);else et(r.localPosition,Ba);this.dirtifyLocal(t,r)}},e.prototype.setLocalPosition=function(t,e,n){var r;void 0===n&&(n=!0);var i=t.transformable;Ua[0]=e[0],Ua[1]=e[1],Ua[2]=null!==(r=e[2])&&void 0!==r?r:0,lt(i.localPosition,Ua)||(et(i.localPosition,Ua),n&&this.dirtifyLocal(t,i))},e.prototype.scaleLocal=function(t,e){var n,r,i,o,a=t.transformable;r=a.localScale,i=a.localScale,o=nt(La,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*o[0],r[1]=i[1]*o[1],r[2]=i[2]*o[2],this.dirtifyLocal(t,a)},e.prototype.setLocalScale=function(t,e,n){var r;void 0===n&&(n=!0);var i=t.transformable;nt(La,e[0],e[1],null!==(r=e[2])&&void 0!==r?r:i.localScale[2]),lt(La,i.localScale)||(et(i.localScale,La),n&&this.dirtifyLocal(t,i))},e.prototype.translate=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=nt(La,e,n,r)),lt(e,ka)||(rt(La,this.getPosition(t),e),this.setPosition(t,La))},e.prototype.setRotation=function(t,e,n,r,i){var o=t.transformable;if("number"==typeof e&&(e=bt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var a=this.getRotation(t.parentNode);Mt(Da,a),xt(Da,Da),gt(o.localRotation,Da,e),Pt(o.localRotation,o.localRotation),this.dirtifyLocal(t,o)}else this.setLocalRotation(t,e)},e.prototype.setLocalRotation=function(t,e,n,r,i,o){void 0===o&&(o=!0),"number"==typeof e&&(e=Tt(Da,e,n,r,i));var a=t.transformable;Mt(a.localRotation,e),o&&this.dirtifyLocal(t,a)},e.prototype.setLocalSkew=function(t,e,n,r){void 0===r&&(r=!0),"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(Oa,e,n));var i,o,a=t.transformable;(i=a.localSkew)[0]=(o=e)[0],i[1]=o[1],r&&this.dirtifyLocal(t,a)},e.prototype.dirtifyLocal=function(t,e){To(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},e.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},e.prototype.dirtifyFragment=function(e){var n=e.transformable;n&&(n.frozen=!1,n.dirtyFlag=!0,n.localDirtyFlag=!0);var r=e.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0);for(var i=e.childNodes.length,o=0;i>o;o++)this.dirtifyFragment(e.childNodes[o]);e.nodeName===t.Shape.FRAGMENT&&this.pendingEvents.set(e,!1)},e.prototype.triggerPendingEvents=function(){var e=this,n=new Set,r=new Set;this.pendingEvents.forEach((function(e,n){n.nodeName===t.Shape.FRAGMENT&&n.forEach((function(t){t!==n&&r.add(t)}))}));var i=function(t,i){!t.isConnected||n.has(t)||r.has(t)||(e.boundsChangedEvent.detail=i,e.boundsChangedEvent.target=t,t.isMutationObserved?t.dispatchEvent(e.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(e.boundsChangedEvent,!0),n.add(t))};this.pendingEvents.forEach((function(t,e){Ha.affectChildren=t,t?e.forEach((function(t){i(t,Ha)})):i(e,Ha)})),n.clear(),r.clear(),this.clearPendingEvents()},e.prototype.clearPendingEvents=function(){this.pendingEvents.clear()},e.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Ta(n),n=n.parentNode;e&&t.forEach((function(t){Ta(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)},e.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},e.prototype.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.dirtifyToRoot(r,!0),r.dispatchEvent(new Ma(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,Ma.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},e.prototype.getPosition=function(t){var e=t.transformable;return U(e.position,this.getWorldTransform(t,e))},e.prototype.getRotation=function(t){var e=t.transformable;return V(e.rotation,this.getWorldTransform(t,e))},e.prototype.getScale=function(t){var e=t.transformable;return B(e.scaling,this.getWorldTransform(t,e))},e.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},e.prototype.getLocalPosition=function(t){return t.transformable.localPosition},e.prototype.getLocalRotation=function(t){return t.transformable.localRotation},e.prototype.getLocalScale=function(t){return t.transformable.localScale},e.prototype.getLocalSkew=function(t){return t.transformable.localSkew},e.prototype.calcLocalTransform=function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){j(t.localTransform,t.localRotation,t.localPosition,tt(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(S(Ia),Ia[4]=Math.tan(t.localSkew[0]),Ia[1]=Math.tan(t.localSkew[1]),C(t.localTransform,t.localTransform,Ia));var e=j(Ia,Tt(Da,0,0,0,1),nt(La,1,1,1),t.localScale,t.origin);C(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,o=t.localScale,a=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==o[0]||1!==o[1]||1!==o[2])||(0!==a[0]||0!==a[1]||0!==a[2])?j(n,i,r,o,a):s?O(n,r):S(n)}},e.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},e.prototype.setLocalTransform=function(t,e){var n=U(Ga,e),r=V(_a,e),i=B(Fa,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,Aa,!1),this.setLocalPosition(t,ka,!1),this.setLocalEulerAngles(t,ka,void 0,void 0,!1),this.setLocalSkew(t,Ca,void 0,!1),this.dirtifyLocal(t,t.transformable)},e.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(It.isEmpty(r))return null;var i=n||new It;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},e.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return n.dirty&&Qa.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new It},e.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new It).update(r.center,r.halfExtents))})),o||(o=new It),e){var a=xo(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o.update(s.center,s.halfExtents)}}return e?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o},e.prototype.getLocalBounds=function(t){if(t.parentNode){var e=Ra;t.parentNode.transformable&&(e=w(Ia,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!It.isEmpty(n)){var r=new It;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},e.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);It.isEmpty(i)||(r=new It).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=p(r.getMin(),2),s=a[0],u=a[1],c=p(r.getMax(),2);return new Ft(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new Ft((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},e.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},e.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},e.prototype.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?C(e.worldTransform,r.worldTransform,e.localTransform):M(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},e.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),Wa={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},qa=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Za=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),$a=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ka=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!$a.exec(n)&&!Za.exec(t))},this.trimByKinsokuShorui=function(t){var e=f([],p(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=Wa.MetricsString+Wa.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Wa.BaselineSymbol).width),u=Wa.HeightMultiplier*s;s=s*Wa.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=l-h,d=!1,p=u;p>s;--p){for(y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,o=e.wordWrap,a=void 0!==o&&o,s=e.lineHeight,u=e.lineWidth,c=void 0===u?1:u,l=e.textBaseline,h=void 0===l?"alphabetic":l,p=e.textAlign,f=void 0===p?"start":p,d=e.letterSpacing,y=void 0===d?0:d,v=e.textPath,m=e.leading,g=void 0===m?0:m,x=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.fontStyle,a=void 0===o?"normal":o,s=t.fontVariant,u=void 0===s?"normal":s,c=t.fontWeight,l=void 0===c?"normal":c,h=$t(n)&&"".concat(n,"px")||"16px",p=i.split(","),f=p.length-1;f>=0;f--){var d=p[f].trim();!Bo.test(d)&&0>Uo.indexOf(d)&&(d='"'.concat(d,'"')),p[f]=d}return"".concat(a," ").concat(u," ").concat(l," ").concat(h," ").concat(p.join(","))}(e),E=this.measureFont(x,n);0===E.fontSize&&(E.fontSize=i,E.ascent=i);var b=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);b.font=x,e.isOverflowing=!1;var M=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),T=Array(M.length),S=0;if(!v){for(k=0;M.length>k;k++){var P=b.measureText(M[k]).width+(M[k].length-1)*y;T[k]=P,S=Math.max(S,P)}A=S+c;var w=s||E.fontSize+c,N=Math.max(w,E.fontSize+c)+(M.length-1)*(w+g),C=0;return"middle"===h?C=-N/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?C=-N:"top"!==h&&"hanging"!==h||(C=0),{font:x,width:A,height:N,lines:M,lineWidths:T,lineHeight:w+=g,maxLineWidth:S,fontProperties:E,lineMetrics:T.map((function(t,e){var n=0;return"center"===f||"middle"===f?n-=t/2:"right"!==f&&"end"!==f||(n-=t),new Ft(n-c/2,C+e*w,t+c,w)}))}}v.getTotalLength();for(var k=0;M.length>k;k++)var A=b.measureText(M[k]).width+(M[k].length-1)*y},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,u=e.maxLines,c=void 0===u?1/0:u,l=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),p=o+s,f="";"ellipsis"===l?f="...":l&&"clip"!==l&&(f=l);for(var d=[],y=0,v=0,m={},g=function(t){return r.getFromCache(t,s,m,h)},x=Array.from(f).reduce((function(t,e){return t+g(e)}),0),E=Array.from(t),b=0;E.length>b;b++){var M=E[b],T=t[b-1],S=t[b+1],P=g(M);if(this.isNewline(M)){if(++y>=c){e.isOverflowing=!0;break}v=0,d[y]=""}else{if(v>0&&v+P>p){if(y+1>=c){if(e.isOverflowing=!0,x>0&&p>=x){for(var w=d[y].length,N=0,C=w,k=0;w>k;k++){var A=g(d[y][k]);if(N+A+x>p){C=k;break}N+=A}d[y]=(d[y]||"").slice(0,C)+f}break}if(v=0,d[++y]="",this.isBreakingSpace(M))continue;this.canBreakInLastChar(M)||(d=this.trimToBreakable(d),v=this.sumTextWidthByCache(d[y]||"",m)),this.shouldBreakByKinsokuShorui(M,S)&&(d=this.trimByKinsokuShorui(d),v+=g(T||""))}v+=P,d[y]=(d[y]||"")+M}}return d.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&Wa.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&Wa.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=f([],p(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},t.prototype.canBreakInLastChar=function(t){return!t||!qa.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!qa.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),Qa={},Ja=(Pa=new ra,wa=new na,(Sa={})[t.Shape.CIRCLE]=new Qo,Sa[t.Shape.ELLIPSE]=new Jo,Sa[t.Shape.RECT]=Pa,Sa[t.Shape.IMAGE]=Pa,Sa[t.Shape.GROUP]=new oa,Sa[t.Shape.LINE]=new ta,Sa[t.Shape.TEXT]=new ia(Qa),Sa[t.Shape.POLYLINE]=wa,Sa[t.Shape.POLYGON]=wa,Sa[t.Shape.PATH]=new ea,Sa[t.Shape.HTML]=new aa,Sa[t.Shape.MESH]=null,Sa),ts=function(){var e,n=new Qi,r=new eo;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new oo,e[t.PropertySyntax.ANGLE]=new $i,e[t.PropertySyntax.DEFINED_PATH]=new Ki,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new Ji,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new no,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new ro,e[t.PropertySyntax.COORDINATE]=new eo,e[t.PropertySyntax.OFFSET_DISTANCE]=new ao,e[t.PropertySyntax.OPACITY_VALUE]=new so,e[t.PropertySyntax.PATH]=new uo,e[t.PropertySyntax.LIST_OF_POINTS]=new co,e[t.PropertySyntax.SHADOW_BLUR]=new lo,e[t.PropertySyntax.TEXT]=new ho,e[t.PropertySyntax.TEXT_TRANSFORM]=new po,e[t.PropertySyntax.TRANSFORM]=new Zo,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new $o,e[t.PropertySyntax.Z_INDEX]=new Ko,e[t.PropertySyntax.MARKER]=new io,e}();Qa.CameraContribution=ln,Qa.AnimationTimeline=null,Qa.EasingFunction=null,Qa.offscreenCanvasCreator=new ma,Qa.sceneGraphSelector=new ba,Qa.sceneGraphService=new za(Qa),Qa.textService=new Ka(Qa),Qa.geometryUpdaterFactory=Ja,Qa.CSSPropertySyntaxFactory=ts,Qa.styleValueRegistry=new Zi(Qa),Qa.layoutRegistry=null,Qa.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Qa.enableStyleSyntax=!0,Qa.enableSizeAttenuation=!1;var es=0;var ns=new Ma(t.ElementEvent.INSERTED,null,"","","",0,"",""),rs=new Ma(t.ElementEvent.REMOVED,null,"","","",0,"",""),is=new pa(t.ElementEvent.DESTROY),os=function(e){function n(){var n=e.call(this)||this;return n.entity=es++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},n.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},n.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},n.rBushNode={aabb:void 0},n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle={},n.parsedStyle={},n.attributes={},n}return i(n,e),Object.defineProperty(n.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),n.prototype.cloneNode=function(t){throw Error(Ut)},n.prototype.appendChild=function(e,n){var r;if(e.destroyed)throw Error("Cannot append a destroyed element.");return Qa.sceneGraphService.attach(e,this,n),(null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView)&&(To(this)||e.nodeName!==t.Shape.FRAGMENT?this.ownerDocument.defaultView.mountChildren(e):this.ownerDocument.defaultView.mountFragment(e)),this.isMutationObserved&&(ns.relatedNode=this,e.dispatchEvent(ns)),e},n.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},n.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},n.prototype.removeChild=function(t){var e;return rs.relatedNode=this,t.dispatchEvent(rs),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Qa.sceneGraphService.detach(t),t},n.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},n.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},n.prototype.matches=function(t){return Qa.sceneGraphService.matches(t,this)},n.prototype.getElementById=function(t){return Qa.sceneGraphService.querySelector("#".concat(t),this)},n.prototype.getElementsByName=function(t){return Qa.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},n.prototype.getElementsByClassName=function(t){return Qa.sceneGraphService.querySelectorAll(".".concat(t),this)},n.prototype.getElementsByTagName=function(t){return Qa.sceneGraphService.querySelectorAll(t,this)},n.prototype.querySelector=function(t){return Qa.sceneGraphService.querySelector(t,this)},n.prototype.querySelectorAll=function(t){return Qa.sceneGraphService.querySelectorAll(t,this)},n.prototype.closest=function(t){var e=this;do{if(Qa.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},n.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n},n.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},n.prototype.after=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},n.prototype.before=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=p(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,f([],p(a),!1))}},n.prototype.replaceWith=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this.after.apply(this,f([],p(t),!1)),this.remove()},n.prototype.append=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},n.prototype.prepend=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},n.prototype.replaceChildren=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,f([],p(t),!1))},n.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},n.prototype.destroy=function(){this.dispatchEvent(is),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},n.prototype.getGeometryBounds=function(){return Qa.sceneGraphService.getGeometryBounds(this)},n.prototype.getRenderBounds=function(){return Qa.sceneGraphService.getBounds(this,!0)},n.prototype.getBounds=function(){return Qa.sceneGraphService.getBounds(this)},n.prototype.getLocalBounds=function(){return Qa.sceneGraphService.getLocalBounds(this)},n.prototype.getBoundingClientRect=function(){return Qa.sceneGraphService.getBoundingClientRect(this)},n.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},n.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},n.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},n.prototype.getAttribute=function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}},n.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},n.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},n.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},n.prototype.setAttribute=function(t,e,n,r){this.attributes[t]=e},n.prototype.getAttributeNS=function(t,e){throw Error(Ut)},n.prototype.getAttributeNode=function(t){throw Error(Ut)},n.prototype.getAttributeNodeNS=function(t,e){throw Error(Ut)},n.prototype.hasAttributeNS=function(t,e){throw Error(Ut)},n.prototype.removeAttributeNS=function(t,e){throw Error(Ut)},n.prototype.removeAttributeNode=function(t){throw Error(Ut)},n.prototype.setAttributeNS=function(t,e,n){throw Error(Ut)},n.prototype.setAttributeNode=function(t){throw Error(Ut)},n.prototype.setAttributeNodeNS=function(t){throw Error(Ut)},n.prototype.toggleAttribute=function(t,e){throw Error(Ut)},n}(ya);function as(t){return!!(null==t?void 0:t.nodeName)}var ss,us=Qa.globalThis.Proxy?Qa.globalThis.Proxy:function(){},cs=new Ma(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Ma.MODIFICATION,null,null),ls=Q(),hs=vt(),ps=function(e){function n(n){var r=e.call(this)||this;return r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.config=n,r.id=n.id||"",r.name=n.name||"",(n.className||n.class)&&(r.className=n.className||n.class),r.nodeName=n.type||t.Shape.GROUP,n.initialParsedStyle&&Object.assign(r.parsedStyle,n.initialParsedStyle),r.initAttributes(n.style),Qa.enableStyleSyntax&&(r.style=new us({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return i(n,e),n.prototype.destroy=function(){e.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},n.prototype.cloneNode=function(t,e){var n=s({},this.attributes);for(var r in n){var i=n[r];as(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},n.prototype.initAttributes=function(t){void 0===t&&(t={});Qa.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0}),this.renderable.dirty=!0},n.prototype.setAttribute=function(t,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=!0),ee(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),e.prototype.setAttribute.call(this,t,n))},n.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];Qa.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(cs.relatedNode=this,cs.prevValue=o,cs.newValue=e,cs.attrName=t,cs.prevParsedValue=a,cs.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(cs):(cs.target=this,this.ownerDocument.defaultView.dispatchEvent(cs,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},n.prototype.getBBox=function(){var t=this.getBounds(),e=p(t.getMin(),2),n=e[0],r=e[1],i=p(t.getMax(),2);return new Ft(n,r,i[0]-n,i[1]-r)},n.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Qa.sceneGraphService.setOrigin(this,Be(t,e,n,!1)),this},n.prototype.getOrigin=function(){return Qa.sceneGraphService.getOrigin(this)},n.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Qa.sceneGraphService.setPosition(this,Be(t,e,n,!1)),this},n.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Qa.sceneGraphService.setLocalPosition(this,Be(t,e,n,!1)),this},n.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Qa.sceneGraphService.translate(this,Be(t,e,n,!1)),this},n.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Qa.sceneGraphService.translateLocal(this,Be(t,e,n,!1)),this},n.prototype.getPosition=function(){return Qa.sceneGraphService.getPosition(this)},n.prototype.getLocalPosition=function(){return Qa.sceneGraphService.getLocalPosition(this)},n.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},n.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=Be(t,e=e||t,n=n||t,!1)),Qa.sceneGraphService.scaleLocal(this,t),this},n.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Be(t,e=e||t,n=n||t,!1)),Qa.sceneGraphService.setLocalScale(this,t),this},n.prototype.getLocalScale=function(){return Qa.sceneGraphService.getLocalScale(this)},n.prototype.getScale=function(){return Qa.sceneGraphService.getScale(this)},n.prototype.getEulerAngles=function(){return Xe(p(We(ls,Qa.sceneGraphService.getWorldTransform(this)),3)[2])},n.prototype.getLocalEulerAngles=function(){return Xe(p(We(ls,Qa.sceneGraphService.getLocalRotation(this)),3)[2])},n.prototype.setEulerAngles=function(t){return Qa.sceneGraphService.setEulerAngles(this,0,0,t),this},n.prototype.setLocalEulerAngles=function(t){return Qa.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},n.prototype.rotateLocal=function(t,e,n){return jt(e)&&jt(n)?Qa.sceneGraphService.rotateLocal(this,0,0,t):Qa.sceneGraphService.rotateLocal(this,t,e,n),this},n.prototype.rotate=function(t,e,n){return jt(e)&&jt(n)?Qa.sceneGraphService.rotate(this,0,0,t):Qa.sceneGraphService.rotate(this,t,e,n),this},n.prototype.setRotation=function(t,e,n,r){return Qa.sceneGraphService.setRotation(this,t,e,n,r),this},n.prototype.setLocalRotation=function(t,e,n,r){return Qa.sceneGraphService.setLocalRotation(this,t,e,n,r),this},n.prototype.setLocalSkew=function(t,e){return Qa.sceneGraphService.setLocalSkew(this,t,e),this},n.prototype.getRotation=function(){return Qa.sceneGraphService.getRotation(this)},n.prototype.getLocalRotation=function(){return Qa.sceneGraphService.getLocalRotation(this)},n.prototype.getLocalSkew=function(){return Qa.sceneGraphService.getLocalSkew(this)},n.prototype.getLocalTransform=function(){return Qa.sceneGraphService.getLocalTransform(this)},n.prototype.getWorldTransform=function(){return Qa.sceneGraphService.getWorldTransform(this)},n.prototype.setLocalTransform=function(t){return Qa.sceneGraphService.setLocalTransform(this,t),this},n.prototype.resetLocalTransform=function(){Qa.sceneGraphService.resetLocalTransform(this)},n.prototype.getAnimations=function(){return this.activeAnimations},n.prototype.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},n.prototype.isVisible=function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},Object.defineProperty(n.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),n.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},n.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},n.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,f([],p(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},n.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,f([],p(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},n.prototype.getConfig=function(){return this.config},n.prototype.attr=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var r=p(e,2),i=r[0],o=r[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},n.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=p(U(ls,e),2),r=n[0],i=n[1],o=p(B(ls,e),2),a=o[0],s=o[1],u=V(hs,e),c=p(We(ls,u),3);return qe(c[0]||c[2],r,i,a,s)},n.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},n.prototype.setMatrix=function(t){var e=p(Ze(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},n.prototype.setLocalMatrix=function(t){var e=p(Ze(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},n.prototype.show=function(){this.forEach((function(t){t.style.visibility="visible"}))},n.prototype.hide=function(){this.forEach((function(t){t.style.visibility="hidden"}))},n.prototype.getCount=function(){return this.childElementCount},n.prototype.getParent=function(){return this.parentElement},n.prototype.getChildren=function(){return this.children},n.prototype.getFirst=function(){return this.firstElementChild},n.prototype.getLast=function(){return this.lastElementChild},n.prototype.getChildByIndex=function(t){return this.children[t]||null},n.prototype.add=function(t,e){return this.appendChild(t,e)},n.prototype.set=function(t,e){this.config[t]=e},n.prototype.get=function(t){return this.config[t]},n.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},n.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},n.prototype.setZIndex=function(t){return this.style.zIndex=t,this},n}(os),fs=function(e){function n(n){return void 0===n&&(n={}),e.call(this,s({type:t.Shape.CIRCLE},n))||this}return i(n,e),n}(ps),ds=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=u(e,["style"]);return(n=t.call(this,s({style:r},i))||this).isCustomElement=!0,n}return i(e,t),e}(ps),ys=function(e){function n(n){return void 0===n&&(n={}),e.call(this,s({type:t.Shape.ELLIPSE},n))||this}return i(n,e),n}(ps),vs=function(e){function n(){return e.call(this,{type:t.Shape.FRAGMENT})||this}return i(n,e),n}(ps),ms=function(e){function n(n){return void 0===n&&(n={}),e.call(this,s({type:t.Shape.GROUP},n))||this}return i(n,e),n}(ps),gs=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=u(n,["style"]);return(r=e.call(this,s({type:t.Shape.HTML,style:i},o))||this).cullable.enable=!1,r}return i(n,e),n.prototype.getDomElement=function(){return this.parsedStyle.$el},n.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},n.prototype.getLocalBounds=function(){if(this.parentNode){var t=w(b(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!It.isEmpty(e)){var n=new It;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(ps),xs=function(e){function n(n){return void 0===n&&(n={}),e.call(this,s({type:t.Shape.IMAGE},n))||this}return i(n,e),n}(ps),Es=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=u(n,["style"]);(r=e.call(this,s({type:t.Shape.LINE,style:s({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},o))||this).markerStartAngle=0,r.markerEndAngle=0;var a=r.parsedStyle,c=a.markerStart,l=a.markerEnd;return c&&as(c)&&(r.markerStartAngle=c.getLocalEulerAngles(),r.appendChild(c)),l&&as(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return i(n,e),n.prototype.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&as(r)&&(this.markerStartAngle=0,r.remove()),i&&as(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&as(r)&&(this.markerEndAngle=0,r.remove()),i&&as(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},n.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,o=e.x2,a=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&as(u)){var c,l,h,p,f,d,y;t?(p=i,f=a,l=o-i,h=s-a,d=n||0,y=this.markerStartAngle):(p=o,f=s,l=i-o,h=a-s,d=r||0,y=this.markerEndAngle),u.setLocalEulerAngles(180*(c=Math.atan2(h,l))/Math.PI+y),u.setLocalPosition(p+Math.cos(c)*d,f+Math.sin(c)*d)}},n.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=ni(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=ct(Q(),tt(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new _t(a[0],a[1])},n.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},n.prototype.getTotalLength=function(){var t=this.parsedStyle;return ei(t.x1,t.y1,t.x2,t.y2)},n}(ps),bs=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=u(n,["style"]);(r=e.call(this,s({type:t.Shape.PATH,style:i,initialParsedStyle:{miterLimit:4,d:s({},pn)}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,c=a.markerStart,l=a.markerEnd,h=a.markerMid;return c&&as(c)&&(r.markerStartAngle=c.getLocalEulerAngles(),r.appendChild(c)),h&&as(h)&&r.placeMarkerMid(h),l&&as(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return i(n,e),n.prototype.attributeChangedCallback=function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&as(r)&&(this.markerStartAngle=0,r.remove()),i&&as(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&as(r)&&(this.markerEndAngle=0,r.remove()),i&&as(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},n.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&as(i)){var o,a,s,u,c,l,h;if(t){var f=p(this.getStartTangent(),2);u=(y=f[1])[0],c=y[1],a=(d=f[0])[0]-y[0],s=d[1]-y[1],l=n||0,h=this.markerStartAngle}else{var d,y,v=p(this.getEndTangent(),2);u=(y=v[1])[0],c=y[1],a=(d=v[0])[0]-y[0],s=d[1]-y[1],l=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(o=Math.atan2(s,a))/Math.PI+h),i.setLocalPosition(u+Math.cos(o)*l,c+Math.sin(o)*l)}},n.prototype.placeMarkerMid=function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&as(t))for(var n=1;e.length-1>n;n++){var r=p(e[n].currentPoint,2),i=r[0],o=r[1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,o)}},n.prototype.getTotalLength=function(){return li(this)},n.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=function(t,e,n){return Ie(t,e,s(s({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=ct(Q(),tt(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new _t(o[0],o[1])},n.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*li(this),e)},n.prototype.getStartTangent=function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},n.prototype.getEndTangent=function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(ps),Ms=function(e){function n(n){void 0===n&&(n={});var r=this,i=n.style,o=u(n,["style"]);(r=e.call(this,s({type:t.Shape.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,c=a.markerStart,l=a.markerEnd,h=a.markerMid;return c&&as(c)&&(r.markerStartAngle=c.getLocalEulerAngles(),r.appendChild(c)),h&&as(h)&&r.placeMarkerMid(h),l&&as(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return i(n,e),n.prototype.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&as(r)&&(this.markerStartAngle=0,r.remove()),i&&as(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&as(r)&&(this.markerEndAngle=0,r.remove()),i&&as(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},n.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,o=t?e.markerStart:e.markerEnd;if(o&&as(o)&&i){var a,s,u,c,l,h,p;if(c=i[0][0],l=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,p=this.markerStartAngle;else{var f=i.length;this.parsedStyle.isClosed?(s=i[f-1][0]-i[0][0],u=i[f-1][1]-i[0][1]):(c=i[f-1][0],l=i[f-1][1],s=i[f-2][0]-i[f-1][0],u=i[f-2][1]-i[f-1][1]),h=r||0,p=this.markerEndAngle}o.setLocalEulerAngles(180*(a=Math.atan2(u,s))/Math.PI+p),o.setLocalPosition(c+Math.cos(a)*h,l+Math.sin(a)*h)}},n.prototype.placeMarkerMid=function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&as(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,i)}},n}(ps),Ts=function(e){function n(n){void 0===n&&(n={});var r=n.style,i=u(n,["style"]);return e.call(this,s({type:t.Shape.POLYLINE,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i))||this}return i(n,e),n.prototype.getTotalLength=function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=ai(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t},n.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},n.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,o=[],a=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=ei(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))})),this.parsedStyle.points.segments=o}var u=0,c=0;this.parsedStyle.points.segments.forEach((function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),c=n)}));var l=ni(n[c][0],n[c][1],n[c+1][0],n[c+1][1],u),h=l.x,p=l.y,f=ct(Q(),tt(h,p,0),e?this.getWorldTransform():this.getLocalTransform());return new _t(f[0],f[1])},n.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},n.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(Ms),Ss=function(e){function n(n){return void 0===n&&(n={}),e.call(this,s({type:t.Shape.RECT},n))||this}return i(n,e),n}(ps),Ps=function(e){function n(n){void 0===n&&(n={});var r=n.style,i=u(n,["style"]);return e.call(this,s({type:t.Shape.TEXT,style:s({fill:"black"},r)},i))||this}return i(n,e),n.prototype.getComputedTextLength=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},n.prototype.getLineBoundingRects=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},n.prototype.isOverflowing=function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing},n}(ps),ws=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,fs),this.define(t.Shape.ELLIPSE,ys),this.define(t.Shape.RECT,Ss),this.define(t.Shape.IMAGE,xs),this.define(t.Shape.LINE,Es),this.define(t.Shape.GROUP,ms),this.define(t.Shape.PATH,bs),this.define(t.Shape.POLYGON,Ms),this.define(t.Shape.POLYLINE,Ts),this.define(t.Shape.TEXT,Ps),this.define(t.Shape.HTML,gs)}return e.prototype.define=function(t,e){this.registry[t]=e},e.prototype.get=function(t){return this.registry[t]},e}(),Ns={number:function(t){return new ur(t)},percent:function(t){return new ur(t,"%")},px:function(t){return new ur(t,"px")},em:function(t){return new ur(t,"em")},rem:function(t){return new ur(t,"rem")},deg:function(t){return new ur(t,"deg")},grad:function(t){return new ur(t,"grad")},rad:function(t){return new ur(t,"rad")},turn:function(t){return new ur(t,"turn")},s:function(t){return new ur(t,"s")},ms:function(t){return new ur(t,"ms")},registerProperty:function(t){Qa.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Qa.layoutRegistry.registerLayout(t,e)}},Cs=function(e){function n(){var n=e.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new Qa.AnimationTimeline(n)}catch(t){}var r={};return zi.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=Vt(n)?n(t.Shape.GROUP):n)})),n.documentElement=new ms({id:"g-root",style:r}),n.documentElement.ownerDocument=n,n.documentElement.parentNode=n,n.childNodes=[n.documentElement],n}return i(n,e),Object.defineProperty(n.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),n.prototype.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Ps:ms);var r=new n(e);return r.ownerDocument=this,r},n.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},n.prototype.cloneNode=function(t){throw Error(Ut)},n.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},n.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},n.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},n.prototype.elementFromPoint=function(t,e){return c(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,h,p;return l(this,(function(l){switch(l.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,0>r||0>i||r>a||i>s?[2,null]:(u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,h=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:h},picked:[]})]);case 1:return[2,(p=l.sent().picked)&&p[0]||this.documentElement]}}))}))},n.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},n.prototype.elementsFromPoint=function(t,e){return c(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,h,p;return l(this,(function(l){switch(l.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,0>r||0>i||r>a||i>s?[2,[]]:(u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,h=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:h},picked:[]})]);case 1:return(p=l.sent().picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),[2,p]}}))}))},n.prototype.appendChild=function(t,e){throw Error(Bt)},n.prototype.insertBefore=function(t,e){throw Error(Bt)},n.prototype.removeChild=function(t,e){throw Error(Bt)},n.prototype.replaceChild=function(t,e,n){throw Error(Bt)},n.prototype.append=function(){throw Error(Bt)},n.prototype.prepend=function(){throw Error(Bt)},n.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},n.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},n.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.prototype.find=function(t){return this.documentElement.find(t)},n.prototype.findAll=function(t){return this.documentElement.findAll(t)},n}(ya),ks=function(){function e(t){this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,o=n.renderingContext,a=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===a.length?o.unculledEntities.indexOf(e.entity)>-1:a.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new pa(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e.tag="Culling",e}(),As=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new la(null),this.rootWheelEvent=new ha(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var s=t.normalizeToPointerEvent(e,a);try{for(var u=h(s),c=u.next();!c.done;c=u.next()){var l=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(l)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,s=t.normalizeToPointerEvent(e,a);try{for(var u=h(s),c=u.next();!c.done;c=u.next()){var l=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(l)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=h(o),s=a.next();!s.done;s=a.next()){var u=n.bootstrapEvent(n.rootPointerEvent,s.value,i,t);n.context.eventService.mapEvent(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(o,t)?"":"outside",s=n.normalizeToPointerEvent(t,i);try{for(var u=h(s),c=u.next();!c.done;c=u.next()){var l=n.bootstrapEvent(n.rootPointerEvent,c.value,i,t);l.type+=a,n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=h(o),s=a.next();!s.done;s=a.next()){var u=n.bootstrapEvent(n.rootPointerEvent,s.value,i,t);n.context.eventService.mapEvent(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,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.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=i.y;t.viewport.x=i.x,t.viewport.y=o;var a=this.context.eventService.viewport2Canvas(t.viewport),s=a.y;return t.canvas.x=a.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=bo[t.type]||t.type),t},t.prototype.normalizeWheelEvent=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 n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Mo.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];ee(i.button)&&(i.button=0),ee(i.buttons)&&(i.buttons=1),ee(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),ee(i.width)&&(i.width=i.radiusX||1),ee(i.height)&&(i.height=i.radiusY||1),ee(i.tiltX)&&(i.tiltX=0),ee(i.tiltY)&&(i.tiltY=0),ee(i.pointerType)&&(i.pointerType="touch"),ee(i.pointerId)&&(i.pointerId=i.identifier||0),ee(i.pressure)&&(i.pressure=i.force||.5),ee(i.twist)&&(i.twist=0),ee(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;ee(o.isPrimary)&&(o.isPrimary=!0),ee(o.width)&&(o.width=1),ee(o.height)&&(o.height=1),ee(o.tiltX)&&(o.tiltX=0),ee(o.tiltY)&&(o.tiltY=0),ee(o.pointerType)&&(o.pointerType="mouse"),ee(o.pointerId)&&(o.pointerId=1),ee(o.pressure)&&(o.pressure=.5),ee(o.twist)&&(o.twist=0),ee(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),Rs=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],Os=function(){function e(){}return e.prototype.isVisible=function(e,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(It.isEmpty(a))return!1;var s=e.getFrustum(),u=null===(i=null===(r=n.parentNode)||void 0===r?void 0:r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,u||t.Mask.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==t.Mask.OUTSIDE,o.visible},e.prototype.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=Rs.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,p=l.distance;if(0>st(h,n.getPositiveFarPoint(i[s]))+p)return t.Mask.OUTSIDE;0>st(h,n.getNegativeFarPoint(i[s]))+p&&(o|=c)}}return o},e}(),Ls=function(){function e(){this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return e.prototype.apply=function(n){var r,i=this,o=n.renderingService,a=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var s=function(t){t.target.renderable.dirty=!0,o.dirtify()},u=function(t){i.syncTasks.set(t.target,t.detail.affectChildren),o.dirtify()},c=function(t){Qa.enableSizeAttenuation&&Qa.styleValueRegistry.updateSizeAttenuation(t.target,a.getCamera().getZoom())},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&i.rBush.remove(n.aabb),i.syncTasks.delete(e),Qa.sceneGraphService.dirtifyToRoot(e),o.dirtify()};o.hooks.init.tap(e.tag,(function(){a.addEventListener(t.ElementEvent.MOUNTED,c),a.addEventListener(t.ElementEvent.UNMOUNTED,l),a.addEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.addEventListener(t.ElementEvent.BOUNDS_CHANGED,u)})),o.hooks.destroy.tap(e.tag,(function(){a.removeEventListener(t.ElementEvent.MOUNTED,c),a.removeEventListener(t.ElementEvent.UNMOUNTED,l),a.removeEventListener(t.ElementEvent.ATTR_MODIFIED,s),a.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,u),i.syncTasks.clear()}));var h=null!==(r=Qa.globalThis.requestIdleCallback)&&void 0!==r?r:Lo.bind(Qa.globalThis);o.hooks.endFrame.tap(e.tag,(function(){i.isFirstTimeRendering?(i.isFirstTimeRendering=!1,i.syncing=!0,h((function(){i.syncRTree(!0),i.isFirstTimeRenderingFinished=!0}))):i.syncRTree()}))},e.prototype.syncNode=function(t,e){if(void 0===e&&(e=!1),t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new It),i.dirtyRenderBounds.update(r.center,r.halfExtents));var o=p(r.getMin(),2),a=o[0],s=o[1],u=p(r.getMax(),2),c=u[0],l=u[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=a,n.aabb.minY=s,n.aabb.maxX=c,n.aabb.maxY=l}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}},e.prototype.syncRTree=function(t){var e=this;if(void 0===t&&(t=!1),t||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var o=e.syncNode(i,t);o&&(n.push(o),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}},e.tag="Prepare",e}();t.CanvasEvent=void 0,(ss=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",ss.BEFORE_RENDER="beforerender",ss.RERENDER="rerender",ss.AFTER_RENDER="afterrender",ss.BEFORE_DESTROY="beforedestroy",ss.AFTER_DESTROY="afterdestroy",ss.RESIZE="resize",ss.DIRTY_RECTANGLE="dirtyrectangle",ss.RENDERER_CHANGED="rendererchanged";var Is=new pa(t.ElementEvent.MOUNTED),Ds=new pa(t.ElementEvent.UNMOUNTED),Gs=new pa(t.CanvasEvent.BEFORE_RENDER),_s=new pa(t.CanvasEvent.RERENDER),Fs=new pa(t.CanvasEvent.AFTER_RENDER),Us=function(e){function r(t){var n=e.call(this)||this;n.Element=ps,n.inited=!1,n.context={},n.document=new Cs,n.document.defaultView=n,n.customElements=new ws;var r=t.container,i=t.canvas,o=t.offscreenCanvas,a=t.width,s=t.height,u=t.devicePixelRatio,c=t.renderer,l=t.background,h=t.cursor,p=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,y=t.createImage,v=t.supportsPointerEvents,m=t.supportsTouchEvents,g=t.supportsCSSTransform,x=t.cleanUpOnDestroy,E=void 0===x||x,b=t.useNativeClickEvent,M=t.alwaysTriggerPointerEventOnCanvas,T=t.isTouchEvent,S=t.isMouseEvent,P=t.dblClickSpeed;t.supportsMutipleCanvasesInOneContainer||yo(r,n,E);var w=a,N=s,C=u;return i&&(C=1>(C=u||vo&&window.devicePixelRatio||1)?1:Math.ceil(C),w=a||function(t){var e=Eo(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/C,N=s||function(t){var e=Eo(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/C),o&&(Qa.offscreenCanvas=o),n.devicePixelRatio=C,n.requestAnimationFrame=null!=f?f:Lo.bind(Qa.globalThis),n.cancelAnimationFrame=null!=d?d:Io.bind(Qa.globalThis),n.supportsTouchEvents=null!=m?m:"ontouchstart"in Qa.globalThis,n.supportsPointerEvents=null!=v?v:!!Qa.globalThis.PointerEvent,n.isTouchEvent=null!=T?T:function(t){return n.supportsTouchEvents&&t instanceof Qa.globalThis.TouchEvent},n.isMouseEvent=null!=S?S:function(t){return!Qa.globalThis.MouseEvent||t instanceof Qa.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Qa.globalThis.PointerEvent))},n.dblClickSpeed=null!=P?P:200,n.initRenderingContext({container:r,canvas:i,width:w,height:N,renderer:c,offscreenCanvas:o,devicePixelRatio:C,cursor:h||"default",background:l||"transparent",createImage:y,document:p,supportsCSSTransform:g,useNativeClickEvent:b,cleanUpOnDestroy:E,alwaysTriggerPointerEventOnCanvas:M}),n.initDefaultCamera(w,N,c.clipSpaceNearZ),n.initRenderer(c,!0),n}return i(r,e),r.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},r.prototype.initDefaultCamera=function(e,n,r){var i=this,o=new Qa.CameraContribution;o.clipSpaceNearZ=r,o.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3),o.canvas=this,o.eventEmitter.on(un.UPDATED,(function(){i.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED),Qa.enableSizeAttenuation&&i.getConfig().renderer.getConfig().enableSizeAttenuation&&i.updateSizeAttenuation()})),this.context.camera=o},r.prototype.updateSizeAttenuation=function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){Qa.styleValueRegistry.updateSizeAttenuation(e,t)}))},r.prototype.getConfig=function(){return this.context.config},r.prototype.getRoot=function(){return this.document.documentElement},r.prototype.getCamera=function(){return this.context.camera},r.prototype.getContextService=function(){return this.context.contextService},r.prototype.getEventService=function(){return this.context.eventService},r.prototype.getRenderingService=function(){return this.context.renderingService},r.prototype.getRenderingContext=function(){return this.context.renderingContext},r.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(r.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),r.prototype.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=this.getConfig().fastCleanExistingCanvas),n||this.dispatchEvent(new pa(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),n||this.dispatchEvent(new pa(t.CanvasEvent.AFTER_DESTROY));var i=function(t){t.currentTarget=null,t.manager=null,t.target=null};i(Is),i(Ds),i(Gs),i(_s),i(Fs),this.cancelAnimationFrame(this.frameId)},r.prototype.changeSize=function(t,e){this.resize(t,e)},r.prototype.resize=function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new pa(t.CanvasEvent.RESIZE,{width:e,height:n}))},r.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},r.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},r.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},r.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},r.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},r.prototype.render=function(t){var e=this;t&&(Gs.detail=t,Fs.detail=t),this.dispatchEvent(Gs),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(_s)})),this.dispatchEvent(Fs)},r.prototype.run=function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()},r.prototype.initRenderer=function(t,e){var r=this;if(void 0===e&&(e=!1),!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new n,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new As,new Ls,new ks([new Os])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(s(s({},Qa),this.context)),this.context.renderingService=new xa(Qa,this.context),this.context.eventService=new va(Qa,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){r.initRenderingService(t,e)}))},r.prototype.initRenderingService=function(e,n,r){var i=this;void 0===n&&(n=!1),void 0===r&&(r=!1),this.context.renderingService.init((function(){i.inited=!0,n?r?i.requestAnimationFrame((function(){i.dispatchEvent(new pa(t.CanvasEvent.READY))})):i.dispatchEvent(new pa(t.CanvasEvent.READY)):i.dispatchEvent(new pa(t.CanvasEvent.RENDERER_CHANGED)),i.readyPromise&&i.resolveReadyPromise(),n||i.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),i.mountChildren(i.getRoot()),e.getConfig().enableAutoRendering&&i.run()}))},r.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Qa)}))},r.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),f([],p(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(Qa)})),this.initRenderer(t)}},r.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},r.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Ds):(Ds.target=t,this.dispatchEvent(Ds,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},r.prototype.mountChildren=function(t,e){var n=this;void 0===e&&(e=To(t)),this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,e||(t.isMutationObserved?t.dispatchEvent(Is):(Is.target=t,this.dispatchEvent(Is,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){n.mountChildren(t,e)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},r.prototype.mountFragment=function(t){this.mountChildren(t,!1)},r.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},r.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},r.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},r.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},r.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},r.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},r}(da);t.AABB=It,t.AbstractRenderer=y,t.AbstractRendererPlugin=d,t.BUILT_IN_PROPERTIES=zi,t.CSS=Ns,t.CSSGradientValue=or,t.CSSKeywordValue=ar,t.CSSRGB=hr,t.CSSStyleValue=rr,t.CSSUnitValue=ur,t.Camera=ln,t.CameraEvent=un,t.Canvas=Us,t.Circle=fs,t.CircleUpdater=Qo,t.CustomElement=ds,t.CustomElementRegistry=ws,t.CustomEvent=pa,t.DefaultSceneGraphSelector=ba,t.DefaultSceneGraphService=za,t.DisplayObject=ps,t.Document=Cs,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=Ut,t.Element=os,t.Ellipse=ys,t.EllipseUpdater=Jo,t.EventService=va,t.EventTarget=da,t.FederatedEvent=ua,t.FederatedMouseEvent=ca,t.FederatedPointerEvent=la,t.FederatedWheelEvent=ha,t.Fragment=vs,t.Frustum=Gt,t.Group=ms,t.GroupUpdater=oa,t.HTML=gs,t.HTMLUpdater=aa,t.Image=xs,t.Line=Es,t.LineUpdater=ta,t.MutationEvent=Ma,t.Node=ya,t.OffscreenCanvasCreator=ma,t.Path=bs,t.PathUpdater=ea,t.Plane=Dt,t.Point=_t,t.Polygon=Ms,t.Polyline=Ts,t.PolylineUpdater=na,t.RBush=n,t.Rect=Ss,t.RectUpdater=ra,t.Rectangle=Ft,t.RenderingService=xa,t.Text=Ps,t.TextService=Ka,t.TextUpdater=ia,t.computeLinearGradient=function(t,e,n,r){var i=je(r.value),o=0+e/2,a=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+o-Math.cos(i)*s/2,y1:t[1]+a-Math.sin(i)*s/2,x2:t[0]+o+Math.cos(i)*s/2,y2:t[1]+a+Math.sin(i)*s/2}},t.computeRadialGradient=function(e,n,r,i,o,a){var s=i.value,u=o.value;i.unit===t.UnitType.kPercentage&&(s=i.value/100*n),o.unit===t.UnitType.kPercentage&&(u=o.value/100*r);var c=Math.max(Pe([0,0],[s,u]),Pe([0,r],[s,u]),Pe([n,r],[s,u]),Pe([n,0],[s,u]));return a&&(a instanceof ur?c=a.value:a instanceof ar&&("closest-side"===a.value?c=Math.min(s,n-s,u,r-u):"farthest-side"===a.value?c=Math.max(s,n-s,u,r-u):"closest-corner"===a.value&&(c=Math.min(Pe([0,0],[s,u]),Pe([0,r],[s,u]),Pe([n,r],[s,u]),Pe([n,0],[s,u]))))),{x:s+e[0],y:u+e[1],r:c}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle,o=i.x1,a=i.y1,s=i.x2,u=i.y2;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===o?0:o,void 0===a?0:a,void 0===s?0:s,void 0===u?0:u);break;case t.Shape.CIRCLE:var c=e.parsedStyle,l=c.r,h=void 0===l?0:l,d=c.cx,y=c.cy;r=bi(h,h,void 0===d?0:d,void 0===y?0:y);break;case t.Shape.ELLIPSE:var v=e.parsedStyle,m=v.rx,g=v.ry,x=v.cx,E=v.cy;r=bi(void 0===m?0:m,void 0===g?0:g,void 0===x?0:x,void 0===E?0:E);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var b=e.parsedStyle,M=b.width,T=void 0===M?0:M,S=b.height,P=void 0===S?0:S,w=b.x,N=void 0===w?0:w,C=b.y,k=void 0===C?0:C,A=b.radius,R=A&&A.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=p(i,4),a=o[0],s=o[1],u=o[2],c=o[3],l=t>0?1:-1,h=e>0?1:-1,f=l+h!==0?1:0;return[["M",l*a+n,r],["L",t-l*s+n,r],s?["A",s,s,0,0,f,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,f,t+n-l*u,e+r]:null,["L",n+l*c,e+r],c?["A",c,c,0,0,f,n,e+r-h*c]:null,["L",n,h*a+r],a?["A",a,a,0,0,f,l*a+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(T,P,N,k,R&&A.map((function(t){return Zt(t,0,Math.min(Math.abs(T)/2,Math.abs(P)/2))})));break;case t.Shape.PATH:r=f([],p(e.parsedStyle.d.absolutePath),!1)}if(r.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=tt(e[1],e[2],0);n&&ct(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var o=tt(e[1],e[2],0),a=tt(e[3],e[4],0),s=tt(e[5],e[6],0);n&&(ct(o,o,n),ct(a,a,n),ct(s,s,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(a[0],",").concat(a[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=tt(e[6],e[7],0);n&&ct(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else"Q"===e[0]&&(o=tt(e[1],e[2],0),a=tt(e[3],e[4],0),n&&(ct(o,o,n),ct(a,a,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(r,0,n)},t.createVec3=Be,t.decompose=Ze,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==p(t,2)[1]})))},t.deg2rad=je,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=xo,t.fromRotationTranslationScale=qe,t.getAngle=Fe,t.getEuler=We,t.getOrCalculatePathTotalLength=li,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.isBrowser=vo,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=kr,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=as,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(t,e,n){void 0===t&&(t="auto");var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Cr,t.mergeColors=Rr,t.parseColor=Ar,t.parseLength=Ir,t.parsePath=Si,t.parseTransform=Li,t.parsedTransformToMat4=qo,t.propertyMetadataCache=qi,t.rad2deg=Xe,t.resetEntityCounter=function(){es=0},t.runtime=Qa,t.setDOMSize=function(t,e,n){vo&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i){void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=0);var o=t.map((function(o,a){var s=t[a+1],u=0===a&&(0!==e||0!==n),c=(a===t.length-1||s&&("M"===s[0]||"Z"===s[0]))&&0!==r&&0!==i;switch(o[0]){case"M":return u?"M ".concat(o[1]+e,",").concat(o[2]+n," L ").concat(o[1],",").concat(o[2]):"M ".concat(o[1],",").concat(o[2]);case"L":return"L ".concat(o[1]+(c?r:0),",").concat(o[2]+(c?i:0));case"Q":return"Q ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4])+(c?" L ".concat(o[3]+r,",").concat(o[4]+i):"");case"C":return"C ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4],",").concat(o[5]," ").concat(o[6])+(c?" L ".concat(o[5]+r,",").concat(o[6]+i):"");case"A":return"A ".concat(o[1]," ").concat(o[2]," ").concat(o[3]," ").concat(o[4]," ").concat(o[5]," ").concat(o[6]," ").concat(o[7])+(c?" L ".concat(o[6]+r,",").concat(o[7]+i):"");case"Z":return"Z"}})).join(" ");return~o.indexOf("NaN")?"":o},t.turn2deg=He}));
1
+ /*!
2
+ * @antv/g-lite
3
+ * @description A core module for rendering engine implements DOM API.
4
+ * @version 2.1.1
5
+ * @date 10/23/2024, 7:12:42 AM
6
+ * @author AntVis
7
+ * @docs https://g.antv.antgroup.com/
8
+ */
9
+ !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).G={})}(this,(function(t){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={exports:{}};!function(t,e){t.exports=function(){function t(t,r,i,a,s){e(t,r,i||0,a||t.length-1,s||n)}function e(t,n,i,a,s){for(;a>i;){if(a-i>600){var o=a-i+1,l=n-i+1,h=Math.log(o),c=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*c*(o-c)/o)*(0>l-o/2?-1:1);e(t,n,Math.max(i,Math.floor(n-l*c/o+u)),Math.min(a,Math.floor(n+(o-l)*c/o+u)),s)}var d=t[n],p=i,v=a;for(r(t,i,n),s(t[a],d)>0&&r(t,i,a);v>p;){for(r(t,p,v),p++,v--;0>s(t[p],d);)p++;for(;s(t[v],d)>0;)v--}0===s(t[i],d)?r(t,i,v):r(t,++v,a),v>n||(i=v+1),n>v||(a=v-1)}}function r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function n(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,r){if(!r)return e.indexOf(t);for(var n=0;e.length>n;n++)if(r(t,e[n]))return n;return-1}function s(t,e){o(t,0,t.children.length,e,t)}function o(t,e,r,n,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;r>a;a++){var s=t.children[a];l(i,t.leaf?n(s):s)}return i}function l(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function h(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function u(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function v(t,e){var r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,a-n)}function f(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function g(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,r,n,i,a){for(var s=[r,n];s.length;)if((n=s.pop())-(r=s.pop())>i){var o=r+Math.ceil((n-r)/i/2)*i;t(e,o,r,n,a),s.push(r,o,o,n)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,r=[];if(!g(t,e))return r;for(var n=this.toBBox,i=[];e;){for(var a=0;e.children.length>a;a++){var s=e.children[a],o=e.leaf?n(s):s;g(t,o)&&(e.leaf?r.push(s):f(t,o)?this._all(s,r):i.push(s))}e=i.pop()}return r},i.prototype.collides=function(t){var e=this.data;if(!g(t,e))return!1;for(var r=[];e;){for(var n=0;e.children.length>n;n++){var i=e.children[n],a=e.leaf?this.toBBox(i):i;if(g(t,a)){if(e.leaf||f(t,a))return!0;r.push(i)}}e=r.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(r.height>this.data.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var r,n,i,s=this.data,o=this.toBBox(t),l=[],h=[];s||l.length;){if(s||(s=l.pop(),n=l[l.length-1],r=h.pop(),i=!0),s.leaf){var c=a(t,s.children,e);if(-1!==c)return s.children.splice(c,1),l.push(s),this._condense(l),this}i||s.leaf||!f(s,o)?n?(r++,s=n.children[r],i=!1):s=null:(l.push(s),h.push(r),r=0,n=s,s=s.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var r=[];t;)t.leaf?e.push.apply(e,t.children):r.push.apply(r,t.children),t=r.pop();return e},i.prototype._build=function(t,e,r,n){var i,a=r-e+1,o=this._maxEntries;if(o>=a)return s(i=m(t.slice(e,r+1)),this.toBBox),i;n||(o=Math.ceil(a/Math.pow(o,(n=Math.ceil(Math.log(a)/Math.log(o)))-1))),(i=m([])).leaf=!1,i.height=n;var l=Math.ceil(a/o),h=l*Math.ceil(Math.sqrt(o));y(t,e,r,h,this.compareMinX);for(var c=e;r>=c;c+=h){var u=Math.min(c+h-1,r);y(t,c,u,l,this.compareMinY);for(var d=c;u>=d;d+=l)i.children.push(this._build(t,d,Math.min(d+l-1,u),n-1))}return s(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,r,n){for(;n.push(e),!e.leaf&&n.length-1!==r;){for(var i=1/0,a=1/0,s=void 0,o=0;e.children.length>o;o++){var l=e.children[o],h=u(l),c=p(t,l)-h;a>c?(a=c,i=i>h?h:i,s=l):c===a&&i>h&&(i=h,s=l)}e=s||e.children[0]}return e},i.prototype._insert=function(t,e,r){var n=r?t:this.toBBox(t),i=[],a=this._chooseSubtree(n,this.data,e,i);for(a.children.push(t),l(a,n);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)},i.prototype._split=function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var a=this._chooseSplitIndex(r,i,n),o=m(r.children.splice(a,r.children.length-a));o.height=r.height,o.leaf=r.leaf,s(r,this.toBBox),s(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(r,o)},i.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,r){for(var n,i=1/0,a=1/0,s=e;r-e>=s;s++){var l=o(t,0,s,this.toBBox),h=o(t,s,r,this.toBBox),c=v(l,h),d=u(l)+u(h);i>c?(i=c,n=s,a=a>d?d:a):c===i&&a>d&&(a=d,n=s)}return n||r-e},i.prototype._chooseSplitAxis=function(t,e,r){var n=t.leaf?this.compareMinX:h,i=t.leaf?this.compareMinY:c,a=this._allDistMargin(t,e,r,n);this._allDistMargin(t,e,r,i)>a&&t.children.sort(n)},i.prototype._allDistMargin=function(t,e,r,n){t.children.sort(n);for(var i=this.toBBox,a=o(t,0,e,i),s=o(t,r-e,r,i),h=d(a)+d(s),c=e;r-e>c;c++){var u=t.children[c];l(a,t.leaf?i(u):u),h+=d(a)}for(var p=r-e-1;p>=e;p--){var v=t.children[p];l(s,t.leaf?i(v):v),h+=d(s)}return h},i.prototype._adjustParentBBoxes=function(t,e,r){for(var n=r;n>=0;n--)l(e[n],t)},i.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():s(t[e],this.toBBox)},i}()}(e);var r=e.exports;function n(t){return n="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},n(t)}function i(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:e+""}function a(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),h=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({});function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);e>r;r++)n[r]=t[r];return n}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,s,o=[],l=!0,h=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){h=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(h)throw i}}return o}}(t,e)||u(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.")}()}var p={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,n,a,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new i(n,a||t,s),l=r?r+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),o.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},o.prototype.listeners=function(t){var e=this._events[r?r+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,i=e.length,a=Array(i);i>n;n++)a[n]=e[n].fn;return a},o.prototype.listenerCount=function(t){var e=this._events[r?r+t:t];return e?e.fn?1:e.length:0},o.prototype.emit=function(t,e,n,i,a,s){var o=r?r+t:t;if(!this._events[o])return!1;var l,h,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,i),!0;case 5:return c.fn.call(c.context,e,n,i,a),!0;case 6:return c.fn.call(c.context,e,n,i,a,s),!0}for(h=1,l=Array(u-1);u>h;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,p=c.length;for(h=0;p>h;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,n);break;case 4:c[h].fn.call(c[h].context,e,n,i);break;default:if(!l)for(d=1,l=Array(u-1);u>d;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},o.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},o.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},o.prototype.removeListener=function(t,e,n,i){var a=r?r+t:t;if(!this._events[a])return this;if(!e)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn!==e||i&&!o.once||n&&o.context!==n||s(this,a);else{for(var l=0,h=[],c=o.length;c>l;l++)(o[l].fn!==e||i&&!o[l].once||n&&o[l].context!==n)&&h.push(o[l]);h.length?this._events[a]=1===h.length?h[0]:h:s(this,a)}return this},o.prototype.removeAllListeners=function(t){var e;return t?this._events[e=r?r+t:t]&&s(this,e):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o}(p);var v=p.exports,f=1e-6,g="undefined"!=typeof Float32Array?Float32Array:Array;function m(){var t=new g(9);return g!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function y(){var t=new g(16);return g!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function x(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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}function E(t,e,r,n,i,a,s,o,l,h,c,u,d,p,v,f,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=s,t[6]=o,t[7]=l,t[8]=h,t[9]=c,t[10]=u,t[11]=d,t[12]=p,t[13]=v,t[14]=f,t[15]=g,t}function b(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 w(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],h=e[7],c=e[8],u=e[9],d=e[10],p=e[11],v=e[12],f=e[13],g=e[14],m=e[15],y=r*o-n*s,x=r*l-i*s,E=r*h-a*s,b=n*l-i*o,w=n*h-a*o,M=i*h-a*l,T=c*f-u*v,N=c*g-d*v,P=c*m-p*v,S=u*g-d*f,C=u*m-p*f,k=d*m-p*g,A=y*k-x*C+E*S+b*P-w*N+M*T;return A?(t[0]=(o*k-l*C+h*S)*(A=1/A),t[1]=(i*C-n*k-a*S)*A,t[2]=(f*M-g*w+m*b)*A,t[3]=(d*w-u*M-p*b)*A,t[4]=(l*P-s*k-h*N)*A,t[5]=(r*k-i*P+a*N)*A,t[6]=(g*E-v*M-m*x)*A,t[7]=(c*M-d*E+p*x)*A,t[8]=(s*C-o*P+h*T)*A,t[9]=(n*P-r*C-a*T)*A,t[10]=(v*w-f*E+m*y)*A,t[11]=(u*E-c*w-p*y)*A,t[12]=(o*N-s*S-l*T)*A,t[13]=(r*S-n*N+i*T)*A,t[14]=(f*x-v*b-g*y)*A,t[15]=(c*b-u*x+d*y)*A,t):null}function M(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],v=e[11],f=e[12],g=e[13],m=e[14],y=e[15],x=r[0],E=r[1],b=r[2],w=r[3];return t[0]=x*n+E*o+b*u+w*f,t[1]=x*i+E*l+b*d+w*g,t[2]=x*a+E*h+b*p+w*m,t[3]=x*s+E*c+b*v+w*y,t[4]=(x=r[4])*n+(E=r[5])*o+(b=r[6])*u+(w=r[7])*f,t[5]=x*i+E*l+b*d+w*g,t[6]=x*a+E*h+b*p+w*m,t[7]=x*s+E*c+b*v+w*y,t[8]=(x=r[8])*n+(E=r[9])*o+(b=r[10])*u+(w=r[11])*f,t[9]=x*i+E*l+b*d+w*g,t[10]=x*a+E*h+b*p+w*m,t[11]=x*s+E*c+b*v+w*y,t[12]=(x=r[12])*n+(E=r[13])*o+(b=r[14])*u+(w=r[15])*f,t[13]=x*i+E*l+b*d+w*g,t[14]=x*a+E*h+b*p+w*m,t[15]=x*s+E*c+b*v+w*y,t}function T(t,e,r){var n,i,a,s,o,l,h,c,u,d,p,v,f=r[0],g=r[1],m=r[2];return e===t?(t[12]=e[0]*f+e[4]*g+e[8]*m+e[12],t[13]=e[1]*f+e[5]*g+e[9]*m+e[13],t[14]=e[2]*f+e[6]*g+e[10]*m+e[14],t[15]=e[3]*f+e[7]*g+e[11]*m+e[15]):(i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],v=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t[6]=h,t[7]=c,t[8]=u,t[9]=d,t[10]=p,t[11]=v,t[12]=n*f+o*g+u*m+e[12],t[13]=i*f+l*g+d*m+e[13],t[14]=a*f+h*g+p*m+e[14],t[15]=s*f+c*g+v*m+e[15]),t}function N(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function P(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function S(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,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 C(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function k(t,e){var r=e[4],n=e[5],i=e[6],a=e[8],s=e[9],o=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(r,n,i),t[2]=Math.hypot(a,s,o),t}function A(t,e){var r=new g(3);k(r,e);var n=1/r[0],i=1/r[1],a=1/r[2],s=e[0]*n,o=e[1]*i,l=e[2]*a,h=e[4]*n,c=e[5]*i,u=e[6]*a,d=e[8]*n,p=e[9]*i,v=e[10]*a,f=s+c+v,m=0;return f>0?(t[3]=.25*(m=2*Math.sqrt(f+1)),t[0]=(u-p)/m,t[1]=(d-l)/m,t[2]=(o-h)/m):s>c&&s>v?(t[3]=(u-p)/(m=2*Math.sqrt(1+s-c-v)),t[0]=.25*m,t[1]=(o+h)/m,t[2]=(d+l)/m):c>v?(t[3]=(d-l)/(m=2*Math.sqrt(1+c-s-v)),t[0]=(o+h)/m,t[1]=.25*m,t[2]=(u+p)/m):(t[3]=(o-h)/(m=2*Math.sqrt(1+v-s-c)),t[0]=(d+l)/m,t[1]=(u+p)/m,t[2]=.25*m),t}function R(t,e,r,n,i){var a=e[0],s=e[1],o=e[2],l=e[3],h=a+a,c=s+s,u=o+o,d=a*h,p=a*c,v=a*u,f=s*c,g=s*u,m=o*u,y=l*h,x=l*c,E=l*u,b=n[0],w=n[1],M=n[2],T=i[0],N=i[1],P=i[2],S=(1-(f+m))*b,C=(p+E)*b,k=(v-x)*b,A=(p-E)*w,R=(1-(d+m))*w,O=(g+y)*w,L=(v+x)*M,I=(g-y)*M,D=(1-(d+f))*M;return t[0]=S,t[1]=C,t[2]=k,t[3]=0,t[4]=A,t[5]=R,t[6]=O,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=r[0]+T-(S*T+A*N+L*P),t[13]=r[1]+N-(C*T+R*N+I*P),t[14]=r[2]+P-(k*T+O*N+D*P),t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var O=function(t,e,r,n,i,a,s){var o=1/(e-r),l=1/(n-i),h=1/(a-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*o,t[13]=(i+n)*l,t[14]=(s+a)*h,t[15]=1,t};var L=M;function I(){var t=new g(3);return g!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function D(t){return Math.hypot(t[0],t[1],t[2])}function G(t,e,r){var n=new g(3);return n[0]=t,n[1]=e,n[2]=r,n}function _(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function F(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function B(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function U(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function Y(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function X(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function H(t,e,r){var n=e[0],i=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=i*l-a*o,t[1]=a*s-n*l,t[2]=n*o-i*s,t}function j(t,e,r){var n=e[0],i=e[1],a=e[2],s=r[3]*n+r[7]*i+r[11]*a+r[15];return t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/(s=s||1),t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/s,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/s,t}function z(t,e){var r=t[0],n=t[1],i=t[2],a=e[0],s=e[1],o=e[2];return f*Math.max(1,Math.abs(r),Math.abs(a))>=Math.abs(r-a)&&f*Math.max(1,Math.abs(n),Math.abs(s))>=Math.abs(n-s)&&f*Math.max(1,Math.abs(i),Math.abs(o))>=Math.abs(i-o)}var W=V,q=D;function Z(){var t=new g(4);return g!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function $(t,e,r,n){var i=new g(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function K(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*s,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*s,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*s,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*s,t}function Q(){var t=new g(4);return g!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function J(t,e,r){var n=Math.sin(r*=.5);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function tt(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=r[0],l=r[1],h=r[2],c=r[3];return t[0]=n*c+s*o+i*h-a*l,t[1]=i*c+s*l+a*o-n*h,t[2]=a*c+s*h+n*l-i*o,t[3]=s*c-n*o-i*l-a*h,t}function et(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],s=r*r+n*n+i*i+a*a,o=s?1/s:0;return t[0]=-r*o,t[1]=-n*o,t[2]=-i*o,t[3]=a*o,t}function rt(t,e,r,n){var i=.5*Math.PI/180;r*=i,n*=i;var a=Math.sin(e*=i),s=Math.cos(e),o=Math.sin(r),l=Math.cos(r),h=Math.sin(n),c=Math.cos(n);return t[0]=a*l*c-s*o*h,t[1]=s*o*c+a*l*h,t[2]=s*l*h-a*o*c,t[3]=s*l*c+a*o*h,t}I(),function(){var t=Z()}();var nt=$,it=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},at=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},st=tt,ot=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],s=r*r+n*n+i*i+a*a;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=a*s,t};function lt(){var t=new g(2);return g!=Float32Array&&(t[0]=0,t[1]=0),t}I(),G(1,0,0),G(0,1,0),Q(),Q(),m(),function(){var t=lt()}();var ht=B,ct=_,ut=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},dt=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},pt=U,vt=W;class ft{constructor(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}static isEmpty(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}update(t,e){ct(this.center,t),ct(this.halfExtents,e),vt(this.min,this.center,this.halfExtents),ht(this.max,this.center,this.halfExtents)}setMinMax(t,e){ht(this.center,e,t),pt(this.center,this.center,.5),vt(this.halfExtents,e,t),pt(this.halfExtents,this.halfExtents,.5),ct(this.min,t),ct(this.max,e)}getMin(){return this.min}getMax(){return this.max}add(t){if(!ft.isEmpty(t))if(ft.isEmpty(this))this.setMinMax(t.getMin(),t.getMax());else{var e=this.center,r=e[0],n=e[1],i=e[2],a=this.halfExtents,s=a[0],o=a[1],l=a[2],h=r-s,c=r+s,u=n-o,d=n+o,p=i-l,v=i+l,f=t.center,g=f[0],m=f[1],y=f[2],x=t.halfExtents,E=x[0],b=x[1],w=x[2],M=g-E,T=g+E,N=m-b,P=m+b,S=y-w,C=y+w;h>M&&(h=M),T>c&&(c=T),u>N&&(u=N),P>d&&(d=P),p>S&&(p=S),C>v&&(v=C),e[0]=.5*(h+c),e[1]=.5*(u+d),e[2]=.5*(p+v),a[0]=.5*(c-h),a[1]=.5*(d-u),a[2]=.5*(v-p),this.min[0]=h,this.min[1]=u,this.min[2]=p,this.max[0]=c,this.max[1]=d,this.max[2]=v}}setFromTransformedAABB(t,e){var r=this.center,n=this.halfExtents,i=t.center,a=t.halfExtents,s=e[0],o=e[4],l=e[8],h=e[1],c=e[5],u=e[9],d=e[2],p=e[6],v=e[10],f=Math.abs(s),g=Math.abs(o),m=Math.abs(l),y=Math.abs(h),x=Math.abs(c),E=Math.abs(u),b=Math.abs(d),w=Math.abs(p),M=Math.abs(v);r[0]=e[12]+s*i[0]+o*i[1]+l*i[2],r[1]=e[13]+h*i[0]+c*i[1]+u*i[2],r[2]=e[14]+d*i[0]+p*i[1]+v*i[2],n[0]=f*a[0]+g*a[1]+m*a[2],n[1]=y*a[0]+x*a[1]+E*a[2],n[2]=b*a[0]+w*a[1]+M*a[2],vt(this.min,r,n),ht(this.max,r,n)}intersects(t){var e=this.getMax(),r=this.getMin(),n=t.getMax(),i=t.getMin();return!(r[0]>n[0]||i[0]>e[0]||r[1]>n[1]||i[1]>e[1]||r[2]>n[2]||i[2]>e[2])}intersection(t){if(!this.intersects(t))return null;var e=new ft,r=ut([0,0,0],this.getMin(),t.getMin()),n=dt([0,0,0],this.getMax(),t.getMax());return e.setMinMax(r,n),e}getNegativeFarPoint(t){return 273===t.pnVertexFlag?ct([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}getPositiveFarPoint(t){return 273===t.pnVertexFlag?ct([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}class gt{constructor(t,e){this.distance=t||0,this.normal=e||G(0,1,0),this.updatePNVertexFlag()}updatePNVertexFlag(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}distanceToPoint(t){return X(t,this.normal)-this.distance}normalize(){var t=1/q(this.normal);U(this.normal,this.normal,t),this.distance*=t}intersectsLine(t,e,r){var n=this.distanceToPoint(t),i=n/(n-this.distanceToPoint(e)),a=i>=0&&1>=i;return a&&r&&function(t,e,r,n){var i=e[0],a=e[1],s=e[2];t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=s+n*(r[2]-s)}(r,t,e,i),a}}var mt=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({});class yt{constructor(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new gt)}extractFromVPMatrix(t){var e=d(t,16),r=e[0],n=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],h=e[7],c=e[8],u=e[9],p=e[10],v=e[11],f=e[12],g=e[13],m=e[14],y=e[15];F(this.planes[0].normal,a-r,h-s,v-c),this.planes[0].distance=y-f,F(this.planes[1].normal,a+r,h+s,v+c),this.planes[1].distance=y+f,F(this.planes[2].normal,a+n,h+o,v+u),this.planes[2].distance=y+g,F(this.planes[3].normal,a-n,h-o,v-u),this.planes[3].distance=y-g,F(this.planes[4].normal,a-i,h-l,v-p),this.planes[4].distance=y-m,F(this.planes[5].normal,a+i,h+l,v+p),this.planes[5].distance=y+m,this.planes.forEach((t=>{t.normalize(),t.updatePNVertexFlag()}))}}class xt{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new xt(this.x,this.y)}copyFrom(t){this.x=t.x,this.y=t.y}}class Et{static fromRect(t){return new Et(t.x,t.y,t.width,t.height)}static applyTransform(t,e){var r=$(t.x,t.y,0,1),n=$(t.x+t.width,t.y,0,1),i=$(t.x,t.y+t.height,0,1),a=$(t.x+t.width,t.y+t.height,0,1),s=Z(),o=Z(),l=Z(),h=Z();K(s,r,e),K(o,n,e),K(l,i,e),K(h,a,e);var c=Math.min(s[0],o[0],l[0],h[0]),u=Math.min(s[1],o[1],l[1],h[1]);return Et.fromRect({x:c,y:u,width:Math.max(s[0],o[0],l[0],h[0])-c,height:Math.max(s[1],o[1],l[1],h[1])-u})}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n,this.left=t,this.right=t+r,this.top=e,this.bottom=e+n}toJSON(){}}var bt="Method not implemented.",wt="Use document.documentElement instead.",Mt=function(t){return"function"==typeof t},Tt=function(t){return null==t},Nt={}.toString,Pt=function(t,e){return Nt.call(t)==="[object "+e+"]"},St=function(t){return Array.isArray?Array.isArray(t):Pt(t,"Array")},Ct=function(t){if(St(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},kt=function(t){if(St(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},At=function(t){return Pt(t,"String")},Rt=function(t,e,r){return e>t?e:t>r?r:t},Ot=function(t){return Pt(t,"Number")},Lt=1e-5;function It(t,e,r){return void 0===r&&(r=Lt),r>Math.abs(t-e)}var Dt=function(t,e){return(t%e+e)%e},Gt=function(t){return Pt(t,"Boolean")},_t=function(t){return void 0===t},Ft=function(){return Ft=Object.assign||function(t){for(var e,r=1,n=arguments.length;n>r;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ft.apply(this,arguments)};function Bt(t,e,r){if(r||2===arguments.length)for(var n,i=0,a=e.length;a>i;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var Vt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Ut(t,e,r){if(t[r].length>7){t[r].shift();for(var n=t[r],i=r;n.length;)e[r]="A",t.splice(i+=1,0,["C"].concat(n.splice(0,6)));t.splice(r,1)}}var Yt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Xt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Yt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Ht(t){return Xt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function jt(t){return Ht(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function zt(t){for(var e=t.pathValue[t.segmentStart],r=e.toLowerCase(),n=t.data;n.length>=Yt[r]&&("m"===r&&n.length>2?(t.segments.push([e].concat(n.splice(0,2))),r="l",e="m"===e?"l":"L"):t.segments.push([e].concat(n.splice(0,Yt[r]))),Yt[r]););}function Wt(t){var e=t.index,r=t.pathValue,n=r.charCodeAt(e);return 48===n?(t.param=0,void(t.index+=1)):49===n?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+r[e]+'", expecting 0 or 1 at index '+e)}function qt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Zt(t){return t>=48&&57>=t}function $t(t){var e,r=t.max,n=t.pathValue,i=t.index,a=i,s=!1,o=!1,l=!1,h=!1;if(r>a)if(43!==(e=n.charCodeAt(a))&&45!==e||(e=n.charCodeAt(a+=1)),Zt(e)||46===e){if(46!==e){if(s=48===e,e=n.charCodeAt(a+=1),s&&r>a&&e&&Zt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" illegal number');for(;r>a&&Zt(n.charCodeAt(a));)a+=1,o=!0;e=n.charCodeAt(a)}if(46===e){for(h=!0,a+=1;Zt(n.charCodeAt(a));)a+=1,l=!0;e=n.charCodeAt(a)}if(101===e||69===e){if(h&&!o&&!l)return void(t.err="[path-util]: Invalid path value at index "+a+', "'+n[a]+'" invalid float exponent');if(43!==(e=n.charCodeAt(a+=1))&&45!==e||(a+=1),a>=r||!Zt(n.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index "+a+', "'+n[a]+'" invalid integer exponent');for(;r>a&&Zt(n.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index "+a+', "'+n[a]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+a+', "pathValue" is missing param'}function Kt(t){for(var e,r=t.pathValue,n=t.max;n>t.index&&(10===(e=r.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Qt(t){var e=t.max,r=t.pathValue,n=t.index,i=r.charCodeAt(n),a=Yt[r[n].toLowerCase()];if(t.segmentStart=n,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Kt(t),t.data=[],a){for(;;){for(var s=a;s>0;s-=1){if(97!=(32|i)||3!==s&&4!==s?$t(t):Wt(t),t.err.length)return;t.data.push(t.param),Kt(t),e>t.index&&44===r.charCodeAt(t.index)&&(t.index+=1,Kt(t))}if(t.index>=t.max)break;if(!qt(r.charCodeAt(t.index)))break}zt(t)}else zt(t);else t.err='[path-util]: Invalid path value "'+r[n]+'" is not a path command'}var Jt=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function te(t){if(Ht(t))return[].concat(t);var e=function(t){if(Xt(t))return[].concat(t);var e=new Jt(t);for(Kt(e);e.max>e.index&&!e.err.length;)Qt(e);return e.err?e.err:e.segments}(t),r=0,n=0,i=0,a=0;return e.map((function(t){var e,s=t.slice(1).map(Number),o=t[0],l=o.toUpperCase();if("M"===o)return i=r=s[0],a=n=s[1],["M",r,n];if(o!==l)switch(l){case"A":e=[l,s[0],s[1],s[2],s[3],s[4],s[5]+r,s[6]+n];break;case"V":e=[l,s[0]+n];break;case"H":e=[l,s[0]+r];break;default:var h=s.map((function(t,e){return t+(e%2?n:r)}));e=[l].concat(h)}else e=[l].concat(s);var c=e.length;switch(l){case"Z":r=i,n=a;break;case"H":r=e[1];break;case"V":n=e[1];break;default:r=e[c-2],n=e[c-1],"M"===l&&(i=r,a=n)}return e}))}function ee(t,e){var r=t[0],n=e.x1,i=e.y1,a=e.x2,s=e.y2,o=t.slice(1).map(Number),l=t;if("TQ".includes(r)||(e.qx=null,e.qy=null),"H"===r)l=["L",t[1],i];else if("V"===r)l=["L",n,t[1]];else if("S"===r){var h=2*n-a,c=2*i-s;e.x1=h,e.y1=c,l=["C",h,c].concat(o)}else if("T"===r){var u=2*n-e.qx,d=2*i-e.qy;e.qx=u,e.qy=d,l=["Q",u,d].concat(o)}else if("Q"===r){var p=o[1];e.qx=o[0],e.qy=p}return l}function re(t){if(jt(t))return[].concat(t);for(var e=te(t),r=Ft({},Vt),n=0;e.length>n;n+=1){e[n]=ee(e[n],r);var i=e[n],a=i.length;r.x1=+i[a-2],r.y1=+i[a-1],r.x2=+i[a-4]||r.x1,r.y2=+i[a-3]||r.y1}return e}function ne(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function ie(t,e,r,n,i,a,s,o,l,h){var c,u,d,p,v,f=t,g=e,m=r,y=n,x=o,E=l,b=120*Math.PI/180,w=Math.PI/180*(+i||0),M=[];if(h)u=h[0],d=h[1],p=h[2],v=h[3];else{g=(c=ne(f,g,-w)).y;var T=((f=c.x)-(x=(c=ne(x,E,-w)).x))/2,N=(g-(E=c.y))/2,P=T*T/(m*m)+N*N/(y*y);P>1&&(m*=P=Math.sqrt(P),y*=P);var S=m*m,C=y*y,k=(a===s?-1:1)*Math.sqrt(Math.abs((S*C-S*N*N-C*T*T)/(S*N*N+C*T*T)));p=k*m*N/y+(f+x)/2,u=Math.asin(((g-(v=k*-y*T/m+(g+E)/2))/y*1e9>>0)/1e9),d=Math.asin(((E-v)/y*1e9>>0)/1e9),0>(u=p>f?Math.PI-u:u)&&(u=2*Math.PI+u),0>(d=p>x?Math.PI-d:d)&&(d=2*Math.PI+d),s&&u>d&&(u-=2*Math.PI),!s&&d>u&&(d-=2*Math.PI)}var A=d-u;if(Math.abs(A)>b){var R=d,O=x,L=E;M=ie(x=p+m*Math.cos(d=u+b*(s&&d>u?1:-1)),E=v+y*Math.sin(d),m,y,i,0,s,O,L,[d,R,p,v])}A=d-u;var I=Math.cos(u),D=Math.sin(u),G=Math.cos(d),_=Math.sin(d),F=Math.tan(A/4),B=4/3*m*F,V=4/3*y*F,U=[f,g],Y=[f+B*D,g-V*I],X=[x+B*_,E-V*G],H=[x,E];if(Y[0]=2*U[0]-Y[0],Y[1]=2*U[1]-Y[1],h)return Y.concat(X,H,M);for(var j=[],z=0,W=(M=Y.concat(X,H,M)).length;W>z;z+=1)j[z]=z%2?ne(M[z-1],M[z],w).y:ne(M[z],M[z+1],w).x;return j}function ae(t,e,r){var n=t[0],i=t[1];return[n+(e[0]-n)*r,i+(e[1]-i)*r]}var se=function(t,e,r,n){return Bt(Bt([],ae([t,e],[r,n],.5),!0),[r,n,r,n],!1)};function oe(t,e){var r,n,i,a,s,o,l,h=t[0],c=t.slice(1).map(Number),u=c[0],d=c[1],p=e.x1,v=e.y1,f=e.x,g=e.y;switch("TQ".includes(h)||(e.qx=null,e.qy=null),h){case"M":return e.x=u,e.y=d,t;case"A":return r=[p,v].concat(c),["C"].concat(ie(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9]));case"Q":return e.qx=u,e.qy=d,r=[p,v].concat(c),["C"].concat([(o=1/3)*r[0]+(l=2/3)*(n=r[2]),o*r[1]+l*(i=r[3]),o*(a=r[4])+l*n,o*(s=r[5])+l*i,a,s]);case"L":return["C"].concat(se(p,v,u,d));case"Z":return p===f&&v===g?["C",p,v,f,g,f,g]:["C"].concat(se(p,v,f,g))}return t}function le(t,e){if(void 0===e&&(e=!1),function(t){return jt(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var r=[].concat(t);return e?[r,[]]:r}for(var n,i,a=re(t),s=Ft({},Vt),o=[],l="",h=a.length,c=[],u=0;h>u;u+=1){a[u]&&(l=a[u][0]),o[u]=l;var d=oe(a[u],s);a[u]=d,Ut(a,o,u),h=a.length,"Z"===l&&c.push(u),s.x1=+(n=a[u])[(i=n.length)-2],s.y1=+n[i-1],s.x2=+n[i-4]||s.x1,s.y2=+n[i-3]||s.y1}return e?[a,c]:a}function he(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ce(t,e,r,n,i){var a=he([t,e],[r,n]),s={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var o=ae([t,e],[r,n],i/a);s={x:o[0],y:o[1]}}else s={x:r,y:n};else s={x:t,y:e};return{length:a,point:s,min:{x:Math.min(t,r),y:Math.min(e,n)},max:{x:Math.max(t,r),y:Math.max(e,n)}}}function ue(t,e){var r=t.x,n=t.y,i=e.x,a=e.y;return(0>r*a-n*i?-1:1)*Math.acos((r*i+n*a)/Math.sqrt((Math.pow(r,2)+Math.pow(n,2))*(Math.pow(i,2)+Math.pow(a,2))))}function de(t,e,r,n,i,a,s,o,l,h){var c=Math.abs,u=Math.sin,d=Math.cos,p=Math.sqrt,v=Math.PI,f=c(r),g=c(n),m=(i%360+360)%360*(v/180);if(t===o&&e===l)return{x:t,y:e};if(0===f||0===g)return ce(t,e,o,l,h).point;var y=(t-o)/2,x=(e-l)/2,E={x:d(m)*y+u(m)*x,y:-u(m)*y+d(m)*x},b=Math.pow(E.x,2)/Math.pow(f,2)+Math.pow(E.y,2)/Math.pow(g,2);b>1&&(f*=p(b),g*=p(b));var w=(Math.pow(f,2)*Math.pow(g,2)-Math.pow(f,2)*Math.pow(E.y,2)-Math.pow(g,2)*Math.pow(E.x,2))/(Math.pow(f,2)*Math.pow(E.y,2)+Math.pow(g,2)*Math.pow(E.x,2)),M=(a!==s?1:-1)*p(w=0>w?0:w),T=M*(f*E.y/g),N=M*(-g*E.x/f),P=d(m)*T-u(m)*N+(t+o)/2,S=u(m)*T+d(m)*N+(e+l)/2,C={x:(E.x-T)/f,y:(E.y-N)/g},k=ue({x:1,y:0},C),A=ue(C,{x:(-E.x-T)/f,y:(-E.y-N)/g});!s&&A>0?A-=2*v:s&&0>A&&(A+=2*v);var R=k+(A%=2*v)*h,O=f*d(R),L=g*u(R);return{x:d(m)*O-u(m)*L+P,y:u(m)*O+d(m)*L+S}}function pe(t,e,r,n,i,a,s,o,l,h,c){var u,d=c.bbox,p=void 0===d||d,v=c.length,f=void 0===v||v,g=c.sampleSize,m=void 0===g?30:g,y="number"==typeof h,x=t,E=e,b=0,w=[x,E,b],M=[x,E],T={x:0,y:0},N=[{x:x,y:E}];y&&0>=h&&(T={x:x,y:E});for(var P=0;m>=P;P+=1){if(x=(u=de(t,e,r,n,i,a,s,o,l,P/m)).x,E=u.y,p&&N.push({x:x,y:E}),f&&(b+=he(M,[x,E])),M=[x,E],y&&b>=h&&h>w[2]){var S=(b-h)/(b-w[2]);T={x:M[0]*(1-S)+w[0]*S,y:M[1]*(1-S)+w[1]*S}}w=[x,E,b]}return y&&h>=b&&(T={x:o,y:l}),{length:b,point:T,min:{x:Math.min.apply(null,N.map((function(t){return t.x}))),y:Math.min.apply(null,N.map((function(t){return t.y})))},max:{x:Math.max.apply(null,N.map((function(t){return t.x}))),y:Math.max.apply(null,N.map((function(t){return t.y})))}}}function ve(t,e,r,n,i,a,s,o,l){var h=1-l;return{x:Math.pow(h,3)*t+3*Math.pow(h,2)*l*r+3*h*Math.pow(l,2)*i+Math.pow(l,3)*s,y:Math.pow(h,3)*e+3*Math.pow(h,2)*l*n+3*h*Math.pow(l,2)*a+Math.pow(l,3)*o}}function fe(t,e,r,n,i,a,s,o,l,h){var c,u=h.bbox,d=void 0===u||u,p=h.length,v=void 0===p||p,f=h.sampleSize,g=void 0===f?10:f,m="number"==typeof l,y=t,x=e,E=0,b=[y,x,E],w=[y,x],M={x:0,y:0},T=[{x:y,y:x}];m&&0>=l&&(M={x:y,y:x});for(var N=0;g>=N;N+=1){if(y=(c=ve(t,e,r,n,i,a,s,o,N/g)).x,x=c.y,d&&T.push({x:y,y:x}),v&&(E+=he(w,[y,x])),w=[y,x],m&&E>=l&&l>b[2]){var P=(E-l)/(E-b[2]);M={x:w[0]*(1-P)+b[0]*P,y:w[1]*(1-P)+b[1]*P}}b=[y,x,E]}return m&&l>=E&&(M={x:s,y:o}),{length:E,point:M,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,T.map((function(t){return t.x}))),y:Math.max.apply(null,T.map((function(t){return t.y})))}}}function ge(t,e,r,n,i,a,s){var o=1-s;return{x:Math.pow(o,2)*t+2*o*s*r+Math.pow(s,2)*i,y:Math.pow(o,2)*e+2*o*s*n+Math.pow(s,2)*a}}function me(t,e,r,n,i,a,s,o){var l,h=o.bbox,c=void 0===h||h,u=o.length,d=void 0===u||u,p=o.sampleSize,v=void 0===p?10:p,f="number"==typeof s,g=t,m=e,y=0,x=[g,m,y],E=[g,m],b={x:0,y:0},w=[{x:g,y:m}];f&&0>=s&&(b={x:g,y:m});for(var M=0;v>=M;M+=1){if(g=(l=ge(t,e,r,n,i,a,M/v)).x,m=l.y,c&&w.push({x:g,y:m}),d&&(y+=he(E,[g,m])),E=[g,m],f&&y>=s&&s>x[2]){var T=(y-s)/(y-x[2]);b={x:E[0]*(1-T)+x[0]*T,y:E[1]*(1-T)+x[1]*T}}x=[g,m,y]}return f&&s>=y&&(b={x:i,y:a}),{length:y,point:b,min:{x:Math.min.apply(null,w.map((function(t){return t.x}))),y:Math.min.apply(null,w.map((function(t){return t.y})))},max:{x:Math.max.apply(null,w.map((function(t){return t.x}))),y:Math.max.apply(null,w.map((function(t){return t.y})))}}}function ye(t,e,r){for(var n,i,a,s,o,l,h,c,u,d=re(t),p="number"==typeof e,v=[],f=0,g=0,m=0,y=0,x=[],E=[],b=0,w={x:0,y:0},M=w,T=w,N=w,P=0,S=0,C=d.length;C>S;S+=1)v=(h="M"===(c=(u=d[S])[0]))?v:[f,g].concat(u.slice(1)),h?(M=w={x:m=u[1],y:y=u[2]},b=0,p&&.001>e&&(N=w)):"L"===c?(b=(n=ce(v[0],v[1],v[2],v[3],(e||0)-P)).length,w=n.min,M=n.max,T=n.point):"A"===c?(b=(i=pe(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],(e||0)-P,r||{})).length,w=i.min,M=i.max,T=i.point):"C"===c?(b=(a=fe(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],(e||0)-P,r||{})).length,w=a.min,M=a.max,T=a.point):"Q"===c?(b=(s=me(v[0],v[1],v[2],v[3],v[4],v[5],(e||0)-P,r||{})).length,w=s.min,M=s.max,T=s.point):"Z"===c&&(b=(o=ce((v=[f,g,m,y])[0],v[1],v[2],v[3],(e||0)-P)).length,w=o.min,M=o.max,T=o.point),p&&e>P&&P+b>=e&&(N=T),E.push(M),x.push(w),P+=b,f=(l="Z"!==c?u.slice(-2):[m,y])[0],g=l[1];return p&&e>=P&&(N={x:f,y:g}),{length:P,point:N,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function xe(t){return function(t){var e=0,r=0,n=0;return le(t).map((function(t){var i;if("M"===t[0])return e=t[1],r=t[2],0;var a,s,o,l,h,c,u,d,p=t.slice(1);return n=3*(((d=p[5])-(s=r))*((o=p[0])+(h=p[2]))-((u=p[4])-(a=e))*((l=p[1])+(c=p[3]))+l*(a-h)-o*(s-c)+d*(h+a/3)-u*(c+s/3))/20,i=t.slice(-2),e=i[0],r=i[1],n})).reduce((function(t,e){return t+e}),0)}(t)>=0}function Ee(t){return t.map((function(t,e,r){var n=e&&r[e-1].slice(-2).concat(t.slice(1)),i=e?fe(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var r=t.slice(0,2),n=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),s=ae(r,n,e),o=ae(n,i,e),l=ae(i,a,e),h=ae(s,o,e),c=ae(o,l,e),u=ae(h,c,e);return[["C"].concat(s,h,u),["C"].concat(c,l,a)]}(n):[t,t]:[t],l:i}}))}function be(t,e,r){var n=Ee(t),i=Ee(e),a=n.length,s=i.length,o=n.filter((function(t){return t.l})).length,l=i.filter((function(t){return t.l})).length,h=n.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/o||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/l||0,u=r||Math.max(a,s),d=[h,c],p=[u-a,u-s],v=0,f=[n,i].map((function(t,e){return t.l===u?t.map((function(t){return t.s})):t.map((function(t,r){return p[e]-=(v=r&&p[e]&&t.l>=d[e])?1:0,v?t.ss:[t.s]})).flat()}));return f[0].length===f[1].length?f:be(f[0],f[1],u)}function we(t){return void 0===t?0:t>360||-360>t?t%360:t}var Me=I();function Te(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(t)&&3===t.length?a?(e=t,(r=new g(3))[0]=e[0],r[1]=e[1],r[2]=e[2],r):_(Me,t):Ot(t)?a?G(t,n,i):F(Me,t,n,i):a?G(t[0],t[1]||n,t[2]||i):F(Me,t[0],t[1]||n,t[2]||i)}var Ne=Math.PI/180;function Pe(t){return t*Ne}var Se=180/Math.PI;function Ce(t){return t*Se}function ke(t){return 360*t}var Ae=Math.PI/2;function Re(t,e){return 16===e.length?function(t,e){var r,n,i=d(k(I(),e),3),a=i[0],s=i[1],o=i[2],l=Math.asin(-e[2]/a);return Ae>l?l>-Ae?(r=Math.atan2(e[6]/s,e[10]/o),n=Math.atan2(e[1]/a,e[0]/a)):(n=0,r=-Math.atan2(e[4]/s,e[5]/s)):(n=0,r=Math.atan2(e[4]/s,e[5]/s)),t[0]=r,t[1]=l,t[2]=n,t}(t,e):function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],s=n*n,o=i*i,l=a*a,h=r*r+s+o+l,c=r*a-n*i;return c>.499995*h?(t[0]=Ae,t[1]=2*Math.atan2(n,r),t[2]=0):-.499995*h>c?(t[0]=-Ae,t[1]=2*Math.atan2(n,r),t[2]=0):(t[0]=Math.asin(2*(r*i-a*n)),t[1]=Math.atan2(2*(r*a+n*i),1-2*(o+l)),t[2]=Math.atan2(2*(r*n+i*a),1-2*(s+o))),t}(t,e)}function Oe(t,e,r,n,i){var a,s,o,l,h,c,u,d,p,v,f=Math.cos(t),m=Math.sin(t);return a=n*f,s=i*m,o=0,l=-n*m,h=i*f,c=0,u=e,d=r,p=1,(v=new g(9))[0]=a,v[1]=s,v[2]=o,v[3]=l,v[4]=h,v[5]=c,v[6]=u,v[7]=d,v[8]=p,v}function Le(t){var e=t[0],r=t[1],n=t[3],i=t[4],a=Math.sqrt(e*e+r*r),s=Math.sqrt(n*n+i*i);if(0>e*i-r*n&&(i>e?a=-a:s=-s),a){var o=1/a;e*=o,r*=o}if(s){var l=1/s;n*=l,i*=l}var h=Ce(Math.atan2(r,e));return[t[6],t[7],a,s,h]}var Ie=y(),De=y(),Ge=Z(),_e=[I(),I(),I()],Fe=I();function Be(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var Ve=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),Ue=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),Ye=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),Xe={UPDATED:"updated"},He=2e-4;class je{constructor(){this.clipSpaceNearZ=h.NEGATIVE_ONE,this.eventEmitter=new v,this.matrix=y(),this.right=G(1,0,0),this.up=G(0,1,0),this.forward=G(0,0,1),this.position=G(0,0,1),this.focalPoint=G(0,0,0),this.distanceVector=G(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=y(),this.projectionMatrixInverse=y(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Ve.EXPLORING,this.trackingMode=Ue.DEFAULT,this.projectionMode=Ye.PERSPECTIVE,this.frustum=new yt,this.orthoMatrix=y()}isOrtho(){return this.projectionMode===Ye.ORTHOGRAPHIC}getProjectionMode(){return this.projectionMode}getPerspective(){return this.jitteredProjectionMatrix||this.projectionMatrix}getPerspectiveInverse(){return this.projectionMatrixInverse}getFrustum(){return this.frustum}getPosition(){return this.position}getFocalPoint(){return this.focalPoint}getDollyingStep(){return this.dollyingStep}getNear(){return this.near}getFar(){return this.far}getZoom(){return this.zoom}getOrthoMatrix(){return this.orthoMatrix}getView(){return this.view}setEnableUpdate(t){this.enableUpdate=t}setType(t,e){return this.type=t,this.setWorldRotation(this.type===Ve.EXPLORING),this._getAngles(),this.type===Ve.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}setProjectionMode(t){return this.projectionMode=t,this}setTrackingMode(t){if(this.type!==Ve.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}setWorldRotation(t){return this.rotateWorld=t,this._getAngles(),this}getViewTransform(){return w(y(),this.matrix)}getWorldTransform(){return this.matrix}jitterProjectionMatrix(t,e){var r=N(y(),[t,e,0]);this.jitteredProjectionMatrix=M(y(),r,this.projectionMatrix)}clearJitterProjectionMatrix(){this.jitteredProjectionMatrix=void 0}setMatrix(t){return this.matrix=t,this._update(),this}setProjectionMatrix(t){this.projectionMatrix=t}setFov(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}setAspect(t){return this.setPerspective(this.near,this.far,this.fov,t),this}setNear(t){return this.projectionMode===Ye.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}setFar(t){return this.projectionMode===Ye.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}setViewOffset(t,e,r,n,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=a,this.projectionMode===Ye.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}clearViewOffset(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Ye.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}setZoom(t){return this.zoom=t,this.projectionMode===Ye.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Ye.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}setZoomByViewportPoint(t,e){var r=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),n=r.x,i=r.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(n,i),this.setFocalPoint(n,i),this.setZoom(t),this.rotate(0,0,a);var s=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),o=G(s.x-n,s.y-i,0),l=X(o,this.right)/D(this.right),h=X(o,this.up)/D(this.up),c=d(this.getPosition(),2),u=c[0],p=c[1],v=d(this.getFocalPoint(),2),f=v[0],g=v[1];return this.setPosition(u-l,p-h),this.setFocalPoint(f-l,g-h),this}setPerspective(t,e,r,n){var i;this.projectionMode=Ye.PERSPECTIVE,this.fov=r,this.near=t,this.far=e,this.aspect=n;var a=this.near*Math.tan(Pe(.5*this.fov))/this.zoom,s=2*a,o=this.aspect*s,l=-.5*o;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var c=this.view.fullWidth,u=this.view.fullHeight;l+=this.view.offsetX*o/c,a-=this.view.offsetY*s/u,o*=this.view.width/c,s*=this.view.height/u}return function(t,e,r,n,i,a,s){var o,l,h=2*a,c=r-e,u=n-i,d=h/u,p=(r+e)/c,v=(n+i)/u,f=s-a,g=s*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(o=-s/f,l=-g/f):(o=-(s+a)/f,l=-2*g/f),t[0]=h/c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=d,t[6]=0,t[7]=0,t[8]=p,t[9]=v,t[10]=o,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,l,l+o,a-s,a,t,this.far,this.clipSpaceNearZ===h.ZERO),w(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}setOrthographic(t,e,r,n,i,a){var s;this.projectionMode=Ye.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=r,this.bottom=n,this.near=i,this.far=a;var o=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),c=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,d=c-o,p=c+o,v=u+l,f=u-l;if(null!==(s=this.view)&&void 0!==s&&s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(d+=g*this.view.offsetX)+g*this.view.width,f=(v-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===h.NEGATIVE_ONE?O(this.projectionMatrix,d,p,v,f,i,a):function(t,e,r,n,i,a,s){var o=1/(e-r),l=1/(n-i),h=1/(a-s);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=h,t[11]=0,t[12]=(e+r)*o,t[13]=(i+n)*l,t[14]=a*h,t[15]=1}(this.projectionMatrix,d,p,v,f,i,a),w(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}setPosition(t){var e=Te(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}setFocalPoint(t){var e,r,n,i,a,s,o,l,h,c,u,d,p,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],m=G(0,1,0);if(this.focalPoint=Te(t,v,g),this.trackingMode===Ue.CINEMATIC){var x=V(I(),this.focalPoint,this.position);t=x[0],v=x[1],g=x[2];var E=D(x),M=Ce(Math.asin(v/E)),T=90+Ce(Math.atan2(g,t)),N=y();e=N,r=N,n=Pe(T),i=Math.sin(n),a=Math.cos(n),s=r[0],o=r[1],l=r[2],h=r[3],c=r[8],u=r[9],d=r[10],p=r[11],r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=s*a-c*i,e[1]=o*a-u*i,e[2]=l*a-d*i,e[3]=h*a-p*i,e[8]=s*i+c*a,e[9]=o*i+u*a,e[10]=l*i+d*a,e[11]=h*i+p*a,function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],s=e[5],o=e[6],l=e[7],h=e[8],c=e[9],u=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*i+h*n,t[5]=s*i+c*n,t[6]=o*i+u*n,t[7]=l*i+d*n,t[8]=h*i-a*n,t[9]=c*i-s*n,t[10]=u*i-o*n,t[11]=d*i-l*n}(N,N,Pe(M)),m=j(I(),[0,1,0],N)}return w(this.matrix,function(t,e,r,n){var i,a,s,o,l,h,c,u,d,p,v=e[0],g=e[1],m=e[2],y=n[0],x=n[1],E=n[2],w=r[0],M=r[1],T=r[2];return f>Math.abs(v-w)&&f>Math.abs(g-M)&&f>Math.abs(m-T)?b(t):(p=1/Math.hypot(c=v-w,u=g-M,d=m-T),(p=Math.hypot(i=x*(d*=p)-E*(u*=p),a=E*(c*=p)-y*d,s=y*u-x*c))?(i*=p=1/p,a*=p,s*=p):(i=0,a=0,s=0),(p=Math.hypot(o=u*s-d*a,l=d*i-c*s,h=c*a-u*i))?(o*=p=1/p,l*=p,h*=p):(o=0,l=0,h=0),t[0]=i,t[1]=o,t[2]=c,t[3]=0,t[4]=a,t[5]=l,t[6]=u,t[7]=0,t[8]=s,t[9]=h,t[10]=d,t[11]=0,t[12]=-(i*v+a*g+s*m),t[13]=-(o*v+l*g+h*m),t[14]=-(c*v+u*g+d*m),t[15]=1,t)}(y(),this.position,this.focalPoint,m)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}getDistance(){return this.distance}getDistanceVector(){return this.distanceVector}setDistance(t){if(this.distance===t||0>t)return this;this.distance=t,He>this.distance&&(this.distance=He),this.dollyingStep=this.distance/100;var e=I(),r=this.forward,n=this.focalPoint;return e[0]=(t=this.distance)*r[0]+n[0],e[1]=t*r[1]+n[1],e[2]=t*r[2]+n[2],this._setPosition(e),this.triggerUpdate(),this}setMaxDistance(t){return this.maxDistance=t,this}setMinDistance(t){return this.minDistance=t,this}setAzimuth(t){return this.azimuth=we(t),this.computeMatrix(),this._getAxes(),this.type===Ve.ORBITING||this.type===Ve.EXPLORING?this._getPosition():this.type===Ve.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}getAzimuth(){return this.azimuth}setElevation(t){return this.elevation=we(t),this.computeMatrix(),this._getAxes(),this.type===Ve.ORBITING||this.type===Ve.EXPLORING?this._getPosition():this.type===Ve.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}getElevation(){return this.elevation}setRoll(t){return this.roll=we(t),this.computeMatrix(),this._getAxes(),this.type===Ve.ORBITING||this.type===Ve.EXPLORING?this._getPosition():this.type===Ve.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}getRoll(){return this.roll}_update(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}computeMatrix(){var t=J(Q(),[0,0,1],Pe(this.roll));b(this.matrix);var e=J(Q(),[1,0,0],Pe((this.rotateWorld&&this.type!==Ve.TRACKING||this.type===Ve.TRACKING?1:-1)*this.elevation)),r=J(Q(),[0,1,0],Pe((this.rotateWorld&&this.type!==Ve.TRACKING||this.type===Ve.TRACKING?1:-1)*this.azimuth)),n=tt(Q(),r,e);n=tt(Q(),n,t);var i,a,s,o,l,h,c,u,d,p,v,f,g,m,x,E,w,N,P=(i=y(),p=(s=(a=n)[0])*(c=s+s),v=(o=a[1])*c,g=(l=a[2])*c,m=l*(u=o+o),E=(h=a[3])*c,w=h*u,N=h*(d=l+l),i[0]=1-(f=o*u)-(x=l*d),i[1]=v+N,i[2]=g-w,i[3]=0,i[4]=v-N,i[5]=1-p-x,i[6]=m+E,i[7]=0,i[8]=g+w,i[9]=m-E,i[10]=1-p-f,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i);this.type===Ve.ORBITING||this.type===Ve.EXPLORING?(T(this.matrix,this.matrix,this.focalPoint),M(this.matrix,this.matrix,P),T(this.matrix,this.matrix,[0,0,this.distance])):this.type===Ve.TRACKING&&(T(this.matrix,this.matrix,this.position),M(this.matrix,this.matrix,P))}_setPosition(t,e,r){this.position=Te(t,e,r);var n=this.matrix;n[12]=this.position[0],n[13]=this.position[1],n[14]=this.position[2],n[15]=1,this._getOrthoMatrix()}_getAxes(){_(this.right,Te(K(Z(),[1,0,0,0],this.matrix))),_(this.up,Te(K(Z(),[0,1,0,0],this.matrix))),_(this.forward,Te(K(Z(),[0,0,1,0],this.matrix))),Y(this.right,this.right),Y(this.up,this.up),Y(this.forward,this.forward)}_getAngles(){var t=this.distanceVector[0],e=this.distanceVector[1],r=this.distanceVector[2],n=D(this.distanceVector);if(0===n)return this.elevation=0,void(this.azimuth=0);this.type===Ve.TRACKING||this.rotateWorld?(this.elevation=Ce(Math.asin(e/n)),this.azimuth=Ce(Math.atan2(-t,-r))):(this.elevation=-Ce(Math.asin(e/n)),this.azimuth=-Ce(Math.atan2(-t,-r)))}_getPosition(){_(this.position,Te(K(Z(),[0,0,0,1],this.matrix))),this._getDistance()}_getFocalPoint(){var t,e;!function(t,e,r){var n=e[0],i=e[1],a=e[2];t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8]}(this.distanceVector,[0,0,-this.distance],(t=m(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),B(this.focalPoint,this.position,this.distanceVector),this._getDistance()}_getDistance(){this.distanceVector=V(I(),this.focalPoint,this.position),this.distance=D(this.distanceVector),this.dollyingStep=this.distance/100}_getOrthoMatrix(){if(this.projectionMode===Ye.ORTHOGRAPHIC){var t=this.position,e=J(Q(),[0,0,1],-this.roll*Math.PI/180);R(this.orthoMatrix,e,G((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),G(this.zoom,this.zoom,1),t)}}triggerUpdate(){if(this.enableUpdate){var t=this.getViewTransform(),e=M(y(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Xe.UPDATED)}}rotate(t,e,r){throw Error(bt)}pan(t,e){throw Error(bt)}dolly(t){throw Error(bt)}createLandmark(t,e){throw Error(bt)}gotoLandmark(t,e){throw Error(bt)}cancelLandmarkAnimation(){throw Error(bt)}}var ze=function(t){return t[t.Standard=0]="Standard",t}({}),We=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),qe={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Et(0,0,0,0)},Ze=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function $e(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Ke(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Qe(){}var Je=.7,tr=1/Je,er="\\s*([+-]?\\d+)\\s*",rr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ir=/^#([0-9a-f]{3,8})$/,ar=RegExp(`^rgb\\(${er},${er},${er}\\)$`),sr=RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`),or=RegExp(`^rgba\\(${er},${er},${er},${rr}\\)$`),lr=RegExp(`^rgba\\(${nr},${nr},${nr},${rr}\\)$`),hr=RegExp(`^hsl\\(${rr},${nr},${nr}\\)$`),cr=RegExp(`^hsla\\(${rr},${nr},${nr},${rr}\\)$`),ur={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 dr(){return this.rgb().formatHex()}function pr(){return this.rgb().formatRgb()}function vr(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=ir.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?fr(e):3===r?new mr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?gr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?gr(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ar.exec(t))?new mr(e[1],e[2],e[3],1):(e=sr.exec(t))?new mr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=or.exec(t))?gr(e[1],e[2],e[3],e[4]):(e=lr.exec(t))?gr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=hr.exec(t))?Mr(e[1],e[2]/100,e[3]/100,1):(e=cr.exec(t))?Mr(e[1],e[2]/100,e[3]/100,e[4]):ur.hasOwnProperty(t)?fr(ur[t]):"transparent"===t?new mr(NaN,NaN,NaN,0):null}function fr(t){return new mr(t>>16&255,t>>8&255,255&t,1)}function gr(t,e,r,n){return n>0||(t=e=r=NaN),new mr(t,e,r,n)}function mr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function yr(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}`}function xr(){const t=Er(this.opacity);return`${1===t?"rgb(":"rgba("}${br(this.r)}, ${br(this.g)}, ${br(this.b)}${1===t?")":`, ${t})`}`}function Er(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function br(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function wr(t){return(16>(t=br(t))?"0":"")+t.toString(16)}function Mr(t,e,r,n){return n>0?r>0&&1>r?e>0||(t=NaN):t=e=NaN:t=e=r=NaN,new Nr(t,e,r,n)}function Tr(t){if(t instanceof Nr)return new Nr(t.h,t.s,t.l,t.opacity);if(t instanceof Qe||(t=vr(t)),!t)return new Nr;if(t instanceof Nr)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(s=e===a?(r-n)/o+6*(n>r):r===a?(n-e)/o+2:(e-r)/o+4,o/=.5>l?a+i:2-a-i,s*=60):o=l>0&&1>l?0:s,new Nr(s,o,l,t.opacity)}function Nr(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Pr(t){return 0>(t=(t||0)%360)?t+360:t}function Sr(t){return Math.max(0,Math.min(1,t||0))}function Cr(t,e,r){return 255*(60>t?e+(r-e)*t/60:180>t?r:240>t?e+(r-e)*(240-t)/60:e)}function kr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){for(var n=arguments.length,i=Array(n),a=0;n>a;a++)i[a]=arguments[a];var s=e?e.apply(this,i):i[0],o=r.cache;if(o.has(s))return o.get(s);var l=t.apply(this,i);return r.cache=o.set(s,l)||o,l};return r.cache=new(kr.Cache||Map),r}$e(Qe,vr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:dr,formatHex:dr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Tr(this).formatHsl()},formatRgb:pr,toString:pr}),$e(mr,(function(t,e,r,n){return 1===arguments.length?((i=t)instanceof Qe||(i=vr(i)),i?new mr((i=i.rgb()).r,i.g,i.b,i.opacity):new mr):new mr(t,e,r,null==n?1:n);var i}),Ke(Qe,{brighter(t){return new mr(this.r*(t=null==t?tr:Math.pow(tr,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new mr(this.r*(t=null==t?Je:Math.pow(Je,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new mr(br(this.r),br(this.g),br(this.b),Er(this.opacity))},displayable(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:yr,formatHex:yr,formatHex8:function(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}${wr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:xr,toString:xr})),$e(Nr,(function(t,e,r,n){return 1===arguments.length?Tr(t):new Nr(t,e,r,null==n?1:n)}),Ke(Qe,{brighter(t){return new Nr(this.h,this.s,this.l*(t=null==t?tr:Math.pow(tr,t)),this.opacity)},darker(t){return new Nr(this.h,this.s,this.l*(t=null==t?Je:Math.pow(Je,t)),this.opacity)},rgb(){var t=this.h%360+360*(0>this.h),e=this.l,r=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),n=2*e-r;return new mr(Cr(240>t?t+120:t-240,n,r),Cr(t,n,r),Cr(120>t?t+240:t-120,n,r),this.opacity)},clamp(){return new Nr(Pr(this.h),Sr(this.s),Sr(this.l),Er(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=Er(this.opacity);return`${1===t?"hsl(":"hsla("}${Pr(this.h)}, ${100*Sr(this.s)}%, ${100*Sr(this.l)}%${1===t?")":`, ${t})`}`}})),kr.Cache=Map;var Ar=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),Rr=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),Or=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Lr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Ir=[{name:"em",unit_type:Ar.kEms},{name:"px",unit_type:Ar.kPixels},{name:"deg",unit_type:Ar.kDegrees},{name:"rad",unit_type:Ar.kRadians},{name:"grad",unit_type:Ar.kGradians},{name:"ms",unit_type:Ar.kMilliseconds},{name:"s",unit_type:Ar.kSeconds},{name:"rem",unit_type:Ar.kRems},{name:"turn",unit_type:Ar.kTurns}],Dr=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),Gr=t=>t?"number"===t?Ar.kNumber:"percent"===t||"%"===t?Ar.kPercentage:(t=>Ir.find((e=>e.name===t)).unit_type)(t):Ar.kUnknown,_r=t=>{var e=1;switch(t){case Ar.kPixels:case Ar.kDegrees:case Ar.kSeconds:break;case Ar.kMilliseconds:e=.001;break;case Ar.kRadians:e=180/Math.PI;break;case Ar.kGradians:e=.9;break;case Ar.kTurns:e=360}return e},Fr=t=>{switch(t){case Ar.kNumber:case Ar.kInteger:return"";case Ar.kPercentage:return"%";case Ar.kEms:return"em";case Ar.kRems:return"rem";case Ar.kPixels:return"px";case Ar.kDegrees:return"deg";case Ar.kRadians:return"rad";case Ar.kGradians:return"grad";case Ar.kMilliseconds:return"ms";case Ar.kSeconds:return"s";case Ar.kTurns:return"turn"}return""};class Br{static isAngle(t){return t===Ar.kDegrees||t===Ar.kRadians||t===Ar.kGradians||t===Ar.kTurns}static isLength(t){return t>=Ar.kEms&&Ar.kDegrees>t}static isRelativeUnit(t){return t===Ar.kPercentage||t===Ar.kEms||t===Ar.kRems}static isTime(t){return t===Ar.kSeconds||t===Ar.kMilliseconds}toString(){return this.buildCSSText(Or.kNo,Lr.kNo,"")}isNumericValue(){return this.getType()>=Dr.kUnitType&&this.getType()<=Dr.kClampType}}class Vr extends Br{constructor(t){super(),this.colorSpace=t}getType(){return Dr.kColorType}to(t){return this}}var Ur=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({});class Yr extends Br{constructor(t,e){super(),this.type=t,this.value=e}clone(){return new Yr(this.type,this.value)}buildCSSText(t,e,r){return r}getType(){return Dr.kColorType}}class Xr extends Br{constructor(t){super(),this.value=t}clone(){return new Xr(this.value)}getType(){return Dr.kKeywordType}buildCSSText(t,e,r){return r+this.value}}var Hr=t=>(t=>{switch(t){case Rr.kUNumber:return Ar.kNumber;case Rr.kULength:return Ar.kPixels;case Rr.kUPercent:return Ar.kPercentage;case Rr.kUTime:return Ar.kSeconds;case Rr.kUAngle:return Ar.kDegrees;default:return Ar.kUnknown}})((t=>{switch(t){case Ar.kNumber:case Ar.kInteger:return Rr.kUNumber;case Ar.kPercentage:return Rr.kUPercent;case Ar.kPixels:return Rr.kULength;case Ar.kMilliseconds:case Ar.kSeconds:return Rr.kUTime;case Ar.kDegrees:case Ar.kRadians:case Ar.kGradians:case Ar.kTurns:return Rr.kUAngle;default:return Rr.kUOther}})(t));class jr extends Br{constructor(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ar.kNumber;super(),e="string"==typeof r?Gr(r):r,this.unit=e,this.value=t}clone(){return new jr(this.value,this.unit)}equals(t){return this.value===t.value&&this.unit===t.unit}getType(){return Dr.kUnitType}convertTo(t){if(this.unit===t)return new jr(this.value,this.unit);var e=Hr(this.unit);if(e!==Hr(t)||e===Ar.kUnknown)return null;var r=_r(this.unit)/_r(t);return new jr(this.value*r,t)}buildCSSText(t,e,r){var n;switch(this.unit){case Ar.kUnknown:break;case Ar.kInteger:n=Number(this.value).toFixed(0);break;case Ar.kNumber:case Ar.kPercentage:case Ar.kEms:case Ar.kRems:case Ar.kPixels:case Ar.kDegrees:case Ar.kRadians:case Ar.kGradians:case Ar.kMilliseconds:case Ar.kSeconds:case Ar.kTurns:var i=this.value,a=Fr(this.unit);if(-999999>i||i>999999){var s=Fr(this.unit);n=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,s):i+(s||"")}else n="".concat(i).concat(a)}return r+=n}}var zr=new jr(0,"px");new jr(1,"px");var Wr=new jr(0,"deg");class qr extends Vr{constructor(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super("rgb"),this.r=t,this.g=e,this.b=r,this.alpha=n,this.isNone=i}clone(){return new qr(this.r,this.g,this.b,this.alpha)}buildCSSText(t,e,r){return"".concat(r,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}var Zr=new Xr("unset"),$r={"":Zr,unset:Zr,initial:new Xr("initial"),inherit:new Xr("inherit")},Kr=new qr(0,0,0,0,!0),Qr=new qr(0,0,0,0),Jr=kr(((t,e,r,n)=>new qr(t,e,r,n)),((t,e,r,n)=>"rgba(".concat(t,",").concat(e,",").concat(r,",").concat(n,")"))),tn=function(t){return new jr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ar.kNumber)};function en(t){var e=t.type,r=t.value;return"hex"===e?"#".concat(r):"literal"===e?r:"rgb"===e?"rgb(".concat(r.join(","),")"):"rgba(".concat(r.join(","),")")}new jr(50,"%");var rn=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-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/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function r(t){throw Error("".concat(e,": ").concat(t))}function n(){var t=p(i);return e.length>0&&r("Invalid input not EOF"),t}function i(){return a("linear-gradient",t.linearGradient,o)||a("repeating-linear-gradient",t.repeatingLinearGradient,o)||a("radial-gradient",t.radialGradient,l)||a("repeating-radial-gradient",t.repeatingRadialGradient,l)||a("conic-gradient",t.conicGradient,l)}function a(e,n,i){return s(n,(function(n){var a=i();return a&&(x(t.comma)||r("Missing comma before color stops")),{type:e,orientation:a,colorStops:p(v)}}))}function s(e,n){var i=x(e);if(i){x(t.startCall)||r("Missing (");var a=n(i);return x(t.endCall)||r("Missing )"),a}}function o(){return y("directional",t.sideOrCorner,1)||y("angular",t.angleValue,1)}function l(){var r,n,i=h();return i&&((r=[]).push(i),n=e,x(t.comma)&&((i=h())?r.push(i):e=n)),r}function h(){var t=function(){var t=y("shape",/^(circle)/i,0);t&&(t.style=m()||c());return t}()||function(){var t=y("shape",/^(ellipse)/i,0);t&&(t.style=g()||c());return t}();if(t)t.at=u();else{var e=c();if(e){t=e;var r=u();r&&(t.at=r)}else{var n=d();n&&(t={type:"default-radial",at:n})}}return t}function c(){return y("extent-keyword",t.extentKeywords,1)}function u(){if(y("position",/^at/,0)){var t=d();return t||r("Missing positioning value"),t}}function d(){var t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function p(e){var n=e(),i=[];if(n)for(i.push(n);x(t.comma);)(n=e())?i.push(n):r("One extra comma");return i}function v(){var e=y("hex",t.hexColor,1)||s(t.rgbaColor,(function(){return{type:"rgba",value:p(f)}}))||s(t.rgbColor,(function(){return{type:"rgb",value:p(f)}}))||y("literal",t.literalColor,0);return e||r("Expected color definition"),e.length=g(),e}function f(){return x(t.number)[1]}function g(){return y("%",t.percentageValue,1)||y("position-keyword",t.positionKeywords,1)||m()}function m(){return y("px",t.pixelValue,1)||y("em",t.emValue,1)}function y(t,e,r){var n=x(e);if(n)return{type:t,value:n[r]}}function x(t){var r=/^[\n\r\t\s]+/.exec(e);r&&E(r[0].length);var n=t.exec(e);return n&&E(n[0].length),n}function E(t){e=e.substring(t)}return function(t){return e=t,n()}}();var nn=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,an=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,sn=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,on=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ln={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},hn=kr((t=>tn("angular"===t.type?Number(t.value):ln[t.value]||0,"deg"))),cn=kr((t=>{var e=50,r=50,n="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,s=a.x,o=a.y;"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?e=50:"right"===s.value?e=100:"top"===s.value?r=0:"bottom"===s.value&&(r=100)),"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?r=50:"right"===o.value?e=100:"top"===o.value?r=0:"bottom"===o.value&&(r=100)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(n=null==s?void 0:s.type,e=Number(s.value)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(i=null==o?void 0:o.type,r=Number(o.value))}return{cx:tn(e,n),cy:tn(r,i)}})),un=kr((t=>{if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return rn(t).map((t=>{var e=t.type,r=t.orientation,n=t.colorStops;!function(t){var e,r,n=t.length;t[n-1].length=null!==(e=t[n-1].length)&&void 0!==e?e:{type:"%",value:"100"},n>1&&(t[0].length=null!==(r=t[0].length)&&void 0!==r?r:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),s=1;n>s;s++){var o,l=null===(o=t[s].length)||void 0===o?void 0:o.value;if(!Tt(l)&&!Tt(a)){for(var h=1;s-i>h;h++)t[i+h].length={type:"%",value:"".concat(a+(Number(l)-a)*h/(s-i))};i=s,a=Number(l)}}}(n);var i,a=n.map((t=>({offset:tn(Number(t.length.value),"%"),color:en(t)})));if("linear-gradient"===e)return new Yr(Ur.LinearGradient,{angle:r?hn(r):Wr,steps:a});if("radial-gradient"===e&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var s,o=cn(r[0].at),l=o.cx,h=o.cy;if(r[0].style){var c=r[0].style,u=c.type,d=c.value;"extent-keyword"===u?($r[i=d]||($r[i]=new Xr(i)),s=$r[i]):s=tn(d,u)}return new Yr(Ur.RadialGradient,{cx:l,cy:h,size:s,steps:a})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var r=nn.exec(t);if(r){var n,i=(null===(n=r[2].match(on))||void 0===n?void 0:n.map((t=>t.split(":"))))||[];return[new Yr(Ur.LinearGradient,{angle:tn(parseFloat(r[1]),"deg"),steps:i.map((t=>{var e=d(t,2),r=e[1];return{offset:tn(100*Number(e[0]),"%"),color:r}}))})]}}else if("r"===e){var a=function(t){var e=an.exec(t);if(e){var r,n=(null===(r=e[4].match(on))||void 0===r?void 0:r.map((t=>t.split(":"))))||[];return{cx:tn(50,"%"),cy:tn(50,"%"),steps:n.map((t=>{var e=d(t,2),r=e[1];return{offset:tn(100*Number(e[0]),"%"),color:r}}))}}return null}(t);if(a){if(!At(a))return[new Yr(Ur.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=sn.exec(t);if(e){var r=e[1],n=e[2];switch(r){case"a":r="repeat";break;case"x":r="repeat-x";break;case"y":r="repeat-y";break;default:r="no-repeat"}return{image:n,repetition:r}}return null}(t)}));function dn(t){return t&&!!t.image}function pn(t){return t&&!Tt(t.r)&&!Tt(t.g)&&!Tt(t.b)}var vn=kr((t=>{if(dn(t))return o({repetition:"repeat"},t);if(Tt(t)&&(t=""),"transparent"===t)return Qr;if("currentColor"===t)t="black";else if("none"===t)return Kr;var e=un(t);if(e)return e;var r=vr(t),n=[0,0,0,0];return null!==r&&(n[0]=r.r||0,n[1]=r.g||0,n[2]=r.b||0,n[3]=r.opacity),Jr(...n)}));function fn(t,e){if(pn(t)&&pn(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],t=>{var e=t.slice();if(e[3])for(var r=0;3>r;r++)e[r]=Math.round(Rt(e[r],0,255));return e[3]=Rt(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function gn(t,e){if(Tt(e))return tn(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return tn(Number(e),"px");if("deg".search(t)>=0)return tn(Number(e),"deg")}var r=[];e=e.replace(t,(t=>(r.push(t),"U".concat(t))));var n="U(".concat(t.source,")");return r.map((t=>tn(Number(e.replace(RegExp("U".concat(t),"g"),"").replace(RegExp(n,"g"),"*0")),t)))[0]}var mn=t=>gn(/px/g,t),yn=kr(mn);kr((t=>gn(RegExp("%","g"),t)));var xn=t=>Ot(t)||isFinite(Number(t))?tn(Number(t)||0,"px"):gn(RegExp("px|%|em|rem","g"),t),En=kr(xn),bn=t=>gn(/deg|rad|grad|turn/g,t),wn=kr(bn);function Mn(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",s=t.value||0,o=e.value||0,l=Hr(t.unit),h=t.convertTo(l),c=e.convertTo(l);return h&&c?(s=h.value,o=c.value,a=Fr(t.unit)):(jr.isLength(t.unit)||jr.isLength(e.unit))&&(s=Pn(t,i,r),o=Pn(e,i,r),a="px"),[s,o,t=>(n&&(t=Math.max(t,0)),t+a)]}function Tn(t){var e=0;return t.unit===Ar.kDegrees?e=t.value:t.unit===Ar.kRadians?e=Ce(Number(t.value)):t.unit===Ar.kTurns?e=ke(Number(t.value)):t.value&&(e=t.value),e}function Nn(t,e){var r;return Array.isArray(t)?r=t.map((t=>Number(t))):At(t)?r=t.split(" ").map((t=>Number(t))):Ot(t)&&(r=[t]),2===e?1===r.length?[r[0],r[0]]:[r[0],r[1]]:1===r.length?[r[0],r[0],r[0],r[0]]:2===r.length?[r[0],r[1],r[0],r[1]]:3===r.length?[r[0],r[1],r[2],r[1]]:[r[0],r[1],r[2],r[3]]}function Pn(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===Ar.kPixels)return Number(t.value);if(t.unit===Ar.kPercentage&&r){var i=r.nodeName===l.GROUP?r.getLocalBounds():r.getGeometryBounds();return(n?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var Sn=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Cn(t){return""+t}var kn=t=>tn("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0),An=kr(kn);function Rn(t,e){return[t,e,Cn]}function On(t,e){return(r,n)=>[r,n,r=>Cn(Rt(r,t,e))]}function Ln(t,e){if(t.length===e.length)return[t,e,t=>t]}
10
+ /*!
11
+ * @antv/g-math
12
+ * @description Geometry util
13
+ * @version 3.0.0
14
+ * @date 10/23/2024, 7:12:37 AM
15
+ * @author AntVis
16
+ * @docs https://g.antv.antgroup.com/
17
+ */function In(t,e,r,n){var i=t-r,a=e-n;return Math.sqrt(i*i+a*a)}function Dn(t,e){var r=Math.min(...t),n=Math.min(...e);return{x:r,y:n,width:Math.max(...t)-r,height:Math.max(...e)-n}}function Gn(t,e,r,n,i,a){return r*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+t}function _n(t,e,r,n,i,a){return r*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+e}function Fn(t,e,r,n,i,a,s){for(var o=function(t,e,r){return Math.atan(-e/t*Math.tan(r))}(r,n,i),l=1/0,h=-1/0,c=[a,s],u=2*-Math.PI;2*Math.PI>=u;u+=Math.PI){var d=o+u;s>a?d>a&&s>d&&c.push(d):d>s&&a>d&&c.push(d)}for(var p=0;c.length>p;p++){var v=Gn(t,0,r,n,i,c[p]);l>v&&(l=v),v>h&&(h=v)}for(var f=function(t,e,r){return Math.atan(e/(t*Math.tan(r)))}(r,n,i),g=1/0,m=-1/0,y=[a,s],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var E=f+x;s>a?E>a&&s>E&&y.push(E):E>s&&a>E&&y.push(E)}for(var b=0;y.length>b;b++){var w=_n(0,e,r,n,i,y[b]);g>w&&(g=w),w>m&&(m=w)}return{x:l,y:g,width:h-l,height:m-g}}function Bn(t,e,r,n){return In(t,e,r,n)}function Vn(t,e,r,n,i){return{x:(1-i)*t+i*r,y:(1-i)*e+i*n}}function Un(t,e,r,n,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*r*i*i*a+n*i*i*i}function Yn(t,e,r,n){var i,a,s,o=-3*t+9*e-9*r+3*n,l=6*t-12*e+6*r,h=3*e-3*t,c=[];if(It(o,0))It(l,0)||0>(i=-h/l)||i>1||c.push(i);else{var u=l*l-4*o*h;It(u,0)?c.push(-l/(2*o)):u>0&&(a=(-l-(s=Math.sqrt(u)))/(2*o),0>(i=(-l+s)/(2*o))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}function Xn(t,e,r,n,i,a,s,o){for(var l=[t,s],h=[e,o],c=Yn(t,r,i,s),u=Yn(e,n,a,o),d=0;c.length>d;d++)l.push(Un(t,r,i,s,c[d]));for(var p=0;u.length>p;p++)h.push(Un(e,n,a,o,u[p]));return Dn(l,h)}function Hn(t){return function(t){if(2>t.length)return 0;for(var e=0,r=0;t.length-1>r;r++){var n=t[r],i=t[r+1];e+=In(n[0],n[1],i[0],i[1])}return e}(t)}function jn(t,e,r,n){var i=1-n;return i*i*t+2*n*i*e+n*n*r}function zn(t,e,r){var n=t+r-2*e;if(It(n,0))return[.5];var i=(t-e)/n;return i>1||0>i?[]:[i]}function Wn(t,e,r,n,i,a){var s=zn(t,r,i)[0],o=zn(e,n,a)[0],l=[t,i],h=[e,a];return void 0!==s&&l.push(jn(t,r,i,s)),void 0!==o&&h.push(jn(e,n,a,o)),Dn(l,h)}function qn(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=ye(t.parsedStyle.d.absolutePath,void 0,Ft(Ft({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Zn(t,e){return t[0]===e[0]&&t[1]===e[1]}function $n(t,e){var r=t.prePoint,n=t.currentPoint,i=t.nextPoint,a=Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),o=Math.acos((a+s-(Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2)))/(2*Math.sqrt(a)*Math.sqrt(s)));if(!o||0===Math.sin(o)||It(o,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-n[1],i[0]-n[0])),h=Math.abs(Math.atan2(i[0]-n[0],i[1]-n[1]));return h=h>Math.PI/2?Math.PI-h:h,{xExtra:Math.cos(o/2-(l=l>Math.PI/2?Math.PI-l:l))*(e/2*(1/Math.sin(o/2)))-e/2||0,yExtra:Math.cos(h-o/2)*(e/2*(1/Math.sin(o/2)))-e/2||0}}function Kn(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}kr((t=>At(t)?t.split(" ").map(An):t.map(An)));var Qn=(t,e)=>(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)))),Jn=(t,e,r,n,i,a,s,o)=>{e=Math.abs(e),r=Math.abs(r);var l=Pe(n=Dt(n,360));if(t.x===s.x&&t.y===s.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===r)return{x:0,y:0,ellipticalArcAngle:0};var h=(t.x-s.x)/2,c=(t.y-s.y)/2,u={x:Math.cos(l)*h+Math.sin(l)*c,y:-Math.sin(l)*h+Math.cos(l)*c},d=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(r,2);d>1&&(e*=Math.sqrt(d),r*=Math.sqrt(d));var p=(Math.pow(e,2)*Math.pow(r,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(r,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(r,2)*Math.pow(u.x,2)),v=(i!==a?1:-1)*Math.sqrt(p=0>p?0:p),f=v*(e*u.y/r),g=v*(-r*u.x/e),m={x:Math.cos(l)*f-Math.sin(l)*g+(t.x+s.x)/2,y:Math.sin(l)*f+Math.cos(l)*g+(t.y+s.y)/2},y={x:(u.x-f)/e,y:(u.y-g)/r},x=Qn({x:1,y:0},y),E=Qn(y,{x:(-u.x-f)/e,y:(-u.y-g)/r});!a&&E>0?E-=2*Math.PI:a&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*o,w=e*Math.cos(b),M=r*Math.sin(b);return{x:Math.cos(l)*w-Math.sin(l)*M+m.x,y:Math.sin(l)*w+Math.cos(l)*M+m.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:m,resultantRx:e,resultantRy:r}};function ti(t,e){var r=2>=arguments.length||void 0===arguments[2]||arguments[2],n=t.arcParams,i=n.rx,a=void 0===i?0:i,s=n.ry,o=void 0===s?0:s,l=n.xRotation,h=n.arcFlag,c=n.sweepFlag,u=Jn({x:t.prePoint[0],y:t.prePoint[1]},a,o,l,!!h,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=Jn({x:t.prePoint[0],y:t.prePoint[1]},a,o,l,!!h,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},r?e+.005:e-.005),p=d.x-u.x,v=d.y-u.y,f=Math.sqrt(p*p+v*v);return{x:-p/f,y:-v/f}}function ei(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ri(t,e){return ei(t)*ei(e)?(t[0]*e[0]+t[1]*e[1])/(ei(t)*ei(e)):1}function ni(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(ri(t,e))}function ii(t,e){var r=e[1],n=e[2],i=Dt(Pe(e[3]),2*Math.PI),a=e[4],s=e[5],o=t[0],l=t[1],h=e[6],c=e[7],u=Math.cos(i)*(o-h)/2+Math.sin(i)*(l-c)/2,d=-1*Math.sin(i)*(o-h)/2+Math.cos(i)*(l-c)/2,p=u*u/(r*r)+d*d/(n*n);p>1&&(r*=Math.sqrt(p),n*=Math.sqrt(p));var v=r*r*(d*d)+n*n*(u*u),f=v?Math.sqrt((r*r*(n*n)-v)/v):1;a===s&&(f*=-1),isNaN(f)&&(f=0);var g=n?f*r*d/n:0,m=r?f*-n*u/r:0,y=(o+h)/2+Math.cos(i)*g-Math.sin(i)*m,x=(l+c)/2+Math.sin(i)*g+Math.cos(i)*m,E=[(u-g)/r,(d-m)/n],b=[(-1*u-g)/r,(-1*d-m)/n],w=ni([1,0],E),M=ni(E,b);return ri(E,b)>-1||(M=Math.PI),1>ri(E,b)||(M=0),0===s&&M>0&&(M-=2*Math.PI),1===s&&0>M&&(M+=2*Math.PI),{cx:y,cy:x,rx:Zn(t,[h,c])?0:r,ry:Zn(t,[h,c])?0:n,startAngle:w,endAngle:w+M,xRotation:i,arcFlag:a,sweepFlag:s}}function ai(t,e,r,n){var i=.5522847498307936,a=t*i,s=e*i,o=r-t,l=r+t,h=n-e,c=n+e;return[["M",o,n],["C",o,n-s,r-a,h,r,h],["C",r+a,h,l,n-s,l,n],["C",l,n+s,r+a,c,r,c],["C",r-a,c,o,n+s,o,n],["Z"]]}var si=t=>{if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=re(t)}catch(r){e=re(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var r=t[e-1],n=t[e];if("M"===n[0]&&r){var i=r[0],a=void 0;"L"===i||"M"===i?a=[r[1],r[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[r[r.length-2],r[r.length-1]]),a&&Zn([n[1],n[2]],a)&&(t.splice(e,1),e--)}}}(e);var r=function(t){for(var e=!1,r=t.length,n=0;r>n;n++){var i=t[n][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),n=function(t){for(var e=[],r=[],n=[],i=0;t.length>i;i++){var a=t[i],s=a[0];"M"===s?(n.length&&(r.push(n),n=[]),n.push([a[1],a[2]])):"Z"===s?n.length&&(e.push(n),n=[]):n.push([a[1],a[2]])}return n.length>0&&r.push(n),{polygons:e,polylines:r}}(e),i=n.polygons,a=n.polylines,s=function(t){for(var e=[],r=null,n=null,i=null,a=0,s=t.length,o=0;s>o;o++){var l=t[o];n=t[o+1];var h=l[0],c={command:h,prePoint:r,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(h){case"M":i=[l[1],l[2]],a=o;break;case"A":var u=ii(r,l);c.arcParams=u}if("Z"===h)r=i,n=t[a+1];else{var d=l.length;r=[l[d-2],l[d-1]]}n&&"Z"===n[0]&&(n=t[a],e[a]&&(e[a].prePoint=r)),c.currentPoint=r,e[a]&&Zn(r,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=n?[n[n.length-2],n[n.length-1]]:null;var p=c.prePoint;if(["L","H","V"].includes(h))c.startTangent=[p[0]-r[0],p[1]-r[1]],c.endTangent=[r[0]-p[0],r[1]-p[1]];else if("Q"===h){var v=[l[1],l[2]];c.startTangent=[p[0]-v[0],p[1]-v[1]],c.endTangent=[r[0]-v[0],r[1]-v[1]]}else if("T"===h){var f=e[o-1],g=Kn(f.currentPoint,p);"Q"===f.command?(c.command="Q",c.startTangent=[p[0]-g[0],p[1]-g[1]],c.endTangent=[r[0]-g[0],r[1]-g[1]]):(c.command="TL",c.startTangent=[p[0]-r[0],p[1]-r[1]],c.endTangent=[r[0]-p[0],r[1]-p[1]])}else if("C"===h){var m=[l[1],l[2]],y=[l[3],l[4]];c.startTangent=[p[0]-m[0],p[1]-m[1]],c.endTangent=[r[0]-y[0],r[1]-y[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[m[0]-y[0],m[1]-y[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[y[0]-m[0],y[1]-m[1]])}else if("S"===h){var x=e[o-1],E=Kn(x.currentPoint,p),b=[l[1],l[2]];"C"===x.command?(c.command="C",c.startTangent=[p[0]-E[0],p[1]-E[1]],c.endTangent=[r[0]-b[0],r[1]-b[1]]):(c.command="SQ",c.startTangent=[p[0]-b[0],p[1]-b[1]],c.endTangent=[r[0]-b[0],r[1]-b[1]])}else if("A"===h){var w=ti(c,0),M=w.x,T=w.y,N=ti(c,1,!1),P=N.x,S=N.y;c.startTangent=[M,T],c.endTangent=[P,S]}e.push(c)}return e}(e),o=function(t,e){for(var r=[],n=[],i=[],a=0;t.length>a;a++){var s=t[a],o=s.currentPoint,l=s.params,h=s.prePoint,c=void 0;switch(s.command){case"Q":c=Wn(h[0],h[1],l[1],l[2],l[3],l[4]);break;case"C":c=Xn(h[0],h[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var u=s.arcParams;c=Fn(u.cx,u.cy,u.rx,u.ry,u.xRotation,u.startAngle,u.endAngle);break;default:r.push(o[0]),n.push(o[1])}c&&(s.box=c,r.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)),e&&("L"===s.command||"M"===s.command)&&s.prePoint&&s.nextPoint&&i.push(s)}r=r.filter((t=>!Number.isNaN(t)&&t!==1/0&&t!==-1/0)),n=n.filter((t=>!Number.isNaN(t)&&t!==1/0&&t!==-1/0));var d=kt(r),p=kt(n),v=Ct(r),f=Ct(n);if(0===i.length)return{x:d,y:p,width:v-d,height:f-p};for(var g=0;i.length>g;g++){var m=i[g],y=m.currentPoint;y[0]===d?d-=$n(m,e).xExtra:y[0]===v&&(v+=$n(m,e).xExtra),y[1]===p?p-=$n(m,e).yExtra:y[1]===f&&(f+=$n(m,e).yExtra)}return{x:d,y:p,width:v-d,height:f-p}}(s,0),l=o.x,h=o.y,c=o.width,u=o.height;return{absolutePath:e,hasArc:r,segments:s,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(h)?h:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(u)?u:0}}},oi=kr(si);function li(t){return At(t)?oi(t):si(t)}function hi(t,e,r){var n=t.curve,i=e.curve;n&&0!==n.length||(n=le(t.absolutePath,!1),t.curve=n),i&&0!==i.length||(i=le(e.absolutePath,!1),e.curve=i);var a=[n,i];n.length!==i.length&&(a=be(n,i));var s,o,l,h,c,u,d,p,v=xe(a[0])!==xe(a[1])?(o=(s=a[0]).slice(1).map((function(t,e,r){return e?r[e-1].slice(-2).concat(t.slice(1)):s[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,r){return t[t.length-r-2*(1-r%2)]}))})).reverse(),[["M"].concat(o[0].slice(0,2))].concat(o.map((function(t){return["C"].concat(t.slice(2))})))):a[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[v,(l=a[1],h=v,c=l.length-1,u=[],d=0,p=function(t){var e=t.length,r=e-1;return t.map((function(n,i){return t.map((function(n,a){var s=i+a;return 0===a||t[s]&&"M"===t[s][0]?["M"].concat(t[s].slice(-2)):(e>s||(s-=r),t[s])}))}))}(l),p.forEach((function(t,e){l.slice(1).forEach((function(t,r){d+=he(l[(e+r)%c].slice(-2),h[r%c].slice(-2))})),u[e]=d,d=0})),p[u.indexOf(Math.min.apply(null,u))]),t=>t]}function ci(t,e){return[t.points,e.points,t=>t]}var ui=null,di=/\s*(\w+)\(([^)]*)\)/g;function pi(t){return function(e){var r=0;return t.map((t=>t===ui?e[r++]:t))}}function vi(t){return t}var fi={matrix:["NNNNNN",[ui,ui,0,0,ui,ui,0,0,0,0,1,0,ui,ui,0,1],vi],matrix3d:["NNNNNNNNNNNNNNNN",vi],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",pi([ui,ui,new jr(1)]),vi],scaleX:["N",pi([ui,new jr(1),new jr(1)]),pi([ui,new jr(1)])],scaleY:["N",pi([new jr(1),ui,new jr(1)]),pi([new jr(1),ui])],scaleZ:["N",pi([new jr(1),new jr(1),ui])],scale3d:["NNN",vi],skew:["Aa",null,vi],skewX:["A",null,pi([ui,Wr])],skewY:["A",null,pi([Wr,ui])],translate:["Tt",pi([ui,ui,zr]),vi],translateX:["T",pi([ui,zr,zr]),pi([ui,zr])],translateY:["T",pi([zr,ui,zr]),pi([zr,ui])],translateZ:["L",pi([zr,zr,ui])],translate3d:["TTL",vi]};function gi(t){for(var e=[],r=t.length,n=0;r>n;n++){var i=t[n],a=i[0],s=i.slice(1);if("translate"===a||"skew"===a?1===s.length&&s.push(0):"scale"===a&&1===s.length&&s.push(s[0]),!fi[a])return[];var o=s.map((t=>tn(t)));e.push({t:a,d:o})}return e}function mi(t){if(Array.isArray(t))return gi(t);if("none"===(t=(t||"none").trim()))return[];var e,r=[],n=0;for(di.lastIndex=0;e=di.exec(t);){if(e.index!==n)return[];n=e.index+e[0].length;var i=e[1],a=fi[i];if(!a)return[];var s=e[2].split(","),o=a[0];if(s.length>o.length)return[];for(var l=[],h=0;o.length>h;h++){var c=s[h],u=o[h],d=void 0;if(void 0===(d=c?{A:t=>"0"===t.trim()?Wr:wn(t),N:An,T:En,L:yn}[u.toUpperCase()](c):{a:Wr,n:l[0],t:zr}[u]))return[];l.push(d)}if(r.push({t:i,d:l}),di.lastIndex===t.length)return r}return[]}function yi(t){if(Array.isArray(t))return gi(t);if("none"===(t=(t||"none").trim()))return[];var e,r=[],n=0;for(di.lastIndex=0;e=di.exec(t);){if(e.index!==n)return[];n=e.index+e[0].length;var i=e[1],a=fi[i];if(!a)return[];var s=e[2].split(","),o=a[0];if(s.length>o.length)return[];for(var l=[],h=0;o.length>h;h++){var c=s[h],u=o[h],d=void 0;if(void 0===(d=c?{A:t=>"0"===t.trim()?Wr:bn(t),N:kn,T:xn,L:mn}[u.toUpperCase()](c):{a:Wr,n:l[0],t:zr}[u]))return[];l.push(d)}if(r.push({t:i,d:l}),di.lastIndex===t.length)return r}return[]}function xi(t){var e,r,n,i;switch(t.t){case"rotateX":return i=Pe(Tn(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=Pe(Tn(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=Pe(Tn(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,r=t.d[1].value,n=t.d[2].value,i=Pe(Tn(t.d[3]));var a=e*e+r*r+n*n;if(0===a)e=1,r=0,n=0;else if(1!==a){var s=Math.sqrt(a);e/=s,r/=s,n/=s}var o=Math.sin(i/2),l=o*Math.cos(i/2),h=o*o;return[1-2*(r*r+n*n)*h,2*(e*r*h+n*l),2*(e*n*h-r*l),0,2*(e*r*h-n*l),1-2*(e*e+n*n)*h,2*(r*n*h+e*l),0,2*(e*n*h+r*l),2*(r*n*h-e*l),1-2*(e*e+r*r)*h,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=Pe(Tn(t.d[0])),u=Pe(Tn(t.d[1]));return[1,Math.tan(u),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=Pe(Tn(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=Pe(Tn(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Pn(t.d[0],0,null)||0,r=Pn(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Pn(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,r=Pn(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,n=Pn(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Pn(t.d[0],0,null)||0,r=Pn(t.d[1],0,null)||0,n=Pn(t.d[2],0,null)||0,1];case"perspective":var d=Pn(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,d?-1/d:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((t=>t.value))}}function Ei(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function bi(t){var e=[0,0,0],r=[1,1,1],n=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,r,n,i,a){if(!function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;16>i;i++)t[i]=e[i]*n;return!0}(Ie,t))return!1;if(x(De,Ie),De[3]=0,De[7]=0,De[11]=0,De[15]=1,1e-8>Math.abs(function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],s=t[5],o=t[6],l=t[7],h=t[8],c=t[9],u=t[10],d=t[11],p=t[12],v=t[13],f=t[14],g=t[15];return(e*s-r*a)*(u*g-d*f)-(e*o-n*a)*(c*g-d*v)+(e*l-i*a)*(c*f-u*v)+(r*o-n*s)*(h*g-d*p)-(r*l-i*s)*(h*f-u*p)+(n*l-i*o)*(h*v-c*p)}(De)))return!1;var s,o,l=Ie[3],h=Ie[7],c=Ie[11],u=Ie[12],d=Ie[13],p=Ie[14],v=Ie[15];if(0!==l||0!==h||0!==c){if(Ge[0]=l,Ge[1]=h,Ge[2]=c,Ge[3]=v,!w(De,De))return!1;!function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],s=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=s,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]}(De,De),K(i,Ge,De)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=u,e[1]=d,e[2]=p,(s=_e)[0][0]=(o=Ie)[0],s[0][1]=o[1],s[0][2]=o[2],s[1][0]=o[4],s[1][1]=o[5],s[1][2]=o[6],s[2][0]=o[8],s[2][1]=o[9],s[2][2]=o[10],r[0]=D(_e[0]),Y(_e[0],_e[0]),n[0]=X(_e[0],_e[1]),Be(_e[1],_e[1],_e[0],1,-n[0]),r[1]=D(_e[1]),Y(_e[1],_e[1]),n[0]/=r[1],n[1]=X(_e[0],_e[2]),Be(_e[2],_e[2],_e[0],1,-n[1]),n[2]=X(_e[1],_e[2]),Be(_e[2],_e[2],_e[1],1,-n[2]),r[2]=D(_e[2]),Y(_e[2],_e[2]),n[1]/=r[2],n[2]/=r[2],H(Fe,_e[1],_e[2]),0>X(_e[0],Fe))for(var f=0;3>f;f++)r[f]*=-1,_e[f][0]*=-1,_e[f][1]*=-1,_e[f][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+_e[0][0]-_e[1][1]-_e[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-_e[0][0]+_e[1][1]-_e[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-_e[0][0]-_e[1][1]+_e[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+_e[0][0]+_e[1][1]+_e[2][2],0)),_e[2][1]>_e[1][2]&&(a[0]=-a[0]),_e[0][2]>_e[2][0]&&(a[1]=-a[1]),_e[1][0]>_e[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(xi).reduce(Ei)}(t),e,r,n,i,a),[[e,r,n,a,i]]}var wi=function(){function t(t,e){for(var r=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],n=0;4>n;n++)for(var i=0;4>i;i++)for(var a=0;4>a;a++)r[n][i]+=e[n][a]*t[a][i];return r}return function(e,r,n,i,a){for(var s=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;4>o;o++)s[o][3]=a[o];for(var l=0;3>l;l++)for(var h=0;3>h;h++)s[3][l]+=e[h]*s[h][l];var c=i[0],u=i[1],d=i[2],p=i[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(u*u+d*d),v[0][1]=2*(c*u-d*p),v[0][2]=2*(c*d+u*p),v[1][0]=2*(c*u+d*p),v[1][1]=1-2*(c*c+d*d),v[1][2]=2*(u*d-c*p),v[2][0]=2*(c*d-u*p),v[2][1]=2*(u*d+c*p),v[2][2]=1-2*(c*c+u*u),s=t(s,v);var f,g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];n[2]&&(g[2][1]=n[2],s=t(s,g)),n[1]&&(g[2][1]=0,g[2][0]=n[0],s=t(s,g)),n[0]&&(g[2][0]=0,g[1][0]=n[0],s=t(s,g));for(var m=0;3>m;m++)for(var y=0;3>y;y++)s[m][y]*=r[m];return 0===(f=s)[0][2]&&0===f[0][3]&&0===f[1][2]&&0===f[1][3]&&0===f[2][0]&&0===f[2][1]&&1===f[2][2]&&0===f[2][3]&&0===f[3][2]&&1===f[3][3]?[s[0][0],s[0][1],s[1][0],s[1][1],s[3][0],s[3][1]]:s[0].concat(s[1],s[2],s[3])}}();function Mi(t){return t.toFixed(6).replace(".000000","")}function Ti(t,e){var r,n;return t.decompositionPair!==e&&(t.decompositionPair=e,r=bi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,n=bi(e)),null===r[0]||null===n[0]?[[!1],[!0],r=>r?e[0].d:t[0].d]:(r[0].push(0),n[0].push(1),[r,n,t=>{var e=function(t,e,r){var n=function(t,e){for(var r=0,n=0;t.length>n;n++)r+=t[n]*e[n];return r}(t,e);n=Rt(n,-1,1);var i=[];if(1===n)i=t;else for(var a=Math.acos(n),s=1*Math.sin(r*a)/Math.sqrt(1-n*n),o=0;4>o;o++)i.push(t[o]*(Math.cos(r*a)-n*s)+e[o]*s);return i}(r[0][3],n[0][3],t[5]);return wi(t[0],t[1],t[2],e,t[4]).map(Mi).join(",")}])}function Ni(t){return t.replace(/[XY]/,"")}function Pi(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function Si(t,e,r){var n=!1;if(!t.length||!e.length){t.length||(n=!0,t=e,e=[]);for(var i=function(){var r=t[a],n=r.t,i=r.d,s="scale"===n.substring(0,5)?1:0;e.push({t:n,d:i.map((t=>"number"==typeof t?tn(s):tn(s,t.unit)))})},a=0;t.length>a;a++)i()}var s,o,l=[],h=[],c=[];if(t.length!==e.length){var u=Ti(t,e);l=[u[0]],h=[u[1]],c=[["matrix",[u[2]]]]}else for(var d=0;t.length>d;d++){var p=t[d].t,v=e[d].t,f=t[d].d,g=e[d].d,m=fi[p],y=fi[v],x=void 0;if(o=v,"perspective"===(s=p)&&"perspective"===o||!("matrix"!==s&&"matrix3d"!==s||"matrix"!==o&&"matrix3d"!==o)){var E=Ti([t[d]],[e[d]]);l.push(E[0]),h.push(E[1]),c.push(["matrix",[E[2]]])}else{if(p===v)x=p;else if(m[2]&&y[2]&&Ni(p)===Ni(v))x=Ni(p),f=m[2](f),g=y[2](g);else{if(!m[1]||!y[1]||Pi(p)!==Pi(v)){var b=Ti(t,e);l=[b[0]],h=[b[1]],c=[["matrix",[b[2]]]];break}x=Pi(p),f=m[1](f),g=y[1](g)}for(var w=[],M=[],T=[],N=0;f.length>N;N++){var P=Mn(f[N],g[N],r,!1,N);w[N]=P[0],M[N]=P[1],T.push(P[2])}l.push(w),h.push(M),c.push([x,T])}}if(n){var S=l;l=h,h=S}return[l,h,t=>t.map(((t,e)=>{var r=t.map(((t,r)=>c[e][1][r](t))).join(",");return"matrix"===c[e][0]&&16===r.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===r.split(",").length&&(c[e][0]="matrix"),"".concat(c[e][0],"(").concat(r,")")})).join(" ")]}var Ci=kr((t=>{if(At(t)){if("text-anchor"===t)return[tn(0,"px"),tn(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[En(ki(e[0])),En(ki(e[1]))]}return[tn(t[0]||0,"px"),tn(t[1]||0,"px")]}));function ki(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var Ai=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Ze.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Ze.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Ze.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Ze.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Ze.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Ze.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Ze.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Ze.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Ze.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:Ze.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Ze.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Ze.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Ze.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Ze.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:Ze.FILTER},{n:"clipPath",syntax:Ze.DEFINED_PATH},{n:"textPath",syntax:Ze.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Ze.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Ze.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Ze.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Ze.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Ze.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Ze.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Ze.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Ze.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Ze.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Ze.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Ze.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Ze.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Ze.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Ze.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Ze.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Ze.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Ze.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Ze.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Ze.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Ze.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Ze.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:Ze.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Ze.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Ze.NUMBER,d:t=>t===l.PATH||t===l.POLYGON||t===l.POLYLINE?"4":"10"},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:Ze.MARKER},{n:"markerEnd",syntax:Ze.MARKER},{n:"markerMid",syntax:Ze.MARKER},{n:"markerStartOffset",syntax:Ze.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Ze.LENGTH,l:!0,int:!0,d:"0"}],Ri=Ai.filter((t=>!!t.l)).map((t=>t.n)),Oi={};class Li{constructor(){this.mixer=Rn}calculator(t,e,r,n){return Tn(r)}}class Ii{calculator(t,e,r,n,i){return r instanceof Xr&&(r=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,r,n),"clipPath"===t&&n.forEach((t=>{0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),r}}class Di{constructor(){this.parser=vn,this.mixer=fn}calculator(t,e,r,n){return r instanceof Xr?"none"===r.value?Kr:Qr:r}}class Gi{calculator(t,e,r){return r instanceof Xr?[]:r}}function _i(t){var e=t.parsedStyle.fontSize;return Tt(e)?null:e}class Fi{constructor(){this.mixer=Rn}calculator(t,e,r,n,i){if(Ot(r))return r;if(!jr.isRelativeUnit(r.unit))return r.value;if(r.unit===Ar.kPercentage)return 0;if(r.unit===Ar.kEms){if(n.parentNode){var a=_i(n.parentNode);if(a)return a*=r.value}return 0}if(r.unit===Ar.kRems){var s;if(null!=n&&null!==(s=n.ownerDocument)&&void 0!==s&&s.documentElement){var o=_i(n.ownerDocument.documentElement);if(o)return o*=r.value}return 0}}}class Bi{constructor(){this.mixer=Ln}calculator(t,e,r){return r.map((t=>t.value))}}class Vi{constructor(){this.mixer=Ln}calculator(t,e,r){return r.map((t=>t.value))}}class Ui{calculator(t,e,r,n){var i;r instanceof Xr&&(r=null);var a=null===(i=r)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}class Yi{constructor(){this.mixer=Rn}calculator(t,e,r){return r.value}}class Xi{constructor(){this.mixer=On(0,1)}calculator(t,e,r){return r.value}postProcessor(t){var e=t.parsedStyle,r=e.offsetPath;if(r){var n=r.nodeName;if(n===l.LINE||n===l.PATH||n===l.POLYLINE){var i=r.getPoint(e.offsetDistance);i&&t.setLocalPosition(i.x,i.y)}}}}class Hi{constructor(){this.mixer=On(0,1)}calculator(t,e,r){return r.value}}class ji{constructor(){this.parser=li,this.mixer=hi}calculator(t,e,r){return r instanceof Xr&&"unset"===r.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Et(0,0,0,0)}:r}}class zi{constructor(){this.mixer=ci}}class Wi extends Fi{constructor(){super(...arguments),this.mixer=On(0,1/0)}}class qi{calculator(t,e,r,n){return r instanceof Xr?"unset"===r.value?"":r.value:"".concat(r)}postProcessor(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}class Zi{calculator(t,e,r,n){var i=n.getAttribute("text");if(i){var a=i;"capitalize"===r.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===r.value?a=i.toLowerCase():"uppercase"===r.value&&(a=i.toUpperCase()),n.parsedStyle.text=a}return r.value}}var $i=new WeakMap;function Ki(t,e,r){if(t){var n="string"==typeof t?document.getElementById(t):t;$i.has(n)?$i.get(n).destroy(r):$i.set(n,e)}}var Qi="undefined"!=typeof window&&void 0!==window.document;function Ji(t){return!!t.getAttribute}function ta(t,e){var r=Number(t.parsedStyle.zIndex||0),n=Number(e.parsedStyle.zIndex||0);if(r===n){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return r-n}function ea(t){var e=t;do{var r;if(null===(r=e.parsedStyle)||void 0===r?void 0:r.clipPath)return e;e=e.parentElement}while(null!==e);return null}function ra(t,e){if(Qi)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var na={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},ia="object"==typeof performance&&performance.now?performance:Date;function aa(t){return t.nodeName===l.FRAGMENT||t.getRootNode().nodeName===l.FRAGMENT}var sa=1,oa="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},la=Date.now(),ha={},ca=Date.now(),ua=t=>{if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),r=e-ca,n=r>16?0:16-r,i=sa++;return ha[i]=t,Object.keys(ha).length>1||setTimeout((()=>{ca=e;var t=ha;ha={},Object.keys(t).forEach((e=>t[e](oa.performance&&"function"==typeof oa.performance.now?oa.performance.now():Date.now()-la)))}),n),i},da=t=>{delete ha[t]},pa=t=>"string"!=typeof t?ua:""===t?oa.requestAnimationFrame:oa["".concat(t,"RequestAnimationFrame")],va=((t,e)=>{for(var r=0;void 0!==t[r];){if(e(t[r]))return t[r];r+=1}})(["","webkit","moz","ms","o"],(t=>!!pa(t))),fa=pa(va),ga=(t=>"string"!=typeof t?da:""===t?oa.cancelAnimationFrame:oa["".concat(t,"CancelAnimationFrame")]||oa["".concat(t,"CancelRequestAnimationFrame")])(va);oa.requestAnimationFrame=fa,oa.cancelAnimationFrame=ga;class ma{constructor(){this.callbacks=[]}getCallbacksNum(){return this.callbacks.length}tapPromise(t,e){this.callbacks.push(e)}promise(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return Promise.all(this.callbacks.map((t=>t(...e))))}}function ya(){ya=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",h=s.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=Object.create((e&&e.prototype instanceof y?e:y).prototype),s=new R(n||[]);return a(i,"_invoke",{value:S(t,r,s)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var p="suspendedStart",v="suspendedYield",f="executing",g="completed",m={};function y(){}function x(){}function E(){}var b={};c(b,o,(function(){return this}));var w=Object.getPrototypeOf,M=w&&w(w(O([])));M&&M!==r&&i.call(M,o)&&(b=M);var T=E.prototype=y.prototype=Object.create(b);function N(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(a,s,o,l){var h=d(t[a],t,s);if("throw"!==h.type){var c=h.arg,u=c.value;return u&&"object"==n(u)&&i.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,l)}),(function(t){r("throw",t,o,l)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,l)}))}l(h.arg)}var s;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function S(e,r,n){var i=p;return function(a,s){if(i===f)throw Error("Generator is already running");if(i===g){if("throw"===a)throw s;return{value:t,done:!0}}for(n.method=a,n.arg=s;;){var o=n.delegate;if(o){var l=C(o,n);if(l){if(l===m)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var h=d(e,r,n);if("normal"===h.type){if(i=n.done?g:v,h.arg===m)continue;return{value:h.arg,done:n.done}}"throw"===h.type&&(i=g,n.method="throw",n.arg=h.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var s=a.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function O(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,s=function r(){for(;++a<e.length;)if(i.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(n(e)+" is not iterable")}return x.prototype=E,a(T,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:x,configurable:!0}),x.displayName=c(E,h,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,c(t,h,"GeneratorFunction")),t.prototype=Object.create(T),t},e.awrap=function(t){return{__await:t}},N(P.prototype),c(P.prototype,l,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var s=new P(u(t,r,n,i),a);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},N(T),c(T,h,"Generator"),c(T,o,(function(){return this})),c(T,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=O,R.prototype={constructor:R,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(A),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function n(n,i){return o.type="throw",o.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return n("end");if(this.prev>=s.tryLoc){var l=i.call(s,"catchLoc"),h=i.call(s,"finallyLoc");if(l&&h){if(s.catchLoc>this.prev)return n(s.catchLoc,!0);if(s.finallyLoc>this.prev)return n(s.finallyLoc)}else if(l){if(s.catchLoc>this.prev)return n(s.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(s.finallyLoc>this.prev)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(this.prev>=n.tryLoc&&i.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var a=n;break}}a&&("break"===t||"continue"===t)&&e>=a.tryLoc&&a.finallyLoc>=e&&(a=null);var s=a?a.completion:{};return s.type=t,s.arg=e,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(s)},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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function xa(t,e,r,n,i,a,s){try{var o=t[a](s),l=o.value}catch(t){return void r(t)}o.done?e(l):Promise.resolve(l).then(n,i)}function Ea(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function s(t){xa(a,n,i,s,o,"next",t)}function o(t){xa(a,n,i,s,o,"throw",t)}s(void 0)}))}}class ba{constructor(){this.callbacks=[]}tapPromise(t,e){this.callbacks.push(e)}promise(){var t=arguments,e=this;return Ea(ya().mark((function r(){var n,i,a;return ya().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.callbacks.length){r.next=14;break}return r.next=3,e.callbacks[0](...t);case 3:n=r.sent,i=0;case 5:if(e.callbacks.length-1<=i){r.next=13;break}return a=e.callbacks[i],r.next=9,a(n);case 9:n=r.sent;case 10:i++,r.next=5;break;case 13:return r.abrupt("return",n);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r)})))()}}class wa{constructor(){this.callbacks=[]}tap(t,e){this.callbacks.push(e)}call(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var n=arguments;this.callbacks.forEach((function(t){t.apply(void 0,n)}))}}class Ma{constructor(){this.callbacks=[]}tap(t,e){this.callbacks.push(e)}call(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];if(this.callbacks.length){for(var n=this.callbacks[0].apply(void 0,arguments),i=0;this.callbacks.length-1>i;i++){n=(0,this.callbacks[i])(n)}return n}return null}}var Ta=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Na=/([\"\'])[^\'\"]+\1/;function Pa(t,e,r){return b(t),t[4]=Math.tan(e),t[1]=Math.tan(r),t}var Sa=y(),Ca=y(),ka={scale:t=>{P(Sa,[t[0].value,t[1].value,1])},scaleX:t=>{P(Sa,[t[0].value,1,1])},scaleY:t=>{P(Sa,[1,t[0].value,1])},scaleZ:t=>{P(Sa,[1,1,t[0].value])},scale3d:t=>{P(Sa,[t[0].value,t[1].value,t[2].value])},translate:t=>{N(Sa,[t[0].value,t[1].value,0])},translateX:t=>{N(Sa,[t[0].value,0,0])},translateY:t=>{N(Sa,[0,t[0].value,0])},translateZ:t=>{N(Sa,[0,0,t[0].value])},translate3d:t=>{N(Sa,[t[0].value,t[1].value,t[2].value])},rotate:t=>{S(Sa,Pe(Tn(t[0])))},rotateX:t=>{var e,r,n,i;e=Sa,r=Pe(Tn(t[0])),n=Math.sin(r),i=Math.cos(r),e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1},rotateY:t=>{var e,r,n,i;e=Sa,r=Pe(Tn(t[0])),n=Math.sin(r),e[0]=i=Math.cos(r),e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1},rotateZ:t=>{S(Sa,Pe(Tn(t[0])))},rotate3d:t=>{!function(t,e,r){var n,i,a,s=r[0],o=r[1],l=r[2],h=Math.hypot(s,o,l);f>h||(s*=h=1/h,o*=h,l*=h,n=Math.sin(e),t[0]=s*s*(a=1-(i=Math.cos(e)))+i,t[1]=o*s*a+l*n,t[2]=l*s*a-o*n,t[3]=0,t[4]=s*o*a-l*n,t[5]=o*o*a+i,t[6]=l*o*a+s*n,t[7]=0,t[8]=s*l*a+o*n,t[9]=o*l*a-s*n,t[10]=l*l*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1)}(Sa,Pe(Tn(t[3])),[t[0].value,t[1].value,t[2].value])},skew:t=>{Pa(Sa,Pe(t[0].value),Pe(t[1].value))},skewX:t=>{Pa(Sa,Pe(t[0].value),0)},skewY:t=>{Pa(Sa,0,Pe(t[0].value))},matrix:t=>{E(Sa,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:t=>{E(Sa,...t.map((t=>t.value)))}},Aa=G(1,1,1),Ra=I(),Oa={translate:(t,e)=>{_s.sceneGraphService.setLocalScale(t,Aa,!1),_s.sceneGraphService.setLocalEulerAngles(t,Ra,void 0,void 0,!1),_s.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),_s.sceneGraphService.dirtifyLocal(t,t.transformable)}};function La(t,e){if(t.length){if(1===t.length&&Oa[t[0].t])return void Oa[t[0].t](e,t[0].d);for(var r=b(Ca),n=0;t.length>n;n++){var i=t[n],a=ka[i.t];a&&(a(i.d),L(r,r,Sa))}e.setLocalTransform(r)}else e.resetLocalTransform();return e.getLocalTransform()}class Ia{constructor(){this.parser=yi,this.mixer=Si}calculator(t,e,r,n){return r instanceof Xr?[]:r}postProcessor(t){La(t.parsedStyle.transform,t)}}class Da{postProcessor(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Ar.kPixels&&e[1].unit===Ar.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}class Ga{calculator(t,e,r,n){return r.value}postProcessor(t){if(t.parentNode){var e=t.parentNode,r=e.renderable,n=e.sortable;r&&(r.dirty=!0),n&&(n.dirty=!0,n.dirtyReason=We.Z_INDEX_CHANGED)}}}class _a{update(t,e){var r=t.cx,n=t.cy,i=t.r,a=void 0===i?0:i;return{cx:void 0===r?0:r,cy:void 0===n?0:n,hwidth:a,hheight:a}}}class Fa{update(t,e){var r=t.cx,n=t.cy,i=t.rx,a=t.ry;return{cx:void 0===r?0:r,cy:void 0===n?0:n,hwidth:void 0===i?0:i,hheight:void 0===a?0:a}}}class Ba{update(t){var e=t.x1,r=t.y1,n=t.x2,i=t.y2,a=Math.min(e,n),s=Math.max(e,n),o=Math.min(r,i),l=(s-a)/2,h=(Math.max(r,i)-o)/2;return{cx:a+l,cy:o+h,hwidth:l,hheight:h}}}class Va{update(t){var e=t.d.rect,r=e.width/2,n=e.height/2;return{cx:e.x+r,cy:e.y+n,hwidth:r,hheight:n}}}class Ua{update(t){if(t.points&&St(t.points.points)){var e=t.points.points,r=Math.min(...e.map((t=>t[0]))),n=Math.max(...e.map((t=>t[0]))),i=Math.min(...e.map((t=>t[1]))),a=(n-r)/2,s=(Math.max(...e.map((t=>t[1])))-i)/2;return{cx:r+a,cy:i+s,hwidth:a,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}}}class Ya{update(t,e){var r=t.x,n=void 0===r?0:r,i=t.y,a=void 0===i?0:i,s=t.src,o=t.width,l=t.height,h=void 0===o?0:o,c=void 0===l?0:l;return s&&!At(s)&&(h||(t.width=h=s.width),c||(t.height=c=s.height)),{cx:n+h/2,cy:a+c/2,hwidth:h/2,hheight:c/2}}}class Xa{constructor(t){this.globalRuntime=t}isReadyToMeasure(t,e){return t.text}update(t,e){var r,n=t.text,i=t.textAlign,a=void 0===i?"start":i,s=t.lineWidth,o=void 0===s?1:s,l=t.textBaseline,h=void 0===l?"alphabetic":l,c=t.dx,u=void 0===c?0:c,d=t.dy,p=void 0===d?0:d,v=t.x,f=void 0===v?0:v,g=t.y,m=void 0===g?0:g;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var y=(null==e||null===(r=e.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.getConfig())||{},x=this.globalRuntime.textService.measureText(n,t,y.offscreenCanvas);t.metrics=x;var E=x.width/2,b=x.height/2,w=f+E;"center"===a||"middle"===a?w+=o/2-E:"right"!==a&&"end"!==a||(w+=o-2*E);var M=m-b;return"middle"===h?M+=b:"top"===h||"hanging"===h?M+=2*b:"alphabetic"===h||"bottom"!==h&&"ideographic"!==h||(M+=0),u&&(w+=u),p&&(M+=p),{cx:w,cy:M,hwidth:E,hheight:b}}}class Ha{update(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}class ja{update(t,e){var r=t.x,n=t.y,i=t.width,a=void 0===i?0:i,s=t.height,o=void 0===s?0:s;return{cx:(void 0===r?0:r)+a/2,cy:(void 0===n?0:n)+o/2,hwidth:a/2,hheight:o/2}}}class za{get name(){return this.type}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewportX(){return this.viewport.x}get viewportY(){return this.viewport.y}constructor(t){this.eventPhase=za.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new xt,this.page=new xt,this.canvas=new xt,this.viewport=new xt,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}get propagationPath(){return this.composedPath()}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw Error(bt)}}class Wa extends za{constructor(){super(...arguments),this.client=new xt,this.movement=new xt,this.offset=new xt,this.global=new xt,this.screen=new xt}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(){throw Error(bt)}}class qa extends Wa{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw Error("getPredictedEvents is not supported!")}clone(){return this.manager.clonePointerEvent(this)}}class Za extends Wa{clone(){return this.manager.cloneWheelEvent(this)}}function $a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=u(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return t.length>n?{done:!1,value:t[n++]}:{done:!0}},e:function(t){throw t},f:i}}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,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){o=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}class Ka extends za{constructor(t,e){super(null),this.type=t,this.detail=e,Object.assign(this,e)}}var Qa=new WeakMap;class Ja{constructor(){this.emitter=new v}on(t,e,r){return this.addEventListener(t,e,r),this}addEventListener(t,e,r){var n=!1,i=!1;if(Gt(r))n=r;else if(r){var a=r.capture;n=void 0!==a&&a;var s=r.once;i=void 0!==s&&s}n&&(t+="capture"),e=Mt(e)?e:e.handleEvent;var o=Mt(e)?void 0:e;return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this}off(t,e,r){return t?this.removeEventListener(t,e,r):this.removeAllEventListeners(),this}removeAllEventListeners(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}removeEventListener(t,e,r){var n;if(!this.emitter)return this;(Gt(r)?r:null==r?void 0:r.capture)&&(t+="capture"),e=Mt(e)?e:null===(n=e)||void 0===n?void 0:n.handleEvent;var i=Mt(e)?void 0:e;return this.emitter.off(t,e,i),this}emit(t,e){this.dispatchEvent(new Ka(t,e))}dispatchEvent(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Qa.get(this);n||(n=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&Qa.set(this,n);if(n){if(t.manager=n.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],r||(t.target=this),t.manager.dispatchEvent(t,t.type,r)}return!t.defaultPrevented}}class ts extends Ja{constructor(){super(...arguments),this.shadow=!1,this.ownerDocument=null,this.isConnected=!1,this.baseURI="",this.childNodes=[],this.nodeType=0,this.nodeName="",this.nodeValue=null,this.parentNode=null}static isNode(t){return!!t.childNodes}get textContent(){var t="";this.nodeName===l.TEXT&&(t+=this.style.text);var e,r=$a(this.childNodes);try{for(r.s();!(e=r.n()).done;){var n=e.value;t+=n.nodeName===l.TEXT?n.nodeValue:n.textContent}}catch(t){r.e(t)}finally{r.f()}return t}set textContent(t){this.childNodes.slice().forEach((t=>{this.removeChild(t)})),this.nodeName===l.TEXT&&(this.style.text="".concat(t))}getRootNode(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}hasChildNodes(){return this.childNodes.length>0}isDefaultNamespace(t){throw Error(bt)}lookupNamespaceURI(t){throw Error(bt)}lookupPrefix(t){throw Error(bt)}normalize(){throw Error(bt)}isEqualNode(t){return this===t}isSameNode(t){return this.isEqualNode(t)}get parent(){return this.parentNode}get parentElement(){return null}get nextSibling(){return null}get previousSibling(){return null}get firstChild(){return this.childNodes.length>0?this.childNodes[0]:null}get lastChild(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}compareDocumentPosition(t){if(t===this)return 0;for(var e=t,r=this,n=[e],i=[r];null!==(a=e.parentNode)&&void 0!==a?a:r.parentNode;){var a;e=e.parentNode?(n.push(e.parentNode),e.parentNode):e,r=r.parentNode?(i.push(r.parentNode),r.parentNode):r}if(e!==r)return ts.DOCUMENT_POSITION_DISCONNECTED|ts.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|ts.DOCUMENT_POSITION_PRECEDING;var s=n.length>i.length?n:i,o=s===n?i:n;if(s[s.length-o.length]===o[0])return s===n?ts.DOCUMENT_POSITION_CONTAINED_BY|ts.DOCUMENT_POSITION_FOLLOWING:ts.DOCUMENT_POSITION_CONTAINS|ts.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-o.length,h=o.length-1;h>=0;h--){var c=o[h],u=s[l+h];if(u!==c){var d=c.parentNode.childNodes;return d.indexOf(c)<d.indexOf(u)?o===n?ts.DOCUMENT_POSITION_PRECEDING:ts.DOCUMENT_POSITION_FOLLOWING:s===n?ts.DOCUMENT_POSITION_PRECEDING:ts.DOCUMENT_POSITION_FOLLOWING}}return ts.DOCUMENT_POSITION_FOLLOWING}contain(t){return this.contains(t)}contains(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}getAncestor(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}forEach(t){if(!1!==t(this))for(var e=this.childNodes,r=e.length,n=0;r>n;n++)e[n].forEach(t)}}ts.DOCUMENT_POSITION_DISCONNECTED=1,ts.DOCUMENT_POSITION_PRECEDING=2,ts.DOCUMENT_POSITION_FOLLOWING=4,ts.DOCUMENT_POSITION_CONTAINS=8,ts.DOCUMENT_POSITION_CONTAINED_BY=16,ts.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;class es{constructor(t,e){this.emitter=new v,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=y(),this.tmpVec3=I(),this.onPointerDown=t=>{var e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){this.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)},this.onPointerUp=t=>{var e=ia.now(),r=this.createPointerEvent(t,void 0,void 0,this.context.config.alwaysTriggerPointerEventOnCanvas?this.rootTarget:void 0);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){this.dispatchEvent(r,2===r.button?"rightup":"mouseup")}var n=this.trackingData(t.pointerId),i=this.findMountedTarget(n.pressTargetsByButton[t.button]),a=i;if(i&&!r.composedPath().includes(i)){for(var s=i;s&&!r.composedPath().includes(s);){if(r.currentTarget=s,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside")}ts.isNode(s)&&(s=s.parentNode)}delete n.pressTargetsByButton[t.button],a=s}if(a){var o,l=this.clonePointerEvent(r,"click");l.target=a,l.path=[],n.clicksByButton[t.button]||(n.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var h=n.clicksByButton[t.button];h.target===l.target&&this.context.renderingContext.root.ownerDocument.defaultView.dblClickSpeed>e-h.timeStamp?++h.clickCount:h.clickCount=1,h.target=l.target,h.timeStamp=e,l.detail=h.clickCount,null!==(o=r.detail)&&void 0!==o&&o.preventClick||(this.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||this.dispatchEvent(l,"click"),this.dispatchEvent(l,"pointertap")),this.freeEvent(l)}this.freeEvent(r)},this.onPointerMove=t=>{var e=this.createPointerEvent(t,void 0,void 0,this.context.config.alwaysTriggerPointerEventOnCanvas?this.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,n=this.trackingData(t.pointerId),i=this.findMountedTarget(n.overTargets);if(n.overTargets&&i!==e.target){var a=this.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",i||void 0);if(this.dispatchEvent(a,"pointerout"),r&&this.dispatchEvent(a,"mouseout"),!e.composedPath().includes(i)){var s=this.createPointerEvent(t,"pointerleave",i||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseleave"),ts.isNode(s.target)&&(s.target=s.target.parentNode);this.freeEvent(s)}this.freeEvent(a)}if(i!==e.target){var o=this.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");this.dispatchEvent(o,"pointerover"),r&&this.dispatchEvent(o,"mouseover");for(var l=i&&ts.isNode(i)&&i.parentNode;l&&l!==(ts.isNode(this.rootTarget)&&this.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(ts.isNode(this.rootTarget)&&this.rootTarget.parentNode)){var h=this.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==i&&h.target!==(ts.isNode(this.rootTarget)&&this.rootTarget.parentNode);)h.currentTarget=h.target,this.notifyTarget(h),r&&this.notifyTarget(h,"mouseenter"),ts.isNode(h.target)&&(h.target=h.target.parentNode);this.freeEvent(h)}this.freeEvent(o)}this.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&this.dispatchEvent(e,"touchmove"),r&&(this.dispatchEvent(e,"mousemove"),this.cursor=this.getCursor(e.target)),n.overTargets=e.composedPath(),this.freeEvent(e)},this.onPointerOut=t=>{var e=this.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,n=this.findMountedTarget(e.overTargets),i=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(i),r&&this.dispatchEvent(i,"mouseout");var a=this.createPointerEvent(t,"pointerleave",n||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(ts.isNode(this.rootTarget)&&this.rootTarget.parentNode);)a.currentTarget=a.target,this.notifyTarget(a),r&&this.notifyTarget(a,"mouseleave"),ts.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,this.freeEvent(i),this.freeEvent(a)}this.cursor=null},this.onPointerOver=t=>{var e=this.trackingData(t.pointerId),r=this.createPointerEvent(t),n="mouse"===r.pointerType||"pen"===r.pointerType;this.dispatchEvent(r,"pointerover"),n&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursor=this.getCursor(r.target));var i=this.clonePointerEvent(r,"pointerenter");for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==(ts.isNode(this.rootTarget)&&this.rootTarget.parentNode);)i.currentTarget=i.target,this.notifyTarget(i),n&&this.notifyTarget(i,"mouseenter"),ts.isNode(i.target)&&(i.target=i.target.parentNode);e.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(i)},this.onPointerUpOutside=t=>{var e=this.trackingData(t.pointerId),r=this.findMountedTarget(e.pressTargetsByButton[t.button]),n=this.createPointerEvent(t);if(r){for(var i=r;i;)n.currentTarget=i,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType||"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),ts.isNode(i)&&(i=i.parentNode);delete e.pressTargetsByButton[t.button]}this.freeEvent(n)},this.onWheel=t=>{var e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)},this.onClick=t=>{if(this.context.config.useNativeClickEvent){var e=this.createPointerEvent(t);this.dispatchEvent(e),this.freeEvent(e)}},this.onPointerCancel=t=>{var e=this.createPointerEvent(t,void 0,void 0,this.context.config.alwaysTriggerPointerEventOnCanvas?this.rootTarget:void 0);this.dispatchEvent(e),this.freeEvent(e)},this.globalRuntime=t,this.context=e}init(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}destroy(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()}getScale(){var t=this.context.contextService.getBoundingClientRect(),e=1,r=1,n=this.context.contextService.getDomElement();if(n&&t){var i=n.offsetWidth,a=n.offsetHeight;i&&a&&(e=t.width/i,r=t.height/a)}return{scaleX:e,scaleY:r,bbox:t}}client2Viewport(t){var e=this.getScale(),r=e.bbox;return new xt((t.x-((null==r?void 0:r.left)||0))/e.scaleX,(t.y-((null==r?void 0:r.top)||0))/e.scaleY)}viewport2Client(t){var e=this.getScale(),r=e.bbox;return new xt((t.x+((null==r?void 0:r.left)||0))*e.scaleX,(t.y+((null==r?void 0:r.top)||0))*e.scaleY)}viewport2Canvas(t){var e=t.x,r=t.y,n=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,s=i.height,o=n.getPerspectiveInverse(),l=n.getWorldTransform(),h=M(this.tmpMatrix,l,o),c=F(this.tmpVec3,e/a*2-1,2*(1-r/s)-1,0);return j(c,c,h),new xt(c[0],c[1])}canvas2Viewport(t){var e=this.rootTarget.defaultView.getCamera(),r=e.getPerspective(),n=e.getViewTransform(),i=M(this.tmpMatrix,r,n),a=F(this.tmpVec3,t.x,t.y,0);j(this.tmpVec3,this.tmpVec3,i);var s=this.context.config;return new xt((a[0]+1)/2*s.width,(1-(a[1]+1)/2)*s.height)}setPickHandler(t){this.pickHandler=t}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}mapEvent(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var r=0,n=e.length;n>r;r++)e[r].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}dispatchEvent(t,e,r){r?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)}propagate(t,e){if(t.target){var r=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var n=r.length-1;n>=1;n--)if(t.currentTarget=r[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){var i=r.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;r.length>a;a++)if(t.currentTarget=r[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}propagationPath(t){var e=[t],r=this.rootTarget.defaultView||null;if(r&&r===t)return e.unshift(r.document),e;for(var n=0;2048>n&&t!==this.rootTarget;n++)ts.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return r&&e.push(r),e}hitTest(t){var e=t.viewportX,r=t.viewportY,n=this.context.config;return 0>e||0>r||e>n.width||r>n.height?null:!n.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null}isNativeEventFromCanvas(t,e){var r,n=null==e?void 0:e.target;if(null!==(r=n)&&void 0!==r&&r.shadowRoot&&(n=e.composedPath()[0]),n){if(n===t)return!0;if(t&&t.contains)return t.contains(n)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}getExistedHTML(t){if(t.nativeEvent.composedPath)for(var e=0,r=t.nativeEvent.composedPath();r.length>e;e++){var n=this.nativeHTMLMap.get(r[e]);if(n)return n}return null}pickTarget(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}createPointerEvent(t,e,r,n){var i=this.allocateEvent(qa);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),s=this.context.contextService.getDomElement();return i.target=null!=r?r:a||this.isNativeEventFromCanvas(s,i.nativeEvent)&&this.pickTarget(i)||n,"string"==typeof e&&(i.type=e),i}createWheelEvent(t){var e=this.allocateEvent(Za);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var r=this.getExistedHTML(e),n=this.context.contextService.getDomElement();return e.target=r||this.isNativeEventFromCanvas(n,e.nativeEvent)&&this.pickTarget(e),e}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}cloneWheelEvent(t){var e=this.allocateEvent(Za);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}clonePointerEvent(t,e){var r=this.allocateEvent(qa);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=null!=e?e:r.type,r}copyPointerData(t,e){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}copyMouseData(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyData(t,e){e.isTrusted=t.isTrusted,e.timeStamp=ia.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}freeEvent(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}notifyTarget(t,e){var r;e=null!==(r=e)&&void 0!==r?r:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}notifyListeners(t,e){var r=t.currentTarget.emitter,n=r._events[e];if(n)if("fn"in n)n.once&&r.removeListener(e,n.fn,void 0,!0),n.fn.call(t.currentTarget||n.context,t);else for(var i=0;n.length>i&&!t.propagationImmediatelyStopped;i++)n[i].once&&r.removeListener(e,n[i].fn,void 0,!0),n[i].fn.call(t.currentTarget||n[i].context,t)}findMountedTarget(t){if(!t)return null;for(var e=t[t.length-1],r=t.length-2;r>=0;r--){var n=t[r];if(!(n===this.rootTarget||ts.isNode(n)&&n.parentNode===e))break;e=t[r]}return e}getCursor(t){for(var e=t;e;){var r=Ji(e)&&e.getAttribute("cursor");if(r)return r;e=ts.isNode(e)&&e.parentNode}}}class rs{static createCanvas(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}getOrCreateCanvas(t,e){if(this.canvas)return this.canvas;if(t||_s.offscreenCanvas)this.canvas=t||_s.offscreenCanvas,this.context=this.canvas.getContext("2d",o({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",o({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",o({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}getOrCreateContext(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}var ns=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({});class is{constructor(t,e){this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new wa,initAsync:new ma,dirtycheck:new Ma,cull:new Ma,beginFrame:new wa,beforeRender:new wa,render:new wa,afterRender:new wa,endFrame:new wa,destroy:new wa,pick:new ba,pickSync:new Ma,pointerDown:new wa,pointerUp:new wa,pointerMove:new wa,pointerOut:new wa,pointerOver:new wa,pointerWheel:new wa,pointerCancel:new wa,click:new wa},this.globalRuntime=t,this.context=e}init(t){var e=o(o({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((t=>{t.apply(e,this.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((()=>{this.inited=!0,t()}))}getStats(){return this.stats}disableDirtyRectangleRendering(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(ns.CAMERA_CHANGED)}render(t,e,r){this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var n=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(n.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),n.renderReasons.size&&this.inited){n.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var i=1===n.renderReasons.size&&n.renderReasons.has(ns.CAMERA_CHANGED),a=!t.disableRenderHooks||!(t.disableRenderHooks&&i);a&&this.renderDisplayObject(n.root,t,n),this.hooks.beginFrame.call(e),a&&n.renderListCurrentFrame.forEach((t=>{this.hooks.beforeRender.call(t),this.hooks.render.call(t),this.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),n.renderListCurrentFrame=[],n.renderReasons.clear(),r()}}renderDisplayObject(t,e,r){var n=e.renderer.getConfig(),i=n.enableDirtyCheck?t.renderable.dirty||r.dirtyRectangleRenderingDisabled?t:null:t;if(i){var a=n.enableCulling?this.hooks.cull.call(i,this.context.camera):i;a&&(this.stats.rendered++,r.renderListCurrentFrame.push(a))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var s=t.sortable;s.dirty&&(this.sort(t,s),s.dirty=!1,s.dirtyChildren=[],s.dirtyReason=void 0),(s.sorted||t.childNodes).forEach((t=>{this.renderDisplayObject(t,e,r)}))}sort(t,e){e.sorted&&e.dirtyReason!==We.Z_INDEX_CHANGED?e.dirtyChildren.forEach((r=>{if(-1===t.childNodes.indexOf(r)){var n=e.sorted.indexOf(r);0>n||e.sorted.splice(n,1)}else if(0===e.sorted.length)e.sorted.push(r);else{var i=function(t,e){for(var r=0,n=t.length;n>r;){var i=r+n>>>1;0>ta(t[i],e)?r=i+1:n=i}return r}(e.sorted,r);e.sorted.splice(i,0,r)}})):e.sorted=t.childNodes.slice().sort(ta)}destroy(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}dirtify(){this.context.renderingContext.renderReasons.add(ns.DISPLAY_OBJECT_CHANGED)}}var as=/\[\s*(.*)=(.*)\s*\]/;class ss{selectOne(t,e){if(t.startsWith("."))return e.find((e=>((null==e?void 0:e.classList)||[]).indexOf(this.getIdOrClassname(t))>-1));if(t.startsWith("#"))return e.find((e=>e.id===this.getIdOrClassname(t)));if(t.startsWith("[")){var r=this.getAttribute(t),n=r.name,i=r.value;return n?e.find((t=>e!==t&&("name"===n?t.name===i:this.attributeToString(t,n)===i))):null}return e.find((r=>e!==r&&r.nodeName===t))}selectAll(t,e){if(t.startsWith("."))return e.findAll((r=>e!==r&&((null==r?void 0:r.classList)||[]).indexOf(this.getIdOrClassname(t))>-1));if(t.startsWith("#"))return e.findAll((r=>e!==r&&r.id===this.getIdOrClassname(t)));if(t.startsWith("[")){var r=this.getAttribute(t),n=r.name,i=r.value;return n?e.findAll((t=>e!==t&&("name"===n?t.name===i:this.attributeToString(t,n)===i))):[]}return e.findAll((r=>e!==r&&r.nodeName===t))}is(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var r=this.getAttribute(t),n=r.name,i=r.value;return"name"===n?e.name===i:this.attributeToString(e,n)===i}return e.nodeName===t}getIdOrClassname(t){return t.substring(1)}getAttribute(t){var e=t.match(as),r="",n="";return e&&e.length>2&&(r=e[1].replace(/"/g,""),n=e[2].replace(/"/g,"")),{name:r,value:n}}attributeToString(t,e){if(!t.getAttribute)return"";var r=t.getAttribute(e);return Tt(r)?"":r.toString?""+r:""}}var os=function(t){return t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({});class ls extends za{constructor(t,e,r,n,i,a,s,o){super(null),this.relatedNode=e,this.prevValue=r,this.newValue=n,this.attrName=i,this.attrChange=a,this.prevParsedValue=s,this.newParsedValue=o,this.type=t}}function hs(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}ls.ADDITION=2,ls.MODIFICATION=1,ls.REMOVAL=3;var cs=new ls(os.REPARENT,null,"","","",0,"",""),us=lt(),ds=I(),ps=G(1,1,1),vs=y(),fs=lt(),gs=I(),ms=y(),ys=Q(),xs=I(),Es=Q(),bs=I(),ws=I(),Ms=I(),Ts=y(),Ns=Q(),Ps=Q(),Ss=Q(),Cs={affectChildren:!0};class ks{constructor(t){this.pendingEvents=new Map,this.boundsChangedEvent=new Ka(os.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=t}matches(t,e){return this.runtime.sceneGraphSelector.is(t,e)}querySelector(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}querySelectorAll(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}attach(t,e,r){var n,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===l.FRAGMENT,s=aa(e);t.parentNode=e;var o=a?t.childNodes:[t];Ot(r)?o.forEach((t=>{e.childNodes.splice(r,0,t),t.parentNode=e})):o.forEach((t=>{e.childNodes.push(t),t.parentNode=e}));var h=e.sortable;if((null!=h&&null!==(n=h.sorted)&&void 0!==n&&n.length||t.parsedStyle.zIndex)&&(-1===h.dirtyChildren.indexOf(t)&&h.dirtyChildren.push(t),h.dirty=!0,h.dirtyReason=We.ADDED),!s){if(a)this.dirtifyFragment(t);else{var c=t.transformable;c&&this.dirtifyWorld(t,c)}i&&t.dispatchEvent(cs)}}detach(t){if(t.parentNode){var e,r,n=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(r=t.style)&&void 0!==r&&r.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=We.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),n&&this.dirtifyWorld(t,n),t.parentNode=null}}getOrigin(t){return t.getGeometryBounds(),t.transformable.origin}setOrigin(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var r=t.transformable;if(e[0]!==r.origin[0]||e[1]!==r.origin[1]||e[2]!==r.origin[2]){var n=r.origin;n[0]=e[0],n[1]=e[1],n[2]=e[2]||0,this.dirtifyLocal(t,r)}}rotate(t,e){"number"==typeof e&&(e=G(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var n=ys;rt(n,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);it(Ss,a),et(Ss,Ss),tt(n,Ss,n),tt(r.localRotation,n,i),ot(r.localRotation,r.localRotation),this.dirtifyLocal(t,r)}else this.rotateLocal(t,e)}rotateLocal(t,e){"number"==typeof e&&(e=G(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;rt(Ps,e[0],e[1],e[2]),st(r.localRotation,r.localRotation,Ps),this.dirtifyLocal(t,r)}setEulerAngles(t,e){"number"==typeof e&&(e=G(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){rt(r.localRotation,e[0],e[1],e[2]);var n=this.getRotation(t.parentNode);it(Ns,et(ys,n)),st(r.localRotation,r.localRotation,Ns),this.dirtifyLocal(t,r)}else this.setLocalEulerAngles(t,e)}setLocalEulerAngles(t,e){var r=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof e&&(e=G(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;rt(n.localRotation,e[0],e[1],e[2]),r&&this.dirtifyLocal(t,n)}translateLocal(t,e){"number"==typeof e&&(e=G(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;z(e,ds)||(!function(t,e,r){var n=r[0],i=r[1],a=r[2],s=e[0],o=e[1],l=e[2],h=i*l-a*o,c=a*s-n*l,u=n*o-i*s,d=i*u-a*c,p=a*h-n*u,v=n*c-i*h,f=2*r[3];c*=f,u*=f,p*=2,v*=2,t[0]=s+(h*=f)+(d*=2),t[1]=o+c+p,t[2]=l+u+v}(e,e,r.localRotation),B(r.localPosition,r.localPosition,e),this.dirtifyLocal(t,r))}setPosition(t,e){var r,n=t.transformable;if(Ms[0]=e[0],Ms[1]=e[1],Ms[2]=null!==(r=e[2])&&void 0!==r?r:0,!z(this.getPosition(t),Ms)){if(_(n.position,Ms),null!==t.parentNode&&t.parentNode.transformable)x(Ts,t.parentNode.transformable.worldTransform),w(Ts,Ts),j(n.localPosition,Ms,Ts);else _(n.localPosition,Ms);this.dirtifyLocal(t,n)}}setLocalPosition(t,e){var r,n=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;ws[0]=e[0],ws[1]=e[1],ws[2]=null!==(r=e[2])&&void 0!==r?r:0,z(i.localPosition,ws)||(_(i.localPosition,ws),n&&this.dirtifyLocal(t,i))}scaleLocal(t,e){var r,n,i,a,s=t.transformable;n=s.localScale,i=s.localScale,a=F(gs,e[0],e[1],null!==(r=e[2])&&void 0!==r?r:1),n[0]=i[0]*a[0],n[1]=i[1]*a[1],n[2]=i[2]*a[2],this.dirtifyLocal(t,s)}setLocalScale(t,e){var r,n=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;F(gs,e[0],e[1],null!==(r=e[2])&&void 0!==r?r:i.localScale[2]),z(gs,i.localScale)||(_(i.localScale,gs),n&&this.dirtifyLocal(t,i))}translate(t,e){"number"==typeof e&&(e=F(gs,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),z(e,ds)||(B(gs,this.getPosition(t),e),this.setPosition(t,gs))}setRotation(t,e,r,n,i){var a=t.transformable;if("number"==typeof e&&(e=nt(e,r,n,i)),null!==t.parentNode&&t.parentNode.transformable){var s=this.getRotation(t.parentNode);it(ys,s),et(ys,ys),tt(a.localRotation,ys,e),ot(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}setLocalRotation(t,e,r,n,i){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=at(ys,e,r,n,i));var s=t.transformable;it(s.localRotation,e),a&&this.dirtifyLocal(t,s)}setLocalSkew(t,e,r){var n=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof e&&(e=function(t,e,r){return t[0]=e,t[1]=r,t}(fs,e,r));var i,a,s=t.transformable;(i=s.localSkew)[0]=(a=e)[0],i[1]=a[1],n&&this.dirtifyLocal(t,s)}dirtifyLocal(t,e){aa(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}dirtifyWorld(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}dirtifyFragment(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0);for(var n=t.childNodes.length,i=0;n>i;i++)this.dirtifyFragment(t.childNodes[i]);t.nodeName===l.FRAGMENT&&this.pendingEvents.set(t,!1)}triggerPendingEvents(){var t=new Set,e=new Set;this.pendingEvents.forEach(((t,r)=>{r.nodeName===l.FRAGMENT&&r.forEach((t=>{t!==r&&e.add(t)}))}));var r=(r,n)=>{!r.isConnected||t.has(r)||e.has(r)||(this.boundsChangedEvent.detail=n,this.boundsChangedEvent.target=r,r.isMutationObserved?r.dispatchEvent(this.boundsChangedEvent):r.ownerDocument.defaultView.dispatchEvent(this.boundsChangedEvent,!0),t.add(r))};this.pendingEvents.forEach(((t,e)=>{Cs.affectChildren=t,t?e.forEach((t=>{r(t,Cs)})):r(e,Cs)})),t.clear(),e.clear(),this.clearPendingEvents()}clearPendingEvents(){this.pendingEvents.clear()}dirtifyToRoot(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t;for(r.renderable&&(r.renderable.dirty=!0);r;)hs(r),r=r.parentNode;e&&t.forEach((t=>{hs(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}updateDisplayObjectDependency(t,e,r,n){if(e&&e!==r){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(n);i[t].splice(a,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[t]||(s[t]=[]),s[t].push(n)}}informDependentDisplayObjects(t){var e=this.displayObjectDependencyMap.get(t);e&&Object.keys(e).forEach((t=>{e[t].forEach((e=>{this.dirtifyToRoot(e,!0),e.dispatchEvent(new ls(os.ATTR_MODIFIED,e,this,this,t,ls.MODIFICATION,this,this)),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback(t,this,this)}))}))}getPosition(t){var e=t.transformable;return C(e.position,this.getWorldTransform(t,e))}getRotation(t){var e=t.transformable;return A(e.rotation,this.getWorldTransform(t,e))}getScale(t){var e=t.transformable;return k(e.scaling,this.getWorldTransform(t,e))}getWorldTransform(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}getLocalPosition(t){return t.transformable.localPosition}getLocalRotation(t){return t.transformable.localRotation}getLocalScale(t){return t.transformable.localScale}getLocalSkew(t){return t.transformable.localSkew}calcLocalTransform(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){R(t.localTransform,t.localRotation,t.localPosition,G(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(b(ms),ms[4]=Math.tan(t.localSkew[0]),ms[1]=Math.tan(t.localSkew[1]),M(t.localTransform,t.localTransform,ms));var e=R(ms,at(ys,0,0,0,1),F(gs,1,1,1),t.localScale,t.origin);M(t.localTransform,t.localTransform,e)}else{var r=t.localTransform,n=t.localPosition,i=t.localRotation,a=t.localScale,s=t.origin,o=0!==n[0]||0!==n[1]||0!==n[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==s[0]||0!==s[1]||0!==s[2])?R(r,i,n,a,s):o?N(r,n):b(r)}}getLocalTransform(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}setLocalTransform(t,e){var r=C(xs,e),n=A(Es,e),i=k(bs,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,r,!1),this.setLocalRotation(t,n,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}resetLocalTransform(t){this.setLocalScale(t,ps,!1),this.setLocalPosition(t,ds,!1),this.setLocalEulerAngles(t,ds,void 0,void 0,!1),this.setLocalSkew(t,us,void 0,!1),this.dirtifyLocal(t,t.transformable)}getTransformedGeometryBounds(t){var e=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!ft.isEmpty(r)){var n=e||new ft;return n.setFromTransformedAABB(r,this.getWorldTransform(t)),n}return null}getGeometryBounds(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.geometry;return r.dirty&&_s.styleValueRegistry.updateGeometry(t),(e?r.renderBounds:r.contentBounds||null)||new ft}getBounds(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var n=e?r.renderBounds:r.bounds,i=this.getTransformedGeometryBounds(t,e,n);if(t.childNodes.forEach((t=>{var r=this.getBounds(t,e);r&&(i?i.add(r):(i=n||new ft).update(r.center,r.halfExtents))})),i||(i=new ft),e){var a=ea(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);i?s&&(i=s.intersection(i)):i.update(s.center,s.halfExtents)}}return e?(r.renderBounds=i,r.renderBoundsDirty=!1):(r.bounds=i,r.boundsDirty=!1),i}getLocalBounds(t){if(t.parentNode){var e=vs;t.parentNode.transformable&&(e=w(ms,this.getWorldTransform(t.parentNode)));var r=this.getBounds(t);if(!ft.isEmpty(r)){var n=new ft;return n.setFromTransformedAABB(r,e),n}}return this.getBounds(t)}getBoundingClientRect(t){var e,r,n=this.getGeometryBounds(t);ft.isEmpty(n)||(r=new ft).setFromTransformedAABB(n,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var a=d(r.getMin(),2),s=a[0],o=a[1],l=d(r.getMax(),2);return new Et(s+((null==i?void 0:i.left)||0),o+((null==i?void 0:i.top)||0),l[0]-s,l[1]-o)}return new Et((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}dirtifyWorldInternal(t,e){if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((t=>{var e=t.transformable;e.dirtyFlag||this.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}}syncHierarchy(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var r=t.childNodes,n=0;r.length>n;n++)this.syncHierarchy(r[n])}}sync(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var r=t.parentNode,n=r&&r.transformable;null!==r&&n?M(e.worldTransform,n.worldTransform,e.localTransform):x(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}unfreezeParentToRoot(t){for(var e=t.parentNode;e;){var r=e.transformable;r&&(r.frozen=!1),e=e.parentNode}}}var As={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Rs=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Os=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Ls=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source));class Is{constructor(t){this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=(t,e)=>!this.isBreakingSpace(e)&&!(!t||!Ls.exec(e)&&!Os.exec(t)),this.trimByKinsokuShorui=t=>{var e=[...t],r=e[e.length-2];if(!r)return t;var n=r[r.length-1];return e[e.length-2]=r.slice(0,-1),e[e.length-1]=n+e[e.length-1],e},this.runtime=t}measureFont(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var r={ascent:0,descent:0,fontSize:0},n=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=As.MetricsString+As.BaselineSymbol,s=Math.ceil(i.measureText(a).width),o=Math.ceil(i.measureText(As.BaselineSymbol).width),l=As.HeightMultiplier*o;o=o*As.BaselineMultiplier|0,n.width=s,n.height=l,i.fillStyle="#f00",i.fillRect(0,0,s,l),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,o);var h=i.getImageData(0,0,s||1,l||1).data,c=h.length,u=4*s,d=0,p=0,v=!1;for(d=0;o>d;++d){for(var f=0;u>f;f+=4)if(255!==h[p+f]){v=!0;break}if(v)break;p+=u}for(r.ascent=o-d,p=c-u,v=!1,d=l;d>o;--d){for(var g=0;u>g;g+=4)if(255!==h[p+g]){v=!0;break}if(v)break;p-=u}return r.descent=d-o,r.fontSize=r.ascent+r.descent,this.fontMetricsCache[t]=r,r}measureText(t,e,r){var n=e.fontSize,i=void 0===n?16:n,a=e.wordWrap,s=void 0!==a&&a,o=e.lineHeight,l=e.lineWidth,h=void 0===l?1:l,c=e.textBaseline,u=void 0===c?"alphabetic":c,d=e.textAlign,p=void 0===d?"start":d,v=e.letterSpacing,f=void 0===v?0:v,g=e.textPath,m=e.leading,y=void 0===m?0:m,x=function(t){for(var e=t.fontSize,r=void 0===e?16:e,n=t.fontFamily,i=void 0===n?"sans-serif":n,a=t.fontStyle,s=void 0===a?"normal":a,o=t.fontVariant,l=void 0===o?"normal":o,h=t.fontWeight,c=void 0===h?"normal":h,u=Ot(r)&&"".concat(r,"px")||"16px",d=i.split(","),p=d.length-1;p>=0;p--){var v=d[p].trim();!Na.test(v)&&0>Ta.indexOf(v)&&(v='"'.concat(v,'"')),d[p]=v}return"".concat(s," ").concat(l," ").concat(c," ").concat(u," ").concat(d.join(","))}(e),E=this.measureFont(x,r);0===E.fontSize&&(E.fontSize=i,E.ascent=i);var b=this.runtime.offscreenCanvasCreator.getOrCreateContext(r);b.font=x,e.isOverflowing=!1;var w=(s?this.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),M=Array(w.length),T=0;if(!g){for(var N=0;w.length>N;N++){var P=b.measureText(w[N]).width+(w[N].length-1)*f;M[N]=P,T=Math.max(T,P)}var S=T+h,C=o||E.fontSize+h,k=Math.max(C,E.fontSize+h)+(w.length-1)*(C+y),A=0;return"middle"===u?A=-k/2:"bottom"===u||"alphabetic"===u||"ideographic"===u?A=-k:"top"!==u&&"hanging"!==u||(A=0),{font:x,width:S,height:k,lines:w,lineWidths:M,lineHeight:C+=y,maxLineWidth:T,fontProperties:E,lineMetrics:M.map(((t,e)=>{var r=0;return"center"===p||"middle"===p?r-=t/2:"right"!==p&&"end"!==p||(r-=t),new Et(r-h/2,A+e*C,t+h,C)}))}}g.getTotalLength();for(var R=0;w.length>R;R++)b.measureText(w[R])}setGraphemeOnPath(){}wordWrap(t,e,r){var n=e.wordWrapWidth,i=void 0===n?0:n,a=e.letterSpacing,s=void 0===a?0:a,o=e.maxLines,l=void 0===o?1/0:o,h=e.textOverflow,c=this.runtime.offscreenCanvasCreator.getOrCreateContext(r),u=i+s,d="";"ellipsis"===h?d="...":h&&"clip"!==h&&(d=h);for(var p=[],v=0,f=0,g={},m=t=>this.getFromCache(t,s,g,c),y=Array.from(d).reduce(((t,e)=>t+m(e)),0),x=Array.from(t),E=0;x.length>E;E++){var b=x[E],w=t[E-1],M=t[E+1],T=m(b);if(this.isNewline(b)){if(++v>=l){e.isOverflowing=!0;break}f=0,p[v]=""}else{if(f>0&&f+T>u){if(v+1>=l){if(e.isOverflowing=!0,y>0&&u>=y){for(var N=p[v].length,P=0,S=N,C=0;N>C;C++){var k=m(p[v][C]);if(P+k+y>u){S=C;break}P+=k}p[v]=(p[v]||"").slice(0,S)+d}break}if(f=0,p[++v]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(p=this.trimToBreakable(p),f=this.sumTextWidthByCache(p[v]||"",g)),this.shouldBreakByKinsokuShorui(b,M)&&(p=this.trimByKinsokuShorui(p),f+=m(w||""))}f+=T,p[v]=(p[v]||"")+b}}return p.join("\n")}isBreakingSpace(t){return"string"==typeof t&&As.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}isNewline(t){return"string"==typeof t&&As.Newlines.indexOf(t.charCodeAt(0))>=0}trimToBreakable(t){var e=[...t],r=e[e.length-2],n=this.findBreakableIndex(r);if(-1===n||!r)return e;var i=r.slice(n,n+1),a=n+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=r.slice(n+1,r.length),e[e.length-2]=r.slice(0,a),e}canBreakInLastChar(t){return!t||!Rs.test(t)}sumTextWidthByCache(t,e){return t.split("").reduce(((t,r)=>{if(!e[r])throw Error("cannot count the word without cache");return t+e[r]}),0)}findBreakableIndex(t){for(var e=t.length-1;e>=0;e--)if(!Rs.test(t[e]))return e;return-1}getFromCache(t,e,r,n){var i=r[t];if("number"!=typeof i){var a=t.length*e;i=n.measureText(t).width+a,r[t]=i}return i}}var Ds,Gs,_s={},Fs=(Ds=new Ya,Gs=new Ua,{[l.CIRCLE]:new _a,[l.ELLIPSE]:new Fa,[l.RECT]:Ds,[l.IMAGE]:Ds,[l.GROUP]:new Ha,[l.LINE]:new Ba,[l.TEXT]:new Xa(_s),[l.POLYLINE]:Gs,[l.POLYGON]:Gs,[l.PATH]:new Va,[l.HTML]:new ja,[l.MESH]:null}),Bs=(()=>{var t=new Di,e=new Fi;return{[Ze.PERCENTAGE]:null,[Ze.NUMBER]:new Yi,[Ze.ANGLE]:new Li,[Ze.DEFINED_PATH]:new Ii,[Ze.PAINT]:t,[Ze.COLOR]:t,[Ze.FILTER]:new Gi,[Ze.LENGTH]:e,[Ze.LENGTH_PERCENTAGE]:e,[Ze.LENGTH_PERCENTAGE_12]:new Bi,[Ze.LENGTH_PERCENTAGE_14]:new Vi,[Ze.COORDINATE]:new Fi,[Ze.OFFSET_DISTANCE]:new Xi,[Ze.OPACITY_VALUE]:new Hi,[Ze.PATH]:new ji,[Ze.LIST_OF_POINTS]:new zi,[Ze.SHADOW_BLUR]:new Wi,[Ze.TEXT]:new qi,[Ze.TEXT_TRANSFORM]:new Zi,[Ze.TRANSFORM]:new Ia,[Ze.TRANSFORM_ORIGIN]:new Da,[Ze.Z_INDEX]:new Ga,[Ze.MARKER]:new Ui}})();_s.CameraContribution=je,_s.AnimationTimeline=null,_s.EasingFunction=null,_s.offscreenCanvasCreator=new rs,_s.sceneGraphSelector=new ss,_s.sceneGraphService=new ks(_s),_s.textService=new Is(_s),_s.geometryUpdaterFactory=Fs,_s.CSSPropertySyntaxFactory=Bs,_s.styleValueRegistry=new class{constructor(t){this.runtime=t,Ai.forEach((t=>{this.registerMetadata(t)}))}registerMetadata(t){[t.n,...t.a||[]].forEach((e=>{Oi[e]=t}))}getPropertySyntax(t){return this.runtime.CSSPropertySyntaxFactory[t]}processProperties(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var n=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;Object.assign(t.parsedStyle,e);var a,s=!!r.forceUpdateGeometry;!s&&Ri.some((t=>t in e))&&(s=!0),e.fill&&(t.parsedStyle.fill=vn(e.fill)),e.stroke&&(t.parsedStyle.stroke=vn(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=vn(e.shadowColor)),e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,r=/\s*([\w-]+)\(([^)]*)\)/g,n=[],i=0;e=r.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Sn.indexOf(e[1])>-1&&n.push({name:e[1],params:e[2].split(" ").map((t=>gn(/deg|rad|grad|turn|px|%/g,t)||vn(t)))}),r.lastIndex===t.length)return n}return[]}(e.filter)),Tt(e.radius)||(t.parsedStyle.radius=Nn(e.radius,4)),Tt(e.lineDash)||(t.parsedStyle.lineDash=Nn(e.lineDash,2)),e.points&&(t.parsedStyle.points={points:At(a=e.points)?a.split(" ").map((t=>{var e=d(t.split(","),2),r=e[1];return[Number(e[0]),Number(r)]})):a,totalLength:0,segments:[]}),""===e.d&&(t.parsedStyle.d=o({},qe)),e.d&&(t.parsedStyle.d=li(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory[Ze.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),_t(e.clipPath)||this.runtime.CSSPropertySyntaxFactory[Ze.DEFINED_PATH].calculator("clipPath",n,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[Ze.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),e.transform&&(t.parsedStyle.transform=mi(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Ci(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[Ze.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[Ze.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[Ze.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),Tt(e.zIndex)||this.runtime.CSSPropertySyntaxFactory[Ze.Z_INDEX].postProcessor(t),Tt(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[Ze.OFFSET_DISTANCE].postProcessor(t),e.transform&&this.runtime.CSSPropertySyntaxFactory[Ze.TRANSFORM].postProcessor(t),e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[Ze.TRANSFORM_ORIGIN].postProcessor(t),s&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,r.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}updateGeometry(t){var e=t.nodeName,r=this.runtime.geometryUpdaterFactory[e];if(r){var n=t.geometry;n.contentBounds||(n.contentBounds=new ft),n.renderBounds||(n.renderBounds=new ft);var i=t.parsedStyle,a=r.update(i,t),s=a.cx,o=void 0===s?0:s,h=a.cy,c=void 0===h?0:h,u=a.cz,d=void 0===u?0:u,p=a.hwidth,v=void 0===p?0:p,f=a.hheight,g=void 0===f?0:f,m=a.hdepth,y=void 0===m?0:m,x=[Math.abs(v),Math.abs(g),y],E=i.stroke,b=i.lineWidth,w=void 0===b?1:b,M=i.increasedLineWidthForHitTesting,T=void 0===M?0:M,N=i.shadowType,P=void 0===N?"outer":N,S=i.shadowColor,C=i.filter,k=void 0===C?[]:C,A=i.transformOrigin,R=[o,c,d];if(n.contentBounds.update(R,x),E&&!E.isNone){var O=((w||0)+(T||0))*(e===l.POLYLINE||e===l.POLYGON||e===l.PATH?Math.SQRT2:.5);x[0]+=O,x[1]+=O}if(n.renderBounds.update(R,x),S&&P&&"inner"!==P){var L=n.renderBounds,I=L.min,D=L.max,G=i.shadowBlur||0,_=i.shadowOffsetX||0,F=i.shadowOffsetY||0,V=D[0]+G+_,U=I[1]-G+F,Y=D[1]+G+F;I[0]=Math.min(I[0],I[0]-G+_),D[0]=Math.max(D[0],V),I[1]=Math.min(I[1],U),D[1]=Math.max(D[1],Y),n.renderBounds.setMinMax(I,D)}k.forEach((t=>{var e=t.name,r=t.params;if("blur"===e){var i=r[0].value;n.renderBounds.update(n.renderBounds.center,B(n.renderBounds.halfExtents,n.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=r[0].value,s=r[1].value,o=r[2].value,l=n.renderBounds,h=l.min,c=l.max,u=c[0]+o+a,d=h[1]-o+s,p=c[1]+o+s;h[0]=Math.min(h[0],h[0]-o+a),c[0]=Math.max(c[0],u),h[1]=Math.min(h[1],d),c[1]=Math.max(c[1],p),n.renderBounds.setMinMax(h,c)}})),t.geometry.dirty=!1;var X=0>g,H=(0>v?-1:1)*(A?Pn(A[0],0,t,!0):0),j=(X?-1:1)*(A?Pn(A[1],1,t,!0):0);(H||j)&&t.setOrigin(H,j)}}updateSizeAttenuation(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===l.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===l.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}(_s),_s.layoutRegistry=null,_s.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},_s.enableStyleSyntax=!0,_s.enableSizeAttenuation=!1;var Vs=0;var Us=new ls(os.INSERTED,null,"","","",0,"",""),Ys=new ls(os.REMOVED,null,"","","",0,"",""),Xs=new Ka(os.DESTROY);class Hs extends ts{constructor(){super(...arguments),this.entity=Vs++,this.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},this.cullable={strategy:ze.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},this.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},this.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},this.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},this.rBushNode={aabb:void 0},this.namespaceURI="g",this.scrollLeft=0,this.scrollTop=0,this.clientTop=0,this.clientLeft=0,this.destroyed=!1,this.style={},this.computedStyle={},this.parsedStyle={},this.attributes={}}get className(){return this.getAttribute("class")||""}set className(t){this.setAttribute("class",t)}get classList(){return this.className.split(" ").filter((t=>""!==t))}get tagName(){return this.nodeName}get children(){return this.childNodes}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.firstChild}get lastElementChild(){return this.lastChild}get parentElement(){return this.parentNode}get nextSibling(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}get previousSibling(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}cloneNode(t){throw Error(bt)}appendChild(t,e){var r;if(t.destroyed)throw Error("Cannot append a destroyed element.");return _s.sceneGraphService.attach(t,this,e),null!==(r=this.ownerDocument)&&void 0!==r&&r.defaultView&&(aa(this)||t.nodeName!==l.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(Us.relatedNode=this,t.dispatchEvent(Us)),t}insertBefore(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var r=this.childNodes.indexOf(e);-1===r?this.appendChild(t):this.appendChild(t,r)}else this.appendChild(t);return t}replaceChild(t,e){var r=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,r),e}removeChild(t){var e;return Ys.relatedNode=this,t.dispatchEvent(Ys),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),_s.sceneGraphService.detach(t),t}removeChildren(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}destroyChildren(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}}matches(t){return _s.sceneGraphService.matches(t,this)}getElementById(t){return _s.sceneGraphService.querySelector("#".concat(t),this)}getElementsByName(t){return _s.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}getElementsByClassName(t){return _s.sceneGraphService.querySelectorAll(".".concat(t),this)}getElementsByTagName(t){return _s.sceneGraphService.querySelectorAll(t,this)}querySelector(t){return _s.sceneGraphService.querySelector(t,this)}querySelectorAll(t){return _s.sceneGraphService.querySelectorAll(t,this)}closest(t){var e=this;do{if(_s.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}find(t){var e=null;return this.forEach((r=>r===this||!t(r)||(e=r,!1))),e}findAll(t){var e=[];return this.forEach((r=>{r!==this&&t(r)&&e.push(r)})),e}after(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];r.forEach(((e,r)=>{var n;return null===(n=this.parentNode)||void 0===n?void 0:n.appendChild(e,t+r+1)}))}}before(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];var i=r[0],a=r.slice(1);this.parentNode.appendChild(i,t),i.after(...a)}}replaceWith(){this.after(...arguments),this.remove()}append(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];e.forEach((t=>this.appendChild(t)))}prepend(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];e.forEach(((t,e)=>this.appendChild(t,e)))}replaceChildren(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append(...arguments)}remove(){return this.parentNode?this.parentNode.removeChild(this):this}destroy(){this.dispatchEvent(Xs),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}getGeometryBounds(){return _s.sceneGraphService.getGeometryBounds(this)}getRenderBounds(){return _s.sceneGraphService.getBounds(this,!0)}getBounds(){return _s.sceneGraphService.getBounds(this)}getLocalBounds(){return _s.sceneGraphService.getLocalBounds(this)}getBoundingClientRect(){return _s.sceneGraphService.getBoundingClientRect(this)}getClientRects(){return[this.getBoundingClientRect()]}computedStyleMap(){return new Map(Object.entries(this.computedStyle))}getAttributeNames(){return Object.keys(this.attributes)}getAttribute(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}hasAttribute(t){return this.getAttributeNames().includes(t)}hasAttributes(){return!!this.getAttributeNames().length}removeAttribute(t){this.setAttribute(t,null),delete this.attributes[t]}setAttribute(t,e,r,n){this.attributes[t]=e}getAttributeNS(t,e){throw Error(bt)}getAttributeNode(t){throw Error(bt)}getAttributeNodeNS(t,e){throw Error(bt)}hasAttributeNS(t,e){throw Error(bt)}removeAttributeNS(t,e){throw Error(bt)}removeAttributeNode(t){throw Error(bt)}setAttributeNS(t,e,r){throw Error(bt)}setAttributeNode(t){throw Error(bt)}setAttributeNodeNS(t){throw Error(bt)}toggleAttribute(t,e){throw Error(bt)}}function js(t){return!(null==t||!t.nodeName)}var zs=_s.globalThis.Proxy?_s.globalThis.Proxy:function(){},Ws=new ls(os.ATTR_MODIFIED,null,null,null,null,ls.MODIFICATION,null,null),qs=I(),Zs=Q();class $s extends Hs{constructor(t){super(),this.isCustomElement=!1,this.isMutationObserved=!1,this.activeAnimations=[],this.config=t,this.id=t.id||"",this.name=t.name||"",(t.className||t.class)&&(this.className=t.className||t.class),this.nodeName=t.type||l.GROUP,t.initialParsedStyle&&Object.assign(this.parsedStyle,t.initialParsedStyle),this.initAttributes(t.style),_s.enableStyleSyntax&&(this.style=new zs({setProperty:(t,e)=>{this.setAttribute(t,e)},getPropertyValue:t=>this.getAttribute(t),removeProperty:t=>{this.removeAttribute(t)},item:()=>""},{get:(t,e)=>void 0!==t[e]?t[e]:this.getAttribute(e),set:(t,e,r)=>(this.setAttribute(e,r),!0)}))}destroy(){super.destroy(),this.getAnimations().forEach((t=>{t.cancel()}))}cloneNode(t,e){var r=o({},this.attributes);for(var n in r){var i=r[n];js(i)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(r[n]=i.cloneNode(t)),e&&(r[n]=e(n,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((e=>{if(!e.style.isMarker){var r=e.cloneNode(t);a.appendChild(r)}})),a}initAttributes(){_s.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.renderable.dirty=!0}setAttribute(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=3>=arguments.length||void 0===arguments[3]||arguments[3];_t(e)||(r||e!==this.attributes[t])&&(this.internalSetAttribute(t,e,{memoize:n}),super.setAttribute(t,e))}internalSetAttribute(t,e){var r=this.renderable,n=this.attributes[t],i=this.parsedStyle[t];_s.styleValueRegistry.processProperties(this,{[t]:e},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),r.dirty=!0;var a=this.parsedStyle[t];this.isConnected&&(Ws.relatedNode=this,Ws.prevValue=n,Ws.newValue=e,Ws.attrName=t,Ws.prevParsedValue=i,Ws.newParsedValue=a,this.isMutationObserved?this.dispatchEvent(Ws):(Ws.target=this,this.ownerDocument.defaultView.dispatchEvent(Ws,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,n,e,i,a)}getBBox(){var t=this.getBounds(),e=d(t.getMin(),2),r=e[0],n=e[1],i=d(t.getMax(),2);return new Et(r,n,i[0]-r,i[1]-n)}setOrigin(t){return _s.sceneGraphService.setOrigin(this,Te(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}getOrigin(){return _s.sceneGraphService.getOrigin(this)}setPosition(t){return _s.sceneGraphService.setPosition(this,Te(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}setLocalPosition(t){return _s.sceneGraphService.setLocalPosition(this,Te(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}translate(t){return _s.sceneGraphService.translate(this,Te(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}translateLocal(t){return _s.sceneGraphService.translateLocal(this,Te(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}getPosition(){return _s.sceneGraphService.getPosition(this)}getLocalPosition(){return _s.sceneGraphService.getLocalPosition(this)}scale(t,e,r){return this.scaleLocal(t,e,r)}scaleLocal(t,e,r){return"number"==typeof t&&(t=Te(t,e=e||t,r=r||t,!1)),_s.sceneGraphService.scaleLocal(this,t),this}setLocalScale(t,e,r){return"number"==typeof t&&(t=Te(t,e=e||t,r=r||t,!1)),_s.sceneGraphService.setLocalScale(this,t),this}getLocalScale(){return _s.sceneGraphService.getLocalScale(this)}getScale(){return _s.sceneGraphService.getScale(this)}getEulerAngles(){return Ce(d(Re(qs,_s.sceneGraphService.getWorldTransform(this)),3)[2])}getLocalEulerAngles(){return Ce(d(Re(qs,_s.sceneGraphService.getLocalRotation(this)),3)[2])}setEulerAngles(t){return _s.sceneGraphService.setEulerAngles(this,0,0,t),this}setLocalEulerAngles(t){return _s.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}rotateLocal(t,e,r){return Tt(e)&&Tt(r)?_s.sceneGraphService.rotateLocal(this,0,0,t):_s.sceneGraphService.rotateLocal(this,t,e,r),this}rotate(t,e,r){return Tt(e)&&Tt(r)?_s.sceneGraphService.rotate(this,0,0,t):_s.sceneGraphService.rotate(this,t,e,r),this}setRotation(t,e,r,n){return _s.sceneGraphService.setRotation(this,t,e,r,n),this}setLocalRotation(t,e,r,n){return _s.sceneGraphService.setLocalRotation(this,t,e,r,n),this}setLocalSkew(t,e){return _s.sceneGraphService.setLocalSkew(this,t,e),this}getRotation(){return _s.sceneGraphService.getRotation(this)}getLocalRotation(){return _s.sceneGraphService.getLocalRotation(this)}getLocalSkew(){return _s.sceneGraphService.getLocalSkew(this)}getLocalTransform(){return _s.sceneGraphService.getLocalTransform(this)}getWorldTransform(){return _s.sceneGraphService.getWorldTransform(this)}setLocalTransform(t){return _s.sceneGraphService.setLocalTransform(this,t),this}resetLocalTransform(){_s.sceneGraphService.resetLocalTransform(this)}getAnimations(){return this.activeAnimations}animate(t,e){var r,n=null===(r=this.ownerDocument)||void 0===r?void 0:r.timeline;return n?n.play(this,t,e):null}isVisible(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}get interactive(){return this.isInteractive()}set interactive(t){this.style.pointerEvents=t?"auto":"none"}isInteractive(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}isCulled(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}toFront(){return this.parentNode&&(this.style.zIndex=Math.max(...this.parentNode.children.map((t=>Number(t.style.zIndex))))+1),this}toBack(){return this.parentNode&&(this.style.zIndex=Math.min(...this.parentNode.children.map((t=>Number(t.style.zIndex))))-1),this}getConfig(){return this.config}attr(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var n=e[0],i=e[1];return n?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(n)?(Object.keys(n).forEach((t=>{this.setAttribute(t,n[t])})),this):2===e.length?(this.setAttribute(n,i),this):this.attributes[n]:this.attributes}getMatrix(t){var e=t||this.getWorldTransform(),r=d(C(qs,e),2),n=r[0],i=r[1],a=d(k(qs,e),2),s=a[0],o=a[1],l=A(Zs,e),h=d(Re(qs,l),3);return Oe(h[0]||h[2],n,i,s,o)}getLocalMatrix(){return this.getMatrix(this.getLocalTransform())}setMatrix(t){var e=d(Le(t),5),r=e[0],n=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(r,n).setLocalScale(i,a)}setLocalMatrix(t){var e=d(Le(t),5),r=e[0],n=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(r,n).setLocalScale(i,a)}show(){this.forEach((t=>{t.style.visibility="visible"}))}hide(){this.forEach((t=>{t.style.visibility="hidden"}))}getCount(){return this.childElementCount}getParent(){return this.parentElement}getChildren(){return this.children}getFirst(){return this.firstElementChild}getLast(){return this.lastElementChild}getChildByIndex(t){return this.children[t]||null}add(t,e){return this.appendChild(t,e)}set(t,e){this.config[t]=e}get(t){return this.config[t]}moveTo(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}move(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}setZIndex(t){return this.style.zIndex=t,this}}class Ks extends $s{constructor(){super(o({type:l.CIRCLE},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}function Qs(t,e){if(null==t)return{};var r,n,i=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;a.length>n;n++)e.includes(r=a[n])||{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}var Js=["style"];class to extends $s{constructor(){super(o({type:l.ELLIPSE},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}class eo extends $s{constructor(){super(o({type:l.GROUP},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}var ro=["style"];class no extends $s{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=Qs(t,ro);super(o({type:l.HTML,style:e},r)),this.cullable.enable=!1}getDomElement(){return this.parsedStyle.$el}getClientRects(){return[this.getBoundingClientRect()]}getLocalBounds(){if(this.parentNode){var t=w(y(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!ft.isEmpty(e)){var r=new ft;return r.setFromTransformedAABB(e,t),r}}return this.getBounds()}}class io extends $s{constructor(){super(o({type:l.IMAGE},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}var ao=["style"];class so extends $s{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=Qs(t,ao);super(o({type:l.LINE,style:o({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},e)},r)),this.markerStartAngle=0,this.markerEndAngle=0;var n=this.parsedStyle,i=n.markerStart,a=n.markerEnd;i&&js(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i)),a&&js(a)&&(this.markerEndAngle=a.getLocalEulerAngles(),this.appendChild(a)),this.transformMarker(!0),this.transformMarker(!1)}attributeChangedCallback(t,e,r,n,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(n&&js(n)&&(this.markerStartAngle=0,n.remove()),i&&js(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(n&&js(n)&&(this.markerEndAngle=0,n.remove()),i&&js(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}transformMarker(t){var e=this.parsedStyle,r=e.markerStartOffset,n=e.markerEndOffset,i=e.x1,a=e.x2,s=e.y1,o=e.y2,l=t?e.markerStart:e.markerEnd;if(l&&js(l)){var h,c,u,d,p,v,f;t?(d=i,p=s,c=a-i,u=o-s,v=r||0,f=this.markerStartAngle):(d=a,p=o,c=i-a,u=s-o,v=n||0,f=this.markerEndAngle),l.setLocalEulerAngles(180*(h=Math.atan2(u,c))/Math.PI+f),l.setLocalPosition(d+Math.cos(h)*v,p+Math.sin(h)*v)}}getPoint(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.parsedStyle,n=Vn(r.x1,r.y1,r.x2,r.y2,t),i=n.x,a=n.y,s=j(I(),G(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new xt(s[0],s[1])}getPointAtLength(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}getTotalLength(){var t=this.parsedStyle;return Bn(t.x1,t.y1,t.x2,t.y2)}}var oo=["style"];class lo extends $s{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=Qs(t,oo);super(o({type:l.PATH,style:e,initialParsedStyle:{miterLimit:4,d:o({},qe)}},r)),this.markerStartAngle=0,this.markerEndAngle=0,this.markerMidList=[];var n=this.parsedStyle,i=n.markerStart,a=n.markerEnd,s=n.markerMid;i&&js(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i)),s&&js(s)&&this.placeMarkerMid(s),a&&js(a)&&(this.markerEndAngle=a.getLocalEulerAngles(),this.appendChild(a)),this.transformMarker(!0),this.transformMarker(!1)}attributeChangedCallback(t,e,r,n,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(n&&js(n)&&(this.markerStartAngle=0,n.remove()),i&&js(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(n&&js(n)&&(this.markerEndAngle=0,n.remove()),i&&js(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}transformMarker(t){var e=this.parsedStyle,r=e.markerStartOffset,n=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&js(i)){var a,s,o,l,h,c,u;if(t){var p=d(this.getStartTangent(),2),v=p[0],f=p[1];l=f[0],h=f[1],s=v[0]-f[0],o=v[1]-f[1],c=r||0,u=this.markerStartAngle}else{var g=d(this.getEndTangent(),2),m=g[0],y=g[1];l=y[0],h=y[1],s=m[0]-y[0],o=m[1]-y[1],c=n||0,u=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(o,s))/Math.PI+u),i.setLocalPosition(l+Math.cos(a)*c,h+Math.sin(a)*c)}}placeMarkerMid(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((t=>{t.remove()})),t&&js(t))for(var r=1;e.length-1>r;r++){var n=d(e[r].currentPoint,2),i=n[0],a=n[1],s=1===r?t:t.cloneNode(!0);this.markerMidList.push(s),this.appendChild(s),s.setLocalPosition(i,a)}}getTotalLength(){return qn(this)}getPointAtLength(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=function(t,e,r){return ye(t,e,Ft(Ft({},r),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),n=r.x,i=r.y,a=j(I(),G(n,i,0),e?this.getWorldTransform():this.getLocalTransform());return new xt(a[0],a[1])}getPoint(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*qn(this),e)}getStartTangent(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var r=t[0].currentPoint,n=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([r[0]-i[0],r[1]-i[1]]),e.push([r[0],r[1]])):(e.push([n[0],n[1]]),e.push([r[0],r[1]]))}return e}getEndTangent(){var t=this.parsedStyle.d.segments,e=t.length,r=[];if(e>1){var n=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;r=[],a?(r.push([i[0]-a[0],i[1]-a[1]]),r.push([i[0],i[1]])):(r.push([n[0],n[1]]),r.push([i[0],i[1]]))}return r}}var ho=["style"];class co extends $s{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=Qs(t,ho);super(o({type:l.POLYGON,style:e,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},r)),this.markerStartAngle=0,this.markerEndAngle=0,this.markerMidList=[];var n=this.parsedStyle,i=n.markerStart,a=n.markerEnd,s=n.markerMid;i&&js(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i)),s&&js(s)&&this.placeMarkerMid(s),a&&js(a)&&(this.markerEndAngle=a.getLocalEulerAngles(),this.appendChild(a)),this.transformMarker(!0),this.transformMarker(!1)}attributeChangedCallback(t,e,r,n,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(n&&js(n)&&(this.markerStartAngle=0,n.remove()),i&&js(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(n&&js(n)&&(this.markerEndAngle=0,n.remove()),i&&js(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}transformMarker(t){var e=this.parsedStyle,r=e.markerStartOffset,n=e.markerEndOffset,i=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&js(a)&&i){var s,o,l,h,c,u,d;if(h=i[0][0],c=i[0][1],t)o=i[1][0]-i[0][0],l=i[1][1]-i[0][1],u=r||0,d=this.markerStartAngle;else{var p=i.length;this.parsedStyle.isClosed?(o=i[p-1][0]-i[0][0],l=i[p-1][1]-i[0][1]):(h=i[p-1][0],c=i[p-1][1],o=i[p-2][0]-i[p-1][0],l=i[p-2][1]-i[p-1][1]),u=n||0,d=this.markerEndAngle}a.setLocalEulerAngles(180*(s=Math.atan2(l,o))/Math.PI+d),a.setLocalPosition(h+Math.cos(s)*u,c+Math.sin(s)*u)}}placeMarkerMid(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((t=>{t.remove()})),this.markerMidList=[],t&&js(t)&&e)for(var r=1;(this.parsedStyle.isClosed?e.length:e.length-1)>r;r++){var n=e[r][0],i=e[r][1],a=1===r?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(n,i)}}}var uo=["style"];class po extends co{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=Qs(t,uo);super(o({type:l.POLYLINE,style:e,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))}getTotalLength(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Hn(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}getPointAtLength(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}getPoint(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var n,i,a=[],s=0,o=this.getTotalLength();r.forEach(((t,e)=>{r[e+1]&&((n=[0,0])[0]=s/o,i=Bn(t[0],t[1],r[e+1][0],r[e+1][1]),n[1]=(s+=i)/o,a.push(n))})),this.parsedStyle.points.segments=a}var l=0,h=0;this.parsedStyle.points.segments.forEach(((e,r)=>{e[0]>t||t>e[1]||(l=(t-e[0])/(e[1]-e[0]),h=r)}));var c=Vn(r[h][0],r[h][1],r[h+1][0],r[h+1][1],l),u=c.x,d=c.y,p=j(I(),G(u,d,0),e?this.getWorldTransform():this.getLocalTransform());return new xt(p[0],p[1])}getStartTangent(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}getEndTangent(){var t=this.parsedStyle.points.points,e=t.length-1,r=[];return r.push([t[e-1][0],t[e-1][1]]),r.push([t[e][0],t[e][1]]),r}}class vo extends $s{constructor(){super(o({type:l.RECT},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}))}}var fo=["style"];class go extends $s{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.style,r=Qs(t,fo);super(o({type:l.TEXT,style:o({fill:"black"},e)},r))}getComputedTextLength(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}getLineBoundingRects(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}isOverflowing(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}class mo{constructor(){this.registry={},this.define(l.CIRCLE,Ks),this.define(l.ELLIPSE,to),this.define(l.RECT,vo),this.define(l.IMAGE,io),this.define(l.LINE,so),this.define(l.GROUP,eo),this.define(l.PATH,lo),this.define(l.POLYGON,co),this.define(l.POLYLINE,po),this.define(l.TEXT,go),this.define(l.HTML,no)}define(t,e){this.registry[t]=e}get(t){return this.registry[t]}}var yo={number:t=>new jr(t),percent:t=>new jr(t,"%"),px:t=>new jr(t,"px"),em:t=>new jr(t,"em"),rem:t=>new jr(t,"rem"),deg:t=>new jr(t,"deg"),grad:t=>new jr(t,"grad"),rad:t=>new jr(t,"rad"),turn:t=>new jr(t,"turn"),s:t=>new jr(t,"s"),ms:t=>new jr(t,"ms"),registerProperty:t=>{_s.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:(t,e)=>{_s.layoutRegistry.registerLayout(t,e)}};class xo extends ts{constructor(){super(),this.defaultView=null,this.ownerDocument=null,this.nodeName="document";try{this.timeline=new _s.AnimationTimeline(this)}catch(t){}var t={};Ai.forEach((e=>{var r=e.d;e.inh&&r&&(t[e.n]=Mt(r)?r(l.GROUP):r)})),this.documentElement=new eo({id:"g-root",style:t}),this.documentElement.ownerDocument=this,this.documentElement.parentNode=this,this.childNodes=[this.documentElement]}get children(){return this.childNodes}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.firstChild}get lastElementChild(){return this.lastChild}createElement(t,e){if("svg"===t)return this.documentElement;var r=this.defaultView.customElements.get(t);r||(console.warn("Unsupported tagName: ",t),r="tspan"===t?go:eo);var n=new r(e);return n.ownerDocument=this,n}createElementNS(t,e,r){return this.createElement(e,r)}cloneNode(t){throw Error(bt)}destroy(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}elementsFromBBox(t,e,r,n){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:r,maxY:n}),a=[];return i.forEach((t=>{var e=t.displayObject,r=e.parsedStyle.pointerEvents,n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===r?"auto":r);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort(((t,e)=>e.sortable.renderOrder-t.sortable.renderOrder)),a}elementFromPointSync(t,e){var r=this.defaultView.canvas2Viewport({x:t,y:e}),n=r.x,i=r.y,a=this.defaultView.getConfig();if(0>n||0>i||n>a.width||i>a.height)return null;var s=this.defaultView.viewport2Client({x:n,y:i}),o=s.x,l=s.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:n,viewportY:i,clientX:o,clientY:l},picked:[]}).picked;return h&&h[0]||this.documentElement}elementFromPoint(t,e){var r=this;return Ea(ya().mark((function n(){var i,a,s,o,l,h,c,u,d,p;return ya().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=r.defaultView.canvas2Viewport({x:t,y:e}),a=i.x,s=i.y,o=r.defaultView.getConfig(),l=o.width,h=o.height,!(0>a||0>s||a>l||s>h)){n.next=4;break}return n.abrupt("return",null);case 4:return c=r.defaultView.viewport2Client({x:a,y:s}),u=c.x,d=c.y,n.next=7,r.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:a,viewportY:s,clientX:u,clientY:d},picked:[]});case 7:return n.abrupt("return",(p=n.sent.picked)&&p[0]||r.documentElement);case 10:case"end":return n.stop()}}),n)})))()}elementsFromPointSync(t,e){var r=this.defaultView.canvas2Viewport({x:t,y:e}),n=r.x,i=r.y,a=this.defaultView.getConfig();if(0>n||0>i||n>a.width||i>a.height)return[];var s=this.defaultView.viewport2Client({x:n,y:i}),o=s.x,l=s.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:n,viewportY:i,clientX:o,clientY:l},picked:[]}).picked;return h[h.length-1]!==this.documentElement&&h.push(this.documentElement),h}elementsFromPoint(t,e){var r=this;return Ea(ya().mark((function n(){var i,a,s,o,l,h,c,u,d,p;return ya().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=r.defaultView.canvas2Viewport({x:t,y:e}),a=i.x,s=i.y,o=r.defaultView.getConfig(),l=o.width,h=o.height,!(0>a||0>s||a>l||s>h)){n.next=4;break}return n.abrupt("return",[]);case 4:return c=r.defaultView.viewport2Client({x:a,y:s}),u=c.x,d=c.y,n.next=7,r.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:a,viewportY:s,clientX:u,clientY:d},picked:[]});case 7:return(p=n.sent.picked)[p.length-1]!==r.documentElement&&p.push(r.documentElement),n.abrupt("return",p);case 11:case"end":return n.stop()}}),n)})))()}appendChild(t,e){throw Error(wt)}insertBefore(t,e){throw Error(wt)}removeChild(t,e){throw Error(wt)}replaceChild(t,e,r){throw Error(wt)}append(){throw Error(wt)}prepend(){throw Error(wt)}getElementById(t){return this.documentElement.getElementById(t)}getElementsByName(t){return this.documentElement.getElementsByName(t)}getElementsByTagName(t){return this.documentElement.getElementsByTagName(t)}getElementsByClassName(t){return this.documentElement.getElementsByClassName(t)}querySelector(t){return this.documentElement.querySelector(t)}querySelectorAll(t){return this.documentElement.querySelectorAll(t)}find(t){return this.documentElement.find(t)}findAll(t){return this.documentElement.findAll(t)}}class Eo{constructor(t){this.strategies=t}apply(t){var e=t.camera,r=t.renderingService,n=t.renderingContext,i=this.strategies;r.hooks.cull.tap(Eo.tag,(t=>{if(t){var r=t.cullable;return r.visible=0===i.length?n.unculledEntities.indexOf(t.entity)>-1:i.every((r=>r.isVisible(e,t))),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new Ka(os.CULLED)),null)}return t})),r.hooks.afterRender.tap(Eo.tag,(t=>{t.cullable.visibilityPlaneMask=-1}))}}Eo.tag="Culling";class bo{constructor(){this.autoPreventDefault=!1,this.rootPointerEvent=new qa(null),this.rootWheelEvent=new Za(null),this.onPointerMove=t=>{var e,r=null===(e=this.context.renderingContext.root)||void 0===e||null===(e=e.ownerDocument)||void 0===e?void 0:e.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var n,i=$a(this.normalizeToPointerEvent(t,r));try{for(i.s();!(n=i.n()).done;){var a=this.bootstrapEvent(this.rootPointerEvent,n.value,r,t);this.context.eventService.mapEvent(a)}}catch(t){i.e(t)}finally{i.f()}this.setCursor(this.context.eventService.cursor)}},this.onClick=t=>{var e,r,n=null===(e=this.context.renderingContext.root)||void 0===e||null===(e=e.ownerDocument)||void 0===e?void 0:e.defaultView,i=$a(this.normalizeToPointerEvent(t,n));try{for(i.s();!(r=i.n()).done;){var a=this.bootstrapEvent(this.rootPointerEvent,r.value,n,t);this.context.eventService.mapEvent(a)}}catch(t){i.e(t)}finally{i.f()}this.setCursor(this.context.eventService.cursor)}}apply(t){this.context=t;var e=t.renderingService,r=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((t=>this.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null)),e.hooks.pointerWheel.tap(bo.tag,(t=>{var e=this.normalizeWheelEvent(t);this.context.eventService.mapEvent(e)})),e.hooks.pointerDown.tap(bo.tag,(t=>{if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerEvent(t,r);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var n,i=$a(e);try{for(i.s();!(n=i.n()).done;){var a=this.bootstrapEvent(this.rootPointerEvent,n.value,r,t);this.context.eventService.mapEvent(a)}}catch(t){i.e(t)}finally{i.f()}this.setCursor(this.context.eventService.cursor)}})),e.hooks.pointerUp.tap(bo.tag,(t=>{if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e,n=this.context.contextService.getDomElement(),i=this.context.eventService.isNativeEventFromCanvas(n,t)?"":"outside",a=$a(this.normalizeToPointerEvent(t,r));try{for(a.s();!(e=a.n()).done;){var s=this.bootstrapEvent(this.rootPointerEvent,e.value,r,t);s.type+=i,this.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}this.setCursor(this.context.eventService.cursor)}})),e.hooks.pointerMove.tap(bo.tag,this.onPointerMove),e.hooks.pointerOver.tap(bo.tag,this.onPointerMove),e.hooks.pointerOut.tap(bo.tag,this.onPointerMove),e.hooks.click.tap(bo.tag,this.onClick),e.hooks.pointerCancel.tap(bo.tag,(t=>{var e,n=$a(this.normalizeToPointerEvent(t,r));try{for(n.s();!(e=n.n()).done;){var i=this.bootstrapEvent(this.rootPointerEvent,e.value,r,t);this.context.eventService.mapEvent(i)}}catch(t){n.e(t)}finally{n.f()}this.setCursor(this.context.eventService.cursor)}))}bootstrapEvent(t,e,r,n){t.view=r,t.originalEvent=null,t.nativeEvent=n,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.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.y;t.viewport.x=i.x,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),o=s.y;return t.canvas.x=s.x,t.canvas.y=o,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=n.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=na[t.type]||t.type),t}normalizeWheelEvent(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 r=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),n=r.y;e.viewport.x=r.x,e.viewport.y=n;var i=this.context.eventService.viewport2Canvas(e.viewport),a=i.y;return e.canvas.x=i.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=ia.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}setCursor(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}normalizeToPointerEvent(t,e){var r=[];if(e.isTouchEvent(t))for(var n=0;t.changedTouches.length>n;n++){var i=t.changedTouches[n];_t(i.button)&&(i.button=0),_t(i.buttons)&&(i.buttons=1),_t(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),_t(i.width)&&(i.width=i.radiusX||1),_t(i.height)&&(i.height=i.radiusY||1),_t(i.tiltX)&&(i.tiltX=0),_t(i.tiltY)&&(i.tiltY=0),_t(i.pointerType)&&(i.pointerType="touch"),_t(i.pointerId)&&(i.pointerId=i.identifier||0),_t(i.pressure)&&(i.pressure=i.force||.5),_t(i.twist)&&(i.twist=0),_t(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,r.push(i)}else if(e.isMouseEvent(t)){var a=t;_t(a.isPrimary)&&(a.isPrimary=!0),_t(a.width)&&(a.width=1),_t(a.height)&&(a.height=1),_t(a.tiltX)&&(a.tiltX=0),_t(a.tiltY)&&(a.tiltY=0),_t(a.pointerType)&&(a.pointerType="mouse"),_t(a.pointerId)&&(a.pointerId=1),_t(a.pressure)&&(a.pressure=.5),_t(a.twist)&&(a.twist=0),_t(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,r.push(a)}else r.push(t);return r}}bo.tag="Event";var wo=[l.CIRCLE,l.ELLIPSE,l.IMAGE,l.RECT,l.LINE,l.POLYLINE,l.POLYGON,l.TEXT,l.PATH,l.HTML];class Mo{isVisible(t,e){var r,n=e.cullable;if(!n.enable)return!0;var i=e.getRenderBounds();if(ft.isEmpty(i))return!1;var a=t.getFrustum(),s=null===(r=e.parentNode)||void 0===r||null===(r=r.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return n.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,s||mt.INDETERMINATE,a.planes),n.visible=n.visibilityPlaneMask!==mt.OUTSIDE,n.visible}computeVisibilityWithPlaneMask(t,e,r,n){if(r===mt.OUTSIDE||r===mt.INSIDE)return r;for(var i=mt.INSIDE,a=wo.indexOf(t.nodeName)>-1,s=0,o=n.length;o>s;++s){var l=1<<s;if(0!=(r&l)&&(!a||4!==s&&5!==s)){var h=n[s],c=h.normal,u=h.distance;if(0>X(c,e.getPositiveFarPoint(n[s]))+u)return mt.OUTSIDE;0>X(c,e.getNegativeFarPoint(n[s]))+u&&(i|=l)}}return i}}class To{constructor(){this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}apply(t){var e,r=t.renderingService,n=t.renderingContext.root.ownerDocument.defaultView;this.rBush=t.rBushRoot;var i=t=>{t.target.renderable.dirty=!0,r.dirtify()},a=t=>{this.syncTasks.set(t.target,t.detail.affectChildren),r.dirtify()},s=t=>{_s.enableSizeAttenuation&&_s.styleValueRegistry.updateSizeAttenuation(t.target,n.getCamera().getZoom())},o=t=>{var e=t.target,n=e.rBushNode;n.aabb&&this.rBush.remove(n.aabb),this.syncTasks.delete(e),_s.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(To.tag,(()=>{n.addEventListener(os.MOUNTED,s),n.addEventListener(os.UNMOUNTED,o),n.addEventListener(os.ATTR_MODIFIED,i),n.addEventListener(os.BOUNDS_CHANGED,a)})),r.hooks.destroy.tap(To.tag,(()=>{n.removeEventListener(os.MOUNTED,s),n.removeEventListener(os.UNMOUNTED,o),n.removeEventListener(os.ATTR_MODIFIED,i),n.removeEventListener(os.BOUNDS_CHANGED,a),this.syncTasks.clear()}));var l=null!==(e=_s.globalThis.requestIdleCallback)&&void 0!==e?e:fa.bind(_s.globalThis);r.hooks.endFrame.tap(To.tag,(()=>{this.isFirstTimeRendering?(this.isFirstTimeRendering=!1,this.syncing=!0,l((()=>{this.syncRTree(!0),this.isFirstTimeRenderingFinished=!0}))):this.syncRTree()}))}syncNode(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var r=t.rBushNode;r.aabb&&this.rBush.remove(r.aabb);var n=t.getRenderBounds();if(n){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new ft),i.dirtyRenderBounds.update(n.center,n.halfExtents));var a=d(n.getMin(),2),s=a[0],o=a[1],l=d(n.getMax(),2),h=l[0],c=l[1];r.aabb||(r.aabb={}),r.aabb.displayObject=t,r.aabb.minX=s,r.aabb.minY=o,r.aabb.maxX=h,r.aabb.maxY=c}return r.aabb&&!(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY))?r.aabb:void 0}}syncRTree(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var e=[],r=new Set,n=n=>{if(!r.has(n)&&n.renderable){var i=this.syncNode(n,t);i&&(e.push(i),r.add(n))}};this.syncTasks.forEach(((t,e)=>{t&&e.forEach(n);for(var r=e;r;)n(r),r=r.parentElement})),this.rBush.load(e),e.length=0,this.syncing=!1}}}To.tag="Prepare";var No=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Po=new Ka(os.MOUNTED),So=new Ka(os.UNMOUNTED),Co=new Ka(No.BEFORE_RENDER),ko=new Ka(No.RERENDER),Ao=new Ka(No.AFTER_RENDER);t.AABB=ft,t.AbstractRenderer=class{constructor(t){this.clipSpaceNearZ=h.NEGATIVE_ONE,this.plugins=[],this.config=o({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},t)}registerPlugin(t){-1===this.plugins.findIndex((e=>e===t))&&this.plugins.push(t)}unregisterPlugin(t){var e=this.plugins.findIndex((e=>e===t));e>-1&&this.plugins.splice(e,1)}getPlugins(){return this.plugins}getPlugin(t){return this.plugins.find((e=>e.name===t))}getConfig(){return this.config}setConfig(t){Object.assign(this.config,t)}},t.AbstractRendererPlugin=class{constructor(){this.plugins=[]}addRenderingPlugin(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}removeAllRenderingPlugins(){this.plugins.forEach((t=>{var e=this.context.renderingPlugins.indexOf(t);0>e||this.context.renderingPlugins.splice(e,1)}))}},t.BUILT_IN_PROPERTIES=Ai,t.CSS=yo,t.CSSGradientValue=Yr,t.CSSKeywordValue=Xr,t.CSSRGB=qr,t.CSSStyleValue=Br,t.CSSUnitValue=jr,t.Camera=je,t.CameraEvent=Xe,t.CameraProjectionMode=Ye,t.CameraTrackingMode=Ue,t.CameraType=Ve,t.Canvas=class extends Ja{constructor(t){super(),this.Element=$s,this.inited=!1,this.context={},this.document=new xo,this.document.defaultView=this,this.customElements=new mo;var e=t.container,r=t.canvas,n=t.offscreenCanvas,i=t.width,a=t.height,s=t.devicePixelRatio,o=t.renderer,l=t.background,h=t.cursor,c=t.document,u=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,v=t.enableLargeImageOptimization,f=t.supportsPointerEvents,g=t.supportsTouchEvents,m=t.supportsCSSTransform,y=t.cleanUpOnDestroy,x=void 0===y||y,E=t.useNativeClickEvent,b=t.alwaysTriggerPointerEventOnCanvas,w=t.isTouchEvent,M=t.isMouseEvent,T=t.dblClickSpeed;t.supportsMutipleCanvasesInOneContainer||Ki(e,this,x);var N=i,P=a,S=s;r&&(S=1>(S=s||Qi&&window.devicePixelRatio||1)?1:Math.ceil(S),N=i||function(t){var e=ra(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(r)||r.width/S,P=a||function(t){var e=ra(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(r)||r.height/S),n&&(_s.offscreenCanvas=n),this.devicePixelRatio=S,this.requestAnimationFrame=null!=u?u:fa.bind(_s.globalThis),this.cancelAnimationFrame=null!=d?d:ga.bind(_s.globalThis),this.supportsTouchEvents=null!=g?g:"ontouchstart"in _s.globalThis,this.supportsPointerEvents=null!=f?f:!!_s.globalThis.PointerEvent,this.isTouchEvent=null!=w?w:t=>this.supportsTouchEvents&&t instanceof _s.globalThis.TouchEvent,this.isMouseEvent=null!=M?M:t=>!_s.globalThis.MouseEvent||t instanceof _s.globalThis.MouseEvent&&(!this.supportsPointerEvents||!(t instanceof _s.globalThis.PointerEvent)),this.dblClickSpeed=null!=T?T:200,this.initRenderingContext({container:e,canvas:r,width:N,height:P,renderer:o,offscreenCanvas:n,devicePixelRatio:S,cursor:h||"default",background:l||"transparent",createImage:p,enableLargeImageOptimization:v,document:c,supportsCSSTransform:m,useNativeClickEvent:E,cleanUpOnDestroy:x,alwaysTriggerPointerEventOnCanvas:b}),this.initDefaultCamera(N,P,o.clipSpaceNearZ),this.initRenderer(o,!0)}initRenderingContext(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}initDefaultCamera(t,e,r){var n=new _s.CameraContribution;n.clipSpaceNearZ=r,n.setType(Ve.EXPLORING,Ue.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),n.canvas=this,n.eventEmitter.on(Xe.UPDATED,(()=>{this.context.renderingContext.renderReasons.add(ns.CAMERA_CHANGED),_s.enableSizeAttenuation&&this.getConfig().renderer.getConfig().enableSizeAttenuation&&this.updateSizeAttenuation()})),this.context.camera=n}updateSizeAttenuation(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((e=>{_s.styleValueRegistry.updateSizeAttenuation(e,t)}))}getConfig(){return this.context.config}getRoot(){return this.document.documentElement}getCamera(){return this.context.camera}getContextService(){return this.context.contextService}getEventService(){return this.context.eventService}getRenderingService(){return this.context.renderingService}getRenderingContext(){return this.context.renderingContext}getStats(){return this.getRenderingService().getStats()}get ready(){return this.readyPromise||(this.readyPromise=new Promise((t=>{this.resolveReadyPromise=()=>{t(this)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}destroy(){var t=0>=arguments.length||void 0===arguments[0]||arguments[0],e=arguments.length>1?arguments[1]:void 0;(void 0===e&&(e=this.getConfig().fastCleanExistingCanvas),e||this.dispatchEvent(new Ka(No.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new Ka(No.AFTER_DESTROY));var n=t=>{t.currentTarget=null,t.manager=null,t.target=null};n(Po),n(So),n(Co),n(ko),n(Ao),this.cancelAnimationFrame(this.frameId)}changeSize(t,e){this.resize(t,e)}resize(t,e){var r=this.context.config;r.width=t,r.height=e,this.getContextService().resize(t,e);var n=this.context.camera,i=n.getProjectionMode();n.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===Ye.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new Ka(No.RESIZE,{width:t,height:e}))}appendChild(t,e){return this.document.documentElement.appendChild(t,e)}insertBefore(t,e){return this.document.documentElement.insertBefore(t,e)}removeChild(t){return this.document.documentElement.removeChild(t)}removeChildren(){this.document.documentElement.removeChildren()}destroyChildren(){this.document.documentElement.destroyChildren()}render(t){t&&(Co.detail=t,Ao.detail=t),this.dispatchEvent(Co),this.getRenderingService().render(this.getConfig(),t,(()=>{this.dispatchEvent(ko)})),this.dispatchEvent(Ao)}run(){var t=(e,r)=>{this.render(r),this.frameId=this.requestAnimationFrame(t)};t()}initRenderer(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new r,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new bo,new To,new Eo([new Mo])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(o(o({},_s),this.context)),this.context.renderingService=new is(_s,this.context),this.context.eventService=new es(_s,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((()=>{this.initRenderingService(t,e)}))}initRenderingService(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((()=>{this.inited=!0,e?r?this.requestAnimationFrame((()=>{this.dispatchEvent(new Ka(No.READY))})):this.dispatchEvent(new Ka(No.READY)):this.dispatchEvent(new Ka(No.RENDERER_CHANGED)),this.readyPromise&&this.resolveReadyPromise(),e||this.getRoot().forEach((t=>{var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),t.getConfig().enableAutoRendering&&this.run()}))}loadRendererContainerModule(t){t.getPlugins().forEach((t=>{t.context=this.context,t.init(_s)}))}setRenderer(t){var e=this.getConfig();if(e.renderer!==t){var r=e.renderer;e.renderer=t,this.destroy(!1,!0),[...(null==r?void 0:r.getPlugins())||[]].reverse().forEach((t=>{t.destroy(_s)})),this.initRenderer(t)}}setCursor(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}unmountChildren(t){t.childNodes.forEach((t=>{this.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(So):(So.target=t,this.dispatchEvent(So,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}mountChildren(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:aa(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,e||(t.isMutationObserved?t.dispatchEvent(Po):(Po.target=t,this.dispatchEvent(Po,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((t=>{this.mountChildren(t,e)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}mountFragment(t){this.mountChildren(t,!1)}client2Viewport(t){return this.getEventService().client2Viewport(t)}viewport2Client(t){return this.getEventService().viewport2Client(t)}viewport2Canvas(t){return this.getEventService().viewport2Canvas(t)}canvas2Viewport(t){return this.getEventService().canvas2Viewport(t)}getPointByClient(t,e){return this.client2Viewport({x:t,y:e})}getClientByPoint(t,e){return this.viewport2Client({x:t,y:e})}},t.CanvasEvent=No,t.Circle=Ks,t.CircleUpdater=_a,t.ClipSpaceNearZ=h,t.CustomElement=class extends $s{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(o({style:t.style},Qs(t,Js))),this.isCustomElement=!0}},t.CustomElementRegistry=mo,t.CustomEvent=Ka,t.DefaultSceneGraphSelector=ss,t.DefaultSceneGraphService=ks,t.DisplayObject=$s,t.Document=xo,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=bt,t.Element=Hs,t.ElementEvent=os,t.Ellipse=to,t.EllipseUpdater=Fa,t.EventService=es,t.EventTarget=Ja,t.FederatedEvent=za,t.FederatedMouseEvent=Wa,t.FederatedPointerEvent=qa,t.FederatedWheelEvent=Za,t.Fragment=class extends $s{constructor(){super({type:l.FRAGMENT})}},t.Frustum=yt,t.GradientType=Ur,t.Group=eo,t.GroupUpdater=Ha,t.HTML=no,t.HTMLUpdater=ja,t.Image=io,t.Line=so,t.LineUpdater=Ba,t.Mask=mt,t.MutationEvent=ls,t.Node=ts,t.OffscreenCanvasCreator=rs,t.Path=lo,t.PathUpdater=Va,t.Plane=gt,t.Point=xt,t.Polygon=co,t.Polyline=po,t.PolylineUpdater=Ua,t.PropertySyntax=Ze,t.RBush=r,t.Rect=vo,t.RectUpdater=Ya,t.Rectangle=Et,t.RenderReason=ns,t.RenderingService=is,t.Shape=l,t.SortReason=We,t.Strategy=ze,t.Text=go,t.TextService=Is,t.TextUpdater=Xa,t.UnitType=Ar,t.computeLinearGradient=function(t,e,r,n){var i=Pe(n.value),a=0+e/2,s=0+r/2,o=Math.abs(e*Math.cos(i))+Math.abs(r*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*o/2,y1:t[1]+s-Math.sin(i)*o/2,x2:t[0]+a+Math.cos(i)*o/2,y2:t[1]+s+Math.sin(i)*o/2}},t.computeRadialGradient=function(t,e,r,n,i,a){var s=n.value,o=i.value;n.unit===Ar.kPercentage&&(s=n.value/100*e),i.unit===Ar.kPercentage&&(o=i.value/100*r);var l=Math.max(he([0,0],[s,o]),he([0,r],[s,o]),he([e,r],[s,o]),he([e,0],[s,o]));return a&&(a instanceof jr?l=a.value:a instanceof Xr&&("closest-side"===a.value?l=Math.min(s,e-s,o,r-o):"farthest-side"===a.value?l=Math.max(s,e-s,o,r-o):"closest-corner"===a.value&&(l=Math.min(he([0,0],[s,o]),he([0,r],[s,o]),he([e,r],[s,o]),he([e,0],[s,o]))))),{x:s+t[0],y:o+t[1],r:l}},t.convertToPath=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),r=[];switch(t.nodeName){case l.LINE:var n=t.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2;r=function(t,e,r,n){return[["M",t,e],["L",r,n]]}(void 0===i?0:i,void 0===a?0:a,void 0===s?0:s,void 0===o?0:o);break;case l.CIRCLE:var h=t.parsedStyle,c=h.r,u=void 0===c?0:c,p=h.cx,v=h.cy;r=ai(u,u,void 0===p?0:p,void 0===v?0:v);break;case l.ELLIPSE:var f=t.parsedStyle,g=f.rx,m=f.ry,y=f.cx,x=f.cy;r=ai(void 0===g?0:g,void 0===m?0:m,void 0===y?0:y,void 0===x?0:x);break;case l.POLYLINE:case l.POLYGON:r=function(t,e){var r=t.map(((t,e)=>[0===e?"M":"L",t[0],t[1]]));return e&&r.push(["Z"]),r}(t.parsedStyle.points.points,t.nodeName===l.POLYGON);break;case l.RECT:var E=t.parsedStyle,b=E.width,w=void 0===b?0:b,M=E.height,T=void 0===M?0:M,N=E.x,P=void 0===N?0:N,S=E.y,C=void 0===S?0:S,k=E.radius,A=k&&k.some((t=>0!==t));r=function(t,e,r,n,i){if(i){var a=d(i,4),s=a[0],o=a[1],l=a[2],h=a[3],c=t>0?1:-1,u=e>0?1:-1,p=c+u!==0?1:0;return[["M",c*s+r,n],["L",t-c*o+r,n],o?["A",o,o,0,0,p,t+r,u*o+n]:null,["L",t+r,e-u*l+n],l?["A",l,l,0,0,p,t+r-c*l,e+n]:null,["L",r+c*h,e+n],h?["A",h,h,0,0,p,r,e+n-u*h]:null,["L",r,u*s+n],s?["A",s,s,0,0,p,c*s+r,n]:null,["Z"]].filter((t=>t))}return[["M",r,n],["L",r+t,n],["L",r+t,n+e],["L",r,n+e],["Z"]]}(w,T,P,C,A&&k.map((t=>Rt(t,0,Math.min(Math.abs(w)/2,Math.abs(T)/2)))));break;case l.PATH:r=[...t.parsedStyle.d.absolutePath]}if(r.length)return function(t,e,r){return t.reduce(((t,e)=>{var n="";if("M"===e[0]||"L"===e[0]){var i=G(e[1],e[2],0);r&&j(i,i,r),n="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])n=e[0];else if("C"===e[0]){var a=G(e[1],e[2],0),s=G(e[3],e[4],0),o=G(e[5],e[6],0);r&&(j(a,a,r),j(s,s,r),j(o,o,r)),n="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(s[0],",").concat(s[1],",").concat(o[0],",").concat(o[1])}else if("A"===e[0]){var l=G(e[6],e[7],0);r&&j(l,l,r),n="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(l[0],",").concat(l[1])}else if("Q"===e[0]){var h=G(e[1],e[2],0),c=G(e[3],e[4],0);r&&(j(h,h,r),j(c,c,r)),n="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+n}),"")}(r,0,e)},t.createVec3=Te,t.decompose=Le,t.definedProps=t=>Object.fromEntries(Object.entries(t).filter((t=>void 0!==d(t,2)[1]))),t.deg2rad=Pe,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=ea,t.fromRotationTranslationScale=Oe,t.getAngle=we,t.getEuler=Re,t.getOrCalculatePathTotalLength=qn,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.isBrowser=Qi,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=pn,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=js,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(n=!!e&&!e.isNone,i=!!r&&!r.isNone):"visiblefill"===t||"fill"===t?n=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(n=!0,i=!0),[n,i]},t.isPattern=dn,t.mergeColors=fn,t.parseColor=vn,t.parseLength=yn,t.parsePath=li,t.parseTransform=mi,t.parsedTransformToMat4=La,t.propertyMetadataCache=Oi,t.rad2deg=Ce,t.resetEntityCounter=function(){Vs=0},t.runtime=_s,t.setDOMSize=function(t,e,r){Qi&&t.style&&(t.style.width=e+"px",t.style.height=r+"px")},t.translatePathToString=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=t.map(((a,s)=>{var o=t[s+1],l=0===s&&(0!==e||0!==r),h=(s===t.length-1||o&&("M"===o[0]||"Z"===o[0]))&&0!==n&&0!==i;switch(a[0]){case"M":return l?"M ".concat(a[1]+e,",").concat(a[2]+r," L ").concat(a[1],",").concat(a[2]):"M ".concat(a[1],",").concat(a[2]);case"L":return"L ".concat(a[1]+(h?n:0),",").concat(a[2]+(h?i:0));case"Q":return"Q ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4]).concat(h?" L ".concat(a[3]+n,",").concat(a[4]+i):"");case"C":return"C ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4],",").concat(a[5]," ").concat(a[6]).concat(h?" L ".concat(a[5]+n,",").concat(a[6]+i):"");case"A":return"A ".concat(a[1]," ").concat(a[2]," ").concat(a[3]," ").concat(a[4]," ").concat(a[5]," ").concat(a[6]," ").concat(a[7]).concat(h?" L ".concat(a[6]+n,",").concat(a[7]+i):"");case"Z":return"Z";default:return null}})).filter((t=>null!==t)).join(" ");return~a.indexOf("NaN")?"":a},t.turn2deg=ke}));
2
18
  //# sourceMappingURL=index.umd.min.js.map