archgine 1.0.78 → 2.0.2

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 (502) hide show
  1. package/lib/animations/animation-action.d.ts +1 -0
  2. package/lib/animations/animation-action.d.ts.map +1 -0
  3. package/lib/animations/animation-clip.d.ts +1 -0
  4. package/lib/animations/animation-clip.d.ts.map +1 -0
  5. package/lib/animations/animation-mixer.d.ts +3 -1
  6. package/lib/animations/animation-mixer.d.ts.map +1 -0
  7. package/lib/animations/animation-utils.d.ts +1 -0
  8. package/lib/animations/animation-utils.d.ts.map +1 -0
  9. package/lib/animations/keyframe-track.d.ts +1 -0
  10. package/lib/animations/keyframe-track.d.ts.map +1 -0
  11. package/lib/animations/property-binding.d.ts +1 -0
  12. package/lib/animations/property-binding.d.ts.map +1 -0
  13. package/lib/animations/property-mixer.d.ts +1 -0
  14. package/lib/animations/property-mixer.d.ts.map +1 -0
  15. package/lib/animations/tracks/boolean-keyframe-track.d.ts +1 -0
  16. package/lib/animations/tracks/boolean-keyframe-track.d.ts.map +1 -0
  17. package/lib/animations/tracks/color-keyframe-track.d.ts +1 -0
  18. package/lib/animations/tracks/color-keyframe-track.d.ts.map +1 -0
  19. package/lib/animations/tracks/number-keyframe-track.d.ts +1 -0
  20. package/lib/animations/tracks/number-keyframe-track.d.ts.map +1 -0
  21. package/lib/animations/tracks/string-keyframe-track.d.ts +1 -0
  22. package/lib/animations/tracks/string-keyframe-track.d.ts.map +1 -0
  23. package/lib/animations/tracks/vector1-keyframe-track.d.ts +1 -0
  24. package/lib/animations/tracks/vector1-keyframe-track.d.ts.map +1 -0
  25. package/lib/animations/tracks/vector2-keyframe-track.d.ts +1 -0
  26. package/lib/animations/tracks/vector2-keyframe-track.d.ts.map +1 -0
  27. package/lib/applications/app2-offscreen.d.ts +92 -0
  28. package/lib/applications/app2-offscreen.d.ts.map +1 -0
  29. package/lib/applications/app2.d.ts +111 -0
  30. package/lib/applications/app2.d.ts.map +1 -0
  31. package/lib/applications/app3-director.d.ts +18 -0
  32. package/lib/applications/app3-director.d.ts.map +1 -0
  33. package/lib/applications/app3-offscreen.d.ts +27 -0
  34. package/lib/applications/app3-offscreen.d.ts.map +1 -0
  35. package/lib/applications/app3.d.ts +59 -0
  36. package/lib/applications/app3.d.ts.map +1 -0
  37. package/lib/controls/drag-controller.d.ts +1 -0
  38. package/lib/controls/drag-controller.d.ts.map +1 -0
  39. package/lib/controls/el-proxy-hammer.d.ts +32 -0
  40. package/lib/controls/el-proxy-hammer.d.ts.map +1 -0
  41. package/lib/controls/el-proxy.d.ts +54 -0
  42. package/lib/controls/el-proxy.d.ts.map +1 -0
  43. package/lib/controls/handler.d.ts +63 -0
  44. package/lib/controls/handler.d.ts.map +1 -0
  45. package/lib/controls/orbit-controller.d.ts +2 -0
  46. package/lib/controls/orbit-controller.d.ts.map +1 -0
  47. package/lib/controls/orbit-controls.d.ts +3 -2
  48. package/lib/controls/orbit-controls.d.ts.map +1 -0
  49. package/lib/controls/orbit-controls2.d.ts +162 -0
  50. package/lib/controls/orbit-controls2.d.ts.map +1 -0
  51. package/lib/core/camera2.d.ts +3 -2
  52. package/lib/core/camera2.d.ts.map +1 -0
  53. package/lib/core/clock.d.ts +1 -0
  54. package/lib/core/clock.d.ts.map +1 -0
  55. package/lib/core/event-dispatcher.d.ts +1 -0
  56. package/lib/core/event-dispatcher.d.ts.map +1 -0
  57. package/lib/core/global.d.ts +92 -1
  58. package/lib/core/global.d.ts.map +1 -0
  59. package/lib/{objects → core}/group2.d.ts +2 -1
  60. package/lib/core/group2.d.ts.map +1 -0
  61. package/lib/core/lights3.d.ts +11 -0
  62. package/lib/core/lights3.d.ts.map +1 -0
  63. package/lib/core/monitor.d.ts +1 -0
  64. package/lib/core/monitor.d.ts.map +1 -0
  65. package/lib/core/object2.d.ts +6 -3
  66. package/lib/core/object2.d.ts.map +1 -0
  67. package/lib/core/queue.d.ts +1 -0
  68. package/lib/core/queue.d.ts.map +1 -0
  69. package/lib/core/ray-caster.d.ts +7 -1
  70. package/lib/core/ray-caster.d.ts.map +1 -0
  71. package/lib/core/texture.d.ts +20 -0
  72. package/lib/core/texture.d.ts.map +1 -0
  73. package/lib/core/tic.d.ts +3 -1
  74. package/lib/core/tic.d.ts.map +1 -0
  75. package/lib/core/transformable2.d.ts +27 -0
  76. package/lib/core/transformable2.d.ts.map +1 -0
  77. package/lib/core/{view.d.ts → view2.d.ts} +20 -12
  78. package/lib/core/view2.d.ts.map +1 -0
  79. package/lib/core/view3.d.ts +70 -0
  80. package/lib/core/view3.d.ts.map +1 -0
  81. package/lib/dummies/dummy2-point.d.ts +9 -0
  82. package/lib/dummies/dummy2-point.d.ts.map +1 -0
  83. package/lib/dummies/dummy2-rect.d.ts +9 -0
  84. package/lib/dummies/dummy2-rect.d.ts.map +1 -0
  85. package/lib/dummies/dummy2.d.ts +21 -0
  86. package/lib/dummies/dummy2.d.ts.map +1 -0
  87. package/lib/editor/editor.d.ts +67 -0
  88. package/lib/editor/editor.d.ts.map +1 -0
  89. package/lib/editor/interfaces.d.ts +61 -0
  90. package/lib/editor/interfaces.d.ts.map +1 -0
  91. package/lib/editor/tool-manager.d.ts +45 -0
  92. package/lib/editor/tool-manager.d.ts.map +1 -0
  93. package/lib/editor/tools/base-tool.d.ts +20 -0
  94. package/lib/editor/tools/base-tool.d.ts.map +1 -0
  95. package/lib/editor/tools/distribution-tool.d.ts +20 -0
  96. package/lib/editor/tools/distribution-tool.d.ts.map +1 -0
  97. package/lib/editor/tools/drag-tool.d.ts +27 -0
  98. package/lib/editor/tools/drag-tool.d.ts.map +1 -0
  99. package/lib/editor/tools/draw-point-tool.d.ts +10 -0
  100. package/lib/editor/tools/draw-point-tool.d.ts.map +1 -0
  101. package/lib/editor/tools/dummy-tool.d.ts +57 -0
  102. package/lib/editor/tools/dummy-tool.d.ts.map +1 -0
  103. package/lib/editor/tools/hover-tool.d.ts +20 -0
  104. package/lib/editor/tools/hover-tool.d.ts.map +1 -0
  105. package/lib/editor/tools/index.d.ts +3 -0
  106. package/lib/editor/tools/index.d.ts.map +1 -0
  107. package/lib/editor/tools/linker-tool.d.ts +19 -0
  108. package/lib/editor/tools/linker-tool.d.ts.map +1 -0
  109. package/lib/editor/tools/select-tool.d.ts +32 -0
  110. package/lib/editor/tools/select-tool.d.ts.map +1 -0
  111. package/lib/editor/tools/selector-rect-tool.d.ts +21 -0
  112. package/lib/editor/tools/selector-rect-tool.d.ts.map +1 -0
  113. package/lib/editor/tools/tips-tool.d.ts +13 -0
  114. package/lib/editor/tools/tips-tool.d.ts.map +1 -0
  115. package/lib/effects/clear-pass.d.ts +1 -0
  116. package/lib/effects/clear-pass.d.ts.map +1 -0
  117. package/lib/effects/debounce-pass.d.ts +2 -0
  118. package/lib/effects/debounce-pass.d.ts.map +1 -0
  119. package/lib/effects/debounce-pass2.d.ts +29 -0
  120. package/lib/effects/debounce-pass2.d.ts.map +1 -0
  121. package/lib/effects/debounce-pass3.d.ts +38 -0
  122. package/lib/effects/debounce-pass3.d.ts.map +1 -0
  123. package/lib/effects/dynamic-pass3.d.ts +11 -0
  124. package/lib/effects/dynamic-pass3.d.ts.map +1 -0
  125. package/lib/effects/effect-composer.d.ts +2 -1
  126. package/lib/effects/effect-composer.d.ts.map +1 -0
  127. package/lib/effects/effect-director.d.ts +7 -3
  128. package/lib/effects/effect-director.d.ts.map +1 -0
  129. package/lib/effects/final-pass.d.ts +3 -2
  130. package/lib/effects/final-pass.d.ts.map +1 -0
  131. package/lib/effects/final-pass3.d.ts +6 -0
  132. package/lib/effects/final-pass3.d.ts.map +1 -0
  133. package/lib/effects/output-pass.d.ts +1 -0
  134. package/lib/effects/output-pass.d.ts.map +1 -0
  135. package/lib/effects/paper-pass.d.ts +5 -0
  136. package/lib/effects/paper-pass.d.ts.map +1 -0
  137. package/lib/effects/pass.d.ts +1 -0
  138. package/lib/effects/pass.d.ts.map +1 -0
  139. package/lib/effects/render-cached-pass.d.ts +1 -0
  140. package/lib/effects/render-cached-pass.d.ts.map +1 -0
  141. package/lib/effects/render-pass.d.ts +1 -0
  142. package/lib/effects/render-pass.d.ts.map +1 -0
  143. package/lib/effects/save-pass.d.ts +1 -0
  144. package/lib/effects/save-pass.d.ts.map +1 -0
  145. package/lib/effects/shadow-pass3.d.ts +16 -0
  146. package/lib/effects/shadow-pass3.d.ts.map +1 -0
  147. package/lib/effects/texture-pass.d.ts +3 -2
  148. package/lib/effects/texture-pass.d.ts.map +1 -0
  149. package/lib/env/conf.zh.d.ts +1 -0
  150. package/lib/env/conf.zh.d.ts.map +1 -0
  151. package/lib/env/constants.d.ts +1 -0
  152. package/lib/env/constants.d.ts.map +1 -0
  153. package/lib/env/default-config.d.ts +99 -0
  154. package/lib/env/default-config.d.ts.map +1 -0
  155. package/lib/env/enums.d.ts +3 -0
  156. package/lib/env/enums.d.ts.map +1 -0
  157. package/lib/env/index.d.ts +1 -0
  158. package/lib/env/index.d.ts.map +1 -0
  159. package/lib/environment.worker.js +2 -4296
  160. package/lib/environment.worker.js.map +1 -0
  161. package/lib/extras/adapter2.d.ts +44 -0
  162. package/lib/extras/adapter2.d.ts.map +1 -0
  163. package/lib/extras/adapter3.d.ts +28 -0
  164. package/lib/extras/adapter3.d.ts.map +1 -0
  165. package/lib/extras/drag.d.ts +1 -0
  166. package/lib/extras/drag.d.ts.map +1 -0
  167. package/lib/extras/dummy-point.d.ts +2 -1
  168. package/lib/extras/dummy-point.d.ts.map +1 -0
  169. package/lib/extras/dummy-rect.d.ts +2 -1
  170. package/lib/extras/dummy-rect.d.ts.map +1 -0
  171. package/lib/extras/dynamic-draw-rect.d.ts +2 -1
  172. package/lib/extras/dynamic-draw-rect.d.ts.map +1 -0
  173. package/lib/extras/interfaces.d.ts +3 -2
  174. package/lib/extras/interfaces.d.ts.map +1 -0
  175. package/lib/extras/label.d.ts +2 -1
  176. package/lib/extras/label.d.ts.map +1 -0
  177. package/lib/extras/svg-app.d.ts +52 -6
  178. package/lib/extras/svg-app.d.ts.map +1 -0
  179. package/lib/extras/svg-chef.d.ts +3 -4
  180. package/lib/extras/svg-chef.d.ts.map +1 -0
  181. package/lib/extras/svg-dummies.d.ts +1 -0
  182. package/lib/extras/svg-dummies.d.ts.map +1 -0
  183. package/lib/extras/svg-multi-selector.d.ts +2 -1
  184. package/lib/extras/svg-multi-selector.d.ts.map +1 -0
  185. package/lib/extras/svg-painter.d.ts +1 -0
  186. package/lib/extras/svg-painter.d.ts.map +1 -0
  187. package/lib/extras/svg-view.d.ts +6 -5
  188. package/lib/extras/svg-view.d.ts.map +1 -0
  189. package/lib/extras/tooltip.d.ts +1 -0
  190. package/lib/extras/tooltip.d.ts.map +1 -0
  191. package/lib/helpers/axes-helper3.d.ts +20 -0
  192. package/lib/helpers/axes-helper3.d.ts.map +1 -0
  193. package/lib/helpers/cache.d.ts +1 -0
  194. package/lib/helpers/cache.d.ts.map +1 -0
  195. package/lib/helpers/canvas-helper.d.ts +7 -14
  196. package/lib/helpers/canvas-helper.d.ts.map +1 -0
  197. package/lib/helpers/geo-helper.d.ts +15 -11
  198. package/lib/helpers/geo-helper.d.ts.map +1 -0
  199. package/lib/helpers/geo3-helper.d.ts +5 -0
  200. package/lib/helpers/geo3-helper.d.ts.map +1 -0
  201. package/lib/helpers/loading-manager.d.ts +1 -0
  202. package/lib/helpers/loading-manager.d.ts.map +1 -0
  203. package/lib/helpers/mtl-helper.d.ts +11 -0
  204. package/lib/helpers/mtl-helper.d.ts.map +1 -0
  205. package/lib/helpers/obj3-helper.d.ts +4 -0
  206. package/lib/helpers/obj3-helper.d.ts.map +1 -0
  207. package/lib/helpers/sax-helper.d.ts +1 -0
  208. package/lib/helpers/sax-helper.d.ts.map +1 -0
  209. package/lib/helpers/shape2-helper.d.ts +27 -0
  210. package/lib/helpers/shape2-helper.d.ts.map +1 -0
  211. package/lib/helpers/shape3-helper.d.ts +11 -0
  212. package/lib/helpers/shape3-helper.d.ts.map +1 -0
  213. package/lib/helpers/sprite-helper.d.ts +10 -0
  214. package/lib/helpers/sprite-helper.d.ts.map +1 -0
  215. package/lib/helpers/svg-helper.d.ts +69 -51
  216. package/lib/helpers/svg-helper.d.ts.map +1 -0
  217. package/lib/helpers/texture-helper.d.ts +26 -27
  218. package/lib/helpers/texture-helper.d.ts.map +1 -0
  219. package/lib/helpers/texture3-helper.d.ts +15 -0
  220. package/lib/helpers/texture3-helper.d.ts.map +1 -0
  221. package/lib/index.d.ts +14 -7
  222. package/lib/index.d.ts.map +1 -0
  223. package/lib/index.mjs +17 -18637
  224. package/lib/index.mjs.map +1 -0
  225. package/lib/index.umd.js +1 -152
  226. package/lib/index.umd.js.map +1 -0
  227. package/lib/interfaces.d.ts +386 -132
  228. package/lib/interfaces.d.ts.map +1 -0
  229. package/lib/loaders/file-loader.d.ts +1 -0
  230. package/lib/loaders/file-loader.d.ts.map +1 -0
  231. package/lib/loaders/image-loader.d.ts +1 -0
  232. package/lib/loaders/image-loader.d.ts.map +1 -0
  233. package/lib/loaders/loader.d.ts +1 -0
  234. package/lib/loaders/loader.d.ts.map +1 -0
  235. package/lib/loaders/svg-loader.d.ts +1 -0
  236. package/lib/loaders/svg-loader.d.ts.map +1 -0
  237. package/lib/loaders/svg-loader3.d.ts +15 -0
  238. package/lib/loaders/svg-loader3.d.ts.map +1 -0
  239. package/lib/main.d.ts +1 -0
  240. package/lib/main.d.ts.map +1 -0
  241. package/lib/math/box2.d.ts +13 -13
  242. package/lib/math/box2.d.ts.map +1 -0
  243. package/lib/math/box3.d.ts +13 -0
  244. package/lib/math/box3.d.ts.map +1 -0
  245. package/lib/math/color.d.ts +4 -2
  246. package/lib/math/color.d.ts.map +1 -0
  247. package/lib/math/cubic-interpolant.d.ts +1 -0
  248. package/lib/math/cubic-interpolant.d.ts.map +1 -0
  249. package/lib/math/curve.d.ts +16 -0
  250. package/lib/math/curve.d.ts.map +1 -0
  251. package/lib/math/discrete-interpolant.d.ts +1 -0
  252. package/lib/math/discrete-interpolant.d.ts.map +1 -0
  253. package/lib/math/improved-noise.d.ts +1 -0
  254. package/lib/math/improved-noise.d.ts.map +1 -0
  255. package/lib/math/interpolant.d.ts +1 -0
  256. package/lib/math/interpolant.d.ts.map +1 -0
  257. package/lib/math/linear-interpolant.d.ts +1 -0
  258. package/lib/math/linear-interpolant.d.ts.map +1 -0
  259. package/lib/math/matrix3.d.ts +12 -2
  260. package/lib/math/matrix3.d.ts.map +1 -0
  261. package/lib/math/matrix4.d.ts +8 -0
  262. package/lib/math/matrix4.d.ts.map +1 -0
  263. package/lib/math/utils.d.ts +1 -0
  264. package/lib/math/utils.d.ts.map +1 -0
  265. package/lib/math/vector2.d.ts +13 -4
  266. package/lib/math/vector2.d.ts.map +1 -0
  267. package/lib/math/vector3.d.ts +10 -5
  268. package/lib/math/vector3.d.ts.map +1 -0
  269. package/lib/math/vector4.d.ts +1 -0
  270. package/lib/math/vector4.d.ts.map +1 -0
  271. package/lib/renderer2.worker.js +16 -0
  272. package/lib/renderer2.worker.js.map +1 -0
  273. package/lib/renderer3.worker.js +22 -0
  274. package/lib/renderer3.worker.js.map +1 -0
  275. package/lib/renderers/binding-states.d.ts +8 -10
  276. package/lib/renderers/binding-states.d.ts.map +1 -0
  277. package/lib/renderers/buffer-renderer.d.ts +18 -20
  278. package/lib/renderers/buffer-renderer.d.ts.map +1 -0
  279. package/lib/renderers/cvs-renderer.d.ts +34 -16
  280. package/lib/renderers/cvs-renderer.d.ts.map +1 -0
  281. package/lib/renderers/render-lists.d.ts +3 -2
  282. package/lib/renderers/render-lists.d.ts.map +1 -0
  283. package/lib/renderers/render-states.d.ts +1 -0
  284. package/lib/renderers/render-states.d.ts.map +1 -0
  285. package/lib/renderers/render-target.d.ts +1 -0
  286. package/lib/renderers/render-target.d.ts.map +1 -0
  287. package/lib/{renders → renderers}/svg-renderer.d.ts +1 -0
  288. package/lib/renderers/svg-renderer.d.ts.map +1 -0
  289. package/lib/renderers/web-g-l-renderer3.d.ts +1 -0
  290. package/lib/renderers/web-g-l-renderer3.d.ts.map +1 -0
  291. package/lib/routes.d.ts +1 -0
  292. package/lib/routes.d.ts.map +1 -0
  293. package/lib/scenes/animate-scene2.d.ts +27 -0
  294. package/lib/scenes/animate-scene2.d.ts.map +1 -0
  295. package/lib/scenes/animate-scene3.d.ts +15 -0
  296. package/lib/scenes/animate-scene3.d.ts.map +1 -0
  297. package/lib/scenes/drawing-scene2.d.ts +43 -0
  298. package/lib/scenes/drawing-scene2.d.ts.map +1 -0
  299. package/lib/scenes/drawing-scene3.d.ts +20 -0
  300. package/lib/scenes/drawing-scene3.d.ts.map +1 -0
  301. package/lib/scenes/dynamic-scene.d.ts +1 -0
  302. package/lib/scenes/dynamic-scene.d.ts.map +1 -0
  303. package/lib/scenes/empty-scene2.d.ts +27 -0
  304. package/lib/scenes/empty-scene2.d.ts.map +1 -0
  305. package/lib/scenes/empty-scene3.d.ts +16 -0
  306. package/lib/scenes/empty-scene3.d.ts.map +1 -0
  307. package/lib/scenes/{loading-scene.d.ts → loading-scene2.d.ts} +9 -8
  308. package/lib/scenes/loading-scene2.d.ts.map +1 -0
  309. package/lib/scenes/loading-scene3.d.ts +17 -0
  310. package/lib/scenes/loading-scene3.d.ts.map +1 -0
  311. package/lib/scenes/scene.d.ts +4 -2
  312. package/lib/scenes/scene.d.ts.map +1 -0
  313. package/lib/scenes/shadow-scene3.d.ts +15 -0
  314. package/lib/scenes/shadow-scene3.d.ts.map +1 -0
  315. package/lib/scenes/static-scene.d.ts +1 -0
  316. package/lib/scenes/static-scene.d.ts.map +1 -0
  317. package/lib/scenes/svg-empty-scene.d.ts +1 -0
  318. package/lib/scenes/svg-empty-scene.d.ts.map +1 -0
  319. package/lib/scenes/svg-loading-scene.d.ts +1 -0
  320. package/lib/scenes/svg-loading-scene.d.ts.map +1 -0
  321. package/lib/scenes/svg-scene.d.ts +2 -1
  322. package/lib/scenes/svg-scene.d.ts.map +1 -0
  323. package/lib/shaders/final.shader.d.ts +13 -0
  324. package/lib/shaders/final.shader.d.ts.map +1 -0
  325. package/lib/shaders/loading-circles.shader.d.ts +14 -0
  326. package/lib/shaders/loading-circles.shader.d.ts.map +1 -0
  327. package/lib/shaders/projection.shader.d.ts +33 -0
  328. package/lib/shaders/projection.shader.d.ts.map +1 -0
  329. package/lib/shaders/shadow.shader.d.ts +16 -0
  330. package/lib/shaders/shadow.shader.d.ts.map +1 -0
  331. package/lib/shaders/smoke.shader.d.ts +12 -0
  332. package/lib/shaders/smoke.shader.d.ts.map +1 -0
  333. package/lib/shaders/textures-box.shader.d.ts +12 -0
  334. package/lib/shaders/textures-box.shader.d.ts.map +1 -0
  335. package/lib/shapes/arrow.d.ts +6 -4
  336. package/lib/shapes/arrow.d.ts.map +1 -0
  337. package/lib/shapes/axes.d.ts +14 -16
  338. package/lib/shapes/axes.d.ts.map +1 -0
  339. package/lib/shapes/circle.d.ts +5 -4
  340. package/lib/shapes/circle.d.ts.map +1 -0
  341. package/lib/shapes/geo/a-geo.d.ts +31 -0
  342. package/lib/shapes/geo/a-geo.d.ts.map +1 -0
  343. package/lib/shapes/geo/cmd.d.ts +11 -0
  344. package/lib/shapes/geo/cmd.d.ts.map +1 -0
  345. package/lib/shapes/geo/geo-circle.d.ts +14 -0
  346. package/lib/shapes/geo/geo-circle.d.ts.map +1 -0
  347. package/lib/shapes/geo/geo-line.d.ts +13 -0
  348. package/lib/shapes/geo/geo-line.d.ts.map +1 -0
  349. package/lib/shapes/geo/geo-polygon.d.ts +9 -0
  350. package/lib/shapes/geo/geo-polygon.d.ts.map +1 -0
  351. package/lib/shapes/geo/geo-polyline.d.ts +22 -0
  352. package/lib/shapes/geo/geo-polyline.d.ts.map +1 -0
  353. package/lib/shapes/geo/geo-rect.d.ts +14 -0
  354. package/lib/shapes/geo/geo-rect.d.ts.map +1 -0
  355. package/lib/shapes/geo/geo-shape.d.ts +22 -0
  356. package/lib/shapes/geo/geo-shape.d.ts.map +1 -0
  357. package/lib/{geometries → shapes/geo}/path-polyfill.d.ts +2 -1
  358. package/lib/shapes/geo/path-polyfill.d.ts.map +1 -0
  359. package/lib/shapes/geo/path-proxy.d.ts +74 -0
  360. package/lib/shapes/geo/path-proxy.d.ts.map +1 -0
  361. package/lib/shapes/line.d.ts +10 -0
  362. package/lib/shapes/line.d.ts.map +1 -0
  363. package/lib/{materials/text-material2.d.ts → shapes/mtl/mtl-text.d.ts} +8 -9
  364. package/lib/shapes/mtl/mtl-text.d.ts.map +1 -0
  365. package/lib/shapes/mtl/mtl.d.ts +30 -0
  366. package/lib/shapes/mtl/mtl.d.ts.map +1 -0
  367. package/lib/shapes/mtl/utils.d.ts +3 -0
  368. package/lib/shapes/mtl/utils.d.ts.map +1 -0
  369. package/lib/shapes/polygon.d.ts +2 -3
  370. package/lib/shapes/polygon.d.ts.map +1 -0
  371. package/lib/shapes/polyline.d.ts +9 -0
  372. package/lib/shapes/polyline.d.ts.map +1 -0
  373. package/lib/shapes/rect.d.ts +14 -0
  374. package/lib/shapes/rect.d.ts.map +1 -0
  375. package/lib/shapes/shape.d.ts +27 -0
  376. package/lib/shapes/shape.d.ts.map +1 -0
  377. package/lib/shapes/skinned-shape.d.ts +10 -0
  378. package/lib/shapes/skinned-shape.d.ts.map +1 -0
  379. package/lib/shapes/sprite.d.ts +9 -0
  380. package/lib/shapes/sprite.d.ts.map +1 -0
  381. package/lib/shapes/svg.d.ts +10 -0
  382. package/lib/shapes/svg.d.ts.map +1 -0
  383. package/lib/shapes/text.d.ts +10 -12
  384. package/lib/shapes/text.d.ts.map +1 -0
  385. package/lib/svg/editor/svg-editor.d.ts +60 -0
  386. package/lib/svg/editor/svg-editor.d.ts.map +1 -0
  387. package/lib/svg/editor/tools/svg-base-tool.d.ts +29 -0
  388. package/lib/svg/editor/tools/svg-base-tool.d.ts.map +1 -0
  389. package/lib/svg/editor/tools/svg-drag-tool.d.ts +26 -0
  390. package/lib/svg/editor/tools/svg-drag-tool.d.ts.map +1 -0
  391. package/lib/svg/editor/tools/svg-draw-base-tool.d.ts +59 -0
  392. package/lib/svg/editor/tools/svg-draw-base-tool.d.ts.map +1 -0
  393. package/lib/svg/editor/tools/svg-draw-point-tool.d.ts +16 -0
  394. package/lib/svg/editor/tools/svg-draw-point-tool.d.ts.map +1 -0
  395. package/lib/svg/editor/tools/svg-draw-polylgon-tool.d.ts +20 -0
  396. package/lib/svg/editor/tools/svg-draw-polylgon-tool.d.ts.map +1 -0
  397. package/lib/svg/editor/tools/svg-draw-polyline-tool.d.ts +29 -0
  398. package/lib/svg/editor/tools/svg-draw-polyline-tool.d.ts.map +1 -0
  399. package/lib/svg/editor/tools/svg-draw-text-tool.d.ts +21 -0
  400. package/lib/svg/editor/tools/svg-draw-text-tool.d.ts.map +1 -0
  401. package/lib/svg/editor/tools/svg-hover-tool.d.ts +17 -0
  402. package/lib/svg/editor/tools/svg-hover-tool.d.ts.map +1 -0
  403. package/lib/svg/utils.d.ts +10 -1
  404. package/lib/svg/utils.d.ts.map +1 -0
  405. package/lib/utils/coords.d.ts +4 -0
  406. package/lib/utils/coords.d.ts.map +1 -0
  407. package/lib/utils/dom-utils.d.ts +1 -0
  408. package/lib/utils/dom-utils.d.ts.map +1 -0
  409. package/lib/utils/md5.d.ts +2 -1
  410. package/lib/utils/md5.d.ts.map +1 -0
  411. package/lib/utils/request-anim-frame.d.ts +1 -0
  412. package/lib/utils/request-anim-frame.d.ts.map +1 -0
  413. package/lib/utils/svg.d.ts +5 -2
  414. package/lib/utils/svg.d.ts.map +1 -0
  415. package/lib/utils/three-utils.d.ts +4 -0
  416. package/lib/utils/three-utils.d.ts.map +1 -0
  417. package/lib/utils/utils.d.ts +1 -0
  418. package/lib/utils/utils.d.ts.map +1 -0
  419. package/lib/utils/uuid.d.ts +1 -0
  420. package/lib/utils/uuid.d.ts.map +1 -0
  421. package/lib/utils/validates.d.ts +1 -0
  422. package/lib/utils/validates.d.ts.map +1 -0
  423. package/lib/workers/environment.worker.d.ts +1 -0
  424. package/lib/workers/environment.worker.d.ts.map +1 -0
  425. package/lib/workers/renderer2.worker.d.ts +2 -0
  426. package/lib/workers/renderer2.worker.d.ts.map +1 -0
  427. package/lib/workers/renderer3.worker.d.ts +2 -0
  428. package/lib/workers/renderer3.worker.d.ts.map +1 -0
  429. package/package.json +8 -3
  430. package/lib/applications/app-cvs.d.ts +0 -61
  431. package/lib/applications/app-director.d.ts +0 -22
  432. package/lib/applications/app-offscreen.d.ts +0 -58
  433. package/lib/applications/application.d.ts +0 -71
  434. package/lib/controls/interactive-controls.d.ts +0 -12
  435. package/lib/core/ope-view.d.ts +0 -45
  436. package/lib/extras/adapter.d.ts +0 -46
  437. package/lib/extras/app.d.ts +0 -0
  438. package/lib/extras/chef.d.ts +0 -23
  439. package/lib/geometries/circle-geo2.d.ts +0 -15
  440. package/lib/geometries/circle-geometry2.d.ts +0 -22
  441. package/lib/geometries/geo2.d.ts +0 -33
  442. package/lib/geometries/geometry2.d.ts +0 -50
  443. package/lib/geometries/line-geometry2.d.ts +0 -29
  444. package/lib/geometries/path.d.ts +0 -40
  445. package/lib/geometries/polygon-geo2.d.ts +0 -5
  446. package/lib/geometries/polygon-geometry2.d.ts +0 -13
  447. package/lib/geometries/polyline-geo2.d.ts +0 -21
  448. package/lib/geometries/rect-geometry2.d.ts +0 -18
  449. package/lib/geometries/text-geometry2.d.ts +0 -13
  450. package/lib/helpers/axes-helper.d.ts +0 -18
  451. package/lib/helpers/axes-helper2.d.ts +0 -21
  452. package/lib/helpers/dummy-helper.d.ts +0 -4
  453. package/lib/helpers/dxf-helper.d.ts +0 -2
  454. package/lib/helpers/mat-helper.d.ts +0 -11
  455. package/lib/helpers/merge-helper.d.ts +0 -11
  456. package/lib/index.cjs.js +0 -152
  457. package/lib/materials/line-material2.d.ts +0 -8
  458. package/lib/materials/mat2.d.ts +0 -35
  459. package/lib/materials/material2.d.ts +0 -38
  460. package/lib/materials/text-mat2.d.ts +0 -53
  461. package/lib/objects/mesh2.d.ts +0 -18
  462. package/lib/objects/node2.d.ts +0 -24
  463. package/lib/objects/shape.d.ts +0 -57
  464. package/lib/objects/shape2.d.ts +0 -32
  465. package/lib/renderer.worker.js +0 -19115
  466. package/lib/renderers/renderer.d.ts +0 -26
  467. package/lib/renders/binding-states.d.ts +0 -35
  468. package/lib/renders/buffer-renderer.d.ts +0 -19
  469. package/lib/renders/render-lists.d.ts +0 -29
  470. package/lib/renders/render-states.d.ts +0 -18
  471. package/lib/renders/render-target.d.ts +0 -26
  472. package/lib/renders/renderer2.d.ts +0 -52
  473. package/lib/renders/t-svg-renderer.d.ts +0 -35
  474. package/lib/scenes/animate-scene.d.ts +0 -17
  475. package/lib/scenes/loading-text-scene.d.ts +0 -19
  476. package/lib/scenes/main-scene.d.ts +0 -34
  477. package/lib/shapes2/actor.d.ts +0 -24
  478. package/lib/shapes2/arrow.d.ts +0 -6
  479. package/lib/shapes2/axes.d.ts +0 -35
  480. package/lib/shapes2/circle.d.ts +0 -10
  481. package/lib/shapes2/dummy.d.ts +0 -19
  482. package/lib/shapes2/polygon.d.ts +0 -9
  483. package/lib/shapes2/svg.d.ts +0 -18
  484. package/lib/shapes2/text.d.ts +0 -21
  485. package/lib/svg/circle-element.d.ts +0 -9
  486. package/lib/svg/defs-element.d.ts +0 -6
  487. package/lib/svg/element.d.ts +0 -32
  488. package/lib/svg/elements.d.ts +0 -25
  489. package/lib/svg/g-element.d.ts +0 -6
  490. package/lib/svg/interfaces.d.ts +0 -46
  491. package/lib/svg/path-element.d.ts +0 -33
  492. package/lib/svg/property.d.ts +0 -25
  493. package/lib/svg/style-element.d.ts +0 -6
  494. package/lib/svg/svg-element.d.ts +0 -10
  495. package/lib/svg/symbol-element.d.ts +0 -6
  496. package/lib/svg/text-element.d.ts +0 -10
  497. package/lib/svg/unknown-element.d.ts +0 -6
  498. package/lib/svg/use-element.d.ts +0 -8
  499. package/lib/svg/view-element.d.ts +0 -6
  500. package/lib/textures/texture.d.ts +0 -45
  501. package/lib/workers/app-offscreen.worker.d.ts +0 -0
  502. package/lib/workers/renderer.worker.d.ts +0 -1
package/lib/index.umd.js CHANGED
@@ -1,152 +1 @@
1
- (function(_t,Gt){typeof exports=="object"&&typeof module!="undefined"?Gt(exports):typeof define=="function"&&define.amd?define(["exports"],Gt):(_t=typeof globalThis!="undefined"?globalThis:_t||self,Gt(_t.archgine={}))})(this,function(_t){"use strict";var uT=Object.defineProperty,lT=Object.defineProperties;var hT=Object.getOwnPropertyDescriptors;var Fg=Object.getOwnPropertySymbols;var cT=Object.prototype.hasOwnProperty,fT=Object.prototype.propertyIsEnumerable;var Xh=(_t,Gt,he)=>Gt in _t?uT(_t,Gt,{enumerable:!0,configurable:!0,writable:!0,value:he}):_t[Gt]=he,Vs=(_t,Gt)=>{for(var he in Gt||(Gt={}))cT.call(Gt,he)&&Xh(_t,he,Gt[he]);if(Fg)for(var he of Fg(Gt))fT.call(Gt,he)&&Xh(_t,he,Gt[he]);return _t},Ou=(_t,Gt)=>lT(_t,hT(Gt));var d=(_t,Gt,he)=>Xh(_t,typeof Gt!="symbol"?Gt+"":Gt,he);var Tt=(_t,Gt,he)=>new Promise((Mu,Ws)=>{var zs=hr=>{try{Gs(he.next(hr))}catch(Ys){Ws(Ys)}},$s=hr=>{try{Gs(he.throw(hr))}catch(Ys){Ws(Ys)}},Gs=hr=>hr.done?Mu(hr.value):Promise.resolve(hr.value).then(zs,$s);Gs((he=he.apply(_t,Gt)).next())});var Ft;const Gt={name:"TinyEngine",containerId:"tinyEngine",canvas:"tinyEngine",width:0,height:0,aspect:1,dpr:1,alpha:!1,color:"#232323",fps:60,syncDelay:800,animateDuration:600,mergeRendering:!1,sliceRendering:!0,sliceDuration:15,usedCache:!1,separateCache:!1,debounceCache:!0,dynamicLoading:!0,svgLoadingType:0,showPoints:!1,wireframe:!1,castShadow:!1,workerRender:!1,monitorDuration:1e4,light:{color:"#f2f2f2",position:[-6,6,0],castShadow:!0,shadowBlur:16},camera:{left:-1,right:1,top:1,bottom:-1,aspect:1,eye:[0,0,0],up:[0,0,1],helperEnable:!0},controls:{target:[0,0,0],minDistance:.1,maxDistance:1e3,enablePan:!0,enableRotate:!0,enableZoom:!0,focusMode:!0,autoRotate:!1,autoRotateSpeed:.5,enableDamping:!0,dampingFactor:.2},gridHelper:{fill:"#e3e3e3"},axesHelper:{},displayUnits:"",tooltip:!0,assetType:"rm",zoomToSelectEnable:!1,selectEnable:!1,multiSelectEnable:!1,socialDistanceEnable:!1,socialDistance:{radius:3}};function he(i,e){const t=i.x*Math.cos(e)-i.y*Math.sin(e),r=i.y*Math.cos(e)+i.x*Math.sin(e);i.x=t,i.y=r}function Mu(i,e,t){i.x+=e,i.y+=t}function Ws(i,e){i.x*=e,i.y*=e}let zs=class Qh{constructor(e){d(this,"commands");this.commands=[],e&&e instanceof Qh?this.commands.push(...e.commands):e&&(this.commands=Ug(e))}addPath(e){e&&e instanceof Qh&&this.commands.push(...e.commands)}moveTo(e,t){this.commands.push(["M",e,t])}lineTo(e,t){this.commands.push(["L",e,t])}arc(e,t,r,s,o,u){this.commands.push(["AC",e,t,r,s,o,!!u])}arcTo(e,t,r,s,o){this.commands.push(["AT",e,t,r,s,o])}ellipse(e,t,r,s,o,u,h,c){this.commands.push(["E",e,t,r,s,o,u,h,!!c])}closePath(){this.commands.push(["Z"])}bezierCurveTo(e,t,r,s,o,u){this.commands.push(["C",e,t,r,s,o,u])}quadraticCurveTo(e,t,r,s){this.commands.push(["Q",e,t,r,s])}rect(e,t,r,s){this.commands.push(["R",e,t,r,s])}roundRect(e,t,r,s,o){typeof o=="undefined"?this.commands.push(["RR",e,t,r,s,0]):this.commands.push(["RR",e,t,r,s,o])}};function $s(i,e){let t=0,r=0,s,o,u,h,c,y,p,A,T,C,N,O,L,P,W,V,b,Y,z,j,tt,Q=null,K=null,rt=null,at=null,ct=null,pt=null;i.beginPath();for(let dt=0;dt<e.length;++dt){Y=e[dt][0],Y!=="S"&&Y!=="s"&&Y!=="C"&&Y!=="c"&&(Q=null,K=null),Y!=="T"&&Y!=="t"&&Y!=="Q"&&Y!=="q"&&(rt=null,at=null);let B;switch(Y){case"m":case"M":B=e[dt],Y==="m"?(t+=B[1],r+=B[2]):(t=B[1],r=B[2]),(Y==="M"||!ct)&&(ct={x:t,y:r}),i.moveTo(t,r);break;case"l":B=e[dt],t+=B[1],r+=B[2],i.lineTo(t,r);break;case"L":B=e[dt],t=B[1],r=B[2],i.lineTo(t,r);break;case"H":B=e[dt],t=B[1],i.lineTo(t,r);break;case"h":B=e[dt],t+=B[1],i.lineTo(t,r);break;case"V":B=e[dt],r=B[1],i.lineTo(t,r);break;case"v":B=e[dt],r+=B[1],i.lineTo(t,r);break;case"a":case"A":if(B=e[dt],pt===null)throw new Error("This should never happen");Y==="a"?(t+=B[6],r+=B[7]):(t=B[6],r=B[7]),P=B[1],W=B[2],p=B[3]*Math.PI/180,u=!!B[4],h=!!B[5],c={x:t,y:r},y={x:(pt.x-c.x)/2,y:(pt.y-c.y)/2},he(y,-p),A=y.x*y.x/(P*P)+y.y*y.y/(W*W),A>1&&(A=Math.sqrt(A),P*=A,W*=A),z={x:P*y.y/W,y:-(W*y.x)/P},T=P*P*W*W,C=P*P*y.y*y.y+W*W*y.x*y.x,h!==u?Ws(z,Math.sqrt((T-C)/C)||0):Ws(z,-Math.sqrt((T-C)/C)||0),o=Math.atan2((y.y-z.y)/W,(y.x-z.x)/P),s=Math.atan2(-(y.y+z.y)/W,-(y.x+z.x)/P),he(z,p),Mu(z,(c.x+pt.x)/2,(c.y+pt.y)/2),i.save(),i.translate(z.x,z.y),i.rotate(p),i.scale(P,W),i.arc(0,0,1,o,s,!h),i.restore();break;case"C":B=e[dt],Q=B[3],K=B[4],t=B[5],r=B[6],i.bezierCurveTo(B[1],B[2],Q,K,t,r);break;case"c":B=e[dt],i.bezierCurveTo(B[1]+t,B[2]+r,B[3]+t,B[4]+r,B[5]+t,B[6]+r),Q=B[3]+t,K=B[4]+r,t+=B[5],r+=B[6];break;case"S":B=e[dt],(Q===null||K===null)&&(Q=t,K=r),i.bezierCurveTo(2*t-Q,2*r-K,B[1],B[2],B[3],B[4]),Q=B[1],K=B[2],t=B[3],r=B[4];break;case"s":B=e[dt],(Q===null||K===null)&&(Q=t,K=r),i.bezierCurveTo(2*t-Q,2*r-K,B[1]+t,B[2]+r,B[3]+t,B[4]+r),Q=B[1]+t,K=B[2]+r,t+=B[3],r+=B[4];break;case"Q":B=e[dt],rt=B[1],at=B[2],t=B[3],r=B[4],i.quadraticCurveTo(rt,at,t,r);break;case"q":B=e[dt],rt=B[1]+t,at=B[2]+r,t+=B[3],r+=B[4],i.quadraticCurveTo(rt,at,t,r);break;case"T":B=e[dt],(rt===null||at===null)&&(rt=t,at=r),rt=2*t-rt,at=2*r-at,t=B[1],r=B[2],i.quadraticCurveTo(rt,at,t,r);break;case"t":B=e[dt],(rt===null||at===null)&&(rt=t,at=r),rt=2*t-rt,at=2*r-at,t+=B[1],r+=B[2],i.quadraticCurveTo(rt,at,t,r);break;case"z":case"Z":ct&&(t=ct.x,r=ct.y),ct=null,i.closePath();break;case"AC":B=e[dt],t=B[1],r=B[2],L=B[3],o=B[4],s=B[5],j=B[6],i.arc(t,r,L,o,s,j);break;case"AT":B=e[dt],N=B[1],O=B[2],t=B[3],r=B[4],L=B[5],i.arcTo(N,O,t,r,L);break;case"E":B=e[dt],t=B[1],r=B[2],P=B[3],W=B[4],p=B[5],o=B[6],s=B[7],j=B[8],i.save(),i.translate(t,r),i.rotate(p),i.scale(P,W),i.arc(0,0,1,o,s,j),i.restore();break;case"R":B=e[dt],t=B[1],r=B[2],V=B[3],b=B[4],ct={x:t,y:r},i.rect(t,r,V,b);break;case"RR":B=e[dt],t=B[1],r=B[2],V=B[3],b=B[4],tt=B[5],ct={x:t,y:r},i.roundRect(t,r,V,b,tt);break}pt?(pt.x=t,pt.y=r):pt={x:t,y:r}}}function Gs(i){if(!i||!i.CanvasRenderingContext2D||i.Path2D)return;const{CanvasRenderingContext2D:e}=i,t=e==null?void 0:e.prototype.fill,r=e==null?void 0:e.prototype.stroke,s=e==null?void 0:e.prototype.isPointInPath;e.prototype.fill=function(...u){if(u[0]instanceof zs){const h=u[0],c=u[1]||"nonzero";$s(this,h.commands),t.apply(this,[c])}else{const h=u[0]||"nonzero";return t.apply(this,[h])}},e.prototype.stroke=function(u){u&&$s(this,u.commands),r.apply(this)},e.prototype.isPointInPath=function(...u){if(u[0]instanceof zs){const h=u[0],c=u[1],y=u[2],p=u[3]||"nonzero";return $s(this,h.commands),s.apply(this,[c,y,p])}else return s.apply(this,u)},i.Path2D=zs}const hr={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Ys=/([astvzqmhlc])([^astvzqmhlc]*)/gi,kg=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Hg(i){const e=i.match(kg);return e?e.map(Number):[]}function Ug(i){const e=[],t=String(i).trim();return t[0]!=="M"&&t[0]!=="m"||t.replace(Ys,(r,s,o)=>{const u=Hg(o);let h=s.toLowerCase(),c=s;if(h==="m"&&u.length>2&&(e.push([c,...u.splice(0,2)]),h="l",c=c==="m"?"l":"L"),u.length<hr[h])return"";for(e.push([c,...u.splice(0,hr[h])]);u.length>=hr[h]&&u.length&&hr[h];)e.push([c,...u.splice(0,hr[h])]);return""}),e}var Zs=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Kh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Yi={},Ei={};function qg(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var r=0;r<i.length;r++)if(Object.prototype.hasOwnProperty.call(i,r)){var s=i[r];if(e.call(void 0,s,r,i))return s}}function Lu(i,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(i):i}function Vg(i,e){if(i===null||typeof i!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}var jh=Lu({HTML:"text/html",isHTML:function(i){return i===jh.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Jh=Lu({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(i){return i===Jh.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Ei.assign=Vg,Ei.find=qg,Ei.freeze=Lu,Ei.MIME_TYPE=jh,Ei.NAMESPACE=Jh;var tc=Ei,ri=tc.find,Xs=tc.NAMESPACE;function Wg(i){return i!==""}function zg(i){return i?i.split(/[\t\n\f\r ]+/).filter(Wg):[]}function $g(i,e){return i.hasOwnProperty(e)||(i[e]=!0),i}function ec(i){if(!i)return[];var e=zg(i);return Object.keys(e.reduce($g,{}))}function Gg(i){return function(e){return i&&i.indexOf(e)!==-1}}function Qs(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function Ge(i,e){var t=i.prototype;if(!(t instanceof e)){let r=function(){};r.prototype=e.prototype,r=new r,Qs(t,r),i.prototype=t=r}t.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),t.constructor=i)}var Ye={},Hr=Ye.ELEMENT_NODE=1,ts=Ye.ATTRIBUTE_NODE=2,to=Ye.TEXT_NODE=3,rc=Ye.CDATA_SECTION_NODE=4,ic=Ye.ENTITY_REFERENCE_NODE=5,Yg=Ye.ENTITY_NODE=6,nc=Ye.PROCESSING_INSTRUCTION_NODE=7,sc=Ye.COMMENT_NODE=8,ac=Ye.DOCUMENT_NODE=9,oc=Ye.DOCUMENT_TYPE_NODE=10,Ai=Ye.DOCUMENT_FRAGMENT_NODE=11,Zg=Ye.NOTATION_NODE=12,Le={},be={};Le.INDEX_SIZE_ERR=(be[1]="Index size error",1),Le.DOMSTRING_SIZE_ERR=(be[2]="DOMString size error",2);var Ze=Le.HIERARCHY_REQUEST_ERR=(be[3]="Hierarchy request error",3);Le.WRONG_DOCUMENT_ERR=(be[4]="Wrong document",4),Le.INVALID_CHARACTER_ERR=(be[5]="Invalid character",5),Le.NO_DATA_ALLOWED_ERR=(be[6]="No data allowed",6),Le.NO_MODIFICATION_ALLOWED_ERR=(be[7]="No modification allowed",7);var uc=Le.NOT_FOUND_ERR=(be[8]="Not found",8);Le.NOT_SUPPORTED_ERR=(be[9]="Not supported",9);var lc=Le.INUSE_ATTRIBUTE_ERR=(be[10]="Attribute in use",10);Le.INVALID_STATE_ERR=(be[11]="Invalid state",11),Le.SYNTAX_ERR=(be[12]="Syntax error",12),Le.INVALID_MODIFICATION_ERR=(be[13]="Invalid modification",13),Le.NAMESPACE_ERR=(be[14]="Invalid namespace",14),Le.INVALID_ACCESS_ERR=(be[15]="Invalid access",15);function se(i,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,be[i]),this.message=be[i],Error.captureStackTrace&&Error.captureStackTrace(this,se);return t.code=i,e&&(this.message=this.message+": "+e),t}se.prototype=Error.prototype,Qs(Le,se);function bi(){}bi.prototype={length:0,item:function(i){return i>=0&&i<this.length?this[i]:null},toString:function(i,e){for(var t=[],r=0;r<this.length;r++)rs(this[r],t,i,e);return t.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};function es(i,e){this._node=i,this._refresh=e,Nu(this)}function Nu(i){var e=i._node._inc||i._node.ownerDocument._inc;if(i._inc!==e){var t=i._refresh(i._node);if(Cc(i,"length",t.length),!i.$$length||t.length<i.$$length)for(var r=t.length;r in i;r++)Object.prototype.hasOwnProperty.call(i,r)&&delete i[r];Qs(t,i),i._inc=e}}es.prototype.item=function(i){return Nu(this),this[i]||null},Ge(es,bi);function eo(){}function hc(i,e){for(var t=i.length;t--;)if(i[t]===e)return t}function cc(i,e,t,r){if(r?e[hc(e,r)]=t:e[e.length++]=t,i){t.ownerElement=i;var s=i.ownerDocument;s&&(r&&gc(s,i,r),Xg(s,i,t))}}function fc(i,e,t){var r=hc(e,t);if(r>=0){for(var s=e.length-1;r<s;)e[r]=e[++r];if(e.length=s,i){var o=i.ownerDocument;o&&(gc(o,i,t),t.ownerElement=null)}}else throw new se(uc,new Error(i.tagName+"@"+t))}eo.prototype={length:0,item:bi.prototype.item,getNamedItem:function(i){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==i)return t}},setNamedItem:function(i){var e=i.ownerElement;if(e&&e!=this._ownerElement)throw new se(lc);var t=this.getNamedItem(i.nodeName);return cc(this._ownerElement,this,i,t),t},setNamedItemNS:function(i){var e=i.ownerElement,t;if(e&&e!=this._ownerElement)throw new se(lc);return t=this.getNamedItemNS(i.namespaceURI,i.localName),cc(this._ownerElement,this,i,t),t},removeNamedItem:function(i){var e=this.getNamedItem(i);return fc(this._ownerElement,this,e),e},removeNamedItemNS:function(i,e){var t=this.getNamedItemNS(i,e);return fc(this._ownerElement,this,t),t},getNamedItemNS:function(i,e){for(var t=this.length;t--;){var r=this[t];if(r.localName==e&&r.namespaceURI==i)return r}return null}};function pc(){}pc.prototype={hasFeature:function(i,e){return!0},createDocument:function(i,e,t){var r=new js;if(r.implementation=this,r.childNodes=new bi,r.doctype=t||null,t&&r.appendChild(t),e){var s=r.createElementNS(i,e);r.appendChild(s)}return r},createDocumentType:function(i,e,t){var r=new no;return r.name=i,r.nodeName=i,r.publicId=e||"",r.systemId=t||"",r}};function Ut(){}Ut.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(i,e){return ro(this,i,e)},replaceChild:function(i,e){ro(this,i,e,xc),e&&this.removeChild(e)},removeChild:function(i){return yc(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return qu(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var e=i.nextSibling;e&&e.nodeType==to&&i.nodeType==to?(this.removeChild(e),i.appendData(e.data)):(i.normalize(),i=e)}},isSupported:function(i,e){return this.ownerDocument.implementation.hasFeature(i,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&t[r]===i)return r}e=e.nodeType==ts?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==ts?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function dc(i){return i=="<"&&"&lt;"||i==">"&&"&gt;"||i=="&"&&"&amp;"||i=='"'&&"&quot;"||"&#"+i.charCodeAt()+";"}Qs(Ye,Ut),Qs(Ye,Ut.prototype);function Ks(i,e){if(e(i))return!0;if(i=i.firstChild)do if(Ks(i,e))return!0;while(i=i.nextSibling)}function js(){this.ownerDocument=this}function Xg(i,e,t){i&&i._inc++;var r=t.namespaceURI;r===Xs.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function gc(i,e,t,r){i&&i._inc++;var s=t.namespaceURI;s===Xs.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Bu(i,e,t){if(i&&i._inc){i._inc++;var r=e.childNodes;if(t)r[r.length++]=t;else{for(var s=e.firstChild,o=0;s;)r[o++]=s,s=s.nextSibling;r.length=o,delete r[r.length]}}}function yc(i,e){var t=e.previousSibling,r=e.nextSibling;return t?t.nextSibling=r:i.firstChild=r,r?r.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Bu(i.ownerDocument,i),e}function Qg(i){return i&&(i.nodeType===Ut.DOCUMENT_NODE||i.nodeType===Ut.DOCUMENT_FRAGMENT_NODE||i.nodeType===Ut.ELEMENT_NODE)}function Kg(i){return i&&(ii(i)||Iu(i)||wi(i)||i.nodeType===Ut.DOCUMENT_FRAGMENT_NODE||i.nodeType===Ut.COMMENT_NODE||i.nodeType===Ut.PROCESSING_INSTRUCTION_NODE)}function wi(i){return i&&i.nodeType===Ut.DOCUMENT_TYPE_NODE}function ii(i){return i&&i.nodeType===Ut.ELEMENT_NODE}function Iu(i){return i&&i.nodeType===Ut.TEXT_NODE}function mc(i,e){var t=i.childNodes||[];if(ri(t,ii)||wi(e))return!1;var r=ri(t,wi);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function vc(i,e){var t=i.childNodes||[];function r(o){return ii(o)&&o!==e}if(ri(t,r))return!1;var s=ri(t,wi);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function jg(i,e,t){if(!Qg(i))throw new se(Ze,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new se(uc,"child not in parent");if(!Kg(e)||wi(e)&&i.nodeType!==Ut.DOCUMENT_NODE)throw new se(Ze,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function Jg(i,e,t){var r=i.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ut.DOCUMENT_FRAGMENT_NODE){var o=s.filter(ii);if(o.length>1||ri(s,Iu))throw new se(Ze,"More than one element or text in fragment");if(o.length===1&&!mc(i,t))throw new se(Ze,"Element in fragment can not be inserted before doctype")}if(ii(e)&&!mc(i,t))throw new se(Ze,"Only one element can be added and only after doctype");if(wi(e)){if(ri(r,wi))throw new se(Ze,"Only one doctype is allowed");var u=ri(r,ii);if(t&&r.indexOf(u)<r.indexOf(t))throw new se(Ze,"Doctype can only be inserted before an element");if(!t&&u)throw new se(Ze,"Doctype can not be appended since element is present")}}function xc(i,e,t){var r=i.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ut.DOCUMENT_FRAGMENT_NODE){var o=s.filter(ii);if(o.length>1||ri(s,Iu))throw new se(Ze,"More than one element or text in fragment");if(o.length===1&&!vc(i,t))throw new se(Ze,"Element in fragment can not be inserted before doctype")}if(ii(e)&&!vc(i,t))throw new se(Ze,"Only one element can be added and only after doctype");if(wi(e)){if(ri(r,function(c){return wi(c)&&c!==t}))throw new se(Ze,"Only one doctype is allowed");var u=ri(r,ii);if(t&&r.indexOf(u)<r.indexOf(t))throw new se(Ze,"Doctype can only be inserted before an element")}}function ro(i,e,t,r){jg(i,e,t),i.nodeType===Ut.DOCUMENT_NODE&&(r||Jg)(i,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===Ai){var o=e.firstChild;if(o==null)return e;var u=e.lastChild}else o=u=e;var h=t?t.previousSibling:i.lastChild;o.previousSibling=h,u.nextSibling=t,h?h.nextSibling=o:i.firstChild=o,t==null?i.lastChild=u:t.previousSibling=u;do o.parentNode=i;while(o!==u&&(o=o.nextSibling));return Bu(i.ownerDocument||i,i),e.nodeType==Ai&&(e.firstChild=e.lastChild=null),e}function t0(i,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=i,e.previousSibling=i.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:i.firstChild=e,i.lastChild=e,Bu(i.ownerDocument,i,e),e}js.prototype={nodeName:"#document",nodeType:ac,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,e){if(i.nodeType==Ai){for(var t=i.firstChild;t;){var r=t.nextSibling;this.insertBefore(t,e),t=r}return i}return ro(this,i,e),i.ownerDocument=this,this.documentElement===null&&i.nodeType===Hr&&(this.documentElement=i),i},removeChild:function(i){return this.documentElement==i&&(this.documentElement=null),yc(this,i)},replaceChild:function(i,e){ro(this,i,e,xc),i.ownerDocument=this,e&&this.removeChild(e),ii(i)&&(this.documentElement=i)},importNode:function(i,e){return _c(this,i,e)},getElementById:function(i){var e=null;return Ks(this.documentElement,function(t){if(t.nodeType==Hr&&t.getAttribute("id")==i)return e=t,!0}),e},getElementsByClassName:function(i){var e=ec(i);return new es(this,function(t){var r=[];return e.length>0&&Ks(t.documentElement,function(s){if(s!==t&&s.nodeType===Hr){var o=s.getAttribute("class");if(o){var u=i===o;if(!u){var h=ec(o);u=e.every(Gg(h))}u&&r.push(s)}}}),r})},createElement:function(i){var e=new Tn;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new bi;var t=e.attributes=new eo;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new so;return i.ownerDocument=this,i.childNodes=new bi,i},createTextNode:function(i){var e=new Ru;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Pu;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new Fu;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Hu;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new io;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new ku;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new Tn,r=e.split(":"),s=t.attributes=new eo;return t.childNodes=new bi,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,r.length==2?(t.prefix=r[0],t.localName=r[1]):t.localName=e,s._ownerElement=t,t},createAttributeNS:function(i,e){var t=new io,r=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,r.length==2?(t.prefix=r[0],t.localName=r[1]):t.localName=e,t}},Ge(js,Ut);function Tn(){this._nsMap={}}Tn.prototype={nodeType:Hr,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===Ai?this.insertBefore(i,null):t0(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var r=this.ownerDocument.createAttributeNS(i,e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new es(this,function(e){var t=[];return Ks(e,function(r){r!==e&&r.nodeType==Hr&&(i==="*"||r.tagName==i)&&t.push(r)}),t})},getElementsByTagNameNS:function(i,e){return new es(this,function(t){var r=[];return Ks(t,function(s){s!==t&&s.nodeType===Hr&&(i==="*"||s.namespaceURI===i)&&(e==="*"||s.localName==e)&&r.push(s)}),r})}},js.prototype.getElementsByTagName=Tn.prototype.getElementsByTagName,js.prototype.getElementsByTagNameNS=Tn.prototype.getElementsByTagNameNS,Ge(Tn,Ut);function io(){}io.prototype.nodeType=ts,Ge(io,Ut);function Js(){}Js.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(be[Ze])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var r=this.data.substring(0,i),s=this.data.substring(i+e);t=r+t+s,this.nodeValue=this.data=t,this.length=t.length}},Ge(Js,Ut);function Ru(){}Ru.prototype={nodeName:"#text",nodeType:to,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},Ge(Ru,Js);function Pu(){}Pu.prototype={nodeName:"#comment",nodeType:sc},Ge(Pu,Js);function Fu(){}Fu.prototype={nodeName:"#cdata-section",nodeType:rc},Ge(Fu,Js);function no(){}no.prototype.nodeType=oc,Ge(no,Ut);function Ec(){}Ec.prototype.nodeType=Zg,Ge(Ec,Ut);function Ac(){}Ac.prototype.nodeType=Yg,Ge(Ac,Ut);function ku(){}ku.prototype.nodeType=ic,Ge(ku,Ut);function so(){}so.prototype.nodeName="#document-fragment",so.prototype.nodeType=Ai,Ge(so,Ut);function Hu(){}Hu.prototype.nodeType=nc,Ge(Hu,Ut);function bc(){}bc.prototype.serializeToString=function(i,e,t){return wc.call(i,e,t)},Ut.prototype.toString=wc;function wc(i,e){var t=[],r=this.nodeType==9&&this.documentElement||this,s=r.prefix,o=r.namespaceURI;if(o&&s==null){var s=r.lookupPrefix(o);if(s==null)var u=[{namespace:o,prefix:null}]}return rs(this,t,i,e,u),t.join("")}function Tc(i,e,t){var r=i.prefix||"",s=i.namespaceURI;if(!s||r==="xml"&&s===Xs.XML||s===Xs.XMLNS)return!1;for(var o=t.length;o--;){var u=t[o];if(u.prefix===r)return u.namespace!==s}return!0}function Uu(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,dc),'"')}function rs(i,e,t,r,s){if(s||(s=[]),r)if(i=r(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case Hr:var o=i.attributes,u=o.length,P=i.firstChild,h=i.tagName;t=Xs.isHTML(i.namespaceURI)||t;var c=h;if(!t&&!i.prefix&&i.namespaceURI){for(var y,p=0;p<o.length;p++)if(o.item(p).name==="xmlns"){y=o.item(p).value;break}if(!y)for(var A=s.length-1;A>=0;A--){var T=s[A];if(T.prefix===""&&T.namespace===i.namespaceURI){y=T.namespace;break}}if(y!==i.namespaceURI)for(var A=s.length-1;A>=0;A--){var T=s[A];if(T.namespace===i.namespaceURI){T.prefix&&(c=T.prefix+":"+h);break}}}e.push("<",c);for(var C=0;C<u;C++){var N=o.item(C);N.prefix=="xmlns"?s.push({prefix:N.localName,namespace:N.value}):N.nodeName=="xmlns"&&s.push({prefix:"",namespace:N.value})}for(var C=0;C<u;C++){var N=o.item(C);if(Tc(N,t,s)){var O=N.prefix||"",L=N.namespaceURI;Uu(e,O?"xmlns:"+O:"xmlns",L),s.push({prefix:O,namespace:L})}rs(N,e,t,r,s)}if(h===c&&Tc(i,t,s)){var O=i.prefix||"",L=i.namespaceURI;Uu(e,O?"xmlns:"+O:"xmlns",L),s.push({prefix:O,namespace:L})}if(P||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(h)){if(e.push(">"),t&&/^script$/i.test(h))for(;P;)P.data?e.push(P.data):rs(P,e,t,r,s.slice()),P=P.nextSibling;else for(;P;)rs(P,e,t,r,s.slice()),P=P.nextSibling;e.push("</",c,">")}else e.push("/>");return;case ac:case Ai:for(var P=i.firstChild;P;)rs(P,e,t,r,s.slice()),P=P.nextSibling;return;case ts:return Uu(e,i.name,i.value);case to:return e.push(i.data.replace(/[<&>]/g,dc));case rc:return e.push("<![CDATA[",i.data,"]]>");case sc:return e.push("<!--",i.data,"-->");case oc:var W=i.publicId,V=i.systemId;if(e.push("<!DOCTYPE ",i.name),W)e.push(" PUBLIC ",W),V&&V!="."&&e.push(" ",V),e.push(">");else if(V&&V!=".")e.push(" SYSTEM ",V,">");else{var b=i.internalSubset;b&&e.push(" [",b,"]"),e.push(">")}return;case nc:return e.push("<?",i.target," ",i.data,"?>");case ic:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function _c(i,e,t){var r;switch(e.nodeType){case Hr:r=e.cloneNode(!1),r.ownerDocument=i;case Ai:break;case ts:t=!0;break}if(r||(r=e.cloneNode(!1)),r.ownerDocument=i,r.parentNode=null,t)for(var s=e.firstChild;s;)r.appendChild(_c(i,s,t)),s=s.nextSibling;return r}function qu(i,e,t){var r=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=e[s];typeof o!="object"&&o!=r[s]&&(r[s]=o)}switch(e.childNodes&&(r.childNodes=new bi),r.ownerDocument=i,r.nodeType){case Hr:var u=e.attributes,h=r.attributes=new eo,c=u.length;h._ownerElement=r;for(var y=0;y<c;y++)r.setAttributeNode(qu(i,u.item(y),!0));break;case ts:t=!0}if(t)for(var p=e.firstChild;p;)r.appendChild(qu(i,p,t)),p=p.nextSibling;return r}function Cc(i,e,t){i[e]=t}try{if(Object.defineProperty){let i=function(e){switch(e.nodeType){case Hr:case Ai:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(i(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Object.defineProperty(es.prototype,"length",{get:function(){return Nu(this),this.$$length}}),Object.defineProperty(Ut.prototype,"textContent",{get:function(){return i(this)},set:function(e){switch(this.nodeType){case Hr:case Ai:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Cc=function(e,t,r){e["$$"+t]=r}}}catch(i){}Yi.DocumentType=no,Yi.DOMException=se,Yi.DOMImplementation=pc,Yi.Element=Tn,Yi.Node=Ut,Yi.NodeList=bi,Yi.XMLSerializer=bc;var ao={},Dc={};(function(i){var e=Ei.freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
2
- `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(Dc);var Vu={},ta=Ei.NAMESPACE,Wu=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Sc=new RegExp("[\\-\\.0-9"+Wu.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Oc=new RegExp("^"+Wu.source+Sc.source+"*(?::"+Wu.source+Sc.source+"*)?$"),ea=0,Zi=1,is=2,ra=3,ns=4,ss=5,ia=6,oo=7;function as(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,as)}as.prototype=new Error,as.prototype.name=as.name;function Mc(){}Mc.prototype={parse:function(i,e,t){var r=this.domBuilder;r.startDocument(),Bc(e,e={}),e0(i,e,t,r,this.errorHandler),r.endDocument()}};function e0(i,e,t,r,s){function o(B){if(B>65535){B-=65536;var xt=55296+(B>>10),kt=56320+(B&1023);return String.fromCharCode(xt,kt)}else return String.fromCharCode(B)}function u(B){var xt=B.slice(1,-1);return Object.hasOwnProperty.call(t,xt)?t[xt]:xt.charAt(0)==="#"?o(parseInt(xt.substr(1).replace("x","0x"))):(s.error("entity not found:"+B),B)}function h(B){if(B>O){var xt=i.substring(O,B).replace(/&#?\w+;/g,u);T&&c(O),r.characters(xt,0,B-O),O=B}}function c(B,xt){for(;B>=p&&(xt=A.exec(i));)y=xt.index,p=y+xt[0].length,T.lineNumber++;T.columnNumber=B-y+1}for(var y=0,p=0,A=/.*(?:\r\n?|\n)|.*$/g,T=r.locator,C=[{currentNSMap:e}],N={},O=0;;){try{var L=i.indexOf("<",O);if(L<0){if(!i.substr(O).match(/^\s*$/)){var P=r.doc,W=P.createTextNode(i.substr(O));P.appendChild(W),r.currentElement=W}return}switch(L>O&&h(L),i.charAt(L+1)){case"/":var rt=i.indexOf(">",L+3),V=i.substring(L+2,rt).replace(/[ \t\n\r]+$/g,""),b=C.pop();rt<0?(V=i.substring(L+2).replace(/[\s<].*/,""),s.error("end tag name: "+V+" is not complete:"+b.tagName),rt=L+1+V.length):V.match(/\s</)&&(V=V.replace(/[\s<].*/,""),s.error("end tag name: "+V+" maybe not complete"),rt=L+1+V.length);var Y=b.localNSMap,z=b.tagName==V,j=z||b.tagName&&b.tagName.toLowerCase()==V.toLowerCase();if(j){if(r.endElement(b.uri,b.localName,V),Y)for(var tt in Y)Object.prototype.hasOwnProperty.call(Y,tt)&&r.endPrefixMapping(tt);z||s.fatalError("end tag name: "+V+" is not match the current start tagName:"+b.tagName)}else C.push(b);rt++;break;case"?":T&&c(L),rt=a0(i,L,r);break;case"!":T&&c(L),rt=s0(i,L,r,s);break;default:T&&c(L);var Q=new Ic,K=C[C.length-1].currentNSMap,rt=r0(i,L,Q,K,u,s),at=Q.length;if(!Q.closed&&n0(i,rt,Q.tagName,N)&&(Q.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),T&&at){for(var ct=Lc(T,{}),pt=0;pt<at;pt++){var dt=Q[pt];c(dt.offset),dt.locator=Lc(T,{})}r.locator=ct,Nc(Q,r,K)&&C.push(Q),r.locator=T}else Nc(Q,r,K)&&C.push(Q);ta.isHTML(Q.uri)&&!Q.closed?rt=i0(i,rt,Q.tagName,u,r):rt++}}catch(B){if(B instanceof as)throw B;s.error("element parse error: "+B),rt=-1}rt>O?O=rt:h(Math.max(L,O)+1)}}function Lc(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function r0(i,e,t,r,s,o){function u(T,C,N){t.attributeNames.hasOwnProperty(T)&&o.fatalError("Attribute "+T+" redefined"),t.addValue(T,C.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),N)}for(var h,c,y=++e,p=ea;;){var A=i.charAt(y);switch(A){case"=":if(p===Zi)h=i.slice(e,y),p=ra;else if(p===is)p=ra;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(p===ra||p===Zi)if(p===Zi&&(o.warning('attribute value must after "="'),h=i.slice(e,y)),e=y+1,y=i.indexOf(A,e),y>0)c=i.slice(e,y),u(h,c,e-1),p=ss;else throw new Error("attribute value no end '"+A+"' match");else if(p==ns)c=i.slice(e,y),u(h,c,e),o.warning('attribute "'+h+'" missed start quot('+A+")!!"),e=y+1,p=ss;else throw new Error('attribute value must after "="');break;case"/":switch(p){case ea:t.setTagName(i.slice(e,y));case ss:case ia:case oo:p=oo,t.closed=!0;case ns:case Zi:break;case is:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),p==ea&&t.setTagName(i.slice(e,y)),y;case">":switch(p){case ea:t.setTagName(i.slice(e,y));case ss:case ia:case oo:break;case ns:case Zi:c=i.slice(e,y),c.slice(-1)==="/"&&(t.closed=!0,c=c.slice(0,-1));case is:p===is&&(c=h),p==ns?(o.warning('attribute "'+c+'" missed quot(")!'),u(h,c,e)):((!ta.isHTML(r[""])||!c.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),u(c,c,e));break;case ra:throw new Error("attribute value missed!!")}return y;case"€":A=" ";default:if(A<=" ")switch(p){case ea:t.setTagName(i.slice(e,y)),p=ia;break;case Zi:h=i.slice(e,y),p=is;break;case ns:var c=i.slice(e,y);o.warning('attribute "'+c+'" missed quot(")!!'),u(h,c,e);case ss:p=ia;break}else switch(p){case is:t.tagName,(!ta.isHTML(r[""])||!h.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+h+'" missed value!! "'+h+'" instead2!!'),u(h,h,e),e=y,p=Zi;break;case ss:o.warning('attribute space is required"'+h+'"!!');case ia:p=Zi,e=y;break;case ra:p=ns,e=y;break;case oo:throw new Error("elements closed character '/' and '>' must be connected to")}}y++}}function Nc(i,e,t){for(var r=i.tagName,s=null,A=i.length;A--;){var o=i[A],u=o.qName,h=o.value,T=u.indexOf(":");if(T>0)var c=o.prefix=u.slice(0,T),y=u.slice(T+1),p=c==="xmlns"&&y;else y=u,c=null,p=u==="xmlns"&&"";o.localName=y,p!==!1&&(s==null&&(s={},Bc(t,t={})),t[p]=s[p]=h,o.uri=ta.XMLNS,e.startPrefixMapping(p,h))}for(var A=i.length;A--;){o=i[A];var c=o.prefix;c&&(c==="xml"&&(o.uri=ta.XML),c!=="xmlns"&&(o.uri=t[c||""]))}var T=r.indexOf(":");T>0?(c=i.prefix=r.slice(0,T),y=i.localName=r.slice(T+1)):(c=null,y=i.localName=r);var C=i.uri=t[c||""];if(e.startElement(C,y,r,i),i.closed){if(e.endElement(C,y,r),s)for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&e.endPrefixMapping(c)}else return i.currentNSMap=t,i.localNSMap=s,!0}function i0(i,e,t,r,s){if(/^(?:script|textarea)$/i.test(t)){var o=i.indexOf("</"+t+">",e),u=i.substring(e+1,o);if(/[&<]/.test(u))return/^script$/i.test(t)?(s.characters(u,0,u.length),o):(u=u.replace(/&#?\w+;/g,r),s.characters(u,0,u.length),o)}return e+1}function n0(i,e,t,r){var s=r[t];return s==null&&(s=i.lastIndexOf("</"+t+">"),s<e&&(s=i.lastIndexOf("</"+t)),r[t]=s),s<e}function Bc(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function s0(i,e,t,r){var s=i.charAt(e+2);switch(s){case"-":if(i.charAt(e+3)==="-"){var o=i.indexOf("-->",e+4);return o>e?(t.comment(i,e+4,o-e-4),o+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var o=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,o-e-9),t.endCDATA(),o+3}var u=o0(i,e),h=u.length;if(h>1&&/!doctype/i.test(u[0][0])){var c=u[1][0],y=!1,p=!1;h>3&&(/^public$/i.test(u[2][0])?(y=u[3][0],p=h>4&&u[4][0]):/^system$/i.test(u[2][0])&&(p=u[3][0]));var A=u[h-1];return t.startDTD(c,y,p),t.endDTD(),A.index+A[0].length}}return-1}function a0(i,e,t){var r=i.indexOf("?>",e);if(r){var s=i.substring(e,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return s?(s[0].length,t.processingInstruction(s[1],s[2]),r+2):-1}return-1}function Ic(){this.attributeNames={}}Ic.prototype={setTagName:function(i){if(!Oc.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!Oc.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function o0(i,e){var t,r=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(i);t=s.exec(i);)if(r.push(t),t[1])return r}Vu.XMLReader=Mc,Vu.ParseError=as;var u0=Ei,l0=Yi,Rc=Dc,Pc=Vu,h0=l0.DOMImplementation,Fc=u0.NAMESPACE,c0=Pc.ParseError,f0=Pc.XMLReader;function kc(i){return i.replace(/\r[\n\u0085]/g,`
3
- `).replace(/[\r\u0085\u2028]/g,`
4
- `)}function Hc(i){this.options=i||{locator:{}}}Hc.prototype.parseFromString=function(i,e){var t=this.options,r=new f0,s=t.domBuilder||new na,o=t.errorHandler,u=t.locator,h=t.xmlns||{},c=/\/x?html?$/.test(e),y=c?Rc.HTML_ENTITIES:Rc.XML_ENTITIES;u&&s.setDocumentLocator(u),r.errorHandler=p0(o,s,u),r.domBuilder=t.domBuilder||s,c&&(h[""]=Fc.HTML),h.xml=h.xml||Fc.XML;var p=t.normalizeLineEndings||kc;return i&&typeof i=="string"?r.parse(p(i),h,y):r.errorHandler.error("invalid doc source"),s.doc};function p0(i,e,t){if(!i){if(e instanceof na)return e;i=e}var r={},s=i instanceof Function;t=t||{};function o(u){var h=i[u];!h&&s&&(h=i.length==2?function(c){i(u,c)}:i),r[u]=h&&function(c){h("[xmldom "+u+"] "+c+zu(t))}||function(){}}return o("warning"),o("error"),o("fatalError"),r}function na(){this.cdata=!1}function os(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}na.prototype={startDocument:function(){this.doc=new h0().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,r){var s=this.doc,o=s.createElementNS(i,t||e),u=r.length;uo(this,o),this.currentElement=o,this.locator&&os(this.locator,o);for(var h=0;h<u;h++){var i=r.getURI(h),c=r.getValue(h),t=r.getQName(h),y=s.createAttributeNS(i,t);this.locator&&os(r.getLocator(h),y),y.value=y.nodeValue=c,o.setAttributeNode(y)}},endElement:function(i,e,t){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(i,e){},endPrefixMapping:function(i){},processingInstruction:function(i,e){var t=this.doc.createProcessingInstruction(i,e);this.locator&&os(this.locator,t),uo(this,t)},ignorableWhitespace:function(i,e,t){},characters:function(i,e,t){if(i=Uc.apply(this,arguments),i){if(this.cdata)var r=this.doc.createCDATASection(i);else var r=this.doc.createTextNode(i);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(i)&&this.doc.appendChild(r),this.locator&&os(this.locator,r)}},skippedEntity:function(i){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(i){(this.locator=i)&&(i.lineNumber=0)},comment:function(i,e,t){i=Uc.apply(this,arguments);var r=this.doc.createComment(i);this.locator&&os(this.locator,r),uo(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(i,e,t){var r=this.doc.implementation;if(r&&r.createDocumentType){var s=r.createDocumentType(i,e,t);this.locator&&os(this.locator,s),uo(this,s),this.doc.doctype=s}},warning:function(i){console.warn("[xmldom warning] "+i,zu(this.locator))},error:function(i){console.error("[xmldom error] "+i,zu(this.locator))},fatalError:function(i){throw new c0(i,this.locator)}};function zu(i){if(i)return`
5
- @`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function Uc(i,e,t){return typeof i=="string"?i.substr(e,t):i.length>=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){na.prototype[i]=function(){return null}});function uo(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}ao.__DOMHandler=na,ao.normalizeLineEndings=kc,ao.DOMParser=Hc;var d0=ao.DOMParser;const g0="1.0.78";function y0(){return typeof window!="undefined"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const us=typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"?self:{document:void 0,tinyEngine:void 0};us.Path2D||Gs(us),us.DOMParser||(us.DOMParser=d0);const Vt={window:us,version:g0,isBrowser:y0(),dpr:typeof window!="undefined"&&window.devicePixelRatio||1,document:us.document,time:0,deltaTime:0,config:Gt},sa=(i,e,t)=>Math.max(e,Math.min(t,i)),qc=(i,e=1e-6)=>Math.abs(i)<e?0:i<0?-1:1,m0=i=>i*(Math.PI/180),v0=(i,e)=>(i%e+e)%e,$u=(i,e,t)=>(1-t)*i+t*e,x0=i=>{let e=i*(180/Math.PI);return e<0&&(e+=360),e>360&&(e-=360),e},Qt={transparent:"rgba(1, 1, 1, 0)",green:"#45b787",darkGreen:"#314a43",blue:"#6e9bc5",darkBlue:"#2775b6",red:"#F26666",darkRed:"#D95970",brown:"#ECD2B9",darkBrown:"#BF9D8A",yellow:"#ECDEC0",darkYellow:"#D0AC57",lightGray:"#e0e0e0",gray:"#beb6b6",darkGray:"#918883",white:"#F2F2F2",darkWhite:"#ececec",lightBlack:"#2E3032",black:"#182327",blackAlpha5:"rgba(0, 0, 0, 0.5)"},E0={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},Ur={h:0,s:0,l:0},lo={h:0,s:0,l:0};function Gu(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}const A0=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Yt{constructor(e,t,r,s){d(this,"isColor",!0);d(this,"r",1);d(this,"g",1);d(this,"b",1);d(this,"a",1);return t===void 0&&r===void 0?this.set(e):this.setRGBA(e,t,r,s)}static isColor(e){return typeof e=="string"?A0.test(e):typeof e=="number"?e>=0&&e<=16777215:!1}static getRandomStyle(){return Ti.random().getStyle()}static getDarken(e,t=.8){return Ti.set(e).getHSL(ho),Ti.setHSL(ho.h,ho.s,ho.l*t).getStyle()}static getLighten(e,t=1.2){return this.getDarken(e,t)}static getContrast(e){return Ti.set(e),Ti.getContrastString()}static getArray(e){return Ti.set(e).toArray()}static getComplementary(e){return Ti.set(e),Ti.getComplementaryString()}static getMoreTransparent(e,t){return Ti.set(e).setA(t).getStyle()}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(e){return this.r=e,this.g=e,this.b=e,this.a=1,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this.a=1,this}setR(e){return this.r=e,this}setG(e){return this.g=e,this}setB(e){return this.b=e,this}setA(e){return this.a=e,this}setRGB(e,t,r){return this.setRGBA(e,t,r,this.a)}setRGBA(e,t,r,s=1){return this.r=e,this.g=t,this.b=r,this.a=s,this}setHSL(e,t,r,s=1){if(e=v0(e,1),t=sa(t,0,1),r=sa(r,0,1),t===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+t):r+t-r*t,u=2*r-o;this.r=Gu(u,o,e+1/3),this.g=Gu(u,o,e),this.b=Gu(u,o,e-1/3)}return this.a=s,this}setStyle(e){let t;if(t=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let r;const s=t[1],o=t[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const u=parseFloat(r[1])/360,h=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100,y=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0);return this.setHSL(u,h,c,y)}break}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=t[1],s=r.length;if(s===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this.a=1,this;if(s===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this.a=1,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=E0[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("Color: Unknown color "+e),this}clone(){return new Yt(this.r,this.g,this.b,this.a)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}getRGB(e=new Yt){return e.setRGB(this.r,this.g,this.b)}getRGBByBg(e=new Yt){const t=this.a,r=t*this.r+(1-t)*e.r,s=t*this.g+(1-t)*e.g,o=t*this.b+(1-t)*e.b;return new Yt(r,s,o)}getHex(){return sa(this.r*255,0,255)<<16^sa(this.g*255,0,255)<<8^sa(this.b*255,0,255)<<0}getHSL(e){const t=this.r,r=this.g,s=this.b,o=Math.max(t,r,s),u=Math.min(t,r,s);let h=0,c;const y=(u+o)/2;if(u===o)h=0,c=0;else{const p=o-u;switch(c=y<=.5?p/(o+u):p/(2-o-u),o){case t:h=(r-s)/p+(r<s?6:0);break;case r:h=(s-t)/p+2;break;case s:h=(t-r)/p+4;break}h/=6}return e.h=h,e.s=c,e.l=y,e}getStyle(){return this.a===1?`rgb(${this.r*255|0},${this.g*255|0},${this.b*255|0})`:`rgba(${this.r*255|0},${this.g*255|0},${this.b*255|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let e=(this.r*255*299+this.g*255*587+this.b*255*144)/1e3;return e+=(255-e)*(255-this.a*255)/255,e}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(e=new Yt){const t=this.toArray(),r=[0,0,0,1];for(let s=0;s<t.length;s++)if(s<3)r[s]=1-t[s];else if(s===3)t[s]>1||t[s]<=0?r[s]=1:r[s]=Math.max(Math.min(parseFloat(t[s].toFixed(2)),1),0);else continue;return e.setRGBA(r[0],r[1],r[2],parseFloat(r[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(e){if(typeof e=="undefined"||e>=1)return this.getHexString();const t=this.getRGBByBg(),r=t.r*e+(1-e),s=t.g*e+(1-e),o=t.b*e+(1-e);return new Yt(r,s,o).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(e,t,r){return this.getHSL(Ur),Ur.h+=e,Ur.s+=t,Ur.l+=r,this.setHSL(Ur.h,Ur.s,Ur.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Ur),e.getHSL(lo);const r=$u(Ur.h,lo.h,t),s=$u(Ur.s,lo.s,t),o=$u(Ur.l,lo.l,t);return this.setHSL(r,s,o),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}toArray(e=[0,0,0,0],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),e.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Ti=new Yt,ho={h:0,s:0,l:0};class k{constructor(e=0,t=0,r){d(this,"isVector2",!0);d(this,"x",0);d(this,"y",0);d(this,"z");this.x=e,this.y=t,this.z=r||0}static isZero(e){return e.x===0&&e.y===0}static isEmpty(e){return!Number.isFinite(e.x)&&!Number.isFinite(e.y)}static equals(e,t,r=!0){return r?e.x===t.x&&e.y===t.y:Math.abs(e.x-t.x)<Number.EPSILON&&Math.abs(e.y-t.y)<Number.EPSILON}static getInt32Array(e,t=2){const r=new ArrayBuffer(e.length*t*4),s=new Int32Array(r);for(let o=0,u=e.length;o<u;o++)s[o*2]=e[o].x,s[o*2+1]=e[o].y;return s}static getFloat64Array(e,t=2){const r=new ArrayBuffer(e.length*t*8),s=new Float64Array(r);for(let o=0,u=e.length;o<u;o++)s[o*2]=e[o].x,s[o*2+1]=e[o].y;return s}static getVectors(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(new k(e[r].x,e[r].y));return t}static getStrings(e){const t=[];if(!e||!e.length)return"";for(let r=0,s=e.length;r<s;r++)t.push(k.getString(e[r]));return t.join(",")}static getString(e){return`${e.x},${e.y}`}static getLength(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static getDistance(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}static dot(e,t){return e.x*t.x+e.y*t.y}static cross(e,t){return e.x*t.y-e.y*t.x}static sub(e,t){return new k().subVectors(e,t)}static isPointOnSegment(e,t,r){return qc(this.sub(e,r).cross(this.sub(t,r)))===0&&qc(this.sub(e,r).dot(this.sub(t,r)))<=0}static angle(e,t,r){return r?Math.atan2(e.y-t.y,e.x-t.x):x0(Math.atan2(e.y-t.y,e.x-t.x))}static getSamplingPoints(e,t=100){let r=this.getClothoidPoints(e,t),s=0;for(let o=0,u=r.length;o<u;o++){let h=Math.max(0,o-1);o>0?s+=this.getDistance(r[h],r[h+1]):s=0,r[o].l=Math.round(s);let c=this.angle(r[h+1],r[h]);r[o].a=Math.round(c*100)/100}return r}static getClothoidPoints(e,t=100){let r=[],s=e.concat([]);if(!s||s.length<2)return r;s.length===2?(s.push(s[1]),s.unshift(s[0])):s.length===3&&s.splice(2,0,s[1]);for(let o=0;o<s.length-3;o+=3){let u=new k(s[o].x,s[o].y),h=new k(s[o+1].x,s[o+1].y),c=new k(s[o+2].x,s[o+2].y),y=new k(s[o+3].x,s[o+3].y),p=0;p+=u.distanceTo(h),p+=h.distanceTo(c),p+=c.distanceTo(y);let A=Math.min(.5,1/(p/t));for(let T=A;T<1;T+=A){let C=3*(h.x-u.x),N=3*(c.x-h.x)-C,O=y.x-u.x-C-N,L=3*(h.y-u.y),P=3*(c.y-h.y)-L,W=y.y-u.y-L-P,V=O*Math.pow(T,3)+N*Math.pow(T,2)+C*T+u.x,b=W*Math.pow(T,3)+P*Math.pow(T,2)+L*T+u.y;r.push({x:Math.round(V),y:Math.round(b),a:0,l:0})}}return r.unshift({x:s[0].x,y:s[0].y,a:0,l:0}),r.push({x:s[s.length-1].x,y:s[s.length-1].y,a:0,l:0}),r}static getClothoidLength(e){let t=0;if(e.length>2)for(let r=0;r<e.length;r++){let s=Math.max(0,r-1);r>0&&(t+=this.getDistance(e[s],e[s+1]))}return t}static getCircleCenterByChord(e,t,r,s=!0,o=new k){const u=this.getDistance(e,t);if(u===0)return o.x=1/0,o.y=1/0,o;Yu.set((e.x+t.x)/2,(e.y+t.y)/2);const h=Math.sqrt(r*r-u*u/4),c=s?-1:1;return o.x=Yu.x+c*h*(t.y-e.y)/u,o.y=Yu.y-c*h*(t.x-e.x)/u,o}static isPointInCircle(e,t,r){return this.getDistance(r,e)<t}static isPointInConvexHull(e,t){let r=!1;const s=t.length;for(let o=0,u=s-1;o<s;u=o++){const h=t[o],c=t[u];if(Math.min(h.x,c.x)<=e.x&&e.x<=Math.max(h.x,c.x)&&Math.min(h.y,c.y)<=e.y&&e.y<=Math.max(h.y,c.y)){const y=(c.x-h.x)*(e.y-h.y)-(c.y-h.y)*(e.x-h.x);if(Math.abs(y)<1e-12)return!0}h.y>e.y!=c.y>e.y&&e.x<(c.x-h.x)*(e.y-h.y)/(c.y-h.y)+h.x&&(r=!r)}return r}static isPointInPolygonByRay(e,t){let r=0;const s=new k().copy(e),o=new k,u=new k;for(let h=0;h<t.length;h++){h===t.length-1?(o.copy(t[h]),u.copy(t[0])):(o.copy(t[h]),u.copy(t[h+1]));let c=[o.y,u.y].sort((y,p)=>y-p);c[0]<s.y&&c[1]>s.y&&(o.x<s.x||u.x<s.x)&&r++}return r%2===1}static getIntersectionOfSegments(e,t,r,s,o=!1,u=new k){const h=(s.y-r.y)*(t.x-e.x)-(s.x-r.x)*(t.y-e.y);if(h===0)return u.makeEmpty();const c=(s.x-r.x)*(e.y-r.y)-(s.y-r.y)*(e.x-r.x),y=(t.x-e.x)*(e.y-r.y)-(t.y-e.y)*(e.x-r.x),p=c/h,A=y/h;return o&&(p<0||p>1||A<0||A>1)?u.makeEmpty():(u.x=e.x+p*(t.x-e.x),u.y=e.y+p*(t.y-e.y),u)}static getConvexHullByGrahamScan(e,t=!1,r=[]){if(!e||!e.length)return r;const s=e.length;let o=0;for(let c=0;c<s;c++)e[c].x<e[o].x&&(o=c);let u=o,h;do{r.push(e[u]),h=(u+1)%s;for(let c=0;c<s;c++)this.whichSideOfSegment(e[u],e[c],e[h])>0&&(h=c);u=h}while(u!==o);return t&&r.push(e[o]),r}static whichSideOfSegment(e,t,r){return(t.x-e.x)*(r.y-e.y)-(r.x-e.x)*(t.y-e.y)}static getPointsWithMatrix3(e,t){const r=[];if(!e)return r;for(let s=0,o=e.length;s<o;s++)r.push({x:t.elements[0]*e[s].x+t.elements[3]*e[s].y+t.elements[6],y:t.elements[1]*e[s].x+t.elements[4]*e[s].y+t.elements[7]});return r}static getPointsApplyMatrix3(e,t=[]){for(let r=0,s=t.length;r<s;r++){const o=e.elements[0]*t[r].x+e.elements[3]*t[r].y+e.elements[6],u=e.elements[1]*t[r].x+e.elements[4]*t[r].y+e.elements[7];t[r].x=o,t[r].y=u}return t}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(e){const t=this.x,r=this.y,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6],this.y=s[1]*t+s[4]*r+s[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clone(){return new k(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}cross(e){return this.x*e.y-this.y*e.x}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}dot(e){return this.x*e.x+this.y*e.y}equals(e,t=!0){return t?e.x===this.x&&e.y===this.y:Math.abs(e.x-this.x)<Number.EPSILON&&Math.abs(e.y-this.y)<Number.EPSILON}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+e)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return this.x===0&&this.y===0}length(){return Math.sqrt(this.dot(this))}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}maxXY(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,t),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}minXY(e,t){return this.x=Math.min(this.x,e),this.y=Math.min(this.y,t),this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e,t){return this.x*=e,this.y*=t||e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(e){return this.applyMatrix3(e.matrixWorldInverse).applyMatrix3(e.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(e){const t=Math.cos(e),r=Math.sin(e),s=this.x,o=this.y;return this.x=s*t-o*r,this.y=s*r+o*t,this}rotateAround(e,t){const r=Math.cos(t),s=Math.sin(t),o=this.x-e.x,u=this.y-e.y;return this.x=o*r-u*s+e.x,this.y=o*s+u*r+e.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(e,t){return this.x=e,this.y=t,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("out of range: "+e)}return this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*3)}setLength(e){return this.normalize().multiplyScalar(e)}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(e,t=!1){return this.applyMatrix3(e.projectionMatrixInverse).applyMatrix3(e.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const Yu=new k,b0=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}));var co={exports:{}};/**
6
- * @license
7
- * Lodash <https://lodash.com/>
8
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
9
- * Released under MIT license <https://lodash.com/license>
10
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
11
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12
- */co.exports,function(i,e){(function(){var t,r="4.17.21",s=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",h="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",y=500,p="__lodash_placeholder__",A=1,T=2,C=4,N=1,O=2,L=1,P=2,W=4,V=8,b=16,Y=32,z=64,j=128,tt=256,Q=512,K=30,rt="...",at=800,ct=16,pt=1,dt=2,B=3,xt=1/0,kt=9007199254740991,Ue=17976931348623157e292,Se=NaN,ge=4294967295,we=ge-1,Xr=ge>>>1,qe=[["ary",j],["bind",L],["bindKey",P],["curry",V],["curryRight",b],["flip",Q],["partial",Y],["partialRight",z],["rearg",tt]],ye="[object Arguments]",Ie="[object Array]",Kt="[object AsyncFunction]",te="[object Boolean]",Bt="[object Date]",Zt="[object DOMException]",Re="[object Error]",Ve="[object Function]",er="[object GeneratorFunction]",ie="[object Map]",Pe="[object Number]",Te="[object Null]",ee="[object Object]",pi="[object Promise]",Ni="[object Proxy]",me="[object RegExp]",It="[object Set]",pr="[object String]",rr="[object Symbol]",Bi="[object Undefined]",Dr="[object WeakMap]",an="[object WeakSet]",dr="[object ArrayBuffer]",ir="[object DataView]",on="[object Float32Array]",un="[object Float64Array]",di="[object Int8Array]",Ii="[object Int16Array]",Fn="[object Int32Array]",H="[object Uint8Array]",nt="[object Uint8ClampedArray]",ot="[object Uint16Array]",Mt="[object Uint32Array]",Et=/\b__p \+= '';/g,xe=/\b(__p \+=) '' \+/g,Fe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Sr=/&(?:amp|lt|gt|quot|#39);/g,ln=/[&<>"']/g,gr=RegExp(Sr.source),kn=RegExp(ln.source),hn=/<%-([\s\S]+?)%>/g,gi=/<%([\s\S]+?)%>/g,Hn=/<%=([\s\S]+?)%>/g,Un=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cn=/^\w*$/,Pl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fn=/[\\^$.*+?()[\]{}|]/g,Fl=RegExp(fn.source),Na=/^\s+/,Po=/\s/,Ba=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,kl=/\{\n\/\* \[wrapped with (.+)\] \*/,Fo=/,? & /,Hl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ko=/[()=,{}\[\]\/\s]/,Ho=/\\(\\)?/g,Uo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ia=/\w*$/,Ra=/^[-+]0x[0-9a-f]+$/i,Ri=/^0b[01]+$/i,qn=/^\[object .+?Constructor\]$/,Vn=/^0o[0-7]+$/i,bs=/^(?:0|[1-9]\d*)$/,Pa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ws=/($^)/,Ul=/['\n\r\u2028\u2029\\]/g,Pi="\\ud800-\\udfff",nr="\\u0300-\\u036f",pn="\\ufe20-\\ufe2f",yi="\\u20d0-\\u20ff",Or=nr+pn+yi,dn="\\u2700-\\u27bf",yr="a-z\\xdf-\\xf6\\xf8-\\xff",Qr="\\xac\\xb1\\xd7\\xf7",qo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Vo="\\u2000-\\u206f",Ts=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",sr="A-Z\\xc0-\\xd6\\xd8-\\xde",Wn="\\ufe0e\\ufe0f",_s=Qr+qo+Vo+Ts,zn="['’]",Fa="["+Pi+"]",Cs="["+_s+"]",Fi="["+Or+"]",Kr="\\d+",ql="["+dn+"]",ka="["+yr+"]",Ds="[^"+Pi+_s+Kr+dn+yr+sr+"]",Ss="\\ud83c[\\udffb-\\udfff]",Vl="(?:"+Fi+"|"+Ss+")",Wo="[^"+Pi+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",E="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+sr+"]",R="\\u200d",X="(?:"+ka+"|"+Ds+")",et="(?:"+_+"|"+Ds+")",At="(?:"+zn+"(?:d|ll|m|re|s|t|ve))?",oe="(?:"+zn+"(?:D|LL|M|RE|S|T|VE))?",ve=Vl+"?",_e="["+Wn+"]?",Mr="(?:"+R+"(?:"+[Wo,m,E].join("|")+")"+_e+ve+")*",pv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",dv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Op=_e+ve+Mr,gv="(?:"+[ql,m,E].join("|")+")"+Op,yv="(?:"+[Wo+Fi+"?",Fi,m,E,Fa].join("|")+")",mv=RegExp(zn,"g"),vv=RegExp(Fi,"g"),Wl=RegExp(Ss+"(?="+Ss+")|"+yv+Op,"g"),xv=RegExp([_+"?"+ka+"+"+At+"(?="+[Cs,_,"$"].join("|")+")",et+"+"+oe+"(?="+[Cs,_+X,"$"].join("|")+")",_+"?"+X+"+"+At,_+"+"+oe,dv,pv,Kr,gv].join("|"),"g"),Ev=RegExp("["+R+Pi+Or+Wn+"]"),Av=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,bv=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],wv=-1,Xt={};Xt[on]=Xt[un]=Xt[di]=Xt[Ii]=Xt[Fn]=Xt[H]=Xt[nt]=Xt[ot]=Xt[Mt]=!0,Xt[ye]=Xt[Ie]=Xt[dr]=Xt[te]=Xt[ir]=Xt[Bt]=Xt[Re]=Xt[Ve]=Xt[ie]=Xt[Pe]=Xt[ee]=Xt[me]=Xt[It]=Xt[pr]=Xt[Dr]=!1;var $t={};$t[ye]=$t[Ie]=$t[dr]=$t[ir]=$t[te]=$t[Bt]=$t[on]=$t[un]=$t[di]=$t[Ii]=$t[Fn]=$t[ie]=$t[Pe]=$t[ee]=$t[me]=$t[It]=$t[pr]=$t[rr]=$t[H]=$t[nt]=$t[ot]=$t[Mt]=!0,$t[Re]=$t[Ve]=$t[Dr]=!1;var Tv={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},_v={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Cv={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Dv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Sv=parseFloat,Ov=parseInt,Mp=typeof Zs=="object"&&Zs&&Zs.Object===Object&&Zs,Mv=typeof self=="object"&&self&&self.Object===Object&&self,Oe=Mp||Mv||Function("return this")(),zl=e&&!e.nodeType&&e,$n=zl&&!0&&i&&!i.nodeType&&i,Lp=$n&&$n.exports===zl,$l=Lp&&Mp.process,Lr=function(){try{var S=$n&&$n.require&&$n.require("util").types;return S||$l&&$l.binding&&$l.binding("util")}catch(U){}}(),Np=Lr&&Lr.isArrayBuffer,Bp=Lr&&Lr.isDate,Ip=Lr&&Lr.isMap,Rp=Lr&&Lr.isRegExp,Pp=Lr&&Lr.isSet,Fp=Lr&&Lr.isTypedArray;function mr(S,U,F){switch(F.length){case 0:return S.call(U);case 1:return S.call(U,F[0]);case 2:return S.call(U,F[0],F[1]);case 3:return S.call(U,F[0],F[1],F[2])}return S.apply(U,F)}function Lv(S,U,F,it){for(var gt=-1,Pt=S==null?0:S.length;++gt<Pt;){var Ee=S[gt];U(it,Ee,F(Ee),S)}return it}function Nr(S,U){for(var F=-1,it=S==null?0:S.length;++F<it&&U(S[F],F,S)!==!1;);return S}function Nv(S,U){for(var F=S==null?0:S.length;F--&&U(S[F],F,S)!==!1;);return S}function kp(S,U){for(var F=-1,it=S==null?0:S.length;++F<it;)if(!U(S[F],F,S))return!1;return!0}function gn(S,U){for(var F=-1,it=S==null?0:S.length,gt=0,Pt=[];++F<it;){var Ee=S[F];U(Ee,F,S)&&(Pt[gt++]=Ee)}return Pt}function zo(S,U){var F=S==null?0:S.length;return!!F&&Os(S,U,0)>-1}function Gl(S,U,F){for(var it=-1,gt=S==null?0:S.length;++it<gt;)if(F(U,S[it]))return!0;return!1}function jt(S,U){for(var F=-1,it=S==null?0:S.length,gt=Array(it);++F<it;)gt[F]=U(S[F],F,S);return gt}function yn(S,U){for(var F=-1,it=U.length,gt=S.length;++F<it;)S[gt+F]=U[F];return S}function Yl(S,U,F,it){var gt=-1,Pt=S==null?0:S.length;for(it&&Pt&&(F=S[++gt]);++gt<Pt;)F=U(F,S[gt],gt,S);return F}function Bv(S,U,F,it){var gt=S==null?0:S.length;for(it&&gt&&(F=S[--gt]);gt--;)F=U(F,S[gt],gt,S);return F}function Zl(S,U){for(var F=-1,it=S==null?0:S.length;++F<it;)if(U(S[F],F,S))return!0;return!1}var Iv=Xl("length");function Rv(S){return S.split("")}function Pv(S){return S.match(Hl)||[]}function Hp(S,U,F){var it;return F(S,function(gt,Pt,Ee){if(U(gt,Pt,Ee))return it=Pt,!1}),it}function $o(S,U,F,it){for(var gt=S.length,Pt=F+(it?1:-1);it?Pt--:++Pt<gt;)if(U(S[Pt],Pt,S))return Pt;return-1}function Os(S,U,F){return U===U?Zv(S,U,F):$o(S,Up,F)}function Fv(S,U,F,it){for(var gt=F-1,Pt=S.length;++gt<Pt;)if(it(S[gt],U))return gt;return-1}function Up(S){return S!==S}function qp(S,U){var F=S==null?0:S.length;return F?Kl(S,U)/F:Se}function Xl(S){return function(U){return U==null?t:U[S]}}function Ql(S){return function(U){return S==null?t:S[U]}}function Vp(S,U,F,it,gt){return gt(S,function(Pt,Ee,zt){F=it?(it=!1,Pt):U(F,Pt,Ee,zt)}),F}function kv(S,U){var F=S.length;for(S.sort(U);F--;)S[F]=S[F].value;return S}function Kl(S,U){for(var F,it=-1,gt=S.length;++it<gt;){var Pt=U(S[it]);Pt!==t&&(F=F===t?Pt:F+Pt)}return F}function jl(S,U){for(var F=-1,it=Array(S);++F<S;)it[F]=U(F);return it}function Hv(S,U){return jt(U,function(F){return[F,S[F]]})}function Wp(S){return S&&S.slice(0,Yp(S)+1).replace(Na,"")}function vr(S){return function(U){return S(U)}}function Jl(S,U){return jt(U,function(F){return S[F]})}function Ha(S,U){return S.has(U)}function zp(S,U){for(var F=-1,it=S.length;++F<it&&Os(U,S[F],0)>-1;);return F}function $p(S,U){for(var F=S.length;F--&&Os(U,S[F],0)>-1;);return F}function Uv(S,U){for(var F=S.length,it=0;F--;)S[F]===U&&++it;return it}var qv=Ql(Tv),Vv=Ql(_v);function Wv(S){return"\\"+Dv[S]}function zv(S,U){return S==null?t:S[U]}function Ms(S){return Ev.test(S)}function $v(S){return Av.test(S)}function Gv(S){for(var U,F=[];!(U=S.next()).done;)F.push(U.value);return F}function th(S){var U=-1,F=Array(S.size);return S.forEach(function(it,gt){F[++U]=[gt,it]}),F}function Gp(S,U){return function(F){return S(U(F))}}function mn(S,U){for(var F=-1,it=S.length,gt=0,Pt=[];++F<it;){var Ee=S[F];(Ee===U||Ee===p)&&(S[F]=p,Pt[gt++]=F)}return Pt}function Go(S){var U=-1,F=Array(S.size);return S.forEach(function(it){F[++U]=it}),F}function Yv(S){var U=-1,F=Array(S.size);return S.forEach(function(it){F[++U]=[it,it]}),F}function Zv(S,U,F){for(var it=F-1,gt=S.length;++it<gt;)if(S[it]===U)return it;return-1}function Xv(S,U,F){for(var it=F+1;it--;)if(S[it]===U)return it;return it}function Ls(S){return Ms(S)?Kv(S):Iv(S)}function jr(S){return Ms(S)?jv(S):Rv(S)}function Yp(S){for(var U=S.length;U--&&Po.test(S.charAt(U)););return U}var Qv=Ql(Cv);function Kv(S){for(var U=Wl.lastIndex=0;Wl.test(S);)++U;return U}function jv(S){return S.match(Wl)||[]}function Jv(S){return S.match(xv)||[]}var t1=function S(U){U=U==null?Oe:Ns.defaults(Oe.Object(),U,Ns.pick(Oe,bv));var F=U.Array,it=U.Date,gt=U.Error,Pt=U.Function,Ee=U.Math,zt=U.Object,eh=U.RegExp,e1=U.String,Br=U.TypeError,Yo=F.prototype,r1=Pt.prototype,Bs=zt.prototype,Zo=U["__core-js_shared__"],Xo=r1.toString,qt=Bs.hasOwnProperty,i1=0,Zp=function(){var n=/[^.]+$/.exec(Zo&&Zo.keys&&Zo.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),Qo=Bs.toString,n1=Xo.call(zt),s1=Oe._,a1=eh("^"+Xo.call(qt).replace(fn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ko=Lp?U.Buffer:t,vn=U.Symbol,jo=U.Uint8Array,Xp=Ko?Ko.allocUnsafe:t,Jo=Gp(zt.getPrototypeOf,zt),Qp=zt.create,Kp=Bs.propertyIsEnumerable,tu=Yo.splice,jp=vn?vn.isConcatSpreadable:t,Ua=vn?vn.iterator:t,Gn=vn?vn.toStringTag:t,eu=function(){try{var n=Kn(zt,"defineProperty");return n({},"",{}),n}catch(a){}}(),o1=U.clearTimeout!==Oe.clearTimeout&&U.clearTimeout,u1=it&&it.now!==Oe.Date.now&&it.now,l1=U.setTimeout!==Oe.setTimeout&&U.setTimeout,ru=Ee.ceil,iu=Ee.floor,rh=zt.getOwnPropertySymbols,h1=Ko?Ko.isBuffer:t,Jp=U.isFinite,c1=Yo.join,f1=Gp(zt.keys,zt),Ae=Ee.max,ke=Ee.min,p1=it.now,d1=U.parseInt,td=Ee.random,g1=Yo.reverse,ih=Kn(U,"DataView"),qa=Kn(U,"Map"),nh=Kn(U,"Promise"),Is=Kn(U,"Set"),Va=Kn(U,"WeakMap"),Wa=Kn(zt,"create"),nu=Va&&new Va,Rs={},y1=jn(ih),m1=jn(qa),v1=jn(nh),x1=jn(Is),E1=jn(Va),su=vn?vn.prototype:t,za=su?su.valueOf:t,ed=su?su.toString:t;function v(n){if(ne(n)&&!mt(n)&&!(n instanceof St)){if(n instanceof Ir)return n;if(qt.call(n,"__wrapped__"))return rg(n)}return new Ir(n)}var Ps=function(){function n(){}return function(a){if(!re(a))return{};if(Qp)return Qp(a);n.prototype=a;var l=new n;return n.prototype=t,l}}();function au(){}function Ir(n,a){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=t}v.templateSettings={escape:hn,evaluate:gi,interpolate:Hn,variable:"",imports:{_:v}},v.prototype=au.prototype,v.prototype.constructor=v,Ir.prototype=Ps(au.prototype),Ir.prototype.constructor=Ir;function St(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ge,this.__views__=[]}function A1(){var n=new St(this.__wrapped__);return n.__actions__=ar(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=ar(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=ar(this.__views__),n}function b1(){if(this.__filtered__){var n=new St(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function w1(){var n=this.__wrapped__.value(),a=this.__dir__,l=mt(n),f=a<0,g=l?n.length:0,x=Rx(0,g,this.__views__),w=x.start,D=x.end,M=D-w,$=f?D:w-1,G=this.__iteratees__,Z=G.length,J=0,st=ke(M,this.__takeCount__);if(!l||!f&&g==M&&st==M)return _d(n,this.__actions__);var lt=[];t:for(;M--&&J<st;){$+=a;for(var bt=-1,ht=n[$];++bt<Z;){var Ct=G[bt],Lt=Ct.iteratee,Ar=Ct.type,$e=Lt(ht);if(Ar==dt)ht=$e;else if(!$e){if(Ar==pt)continue t;break t}}lt[J++]=ht}return lt}St.prototype=Ps(au.prototype),St.prototype.constructor=St;function Yn(n){var a=-1,l=n==null?0:n.length;for(this.clear();++a<l;){var f=n[a];this.set(f[0],f[1])}}function T1(){this.__data__=Wa?Wa(null):{},this.size=0}function _1(n){var a=this.has(n)&&delete this.__data__[n];return this.size-=a?1:0,a}function C1(n){var a=this.__data__;if(Wa){var l=a[n];return l===c?t:l}return qt.call(a,n)?a[n]:t}function D1(n){var a=this.__data__;return Wa?a[n]!==t:qt.call(a,n)}function S1(n,a){var l=this.__data__;return this.size+=this.has(n)?0:1,l[n]=Wa&&a===t?c:a,this}Yn.prototype.clear=T1,Yn.prototype.delete=_1,Yn.prototype.get=C1,Yn.prototype.has=D1,Yn.prototype.set=S1;function ki(n){var a=-1,l=n==null?0:n.length;for(this.clear();++a<l;){var f=n[a];this.set(f[0],f[1])}}function O1(){this.__data__=[],this.size=0}function M1(n){var a=this.__data__,l=ou(a,n);if(l<0)return!1;var f=a.length-1;return l==f?a.pop():tu.call(a,l,1),--this.size,!0}function L1(n){var a=this.__data__,l=ou(a,n);return l<0?t:a[l][1]}function N1(n){return ou(this.__data__,n)>-1}function B1(n,a){var l=this.__data__,f=ou(l,n);return f<0?(++this.size,l.push([n,a])):l[f][1]=a,this}ki.prototype.clear=O1,ki.prototype.delete=M1,ki.prototype.get=L1,ki.prototype.has=N1,ki.prototype.set=B1;function Hi(n){var a=-1,l=n==null?0:n.length;for(this.clear();++a<l;){var f=n[a];this.set(f[0],f[1])}}function I1(){this.size=0,this.__data__={hash:new Yn,map:new(qa||ki),string:new Yn}}function R1(n){var a=xu(this,n).delete(n);return this.size-=a?1:0,a}function P1(n){return xu(this,n).get(n)}function F1(n){return xu(this,n).has(n)}function k1(n,a){var l=xu(this,n),f=l.size;return l.set(n,a),this.size+=l.size==f?0:1,this}Hi.prototype.clear=I1,Hi.prototype.delete=R1,Hi.prototype.get=P1,Hi.prototype.has=F1,Hi.prototype.set=k1;function Zn(n){var a=-1,l=n==null?0:n.length;for(this.__data__=new Hi;++a<l;)this.add(n[a])}function H1(n){return this.__data__.set(n,c),this}function U1(n){return this.__data__.has(n)}Zn.prototype.add=Zn.prototype.push=H1,Zn.prototype.has=U1;function Jr(n){var a=this.__data__=new ki(n);this.size=a.size}function q1(){this.__data__=new ki,this.size=0}function V1(n){var a=this.__data__,l=a.delete(n);return this.size=a.size,l}function W1(n){return this.__data__.get(n)}function z1(n){return this.__data__.has(n)}function $1(n,a){var l=this.__data__;if(l instanceof ki){var f=l.__data__;if(!qa||f.length<s-1)return f.push([n,a]),this.size=++l.size,this;l=this.__data__=new Hi(f)}return l.set(n,a),this.size=l.size,this}Jr.prototype.clear=q1,Jr.prototype.delete=V1,Jr.prototype.get=W1,Jr.prototype.has=z1,Jr.prototype.set=$1;function rd(n,a){var l=mt(n),f=!l&&Jn(n),g=!l&&!f&&wn(n),x=!l&&!f&&!g&&Us(n),w=l||f||g||x,D=w?jl(n.length,e1):[],M=D.length;for(var $ in n)(a||qt.call(n,$))&&!(w&&($=="length"||g&&($=="offset"||$=="parent")||x&&($=="buffer"||$=="byteLength"||$=="byteOffset")||Wi($,M)))&&D.push($);return D}function id(n){var a=n.length;return a?n[gh(0,a-1)]:t}function G1(n,a){return Eu(ar(n),Xn(a,0,n.length))}function Y1(n){return Eu(ar(n))}function sh(n,a,l){(l!==t&&!ti(n[a],l)||l===t&&!(a in n))&&Ui(n,a,l)}function $a(n,a,l){var f=n[a];(!(qt.call(n,a)&&ti(f,l))||l===t&&!(a in n))&&Ui(n,a,l)}function ou(n,a){for(var l=n.length;l--;)if(ti(n[l][0],a))return l;return-1}function Z1(n,a,l,f){return xn(n,function(g,x,w){a(f,g,l(g),w)}),f}function nd(n,a){return n&&vi(a,Ce(a),n)}function X1(n,a){return n&&vi(a,ur(a),n)}function Ui(n,a,l){a=="__proto__"&&eu?eu(n,a,{configurable:!0,enumerable:!0,value:l,writable:!0}):n[a]=l}function ah(n,a){for(var l=-1,f=a.length,g=F(f),x=n==null;++l<f;)g[l]=x?t:Uh(n,a[l]);return g}function Xn(n,a,l){return n===n&&(l!==t&&(n=n<=l?n:l),a!==t&&(n=n>=a?n:a)),n}function Rr(n,a,l,f,g,x){var w,D=a&A,M=a&T,$=a&C;if(l&&(w=g?l(n,f,g,x):l(n)),w!==t)return w;if(!re(n))return n;var G=mt(n);if(G){if(w=Fx(n),!D)return ar(n,w)}else{var Z=He(n),J=Z==Ve||Z==er;if(wn(n))return Sd(n,D);if(Z==ee||Z==ye||J&&!g){if(w=M||J?{}:Yd(n),!D)return M?Cx(n,X1(w,n)):_x(n,nd(w,n))}else{if(!$t[Z])return g?n:{};w=kx(n,Z,D)}}x||(x=new Jr);var st=x.get(n);if(st)return st;x.set(n,w),bg(n)?n.forEach(function(ht){w.add(Rr(ht,a,l,ht,n,x))}):Eg(n)&&n.forEach(function(ht,Ct){w.set(Ct,Rr(ht,a,l,Ct,n,x))});var lt=$?M?Ch:_h:M?ur:Ce,bt=G?t:lt(n);return Nr(bt||n,function(ht,Ct){bt&&(Ct=ht,ht=n[Ct]),$a(w,Ct,Rr(ht,a,l,Ct,n,x))}),w}function Q1(n){var a=Ce(n);return function(l){return sd(l,n,a)}}function sd(n,a,l){var f=l.length;if(n==null)return!f;for(n=zt(n);f--;){var g=l[f],x=a[g],w=n[g];if(w===t&&!(g in n)||!x(w))return!1}return!0}function ad(n,a,l){if(typeof n!="function")throw new Br(u);return ja(function(){n.apply(t,l)},a)}function Ga(n,a,l,f){var g=-1,x=zo,w=!0,D=n.length,M=[],$=a.length;if(!D)return M;l&&(a=jt(a,vr(l))),f?(x=Gl,w=!1):a.length>=s&&(x=Ha,w=!1,a=new Zn(a));t:for(;++g<D;){var G=n[g],Z=l==null?G:l(G);if(G=f||G!==0?G:0,w&&Z===Z){for(var J=$;J--;)if(a[J]===Z)continue t;M.push(G)}else x(a,Z,f)||M.push(G)}return M}var xn=Bd(mi),od=Bd(uh,!0);function K1(n,a){var l=!0;return xn(n,function(f,g,x){return l=!!a(f,g,x),l}),l}function uu(n,a,l){for(var f=-1,g=n.length;++f<g;){var x=n[f],w=a(x);if(w!=null&&(D===t?w===w&&!Er(w):l(w,D)))var D=w,M=x}return M}function j1(n,a,l,f){var g=n.length;for(l=vt(l),l<0&&(l=-l>g?0:g+l),f=f===t||f>g?g:vt(f),f<0&&(f+=g),f=l>f?0:Tg(f);l<f;)n[l++]=a;return n}function ud(n,a){var l=[];return xn(n,function(f,g,x){a(f,g,x)&&l.push(f)}),l}function Me(n,a,l,f,g){var x=-1,w=n.length;for(l||(l=Ux),g||(g=[]);++x<w;){var D=n[x];a>0&&l(D)?a>1?Me(D,a-1,l,f,g):yn(g,D):f||(g[g.length]=D)}return g}var oh=Id(),ld=Id(!0);function mi(n,a){return n&&oh(n,a,Ce)}function uh(n,a){return n&&ld(n,a,Ce)}function lu(n,a){return gn(a,function(l){return zi(n[l])})}function Qn(n,a){a=An(a,n);for(var l=0,f=a.length;n!=null&&l<f;)n=n[xi(a[l++])];return l&&l==f?n:t}function hd(n,a,l){var f=a(n);return mt(n)?f:yn(f,l(n))}function We(n){return n==null?n===t?Bi:Te:Gn&&Gn in zt(n)?Ix(n):Yx(n)}function lh(n,a){return n>a}function J1(n,a){return n!=null&&qt.call(n,a)}function tx(n,a){return n!=null&&a in zt(n)}function ex(n,a,l){return n>=ke(a,l)&&n<Ae(a,l)}function hh(n,a,l){for(var f=l?Gl:zo,g=n[0].length,x=n.length,w=x,D=F(x),M=1/0,$=[];w--;){var G=n[w];w&&a&&(G=jt(G,vr(a))),M=ke(G.length,M),D[w]=!l&&(a||g>=120&&G.length>=120)?new Zn(w&&G):t}G=n[0];var Z=-1,J=D[0];t:for(;++Z<g&&$.length<M;){var st=G[Z],lt=a?a(st):st;if(st=l||st!==0?st:0,!(J?Ha(J,lt):f($,lt,l))){for(w=x;--w;){var bt=D[w];if(!(bt?Ha(bt,lt):f(n[w],lt,l)))continue t}J&&J.push(lt),$.push(st)}}return $}function rx(n,a,l,f){return mi(n,function(g,x,w){a(f,l(g),x,w)}),f}function Ya(n,a,l){a=An(a,n),n=Kd(n,a);var f=n==null?n:n[xi(Fr(a))];return f==null?t:mr(f,n,l)}function cd(n){return ne(n)&&We(n)==ye}function ix(n){return ne(n)&&We(n)==dr}function nx(n){return ne(n)&&We(n)==Bt}function Za(n,a,l,f,g){return n===a?!0:n==null||a==null||!ne(n)&&!ne(a)?n!==n&&a!==a:sx(n,a,l,f,Za,g)}function sx(n,a,l,f,g,x){var w=mt(n),D=mt(a),M=w?Ie:He(n),$=D?Ie:He(a);M=M==ye?ee:M,$=$==ye?ee:$;var G=M==ee,Z=$==ee,J=M==$;if(J&&wn(n)){if(!wn(a))return!1;w=!0,G=!1}if(J&&!G)return x||(x=new Jr),w||Us(n)?zd(n,a,l,f,g,x):Nx(n,a,M,l,f,g,x);if(!(l&N)){var st=G&&qt.call(n,"__wrapped__"),lt=Z&&qt.call(a,"__wrapped__");if(st||lt){var bt=st?n.value():n,ht=lt?a.value():a;return x||(x=new Jr),g(bt,ht,l,f,x)}}return J?(x||(x=new Jr),Bx(n,a,l,f,g,x)):!1}function ax(n){return ne(n)&&He(n)==ie}function ch(n,a,l,f){var g=l.length,x=g,w=!f;if(n==null)return!x;for(n=zt(n);g--;){var D=l[g];if(w&&D[2]?D[1]!==n[D[0]]:!(D[0]in n))return!1}for(;++g<x;){D=l[g];var M=D[0],$=n[M],G=D[1];if(w&&D[2]){if($===t&&!(M in n))return!1}else{var Z=new Jr;if(f)var J=f($,G,M,n,a,Z);if(!(J===t?Za(G,$,N|O,f,Z):J))return!1}}return!0}function fd(n){if(!re(n)||Vx(n))return!1;var a=zi(n)?a1:qn;return a.test(jn(n))}function ox(n){return ne(n)&&We(n)==me}function ux(n){return ne(n)&&He(n)==It}function lx(n){return ne(n)&&Cu(n.length)&&!!Xt[We(n)]}function pd(n){return typeof n=="function"?n:n==null?lr:typeof n=="object"?mt(n)?yd(n[0],n[1]):gd(n):Rg(n)}function fh(n){if(!Ka(n))return f1(n);var a=[];for(var l in zt(n))qt.call(n,l)&&l!="constructor"&&a.push(l);return a}function hx(n){if(!re(n))return Gx(n);var a=Ka(n),l=[];for(var f in n)f=="constructor"&&(a||!qt.call(n,f))||l.push(f);return l}function ph(n,a){return n<a}function dd(n,a){var l=-1,f=or(n)?F(n.length):[];return xn(n,function(g,x,w){f[++l]=a(g,x,w)}),f}function gd(n){var a=Sh(n);return a.length==1&&a[0][2]?Xd(a[0][0],a[0][1]):function(l){return l===n||ch(l,n,a)}}function yd(n,a){return Mh(n)&&Zd(a)?Xd(xi(n),a):function(l){var f=Uh(l,n);return f===t&&f===a?qh(l,n):Za(a,f,N|O)}}function hu(n,a,l,f,g){n!==a&&oh(a,function(x,w){if(g||(g=new Jr),re(x))cx(n,a,w,l,hu,f,g);else{var D=f?f(Nh(n,w),x,w+"",n,a,g):t;D===t&&(D=x),sh(n,w,D)}},ur)}function cx(n,a,l,f,g,x,w){var D=Nh(n,l),M=Nh(a,l),$=w.get(M);if($){sh(n,l,$);return}var G=x?x(D,M,l+"",n,a,w):t,Z=G===t;if(Z){var J=mt(M),st=!J&&wn(M),lt=!J&&!st&&Us(M);G=M,J||st||lt?mt(D)?G=D:ue(D)?G=ar(D):st?(Z=!1,G=Sd(M,!0)):lt?(Z=!1,G=Od(M,!0)):G=[]:Ja(M)||Jn(M)?(G=D,Jn(D)?G=_g(D):(!re(D)||zi(D))&&(G=Yd(M))):Z=!1}Z&&(w.set(M,G),g(G,M,f,x,w),w.delete(M)),sh(n,l,G)}function md(n,a){var l=n.length;if(l)return a+=a<0?l:0,Wi(a,l)?n[a]:t}function vd(n,a,l){a.length?a=jt(a,function(x){return mt(x)?function(w){return Qn(w,x.length===1?x[0]:x)}:x}):a=[lr];var f=-1;a=jt(a,vr(ut()));var g=dd(n,function(x,w,D){var M=jt(a,function($){return $(x)});return{criteria:M,index:++f,value:x}});return kv(g,function(x,w){return Tx(x,w,l)})}function fx(n,a){return xd(n,a,function(l,f){return qh(n,f)})}function xd(n,a,l){for(var f=-1,g=a.length,x={};++f<g;){var w=a[f],D=Qn(n,w);l(D,w)&&Xa(x,An(w,n),D)}return x}function px(n){return function(a){return Qn(a,n)}}function dh(n,a,l,f){var g=f?Fv:Os,x=-1,w=a.length,D=n;for(n===a&&(a=ar(a)),l&&(D=jt(n,vr(l)));++x<w;)for(var M=0,$=a[x],G=l?l($):$;(M=g(D,G,M,f))>-1;)D!==n&&tu.call(D,M,1),tu.call(n,M,1);return n}function Ed(n,a){for(var l=n?a.length:0,f=l-1;l--;){var g=a[l];if(l==f||g!==x){var x=g;Wi(g)?tu.call(n,g,1):vh(n,g)}}return n}function gh(n,a){return n+iu(td()*(a-n+1))}function dx(n,a,l,f){for(var g=-1,x=Ae(ru((a-n)/(l||1)),0),w=F(x);x--;)w[f?x:++g]=n,n+=l;return w}function yh(n,a){var l="";if(!n||a<1||a>kt)return l;do a%2&&(l+=n),a=iu(a/2),a&&(n+=n);while(a);return l}function wt(n,a){return Bh(Qd(n,a,lr),n+"")}function gx(n){return id(qs(n))}function yx(n,a){var l=qs(n);return Eu(l,Xn(a,0,l.length))}function Xa(n,a,l,f){if(!re(n))return n;a=An(a,n);for(var g=-1,x=a.length,w=x-1,D=n;D!=null&&++g<x;){var M=xi(a[g]),$=l;if(M==="__proto__"||M==="constructor"||M==="prototype")return n;if(g!=w){var G=D[M];$=f?f(G,M,D):t,$===t&&($=re(G)?G:Wi(a[g+1])?[]:{})}$a(D,M,$),D=D[M]}return n}var Ad=nu?function(n,a){return nu.set(n,a),n}:lr,mx=eu?function(n,a){return eu(n,"toString",{configurable:!0,enumerable:!1,value:Wh(a),writable:!0})}:lr;function vx(n){return Eu(qs(n))}function Pr(n,a,l){var f=-1,g=n.length;a<0&&(a=-a>g?0:g+a),l=l>g?g:l,l<0&&(l+=g),g=a>l?0:l-a>>>0,a>>>=0;for(var x=F(g);++f<g;)x[f]=n[f+a];return x}function xx(n,a){var l;return xn(n,function(f,g,x){return l=a(f,g,x),!l}),!!l}function cu(n,a,l){var f=0,g=n==null?f:n.length;if(typeof a=="number"&&a===a&&g<=Xr){for(;f<g;){var x=f+g>>>1,w=n[x];w!==null&&!Er(w)&&(l?w<=a:w<a)?f=x+1:g=x}return g}return mh(n,a,lr,l)}function mh(n,a,l,f){var g=0,x=n==null?0:n.length;if(x===0)return 0;a=l(a);for(var w=a!==a,D=a===null,M=Er(a),$=a===t;g<x;){var G=iu((g+x)/2),Z=l(n[G]),J=Z!==t,st=Z===null,lt=Z===Z,bt=Er(Z);if(w)var ht=f||lt;else $?ht=lt&&(f||J):D?ht=lt&&J&&(f||!st):M?ht=lt&&J&&!st&&(f||!bt):st||bt?ht=!1:ht=f?Z<=a:Z<a;ht?g=G+1:x=G}return ke(x,we)}function bd(n,a){for(var l=-1,f=n.length,g=0,x=[];++l<f;){var w=n[l],D=a?a(w):w;if(!l||!ti(D,M)){var M=D;x[g++]=w===0?0:w}}return x}function wd(n){return typeof n=="number"?n:Er(n)?Se:+n}function xr(n){if(typeof n=="string")return n;if(mt(n))return jt(n,xr)+"";if(Er(n))return ed?ed.call(n):"";var a=n+"";return a=="0"&&1/n==-xt?"-0":a}function En(n,a,l){var f=-1,g=zo,x=n.length,w=!0,D=[],M=D;if(l)w=!1,g=Gl;else if(x>=s){var $=a?null:Mx(n);if($)return Go($);w=!1,g=Ha,M=new Zn}else M=a?[]:D;t:for(;++f<x;){var G=n[f],Z=a?a(G):G;if(G=l||G!==0?G:0,w&&Z===Z){for(var J=M.length;J--;)if(M[J]===Z)continue t;a&&M.push(Z),D.push(G)}else g(M,Z,l)||(M!==D&&M.push(Z),D.push(G))}return D}function vh(n,a){return a=An(a,n),n=Kd(n,a),n==null||delete n[xi(Fr(a))]}function Td(n,a,l,f){return Xa(n,a,l(Qn(n,a)),f)}function fu(n,a,l,f){for(var g=n.length,x=f?g:-1;(f?x--:++x<g)&&a(n[x],x,n););return l?Pr(n,f?0:x,f?x+1:g):Pr(n,f?x+1:0,f?g:x)}function _d(n,a){var l=n;return l instanceof St&&(l=l.value()),Yl(a,function(f,g){return g.func.apply(g.thisArg,yn([f],g.args))},l)}function xh(n,a,l){var f=n.length;if(f<2)return f?En(n[0]):[];for(var g=-1,x=F(f);++g<f;)for(var w=n[g],D=-1;++D<f;)D!=g&&(x[g]=Ga(x[g]||w,n[D],a,l));return En(Me(x,1),a,l)}function Cd(n,a,l){for(var f=-1,g=n.length,x=a.length,w={};++f<g;){var D=f<x?a[f]:t;l(w,n[f],D)}return w}function Eh(n){return ue(n)?n:[]}function Ah(n){return typeof n=="function"?n:lr}function An(n,a){return mt(n)?n:Mh(n,a)?[n]:eg(Ht(n))}var Ex=wt;function bn(n,a,l){var f=n.length;return l=l===t?f:l,!a&&l>=f?n:Pr(n,a,l)}var Dd=o1||function(n){return Oe.clearTimeout(n)};function Sd(n,a){if(a)return n.slice();var l=n.length,f=Xp?Xp(l):new n.constructor(l);return n.copy(f),f}function bh(n){var a=new n.constructor(n.byteLength);return new jo(a).set(new jo(n)),a}function Ax(n,a){var l=a?bh(n.buffer):n.buffer;return new n.constructor(l,n.byteOffset,n.byteLength)}function bx(n){var a=new n.constructor(n.source,Ia.exec(n));return a.lastIndex=n.lastIndex,a}function wx(n){return za?zt(za.call(n)):{}}function Od(n,a){var l=a?bh(n.buffer):n.buffer;return new n.constructor(l,n.byteOffset,n.length)}function Md(n,a){if(n!==a){var l=n!==t,f=n===null,g=n===n,x=Er(n),w=a!==t,D=a===null,M=a===a,$=Er(a);if(!D&&!$&&!x&&n>a||x&&w&&M&&!D&&!$||f&&w&&M||!l&&M||!g)return 1;if(!f&&!x&&!$&&n<a||$&&l&&g&&!f&&!x||D&&l&&g||!w&&g||!M)return-1}return 0}function Tx(n,a,l){for(var f=-1,g=n.criteria,x=a.criteria,w=g.length,D=l.length;++f<w;){var M=Md(g[f],x[f]);if(M){if(f>=D)return M;var $=l[f];return M*($=="desc"?-1:1)}}return n.index-a.index}function Ld(n,a,l,f){for(var g=-1,x=n.length,w=l.length,D=-1,M=a.length,$=Ae(x-w,0),G=F(M+$),Z=!f;++D<M;)G[D]=a[D];for(;++g<w;)(Z||g<x)&&(G[l[g]]=n[g]);for(;$--;)G[D++]=n[g++];return G}function Nd(n,a,l,f){for(var g=-1,x=n.length,w=-1,D=l.length,M=-1,$=a.length,G=Ae(x-D,0),Z=F(G+$),J=!f;++g<G;)Z[g]=n[g];for(var st=g;++M<$;)Z[st+M]=a[M];for(;++w<D;)(J||g<x)&&(Z[st+l[w]]=n[g++]);return Z}function ar(n,a){var l=-1,f=n.length;for(a||(a=F(f));++l<f;)a[l]=n[l];return a}function vi(n,a,l,f){var g=!l;l||(l={});for(var x=-1,w=a.length;++x<w;){var D=a[x],M=f?f(l[D],n[D],D,l,n):t;M===t&&(M=n[D]),g?Ui(l,D,M):$a(l,D,M)}return l}function _x(n,a){return vi(n,Oh(n),a)}function Cx(n,a){return vi(n,$d(n),a)}function pu(n,a){return function(l,f){var g=mt(l)?Lv:Z1,x=a?a():{};return g(l,n,ut(f,2),x)}}function Fs(n){return wt(function(a,l){var f=-1,g=l.length,x=g>1?l[g-1]:t,w=g>2?l[2]:t;for(x=n.length>3&&typeof x=="function"?(g--,x):t,w&&ze(l[0],l[1],w)&&(x=g<3?t:x,g=1),a=zt(a);++f<g;){var D=l[f];D&&n(a,D,f,x)}return a})}function Bd(n,a){return function(l,f){if(l==null)return l;if(!or(l))return n(l,f);for(var g=l.length,x=a?g:-1,w=zt(l);(a?x--:++x<g)&&f(w[x],x,w)!==!1;);return l}}function Id(n){return function(a,l,f){for(var g=-1,x=zt(a),w=f(a),D=w.length;D--;){var M=w[n?D:++g];if(l(x[M],M,x)===!1)break}return a}}function Dx(n,a,l){var f=a&L,g=Qa(n);function x(){var w=this&&this!==Oe&&this instanceof x?g:n;return w.apply(f?l:this,arguments)}return x}function Rd(n){return function(a){a=Ht(a);var l=Ms(a)?jr(a):t,f=l?l[0]:a.charAt(0),g=l?bn(l,1).join(""):a.slice(1);return f[n]()+g}}function ks(n){return function(a){return Yl(Bg(Ng(a).replace(mv,"")),n,"")}}function Qa(n){return function(){var a=arguments;switch(a.length){case 0:return new n;case 1:return new n(a[0]);case 2:return new n(a[0],a[1]);case 3:return new n(a[0],a[1],a[2]);case 4:return new n(a[0],a[1],a[2],a[3]);case 5:return new n(a[0],a[1],a[2],a[3],a[4]);case 6:return new n(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new n(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var l=Ps(n.prototype),f=n.apply(l,a);return re(f)?f:l}}function Sx(n,a,l){var f=Qa(n);function g(){for(var x=arguments.length,w=F(x),D=x,M=Hs(g);D--;)w[D]=arguments[D];var $=x<3&&w[0]!==M&&w[x-1]!==M?[]:mn(w,M);if(x-=$.length,x<l)return Ud(n,a,du,g.placeholder,t,w,$,t,t,l-x);var G=this&&this!==Oe&&this instanceof g?f:n;return mr(G,this,w)}return g}function Pd(n){return function(a,l,f){var g=zt(a);if(!or(a)){var x=ut(l,3);a=Ce(a),l=function(D){return x(g[D],D,g)}}var w=n(a,l,f);return w>-1?g[x?a[w]:w]:t}}function Fd(n){return Vi(function(a){var l=a.length,f=l,g=Ir.prototype.thru;for(n&&a.reverse();f--;){var x=a[f];if(typeof x!="function")throw new Br(u);if(g&&!w&&vu(x)=="wrapper")var w=new Ir([],!0)}for(f=w?f:l;++f<l;){x=a[f];var D=vu(x),M=D=="wrapper"?Dh(x):t;M&&Lh(M[0])&&M[1]==(j|V|Y|tt)&&!M[4].length&&M[9]==1?w=w[vu(M[0])].apply(w,M[3]):w=x.length==1&&Lh(x)?w[D]():w.thru(x)}return function(){var $=arguments,G=$[0];if(w&&$.length==1&&mt(G))return w.plant(G).value();for(var Z=0,J=l?a[Z].apply(this,$):G;++Z<l;)J=a[Z].call(this,J);return J}})}function du(n,a,l,f,g,x,w,D,M,$){var G=a&j,Z=a&L,J=a&P,st=a&(V|b),lt=a&Q,bt=J?t:Qa(n);function ht(){for(var Ct=arguments.length,Lt=F(Ct),Ar=Ct;Ar--;)Lt[Ar]=arguments[Ar];if(st)var $e=Hs(ht),br=Uv(Lt,$e);if(f&&(Lt=Ld(Lt,f,g,st)),x&&(Lt=Nd(Lt,x,w,st)),Ct-=br,st&&Ct<$){var le=mn(Lt,$e);return Ud(n,a,du,ht.placeholder,l,Lt,le,D,M,$-Ct)}var ei=Z?l:this,Gi=J?ei[n]:n;return Ct=Lt.length,D?Lt=Zx(Lt,D):lt&&Ct>1&&Lt.reverse(),G&&M<Ct&&(Lt.length=M),this&&this!==Oe&&this instanceof ht&&(Gi=bt||Qa(Gi)),Gi.apply(ei,Lt)}return ht}function kd(n,a){return function(l,f){return rx(l,n,a(f),{})}}function gu(n,a){return function(l,f){var g;if(l===t&&f===t)return a;if(l!==t&&(g=l),f!==t){if(g===t)return f;typeof l=="string"||typeof f=="string"?(l=xr(l),f=xr(f)):(l=wd(l),f=wd(f)),g=n(l,f)}return g}}function wh(n){return Vi(function(a){return a=jt(a,vr(ut())),wt(function(l){var f=this;return n(a,function(g){return mr(g,f,l)})})})}function yu(n,a){a=a===t?" ":xr(a);var l=a.length;if(l<2)return l?yh(a,n):a;var f=yh(a,ru(n/Ls(a)));return Ms(a)?bn(jr(f),0,n).join(""):f.slice(0,n)}function Ox(n,a,l,f){var g=a&L,x=Qa(n);function w(){for(var D=-1,M=arguments.length,$=-1,G=f.length,Z=F(G+M),J=this&&this!==Oe&&this instanceof w?x:n;++$<G;)Z[$]=f[$];for(;M--;)Z[$++]=arguments[++D];return mr(J,g?l:this,Z)}return w}function Hd(n){return function(a,l,f){return f&&typeof f!="number"&&ze(a,l,f)&&(l=f=t),a=$i(a),l===t?(l=a,a=0):l=$i(l),f=f===t?a<l?1:-1:$i(f),dx(a,l,f,n)}}function mu(n){return function(a,l){return typeof a=="string"&&typeof l=="string"||(a=kr(a),l=kr(l)),n(a,l)}}function Ud(n,a,l,f,g,x,w,D,M,$){var G=a&V,Z=G?w:t,J=G?t:w,st=G?x:t,lt=G?t:x;a|=G?Y:z,a&=~(G?z:Y),a&W||(a&=~(L|P));var bt=[n,a,g,st,Z,lt,J,D,M,$],ht=l.apply(t,bt);return Lh(n)&&jd(ht,bt),ht.placeholder=f,Jd(ht,n,a)}function Th(n){var a=Ee[n];return function(l,f){if(l=kr(l),f=f==null?0:ke(vt(f),292),f&&Jp(l)){var g=(Ht(l)+"e").split("e"),x=a(g[0]+"e"+(+g[1]+f));return g=(Ht(x)+"e").split("e"),+(g[0]+"e"+(+g[1]-f))}return a(l)}}var Mx=Is&&1/Go(new Is([,-0]))[1]==xt?function(n){return new Is(n)}:Gh;function qd(n){return function(a){var l=He(a);return l==ie?th(a):l==It?Yv(a):Hv(a,n(a))}}function qi(n,a,l,f,g,x,w,D){var M=a&P;if(!M&&typeof n!="function")throw new Br(u);var $=f?f.length:0;if($||(a&=~(Y|z),f=g=t),w=w===t?w:Ae(vt(w),0),D=D===t?D:vt(D),$-=g?g.length:0,a&z){var G=f,Z=g;f=g=t}var J=M?t:Dh(n),st=[n,a,l,f,g,G,Z,x,w,D];if(J&&$x(st,J),n=st[0],a=st[1],l=st[2],f=st[3],g=st[4],D=st[9]=st[9]===t?M?0:n.length:Ae(st[9]-$,0),!D&&a&(V|b)&&(a&=~(V|b)),!a||a==L)var lt=Dx(n,a,l);else a==V||a==b?lt=Sx(n,a,D):(a==Y||a==(L|Y))&&!g.length?lt=Ox(n,a,l,f):lt=du.apply(t,st);var bt=J?Ad:jd;return Jd(bt(lt,st),n,a)}function Vd(n,a,l,f){return n===t||ti(n,Bs[l])&&!qt.call(f,l)?a:n}function Wd(n,a,l,f,g,x){return re(n)&&re(a)&&(x.set(a,n),hu(n,a,t,Wd,x),x.delete(a)),n}function Lx(n){return Ja(n)?t:n}function zd(n,a,l,f,g,x){var w=l&N,D=n.length,M=a.length;if(D!=M&&!(w&&M>D))return!1;var $=x.get(n),G=x.get(a);if($&&G)return $==a&&G==n;var Z=-1,J=!0,st=l&O?new Zn:t;for(x.set(n,a),x.set(a,n);++Z<D;){var lt=n[Z],bt=a[Z];if(f)var ht=w?f(bt,lt,Z,a,n,x):f(lt,bt,Z,n,a,x);if(ht!==t){if(ht)continue;J=!1;break}if(st){if(!Zl(a,function(Ct,Lt){if(!Ha(st,Lt)&&(lt===Ct||g(lt,Ct,l,f,x)))return st.push(Lt)})){J=!1;break}}else if(!(lt===bt||g(lt,bt,l,f,x))){J=!1;break}}return x.delete(n),x.delete(a),J}function Nx(n,a,l,f,g,x,w){switch(l){case ir:if(n.byteLength!=a.byteLength||n.byteOffset!=a.byteOffset)return!1;n=n.buffer,a=a.buffer;case dr:return!(n.byteLength!=a.byteLength||!x(new jo(n),new jo(a)));case te:case Bt:case Pe:return ti(+n,+a);case Re:return n.name==a.name&&n.message==a.message;case me:case pr:return n==a+"";case ie:var D=th;case It:var M=f&N;if(D||(D=Go),n.size!=a.size&&!M)return!1;var $=w.get(n);if($)return $==a;f|=O,w.set(n,a);var G=zd(D(n),D(a),f,g,x,w);return w.delete(n),G;case rr:if(za)return za.call(n)==za.call(a)}return!1}function Bx(n,a,l,f,g,x){var w=l&N,D=_h(n),M=D.length,$=_h(a),G=$.length;if(M!=G&&!w)return!1;for(var Z=M;Z--;){var J=D[Z];if(!(w?J in a:qt.call(a,J)))return!1}var st=x.get(n),lt=x.get(a);if(st&&lt)return st==a&&lt==n;var bt=!0;x.set(n,a),x.set(a,n);for(var ht=w;++Z<M;){J=D[Z];var Ct=n[J],Lt=a[J];if(f)var Ar=w?f(Lt,Ct,J,a,n,x):f(Ct,Lt,J,n,a,x);if(!(Ar===t?Ct===Lt||g(Ct,Lt,l,f,x):Ar)){bt=!1;break}ht||(ht=J=="constructor")}if(bt&&!ht){var $e=n.constructor,br=a.constructor;$e!=br&&"constructor"in n&&"constructor"in a&&!(typeof $e=="function"&&$e instanceof $e&&typeof br=="function"&&br instanceof br)&&(bt=!1)}return x.delete(n),x.delete(a),bt}function Vi(n){return Bh(Qd(n,t,sg),n+"")}function _h(n){return hd(n,Ce,Oh)}function Ch(n){return hd(n,ur,$d)}var Dh=nu?function(n){return nu.get(n)}:Gh;function vu(n){for(var a=n.name+"",l=Rs[a],f=qt.call(Rs,a)?l.length:0;f--;){var g=l[f],x=g.func;if(x==null||x==n)return g.name}return a}function Hs(n){var a=qt.call(v,"placeholder")?v:n;return a.placeholder}function ut(){var n=v.iteratee||zh;return n=n===zh?pd:n,arguments.length?n(arguments[0],arguments[1]):n}function xu(n,a){var l=n.__data__;return qx(a)?l[typeof a=="string"?"string":"hash"]:l.map}function Sh(n){for(var a=Ce(n),l=a.length;l--;){var f=a[l],g=n[f];a[l]=[f,g,Zd(g)]}return a}function Kn(n,a){var l=zv(n,a);return fd(l)?l:t}function Ix(n){var a=qt.call(n,Gn),l=n[Gn];try{n[Gn]=t;var f=!0}catch(x){}var g=Qo.call(n);return f&&(a?n[Gn]=l:delete n[Gn]),g}var Oh=rh?function(n){return n==null?[]:(n=zt(n),gn(rh(n),function(a){return Kp.call(n,a)}))}:Yh,$d=rh?function(n){for(var a=[];n;)yn(a,Oh(n)),n=Jo(n);return a}:Yh,He=We;(ih&&He(new ih(new ArrayBuffer(1)))!=ir||qa&&He(new qa)!=ie||nh&&He(nh.resolve())!=pi||Is&&He(new Is)!=It||Va&&He(new Va)!=Dr)&&(He=function(n){var a=We(n),l=a==ee?n.constructor:t,f=l?jn(l):"";if(f)switch(f){case y1:return ir;case m1:return ie;case v1:return pi;case x1:return It;case E1:return Dr}return a});function Rx(n,a,l){for(var f=-1,g=l.length;++f<g;){var x=l[f],w=x.size;switch(x.type){case"drop":n+=w;break;case"dropRight":a-=w;break;case"take":a=ke(a,n+w);break;case"takeRight":n=Ae(n,a-w);break}}return{start:n,end:a}}function Px(n){var a=n.match(kl);return a?a[1].split(Fo):[]}function Gd(n,a,l){a=An(a,n);for(var f=-1,g=a.length,x=!1;++f<g;){var w=xi(a[f]);if(!(x=n!=null&&l(n,w)))break;n=n[w]}return x||++f!=g?x:(g=n==null?0:n.length,!!g&&Cu(g)&&Wi(w,g)&&(mt(n)||Jn(n)))}function Fx(n){var a=n.length,l=new n.constructor(a);return a&&typeof n[0]=="string"&&qt.call(n,"index")&&(l.index=n.index,l.input=n.input),l}function Yd(n){return typeof n.constructor=="function"&&!Ka(n)?Ps(Jo(n)):{}}function kx(n,a,l){var f=n.constructor;switch(a){case dr:return bh(n);case te:case Bt:return new f(+n);case ir:return Ax(n,l);case on:case un:case di:case Ii:case Fn:case H:case nt:case ot:case Mt:return Od(n,l);case ie:return new f;case Pe:case pr:return new f(n);case me:return bx(n);case It:return new f;case rr:return wx(n)}}function Hx(n,a){var l=a.length;if(!l)return n;var f=l-1;return a[f]=(l>1?"& ":"")+a[f],a=a.join(l>2?", ":" "),n.replace(Ba,`{
13
- /* [wrapped with `+a+`] */
14
- `)}function Ux(n){return mt(n)||Jn(n)||!!(jp&&n&&n[jp])}function Wi(n,a){var l=typeof n;return a=a==null?kt:a,!!a&&(l=="number"||l!="symbol"&&bs.test(n))&&n>-1&&n%1==0&&n<a}function ze(n,a,l){if(!re(l))return!1;var f=typeof a;return(f=="number"?or(l)&&Wi(a,l.length):f=="string"&&a in l)?ti(l[a],n):!1}function Mh(n,a){if(mt(n))return!1;var l=typeof n;return l=="number"||l=="symbol"||l=="boolean"||n==null||Er(n)?!0:cn.test(n)||!Un.test(n)||a!=null&&n in zt(a)}function qx(n){var a=typeof n;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?n!=="__proto__":n===null}function Lh(n){var a=vu(n),l=v[a];if(typeof l!="function"||!(a in St.prototype))return!1;if(n===l)return!0;var f=Dh(l);return!!f&&n===f[0]}function Vx(n){return!!Zp&&Zp in n}var Wx=Zo?zi:Zh;function Ka(n){var a=n&&n.constructor,l=typeof a=="function"&&a.prototype||Bs;return n===l}function Zd(n){return n===n&&!re(n)}function Xd(n,a){return function(l){return l==null?!1:l[n]===a&&(a!==t||n in zt(l))}}function zx(n){var a=Tu(n,function(f){return l.size===y&&l.clear(),f}),l=a.cache;return a}function $x(n,a){var l=n[1],f=a[1],g=l|f,x=g<(L|P|j),w=f==j&&l==V||f==j&&l==tt&&n[7].length<=a[8]||f==(j|tt)&&a[7].length<=a[8]&&l==V;if(!(x||w))return n;f&L&&(n[2]=a[2],g|=l&L?0:W);var D=a[3];if(D){var M=n[3];n[3]=M?Ld(M,D,a[4]):D,n[4]=M?mn(n[3],p):a[4]}return D=a[5],D&&(M=n[5],n[5]=M?Nd(M,D,a[6]):D,n[6]=M?mn(n[5],p):a[6]),D=a[7],D&&(n[7]=D),f&j&&(n[8]=n[8]==null?a[8]:ke(n[8],a[8])),n[9]==null&&(n[9]=a[9]),n[0]=a[0],n[1]=g,n}function Gx(n){var a=[];if(n!=null)for(var l in zt(n))a.push(l);return a}function Yx(n){return Qo.call(n)}function Qd(n,a,l){return a=Ae(a===t?n.length-1:a,0),function(){for(var f=arguments,g=-1,x=Ae(f.length-a,0),w=F(x);++g<x;)w[g]=f[a+g];g=-1;for(var D=F(a+1);++g<a;)D[g]=f[g];return D[a]=l(w),mr(n,this,D)}}function Kd(n,a){return a.length<2?n:Qn(n,Pr(a,0,-1))}function Zx(n,a){for(var l=n.length,f=ke(a.length,l),g=ar(n);f--;){var x=a[f];n[f]=Wi(x,l)?g[x]:t}return n}function Nh(n,a){if(!(a==="constructor"&&typeof n[a]=="function")&&a!="__proto__")return n[a]}var jd=tg(Ad),ja=l1||function(n,a){return Oe.setTimeout(n,a)},Bh=tg(mx);function Jd(n,a,l){var f=a+"";return Bh(n,Hx(f,Xx(Px(f),l)))}function tg(n){var a=0,l=0;return function(){var f=p1(),g=ct-(f-l);if(l=f,g>0){if(++a>=at)return arguments[0]}else a=0;return n.apply(t,arguments)}}function Eu(n,a){var l=-1,f=n.length,g=f-1;for(a=a===t?f:a;++l<a;){var x=gh(l,g),w=n[x];n[x]=n[l],n[l]=w}return n.length=a,n}var eg=zx(function(n){var a=[];return n.charCodeAt(0)===46&&a.push(""),n.replace(Pl,function(l,f,g,x){a.push(g?x.replace(Ho,"$1"):f||l)}),a});function xi(n){if(typeof n=="string"||Er(n))return n;var a=n+"";return a=="0"&&1/n==-xt?"-0":a}function jn(n){if(n!=null){try{return Xo.call(n)}catch(a){}try{return n+""}catch(a){}}return""}function Xx(n,a){return Nr(qe,function(l){var f="_."+l[0];a&l[1]&&!zo(n,f)&&n.push(f)}),n.sort()}function rg(n){if(n instanceof St)return n.clone();var a=new Ir(n.__wrapped__,n.__chain__);return a.__actions__=ar(n.__actions__),a.__index__=n.__index__,a.__values__=n.__values__,a}function Qx(n,a,l){(l?ze(n,a,l):a===t)?a=1:a=Ae(vt(a),0);var f=n==null?0:n.length;if(!f||a<1)return[];for(var g=0,x=0,w=F(ru(f/a));g<f;)w[x++]=Pr(n,g,g+=a);return w}function Kx(n){for(var a=-1,l=n==null?0:n.length,f=0,g=[];++a<l;){var x=n[a];x&&(g[f++]=x)}return g}function jx(){var n=arguments.length;if(!n)return[];for(var a=F(n-1),l=arguments[0],f=n;f--;)a[f-1]=arguments[f];return yn(mt(l)?ar(l):[l],Me(a,1))}var Jx=wt(function(n,a){return ue(n)?Ga(n,Me(a,1,ue,!0)):[]}),tE=wt(function(n,a){var l=Fr(a);return ue(l)&&(l=t),ue(n)?Ga(n,Me(a,1,ue,!0),ut(l,2)):[]}),eE=wt(function(n,a){var l=Fr(a);return ue(l)&&(l=t),ue(n)?Ga(n,Me(a,1,ue,!0),t,l):[]});function rE(n,a,l){var f=n==null?0:n.length;return f?(a=l||a===t?1:vt(a),Pr(n,a<0?0:a,f)):[]}function iE(n,a,l){var f=n==null?0:n.length;return f?(a=l||a===t?1:vt(a),a=f-a,Pr(n,0,a<0?0:a)):[]}function nE(n,a){return n&&n.length?fu(n,ut(a,3),!0,!0):[]}function sE(n,a){return n&&n.length?fu(n,ut(a,3),!0):[]}function aE(n,a,l,f){var g=n==null?0:n.length;return g?(l&&typeof l!="number"&&ze(n,a,l)&&(l=0,f=g),j1(n,a,l,f)):[]}function ig(n,a,l){var f=n==null?0:n.length;if(!f)return-1;var g=l==null?0:vt(l);return g<0&&(g=Ae(f+g,0)),$o(n,ut(a,3),g)}function ng(n,a,l){var f=n==null?0:n.length;if(!f)return-1;var g=f-1;return l!==t&&(g=vt(l),g=l<0?Ae(f+g,0):ke(g,f-1)),$o(n,ut(a,3),g,!0)}function sg(n){var a=n==null?0:n.length;return a?Me(n,1):[]}function oE(n){var a=n==null?0:n.length;return a?Me(n,xt):[]}function uE(n,a){var l=n==null?0:n.length;return l?(a=a===t?1:vt(a),Me(n,a)):[]}function lE(n){for(var a=-1,l=n==null?0:n.length,f={};++a<l;){var g=n[a];f[g[0]]=g[1]}return f}function ag(n){return n&&n.length?n[0]:t}function hE(n,a,l){var f=n==null?0:n.length;if(!f)return-1;var g=l==null?0:vt(l);return g<0&&(g=Ae(f+g,0)),Os(n,a,g)}function cE(n){var a=n==null?0:n.length;return a?Pr(n,0,-1):[]}var fE=wt(function(n){var a=jt(n,Eh);return a.length&&a[0]===n[0]?hh(a):[]}),pE=wt(function(n){var a=Fr(n),l=jt(n,Eh);return a===Fr(l)?a=t:l.pop(),l.length&&l[0]===n[0]?hh(l,ut(a,2)):[]}),dE=wt(function(n){var a=Fr(n),l=jt(n,Eh);return a=typeof a=="function"?a:t,a&&l.pop(),l.length&&l[0]===n[0]?hh(l,t,a):[]});function gE(n,a){return n==null?"":c1.call(n,a)}function Fr(n){var a=n==null?0:n.length;return a?n[a-1]:t}function yE(n,a,l){var f=n==null?0:n.length;if(!f)return-1;var g=f;return l!==t&&(g=vt(l),g=g<0?Ae(f+g,0):ke(g,f-1)),a===a?Xv(n,a,g):$o(n,Up,g,!0)}function mE(n,a){return n&&n.length?md(n,vt(a)):t}var vE=wt(og);function og(n,a){return n&&n.length&&a&&a.length?dh(n,a):n}function xE(n,a,l){return n&&n.length&&a&&a.length?dh(n,a,ut(l,2)):n}function EE(n,a,l){return n&&n.length&&a&&a.length?dh(n,a,t,l):n}var AE=Vi(function(n,a){var l=n==null?0:n.length,f=ah(n,a);return Ed(n,jt(a,function(g){return Wi(g,l)?+g:g}).sort(Md)),f});function bE(n,a){var l=[];if(!(n&&n.length))return l;var f=-1,g=[],x=n.length;for(a=ut(a,3);++f<x;){var w=n[f];a(w,f,n)&&(l.push(w),g.push(f))}return Ed(n,g),l}function Ih(n){return n==null?n:g1.call(n)}function wE(n,a,l){var f=n==null?0:n.length;return f?(l&&typeof l!="number"&&ze(n,a,l)?(a=0,l=f):(a=a==null?0:vt(a),l=l===t?f:vt(l)),Pr(n,a,l)):[]}function TE(n,a){return cu(n,a)}function _E(n,a,l){return mh(n,a,ut(l,2))}function CE(n,a){var l=n==null?0:n.length;if(l){var f=cu(n,a);if(f<l&&ti(n[f],a))return f}return-1}function DE(n,a){return cu(n,a,!0)}function SE(n,a,l){return mh(n,a,ut(l,2),!0)}function OE(n,a){var l=n==null?0:n.length;if(l){var f=cu(n,a,!0)-1;if(ti(n[f],a))return f}return-1}function ME(n){return n&&n.length?bd(n):[]}function LE(n,a){return n&&n.length?bd(n,ut(a,2)):[]}function NE(n){var a=n==null?0:n.length;return a?Pr(n,1,a):[]}function BE(n,a,l){return n&&n.length?(a=l||a===t?1:vt(a),Pr(n,0,a<0?0:a)):[]}function IE(n,a,l){var f=n==null?0:n.length;return f?(a=l||a===t?1:vt(a),a=f-a,Pr(n,a<0?0:a,f)):[]}function RE(n,a){return n&&n.length?fu(n,ut(a,3),!1,!0):[]}function PE(n,a){return n&&n.length?fu(n,ut(a,3)):[]}var FE=wt(function(n){return En(Me(n,1,ue,!0))}),kE=wt(function(n){var a=Fr(n);return ue(a)&&(a=t),En(Me(n,1,ue,!0),ut(a,2))}),HE=wt(function(n){var a=Fr(n);return a=typeof a=="function"?a:t,En(Me(n,1,ue,!0),t,a)});function UE(n){return n&&n.length?En(n):[]}function qE(n,a){return n&&n.length?En(n,ut(a,2)):[]}function VE(n,a){return a=typeof a=="function"?a:t,n&&n.length?En(n,t,a):[]}function Rh(n){if(!(n&&n.length))return[];var a=0;return n=gn(n,function(l){if(ue(l))return a=Ae(l.length,a),!0}),jl(a,function(l){return jt(n,Xl(l))})}function ug(n,a){if(!(n&&n.length))return[];var l=Rh(n);return a==null?l:jt(l,function(f){return mr(a,t,f)})}var WE=wt(function(n,a){return ue(n)?Ga(n,a):[]}),zE=wt(function(n){return xh(gn(n,ue))}),$E=wt(function(n){var a=Fr(n);return ue(a)&&(a=t),xh(gn(n,ue),ut(a,2))}),GE=wt(function(n){var a=Fr(n);return a=typeof a=="function"?a:t,xh(gn(n,ue),t,a)}),YE=wt(Rh);function ZE(n,a){return Cd(n||[],a||[],$a)}function XE(n,a){return Cd(n||[],a||[],Xa)}var QE=wt(function(n){var a=n.length,l=a>1?n[a-1]:t;return l=typeof l=="function"?(n.pop(),l):t,ug(n,l)});function lg(n){var a=v(n);return a.__chain__=!0,a}function KE(n,a){return a(n),n}function Au(n,a){return a(n)}var jE=Vi(function(n){var a=n.length,l=a?n[0]:0,f=this.__wrapped__,g=function(x){return ah(x,n)};return a>1||this.__actions__.length||!(f instanceof St)||!Wi(l)?this.thru(g):(f=f.slice(l,+l+(a?1:0)),f.__actions__.push({func:Au,args:[g],thisArg:t}),new Ir(f,this.__chain__).thru(function(x){return a&&!x.length&&x.push(t),x}))});function JE(){return lg(this)}function tA(){return new Ir(this.value(),this.__chain__)}function eA(){this.__values__===t&&(this.__values__=wg(this.value()));var n=this.__index__>=this.__values__.length,a=n?t:this.__values__[this.__index__++];return{done:n,value:a}}function rA(){return this}function iA(n){for(var a,l=this;l instanceof au;){var f=rg(l);f.__index__=0,f.__values__=t,a?g.__wrapped__=f:a=f;var g=f;l=l.__wrapped__}return g.__wrapped__=n,a}function nA(){var n=this.__wrapped__;if(n instanceof St){var a=n;return this.__actions__.length&&(a=new St(this)),a=a.reverse(),a.__actions__.push({func:Au,args:[Ih],thisArg:t}),new Ir(a,this.__chain__)}return this.thru(Ih)}function sA(){return _d(this.__wrapped__,this.__actions__)}var aA=pu(function(n,a,l){qt.call(n,l)?++n[l]:Ui(n,l,1)});function oA(n,a,l){var f=mt(n)?kp:K1;return l&&ze(n,a,l)&&(a=t),f(n,ut(a,3))}function uA(n,a){var l=mt(n)?gn:ud;return l(n,ut(a,3))}var lA=Pd(ig),hA=Pd(ng);function cA(n,a){return Me(bu(n,a),1)}function fA(n,a){return Me(bu(n,a),xt)}function pA(n,a,l){return l=l===t?1:vt(l),Me(bu(n,a),l)}function hg(n,a){var l=mt(n)?Nr:xn;return l(n,ut(a,3))}function cg(n,a){var l=mt(n)?Nv:od;return l(n,ut(a,3))}var dA=pu(function(n,a,l){qt.call(n,l)?n[l].push(a):Ui(n,l,[a])});function gA(n,a,l,f){n=or(n)?n:qs(n),l=l&&!f?vt(l):0;var g=n.length;return l<0&&(l=Ae(g+l,0)),Du(n)?l<=g&&n.indexOf(a,l)>-1:!!g&&Os(n,a,l)>-1}var yA=wt(function(n,a,l){var f=-1,g=typeof a=="function",x=or(n)?F(n.length):[];return xn(n,function(w){x[++f]=g?mr(a,w,l):Ya(w,a,l)}),x}),mA=pu(function(n,a,l){Ui(n,l,a)});function bu(n,a){var l=mt(n)?jt:dd;return l(n,ut(a,3))}function vA(n,a,l,f){return n==null?[]:(mt(a)||(a=a==null?[]:[a]),l=f?t:l,mt(l)||(l=l==null?[]:[l]),vd(n,a,l))}var xA=pu(function(n,a,l){n[l?0:1].push(a)},function(){return[[],[]]});function EA(n,a,l){var f=mt(n)?Yl:Vp,g=arguments.length<3;return f(n,ut(a,4),l,g,xn)}function AA(n,a,l){var f=mt(n)?Bv:Vp,g=arguments.length<3;return f(n,ut(a,4),l,g,od)}function bA(n,a){var l=mt(n)?gn:ud;return l(n,_u(ut(a,3)))}function wA(n){var a=mt(n)?id:gx;return a(n)}function TA(n,a,l){(l?ze(n,a,l):a===t)?a=1:a=vt(a);var f=mt(n)?G1:yx;return f(n,a)}function _A(n){var a=mt(n)?Y1:vx;return a(n)}function CA(n){if(n==null)return 0;if(or(n))return Du(n)?Ls(n):n.length;var a=He(n);return a==ie||a==It?n.size:fh(n).length}function DA(n,a,l){var f=mt(n)?Zl:xx;return l&&ze(n,a,l)&&(a=t),f(n,ut(a,3))}var SA=wt(function(n,a){if(n==null)return[];var l=a.length;return l>1&&ze(n,a[0],a[1])?a=[]:l>2&&ze(a[0],a[1],a[2])&&(a=[a[0]]),vd(n,Me(a,1),[])}),wu=u1||function(){return Oe.Date.now()};function OA(n,a){if(typeof a!="function")throw new Br(u);return n=vt(n),function(){if(--n<1)return a.apply(this,arguments)}}function fg(n,a,l){return a=l?t:a,a=n&&a==null?n.length:a,qi(n,j,t,t,t,t,a)}function pg(n,a){var l;if(typeof a!="function")throw new Br(u);return n=vt(n),function(){return--n>0&&(l=a.apply(this,arguments)),n<=1&&(a=t),l}}var Ph=wt(function(n,a,l){var f=L;if(l.length){var g=mn(l,Hs(Ph));f|=Y}return qi(n,f,a,l,g)}),dg=wt(function(n,a,l){var f=L|P;if(l.length){var g=mn(l,Hs(dg));f|=Y}return qi(a,f,n,l,g)});function gg(n,a,l){a=l?t:a;var f=qi(n,V,t,t,t,t,t,a);return f.placeholder=gg.placeholder,f}function yg(n,a,l){a=l?t:a;var f=qi(n,b,t,t,t,t,t,a);return f.placeholder=yg.placeholder,f}function mg(n,a,l){var f,g,x,w,D,M,$=0,G=!1,Z=!1,J=!0;if(typeof n!="function")throw new Br(u);a=kr(a)||0,re(l)&&(G=!!l.leading,Z="maxWait"in l,x=Z?Ae(kr(l.maxWait)||0,a):x,J="trailing"in l?!!l.trailing:J);function st(le){var ei=f,Gi=g;return f=g=t,$=le,w=n.apply(Gi,ei),w}function lt(le){return $=le,D=ja(Ct,a),G?st(le):w}function bt(le){var ei=le-M,Gi=le-$,Pg=a-ei;return Z?ke(Pg,x-Gi):Pg}function ht(le){var ei=le-M,Gi=le-$;return M===t||ei>=a||ei<0||Z&&Gi>=x}function Ct(){var le=wu();if(ht(le))return Lt(le);D=ja(Ct,bt(le))}function Lt(le){return D=t,J&&f?st(le):(f=g=t,w)}function Ar(){D!==t&&Dd(D),$=0,f=M=g=D=t}function $e(){return D===t?w:Lt(wu())}function br(){var le=wu(),ei=ht(le);if(f=arguments,g=this,M=le,ei){if(D===t)return lt(M);if(Z)return Dd(D),D=ja(Ct,a),st(M)}return D===t&&(D=ja(Ct,a)),w}return br.cancel=Ar,br.flush=$e,br}var MA=wt(function(n,a){return ad(n,1,a)}),LA=wt(function(n,a,l){return ad(n,kr(a)||0,l)});function NA(n){return qi(n,Q)}function Tu(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new Br(u);var l=function(){var f=arguments,g=a?a.apply(this,f):f[0],x=l.cache;if(x.has(g))return x.get(g);var w=n.apply(this,f);return l.cache=x.set(g,w)||x,w};return l.cache=new(Tu.Cache||Hi),l}Tu.Cache=Hi;function _u(n){if(typeof n!="function")throw new Br(u);return function(){var a=arguments;switch(a.length){case 0:return!n.call(this);case 1:return!n.call(this,a[0]);case 2:return!n.call(this,a[0],a[1]);case 3:return!n.call(this,a[0],a[1],a[2])}return!n.apply(this,a)}}function BA(n){return pg(2,n)}var IA=Ex(function(n,a){a=a.length==1&&mt(a[0])?jt(a[0],vr(ut())):jt(Me(a,1),vr(ut()));var l=a.length;return wt(function(f){for(var g=-1,x=ke(f.length,l);++g<x;)f[g]=a[g].call(this,f[g]);return mr(n,this,f)})}),Fh=wt(function(n,a){var l=mn(a,Hs(Fh));return qi(n,Y,t,a,l)}),vg=wt(function(n,a){var l=mn(a,Hs(vg));return qi(n,z,t,a,l)}),RA=Vi(function(n,a){return qi(n,tt,t,t,t,a)});function PA(n,a){if(typeof n!="function")throw new Br(u);return a=a===t?a:vt(a),wt(n,a)}function FA(n,a){if(typeof n!="function")throw new Br(u);return a=a==null?0:Ae(vt(a),0),wt(function(l){var f=l[a],g=bn(l,0,a);return f&&yn(g,f),mr(n,this,g)})}function kA(n,a,l){var f=!0,g=!0;if(typeof n!="function")throw new Br(u);return re(l)&&(f="leading"in l?!!l.leading:f,g="trailing"in l?!!l.trailing:g),mg(n,a,{leading:f,maxWait:a,trailing:g})}function HA(n){return fg(n,1)}function UA(n,a){return Fh(Ah(a),n)}function qA(){if(!arguments.length)return[];var n=arguments[0];return mt(n)?n:[n]}function VA(n){return Rr(n,C)}function WA(n,a){return a=typeof a=="function"?a:t,Rr(n,C,a)}function zA(n){return Rr(n,A|C)}function $A(n,a){return a=typeof a=="function"?a:t,Rr(n,A|C,a)}function GA(n,a){return a==null||sd(n,a,Ce(a))}function ti(n,a){return n===a||n!==n&&a!==a}var YA=mu(lh),ZA=mu(function(n,a){return n>=a}),Jn=cd(function(){return arguments}())?cd:function(n){return ne(n)&&qt.call(n,"callee")&&!Kp.call(n,"callee")},mt=F.isArray,XA=Np?vr(Np):ix;function or(n){return n!=null&&Cu(n.length)&&!zi(n)}function ue(n){return ne(n)&&or(n)}function QA(n){return n===!0||n===!1||ne(n)&&We(n)==te}var wn=h1||Zh,KA=Bp?vr(Bp):nx;function jA(n){return ne(n)&&n.nodeType===1&&!Ja(n)}function JA(n){if(n==null)return!0;if(or(n)&&(mt(n)||typeof n=="string"||typeof n.splice=="function"||wn(n)||Us(n)||Jn(n)))return!n.length;var a=He(n);if(a==ie||a==It)return!n.size;if(Ka(n))return!fh(n).length;for(var l in n)if(qt.call(n,l))return!1;return!0}function tb(n,a){return Za(n,a)}function eb(n,a,l){l=typeof l=="function"?l:t;var f=l?l(n,a):t;return f===t?Za(n,a,t,l):!!f}function kh(n){if(!ne(n))return!1;var a=We(n);return a==Re||a==Zt||typeof n.message=="string"&&typeof n.name=="string"&&!Ja(n)}function rb(n){return typeof n=="number"&&Jp(n)}function zi(n){if(!re(n))return!1;var a=We(n);return a==Ve||a==er||a==Kt||a==Ni}function xg(n){return typeof n=="number"&&n==vt(n)}function Cu(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=kt}function re(n){var a=typeof n;return n!=null&&(a=="object"||a=="function")}function ne(n){return n!=null&&typeof n=="object"}var Eg=Ip?vr(Ip):ax;function ib(n,a){return n===a||ch(n,a,Sh(a))}function nb(n,a,l){return l=typeof l=="function"?l:t,ch(n,a,Sh(a),l)}function sb(n){return Ag(n)&&n!=+n}function ab(n){if(Wx(n))throw new gt(o);return fd(n)}function ob(n){return n===null}function ub(n){return n==null}function Ag(n){return typeof n=="number"||ne(n)&&We(n)==Pe}function Ja(n){if(!ne(n)||We(n)!=ee)return!1;var a=Jo(n);if(a===null)return!0;var l=qt.call(a,"constructor")&&a.constructor;return typeof l=="function"&&l instanceof l&&Xo.call(l)==n1}var Hh=Rp?vr(Rp):ox;function lb(n){return xg(n)&&n>=-kt&&n<=kt}var bg=Pp?vr(Pp):ux;function Du(n){return typeof n=="string"||!mt(n)&&ne(n)&&We(n)==pr}function Er(n){return typeof n=="symbol"||ne(n)&&We(n)==rr}var Us=Fp?vr(Fp):lx;function hb(n){return n===t}function cb(n){return ne(n)&&He(n)==Dr}function fb(n){return ne(n)&&We(n)==an}var pb=mu(ph),db=mu(function(n,a){return n<=a});function wg(n){if(!n)return[];if(or(n))return Du(n)?jr(n):ar(n);if(Ua&&n[Ua])return Gv(n[Ua]());var a=He(n),l=a==ie?th:a==It?Go:qs;return l(n)}function $i(n){if(!n)return n===0?n:0;if(n=kr(n),n===xt||n===-xt){var a=n<0?-1:1;return a*Ue}return n===n?n:0}function vt(n){var a=$i(n),l=a%1;return a===a?l?a-l:a:0}function Tg(n){return n?Xn(vt(n),0,ge):0}function kr(n){if(typeof n=="number")return n;if(Er(n))return Se;if(re(n)){var a=typeof n.valueOf=="function"?n.valueOf():n;n=re(a)?a+"":a}if(typeof n!="string")return n===0?n:+n;n=Wp(n);var l=Ri.test(n);return l||Vn.test(n)?Ov(n.slice(2),l?2:8):Ra.test(n)?Se:+n}function _g(n){return vi(n,ur(n))}function gb(n){return n?Xn(vt(n),-kt,kt):n===0?n:0}function Ht(n){return n==null?"":xr(n)}var yb=Fs(function(n,a){if(Ka(a)||or(a)){vi(a,Ce(a),n);return}for(var l in a)qt.call(a,l)&&$a(n,l,a[l])}),Cg=Fs(function(n,a){vi(a,ur(a),n)}),Su=Fs(function(n,a,l,f){vi(a,ur(a),n,f)}),mb=Fs(function(n,a,l,f){vi(a,Ce(a),n,f)}),vb=Vi(ah);function xb(n,a){var l=Ps(n);return a==null?l:nd(l,a)}var Eb=wt(function(n,a){n=zt(n);var l=-1,f=a.length,g=f>2?a[2]:t;for(g&&ze(a[0],a[1],g)&&(f=1);++l<f;)for(var x=a[l],w=ur(x),D=-1,M=w.length;++D<M;){var $=w[D],G=n[$];(G===t||ti(G,Bs[$])&&!qt.call(n,$))&&(n[$]=x[$])}return n}),Ab=wt(function(n){return n.push(t,Wd),mr(Dg,t,n)});function bb(n,a){return Hp(n,ut(a,3),mi)}function wb(n,a){return Hp(n,ut(a,3),uh)}function Tb(n,a){return n==null?n:oh(n,ut(a,3),ur)}function _b(n,a){return n==null?n:ld(n,ut(a,3),ur)}function Cb(n,a){return n&&mi(n,ut(a,3))}function Db(n,a){return n&&uh(n,ut(a,3))}function Sb(n){return n==null?[]:lu(n,Ce(n))}function Ob(n){return n==null?[]:lu(n,ur(n))}function Uh(n,a,l){var f=n==null?t:Qn(n,a);return f===t?l:f}function Mb(n,a){return n!=null&&Gd(n,a,J1)}function qh(n,a){return n!=null&&Gd(n,a,tx)}var Lb=kd(function(n,a,l){a!=null&&typeof a.toString!="function"&&(a=Qo.call(a)),n[a]=l},Wh(lr)),Nb=kd(function(n,a,l){a!=null&&typeof a.toString!="function"&&(a=Qo.call(a)),qt.call(n,a)?n[a].push(l):n[a]=[l]},ut),Bb=wt(Ya);function Ce(n){return or(n)?rd(n):fh(n)}function ur(n){return or(n)?rd(n,!0):hx(n)}function Ib(n,a){var l={};return a=ut(a,3),mi(n,function(f,g,x){Ui(l,a(f,g,x),f)}),l}function Rb(n,a){var l={};return a=ut(a,3),mi(n,function(f,g,x){Ui(l,g,a(f,g,x))}),l}var Pb=Fs(function(n,a,l){hu(n,a,l)}),Dg=Fs(function(n,a,l,f){hu(n,a,l,f)}),Fb=Vi(function(n,a){var l={};if(n==null)return l;var f=!1;a=jt(a,function(x){return x=An(x,n),f||(f=x.length>1),x}),vi(n,Ch(n),l),f&&(l=Rr(l,A|T|C,Lx));for(var g=a.length;g--;)vh(l,a[g]);return l});function kb(n,a){return Sg(n,_u(ut(a)))}var Hb=Vi(function(n,a){return n==null?{}:fx(n,a)});function Sg(n,a){if(n==null)return{};var l=jt(Ch(n),function(f){return[f]});return a=ut(a),xd(n,l,function(f,g){return a(f,g[0])})}function Ub(n,a,l){a=An(a,n);var f=-1,g=a.length;for(g||(g=1,n=t);++f<g;){var x=n==null?t:n[xi(a[f])];x===t&&(f=g,x=l),n=zi(x)?x.call(n):x}return n}function qb(n,a,l){return n==null?n:Xa(n,a,l)}function Vb(n,a,l,f){return f=typeof f=="function"?f:t,n==null?n:Xa(n,a,l,f)}var Og=qd(Ce),Mg=qd(ur);function Wb(n,a,l){var f=mt(n),g=f||wn(n)||Us(n);if(a=ut(a,4),l==null){var x=n&&n.constructor;g?l=f?new x:[]:re(n)?l=zi(x)?Ps(Jo(n)):{}:l={}}return(g?Nr:mi)(n,function(w,D,M){return a(l,w,D,M)}),l}function zb(n,a){return n==null?!0:vh(n,a)}function $b(n,a,l){return n==null?n:Td(n,a,Ah(l))}function Gb(n,a,l,f){return f=typeof f=="function"?f:t,n==null?n:Td(n,a,Ah(l),f)}function qs(n){return n==null?[]:Jl(n,Ce(n))}function Yb(n){return n==null?[]:Jl(n,ur(n))}function Zb(n,a,l){return l===t&&(l=a,a=t),l!==t&&(l=kr(l),l=l===l?l:0),a!==t&&(a=kr(a),a=a===a?a:0),Xn(kr(n),a,l)}function Xb(n,a,l){return a=$i(a),l===t?(l=a,a=0):l=$i(l),n=kr(n),ex(n,a,l)}function Qb(n,a,l){if(l&&typeof l!="boolean"&&ze(n,a,l)&&(a=l=t),l===t&&(typeof a=="boolean"?(l=a,a=t):typeof n=="boolean"&&(l=n,n=t)),n===t&&a===t?(n=0,a=1):(n=$i(n),a===t?(a=n,n=0):a=$i(a)),n>a){var f=n;n=a,a=f}if(l||n%1||a%1){var g=td();return ke(n+g*(a-n+Sv("1e-"+((g+"").length-1))),a)}return gh(n,a)}var Kb=ks(function(n,a,l){return a=a.toLowerCase(),n+(l?Lg(a):a)});function Lg(n){return Vh(Ht(n).toLowerCase())}function Ng(n){return n=Ht(n),n&&n.replace(Pa,qv).replace(vv,"")}function jb(n,a,l){n=Ht(n),a=xr(a);var f=n.length;l=l===t?f:Xn(vt(l),0,f);var g=l;return l-=a.length,l>=0&&n.slice(l,g)==a}function Jb(n){return n=Ht(n),n&&kn.test(n)?n.replace(ln,Vv):n}function tw(n){return n=Ht(n),n&&Fl.test(n)?n.replace(fn,"\\$&"):n}var ew=ks(function(n,a,l){return n+(l?"-":"")+a.toLowerCase()}),rw=ks(function(n,a,l){return n+(l?" ":"")+a.toLowerCase()}),iw=Rd("toLowerCase");function nw(n,a,l){n=Ht(n),a=vt(a);var f=a?Ls(n):0;if(!a||f>=a)return n;var g=(a-f)/2;return yu(iu(g),l)+n+yu(ru(g),l)}function sw(n,a,l){n=Ht(n),a=vt(a);var f=a?Ls(n):0;return a&&f<a?n+yu(a-f,l):n}function aw(n,a,l){n=Ht(n),a=vt(a);var f=a?Ls(n):0;return a&&f<a?yu(a-f,l)+n:n}function ow(n,a,l){return l||a==null?a=0:a&&(a=+a),d1(Ht(n).replace(Na,""),a||0)}function uw(n,a,l){return(l?ze(n,a,l):a===t)?a=1:a=vt(a),yh(Ht(n),a)}function lw(){var n=arguments,a=Ht(n[0]);return n.length<3?a:a.replace(n[1],n[2])}var hw=ks(function(n,a,l){return n+(l?"_":"")+a.toLowerCase()});function cw(n,a,l){return l&&typeof l!="number"&&ze(n,a,l)&&(a=l=t),l=l===t?ge:l>>>0,l?(n=Ht(n),n&&(typeof a=="string"||a!=null&&!Hh(a))&&(a=xr(a),!a&&Ms(n))?bn(jr(n),0,l):n.split(a,l)):[]}var fw=ks(function(n,a,l){return n+(l?" ":"")+Vh(a)});function pw(n,a,l){return n=Ht(n),l=l==null?0:Xn(vt(l),0,n.length),a=xr(a),n.slice(l,l+a.length)==a}function dw(n,a,l){var f=v.templateSettings;l&&ze(n,a,l)&&(a=t),n=Ht(n),a=Su({},a,f,Vd);var g=Su({},a.imports,f.imports,Vd),x=Ce(g),w=Jl(g,x),D,M,$=0,G=a.interpolate||ws,Z="__p += '",J=eh((a.escape||ws).source+"|"+G.source+"|"+(G===Hn?Uo:ws).source+"|"+(a.evaluate||ws).source+"|$","g"),st="//# sourceURL="+(qt.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wv+"]")+`
15
- `;n.replace(J,function(ht,Ct,Lt,Ar,$e,br){return Lt||(Lt=Ar),Z+=n.slice($,br).replace(Ul,Wv),Ct&&(D=!0,Z+=`' +
16
- __e(`+Ct+`) +
17
- '`),$e&&(M=!0,Z+=`';
18
- `+$e+`;
19
- __p += '`),Lt&&(Z+=`' +
20
- ((__t = (`+Lt+`)) == null ? '' : __t) +
21
- '`),$=br+ht.length,ht}),Z+=`';
22
- `;var lt=qt.call(a,"variable")&&a.variable;if(!lt)Z=`with (obj) {
23
- `+Z+`
24
- }
25
- `;else if(ko.test(lt))throw new gt(h);Z=(M?Z.replace(Et,""):Z).replace(xe,"$1").replace(Fe,"$1;"),Z="function("+(lt||"obj")+`) {
26
- `+(lt?"":`obj || (obj = {});
27
- `)+"var __t, __p = ''"+(D?", __e = _.escape":"")+(M?`, __j = Array.prototype.join;
28
- function print() { __p += __j.call(arguments, '') }
29
- `:`;
30
- `)+Z+`return __p
31
- }`;var bt=Ig(function(){return Pt(x,st+"return "+Z).apply(t,w)});if(bt.source=Z,kh(bt))throw bt;return bt}function gw(n){return Ht(n).toLowerCase()}function yw(n){return Ht(n).toUpperCase()}function mw(n,a,l){if(n=Ht(n),n&&(l||a===t))return Wp(n);if(!n||!(a=xr(a)))return n;var f=jr(n),g=jr(a),x=zp(f,g),w=$p(f,g)+1;return bn(f,x,w).join("")}function vw(n,a,l){if(n=Ht(n),n&&(l||a===t))return n.slice(0,Yp(n)+1);if(!n||!(a=xr(a)))return n;var f=jr(n),g=$p(f,jr(a))+1;return bn(f,0,g).join("")}function xw(n,a,l){if(n=Ht(n),n&&(l||a===t))return n.replace(Na,"");if(!n||!(a=xr(a)))return n;var f=jr(n),g=zp(f,jr(a));return bn(f,g).join("")}function Ew(n,a){var l=K,f=rt;if(re(a)){var g="separator"in a?a.separator:g;l="length"in a?vt(a.length):l,f="omission"in a?xr(a.omission):f}n=Ht(n);var x=n.length;if(Ms(n)){var w=jr(n);x=w.length}if(l>=x)return n;var D=l-Ls(f);if(D<1)return f;var M=w?bn(w,0,D).join(""):n.slice(0,D);if(g===t)return M+f;if(w&&(D+=M.length-D),Hh(g)){if(n.slice(D).search(g)){var $,G=M;for(g.global||(g=eh(g.source,Ht(Ia.exec(g))+"g")),g.lastIndex=0;$=g.exec(G);)var Z=$.index;M=M.slice(0,Z===t?D:Z)}}else if(n.indexOf(xr(g),D)!=D){var J=M.lastIndexOf(g);J>-1&&(M=M.slice(0,J))}return M+f}function Aw(n){return n=Ht(n),n&&gr.test(n)?n.replace(Sr,Qv):n}var bw=ks(function(n,a,l){return n+(l?" ":"")+a.toUpperCase()}),Vh=Rd("toUpperCase");function Bg(n,a,l){return n=Ht(n),a=l?t:a,a===t?$v(n)?Jv(n):Pv(n):n.match(a)||[]}var Ig=wt(function(n,a){try{return mr(n,t,a)}catch(l){return kh(l)?l:new gt(l)}}),ww=Vi(function(n,a){return Nr(a,function(l){l=xi(l),Ui(n,l,Ph(n[l],n))}),n});function Tw(n){var a=n==null?0:n.length,l=ut();return n=a?jt(n,function(f){if(typeof f[1]!="function")throw new Br(u);return[l(f[0]),f[1]]}):[],wt(function(f){for(var g=-1;++g<a;){var x=n[g];if(mr(x[0],this,f))return mr(x[1],this,f)}})}function _w(n){return Q1(Rr(n,A))}function Wh(n){return function(){return n}}function Cw(n,a){return n==null||n!==n?a:n}var Dw=Fd(),Sw=Fd(!0);function lr(n){return n}function zh(n){return pd(typeof n=="function"?n:Rr(n,A))}function Ow(n){return gd(Rr(n,A))}function Mw(n,a){return yd(n,Rr(a,A))}var Lw=wt(function(n,a){return function(l){return Ya(l,n,a)}}),Nw=wt(function(n,a){return function(l){return Ya(n,l,a)}});function $h(n,a,l){var f=Ce(a),g=lu(a,f);l==null&&!(re(a)&&(g.length||!f.length))&&(l=a,a=n,n=this,g=lu(a,Ce(a)));var x=!(re(l)&&"chain"in l)||!!l.chain,w=zi(n);return Nr(g,function(D){var M=a[D];n[D]=M,w&&(n.prototype[D]=function(){var $=this.__chain__;if(x||$){var G=n(this.__wrapped__),Z=G.__actions__=ar(this.__actions__);return Z.push({func:M,args:arguments,thisArg:n}),G.__chain__=$,G}return M.apply(n,yn([this.value()],arguments))})}),n}function Bw(){return Oe._===this&&(Oe._=s1),this}function Gh(){}function Iw(n){return n=vt(n),wt(function(a){return md(a,n)})}var Rw=wh(jt),Pw=wh(kp),Fw=wh(Zl);function Rg(n){return Mh(n)?Xl(xi(n)):px(n)}function kw(n){return function(a){return n==null?t:Qn(n,a)}}var Hw=Hd(),Uw=Hd(!0);function Yh(){return[]}function Zh(){return!1}function qw(){return{}}function Vw(){return""}function Ww(){return!0}function zw(n,a){if(n=vt(n),n<1||n>kt)return[];var l=ge,f=ke(n,ge);a=ut(a),n-=ge;for(var g=jl(f,a);++l<n;)a(l);return g}function $w(n){return mt(n)?jt(n,xi):Er(n)?[n]:ar(eg(Ht(n)))}function Gw(n){var a=++i1;return Ht(n)+a}var Yw=gu(function(n,a){return n+a},0),Zw=Th("ceil"),Xw=gu(function(n,a){return n/a},1),Qw=Th("floor");function Kw(n){return n&&n.length?uu(n,lr,lh):t}function jw(n,a){return n&&n.length?uu(n,ut(a,2),lh):t}function Jw(n){return qp(n,lr)}function tT(n,a){return qp(n,ut(a,2))}function eT(n){return n&&n.length?uu(n,lr,ph):t}function rT(n,a){return n&&n.length?uu(n,ut(a,2),ph):t}var iT=gu(function(n,a){return n*a},1),nT=Th("round"),sT=gu(function(n,a){return n-a},0);function aT(n){return n&&n.length?Kl(n,lr):0}function oT(n,a){return n&&n.length?Kl(n,ut(a,2)):0}return v.after=OA,v.ary=fg,v.assign=yb,v.assignIn=Cg,v.assignInWith=Su,v.assignWith=mb,v.at=vb,v.before=pg,v.bind=Ph,v.bindAll=ww,v.bindKey=dg,v.castArray=qA,v.chain=lg,v.chunk=Qx,v.compact=Kx,v.concat=jx,v.cond=Tw,v.conforms=_w,v.constant=Wh,v.countBy=aA,v.create=xb,v.curry=gg,v.curryRight=yg,v.debounce=mg,v.defaults=Eb,v.defaultsDeep=Ab,v.defer=MA,v.delay=LA,v.difference=Jx,v.differenceBy=tE,v.differenceWith=eE,v.drop=rE,v.dropRight=iE,v.dropRightWhile=nE,v.dropWhile=sE,v.fill=aE,v.filter=uA,v.flatMap=cA,v.flatMapDeep=fA,v.flatMapDepth=pA,v.flatten=sg,v.flattenDeep=oE,v.flattenDepth=uE,v.flip=NA,v.flow=Dw,v.flowRight=Sw,v.fromPairs=lE,v.functions=Sb,v.functionsIn=Ob,v.groupBy=dA,v.initial=cE,v.intersection=fE,v.intersectionBy=pE,v.intersectionWith=dE,v.invert=Lb,v.invertBy=Nb,v.invokeMap=yA,v.iteratee=zh,v.keyBy=mA,v.keys=Ce,v.keysIn=ur,v.map=bu,v.mapKeys=Ib,v.mapValues=Rb,v.matches=Ow,v.matchesProperty=Mw,v.memoize=Tu,v.merge=Pb,v.mergeWith=Dg,v.method=Lw,v.methodOf=Nw,v.mixin=$h,v.negate=_u,v.nthArg=Iw,v.omit=Fb,v.omitBy=kb,v.once=BA,v.orderBy=vA,v.over=Rw,v.overArgs=IA,v.overEvery=Pw,v.overSome=Fw,v.partial=Fh,v.partialRight=vg,v.partition=xA,v.pick=Hb,v.pickBy=Sg,v.property=Rg,v.propertyOf=kw,v.pull=vE,v.pullAll=og,v.pullAllBy=xE,v.pullAllWith=EE,v.pullAt=AE,v.range=Hw,v.rangeRight=Uw,v.rearg=RA,v.reject=bA,v.remove=bE,v.rest=PA,v.reverse=Ih,v.sampleSize=TA,v.set=qb,v.setWith=Vb,v.shuffle=_A,v.slice=wE,v.sortBy=SA,v.sortedUniq=ME,v.sortedUniqBy=LE,v.split=cw,v.spread=FA,v.tail=NE,v.take=BE,v.takeRight=IE,v.takeRightWhile=RE,v.takeWhile=PE,v.tap=KE,v.throttle=kA,v.thru=Au,v.toArray=wg,v.toPairs=Og,v.toPairsIn=Mg,v.toPath=$w,v.toPlainObject=_g,v.transform=Wb,v.unary=HA,v.union=FE,v.unionBy=kE,v.unionWith=HE,v.uniq=UE,v.uniqBy=qE,v.uniqWith=VE,v.unset=zb,v.unzip=Rh,v.unzipWith=ug,v.update=$b,v.updateWith=Gb,v.values=qs,v.valuesIn=Yb,v.without=WE,v.words=Bg,v.wrap=UA,v.xor=zE,v.xorBy=$E,v.xorWith=GE,v.zip=YE,v.zipObject=ZE,v.zipObjectDeep=XE,v.zipWith=QE,v.entries=Og,v.entriesIn=Mg,v.extend=Cg,v.extendWith=Su,$h(v,v),v.add=Yw,v.attempt=Ig,v.camelCase=Kb,v.capitalize=Lg,v.ceil=Zw,v.clamp=Zb,v.clone=VA,v.cloneDeep=zA,v.cloneDeepWith=$A,v.cloneWith=WA,v.conformsTo=GA,v.deburr=Ng,v.defaultTo=Cw,v.divide=Xw,v.endsWith=jb,v.eq=ti,v.escape=Jb,v.escapeRegExp=tw,v.every=oA,v.find=lA,v.findIndex=ig,v.findKey=bb,v.findLast=hA,v.findLastIndex=ng,v.findLastKey=wb,v.floor=Qw,v.forEach=hg,v.forEachRight=cg,v.forIn=Tb,v.forInRight=_b,v.forOwn=Cb,v.forOwnRight=Db,v.get=Uh,v.gt=YA,v.gte=ZA,v.has=Mb,v.hasIn=qh,v.head=ag,v.identity=lr,v.includes=gA,v.indexOf=hE,v.inRange=Xb,v.invoke=Bb,v.isArguments=Jn,v.isArray=mt,v.isArrayBuffer=XA,v.isArrayLike=or,v.isArrayLikeObject=ue,v.isBoolean=QA,v.isBuffer=wn,v.isDate=KA,v.isElement=jA,v.isEmpty=JA,v.isEqual=tb,v.isEqualWith=eb,v.isError=kh,v.isFinite=rb,v.isFunction=zi,v.isInteger=xg,v.isLength=Cu,v.isMap=Eg,v.isMatch=ib,v.isMatchWith=nb,v.isNaN=sb,v.isNative=ab,v.isNil=ub,v.isNull=ob,v.isNumber=Ag,v.isObject=re,v.isObjectLike=ne,v.isPlainObject=Ja,v.isRegExp=Hh,v.isSafeInteger=lb,v.isSet=bg,v.isString=Du,v.isSymbol=Er,v.isTypedArray=Us,v.isUndefined=hb,v.isWeakMap=cb,v.isWeakSet=fb,v.join=gE,v.kebabCase=ew,v.last=Fr,v.lastIndexOf=yE,v.lowerCase=rw,v.lowerFirst=iw,v.lt=pb,v.lte=db,v.max=Kw,v.maxBy=jw,v.mean=Jw,v.meanBy=tT,v.min=eT,v.minBy=rT,v.stubArray=Yh,v.stubFalse=Zh,v.stubObject=qw,v.stubString=Vw,v.stubTrue=Ww,v.multiply=iT,v.nth=mE,v.noConflict=Bw,v.noop=Gh,v.now=wu,v.pad=nw,v.padEnd=sw,v.padStart=aw,v.parseInt=ow,v.random=Qb,v.reduce=EA,v.reduceRight=AA,v.repeat=uw,v.replace=lw,v.result=Ub,v.round=nT,v.runInContext=S,v.sample=wA,v.size=CA,v.snakeCase=hw,v.some=DA,v.sortedIndex=TE,v.sortedIndexBy=_E,v.sortedIndexOf=CE,v.sortedLastIndex=DE,v.sortedLastIndexBy=SE,v.sortedLastIndexOf=OE,v.startCase=fw,v.startsWith=pw,v.subtract=sT,v.sum=aT,v.sumBy=oT,v.template=dw,v.times=zw,v.toFinite=$i,v.toInteger=vt,v.toLength=Tg,v.toLower=gw,v.toNumber=kr,v.toSafeInteger=gb,v.toString=Ht,v.toUpper=yw,v.trim=mw,v.trimEnd=vw,v.trimStart=xw,v.truncate=Ew,v.unescape=Aw,v.uniqueId=Gw,v.upperCase=bw,v.upperFirst=Vh,v.each=hg,v.eachRight=cg,v.first=ag,$h(v,function(){var n={};return mi(v,function(a,l){qt.call(v.prototype,l)||(n[l]=a)}),n}(),{chain:!1}),v.VERSION=r,Nr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){v[n].placeholder=v}),Nr(["drop","take"],function(n,a){St.prototype[n]=function(l){l=l===t?1:Ae(vt(l),0);var f=this.__filtered__&&!a?new St(this):this.clone();return f.__filtered__?f.__takeCount__=ke(l,f.__takeCount__):f.__views__.push({size:ke(l,ge),type:n+(f.__dir__<0?"Right":"")}),f},St.prototype[n+"Right"]=function(l){return this.reverse()[n](l).reverse()}}),Nr(["filter","map","takeWhile"],function(n,a){var l=a+1,f=l==pt||l==B;St.prototype[n]=function(g){var x=this.clone();return x.__iteratees__.push({iteratee:ut(g,3),type:l}),x.__filtered__=x.__filtered__||f,x}}),Nr(["head","last"],function(n,a){var l="take"+(a?"Right":"");St.prototype[n]=function(){return this[l](1).value()[0]}}),Nr(["initial","tail"],function(n,a){var l="drop"+(a?"":"Right");St.prototype[n]=function(){return this.__filtered__?new St(this):this[l](1)}}),St.prototype.compact=function(){return this.filter(lr)},St.prototype.find=function(n){return this.filter(n).head()},St.prototype.findLast=function(n){return this.reverse().find(n)},St.prototype.invokeMap=wt(function(n,a){return typeof n=="function"?new St(this):this.map(function(l){return Ya(l,n,a)})}),St.prototype.reject=function(n){return this.filter(_u(ut(n)))},St.prototype.slice=function(n,a){n=vt(n);var l=this;return l.__filtered__&&(n>0||a<0)?new St(l):(n<0?l=l.takeRight(-n):n&&(l=l.drop(n)),a!==t&&(a=vt(a),l=a<0?l.dropRight(-a):l.take(a-n)),l)},St.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},St.prototype.toArray=function(){return this.take(ge)},mi(St.prototype,function(n,a){var l=/^(?:filter|find|map|reject)|While$/.test(a),f=/^(?:head|last)$/.test(a),g=v[f?"take"+(a=="last"?"Right":""):a],x=f||/^find/.test(a);g&&(v.prototype[a]=function(){var w=this.__wrapped__,D=f?[1]:arguments,M=w instanceof St,$=D[0],G=M||mt(w),Z=function(Ct){var Lt=g.apply(v,yn([Ct],D));return f&&J?Lt[0]:Lt};G&&l&&typeof $=="function"&&$.length!=1&&(M=G=!1);var J=this.__chain__,st=!!this.__actions__.length,lt=x&&!J,bt=M&&!st;if(!x&&G){w=bt?w:new St(this);var ht=n.apply(w,D);return ht.__actions__.push({func:Au,args:[Z],thisArg:t}),new Ir(ht,J)}return lt&&bt?n.apply(this,D):(ht=this.thru(Z),lt?f?ht.value()[0]:ht.value():ht)})}),Nr(["pop","push","shift","sort","splice","unshift"],function(n){var a=Yo[n],l=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",f=/^(?:pop|shift)$/.test(n);v.prototype[n]=function(){var g=arguments;if(f&&!this.__chain__){var x=this.value();return a.apply(mt(x)?x:[],g)}return this[l](function(w){return a.apply(mt(w)?w:[],g)})}}),mi(St.prototype,function(n,a){var l=v[a];if(l){var f=l.name+"";qt.call(Rs,f)||(Rs[f]=[]),Rs[f].push({name:a,func:l})}}),Rs[du(t,P).name]=[{name:"wrapper",func:t}],St.prototype.clone=A1,St.prototype.reverse=b1,St.prototype.value=w1,v.prototype.at=jE,v.prototype.chain=JE,v.prototype.commit=tA,v.prototype.next=eA,v.prototype.plant=iA,v.prototype.reverse=nA,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=sA,v.prototype.first=v.prototype.head,Ua&&(v.prototype[Ua]=rA),v},Ns=t1();$n?(($n.exports=Ns)._=Ns,zl._=Ns):Oe._=Ns}).call(Zs)}(co,co.exports);var w0=co.exports;const Rt=Kh(w0);class Ot{constructor(e=new k(1/0,1/0),t=new k(-1/0,-1/0)){d(this,"isBox2",!0);d(this,"min");d(this,"max");this.min=e,this.max=t}applyMatrix3(e){return this.isEmpty()?this:(aa[0].set(this.min.x,this.min.y).applyMatrix3(e),aa[1].set(this.min.x,this.max.y).applyMatrix3(e),aa[3].set(this.max.x,this.max.y).applyMatrix3(e),aa[2].set(this.max.x,this.min.y).applyMatrix3(e),this.setFromPoints(aa),this)}clone(){return new Ot().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}ceil(){return this.min.ceilToZero(),this.max.ceilToZero(),this}distanceToPoint(e){return Xe.copy(e).clamp(this.min,this.max).sub(e).length()}expandByXY(e,t){return this.min.minXY(e,t),this.max.maxXY(e,t),this}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByPoints(e){if(!e||!e.length)return this;for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){return e.updateWorldMatrix(!1,!1),e.geometry.boundingBox!==void 0?((!e.geometry.boundingBox||e.geometry.boundingBox.isEmpty())&&e.computeBoundingBox(),ls.copy(e.geometry.boundingBox),ls.applyMatrix3(e.matrixWorld),this.union(ls)):e.geometry.points&&e.geometry.points.length&&(ls.setFromPoints(e.geometry.points),ls.applyMatrix3(e.matrixWorld),this.union(ls)),this}expandByBox(e){this.expandByPoint(e.min),this.expandByPoint(e.max)}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}floor(){return this.min.floorToZero(),this.max.floorToZero(),this}getCenter(e=new k){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e=new k){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}getPoints(e=[]){return e.length=0,e[0]={x:this.min.x,y:this.min.y},e[1]={x:this.min.x,y:this.max.y},e[2]={x:this.max.x,y:this.max.y},e[3]={x:this.max.x,y:this.min.y},e}getArea(){return this.getSize(Xe),Xe.x*Xe.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}intersectsBox(e){return e?!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y):!1}intersectsObject(e){return!e||!e.geometry?!1:this.intersectsBox(e.geometry.boundingBox)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}round(){return this.min.roundToZero(),this.max.roundToZero(),this}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t+=3)this.expandByPoint(Xe.fromArray(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=Xe.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromProjectionMatrix(e){return this.min.set(e.elements[6],e.elements[7]),this.max.set(e.elements[6],e.elements[7]),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}setFromMinMaxString(e,t=" "){if(this.makeEmpty(),!(e!=null&&e.length))return this;let r=e.split(t),s=Rt.map(r,o=>parseFloat(o));for(let o=0,u=s.length;o<u;o+=2)this.expandByPoint(Xe.fromArray(s,o));return this}translate(e){return this.min.add(e),this.max.add(e),this}toString(){return`{"min":${this.min.toString()},"max":${this.max.toString()}}`}fromString(e){return e?(this.copy(JSON.parse(e)),this):this}union(e){return e.validate()?(this.min.min(e.min),this.max.max(e.max),this):this}validate(){return this.min.validate()&&this.max.validate()}unproject(e){return this.applyMatrix3(e.projectionMatrixInverse).applyMatrix3(e.matrixWorld)}centralArrange(e=1,t=20,r=10){const s=t+r;this.getCenter(Xe),this.getSize(ni),ni.subScalar(t);const o=Math.floor(ni.x/s),u=Math.ceil(e/o),h=o*s,c=u*s;if(ni.x<s||ni.y<s||h>=ni.x||c>=ni.y)return Xe.clone();let p=[],A=0,T=0;for(let C=0;C<e;C++){const N=o>e?e*s:h,O=Xe.x-N/2+T*s+s/2,L=Xe.y-c/2+A*s+s/2;p.push(new k(O,L)),T++,T>=o&&(T=0,A++)}return p}flipY(){return Xe.copy(this.min).multiplyScalar(1,-1),ni.copy(this.max).multiplyScalar(1,-1),this.min.set(Xe.x,ni.y),this.max.set(ni.x,Xe.y),this}}const ls=new Ot,aa=[new k,new k,new k,new k],Xe=new k,ni=new k,T0=Object.freeze(Object.defineProperty({__proto__:null,default:Ot},Symbol.toStringTag,{value:"Module"})),_0=Vt.window.requestAnimationFrame,oa=Vt.window.performance?()=>Vt.window.performance.now():()=>new Date().getTime(),Vc=_0,Nt=class Nt{constructor(){d(this,"id",Nt.idCounter++);d(this,"timers",new Map);d(this,"timersDuration",new Map);d(this,"counters",new Map);d(this,"countersAmount",new Map);d(this,"out",[])}static active(e){e?Nt.actived=!0:Nt.actived=!1,Nt.duration=e||0}static add(e){this.children.push(e),this.handleStart()}static remove(e){for(let t=0,r=Nt.children.length;t<r;t++)if(Nt.children[t].id===e.id){this.children.splice(t,1);break}}static handleStart(){this.isRunning||(this.isRunning=!0,Vc(this.runLoop))}static runLoop(){Nt.children.length?(Nt.runFrames(),Vc(Nt.runLoop)):Nt.isRunning=!1}static runFrames(){let e,t=oa();if(!(t-Nt.lastTime<Nt.duration)){Nt.lastTime=t;for(let r=0,s=this.children.length;r<s;r++)e=this.children[r],e.calculateTimers(),e.calculateCounters(),Nt.messages=Nt.messages.concat(e.out),e.out.length=0;if(Nt.messages.length){if(Nt.actived){let r=[];r.push(C0),r.push(D0),r.push(S0),this.messages.forEach(s=>r.push(I0(s,this.maxLetters))),r.push(O0),console.log(r.join(`
32
- `))}Nt.messages.length=0}}}destroy(){Nt.remove(this)}addTimer(e,t=oa(),r=oa()-(this.timersDuration.get(e)||oa())){this.addTimerDuration(e,r),this.timersDuration.set(e,t)}addTimerDuration(e,t){var r;this.timers.has(e)||this.timers.set(e,[]),(r=this.timers.get(e))==null||r.push(t)}calculateTimers(){this.timers.forEach((e,t)=>{!e||!e.length||(this.out.push(this.calculateDurations(t,e)),e.length=0)})}addCounterAmount(e,t){var r;this.counters.has(e)||this.counters.set(e,[]),(r=this.counters.get(e))==null||r.push(t)}calculateCounters(){this.counters.forEach((e,t)=>{!e||!e.length||(this.out.push(this.calculateAmounts(t,e)),e.length=0)})}start(){return this.stop(),Nt.add(this),this}stop(){return Nt.remove(this),this}calculateDurations(e,t){const r={name:e,avg:0,min:0,max:0,stdDev:0,count:0,FPS:0};if(!t||!t.length)return r;const s=t.length,{min:o,max:u,avg:h}=this.minMaxAvg(t),c=parseFloat(this.stdDev(t,h).toFixed(2));return{name:e,avg:this.fd(h),min:this.fd(o),max:this.fd(u),stdDev:c,count:s,FPS:Math.ceil(s/Nt.duration*1e3)}}calculateAmounts(e,t){const r={name:e,avg:0,min:0,max:0,stdDev:0,count:0,FPS:0};if(!t||!t.length)return r;const s=t.length,{min:o,max:u,avg:h}=this.minMaxAvg(t),c=this.stdDev(t,h);return{name:e,avg:h,min:o,max:u,stdDev:c,count:s,FPS:Math.ceil(s/Nt.duration*1e3)}}minMaxAvg(e){let t=e[0],r=e[0],s=e.length,o=0;for(let h=0;h<e.length;h++){const c=e[h];o+=c,c<t&&(t=c),c>r&&(r=c)}const u=o/s;return{min:this.fx(t),max:this.fx(r),avg:this.fx(u)}}stdDev(e,t){let r=0;for(let o=0;o<e.length;o++){const u=e[o];r+=(u-t)*(u-t)}const s=e.length;return this.fx(Math.sqrt(r/s))}fd(e){return e>1e3?(e/1e3).toFixed(1)+"s":e.toFixed(1)+"ms"}fx(e,t=1){return t===1?Math.round(e*10)/10:t===2?Math.round(e*100)/100:t===3?Math.round(e*1e3)/1e3:e}};d(Nt,"idCounter",0),d(Nt,"children",[]),d(Nt,"isRunning",!1),d(Nt,"actived",!1),d(Nt,"duration",0),d(Nt,"lastTime",oa()),d(Nt,"messages",[]),d(Nt,"maxLetters",20);let hs=Nt;const fo=20,po=["avg","min","max","stdDev","count","FPS"],si=L0(po,1),C0=M0(po,fo),D0=N0(po,fo),S0=B0(po,fo),O0=R0(fo);function M0(i,e=20){let t="┌";t+="─".repeat(e),t+="┬";for(let r=0,s=i.length;r<s;r++)t+="─".repeat(si),r<s-1?t+="┬":t+="┐";return t}function L0(i,e=0){let t=0;for(let r=0,s=i.length;r<s;r++)t=Math.max(t,i[r].length);return t+e}function N0(i,e=20){let t="│";t+=" ".repeat(e),t+="│";for(let r=0,s=i.length;r<s;r++)t+=" ".repeat(Math.max(si-i[r].length-1,0)),t+=i[r],t+=" │";return t}function B0(i,e=20){let t="├";t+="─".repeat(e),t+="┼";for(let r=0,s=i.length;r<s;r++)t+="─".repeat(si),r<s-1?t+="┴":t+="┘";return t}function I0(i,e=20){let t="│";t+=" ".repeat(Math.max(e-i.name.length,0)),t+=i.name,t+="│";const r=typeof i.avg=="string"?si-i.avg.length:si-i.avg.toString().length;return t+=" ".repeat(Math.max(r,0)),t+=i.avg+" ",t+=" ".repeat(Math.max(si-i.min.toString().length,0)),t+=i.min+" ",t+=" ".repeat(Math.max(si-i.max.toString().length,0)),t+=i.max+" ",t+=" ".repeat(Math.max(si-i.stdDev.toString().length,0)),t+=i.stdDev+" ",t+=" ".repeat(Math.max(si-i.count.toString().length,0)),t+=i.count+" ",t+=" ".repeat(Math.max(si-i.FPS.toString().length,0)),t+=i.FPS,t}function R0(i=20){let e="└";for(let t=0;t<i;t++)e+="─";return e+="┘",e}function Zu(i,e="http://www.w3.org/2000/svg"){var t,r;return(r=(t=Vt.window)==null?void 0:t.document)==null?void 0:r.createElementNS(e,i)}function go(i=2e3){return Tt(this,null,function*(){return new Promise(e=>setTimeout(e,(Math.random()+.5)*i))})}function Wc(i,e=[]){var t,r;return!i||!i.value||(e.push(i.value),(t=i.children)!=null&&t.length&&((r=i.children)==null||r.forEach(s=>Wc(s,e)))),e}var Qe=(i=>(i.GROS="gros",i.RM="rm",i.WS="ws",i.SU="su",i.EQ="eq",i.FN="fn",i.GL="gl",i.IP="ip",i))(Qe||{}),ua=(i=>(i.BACKGROUND="background",i.ASSETS="assets",i.ANNOTATIONS="annotations",i.TEXT="text",i.ASSET_LABELS="asset-labels",i.LABELS="labels",i))(ua||{});const cs="ae",zc="-",Xu="rm-assets",P0="rm-labels",$c="ws-assets",Gc="ws-labels";function fs(i){return i+zc+ua.ASSETS}function la(i){return i+zc+ua.LABELS}const Yc={rm:["su-assets","su-labels","eq-assets","eq-labels","fn-assets","fn-labels"],ws:["su-assets","su-labels","eq-assets","eq-labels","fn-assets","fn-labels"],su:[Xu,P0,$c,Gc,"eq-assets","eq-labels","fn-assets","fn-labels"],eq:[$c,Gc,"su-assets","su-labels","fn-assets","fn-labels"]};class Ke{constructor(){d(this,"_listeners",new Map)}destroy(){this._listeners.clear()}addEventListener(e,t){let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r)),r.includes(t)||r.push(t)}addEventListeners(e,t){const r=e.split(","),s=r.length;for(let o=0;o<s;o++)this.addEventListener(r[o].trim(),t)}isListening(e){var t;return this._listeners.has(e)&&!!((t=this._listeners.get(e))!=null&&t.length)}hasEventListener(e,t){var r;return this._listeners.size===0?!1:this._listeners.has(e)&&!!((r=this._listeners.get(e))!=null&&r.includes(t))}removeEventListener(e,t){const r=this._listeners.get(e);if(r){const s=r.indexOf(t);s>-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners.get(e.type);if(t){e.target=this;const r=t.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=void 0}}dispatchEventAsync(e){const t=this._listeners.get(e.type);t&&setTimeout(()=>{for(const r of t)r.call(this,e)})}}function Zc(i){if(!i)return"inches";let e=i.querySelector("#defaultView"),t=e==null?void 0:e.getAttribute("units");return t||"inches"}function F0(i){if(!i)return 1;let e=Zc(i),t=1;switch(e){case"mm":t=500/39.3701;break;case"cm":t=50/39.3701;break;case"Metres":t=.5/39.3701;break;case"m":t=.5/39.3701;break;default:t=1}return t}function k0(i,e=new Ot){if(!i)return e;let t=i.split(" "),r=Rt.map(t,s=>parseFloat(s));return(r==null?void 0:r.length)!==4||(e.min.set(r[0],r[1]),e.max.set(r[0]+r[2],r[1]+r[3])),e}function H0(i=new Ot){let e="";const t=[];return t.push(i.min.x),t.push(i.min.y),t.push(Math.abs(i.max.x-i.min.x)),t.push(Math.abs(i.max.y-i.min.y)),e=t.join(" "),e}function Xc(i){var e;if((e=i==null?void 0:i.children)!=null&&e.length){for(let t=0,r=i.children.length;t<r;t++)if(i.children[t].nodeName==="g")return i.children[t]}}const U0=new hs().start();class q0 extends Ke{constructor(t){super();d(this,"isSvgRenderer",!0);d(this,"id");d(this,"params");d(this,"container",Vt.window.document.getElementsByTagName("body")[0]);d(this,"cameraVersion",-1);d(this,"viewAreaLimit",-1);d(this,"autoClear");this.id="SvgRenderer@"+Date.now(),this.params=t,Vt.config=t,this.initSvg(),hs.active(this.params.monitorDuration)}destroy(){hs.active(0)}initSvg(){if(this.params.containerId&&(this.container=Vt.window.document.getElementById(this.params.containerId)),this.container||(this.container=Vt.window.document.getElementsByTagName("body")[0]),!this.params.width||!this.params.height){const t=this.container.getBoundingClientRect();this.params.width=t.width,this.params.height=t.height}this.container.style.overflow="hidden",this.container.style.transform="translateZ(0)",this.setSize(this.params.width,this.params.height)}resize(){var p,A;const t=((p=this.container)==null?void 0:p.parentElement)||document.body,r=t.getBoundingClientRect();if(!r)return;const s=window.getComputedStyle(t),o=r.width-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight),u=r.height-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom),h=(A=this.container)==null?void 0:A.getBoundingClientRect();if(!h)return;const c=o-h.left+r.left,y=u-h.top+r.top;this.setSize(c,y)}setSize(t,r){this.container.style.width=t+"px",this.container.style.height=r+"px",this.params.width=t,this.params.height=r,this.params.camera||(this.params.camera={}),this.params.camera.width=this.params.width,this.params.camera.height=this.params.height,this.params.aspect=this.params.width/this.params.height,this.params.camera.aspect=this.params.aspect,this.params.camera.left=this.params.width*-.5,this.params.camera.right=this.params.width*.5,this.params.camera.top=this.params.height*.5,this.params.camera.bottom=this.params.height*-.5}getSize(t){return t.set(this.params.width,this.params.height)}clean(){}render(t,r){return Tt(this,null,function*(){var o;if(!t||!r||this.cameraVersion===(r==null?void 0:r.version))return;r.updateMatrixWorld(),Kc.set(0,0).unproject(r),jc.set(this.params.width,this.params.height).unproject(r),Qc.setFromPoints([Kc,jc]);let s=H0(Qc);(o=t.svg)==null||o.setAttribute("viewBox",s),this.cameraVersion=r.version||-1,U0.addTimer("render cycle")})}getRenderTarget(){}setRenderTarget(t){}renderTexture(t,r){}}const Qc=new Ot,Kc=new k,jc=new k;class ce{constructor(){d(this,"isMatrix3",!0);d(this,"elements",[1,0,0,0,1,0,0,0,1])}static equals(e,t,r=1e-6){if(e.elements.length!=t.elements.length)return!1;for(let s=0,o=e.elements.length;s<o;s++){const u=e.elements[s]-t.elements[s];if(Math.abs(u)>r)return!1}return!0}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}clone(){return new ce().fromArray(this.elements)}compose(e,t,r){const s=Math.sin(t.x),o=Math.cos(t.x);return this.set(r.x*o,r.y*s*-1,e.x,r.x*s,r.y*o,e.y,0,0,1)}composeWithCenter(e,t,r,s){return qr.identity(),yo.makeTranslation(e.x,e.y),ha.makeRotation(t.x),_n.makeScale(r.x,r.y),De.copy(s).applyMatrix3(_n),qr.multiply(Qu.makeTranslation(-De.x,-De.y)).multiply(yo).multiply(Qu.makeTranslation(De.x,De.y)).multiply(ha).multiply(Qu.makeTranslation(-De.x,-De.y)).multiply(_n),this.copy(qr)}decompose(e,t,r){const s=qr.copy(this).elements,o=Math.sqrt(s[0]*s[0]+s[3]*s[3]),u=Math.sqrt(s[1]*s[1]+s[4]*s[4]),h=s[0]*s[4]-s[3]*s[1];s[0]||s[3]?r.set(o,h/o):s[1]||s[4]?r.set(h/u,u):r.set(0,0);let c=0;s[0]||s[3]?c=s[3]>0?-Math.acos(s[0]/o):Math.acos(s[0]/o):s[1]||s[4]?c=Math.PI/2-(s[4]>0?Math.acos(-s[1]/u):-Math.acos(s[1]/u)):c=0,c!==0&&r.y<0&&(c*=-1),t.set(c,c),e.set(s[6],s[7])}compose2(e,t,r){return this.identity().translate(e.x,e.y).rotate(t.x).scale(r.x,r.y),this}decompose2(e,t,r){const s=this.clone();s.scale(-1,1);const o=s.elements[0],u=s.elements[1],h=s.elements[3],c=s.elements[4];let y=0,p=0,A=0;if(o!==0||h!==0){const T=Math.hypot(o,h);y=T,p=(o*c-u*h)/T;const C=Math.acos(o/T);A=h>0?-C:C}else if(u!==0||c!==0){const T=Math.hypot(u,c);y=(o*c-u*h)/T,p=T;const C=Math.acos(u/T);A=Math.PI/2+(c>0?-C:C)}else y=0,p=0,A=0;y=-y,e.x=s.elements[6],e.y=s.elements[7],t.x=t.y=A/Math.PI/180,r.x=y,r.y=p}composeSvgTransform(e=0,t=0,r,s=!1){if(!r&&!e&&!t)return this;this.identity(),qr.identity();let o=r==null?void 0:r.split(") ").map(u=>u.trim()+")").filter(u=>u!==")");return o||(o=[]),(e||t)&&o.push(`translate(${e},${t})`),o.forEach(u=>{const h=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(u),c=/rotate\(\s*(-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+))?)?\s*\)/.exec(u),y=/translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(u);if(h){const p=Number(h[1])||1,A=Number(h[2])||p;qr.multiply(_n.makeScale(p,A))}else if(c){const p=m0(Number(c[1])||0);Number(c[2])||Number(c[3])?(Ne.set(Number(c[2]||"0"),Number(c[3]||"0")),qr.multiply(ha.makeRotationByPoint(p,Ne))):qr.multiply(ha.makeRotation(p))}else y&&qr.multiply(yo.makeTranslation(Number(y[1])||0,Number(y[2])||0))}),this.copy(qr),s&&this.premultiply(_n.makeScale(1,-1)),this}decomposeSvgMatrix(e,t,r){const s=qr.copy(this).elements;Ne.set(s[0],s[1]),De.set(s[3],s[4]);let o=Ne.length();Ne.normalize();let u=Ne.dot(De);Jc.copy(Ne).multiplyScalar(-u),De.add(Jc);const h=De.length()||0;De.normalize(),Ne.x*De.y<De.x*Ne.y&&(Ne.x=-Ne.x,Ne.y=-Ne.y,o=-o,u=-u);const c=o?Math.atan2(Ne.y,Ne.x):Math.atan2(-Ne.x,De.y);e.set(s[6],s[7]),t.set(c,c),r.set(o,h)}determinant(){const e=this.elements,t=e[0],r=e[3],s=e[6],o=e[1],u=e[4],h=e[7],c=e[2],y=e[5],p=e[8];return t*u*p-t*y*h-o*r*p+o*y*s+c*r*h-c*u*s}equals(e,t=0){const r=this.elements,s=e.elements;for(let o=0;o<9;o++)if(Math.abs(r[o]-s[o])>t)return!1;return!0}extractBasis2(e,t){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),this}flipY(){return this.multiply(_n.makeScale(1,-1))}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}getComponents(e=[1,0,0,1,0,0]){return e[0]=this.elements[0],e[1]=this.elements[1],e[2]=this.elements[3],e[3]=this.elements[4],e[4]=this.elements[6],e[5]=this.elements[7],e}getNormalMatrix(e){return this.setFromMatrix(e).invert().transpose()}getRotation(e){let t=this.elements;const r=Math.sqrt(t[0]*t[0]+t[3]*t[3]),s=Math.sqrt(t[1]*t[1]+t[4]*t[4]);let o=0;t[0]||t[3]?o=t[3]>0?-Math.acos(t[0]/r):Math.acos(t[0]/r):t[1]||t[4]?o=Math.PI/2-(t[4]>0?Math.acos(-t[1]/s):-Math.acos(t[1]/s)):o=0,this.getScale(De),o!==0&&De.x<0&&(o*=-1),e.set(o,o)}getScale(e){let t=this.elements,r=Math.sqrt(t[0]*t[0]+t[1]*t[1]),s=Math.sqrt(t[3]*t[3]+t[4]*t[4]),o=t[0]*t[4]-t[3]*t[1];t[0]||t[1]?e.set(o/s,s):t[3]||t[4]?e.set(r,o/r):e.set(0,0)}getTransition(e){e.set(this.elements[6],this.elements[7])}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}hasChange(){for(let e=0,t=this.elements.length;e<t;e++)if(Math.abs(this.elements[e]-V0[e])>Number.EPSILON)return!0;return!1}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],u=e[4],h=e[5],c=e[6],y=e[7],p=e[8],A=p*u-h*y,T=h*c-p*o,C=y*o-u*c,N=t*A+r*T+s*C;if(N===0)return this.set(0,0,0,0,0,0,0,0,0);const O=1/N;return e[0]=A*O,e[1]=(s*y-p*r)*O,e[2]=(h*r-s*u)*O,e[3]=T*O,e[4]=(p*t-s*c)*O,e[5]=(s*o-h*t)*O,e[6]=C*O,e[7]=(r*c-y*t)*O,e[8]=(u*t-r*o)*O,this}lookAt(e,t,r){return this.identity().rotate(t.angle()-e.angle()+r.angle())}makeProjection(e,t,r,s,o,u){const h=o/(t-e),c=u/(r-s),y=o/2-(t+e)*h,p=u/2+(r+s)*c;return this.elements[0]=h,this.elements[3]=0,this.elements[6]=y,this.elements[1]=0,this.elements[4]=-c,this.elements[7]=p,this.elements[2]=0,this.elements[5]=0,this.elements[8]=1,this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeRotationByPoint(e,t){const r=Math.cos(e),s=Math.sin(e),o=-t.x*r+t.y*s+t.x,u=-t.x*s-t.y*r+t.y;return this.set(r,-s,o,s,r,u,0,0,1),this}makeRotationFromQuaternion(e){return this.compose(W0,e,z0)}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}multiply(e){return this.multiplyMatrices(this,e)}multiplyMatrices(e,t){const r=e.elements,s=t.elements,o=this.elements,u=r[0],h=r[3],c=r[6],y=r[1],p=r[4],A=r[7],T=r[2],C=r[5],N=r[8],O=s[0],L=s[3],P=s[6],W=s[1],V=s[4],b=s[7],Y=s[2],z=s[5],j=s[8];return o[0]=u*O+h*W+c*Y,o[3]=u*L+h*V+c*z,o[6]=u*P+h*b+c*j,o[1]=y*O+p*W+A*Y,o[4]=y*L+p*V+A*z,o[7]=y*P+p*b+A*j,o[2]=T*O+C*W+N*Y,o[5]=T*L+C*V+N*z,o[8]=T*P+C*b+N*j,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}premultiply(e){return this.multiplyMatrices(e,this)}rotate(e){return this.premultiply(ha.makeRotation(-e))}scale(e,t){return this.premultiply(_n.makeScale(e,t))}set(e,t,r,s,o,u,h,c,y){return this.elements[0]=e,this.elements[3]=t,this.elements[6]=r,this.elements[1]=s,this.elements[4]=o,this.elements[7]=u,this.elements[2]=h,this.elements[5]=c,this.elements[8]=y,this}setFromDomMatrix(e){return typeof e.m11!="undefined"&&typeof e.m21!="undefined"&&typeof e.m41!="undefined"&&typeof e.m12!="undefined"&&typeof e.m22!="undefined"&&typeof e.m42!="undefined"&&typeof e.m14!="undefined"&&typeof e.m24!="undefined"&&typeof e.m44!="undefined"?this.set(e.m11,e.m21,e.m41,e.m12,e.m22,e.m42,e.m14,e.m24,e.m44):typeof e.a!="undefined"&&typeof e.b!="undefined"&&typeof e.c!="undefined"&&typeof e.d!="undefined"&&typeof e.e!="undefined"&&typeof e.f!="undefined"&&this.set(e.a,e.c,e.e,e.b,e.d,e.f,0,0,1),this}setFromMatrix(e){const t=e.elements;return this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this}setUvTransform(e,t,r,s,o,u,h){const c=Math.cos(o),y=Math.sin(o);return this.set(r*c,r*y,-r*(c*u+y*h)+u+e,-s*y,s*c,-s*(-y*u+c*h)+h+t,0,0,1),this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}toString(){return`[${this.elements[0]},${this.elements[1]}, ${this.elements[3]},${this.elements[4]}, ${this.elements[6]},${this.elements[7]}]`}translate(e,t){return this.premultiply(yo.makeTranslation(e,t))}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}}const V0=[1,0,0,0,1,0,0,0,1],Ne=new k,De=new k,Jc=new k,qr=new ce,yo=new ce,ha=new ce,_n=new ce,Qu=new ce,W0=new k(0,0,0),z0=new k(1,1,1),Be=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],tf=()=>{const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Be[i&255]+Be[i>>8&255]+Be[i>>16&255]+Be[i>>24&255]+"-"+Be[e&255]+Be[e>>8&255]+"-"+Be[e>>16&15|64]+Be[e>>24&255]+"-"+Be[t&63|128]+Be[t>>8&255]+"-"+Be[t>>16&255]+Be[t>>24&255]+Be[r&255]+Be[r>>8&255]+Be[r>>16&255]+Be[r>>24&255]).toLowerCase()};class ef extends Ke{constructor(t={}){super();d(this,"isObject2",!0);d(this,"id",$0++);d(this,"uuid",tf());d(this,"name");d(this,"type","Object2");d(this,"featureKey","Object2_"+this.id);d(this,"parent");d(this,"children",[]);d(this,"up",new k(0,1));d(this,"position",new k);d(this,"rotation",new k);d(this,"scaled",new k(1,1));d(this,"flipY",!1);d(this,"selectable",!1);d(this,"matrix",new ce);d(this,"matrixWorld",new ce);d(this,"matrixWorldInverse",new ce);d(this,"modelViewMatrix",new ce);d(this,"normalMatrix",new ce);d(this,"fixed",!1);d(this,"dynamically",!1);d(this,"matrixAutoUpdate",!1);d(this,"matrixWorldNeedsUpdate",!1);d(this,"matrixWorldAutoUpdate",!1);d(this,"composeNode",!1);d(this,"isInComposeNode",!1);d(this,"alignCenter",!1);d(this,"boundingBox",new Ot);d(this,"boundingBoxWorld",new Ot);d(this,"boundingBoxNeedsUpdate",!1);d(this,"centerPoint",new k);d(this,"visible",!0);d(this,"castShadow",!1);d(this,"receiveShadow",!1);d(this,"renderOrder",0);d(this,"animations",[]);d(this,"finalSize");d(this,"userData",{});d(this,"DefaultUp",new k(0,1));d(this,"_autoSort",!0);d(this,"_version",0);t.name!==void 0?this.name=t.name:this.name="Object2",t.flipY!==void 0&&(this.flipY=t.flipY),t.selectable!==void 0&&(this.selectable=t.selectable),t.finalSize!==void 0&&(this.finalSize=t.finalSize),this.setAttrs(t)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}destroy(){super.destroy(),this.clear(),this.removeFromParent(),this.dispatchEvent(Ju)}setPosition(t){return this.position.set(t.x,t.y),this}translate(t,r){this.position.x+=t,this.position.y+=r}setScale(t,r){return this.scaled.set(t,r),this}setRotationFromMatrix(t){t.decompose(fa,this.rotation,ju)}setRotation(t){return this.rotation.set(t,t),this}rotate(t){this.rotation.x+=t}scale(t,r){r?(this.scaled.x*=t,this.scaled.y*=r):this.scaled.multiplyScalar(t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(ai.copy(this.matrixWorld).invert())}lookAt(t){rf.copy(t),this.updateWorldMatrix(!0,!1),this.matrixWorld.getTransition(fa),ai.lookAt(fa,rf,G0),ai.getRotation(Cn),this.rotation.set(Cn.x,Cn.x),this.parent&&(this.parent.matrixWorld.getRotation(Cn),this.rotate(Cn.x))}applyMatrix3(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.rotation,this.scaled)}updateMatrix(){Ku.copy(this.scaled),this.flipY&&(Ku.y*=-1),this.matrix.compose(this.position,this.rotation,Ku),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.matrixWorldNeedsUpdate=!1,t=!0,this.boundingBoxNeedsUpdate=!0);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateMatrixWorld(t);this.boundingBoxNeedsUpdate&&(this.updateBoundingBox(),this.boundingBoxNeedsUpdate=!1)}updateWorldMatrix(t=!1,r=!1){const s=this.parent;if(t&&s&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),r){const o=this.children;for(let u=0,h=o.length;u<h;u++)o[u].updateWorldMatrix(!1,!0)}}updateModelViewMatrix(t){ai.copy(this.matrixWorld),t&&this.fixed?this.modelViewMatrix.copy(t.projectionMatrix):t?this.modelViewMatrix.multiplyMatrices(t.viewMatrix,ai):this.modelViewMatrix.copy(ai);for(let r=0,s=this.children.length;r<s;r++)this.children[r].updateModelViewMatrix(t)}computeBoundingBox(){this.boundingBox.makeEmpty(),this.centerPoint.set(0,0);for(let t=0,r=this.children.length;t<r;t++)this.children[t].updateMatrixWorld(),ca.copy(this.children[t].computeBoundingBox()),ca.applyMatrix3(ai.copy(this.children[t].matrixWorld)),this.boundingBox.union(ca);return this.boundingBox.applyMatrix3(this.matrixWorldInverse),this.boundingBox}updateBoundingBox(){this.boundingBox.isEmpty()||this.boundingBoxWorld.copy(this.boundingBox).applyMatrix3(this.matrixWorld)}setAttrs(t){if(!t)return this;for(const r in t)if(!(r==="children"||t[r]===void 0)){if(r==="userData"&&t[r]){Object.keys(t[r]).forEach(s=>this.userData[s]=t[r][s]);continue}this.userData[r]=t[r]}return this}add(t){return!t||!t.isObject2||t===this?this:(t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.isInComposeNode=this.composeNode||this.isInComposeNode,t.selectable&&t.parent.setSelectable(t.selectable),this._autoSort&&this.children.sort((r,s)=>r.renderOrder-s.renderOrder),t.dispatchEvent(Y0),this.matrixAutoUpdate||(this.matrixWorldNeedsUpdate=!0),this)}adds(t){if(!t||!t.length)return this;this._autoSort=!1;for(let r=0,s=t.length;r<s;r++)r===t.length-1&&(this._autoSort=!0),this.add(t[r]);return this}remove(t){const r=this.children.indexOf(t);return r!==-1&&(t.parent=void 0,this.children.splice(r,1),t.dispatchEvent(Ju)),this}removes(t){for(let r=0,s=t.length;r<s;r++)this.remove(t[r]);return this}removeFromParent(){const t=this.parent;return t&&t.remove(this),this.parent=void 0,this}moveToLast(){const t=this.parent;t&&(this.removeFromParent(),t.add(this))}clear(){for(let t=0;t<this.children.length;t++){const r=this.children[t];r.parent=void 0,r.destroy(),r.dispatchEvent(Ju)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),ai.copy(this.matrixWorld).invert(),t.parent&&(t.parent.updateWorldMatrix(!0,!1),ai.multiply(t.parent.matrixWorld)),t.applyMatrix3(ai),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,r){if(this[t]===r)return this;for(let s=0,o=this.children.length;s<o;s++){const h=this.children[s].getObjectByProperty(t,r);if(h!==void 0)return h}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(t,Cn,ju),t}getWorldRotation(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(fa,t,ju),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(fa,Cn,t),t}getWorldDirection(t){return this.updateWorldMatrix(!0,!1),t.set(this.matrixWorld.elements[6],this.matrixWorld.elements[7]).normalize()}traverse(t){t(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].traverse(t)}traverseVisible(t){if(this.visible)return;t(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].traverseVisible(t)}traverseAncestors(t){const r=this.parent;r&&(t(r),r.traverseAncestors(t))}onBeforeRender(t,r,s,o){}render(t){}onAfterRender(t,r,s){}setSelectable(t){this.selectable=t,this.parent&&this.parent.setSelectable(t)}raycast(t,r=[]){}getByRange(t,r=!1,s=[]){if(ca.copy(t),ca.containsBox(this.boundingBoxWorld)&&s.push(this),!r||this.composeNode)return s;for(let o=0,u=this.children.length;o<u;o++)this.children[o].getByRange(t,r,s);return s}clone(t=!0,r=!1){const s=this.constructor;return new s(this.userData).copy(this,t,r)}copy(t,r=!0,s=!1){if(this.name=t.name,this.type=t.type,this.featureKey=t.featureKey,this._version=0,this.parent=t.parent,this.up.copy(t.up),this.position.copy(t.position),this.rotation.copy(t.rotation),this.scaled.copy(t.scaled),this.flipY=t.flipY,this.selectable=t.selectable,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.modelViewMatrix.copy(t.modelViewMatrix),this.normalMatrix.copy(t.normalMatrix),this.fixed=t.fixed,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.composeNode=t.composeNode,this.alignCenter=t.alignCenter,this.boundingBox.copy(t.boundingBox),this.boundingBoxWorld.copy(t.boundingBoxWorld),this.boundingBoxNeedsUpdate=t.boundingBoxNeedsUpdate,this.centerPoint.copy(t.centerPoint),this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),r)for(let o=0;o<t.children.length;o++){const u=t.children[o];this.add(u.clone(r,s))}return this}}let $0=0;const Ku=new k,ai=new ce,rf=new k,ca=new Ot,fa=new k,ju=new k,Cn=new k,G0=new k(0,1),Y0={type:"added"},Ju={type:"removed"};class Z0 extends ef{constructor(){super();d(this,"name","Scene");d(this,"type","Scene");d(this,"isScene",!0);d(this,"view");d(this,"background");d(this,"featureKey","Scene_"+this.id);d(this,"matrixAutoUpdate",!1)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}setup(t){this.view=t}render(t){var r;this.visible&&((r=this.children)==null||r.forEach(function(s){s.isShape&&s.render(t)}))}getIntersectObjects(t,r=Qe.RM,s=[]){throw new Error("must be implemented in derived")}}class X0{constructor(e,t,r){d(this,"isLoading",!1);d(this,"itemsLoaded",0);d(this,"itemsTotal",0);d(this,"urlModifier");d(this,"handlers",[]);d(this,"onStart");d(this,"onLoad");d(this,"onProgress");d(this,"onError");this.onLoad=e,this.onProgress=t,this.onError=r}itemStart(e){this.itemsTotal++,this.isLoading||this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier!==void 0?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,r=this.handlers.length;t<r;t+=2){const s=this.handlers[t],o=this.handlers[t+1];if(s.global&&(s.lastIndex=0),s.test(e))return o}return null}}const nf={enabled:!1,files:{},add:function(i,e){this.enabled&&(this.files[i]=e)},get:function(i){if(this.enabled)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}},Q0=new X0;class sf{constructor(e=Q0){d(this,"manager");d(this,"crossOrigin","anonymous");d(this,"withCredentials",!1);d(this,"path","");d(this,"resourcePath","");d(this,"requestHeader",{});this.manager=e}loadAsync(e,t){const r=this;return new Promise(function(s,o){r.load(e,s,t,o)})}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const _i={};class K0 extends Error{constructor(t,r){super(t);d(this,"response");this.response=r}}class j0 extends sf{constructor(t){super(t);d(this,"mimeType");d(this,"responseType")}load(t,r,s,o){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const u=nf.get(t);if(u!==void 0)return this.manager.itemStart(t),setTimeout(()=>{r&&r(u),this.manager.itemEnd(t)},0),u;if(_i[t]!==void 0){_i[t].push({onLoad:r,onProgress:s,onError:o});return}_i[t]=[],_i[t].push({onLoad:r,onProgress:s,onError:o});const h=new Vt.window.Request(t,{headers:new Vt.window.Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,y=this.responseType;fetch(h).then(p=>{if(p.status===200||p.status===0){if(p.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream=="undefined"||p.body===void 0||p.body.getReader===void 0)return p;const A=_i[t],T=p.body.getReader(),C=p.headers.get("Content-Length")||p.headers.get("X-File-Size"),N=C?parseInt(C):0,O=N!==0;let L=0;const P=new ReadableStream({start(W){V();function V(){T.read().then(({done:b,value:Y})=>{if(b)W.close();else{L+=Y.byteLength;const z=new ProgressEvent("progress",{lengthComputable:O,loaded:L,total:N});for(let j=0,tt=A.length;j<tt;j++){const Q=A[j];Q.onProgress&&Q.onProgress(z)}W.enqueue(Y),V()}})}}});return new Response(P)}else throw new K0(`fetch for "${p.url}" responded with ${p.status}: ${p.statusText}`,p)}).then(p=>{switch(y){case"arraybuffer":return p.arrayBuffer();case"blob":return p.blob();case"document":return p.text().then(A=>new DOMParser().parseFromString(A,c));case"json":return p.json();default:if(c===void 0)return p.text();{const T=/charset="?([^;"\s]*)"?/i.exec(c),C=T&&T[1]?T[1].toLowerCase():void 0,N=new TextDecoder(C);return p.arrayBuffer().then(O=>N.decode(O))}}}).then(p=>{nf.add(t,p);const A=_i[t];delete _i[t];for(let T=0,C=A.length;T<C;T++){const N=A[T];N.onLoad&&N.onLoad(p)}}).catch(p=>{const A=_i[t];if(A===void 0)throw this.manager.itemError(t),p;delete _i[t];for(let T=0,C=A.length;T<C;T++){const N=A[T];N.onError&&N.onError(p)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setMimeType(t){return this.mimeType=t,this}setResponseType(t){return this.responseType=t,this}}class af extends sf{constructor(e){super(e)}load(e,t,r,s){const o=this,u=new j0(o.manager);u.setPath(o.path),u.setRequestHeader(o.requestHeader),u.setWithCredentials(o.withCredentials),u.load(e,function(h){try{t&&t(h)}catch(c){s?s(c):console.error(c),o.manager.itemError(e)}},r,s)}}function pa(i,e,t){if(!i)return t;let r=t;if(typeof i.getAttribute=="function"?r=i==null?void 0:i.getAttribute(e):Object.hasOwnProperty.call(i,"attributes")&&(r=i.attributes[e]),!r)return t;if(typeof t!="undefined"){if(typeof t=="string")return r;if(typeof t=="number")return Number(r)}return r}function J0(i,e,t,r,s,o,u,h,c){let y=c*(Math.PI/180),p=Math.cos(y)*(i-t)/2+Math.sin(y)*(e-r)/2,A=-1*Math.sin(y)*(i-t)/2+Math.cos(y)*(e-r)/2,T=p*p/(u*u)+A*A/(h*h);T>1&&(u*=Math.sqrt(T),h*=Math.sqrt(T));let C=Math.sqrt((u*u*(h*h)-u*u*(A*A)-h*h*(p*p))/(u*u*(A*A)+h*h*(p*p)));s===o&&(C*=-1),isNaN(C)&&(C=0);let N=C*u*A/h,O=C*-h*p/u,L=(i+t)/2+Math.cos(y)*N-Math.sin(y)*O,P=(e+r)/2+Math.sin(y)*N+Math.cos(y)*O,W=function(Q){return Math.sqrt(Q[0]*Q[0]+Q[1]*Q[1])},V=function(Q,K){return(Q[0]*K[0]+Q[1]*K[1])/(W(Q)*W(K))},b=function(Q,K){return(Q[0]*K[1]<Q[1]*K[0]?-1:1)*Math.acos(V(Q,K))},Y=b([1,0],[(p-N)/u,(A-O)/h]),z=[(p-N)/u,(A-O)/h],j=[(-1*p-N)/u,(-1*A-O)/h],tt=b(z,j);return V(z,j)<=-1&&(tt=Math.PI),V(z,j)>=1&&(tt=0),o===0&&tt>0&&(tt=tt-2*Math.PI),o===1&&tt<0&&(tt=tt+2*Math.PI),[L,P,u,h,Y,tt,y,o]}function t2(i,e,t,r,s,o,u){const h=[],c=Math.max(Math.floor(Math.abs(o)/(Math.PI/2)),1),y=o/c;for(let p=0;p<c;p++){const A=s+p*y,T=A+y,C=Math.tan(T/4-A/4),N=Math.sin(A),O=Math.cos(A),L=Math.sin(T),P=Math.cos(T),W=i+t*O*Math.cos(u*Math.PI/180)-r*N*Math.sin(u*Math.PI/180),V=e+t*O*Math.sin(u*Math.PI/180)+r*N*Math.cos(u*Math.PI/180),b=i+t*P*Math.cos(u*Math.PI/180)-r*L*Math.sin(u*Math.PI/180),Y=e+t*P*Math.sin(u*Math.PI/180)+r*L*Math.cos(u*Math.PI/180),z=W+C*(-t*N*Math.cos(u*Math.PI/180)-r*O*Math.sin(u*Math.PI/180)),j=V+C*(-t*N*Math.sin(u*Math.PI/180)+r*O*Math.cos(u*Math.PI/180)),tt=b+C*(t*L*Math.cos(u*Math.PI/180)+r*P*Math.sin(u*Math.PI/180)),Q=Y+C*(t*L*Math.sin(u*Math.PI/180)-r*P*Math.cos(u*Math.PI/180));h.push([[W,V],[z,j],[tt,Q],[b,Y]])}return h}const fe=" ";function e2(i){let e="";Array.isArray(i)||(i=[i]);for(let t=0;t<i.length;t++){const r=i[t];if(r.type===I.CLOSE_PATH)e+="z";else if(r.type===I.HORIZ_LINE_TO)e+=(r.relative?"h":"H")+r.x;else if(r.type===I.VERT_LINE_TO)e+=(r.relative?"v":"V")+r.y;else if(r.type===I.MOVE_TO)e+=(r.relative?"m":"M")+r.x+fe+r.y;else if(r.type===I.LINE_TO)e+=(r.relative?"l":"L")+r.x+fe+r.y;else if(r.type===I.CURVE_TO)e+=(r.relative?"c":"C")+r.x1+fe+r.y1+fe+r.x2+fe+r.y2+fe+r.x+fe+r.y;else if(r.type===I.SMOOTH_CURVE_TO)e+=(r.relative?"s":"S")+r.x2+fe+r.y2+fe+r.x+fe+r.y;else if(r.type===I.QUAD_TO)e+=(r.relative?"q":"Q")+r.x1+fe+r.y1+fe+r.x+fe+r.y;else if(r.type===I.SMOOTH_QUAD_TO)e+=(r.relative?"t":"T")+r.x+fe+r.y;else if(r.type===I.ARC)e+=(r.relative?"a":"A")+r.rX+fe+r.rY+fe+r.xRot+fe+ +r.lArcFlag+fe+ +r.sweepFlag+fe+r.x+fe+r.y;else throw new Error(`Unexpected command type "${r==null?void 0:r.type}" at index ${t}.`)}return e}function tl([i,e],t){return[i*Math.cos(t)-e*Math.sin(t),i*Math.sin(t)+e*Math.cos(t)]}function Vr(...i){for(let e=0;e<i.length;e++)if(typeof i[e]!="number")throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof i[e]} == typeof ${i[e]}`);return!0}const Xi=Math.PI;function el(i,e,t){i.lArcFlag=i.lArcFlag===0?0:1,i.sweepFlag=i.sweepFlag===0?0:1;let{rX:r,rY:s}=i;const{x:o,y:u}=i;if(Math.abs(r)<1e-10||Math.abs(s)<1e-10){i.rX=0,i.rY=0,i.cX=(e+o)/2,i.cY=(t+u)/2,i.phi1=0,i.phi2=0;return}r=Math.abs(i.rX),s=Math.abs(i.rY);const h=i.xRot/180*Xi,[c,y]=tl([(e-o)/2,(t-u)/2],-h),p=Math.pow(c,2)/Math.pow(r,2)+Math.pow(y,2)/Math.pow(s,2);1<p&&(r*=Math.sqrt(p),s*=Math.sqrt(p)),i.rX=r,i.rY=s;const A=Math.pow(r,2)*Math.pow(y,2)+Math.pow(s,2)*Math.pow(c,2),T=(i.lArcFlag!==i.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(s,2)-A)/A)),C=r*y/s*T,N=-s*c/r*T,O=tl([C,N],h);i.cX=O[0]+(e+o)/2,i.cY=O[1]+(t+u)/2,i.phi1=Math.atan2((y-N)/s,(c-C)/r),i.phi2=Math.atan2((-y-N)/s,(-c-C)/r),i.sweepFlag===0&&i.phi2>i.phi1&&(i.phi2-=2*Xi),i.sweepFlag===1&&i.phi2<i.phi1&&(i.phi2+=2*Xi),i.phi1*=180/Xi,i.phi2*=180/Xi}function of(i,e,t){Vr(i,e,t);const r=i*i+e*e-t*t;if(0>r)return[];if(r===0)return[[i*t/(i*i+e*e),e*t/(i*i+e*e)]];const s=Math.sqrt(r);return[[(i*t+e*s)/(i*i+e*e),(e*t-i*s)/(i*i+e*e)],[(i*t-e*s)/(i*i+e*e),(e*t+i*s)/(i*i+e*e)]]}const Dn=Math.PI/180;function uf(i,e,t){return(1-t)*i+t*e}function lf(i,e,t,r){return i+Math.cos(r/180*Xi)*e+Math.sin(r/180*Xi)*t}function hf(i,e,t,r){const o=e-i,u=t-e,h=r-t,c=3*o+3*h-6*u,y=(u-o)*6,p=3*o;return Math.abs(c)<1e-6?Math.abs(y)<1e-6?[]:[-p/y]:r2(y/c,p/c,1e-6)}function cf(i,e,t,r,s){const o=1-s,u=o*o*o,h=3*o*o*s,c=3*o*s*s,y=s*s*s;return i*u+e*h+t*c+r*y}function r2(i,e,t=1e-6){const r=i*i/4-e;if(r<-t)return[];if(r<=t)return[-i/2];const s=Math.sqrt(r);return[-(i/2)-s,-(i/2)+s]}function i2(i,e,t){i.cX||el(i,e,t);const r=i.xRot/180*Xi;if(Math.abs(i.rX)<1e-10||Math.abs(i.rY)<1e-10)return[{relative:i.relative,type:I.CURVE_TO,x1:e+(i.x-e)/3,y1:t+(i.y-t)/3,x2:e+2*(i.x-e)/3,y2:t+2*(i.y-t)/3,x:i.x,y:i.y}];const s=Math.min(i.phi1,i.phi2),o=Math.max(i.phi1,i.phi2),u=o-s,h=Math.ceil(u/90),c=new Array(h);let y=e,p=t;const A=(T,C)=>{const[N,O]=tl([T*i.rX,C*i.rY],r);return[i.cX+N,i.cY+O]};for(let T=0;T<h;T++){const C=uf(i.phi1,i.phi2,T/h),N=uf(i.phi1,i.phi2,(T+1)/h),O=N-C,L=4/3*Math.tan(O*Dn/4),P=Math.cos(C*Dn)-L*Math.sin(C*Dn),W=Math.sin(C*Dn)+L*Math.cos(C*Dn),V=Math.cos(N*Dn),b=Math.sin(N*Dn),Y=V+L*b,z=b-L*V,j=A(P,W),tt=A(Y,z),Q=A(V,b),K={relative:i.relative,type:I.CURVE_TO,x:Q[0],y:Q[1],x1:j[0],y1:j[1],x2:tt[0],y2:tt[1]};i.relative&&(K.x1-=y,K.y1-=p,K.x2-=y,K.y2-=p,K.x-=y,K.y-=p),y=Q[0],p=Q[1],c[T]=K}return c}function rl(i,e,t){const r=e[0]-i[0],s=e[1]-i[1],o=t[0]-i[0],u=t[1]-i[1],h=r*u-s*o;if(!(Math.abs(h)<1e-10))return!1;const y=r*o+s*u,p=r*r+s*s,A=o*o+u*u;return 0<=y&&y<=A&&p<=A}function n2(i,e=!0){if(i.length<2)return i;const t=pe.INFO((o,u,h)=>{var c,y,p;return Ou(Vs({},o),{x:(c=o.x)!=null?c:u,y:(y=o.y)!=null?y:h,relative:(p=o.relative)!=null?p:!1})}),r=[];let s=[];for(const o of i){const u=t(o);u.type===I.MOVE_TO&&s.length>0&&(e?r.push(...mo(s)):r.unshift(...mo(s)),s=[]),s.push(u)}return s.length>0&&(e?r.push(...mo(s)):r.unshift(...mo(s))),r}function mo(i){var s;const e=((s=i[i.length-1])==null?void 0:s.type)===I.CLOSE_PATH,t=e?i.length-2:i.length-1,r=[{type:I.MOVE_TO,relative:!1,x:i[t].x,y:i[t].y}];for(let o=t;o>0;o--){const u=i[o],h=i[o-1];if(u.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(u.type){case I.HORIZ_LINE_TO:r.push({type:I.HORIZ_LINE_TO,relative:!1,x:h.x});break;case I.VERT_LINE_TO:r.push({type:I.VERT_LINE_TO,relative:!1,y:h.y});break;case I.LINE_TO:case I.MOVE_TO:r.push({type:I.LINE_TO,relative:!1,x:h.x,y:h.y});break;case I.CURVE_TO:r.push({type:I.CURVE_TO,relative:!1,x:h.x,y:h.y,x1:u.x2,y1:u.y2,x2:u.x1,y2:u.y1});break;case I.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case I.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case I.ARC:throw new Error("Unsupported command: A (arc)");case I.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&r.push({type:I.CLOSE_PATH}),r}function s2(i=1e13){Vr(i);function e(t){return Math.round(t*i)/i}return function(r){return"x1"in r&&typeof r.x1!="undefined"&&(r.x1=e(r.x1)),"y1"in r&&typeof r.y1!="undefined"&&(r.y1=e(r.y1)),"x2"in r&&typeof r.x2!="undefined"&&(r.x2=e(r.x2)),"y2"in r&&typeof r.y2!="undefined"&&(r.y2=e(r.y2)),"x"in r&&typeof r.x!="undefined"&&(r.x=e(r.x)),"y"in r&&typeof r.y!="undefined"&&(r.y=e(r.y)),"rX"in r&&typeof r.rX!="undefined"&&(r.rX=e(r.rX)),"rY"in r&&typeof r.rY!="undefined"&&(r.rY=e(r.rY)),r}}function ff(){return Wr((i,e,t)=>(i.relative&&(typeof i.x1!="undefined"&&(i.x1+=e),typeof i.y1!="undefined"&&(i.y1+=t),typeof i.x2!="undefined"&&(i.x2+=e),typeof i.y2!="undefined"&&(i.y2+=t),typeof i.x!="undefined"&&(i.x+=e),typeof i.y!="undefined"&&(i.y+=t),i.relative=!1),i))}function a2(){return Wr((i,e,t)=>(i.relative||(typeof i.x1!="undefined"&&(i.x1-=e),typeof i.y1!="undefined"&&(i.y1-=t),typeof i.x2!="undefined"&&(i.x2-=e),typeof i.y2!="undefined"&&(i.y2-=t),typeof i.x!="undefined"&&(i.x-=e),typeof i.y!="undefined"&&(i.y-=t),i.relative=!0),i))}function o2(i=!0,e=!0,t=!0,r=!0){return Wr((s,o,u,h,c)=>{if(isNaN(h)&&!(s.type&I.MOVE_TO))throw new Error("path must start with moveto");if(e&&s.type&I.HORIZ_LINE_TO&&(s.type=I.LINE_TO,s.y=s.relative?0:u),t&&s.type&I.VERT_LINE_TO&&(s.type=I.LINE_TO,s.x=s.relative?0:o),i&&s.type&I.CLOSE_PATH&&(s.type=I.LINE_TO,s.x=s.relative?h-o:h,s.y=s.relative?c-u:c),s.type&I.ARC&&(s.rX===0||s.rY===0)&&(s.type=I.LINE_TO,delete s.rX,delete s.rY,delete s.xRot,delete s.lArcFlag,delete s.sweepFlag),r&&s.type&I.QUAD_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x,u+s.y]:[s.x,s.y];rl(y,p,A)&&(s.type=I.LINE_TO,delete s.x1,delete s.y1)}if(r&&s.type&I.CURVE_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x2,u+s.y2]:[s.x2,s.y2],T=s.relative?[o+s.x,u+s.y]:[s.x,s.y];rl(y,p,T)&&rl(y,A,T)&&(s.type=I.LINE_TO,delete s.x1,delete s.y1,delete s.x2,delete s.y2)}return s})}function pf(){let i=NaN,e=NaN,t=NaN,r=NaN;return Wr((s,o,u)=>(s.type&I.SMOOTH_CURVE_TO&&(s.type=I.CURVE_TO,i=isNaN(i)?o:i,e=isNaN(e)?u:e,s.x1=s.relative?o-i:2*o-i,s.y1=s.relative?u-e:2*u-e),s.type&I.CURVE_TO?(i=s.relative?o+s.x2:s.x2,e=s.relative?u+s.y2:s.y2):(i=NaN,e=NaN),s.type&I.SMOOTH_QUAD_TO&&(s.type=I.QUAD_TO,t=isNaN(t)?o:t,r=isNaN(r)?u:r,s.x1=s.relative?o-t:2*o-t,s.y1=s.relative?u-r:2*u-r),s.type&I.QUAD_TO?(t=s.relative?o+s.x1:s.x1,r=s.relative?u+s.y1:s.y1):(t=NaN,r=NaN),s))}function df(){let i=NaN,e=NaN;return Wr((t,r,s)=>{if(t.type&I.SMOOTH_QUAD_TO&&(t.type=I.QUAD_TO,i=isNaN(i)?r:i,e=isNaN(e)?s:e,t.x1=t.relative?r-i:2*r-i,t.y1=t.relative?s-e:2*s-e),t.type&I.QUAD_TO){i=t.relative?r+t.x1:t.x1,e=t.relative?s+t.y1:t.y1;const o=t.x1,u=t.y1;t.type=I.CURVE_TO,t.x1=((t.relative?0:r)+o*2)/3,t.y1=((t.relative?0:s)+u*2)/3,t.x2=(t.x+o*2)/3,t.y2=(t.y+u*2)/3}else i=NaN,e=NaN;return t})}function Wr(i){let e=0,t=0,r=NaN,s=NaN;return function(u){if(isNaN(r)&&!(u.type&I.MOVE_TO))throw new Error("path must start with moveto");const h=i(u,e,t,r,s);return u.type&I.CLOSE_PATH&&(e=r,t=s),"x"in u&&typeof u.x!="undefined"&&(e=u.relative?e+u.x:u.x),"y"in u&&typeof u.y!="undefined"&&(t=u.relative?t+u.y:u.y),u.type&I.MOVE_TO&&(r=e,s=t),h}}function u2(i=0){Vr(i);let e=NaN,t=NaN,r=NaN,s=NaN;return Wr((o,u,h,c,y)=>{const p=Math.abs;let A=!1,T=0,C=0;if(o.type&I.SMOOTH_CURVE_TO&&(T=isNaN(e)?0:u-e,C=isNaN(t)?0:h-t),o.type&(I.CURVE_TO|I.SMOOTH_CURVE_TO)?(e=o.relative?u+o.x2:o.x2,t=o.relative?h+o.y2:o.y2):(e=NaN,t=NaN),o.type&I.SMOOTH_QUAD_TO?(r=isNaN(r)?u:2*u-r,s=isNaN(s)?h:2*h-s):o.type&I.QUAD_TO?(r=o.relative?u+o.x1:o.x1,s=o.relative?h+o.y1:o.y2):(r=NaN,s=NaN),o.type&I.LINE_COMMANDS||o.type&I.ARC&&(o.rX===0||o.rY===0||!o.lArcFlag)||o.type&I.CURVE_TO||o.type&I.SMOOTH_CURVE_TO||o.type&I.QUAD_TO||o.type&I.SMOOTH_QUAD_TO){const N=typeof o.x=="undefined"?0:o.relative?o.x:o.x-u,O=typeof o.y=="undefined"?0:o.relative?o.y:o.y-h;T=isNaN(r)?typeof o.x1=="undefined"?T:o.relative?o.x:o.x1-u:r-u,C=isNaN(s)?typeof o.y1=="undefined"?C:o.relative?o.y:o.y1-h:s-h;const L=typeof o.x2=="undefined"?0:o.relative?o.x:o.x2-u,P=typeof o.y2=="undefined"?0:o.relative?o.y:o.y2-h;p(N)<=i&&p(O)<=i&&p(T)<=i&&p(C)<=i&&p(L)<=i&&p(P)<=i&&(A=!0)}return o.type&I.CLOSE_PATH&&p(u-c)<=i&&p(h-y)<=i&&(A=!0),A?[]:o})}function Qi(i,e,t,r,s,o){return Vr(i,e,t,r,s,o),Wr((u,h,c,y)=>{const p=u.x1,A=u.x2,T=u.relative&&!isNaN(y),C=typeof u.x!="undefined"?u.x:T?0:h,N=typeof u.y!="undefined"?u.y:T?0:c;u.type&I.HORIZ_LINE_TO&&e!==0&&(u.type=I.LINE_TO,u.y=u.relative?0:c),u.type&I.VERT_LINE_TO&&t!==0&&(u.type=I.LINE_TO,u.x=u.relative?0:h),typeof u.x!="undefined"&&(u.x=u.x*i+N*t+(T?0:s)),typeof u.y!="undefined"&&(u.y=C*e+u.y*r+(T?0:o)),typeof u.x1!="undefined"&&(u.x1=u.x1*i+u.y1*t+(T?0:s)),typeof u.y1!="undefined"&&(u.y1=p*e+u.y1*r+(T?0:o)),typeof u.x2!="undefined"&&(u.x2=u.x2*i+u.y2*t+(T?0:s)),typeof u.y2!="undefined"&&(u.y2=A*e+u.y2*r+(T?0:o));function O(P){return P*P}const L=i*r-e*t;if(typeof u.xRot!="undefined"&&(i!==1||e!==0||t!==0||r!==1))if(L===0)delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag,u.type=I.LINE_TO;else{const P=u.xRot*Math.PI/180,W=Math.sin(P),V=Math.cos(P),b=1/O(u.rX),Y=1/O(u.rY),z=O(V)*b+O(W)*Y,j=2*W*V*(b-Y),tt=O(W)*b+O(V)*Y,Q=z*r*r-j*e*r+tt*e*e,K=j*(i*r+e*t)-2*(z*t*r+tt*i*e),rt=z*t*t-j*i*t+tt*i*i,at=(Math.atan2(K,Q-rt)+Math.PI)%Math.PI/2,ct=Math.sin(at),pt=Math.cos(at);u.rX=Math.abs(L)/Math.sqrt(Q*O(pt)+K*ct*pt+rt*O(ct)),u.rY=Math.abs(L)/Math.sqrt(Q*O(ct)-K*ct*pt+rt*O(pt)),u.xRot=at*180/Math.PI}return typeof u.sweepFlag!="undefined"&&0>L&&(u.sweepFlag=+!u.sweepFlag),u})}function l2(i,e=0,t=0){Vr(i,e,t);const r=Math.sin(i),s=Math.cos(i);return Qi(s,r,-r,s,e-e*s+t*r,t-e*r-t*s)}function h2(i,e=0){return Vr(i,e),Qi(1,0,0,1,i,e)}function c2(i,e=i){return Vr(i,e),Qi(i,0,0,e,0,0)}function f2(i){return Vr(i),Qi(1,0,Math.tan(i),1,0,0)}function p2(i){return Vr(i),Qi(1,Math.tan(i),0,1,0,0)}function d2(i=0){return Vr(i),Qi(-1,0,0,1,i,0)}function g2(i=0){return Vr(i),Qi(1,0,0,-1,0,i)}function y2(){return Wr((i,e,t)=>I.ARC===i.type?i2(i,i.relative?0:e,i.relative?0:t):i)}function m2(){return Wr((i,e,t)=>(i.relative&&(e=0,t=0),I.ARC===i.type&&el(i,e,t),i))}function gf(){return i=>Vs({},i)}function v2(){const i=gf(),e=ff(),t=df(),r=pf(),s=Wr((o,u,h)=>{const c=r(t(e(i(o))));function y(A){A>s.maxX&&(s.maxX=A),A<s.minX&&(s.minX=A)}function p(A){A>s.maxY&&(s.maxY=A),A<s.minY&&(s.minY=A)}if(c.type&I.DRAWING_COMMANDS&&(y(u),p(h)),c.type&I.HORIZ_LINE_TO&&y(c.x),c.type&I.VERT_LINE_TO&&p(c.y),c.type&I.LINE_TO&&(y(c.x),p(c.y)),c.type&I.CURVE_TO){y(c.x),p(c.y);const A=hf(u,c.x1,c.x2,c.x);for(const C of A)0<C&&1>C&&y(cf(u,c.x1,c.x2,c.x,C));const T=hf(h,c.y1,c.y2,c.y);for(const C of T)0<C&&1>C&&p(cf(h,c.y1,c.y2,c.y,C))}if(c.type&I.ARC){y(c.x),p(c.y),el(c,u,h);const A=c.xRot/180*Math.PI,T=Math.cos(A)*c.rX,C=Math.sin(A)*c.rX,N=-Math.sin(A)*c.rY,O=Math.cos(A)*c.rY,[L,P]=c.phi1<c.phi2?[c.phi1,c.phi2]:-180>c.phi2?[c.phi2+360,c.phi1+360]:[c.phi2,c.phi1],W=([Y,z])=>{const tt=Math.atan2(z,Y)*180/Math.PI;return tt<L?tt+360:tt},V=of(N,-T,0).map(W);for(const Y of V)Y>L&&Y<P&&y(lf(c.cX,T,N,Y));const b=of(O,-C,0).map(W);for(const Y of b)Y>L&&Y<P&&p(lf(c.cY,C,O,Y))}return o});return s.minX=1/0,s.maxX=-1/0,s.minY=1/0,s.maxY=-1/0,s}const pe={ROUND:s2,TO_ABS:ff,TO_REL:a2,NORMALIZE_HVZ:o2,NORMALIZE_ST:pf,QT_TO_C:df,INFO:Wr,SANITIZE:u2,MATRIX:Qi,ROTATE:l2,TRANSLATE:h2,SCALE:c2,SKEW_X:f2,SKEW_Y:p2,X_AXIS_SYMMETRY:d2,Y_AXIS_SYMMETRY:g2,A_TO_C:y2,ANNOTATE_ARCS:m2,CLONE:gf,CALCULATE_BOUNDS:v2,REVERSE_PATH:n2};let yf=class{round(e){return this.transform(pe.ROUND(e))}toAbs(){return this.transform(pe.TO_ABS())}toRel(){return this.transform(pe.TO_REL())}normalizeHVZ(e,t,r){return this.transform(pe.NORMALIZE_HVZ(e,t,r))}normalizeST(){return this.transform(pe.NORMALIZE_ST())}qtToC(){return this.transform(pe.QT_TO_C())}aToC(){return this.transform(pe.A_TO_C())}sanitize(e){return this.transform(pe.SANITIZE(e))}translate(e,t){return this.transform(pe.TRANSLATE(e,t))}scale(e,t){return this.transform(pe.SCALE(e,t))}rotate(e,t,r){return this.transform(pe.ROTATE(e,t,r))}matrix(e,t,r,s,o,u){return this.transform(pe.MATRIX(e,t,r,s,o,u))}skewX(e){return this.transform(pe.SKEW_X(e))}skewY(e){return this.transform(pe.SKEW_Y(e))}xSymmetry(e){return this.transform(pe.X_AXIS_SYMMETRY(e))}ySymmetry(e){return this.transform(pe.Y_AXIS_SYMMETRY(e))}annotateArcs(){return this.transform(pe.ANNOTATE_ARCS())}};const x2=i=>i===" "||i===" "||i==="\r"||i===`
33
- `,mf=i=>48<=i.charCodeAt(0)&&i.charCodeAt(0)<=57;let E2=class extends yf{constructor(){super();d(this,"curNumber","");d(this,"curCommandType",-1);d(this,"curCommandRelative",!1);d(this,"canParseCommandOrComma",!0);d(this,"curNumberHasExp",!1);d(this,"curNumberHasExpDigits",!1);d(this,"curNumberHasDecimal",!1);d(this,"curArgs",[])}finish(t=[]){if(this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,r=[]){const s=o=>{r.push(o),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let o=0;o<t.length;o++){const u=t[o],h=this.curCommandType===I.ARC&&(this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber.length===1&&(this.curNumber==="0"||this.curNumber==="1"),c=mf(u)&&(this.curNumber==="0"&&u==="0"||h);if(mf(u)&&!c){this.curNumber+=u,this.curNumberHasExpDigits=this.curNumberHasExp;continue}if(u==="e"||u==="E"){this.curNumber+=u,this.curNumberHasExp=!0;continue}if((u==="-"||u==="+")&&this.curNumberHasExp&&!this.curNumberHasExpDigits){this.curNumber+=u;continue}if(u==="."&&!this.curNumberHasExp&&!this.curNumberHasDecimal&&!h){this.curNumber+=u,this.curNumberHasDecimal=!0;continue}if(this.curNumber&&this.curCommandType!==-1){const y=Number(this.curNumber);if(isNaN(y))throw new SyntaxError(`Invalid number ending at ${o}`);if(this.curCommandType===I.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>y)throw new SyntaxError(`Expected positive number, got "${y}" at index "${o}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${o}"`)}this.curArgs.push(y),this.curArgs.length===A2[this.curCommandType]&&(I.HORIZ_LINE_TO===this.curCommandType?s({type:I.HORIZ_LINE_TO,relative:this.curCommandRelative,x:y}):I.VERT_LINE_TO===this.curCommandType?s({type:I.VERT_LINE_TO,relative:this.curCommandRelative,y}):this.curCommandType===I.MOVE_TO||this.curCommandType===I.LINE_TO||this.curCommandType===I.SMOOTH_QUAD_TO?(s({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),I.MOVE_TO===this.curCommandType&&(this.curCommandType=I.LINE_TO)):this.curCommandType===I.CURVE_TO?s({type:I.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===I.SMOOTH_CURVE_TO?s({type:I.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===I.QUAD_TO?s({type:I.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===I.ARC&&s({type:I.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!x2(u)){if(u===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(u==="+"||u==="-"||u==="."){this.curNumber=u,this.curNumberHasDecimal=u===".";continue}if(c){this.curNumber=u,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${o}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${u}" at index ${o}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,u==="z"||u==="Z"){r.push({type:I.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(u==="h"||u==="H")this.curCommandType=I.HORIZ_LINE_TO,this.curCommandRelative=u==="h";else if(u==="v"||u==="V")this.curCommandType=I.VERT_LINE_TO,this.curCommandRelative=u==="v";else if(u==="m"||u==="M")this.curCommandType=I.MOVE_TO,this.curCommandRelative=u==="m";else if(u==="l"||u==="L")this.curCommandType=I.LINE_TO,this.curCommandRelative=u==="l";else if(u==="c"||u==="C")this.curCommandType=I.CURVE_TO,this.curCommandRelative=u==="c";else if(u==="s"||u==="S")this.curCommandType=I.SMOOTH_CURVE_TO,this.curCommandRelative=u==="s";else if(u==="q"||u==="Q")this.curCommandType=I.QUAD_TO,this.curCommandRelative=u==="q";else if(u==="t"||u==="T")this.curCommandType=I.SMOOTH_QUAD_TO,this.curCommandRelative=u==="t";else if(u==="a"||u==="A")this.curCommandType=I.ARC,this.curCommandRelative=u==="a";else throw new SyntaxError(`Unexpected character "${u}" at index ${o}.`)}}return r}transform(t){return Object.create(this,{parse:{value(s,o=[]){const u=Object.getPrototypeOf(this).parse.call(this,s);for(const h of u){const c=t(h);Array.isArray(c)?o.push(...c):o.push(c)}return o}}})}},I=(Ft=class extends yf{constructor(t){super();d(this,"commands");typeof t=="string"?this.commands=Ft.parse(t):this.commands=t}encode(){return Ft.encode(this.commands)}getBounds(){const t=pe.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const r=[];for(const s of this.commands){const o=t(s);Array.isArray(o)?r.push(...o):r.push(o)}return this.commands=r,this}reverse(t=!0){return this.commands=pe.REVERSE_PATH(this.commands,t),this}static encode(t){return e2(t)}static parse(t){const r=new E2,s=[];return r.parse(t,s),r.finish(s),s}},d(Ft,"CLOSE_PATH",1),d(Ft,"MOVE_TO",2),d(Ft,"HORIZ_LINE_TO",4),d(Ft,"VERT_LINE_TO",8),d(Ft,"LINE_TO",16),d(Ft,"CURVE_TO",32),d(Ft,"SMOOTH_CURVE_TO",64),d(Ft,"QUAD_TO",128),d(Ft,"SMOOTH_QUAD_TO",256),d(Ft,"ARC",512),d(Ft,"LINE_COMMANDS",Ft.LINE_TO|Ft.HORIZ_LINE_TO|Ft.VERT_LINE_TO),d(Ft,"DRAWING_COMMANDS",Ft.HORIZ_LINE_TO|Ft.VERT_LINE_TO|Ft.LINE_TO|Ft.CURVE_TO|Ft.SMOOTH_CURVE_TO|Ft.QUAD_TO|Ft.SMOOTH_QUAD_TO|Ft.ARC),Ft);const A2={[I.MOVE_TO]:2,[I.LINE_TO]:2,[I.HORIZ_LINE_TO]:1,[I.VERT_LINE_TO]:1,[I.CLOSE_PATH]:0,[I.QUAD_TO]:4,[I.SMOOTH_QUAD_TO]:2,[I.CURVE_TO]:6,[I.SMOOTH_CURVE_TO]:4,[I.ARC]:7},de=" ";function b2(i){let e="";Array.isArray(i)||(i=[i]);for(let t=0;t<i.length;t++){const r=i[t];if(r.type===q.CLOSE_PATH)e+="z";else if(r.type===q.HORIZ_LINE_TO)e+=(r.relative?"h":"H")+r.x;else if(r.type===q.VERT_LINE_TO)e+=(r.relative?"v":"V")+r.y;else if(r.type===q.MOVE_TO)e+=(r.relative?"m":"M")+r.x+de+r.y;else if(r.type===q.LINE_TO)e+=(r.relative?"l":"L")+r.x+de+r.y;else if(r.type===q.CURVE_TO)e+=(r.relative?"c":"C")+r.x1+de+r.y1+de+r.x2+de+r.y2+de+r.x+de+r.y;else if(r.type===q.SMOOTH_CURVE_TO)e+=(r.relative?"s":"S")+r.x2+de+r.y2+de+r.x+de+r.y;else if(r.type===q.QUAD_TO)e+=(r.relative?"q":"Q")+r.x1+de+r.y1+de+r.x+de+r.y;else if(r.type===q.SMOOTH_QUAD_TO)e+=(r.relative?"t":"T")+r.x+de+r.y;else if(r.type===q.ARC)e+=(r.relative?"a":"A")+r.rX+de+r.rY+de+r.xRot+de+ +r.lArcFlag+de+ +r.sweepFlag+de+r.x+de+r.y;else throw new Error(`Unexpected command type "${r==null?void 0:r.type}" at index ${t}.`)}return e}class vf{round(e){return this.transform(ae.ROUND(e))}toAbs(){return this.transform(ae.TO_ABS())}toRel(){return this.transform(ae.TO_REL())}normalizeHVZ(e,t,r){return this.transform(ae.NORMALIZE_HVZ(e,t,r))}normalizeST(){return this.transform(ae.NORMALIZE_ST())}qtToC(){return this.transform(ae.QT_TO_C())}aToC(){return this.transform(ae.A_TO_C())}sanitize(e){return this.transform(ae.SANITIZE(e))}translate(e,t){return this.transform(ae.TRANSLATE(e,t))}scale(e,t){return this.transform(ae.SCALE(e,t))}rotate(e,t,r){return this.transform(ae.ROTATE(e,t,r))}matrix(e,t,r,s,o,u){return this.transform(ae.MATRIX(e,t,r,s,o,u))}skewX(e){return this.transform(ae.SKEW_X(e))}skewY(e){return this.transform(ae.SKEW_Y(e))}xSymmetry(e){return this.transform(ae.X_AXIS_SYMMETRY(e))}ySymmetry(e){return this.transform(ae.Y_AXIS_SYMMETRY(e))}annotateArcs(){return this.transform(ae.ANNOTATE_ARCS())}}const w2=i=>i===" "||i===" "||i==="\r"||i===`
34
- `,xf=i=>48<=i.charCodeAt(0)&&i.charCodeAt(0)<=57;class T2 extends vf{constructor(){super(),this.curNumber="",this.curCommandType=-1,this.curCommandRelative=!1,this.canParseCommandOrComma=!0,this.curNumberHasExp=!1,this.curNumberHasExpDigits=!1,this.curNumberHasDecimal=!1,this.curArgs=[]}finish(e=[]){if(this.parse(" ",e),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return e}parse(e,t=[]){const r=s=>{t.push(s),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let s=0;s<e.length;s++){const o=e[s],u=this.curCommandType===q.ARC&&(this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber.length===1&&(this.curNumber==="0"||this.curNumber==="1"),h=xf(o)&&(this.curNumber==="0"&&o==="0"||u);if(xf(o)&&!h){this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp;continue}if(o==="e"||o==="E"){this.curNumber+=o,this.curNumberHasExp=!0;continue}if((o==="-"||o==="+")&&this.curNumberHasExp&&!this.curNumberHasExpDigits){this.curNumber+=o;continue}if(o==="."&&!this.curNumberHasExp&&!this.curNumberHasDecimal&&!u){this.curNumber+=o,this.curNumberHasDecimal=!0;continue}if(this.curNumber&&this.curCommandType!==-1){const c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError(`Invalid number ending at ${s}`);if(this.curCommandType===q.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError(`Expected positive number, got "${c}" at index "${s}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${s}"`)}this.curArgs.push(c),this.curArgs.length===_2[this.curCommandType]&&(q.HORIZ_LINE_TO===this.curCommandType?r({type:q.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):q.VERT_LINE_TO===this.curCommandType?r({type:q.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===q.MOVE_TO||this.curCommandType===q.LINE_TO||this.curCommandType===q.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),q.MOVE_TO===this.curCommandType&&(this.curCommandType=q.LINE_TO)):this.curCommandType===q.CURVE_TO?r({type:q.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===q.SMOOTH_CURVE_TO?r({type:q.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===q.QUAD_TO?r({type:q.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===q.ARC&&r({type:q.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!w2(o)){if(o===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(o==="+"||o==="-"||o==="."){this.curNumber=o,this.curNumberHasDecimal=o===".";continue}if(h){this.curNumber=o,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${s}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${o}" at index ${s}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,o==="z"||o==="Z"){t.push({type:q.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(o==="h"||o==="H")this.curCommandType=q.HORIZ_LINE_TO,this.curCommandRelative=o==="h";else if(o==="v"||o==="V")this.curCommandType=q.VERT_LINE_TO,this.curCommandRelative=o==="v";else if(o==="m"||o==="M")this.curCommandType=q.MOVE_TO,this.curCommandRelative=o==="m";else if(o==="l"||o==="L")this.curCommandType=q.LINE_TO,this.curCommandRelative=o==="l";else if(o==="c"||o==="C")this.curCommandType=q.CURVE_TO,this.curCommandRelative=o==="c";else if(o==="s"||o==="S")this.curCommandType=q.SMOOTH_CURVE_TO,this.curCommandRelative=o==="s";else if(o==="q"||o==="Q")this.curCommandType=q.QUAD_TO,this.curCommandRelative=o==="q";else if(o==="t"||o==="T")this.curCommandType=q.SMOOTH_QUAD_TO,this.curCommandRelative=o==="t";else if(o==="a"||o==="A")this.curCommandType=q.ARC,this.curCommandRelative=o==="a";else throw new SyntaxError(`Unexpected character "${o}" at index ${s}.`)}}return t}transform(e){return Object.create(this,{parse:{value(r,s=[]){const o=Object.getPrototypeOf(this).parse.call(this,r);for(const u of o){const h=e(u);Array.isArray(h)?s.push(...h):s.push(h)}return s}}})}}const Wt=class Wt extends vf{constructor(e){super(),typeof e=="string"?this.commands=Wt.parse(e):this.commands=e}encode(){return Wt.encode(this.commands)}getBounds(){const e=ae.CALCULATE_BOUNDS();return this.transform(e),e}transform(e){const t=[];for(const r of this.commands){const s=e(r);Array.isArray(s)?t.push(...s):t.push(s)}return this.commands=t,this}reverse(e=!0){return this.commands=ae.REVERSE_PATH(this.commands,e),this}static encode(e){return b2(e)}static parse(e){const t=new T2,r=[];return t.parse(e,r),t.finish(r),r}};Wt.CLOSE_PATH=1,Wt.MOVE_TO=2,Wt.HORIZ_LINE_TO=4,Wt.VERT_LINE_TO=8,Wt.LINE_TO=16,Wt.CURVE_TO=32,Wt.SMOOTH_CURVE_TO=64,Wt.QUAD_TO=128,Wt.SMOOTH_QUAD_TO=256,Wt.ARC=512,Wt.LINE_COMMANDS=Wt.LINE_TO|Wt.HORIZ_LINE_TO|Wt.VERT_LINE_TO,Wt.DRAWING_COMMANDS=Wt.HORIZ_LINE_TO|Wt.VERT_LINE_TO|Wt.LINE_TO|Wt.CURVE_TO|Wt.SMOOTH_CURVE_TO|Wt.QUAD_TO|Wt.SMOOTH_QUAD_TO|Wt.ARC;let q=Wt;const _2={[q.MOVE_TO]:2,[q.LINE_TO]:2,[q.HORIZ_LINE_TO]:1,[q.VERT_LINE_TO]:1,[q.CLOSE_PATH]:0,[q.QUAD_TO]:4,[q.SMOOTH_QUAD_TO]:2,[q.CURVE_TO]:6,[q.SMOOTH_CURVE_TO]:4,[q.ARC]:7};function il([i,e],t){return[i*Math.cos(t)-e*Math.sin(t),i*Math.sin(t)+e*Math.cos(t)]}function zr(...i){for(let e=0;e<i.length;e++)if(typeof i[e]!="number")throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof i[e]} == typeof ${i[e]}`);return!0}const Ki=Math.PI;function nl(i,e,t){i.lArcFlag=i.lArcFlag===0?0:1,i.sweepFlag=i.sweepFlag===0?0:1;let{rX:r,rY:s}=i;const{x:o,y:u}=i;if(Math.abs(r)<1e-10||Math.abs(s)<1e-10){i.rX=0,i.rY=0,i.cX=(e+o)/2,i.cY=(t+u)/2,i.phi1=0,i.phi2=0;return}r=Math.abs(i.rX),s=Math.abs(i.rY);const h=i.xRot/180*Ki,[c,y]=il([(e-o)/2,(t-u)/2],-h),p=Math.pow(c,2)/Math.pow(r,2)+Math.pow(y,2)/Math.pow(s,2);1<p&&(r*=Math.sqrt(p),s*=Math.sqrt(p)),i.rX=r,i.rY=s;const A=Math.pow(r,2)*Math.pow(y,2)+Math.pow(s,2)*Math.pow(c,2),T=(i.lArcFlag!==i.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(s,2)-A)/A)),C=r*y/s*T,N=-s*c/r*T,O=il([C,N],h);i.cX=O[0]+(e+o)/2,i.cY=O[1]+(t+u)/2,i.phi1=Math.atan2((y-N)/s,(c-C)/r),i.phi2=Math.atan2((-y-N)/s,(-c-C)/r),i.sweepFlag===0&&i.phi2>i.phi1&&(i.phi2-=2*Ki),i.sweepFlag===1&&i.phi2<i.phi1&&(i.phi2+=2*Ki),i.phi1*=180/Ki,i.phi2*=180/Ki}function Ef(i,e,t){zr(i,e,t);const r=i*i+e*e-t*t;if(0>r)return[];if(r===0)return[[i*t/(i*i+e*e),e*t/(i*i+e*e)]];const s=Math.sqrt(r);return[[(i*t+e*s)/(i*i+e*e),(e*t-i*s)/(i*i+e*e)],[(i*t-e*s)/(i*i+e*e),(e*t+i*s)/(i*i+e*e)]]}const Sn=Math.PI/180;function Af(i,e,t){return(1-t)*i+t*e}function bf(i,e,t,r){return i+Math.cos(r/180*Ki)*e+Math.sin(r/180*Ki)*t}function wf(i,e,t,r){const o=e-i,u=t-e,h=r-t,c=3*o+3*h-6*u,y=(u-o)*6,p=3*o;return Math.abs(c)<1e-6?Math.abs(y)<1e-6?[]:[-p/y]:C2(y/c,p/c,1e-6)}function Tf(i,e,t,r,s){const o=1-s,u=o*o*o,h=3*o*o*s,c=3*o*s*s,y=s*s*s;return i*u+e*h+t*c+r*y}function C2(i,e,t=1e-6){const r=i*i/4-e;if(r<-t)return[];if(r<=t)return[-i/2];const s=Math.sqrt(r);return[-(i/2)-s,-(i/2)+s]}function D2(i,e,t){i.cX||nl(i,e,t);const r=i.xRot/180*Ki;if(Math.abs(i.rX)<1e-10||Math.abs(i.rY)<1e-10)return[{relative:i.relative,type:q.CURVE_TO,x1:e+(i.x-e)/3,y1:t+(i.y-t)/3,x2:e+2*(i.x-e)/3,y2:t+2*(i.y-t)/3,x:i.x,y:i.y}];const s=Math.min(i.phi1,i.phi2),o=Math.max(i.phi1,i.phi2),u=o-s,h=Math.ceil(u/90),c=new Array(h);let y=e,p=t;const A=(T,C)=>{const[N,O]=il([T*i.rX,C*i.rY],r);return[i.cX+N,i.cY+O]};for(let T=0;T<h;T++){const C=Af(i.phi1,i.phi2,T/h),N=Af(i.phi1,i.phi2,(T+1)/h),O=N-C,L=4/3*Math.tan(O*Sn/4),P=Math.cos(C*Sn)-L*Math.sin(C*Sn),W=Math.sin(C*Sn)+L*Math.cos(C*Sn),V=Math.cos(N*Sn),b=Math.sin(N*Sn),Y=V+L*b,z=b-L*V,j=A(P,W),tt=A(Y,z),Q=A(V,b),K={relative:i.relative,type:q.CURVE_TO,x:Q[0],y:Q[1],x1:j[0],y1:j[1],x2:tt[0],y2:tt[1]};i.relative&&(K.x1-=y,K.y1-=p,K.x2-=y,K.y2-=p,K.x-=y,K.y-=p),y=Q[0],p=Q[1],c[T]=K}return c}function sl(i,e,t){const r=e[0]-i[0],s=e[1]-i[1],o=t[0]-i[0],u=t[1]-i[1],h=r*u-s*o;if(!(Math.abs(h)<1e-10))return!1;const y=r*o+s*u,p=r*r+s*s,A=o*o+u*u;return 0<=y&&y<=A&&p<=A}function S2(i,e=!0){if(i.length<2)return i;const t=ae.INFO((o,u,h)=>{var c,y,p;return Ou(Vs({},o),{x:(c=o.x)!=null?c:u,y:(y=o.y)!=null?y:h,relative:(p=o.relative)!=null?p:!1})}),r=[];let s=[];for(const o of i){const u=t(o);u.type===q.MOVE_TO&&s.length>0&&(e?r.push(...vo(s)):r.unshift(...vo(s)),s=[]),s.push(u)}return s.length>0&&(e?r.push(...vo(s)):r.unshift(...vo(s))),r}function vo(i){var s;const e=((s=i[i.length-1])==null?void 0:s.type)===q.CLOSE_PATH,t=e?i.length-2:i.length-1,r=[{type:q.MOVE_TO,relative:!1,x:i[t].x,y:i[t].y}];for(let o=t;o>0;o--){const u=i[o],h=i[o-1];if(u.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(u.type){case q.HORIZ_LINE_TO:r.push({type:q.HORIZ_LINE_TO,relative:!1,x:h.x});break;case q.VERT_LINE_TO:r.push({type:q.VERT_LINE_TO,relative:!1,y:h.y});break;case q.LINE_TO:case q.MOVE_TO:r.push({type:q.LINE_TO,relative:!1,x:h.x,y:h.y});break;case q.CURVE_TO:r.push({type:q.CURVE_TO,relative:!1,x:h.x,y:h.y,x1:u.x2,y1:u.y2,x2:u.x1,y2:u.y1});break;case q.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case q.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case q.ARC:throw new Error("Unsupported command: A (arc)");case q.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&r.push({type:q.CLOSE_PATH}),r}function O2(i=1e13){zr(i);function e(t){return Math.round(t*i)/i}return function(r){return"x1"in r&&typeof r.x1!="undefined"&&(r.x1=e(r.x1)),"y1"in r&&typeof r.y1!="undefined"&&(r.y1=e(r.y1)),"x2"in r&&typeof r.x2!="undefined"&&(r.x2=e(r.x2)),"y2"in r&&typeof r.y2!="undefined"&&(r.y2=e(r.y2)),"x"in r&&typeof r.x!="undefined"&&(r.x=e(r.x)),"y"in r&&typeof r.y!="undefined"&&(r.y=e(r.y)),"rX"in r&&typeof r.rX!="undefined"&&(r.rX=e(r.rX)),"rY"in r&&typeof r.rY!="undefined"&&(r.rY=e(r.rY)),r}}function _f(){return $r((i,e,t)=>(i.relative&&(typeof i.x1!="undefined"&&(i.x1+=e),typeof i.y1!="undefined"&&(i.y1+=t),typeof i.x2!="undefined"&&(i.x2+=e),typeof i.y2!="undefined"&&(i.y2+=t),typeof i.x!="undefined"&&(i.x+=e),typeof i.y!="undefined"&&(i.y+=t),i.relative=!1),i))}function M2(){return $r((i,e,t)=>(i.relative||(typeof i.x1!="undefined"&&(i.x1-=e),typeof i.y1!="undefined"&&(i.y1-=t),typeof i.x2!="undefined"&&(i.x2-=e),typeof i.y2!="undefined"&&(i.y2-=t),typeof i.x!="undefined"&&(i.x-=e),typeof i.y!="undefined"&&(i.y-=t),i.relative=!0),i))}function L2(i=!0,e=!0,t=!0,r=!0){return $r((s,o,u,h,c)=>{if(isNaN(h)&&!(s.type&q.MOVE_TO))throw new Error("path must start with moveto");if(e&&s.type&q.HORIZ_LINE_TO&&(s.type=q.LINE_TO,s.y=s.relative?0:u),t&&s.type&q.VERT_LINE_TO&&(s.type=q.LINE_TO,s.x=s.relative?0:o),i&&s.type&q.CLOSE_PATH&&(s.type=q.LINE_TO,s.x=s.relative?h-o:h,s.y=s.relative?c-u:c),s.type&q.ARC&&(s.rX===0||s.rY===0)&&(s.type=q.LINE_TO,delete s.rX,delete s.rY,delete s.xRot,delete s.lArcFlag,delete s.sweepFlag),r&&s.type&q.QUAD_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x,u+s.y]:[s.x,s.y];sl(y,p,A)&&(s.type=q.LINE_TO,delete s.x1,delete s.y1)}if(r&&s.type&q.CURVE_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x2,u+s.y2]:[s.x2,s.y2],T=s.relative?[o+s.x,u+s.y]:[s.x,s.y];sl(y,p,T)&&sl(y,A,T)&&(s.type=q.LINE_TO,delete s.x1,delete s.y1,delete s.x2,delete s.y2)}return s})}function Cf(){let i=NaN,e=NaN,t=NaN,r=NaN;return $r((s,o,u)=>(s.type&q.SMOOTH_CURVE_TO&&(s.type=q.CURVE_TO,i=isNaN(i)?o:i,e=isNaN(e)?u:e,s.x1=s.relative?o-i:2*o-i,s.y1=s.relative?u-e:2*u-e),s.type&q.CURVE_TO?(i=s.relative?o+s.x2:s.x2,e=s.relative?u+s.y2:s.y2):(i=NaN,e=NaN),s.type&q.SMOOTH_QUAD_TO&&(s.type=q.QUAD_TO,t=isNaN(t)?o:t,r=isNaN(r)?u:r,s.x1=s.relative?o-t:2*o-t,s.y1=s.relative?u-r:2*u-r),s.type&q.QUAD_TO?(t=s.relative?o+s.x1:s.x1,r=s.relative?u+s.y1:s.y1):(t=NaN,r=NaN),s))}function Df(){let i=NaN,e=NaN;return $r((t,r,s)=>{if(t.type&q.SMOOTH_QUAD_TO&&(t.type=q.QUAD_TO,i=isNaN(i)?r:i,e=isNaN(e)?s:e,t.x1=t.relative?r-i:2*r-i,t.y1=t.relative?s-e:2*s-e),t.type&q.QUAD_TO){i=t.relative?r+t.x1:t.x1,e=t.relative?s+t.y1:t.y1;const o=t.x1,u=t.y1;t.type=q.CURVE_TO,t.x1=((t.relative?0:r)+o*2)/3,t.y1=((t.relative?0:s)+u*2)/3,t.x2=(t.x+o*2)/3,t.y2=(t.y+u*2)/3}else i=NaN,e=NaN;return t})}function $r(i){let e=0,t=0,r=NaN,s=NaN;return function(u){if(isNaN(r)&&!(u.type&q.MOVE_TO))throw new Error("path must start with moveto");const h=i(u,e,t,r,s);return u.type&q.CLOSE_PATH&&(e=r,t=s),"x"in u&&typeof u.x!="undefined"&&(e=u.relative?e+u.x:u.x),"y"in u&&typeof u.y!="undefined"&&(t=u.relative?t+u.y:u.y),u.type&q.MOVE_TO&&(r=e,s=t),h}}function N2(i=0){zr(i);let e=NaN,t=NaN,r=NaN,s=NaN;return $r((o,u,h,c,y)=>{const p=Math.abs;let A=!1,T=0,C=0;if(o.type&q.SMOOTH_CURVE_TO&&(T=isNaN(e)?0:u-e,C=isNaN(t)?0:h-t),o.type&(q.CURVE_TO|q.SMOOTH_CURVE_TO)?(e=o.relative?u+o.x2:o.x2,t=o.relative?h+o.y2:o.y2):(e=NaN,t=NaN),o.type&q.SMOOTH_QUAD_TO?(r=isNaN(r)?u:2*u-r,s=isNaN(s)?h:2*h-s):o.type&q.QUAD_TO?(r=o.relative?u+o.x1:o.x1,s=o.relative?h+o.y1:o.y2):(r=NaN,s=NaN),o.type&q.LINE_COMMANDS||o.type&q.ARC&&(o.rX===0||o.rY===0||!o.lArcFlag)||o.type&q.CURVE_TO||o.type&q.SMOOTH_CURVE_TO||o.type&q.QUAD_TO||o.type&q.SMOOTH_QUAD_TO){const N=typeof o.x=="undefined"?0:o.relative?o.x:o.x-u,O=typeof o.y=="undefined"?0:o.relative?o.y:o.y-h;T=isNaN(r)?typeof o.x1=="undefined"?T:o.relative?o.x:o.x1-u:r-u,C=isNaN(s)?typeof o.y1=="undefined"?C:o.relative?o.y:o.y1-h:s-h;const L=typeof o.x2=="undefined"?0:o.relative?o.x:o.x2-u,P=typeof o.y2=="undefined"?0:o.relative?o.y:o.y2-h;p(N)<=i&&p(O)<=i&&p(T)<=i&&p(C)<=i&&p(L)<=i&&p(P)<=i&&(A=!0)}return o.type&q.CLOSE_PATH&&p(u-c)<=i&&p(h-y)<=i&&(A=!0),A?[]:o})}function ji(i,e,t,r,s,o){return zr(i,e,t,r,s,o),$r((u,h,c,y)=>{const p=u.x1,A=u.x2,T=u.relative&&!isNaN(y),C=typeof u.x!="undefined"?u.x:T?0:h,N=typeof u.y!="undefined"?u.y:T?0:c;u.type&q.HORIZ_LINE_TO&&e!==0&&(u.type=q.LINE_TO,u.y=u.relative?0:c),u.type&q.VERT_LINE_TO&&t!==0&&(u.type=q.LINE_TO,u.x=u.relative?0:h),typeof u.x!="undefined"&&(u.x=u.x*i+N*t+(T?0:s)),typeof u.y!="undefined"&&(u.y=C*e+u.y*r+(T?0:o)),typeof u.x1!="undefined"&&(u.x1=u.x1*i+u.y1*t+(T?0:s)),typeof u.y1!="undefined"&&(u.y1=p*e+u.y1*r+(T?0:o)),typeof u.x2!="undefined"&&(u.x2=u.x2*i+u.y2*t+(T?0:s)),typeof u.y2!="undefined"&&(u.y2=A*e+u.y2*r+(T?0:o));function O(P){return P*P}const L=i*r-e*t;if(typeof u.xRot!="undefined"&&(i!==1||e!==0||t!==0||r!==1))if(L===0)delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag,u.type=q.LINE_TO;else{const P=u.xRot*Math.PI/180,W=Math.sin(P),V=Math.cos(P),b=1/O(u.rX),Y=1/O(u.rY),z=O(V)*b+O(W)*Y,j=2*W*V*(b-Y),tt=O(W)*b+O(V)*Y,Q=z*r*r-j*e*r+tt*e*e,K=j*(i*r+e*t)-2*(z*t*r+tt*i*e),rt=z*t*t-j*i*t+tt*i*i,at=(Math.atan2(K,Q-rt)+Math.PI)%Math.PI/2,ct=Math.sin(at),pt=Math.cos(at);u.rX=Math.abs(L)/Math.sqrt(Q*O(pt)+K*ct*pt+rt*O(ct)),u.rY=Math.abs(L)/Math.sqrt(Q*O(ct)-K*ct*pt+rt*O(pt)),u.xRot=at*180/Math.PI}return typeof u.sweepFlag!="undefined"&&0>L&&(u.sweepFlag=+!u.sweepFlag),u})}function B2(i,e=0,t=0){zr(i,e,t);const r=Math.sin(i),s=Math.cos(i);return ji(s,r,-r,s,e-e*s+t*r,t-e*r-t*s)}function I2(i,e=0){return zr(i,e),ji(1,0,0,1,i,e)}function R2(i,e=i){return zr(i,e),ji(i,0,0,e,0,0)}function P2(i){return zr(i),ji(1,0,Math.tan(i),1,0,0)}function F2(i){return zr(i),ji(1,Math.tan(i),0,1,0,0)}function k2(i=0){return zr(i),ji(-1,0,0,1,i,0)}function H2(i=0){return zr(i),ji(1,0,0,-1,0,i)}function U2(){return $r((i,e,t)=>q.ARC===i.type?D2(i,i.relative?0:e,i.relative?0:t):i)}function q2(){return $r((i,e,t)=>(i.relative&&(e=0,t=0),q.ARC===i.type&&nl(i,e,t),i))}function Sf(){return i=>Vs({},i)}function V2(){const i=Sf(),e=_f(),t=Df(),r=Cf(),s=$r((o,u,h)=>{const c=r(t(e(i(o))));function y(A){A>s.maxX&&(s.maxX=A),A<s.minX&&(s.minX=A)}function p(A){A>s.maxY&&(s.maxY=A),A<s.minY&&(s.minY=A)}if(c.type&q.DRAWING_COMMANDS&&(y(u),p(h)),c.type&q.HORIZ_LINE_TO&&y(c.x),c.type&q.VERT_LINE_TO&&p(c.y),c.type&q.LINE_TO&&(y(c.x),p(c.y)),c.type&q.CURVE_TO){y(c.x),p(c.y);const A=wf(u,c.x1,c.x2,c.x);for(const C of A)0<C&&1>C&&y(Tf(u,c.x1,c.x2,c.x,C));const T=wf(h,c.y1,c.y2,c.y);for(const C of T)0<C&&1>C&&p(Tf(h,c.y1,c.y2,c.y,C))}if(c.type&q.ARC){y(c.x),p(c.y),nl(c,u,h);const A=c.xRot/180*Math.PI,T=Math.cos(A)*c.rX,C=Math.sin(A)*c.rX,N=-Math.sin(A)*c.rY,O=Math.cos(A)*c.rY,[L,P]=c.phi1<c.phi2?[c.phi1,c.phi2]:-180>c.phi2?[c.phi2+360,c.phi1+360]:[c.phi2,c.phi1],W=([Y,z])=>{const tt=Math.atan2(z,Y)*180/Math.PI;return tt<L?tt+360:tt},V=Ef(N,-T,0).map(W);for(const Y of V)Y>L&&Y<P&&y(bf(c.cX,T,N,Y));const b=Ef(O,-C,0).map(W);for(const Y of b)Y>L&&Y<P&&p(bf(c.cY,C,O,Y))}return o});return s.minX=1/0,s.maxX=-1/0,s.minY=1/0,s.maxY=-1/0,s}const ae={ROUND:O2,TO_ABS:_f,TO_REL:M2,NORMALIZE_HVZ:L2,NORMALIZE_ST:Cf,QT_TO_C:Df,INFO:$r,SANITIZE:N2,MATRIX:ji,ROTATE:B2,TRANSLATE:I2,SCALE:R2,SKEW_X:P2,SKEW_Y:F2,X_AXIS_SYMMETRY:k2,Y_AXIS_SYMMETRY:H2,A_TO_C:U2,ANNOTATE_ARCS:q2,CLONE:Sf,CALCULATE_BOUNDS:V2,REVERSE_PATH:S2};class Gr{static destroy(){this.cached.clear(),this.cachedCanvas.clear()}static createCanvas(e){var s;if(!((s=Vt.window)!=null&&s.document))throw new Error("environment not support");let t;e.containerId&&(t=Vt.window.document.getElementById(e.containerId)),t||(t=Vt.window.document.getElementsByTagName("body")[0]);let r;if(e.canvasId&&(r=Vt.window.document.getElementById(e.canvasId)||void 0),e.width||(e.width=(t==null?void 0:t.offsetWidth)||100),e.height||(e.height=(t==null?void 0:t.offsetHeight)||100),e.dpr||(e.dpr=Vt.dpr),r)this.resizeCanvas(r,e.width,e.height,e.dpr);else{if(r=this.createHtmlCanvas(e.width,e.height,e.dpr),!r)throw new Error("error environment");e.canvasId&&r.setAttribute("id",e.canvasId),t==null||t.appendChild(r)}return r.style.background=e.background||"transparent",r}static getContext2D(e,t={}){const r={alpha:!0,willReadFrequently:!!t.willReadFrequently},s=e.getContext("2d",r);if(!s)throw new Error("getContext2D error");return s.scale(t.dpr||1,t.dpr||1),s}static resizeCanvas(e,t,r,s=1){e instanceof OffscreenCanvas?(e.width=t,e.height=r):e instanceof HTMLCanvasElement&&(e.setAttribute("width",(t*s).toString()),e.setAttribute("height",(r*s).toString()),e.style.width=t+"px",e.style.height=r+"px",e.style.padding="0",e.style.margin="0",e.style.border="0",e.style.imageRendering="pixelated",e.style.transform="translateZ(0)")}static getImageBitmapByCanvasAsync(e){return Tt(this,null,function*(){if(e)return e instanceof OffscreenCanvas?e.transferToImageBitmap():e instanceof HTMLCanvasElement?yield createImageBitmap(e):void 0})}static get(e,t,r,s=1){let o=this.cached.get(e);return o||(o=this.create(t,r,s),this.set(e,o)),this.resizeCanvas(o,t,r,s),o}static set(e,t){if(!e||!t)throw new Error("error input");return this.cached.set(e,t)}static remove(e){this.cached.has(e)&&this.cached.delete(e)}static create(e,t,r=1){var s;if((s=Vt.window)!=null&&s.OffscreenCanvas)return new OffscreenCanvas(e,t);throw new Error("environment does not support")}static createHtmlCanvas(e,t,r=1){if(!Vt.window.document)throw new Error("environment does not support");const s=Vt.window.document.createElement("canvas");return this.resizeCanvas(s,e,t,r),s}static measureText(e,t,r=new k){if(!e)throw new Error("input error");const o=this.get("measureText",1,1).getContext("2d");if(!o)throw new Error("bufferCtx not found");t.render(o);const u=o.measureText(e);if(!u)throw new Error("measureText error");const h=u.actualBoundingBoxRight+u.actualBoundingBoxLeft,c=u.actualBoundingBoxAscent+u.actualBoundingBoxDescent;return r.set(h,c),r}}d(Gr,"cached",new Map),d(Gr,"cachedCanvas",new Map);let W2=0;class xo extends I{constructor(t={}){var r;super(t.commands);d(this,"name","Geo2");d(this,"id",++W2);d(this,"params");d(this,"viewMatrix",new ce);d(this,"boundingBox",new Ot);d(this,"flipY",!1);d(this,"renderPath");d(this,"_version",0);typeof t.flipY!="undefined"&&(this.flipY=!!t.flipY),this.params=t,(r=this.commands)!=null&&r.length&&this.toAbs(),t.flipY&&this.scale(1,-1)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}setFromPoints(t){return t!=null&&t.length?(this.params.points=t,this.recomputePath(),this):this}recomputePath(){throw new Error("must be implemented in derived")}computeBoundingBox(){var t;this.boundingBox.makeEmpty(),yt.identity();for(let r=0,s=((t=this.commands)==null?void 0:t.length)||0;r<s;r++){const o=this.commands[r];switch(o.type){case I.MOVE_TO:this.boundingBox.expandByXY(o.x,o.y),yt.set(o.x,o.y);break;case I.LINE_TO:this.boundingBox.expandByXY(o.x,o.y),yt.set(o.x,o.y);break;case I.ARC:typeof o.xRot=="undefined"?(this.boundingBox.expandByXY(o.x,o.y),Ci.set(o.x,o.y).addScalar(-o.rX),this.boundingBox.expandByPoint(Ci),Ci.set(o.x,o.y).addScalar(o.rX),this.boundingBox.expandByPoint(Ci)):this.boundingBox.expandByXY(o.x,o.y),yt.set(o.x,o.y);break;case I.HORIZ_LINE_TO:this.boundingBox.expandByXY(o.x,yt.y),yt.set(o.x,yt.y);break;case I.VERT_LINE_TO:this.boundingBox.expandByXY(yt.x,o.y),yt.set(yt.x,o.y);break;case I.QUAD_TO:this.boundingBox.expandByXY(o.x,o.y),yt.set(o.x,o.y);break}}return this.boundingBox}render(t,r){if(this.renderPath=new Path2D,!(!t||!(r!=null&&r.length))){yt.identity();for(let s=0,o=(r==null?void 0:r.length)||0;s<o;s++){const u=r[s];switch(u.type){case I.MOVE_TO:this.renderPath.moveTo(u.x,u.y),yt.set(u.x,u.y);break;case I.LINE_TO:this.renderPath.lineTo(u.x,u.y),yt.set(u.x,u.y);break;case I.ARC:this.renderPath.arc(u.x,u.y,u.rX,u.phi1||0,u.phi2||Math.PI*2,u.sweepFlag!==1),yt.set(u.x,u.y);break;case I.HORIZ_LINE_TO:this.renderPath.lineTo(u.x,yt.y),yt.set(u.x,yt.y);break;case I.VERT_LINE_TO:this.renderPath.lineTo(yt.x,u.y),yt.set(yt.x,u.y);break;case I.CURVE_TO:this.renderPath.bezierCurveTo(u.x1,u.y1,u.x2,u.y2,u.x,u.y),yt.set(u.x,u.y);break;case I.SMOOTH_CURVE_TO:yt.set(u.x,u.y);break;case I.QUAD_TO:yt.set(u.x,u.y);break;case I.SMOOTH_QUAD_TO:yt.set(u.x,u.y);break}}}}applyMatrix(t){return this.needsUpdate=!0,this.matrix(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),this}getRenderCommands(t){var u;const r=[];for(let h=0,c=((u=this.commands)==null?void 0:u.length)||0;h<c;h++)r.push(Object.assign({},this.commands[h]));if(!t)return r;yt.identity();const s=ae.MATRIX(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),o=[];for(let h=0,c=r.length;h<c;h++){const y=r[h],p=s(y);if(p.type===I.ARC){let[A,T,C,N,O,L,P,W]=J0(yt.x,yt.y,p.x,p.y,p.lArcFlag,p.sweepFlag,p.rX,p.rY,0);if(yt.set(p.x,p.y),p.rX===p.rY&&typeof p.xRot!="undefined")p.x=A,p.y=T,p.rx=C>N?C:N,p.phi1=O,p.phi2=O+L;else if(p.rX===p.rY)t.getScale(Ci),p.rX=p.rY*Math.abs(Ci.x),(p.phi1!==0||p.phi2!==Math.PI*2)&&(t.getRotation(Ci),p.phi1+=Ci.x,p.phi2+=Ci.x);else{const V=t2(A,T,C,N,O,L,P);if(!(V!=null&&V.length))break;p.type=I.MOVE_TO,p.x=A,p.y=T;for(let b=0,Y=V.length;b<Y;b++)o.push({type:I.CURVE_TO,x1:V[b][1][0],y1:V[b][1][1],x2:V[b][2][0],y2:V[b][2][1],x:V[b][3][0],y:V[b][3][1]})}}else yt.set(p.x||yt.x,p.y||yt.y);Array.isArray(p)?o.push(...p):o.push(p)}return o}copy(t){return this.commands=Rt.cloneDeep(t.commands),this.version=0,this}clone(){const t=this.constructor;return new t(this.params).copy(this)}getConvexHull(){var r,s;const t=[];if(!((r=this.commands)!=null&&r.length))return t;for(let o=0,u=((s=this.commands)==null?void 0:s.length)||0;o<u;o++){const h=this.commands[o];switch(h.type){case I.MOVE_TO:t.push({x:h.x,y:h.y}),yt.set(h.x,h.y);break;case I.LINE_TO:t.push({x:h.x,y:h.y}),yt.set(h.x,h.y);break;case I.ARC:t.push({x:h.x,y:h.y}),yt.set(h.x,h.y);break;case I.HORIZ_LINE_TO:t.push({x:h.x,y:yt.y}),yt.set(h.x,yt.y);break;case I.VERT_LINE_TO:t.push({x:yt.x,y:h.y}),yt.set(yt.x,h.y);break;case I.CURVE_TO:case I.SMOOTH_CURVE_TO:t.push({x:h.x,y:h.y}),yt.set(h.x,h.y);break;case I.QUAD_TO:case I.SMOOTH_QUAD_TO:t.push({x:h.x,y:h.y}),yt.set(h.x,h.y);break}}return t}isPointInBoundingBox(t){return this.boundingBox?this.boundingBox.containsPoint(t):!1}isPointInPath(t){if(this.renderPath){Ji.save(),Ji.beginPath(),Ji.lineWidth=5,Ji.stroke(this.renderPath),Ji.fill(this.renderPath),Ji.closePath();const r=Ji.isPointInPath(this.renderPath,t.x,t.y);return Ji.restore(),r}return!1}}const yt=new k,Ci=new k,Ji=Gr.get("RAY_CASTER",10,10).getContext("2d");class z2 extends xo{constructor(t={}){t.commands||(t.commands=[]);super(t);d(this,"isCircle",!0);d(this,"radius",1);d(this,"start",0);d(this,"end",Math.PI*2);typeof t.radius!="undefined"&&(this.radius=t.radius),typeof t.start!="undefined"&&(this.start=t.start),typeof t.end!="undefined"&&(this.end=t.end),this.recomputePath()}recomputePath(){var s,o,u;if(!((o=(s=this.params)==null?void 0:s.points)!=null&&o.length))return this;const t=this.params.points,r=[];for(let h=0,c=t.length;h<c;h++)r.push({type:I.MOVE_TO,x:t[h].x+this.radius,y:t[h].y*(this.params.flipY?-1:1),relative:!1}),r.push({type:I.ARC,rX:this.radius,rY:this.radius,xRot:void 0,lArcFlag:0,sweepFlag:((u=this.params)==null?void 0:u.sweepFlag)||1,phi1:this.start,phi2:this.end,x:t[h].x,y:t[h].y*(this.params.flipY?-1:1),relative:!1});return this.commands=r,this}}class Of{constructor(e={}){d(this,"params");this.params=e}destroy(){}static getInstanceByElement(e,t=!1){if(!e)return;let r;switch(e.nodeName){case"path":r=this.getInstanceByPath(e,t);break;case"circle":r=this.getInstanceByCircle(e,t);break}return r||console.error(`unsupported: ${e}`),r}static getInstanceByPath(e,t=!1){if(!e)return;const r=pa(e,"d");if(!r)return;const s=r.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""),o=s.match(/([Mm][^Mm]*)/g);if(!o||o.length<=this.splitLimit)try{return new xo({commands:s,flipY:t})}catch(h){console.error(`getInstanceByPath error: ${h}: ${s}`);return}const u=[];for(let h=0,c=o.length;h<c;h+=this.splitLimit){const p=o.slice(h,h+this.splitLimit).join(" ");try{u.push(new xo({commands:p,flipY:t}))}catch(A){console.error(`getInstanceByPath error: ${A}`)}}return u}static getInstanceByCircle(e,t=!1){if(!e||e.nodeName!=="circle")return;Mf.set(pa(e,"cx",0),pa(e,"cy",0));const r=pa(e,"r",0);return new z2({points:[Mf.clone()],radius:r,flipY:t})}static getInstance(e,t=!1){if(e)return new xo({commands:e,flipY:t})}}d(Of,"splitLimit",100);const Mf=new k;class $2{constructor(){d(this,"svg");d(this,"offset",new k);d(this,"svgRoot");d(this,"layers",[]);d(this,"elementsMap",{});d(this,"boundingBoxMap",{});d(this,"boundingBox",new Ot);d(this,"svgSkeletons",[]);d(this,"data");d(this,"_exceptTypes",["view"]);d(this,"_exceptIds",["viewer","mirror"]);d(this,"_lvi",0);d(this,"_lastLinked",[])}bindSvg(e){return this.svg=e,this.svgRoot=Xc(this.svg),this.layers=this.getLayers(2),this.elementsMap={},this.boundingBoxMap={},this.boundingBox.makeEmpty(),this.getElementsMap(this.svg,this.elementsMap),this}getLayers(e){var t;if(!this.svg)throw new Error("please bind svg first");return e===2&&((t=this.layers)!=null&&t.length)?this.layers:(this.layers=this._getSvgLayer(this.svg,e),this.layers)}_getSvgLayer(e,t=0,r=0,s=[]){var h;let o,u=e.id;if(this._exceptTypes.includes(e.tagName)||e.tagName==="defs")return this._lvi--,s;if(t&&this._lvi>t)return s;u&&!this._exceptIds.includes(u)&&(o={value:u,label:u,children:[]},s.push(o)),this._lvi++;for(let c=0,y=e.children.length;c<y;c++)o?this._getSvgLayer(e.children[c],t,this._lvi,o.children):this._getSvgLayer(e.children[c],t,this._lvi,s);return((h=o==null?void 0:o.children)==null?void 0:h.length)===0&&delete o.children,this._lvi=r,s}getElementsMap(e,t={}){return this.traverseSvg(e,r=>{r!==e&&r.id&&(t[r.id]=r)}),t}computeBoundingBoxMap(){var t;if(Object.keys(this.boundingBoxMap).length)return this.boundingBoxMap;let e=(t=this.svg)==null?void 0:t.getBoundingClientRect();return e&&this.offset.set(e.left,e.top),this.traverseSvg(this.svg,r=>{if(!r.id)return;if(r.tagName==="use"){const u=this.getUseSymbolId(r);if(!u)return;const h=this.boundingBoxMap[u];if(h&&!h.isEmpty()){Di.set(Number(r.getAttribute("x")||"0"),Number(r.getAttribute("y")||"0")),Eo.composeSvgTransform(Di.x,Di.y,r.getAttribute("transform"));const p=new Ot().copy(h).applyMatrix3(Eo);this.boundingBoxMap[r.id]=p;return}const c=this.getUseElementBoundingBoxWithSymbol(r);if(!c)return;this.boundingBoxMap[u]=c,Di.set(Number(r.getAttribute("x")||"0"),Number(r.getAttribute("y")||"0")),Eo.composeSvgTransform(Di.x,Di.y,r.getAttribute("transform"));const y=new Ot().copy(c).applyMatrix3(Eo);this.boundingBoxMap[r.id]=y,this.boundingBox.expandByBox(y);return}if(typeof r.getBBox!="function")return;const s=r.getBBox();if((!s.width||!s.height)&&r.tagName==="path"){const u=Of.getInstanceByPath(r);if(!Array.isArray(u)){const h=u==null?void 0:u.computeBoundingBox();if(!h||h.isEmpty())return;h.getSize(Di),s.x=h.min.x,s.y=h.max.y,s.width=Di.x,s.height=Di.y}}if(!s.width||!s.height)return;const o=new Ot(new k(s.x,s.y),new k(s.x+s.width,s.y+s.height));this.boundingBoxMap[r.id]=o.round(),this.boundingBox.expandByBox(o)}),this.boundingBoxMap}getLayerVisible(e){var r;const t=this.getElementById(e);if(t)return((r=t.style)==null?void 0:r.display)!=="none"}updateLayersVisibility(e,t=!1,r=!0){if(!this.elementsMap)throw new Error("please bind svg first");r&&this._updateAllLayersVisibility(!t),e!=null&&e.length||(e=["background"]);for(let s=0,o=e.length;s<o;s++){const u=this.getElementById(e[s]);u&&this._updateLayersVisibility(u,t,!0,!0)}}_updateAllLayersVisibility(e=!1){Object.values(this.elementsMap).forEach(t=>{t.tagName==="svg"||t.tagName==="symbol"||!t.getAttribute("id")||(t.style.display=e?"block":"none")})}_updateLayersVisibility(e,t=!1,r=!1,s=!1){var o,u;if(!(!e||e.tagName==="svg"||!e.getAttribute("id"))){if(e.style.display=t?"block":"none",r&&t){let h=e.parentElement;for(;h&&h.tagName!=="svg";)h.style.display=t?"block":"none",h=h.parentElement}if(s&&((o=e.children)==null?void 0:o.length)>0)for(let h=0,c=(u=e.children)==null?void 0:u.length;h<c;h++)this._updateLayersVisibility(e.children[h],t,!1,!0)}}updateVisibilityByAssetType(e,t=!1,r){r||(r=Yc[e]),this.updateLayersVisibility(r,!t)}updateVisibilityByAssetTypes(e,t=!1,r){if(Array.isArray(e)||(e=[e]),!!(e!=null&&e.length))for(let s=0,o=e.length;s<o;s++)this.updateVisibilityByAssetType(e[s],t,r)}getElementById(e){if(!this.elementsMap)throw new Error("please bind svg first");return this.elementsMap[e]}getElementBoundingBox(e){return this.boundingBoxMap[e]}findSkeletonByPath(e=[]){let t=0,r;const s=Object.keys(this.elementsMap);for(let o=0,u=s.length;o<u;o++){const h=this.elementsMap[s[o]];if(!h)continue;const c=h.getAttribute("d");c&&(c.length<t||(t=c.length,r=h.id?h:h.parent))}return r&&e.push(r),e}setTextInChildren2(e,t){var s;let r;((s=e==null?void 0:e.children)==null?void 0:s.length)<2?(r=Zu("text"),r.setAttribute("dy","1em"),e.appendChild(r)):r=e.children[e.children.length-1],r.innerHTML=t}traverseSvg(e,t){var r;if(!this._exceptTypes.includes(e.tagName)&&!(e.tagName!=="svg"&&e.tagName!=="defs"&&!e.id)&&!(e.tagName==="g"&&((r=e.children)==null?void 0:r.length)===0)){this._exceptIds.includes(e.id)||t(e);for(let s=0,o=e.children.length;s<o;s++)this.traverseSvg(e.children[s],t)}}traverseSvgTLayers(e,t){var r;if(Array.isArray(e)){for(let s=0,o=e.length;s<o;s++)this.traverseSvgTLayers(e[s],t);return}if(t(e),!!((r=e.children)!=null&&r.length))for(let s=0,o=e.children.length;s<o;s++)this.traverseSvgTLayers(e.children[s],t)}getLabelElementsByType(e,t={}){const r=this.getElementById(la(e));return r&&this.getElementsMap(r,t),t}getLabelElementById(e,t="rm"){if(!e)return;const r=this.getElementById(e);if(!r)return;let s=r.getAttribute("aid");return s||(s="l-"+t+"-"+e),this.getElementById(s)}setLabelsById(e,t,r="rm"){var u,h;const s=this.getLabelElementById(e,r);if(!s)return;const o=((u=s.children)==null?void 0:u.length)||0;for(let c=0,y=((t==null?void 0:t.length)||0)-(o-1);c<y;c++){const p=Zu("text");p.setAttribute("x","0"),p.setAttribute("y",o+c+"em"),s.appendChild(p)}for(let c=1,y=(h=s.children)==null?void 0:h.length;c<y;c++)s.children[c].textContent=t&&c<=t.length?t[c-1]:""}clearAssetLabelsByType(e="rm"){var s;const t=this.getLabelElementsByType(e),r=Rt.keys(t);for(let o=0,u=r.length;o<u;o++){const h=t[r[o]];for(let c=1,y=((s=h.children)==null?void 0:s.length)||0;c<y;c++)h.children[c].textContent=""}}getUseSymbolId(e){var t;if(!(!e||e.tagName!=="use"))return(t=e.getAttribute("xlink:href"))==null?void 0:t.substring(1)}getUseSymbol(e){if(!e||e.tagName!=="use")return;const t=this.getUseSymbolId(e);if(t)return this.getElementById(t)}setElementState2selected(e,t=!1){var s;if(!e)return;if(e.tagName==="use"){const o=this._getSymbolBox(e);if(!o)return;t?(s=e.parentNode)==null||s.insertBefore(o,e):e.parentNode&&e.parentNode.contains(o)&&e.parentNode.removeChild(o);return}let r=e.getAttribute("class");r||(r=""),t?r="danger":r=Rt.replace(r,"danger","").trim(),e.setAttribute("class",r)}_getSymbolBox(e){if(!e)return;const t=e.id+"-boundingBox";let r=this.getElementById(t);if(r)return r;const s=this.getUseSymbol(e);if(!s)return;let o=this.getElementBoundingBox(e.id);if(!o||o.isEmpty())return;r=document.createElementNS("http://www.w3.org/2000/svg","rect"),r.setAttribute("id",t),r.setAttribute("class","danger"),r.setAttribute("x",o.min.x.toString()),r.setAttribute("y",o.min.y.toString());const u=new k;return o.getSize(u),r.setAttribute("width",u.x.toString()),r.setAttribute("height",u.y.toString()),s.getAttribute("transform")&&r.setAttribute("transform",s.getAttribute("transform")||""),s.getAttribute("style")&&r.setAttribute("style",s.getAttribute("style")||""),this.elementsMap[t]=r,r}getUseElementBoundingBoxWithSymbol(e){var c;if(!e)return;const t=(c=e.getAttribute("xlink:href"))==null?void 0:c.substring(1);if(!t)return;let r=this.getElementById(t);if(!r)return;const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px";let o;if(Rt.lowerCase(r.tagName)==="symbol"){o=document.createElementNS("http://www.w3.org/2000/svg","g");for(let y=0,p=r.childNodes.length;y<p;y++){const A=r.childNodes[y].cloneNode(!0);o.appendChild(A)}}else o=r.cloneNode(!0);s.appendChild(o),o.setAttribute("style","stroke: #333333;"),document.body.appendChild(s);const u=s.getBBox();if(document.body.removeChild(s),!u)return;const h=new Ot;return h.set(new k(u.x,u.y),new k(u.x+u.width,u.y+u.height)),h}fontZoom(e,t=1){const r=this.getElementById(e);if(!r)return;let s=r.getAttribute("font-size");s||(s="12");const o=/(\d+)([a-zA-Z%]+)/.exec(s),u=o&&(o==null?void 0:o.length)>2?o[2]:"";let h=Math.round(parseFloat(s)*t*100)/100;r.setAttribute("font-size",h+u)}strokeWidthChanged(e=1){var y,p;const t=(y=this.svg)==null?void 0:y.querySelector("#mirror");if(!t){console.error("Cannot find g SVGElement with ID mirror");return}let r=(p=pa(t,"stroke-width"))!=null?p:"1em";const s=String(r).match(/^([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(%|[a-z]*)$/i);if(!s){console.error("Invalid stroke-width format:",r);return}const o=parseFloat(s[1]),u=s[2]||"em",h=o*e,c=Number.isInteger(h)?h.toFixed(0):h.toString().replace(/\.?0+$/,"");t.setAttribute("stroke-width",`${c}${u}`),u==="em"&&(this.fontZoom("background-labels",1),this.fontZoom("asset-labels",1),t.style.fontSize=`${c}${u}`)}getCentroid(e,t=new k){const r=e.getAttribute("insX"),s=e.getAttribute("insY");return r||s?t.set(Number(r||"0"),Number(s||"0")):this.getCentroidByDom(e,t)}getCentroidByDom(e,t=new k){const r=Number(e.getAttribute("x")||"0"),s=Number(e.getAttribute("y")||"0"),o=e.getBBox();let u=1,h=1,c=e.getAttribute("transform");if(!c)return t.set(r,s);const y=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(c);if(typeof y=="undefined"||y==null){const p=e.transform.baseVal;if(c&&p.numberOfItems>0){let A=p.getItem(0);A&&A.type===SVGTransform.SVG_TRANSFORM_SCALE&&(u=A.matrix.a!==0?A.matrix.a:1,h=A.matrix.d!==0?A.matrix.d:u)}else return t.set((o.x+o.width/2)*u,(o.y+o.height/2)*h)}else u=y[1]&&Number(y[1])>0?Number(y[1]):1,h=y[2]&&Number(y[2])>0?Number(y[2]):u;return r&&s?t.set(r*u,s*h):t.set((o.x+o.width/2)*u,(o.y+o.height/2)*h),t}linkAssetsByTree(e,t){if(e||(e=Qe.RM),this.clearLinkedLines(e),!t||!t.value)return;const r=this.getLinesByTree(t);this.drawLinkedLines(e,r)}clearLinkedLines(e){var s;const t=fs(e);if(this.getElementById(t)){for(let o=((s=this._lastLinked)==null?void 0:s.length)-1;o>=0;o--){const u=this._lastLinked[o];u.parentNode&&u.parentNode.removeChild(u),this._lastLinked.splice(o,1)}this._lastLinked.length=0}}drawLinkedLines(e,t){var o;if(!(t!=null&&t.length))return;const r=fs(e),s=this.getElementById(r);if(s)for(let u=0,h=t.length;u<h;u++){const c=t[u][0],y=t[u][((o=t[u])==null?void 0:o.length)-1],p=Zu("line");p.setAttribute("x1",c.x.toString()),p.setAttribute("y1",c.y.toString()),p.setAttribute("x2",y.x.toString()),p.setAttribute("y2",y.y.toString()),p.setAttribute("class","danger"),p.setAttribute("style","stroke-width: 2;"),s.appendChild(p),this._lastLinked.push(p)}}getLinesByTree(e,t=[]){var o;if(!(e!=null&&e.value))return t;const r=this.getElementBoundingBox(e.value);if(!r)return t;const s=r.getCenter();return(o=e.children)==null||o.forEach(u=>{var y;const h=this.getElementBoundingBox(u==null?void 0:u.value);if(!h)return;const c=h.getCenter();t.push([s,c]),(y=u.children)!=null&&y.length&&this.getLinesByTree(u,t)}),t}}const Di=new k,Eo=new ce;class G2{constructor(e={},t){d(this,"name","SvgPainter");d(this,"params");d(this,"chef");this.params=e,this.chef=t}drawSocialDistanceCircles(e,t="http://www.w3.org/2000/svg"){var C,N,O;if(!e)return;const r=F0(e),s=Zc(e),o=2*r,u=(N=(C=this.params.socialDistance)==null?void 0:C.colors)!=null&&N.length?(O=this.params.socialDistance)==null?void 0:O.colors:[Qt.green,Qt.red],h=this.getRadius(s),c=e.querySelector(`#${Xu}`),y=c==null?void 0:c.querySelectorAll("path");if(!c||!(y!=null&&y.length))return;let p,A;const T=new Array;for(let L=0,P=(y==null?void 0:y.length)||0;L<P;L++){if(p=y[L],A=p.getAttribute("id"),!A)continue;const W=this.chef.getElementBoundingBox(A);if(!W)continue;const V=new k;W.getCenter(V),T.push({id:A,cp:V})}for(let L=0,P=T.length;L<P;L++){T[L].color=u[0];for(let W=0,V=P;W<V;W++)T[L]!==T[W]&&k.getDistance(T[L].cp,T[W].cp)<h*2&&(T[L].color=u[1])}for(let L=0,P=T.length;L<P;L++){let W=this.createCircle(T[L],h,o,t);c.appendChild(W)}}clearSocialDistanceCircles(e){if(!e)return;const t=e.querySelector(`#${Xu}`),r=t==null?void 0:t.querySelectorAll("circle");if(!(!t||!(r!=null&&r.length)))for(let s=0,o=(r==null?void 0:r.length)||0;s<o;s++){const u=r[s].getAttribute("id");u&&(u==null?void 0:u.indexOf("_circle"))>-1&&t.removeChild(r[s])}}getRadius(e){var r,s,o;let t=((s=(r=this.params)==null?void 0:r.socialDistance)==null?void 0:s.radius)||3;return((o=this.params)==null?void 0:o.displayUnits)==="imperial"?e==="Metres"||e==="m"?t/=3.28084:e==="cm"?t=t/3.28084*100:e==="mm"?t=t/3.28084*1e3:(e==="INCH"||e==="inches")&&(t*=12):e==="INCH"||e==="inches"?t=t*3.28084*12:e==="cm"?t*=100:e==="mm"&&(t*=1e3),t}createCircle(e,t,r,s){const o=document.createElementNS(s,"circle");return o.setAttributeNS(null,"id",e.id+"_circle"),o.setAttributeNS(null,"cx",e.cp.x),o.setAttributeNS(null,"cy",e.cp.y),o.setAttributeNS(null,"r",String(t)),o.setAttributeNS(null,"style",`pointer-events:none;fill-opacity:0.1;stroke:${e.color};stroke-width:${r}px;`),o}}const Y2=function(i){return(i||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")};function Ao(i,e){if(!i||!e)return!1;if(e.indexOf(" ")!==-1)throw new Error("className should not contain space.");return i.classList?i.classList.contains(e):(" "+i.className+" ").indexOf(" "+e+" ")>-1}function da(i,e){if(!i)return;let t=i.className;const r=(e||"").split(" ");for(let s=0,o=r.length;s<o;s++){const u=r[s];u&&(i.classList?i.classList.add(u):Ao(i,u)||(t+=" "+u))}i.classList||(i.className=t)}function ga(i,e){if(!i||!e)return;const t=e.split(" ");let r=" "+i.className+" ";for(let s=0,o=t.length;s<o;s++){const u=t[s];u&&(i.classList?i.classList.remove(u):Ao(i,u)&&(r=r.replace(" "+u+" "," ")))}i.classList||(i.className=Y2(r))}class al extends Z0{constructor(t={}){super();d(this,"isSvgScene",!0);d(this,"name","SvgScene");d(this,"dynamically",!0);d(this,"params");d(this,"socialDistanceEnable",!1);d(this,"container");d(this,"svg");d(this,"svgStr","");d(this,"svgRoot");d(this,"viewBox",new Ot);d(this,"chef");d(this,"defaultLayers",[]);d(this,"skeletonLayers",[]);d(this,"currentLayers",[]);d(this,"assetType");d(this,"assetsMap",{});d(this,"legend",[]);d(this,"selectedList",[]);d(this,"painter");d(this,"_lastHighlightType","");d(this,"_lastHighlightIds",[]);d(this,"clickSvgElementHandler",this.handleClickSvgElement.bind(this));d(this,"_lastLinkedIds",[]);this.params=t,this.assetType=t.assetType||Qe.RM,this.params.socialDistanceEnable&&(this.socialDistanceEnable=!0),this.container=this.params.containerId?document.getElementById(this.params.containerId):Vt.window.document.getElementsByTagName("body")[0],this.chef=new $2,this.painter=new G2(t,this.chef)}get isMounted(){var t;return((t=this.container.querySelectorAll("svg"))==null?void 0:t.length)>0}destroy(){var t;super.destroy(),this.unmount(),(t=this.camera)==null||t.destroy()}mount(){this.svg&&(this.container.contains(this.svg)||this.container.appendChild(this.svg),this.chef.computeBoundingBoxMap())}unmount(){this.svg&&this.svg.parentNode&&this.container.contains(this.svg)&&this.container.removeChild(this.svg)}computeBoundingBox(){return this.boundingBox.makeEmpty(),!this.chef||!this.svg?this.boundingBox:(this.chef.computeBoundingBoxMap(),this.boundingBox.copy(this.chef.boundingBox),console.warn("svgScene.computeBoundingBox: ",this.chef.boundingBox.toString()),this.boundingBox)}load(t){return Tt(this,null,function*(){return new af().loadAsync(t)})}bind(t){this.svgStr=t;const r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;return this.bindSvg(r),!0}bindSvg(t){if(this.svg=t,!this.svg)throw new Error("svg load failed");let r=this.svg.getAttribute("viewBox");r&&(k0(r,this.viewBox),this.chef.bindSvg(this.svg),this.svgRoot=Xc(this.svg),this.svg.setAttribute("viewBox",`0 0 ${this.params.width} ${this.params.height}`),this.svg.setAttribute("style","transform: translateZ(0);"),this.appendStyles(),console.log(this.name,"viewBox -> ",r,this.viewBox.toString()),this.setAssetsMap(this.assetType,this.assetsMap))}recompute(t){t&&(this.bindSvg(t),this.computeBoundingBox(),this.viewBox.copy(this.boundingBox))}appendStyles(){var r;let t=(r=this.svg)==null?void 0:r.querySelector("style");t&&(t.appendChild(document.createTextNode(`.default { stroke: ${this.params.defaultStroke}; fill: ${this.params.defaultFill}; }`)),t.appendChild(document.createTextNode(`.info { stroke: ${this.params.infoStroke}; fill: ${this.params.infoFill}; }`)),t.appendChild(document.createTextNode(`.primary { stroke: ${this.params.primaryStroke}; fill: ${this.params.primaryFill}; }`)),t.appendChild(document.createTextNode(`.success { stroke: ${this.params.successStroke}; fill: ${this.params.successFill}; }`)),t.appendChild(document.createTextNode(`.warning { stroke: ${this.params.warningStroke}; fill: ${this.params.warningFill}; }`)),t.appendChild(document.createTextNode(`.danger { stroke: ${this.params.dangerStroke}; fill: ${this.params.dangerFill}; }`)),t.appendChild(document.createTextNode(`.active { stroke: ${this.params.activeStroke}; fill: ${this.params.activeFill}; }`)),t.appendChild(document.createTextNode(`text { font-family: ${this.params.fontFamily||"simhei"}; }`)))}getLayers(t=2){return this.svg?this.chef.getLayers(t):[]}setDefaultLayers(t){t!=null&&t.length&&(this.defaultLayers=t)}setSkeletonLayers(t){t!=null&&t.length&&(this.skeletonLayers=t)}setCurrentLayers(t){t!=null&&t.length&&(this.currentLayers=t)}showDefaultLayers(t,r=!1){this.setDefaultLayers(t),this.chef.updateLayersVisibility(t,r)}getLayerVisible(t){return this.chef.getLayerVisible(t)}updateLayersVisibility(t,r=!1,s=!0){this.chef.updateLayersVisibility(t,r,s)}setAssetType(t,r){this.assetsMap={},this.assetType=t,this.setAssetsMap(this.assetType,this.assetsMap),r||(r=[fs(t)],t!==Qe.RM&&r.unshift(fs(Qe.RM))),this.setDefaultLayers(r),this.updateLayersVisibility(this.defaultLayers,!0)}isBelongsToAssetType(t,r){r||(r=this.assetType);const s=this.getAssetsByType(r);return s?!!(s!=null&&s.hasOwnProperty(t)):!1}setAssetsMap(t,r={}){const s=this.chef.getElementById(fs(t));if(!s)return r;r[t]=this.chef.getElementsMap(s);const o=la(t),u=this.chef.getElementById(o);if(!u)return r;const h=this.chef.getElementsMap(u),c=Rt.keys(h);if(!(c!=null&&c.length))return r;if(Rt.startsWith(c[0],`l-${t}-`)){const y=`l-${t}-`.length;for(let p=0,A=c.length;p<A;p++){const T=c[p].slice(y);h[T]=h[c[p]],delete h[c[p]]}}return r[o]=h,r}getAssetsByType(t){return this.assetsMap.hasOwnProperty(t)||this.setAssetsMap(t,this.assetsMap),this.assetsMap[t]}getElementById(t){if(!t)return;const r=this.getAssetsByType(this.assetType);if(!(!r||!Object.hasOwnProperty.call(r,t)))return r[t]}getAssetIdsByType(t){const r=this.getAssetsByType(t),s=[];return r?Rt.keys(r):s}clearFillOrStroke(t="fill"){const r=this.getAssetsByType(this.assetType);if(!r)return;const s=Rt.keys(r);let o;for(let u=0,h=s.length;u<h;u++)o=r[s[u]],o&&(o.hasAttribute(t)&&o.removeAttribute(t),t==="stroke"&&o.removeAttribute("stroke-width"));this.clearLegendBy(t)}clearFillOrStrokeByIds(t,r="fill"){const s=this.getAssetsByType(this.assetType);if(!s)return;const o=Rt.keys(s);let u;for(let h=0,c=o.length;h<c;h++)t!=null&&t.length&&!t.includes(o[h])||(u=s[o[h]],!(!u||!u.hasAttribute(r))&&(u.removeAttribute(r),r==="stroke"&&u.removeAttribute("stroke-width")));this.clearLegendBy(r)}setFillOrStrokeByIds(t,r,s="fill",o="7em"){const u=this.getAssetsByType(this.assetType);if(!u)return;const h=Rt.keys(u);let c;for(let y=0,p=h.length;y<p;y++)t.includes(h[y])&&(c=u[h[y]],c&&(c.setAttribute(s,r),s==="stroke"&&c.setAttribute("stroke-width",o),this.addLegend(s,r,h[y])))}addLegend(t,r,s){let o=this.legend.find(u=>u.color===r);o||(o={type:t,color:r,ids:[]},this.legend.push(o)),o.ids.push(s)}clearLegendBy(t){var r;t||(this.legend.length=0);for(let s=((r=this.legend)==null?void 0:r.length)-1;s>=0;s--)this.legend[s].type===t&&this.legend.splice(s,s)}getLegend(){return this.legend}showSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.defaultLayers,!1),this.chef.updateLayersVisibility(this.skeletonLayers,!0))}hideSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.skeletonLayers,!1),this.chef.updateLayersVisibility(this.defaultLayers,!0))}setAssetLabels(t,r){this.chef.setLabelsById(t,r,this.assetType)}getAssetLabelsMap(t){var o,u;if(!t)return;const r=la(t);let s=this.getAssetsByType(r);if(!s||!((o=Object.keys(s))!=null&&o.length)){let h=this.chef.getElementById(r);if(h||(h=this.chef.getElementById(t+"-txt-label")),!h)return;s=this.chef.getElementsMap(h),this.assetsMap[r]=s}if(!(!s||!((u=Object.keys(s))!=null&&u.length)))return s}getAssetLabelById(t,r){var h,c;const s=this.getAssetLabelsMap(t);if(!s)return;let o=s[r];if(o&&((h=o==null?void 0:o.childNodes)!=null&&h.length))return o.childNodes[0].textContent||"";const u="l-"+t+"-"+r;if(o=s[u],o&&((c=o==null?void 0:o.children)!=null&&c.length))return o.children[0].textContent||""}clearAssetLabels(){this.chef.clearAssetLabelsByType(this.assetType)}bindAssetsEvents(t){var o;const r=(o=this.svg)==null?void 0:o.querySelector("#"+t);if(!r)return;r.querySelectorAll("[id]").forEach(u=>{u instanceof SVGElement&&u.addEventListener("click",this.clickSvgElementHandler)})}handleClickSvgElement(t){var r;typeof t.preventDefault=="function"&&t.preventDefault(),console.warn("svgScene.handleClickSvgElement: ",(r=t==null?void 0:t.target)==null?void 0:r.id,t==null?void 0:t.target),this.dispatchEvent({type:"click",data:t})}socialDistanceEnableChanged(t){this.socialDistanceEnable=!!t,t?this.painter.drawSocialDistanceCircles(this.svg):this.painter.clearSocialDistanceCircles(this.svg)}highlightAssets(t,r){var o;this.resetHighlightAssets(t);const s=this.getAssetsByType(t);!s||!((o=Object.keys(s))!=null&&o.length)||(this._lastHighlightType=t,this._lastHighlightIds=Array.isArray(r)?r:[r],this._lastHighlightIds.forEach(u=>{u&&s[u]&&da(s[u],"active")}))}resetHighlightAssets(t){var s;const r=this.getAssetsByType(t||this._lastHighlightType);!r||!((s=Object.keys(r))!=null&&s.length)||(this._lastHighlightIds.forEach(o=>{o&&r[o]&&ga(r[o],"active")}),this._lastHighlightIds.length=0)}getIntersectObjects(t,r=Qe.RM,s=[]){s.length=0;const o=[],u=this.getAssetsByType(r);if(!u)return s;const h=Rt.keys(u);for(let y=0,p=h.length;y<p;y++){const A=this.chef.getElementBoundingBox(u[h[y]].id);A&&A.containsPoint(t.worldCoords)&&o.push(u[h[y]])}const c=Rt.sortBy(o,y=>{var p;return(p=this.chef.getElementBoundingBox(y.id))==null?void 0:p.getArea()});return s.push(...c),s}clearSelected(){var t,r;if((t=this.selectedList)!=null&&t.length)for(let s=((r=this.selectedList)==null?void 0:r.length)-1;s>=0;s--){let o=this.selectedList[s];this.selectedList.splice(s,1),this.chef.setElementState2selected(o,!1)}}clearSelectedById(t){var s,o;let r=(s=this.selectedList)==null?void 0:s.findIndex(u=>u.getAttribute("id")===t);r>-1&&(this.chef.setElementState2selected(this.selectedList[r],!1),(o=this.selectedList)==null||o.splice(r||0,1))}selectByIds(t,r=!1){Array.isArray(t)||(t=[t]),r||this.clearSelected();const s=Rt.uniq(Rt.map(this.selectedList,u=>u.getAttribute("id")||"")),o=this.getAssetsByType(this.assetType);if(o){for(let u=t.length-1;u>=0;u--)s.includes(t[u])?(this.clearSelectedById(t[u]),t.splice(u,1)):Object.hasOwnProperty.call(o,t[u])&&this.selectedList.push(o[t[u]]);this.selectedList.forEach(u=>{this.chef.setElementState2selected(u,!0)})}}getSelectedIds(){var r;if(!((r=this.selectedList)!=null&&r.length))return;const t=[];for(let s=0,o=this.selectedList.length;s<o;s++)this.selectedList[s].id&&t.push(this.selectedList[s].id);return t}getSelectedBoundingBox(){var r;const t=new Ot;return(r=this.selectedList)!=null&&r.length?(this.selectedList.forEach(s=>{const o=this.chef.boundingBoxMap[s.id];o&&t.expandByBox(o)}),t):t.copy(this.boundingBox)}getElementsByBox(t){const r=[],s=Object.keys(this.chef.boundingBoxMap),o=this.getAssetsByType(this.assetType);if(!o)return r;for(let u=0,h=s.length;u<h;u++)if(o.hasOwnProperty(s[u])&&!(s[u].indexOf("-assets")>-1)&&t.intersectsBox(this.chef.boundingBoxMap[s[u]])){const c=o[s[u]];c&&r.push(c)}return r}getBoundingBoxByIds(t){var s,o;if(!t||Array.isArray(t)&&!t.length)return;Array.isArray(t)||(t=[t]);const r=new Ot;for(let u=0,h=t==null?void 0:t.length;u<h;u++)(o=(s=this.chef)==null?void 0:s.boundingBoxMap)!=null&&o.hasOwnProperty(t[u])&&r.expandByBox(this.chef.boundingBoxMap[t[u]]);return r}getBoundingBoxById(t){if(this.chef.boundingBoxMap.hasOwnProperty(t))return new Ot().copy(this.chef.boundingBoxMap[t])}linkAssetsByTree(t){this.chef.linkAssetsByTree(this.assetType,t);const r=this.chef.getElementById(ua.ASSET_LABELS);r&&(r.style.display="block");const s=la(this.assetType),o=this.chef.getElementById(s);o&&(o.style.display="block");const u=this.assetsMap[s];u&&(this._lastLinkedIds.forEach(h=>{u[h]&&(u[h].style.display="none")}),this._lastLinkedIds=Wc(t),this._lastLinkedIds.forEach(h=>{u[h]&&(u[h].style.display="block")}))}onBeforeRender(){}fullscreen(t=1e3,r=!1){}update(){}}class Z2 extends al{constructor(t){super(t);d(this,"name","SvgLoadingScene");this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
35
- <view id="defaultView" viewBox="-200 -200 500 500" />
36
- <style>
37
- /*#svg-loading-fast circle {animation: svg-loading-fast 2s ease infinite;}*/
38
- /*@keyframes svg-loading-fast {*/
39
- /* 0% {stroke-dasharray: 250; stroke-dashoffset: 250;}*/
40
- /* 50% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}*/
41
- /*}*/
42
- #svg-loading-fast .line {animation: svg-loading-fast 3s ease infinite;}
43
- @keyframes svg-loading-fast {
44
- 0% {stroke-dasharray: 250; stroke-dashoffset: 250; opacity: 1;}
45
- 50% {stroke-dasharray: 250; stroke-dashoffset: 0; opacity: 0.5;}
46
- }
47
- #svg-loading-fast path {animation: pathFrames 6s ease infinite;}
48
- @keyframes pathFrames {
49
- 0% {opacity: 1;}
50
- 50% {opacity: 0.5;}
51
- }
52
- #svg-loading-fast .triangle {animation: triangleFrames 1s ease infinite;}
53
- @keyframes triangleFrames {
54
- 0% {opacity: 1;}
55
- 50% {opacity: 0.3;}
56
- }
57
- #svg-loading-fast {fill: #525252}
58
- .line {stroke: #525252; stroke-width: 4px}
59
- .triangle {fill: #F26666}
60
- </style>
61
- <g id="svg-loading-fast">
62
- <!-- <text x="50" y="55" style="text-anchor: middle; fill: #5CC9F5; font-size: 15px;">loading</text>-->
63
- <!-- <circle cx="103" cy="25" r="103" style="fill: none; stroke: #5CC9F5; stroke-width: 1px;" />-->
64
- <path d="M14 35.7L14 15L21.27 15L21.27 33L34.59 33L33.08 35.7L14 35.7Z" />
65
- <path d="M44.78 17.77L44.78 32.93L55.4 32.93L55.4 15L62.71 15L62.71 35.7L37.47 35.7L37.47 15L55.4 15L52.88 17.77L44.78 17.77Z" />
66
- <path d="M76.39 27.92L85.03 27.92L82.9 30.77L75.2 30.77L73.29 35.7L65.59 35.7L73.94 15L87.19 15L95.58 35.7L87.94 35.7L85.03 27.92L81.14 17.77L79.99 17.77L76.39 27.92Z" />
67
- <path d="M123.73 32.78L120.88 35.7L98.46 35.7L98.46 15L116.53 15L113.97 17.84L105.66 17.84L105.66 32.93L116.53 32.93L116.53 15L121.14 15L123.73 17.7L123.73 32.78Z" />
68
- <path d="M133.63 35.7L126.61 35.7L126.61 15L133.63 15L133.63 35.7Z" />
69
- <path d="M153.75 35.7L143.78 21.3L143.78 35.7L136.51 35.7L136.51 15L144.64 15L154.58 29.65L154.58 15L161.78 15L161.78 35.7L153.75 35.7Z" />
70
- <path d="M182.73 33L182.73 25.73L177.37 25.73L177.37 22.99L189.93 22.99L189.93 35.7L182.73 35.7L182.73 33.5L180.57 35.7L164.66 35.7L164.66 15L190.04 15L188.46 17.7L172.04 17.7L172.04 33L182.73 33Z" />
71
- <!-- <rect class="line" width="207" height="5" x="0" y="43" />-->
72
- <!-- <path class="line" d="M0 43L207 43" />-->
73
- <path class="line" d="M103.5 46L0 46" />
74
- <path class="line" d="M103.5 46L207 46" />
75
- <path class="triangle" d="M103.5 56L133.5 90L73.5 90Z" />
76
- </g>
77
- </svg>`)}}var Lf={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
78
- * http://hammerjs.github.io/
79
- *
80
- * Copyright (c) 2016 Jorik Tangelder;
81
- * Licensed under the MIT license */(function(i){(function(e,t,r,s){var o=["","webkit","Moz","MS","ms","o"],u=t.createElement("div"),h="function",c=Math.round,y=Math.abs,p=Date.now;function A(m,E,_){return setTimeout(V(m,_),E)}function T(m,E,_){return Array.isArray(m)?(C(m,_[E],_),!0):!1}function C(m,E,_){var R;if(m)if(m.forEach)m.forEach(E,_);else if(m.length!==s)for(R=0;R<m.length;)E.call(_,m[R],R,m),R++;else for(R in m)m.hasOwnProperty(R)&&E.call(_,m[R],R,m)}function N(m,E,_){var R="DEPRECATED METHOD: "+E+`
82
- `+_+` AT
83
- `;return function(){var X=new Error("get-stack-trace"),et=X&&X.stack?X.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",At=e.console&&(e.console.warn||e.console.log);return At&&At.call(e.console,R,et),m.apply(this,arguments)}}var O;typeof Object.assign!="function"?O=function(E){if(E===s||E===null)throw new TypeError("Cannot convert undefined or null to object");for(var _=Object(E),R=1;R<arguments.length;R++){var X=arguments[R];if(X!==s&&X!==null)for(var et in X)X.hasOwnProperty(et)&&(_[et]=X[et])}return _}:O=Object.assign;var L=N(function(E,_,R){for(var X=Object.keys(_),et=0;et<X.length;)(!R||R&&E[X[et]]===s)&&(E[X[et]]=_[X[et]]),et++;return E},"extend","Use `assign`."),P=N(function(E,_){return L(E,_,!0)},"merge","Use `assign`.");function W(m,E,_){var R=E.prototype,X;X=m.prototype=Object.create(R),X.constructor=m,X._super=R,_&&O(X,_)}function V(m,E){return function(){return m.apply(E,arguments)}}function b(m,E){return typeof m==h?m.apply(E&&E[0]||s,E):m}function Y(m,E){return m===s?E:m}function z(m,E,_){C(K(E),function(R){m.addEventListener(R,_,!1)})}function j(m,E,_){C(K(E),function(R){m.removeEventListener(R,_,!1)})}function tt(m,E){for(;m;){if(m==E)return!0;m=m.parentNode}return!1}function Q(m,E){return m.indexOf(E)>-1}function K(m){return m.trim().split(/\s+/g)}function rt(m,E,_){if(m.indexOf&&!_)return m.indexOf(E);for(var R=0;R<m.length;){if(_&&m[R][_]==E||!_&&m[R]===E)return R;R++}return-1}function at(m){return Array.prototype.slice.call(m,0)}function ct(m,E,_){for(var R=[],X=[],et=0;et<m.length;){var At=m[et][E];rt(X,At)<0&&R.push(m[et]),X[et]=At,et++}return R=R.sort(function(ve,_e){return ve[E]>_e[E]}),R}function pt(m,E){for(var _,R,X=E[0].toUpperCase()+E.slice(1),et=0;et<o.length;){if(_=o[et],R=_?_+X:E,R in m)return R;et++}return s}var dt=1;function B(){return dt++}function xt(m){var E=m.ownerDocument||m;return E.defaultView||E.parentWindow||e}var kt=/mobile|tablet|ip(ad|hone|od)|android/i,Ue="ontouchstart"in e,Se=pt(e,"PointerEvent")!==s,ge=Ue&&kt.test(navigator.userAgent),we="touch",Xr="pen",qe="mouse",ye="kinect",Ie=25,Kt=1,te=2,Bt=4,Zt=8,Re=1,Ve=2,er=4,ie=8,Pe=16,Te=Ve|er,ee=ie|Pe,pi=Te|ee,Ni=["x","y"],me=["clientX","clientY"];function It(m,E){var _=this;this.manager=m,this.callback=E,this.element=m.element,this.target=m.options.inputTarget,this.domHandler=function(R){b(m.options.enable,[m])&&_.handler(R)},this.init()}It.prototype={handler:function(){},init:function(){this.evEl&&z(this.element,this.evEl,this.domHandler),this.evTarget&&z(this.target,this.evTarget,this.domHandler),this.evWin&&z(xt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(xt(this.element),this.evWin,this.domHandler)}};function pr(m){var E,_=m.options.inputClass;return _?E=_:Se?E=gr:ge?E=fn:Ue?E=Ba:E=Et,new E(m,rr)}function rr(m,E,_){var R=_.pointers.length,X=_.changedPointers.length,et=E&Kt&&R-X===0,At=E&(Bt|Zt)&&R-X===0;_.isFirst=!!et,_.isFinal=!!At,et&&(m.session={}),_.eventType=E,Bi(m,_),m.emit("hammer.input",_),m.recognize(_),m.session.prevInput=_}function Bi(m,E){var _=m.session,R=E.pointers,X=R.length;_.firstInput||(_.firstInput=dr(E)),X>1&&!_.firstMultiple?_.firstMultiple=dr(E):X===1&&(_.firstMultiple=!1);var et=_.firstInput,At=_.firstMultiple,oe=At?At.center:et.center,ve=E.center=ir(R);E.timeStamp=p(),E.deltaTime=E.timeStamp-et.timeStamp,E.angle=Ii(oe,ve),E.distance=di(oe,ve),Dr(_,E),E.offsetDirection=un(E.deltaX,E.deltaY);var _e=on(E.deltaTime,E.deltaX,E.deltaY);E.overallVelocityX=_e.x,E.overallVelocityY=_e.y,E.overallVelocity=y(_e.x)>y(_e.y)?_e.x:_e.y,E.scale=At?H(At.pointers,R):1,E.rotation=At?Fn(At.pointers,R):0,E.maxPointers=_.prevInput?E.pointers.length>_.prevInput.maxPointers?E.pointers.length:_.prevInput.maxPointers:E.pointers.length,an(_,E);var Mr=m.element;tt(E.srcEvent.target,Mr)&&(Mr=E.srcEvent.target),E.target=Mr}function Dr(m,E){var _=E.center,R=m.offsetDelta||{},X=m.prevDelta||{},et=m.prevInput||{};(E.eventType===Kt||et.eventType===Bt)&&(X=m.prevDelta={x:et.deltaX||0,y:et.deltaY||0},R=m.offsetDelta={x:_.x,y:_.y}),E.deltaX=X.x+(_.x-R.x),E.deltaY=X.y+(_.y-R.y)}function an(m,E){var _=m.lastInterval||E,R=E.timeStamp-_.timeStamp,X,et,At,oe;if(E.eventType!=Zt&&(R>Ie||_.velocity===s)){var ve=E.deltaX-_.deltaX,_e=E.deltaY-_.deltaY,Mr=on(R,ve,_e);et=Mr.x,At=Mr.y,X=y(Mr.x)>y(Mr.y)?Mr.x:Mr.y,oe=un(ve,_e),m.lastInterval=E}else X=_.velocity,et=_.velocityX,At=_.velocityY,oe=_.direction;E.velocity=X,E.velocityX=et,E.velocityY=At,E.direction=oe}function dr(m){for(var E=[],_=0;_<m.pointers.length;)E[_]={clientX:c(m.pointers[_].clientX),clientY:c(m.pointers[_].clientY)},_++;return{timeStamp:p(),pointers:E,center:ir(E),deltaX:m.deltaX,deltaY:m.deltaY}}function ir(m){var E=m.length;if(E===1)return{x:c(m[0].clientX),y:c(m[0].clientY)};for(var _=0,R=0,X=0;X<E;)_+=m[X].clientX,R+=m[X].clientY,X++;return{x:c(_/E),y:c(R/E)}}function on(m,E,_){return{x:E/m||0,y:_/m||0}}function un(m,E){return m===E?Re:y(m)>=y(E)?m<0?Ve:er:E<0?ie:Pe}function di(m,E,_){_||(_=Ni);var R=E[_[0]]-m[_[0]],X=E[_[1]]-m[_[1]];return Math.sqrt(R*R+X*X)}function Ii(m,E,_){_||(_=Ni);var R=E[_[0]]-m[_[0]],X=E[_[1]]-m[_[1]];return Math.atan2(X,R)*180/Math.PI}function Fn(m,E){return Ii(E[1],E[0],me)+Ii(m[1],m[0],me)}function H(m,E){return di(E[0],E[1],me)/di(m[0],m[1],me)}var nt={mousedown:Kt,mousemove:te,mouseup:Bt},ot="mousedown",Mt="mousemove mouseup";function Et(){this.evEl=ot,this.evWin=Mt,this.pressed=!1,It.apply(this,arguments)}W(Et,It,{handler:function(E){var _=nt[E.type];_&Kt&&E.button===0&&(this.pressed=!0),_&te&&E.which!==1&&(_=Bt),this.pressed&&(_&Bt&&(this.pressed=!1),this.callback(this.manager,_,{pointers:[E],changedPointers:[E],pointerType:qe,srcEvent:E}))}});var xe={pointerdown:Kt,pointermove:te,pointerup:Bt,pointercancel:Zt,pointerout:Zt},Fe={2:we,3:Xr,4:qe,5:ye},Sr="pointerdown",ln="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Sr="MSPointerDown",ln="MSPointerMove MSPointerUp MSPointerCancel");function gr(){this.evEl=Sr,this.evWin=ln,It.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}W(gr,It,{handler:function(E){var _=this.store,R=!1,X=E.type.toLowerCase().replace("ms",""),et=xe[X],At=Fe[E.pointerType]||E.pointerType,oe=At==we,ve=rt(_,E.pointerId,"pointerId");et&Kt&&(E.button===0||oe)?ve<0&&(_.push(E),ve=_.length-1):et&(Bt|Zt)&&(R=!0),!(ve<0)&&(_[ve]=E,this.callback(this.manager,et,{pointers:_,changedPointers:[E],pointerType:At,srcEvent:E}),R&&_.splice(ve,1))}});var kn={touchstart:Kt,touchmove:te,touchend:Bt,touchcancel:Zt},hn="touchstart",gi="touchstart touchmove touchend touchcancel";function Hn(){this.evTarget=hn,this.evWin=gi,this.started=!1,It.apply(this,arguments)}W(Hn,It,{handler:function(E){var _=kn[E.type];if(_===Kt&&(this.started=!0),!!this.started){var R=Un.call(this,E,_);_&(Bt|Zt)&&R[0].length-R[1].length===0&&(this.started=!1),this.callback(this.manager,_,{pointers:R[0],changedPointers:R[1],pointerType:we,srcEvent:E})}}});function Un(m,E){var _=at(m.touches),R=at(m.changedTouches);return E&(Bt|Zt)&&(_=ct(_.concat(R),"identifier")),[_,R]}var cn={touchstart:Kt,touchmove:te,touchend:Bt,touchcancel:Zt},Pl="touchstart touchmove touchend touchcancel";function fn(){this.evTarget=Pl,this.targetIds={},It.apply(this,arguments)}W(fn,It,{handler:function(E){var _=cn[E.type],R=Fl.call(this,E,_);R&&this.callback(this.manager,_,{pointers:R[0],changedPointers:R[1],pointerType:we,srcEvent:E})}});function Fl(m,E){var _=at(m.touches),R=this.targetIds;if(E&(Kt|te)&&_.length===1)return R[_[0].identifier]=!0,[_,_];var X,et,At=at(m.changedTouches),oe=[],ve=this.target;if(et=_.filter(function(_e){return tt(_e.target,ve)}),E===Kt)for(X=0;X<et.length;)R[et[X].identifier]=!0,X++;for(X=0;X<At.length;)R[At[X].identifier]&&oe.push(At[X]),E&(Bt|Zt)&&delete R[At[X].identifier],X++;if(oe.length)return[ct(et.concat(oe),"identifier"),oe]}var Na=2500,Po=25;function Ba(){It.apply(this,arguments);var m=V(this.handler,this);this.touch=new fn(this.manager,m),this.mouse=new Et(this.manager,m),this.primaryTouch=null,this.lastTouches=[]}W(Ba,It,{handler:function(E,_,R){var X=R.pointerType==we,et=R.pointerType==qe;if(!(et&&R.sourceCapabilities&&R.sourceCapabilities.firesTouchEvents)){if(X)kl.call(this,_,R);else if(et&&Hl.call(this,R))return;this.callback(E,_,R)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function kl(m,E){m&Kt?(this.primaryTouch=E.changedPointers[0].identifier,Fo.call(this,E)):m&(Bt|Zt)&&Fo.call(this,E)}function Fo(m){var E=m.changedPointers[0];if(E.identifier===this.primaryTouch){var _={x:E.clientX,y:E.clientY};this.lastTouches.push(_);var R=this.lastTouches,X=function(){var et=R.indexOf(_);et>-1&&R.splice(et,1)};setTimeout(X,Na)}}function Hl(m){for(var E=m.srcEvent.clientX,_=m.srcEvent.clientY,R=0;R<this.lastTouches.length;R++){var X=this.lastTouches[R],et=Math.abs(E-X.x),At=Math.abs(_-X.y);if(et<=Po&&At<=Po)return!0}return!1}var ko=pt(u.style,"touchAction"),Ho=ko!==s,Uo="compute",Ia="auto",Ra="manipulation",Ri="none",qn="pan-x",Vn="pan-y",bs=Ul();function Pa(m,E){this.manager=m,this.set(E)}Pa.prototype={set:function(m){m==Uo&&(m=this.compute()),Ho&&this.manager.element.style&&bs[m]&&(this.manager.element.style[ko]=m),this.actions=m.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var m=[];return C(this.manager.recognizers,function(E){b(E.options.enable,[E])&&(m=m.concat(E.getTouchAction()))}),ws(m.join(" "))},preventDefaults:function(m){var E=m.srcEvent,_=m.offsetDirection;if(this.manager.session.prevented){E.preventDefault();return}var R=this.actions,X=Q(R,Ri)&&!bs[Ri],et=Q(R,Vn)&&!bs[Vn],At=Q(R,qn)&&!bs[qn];if(X){var oe=m.pointers.length===1,ve=m.distance<2,_e=m.deltaTime<250;if(oe&&ve&&_e)return}if(!(At&&et)&&(X||et&&_&Te||At&&_&ee))return this.preventSrc(E)},preventSrc:function(m){this.manager.session.prevented=!0,m.preventDefault()}};function ws(m){if(Q(m,Ri))return Ri;var E=Q(m,qn),_=Q(m,Vn);return E&&_?Ri:E||_?E?qn:Vn:Q(m,Ra)?Ra:Ia}function Ul(){if(!Ho)return!1;var m={},E=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(_){m[_]=E?e.CSS.supports("touch-action",_):!0}),m}var Pi=1,nr=2,pn=4,yi=8,Or=yi,dn=16,yr=32;function Qr(m){this.options=O({},this.defaults,m||{}),this.id=B(),this.manager=null,this.options.enable=Y(this.options.enable,!0),this.state=Pi,this.simultaneous={},this.requireFail=[]}Qr.prototype={defaults:{},set:function(m){return O(this.options,m),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(m){if(T(m,"recognizeWith",this))return this;var E=this.simultaneous;return m=Ts(m,this),E[m.id]||(E[m.id]=m,m.recognizeWith(this)),this},dropRecognizeWith:function(m){return T(m,"dropRecognizeWith",this)?this:(m=Ts(m,this),delete this.simultaneous[m.id],this)},requireFailure:function(m){if(T(m,"requireFailure",this))return this;var E=this.requireFail;return m=Ts(m,this),rt(E,m)===-1&&(E.push(m),m.requireFailure(this)),this},dropRequireFailure:function(m){if(T(m,"dropRequireFailure",this))return this;m=Ts(m,this);var E=rt(this.requireFail,m);return E>-1&&this.requireFail.splice(E,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(m){return!!this.simultaneous[m.id]},emit:function(m){var E=this,_=this.state;function R(X){E.manager.emit(X,m)}_<yi&&R(E.options.event+qo(_)),R(E.options.event),m.additionalEvent&&R(m.additionalEvent),_>=yi&&R(E.options.event+qo(_))},tryEmit:function(m){if(this.canEmit())return this.emit(m);this.state=yr},canEmit:function(){for(var m=0;m<this.requireFail.length;){if(!(this.requireFail[m].state&(yr|Pi)))return!1;m++}return!0},recognize:function(m){var E=O({},m);if(!b(this.options.enable,[this,E])){this.reset(),this.state=yr;return}this.state&(Or|dn|yr)&&(this.state=Pi),this.state=this.process(E),this.state&(nr|pn|yi|dn)&&this.tryEmit(E)},process:function(m){},getTouchAction:function(){},reset:function(){}};function qo(m){return m&dn?"cancel":m&yi?"end":m&pn?"move":m&nr?"start":""}function Vo(m){return m==Pe?"down":m==ie?"up":m==Ve?"left":m==er?"right":""}function Ts(m,E){var _=E.manager;return _?_.get(m):m}function sr(){Qr.apply(this,arguments)}W(sr,Qr,{defaults:{pointers:1},attrTest:function(m){var E=this.options.pointers;return E===0||m.pointers.length===E},process:function(m){var E=this.state,_=m.eventType,R=E&(nr|pn),X=this.attrTest(m);return R&&(_&Zt||!X)?E|dn:R||X?_&Bt?E|yi:E&nr?E|pn:nr:yr}});function Wn(){sr.apply(this,arguments),this.pX=null,this.pY=null}W(Wn,sr,{defaults:{event:"pan",threshold:10,pointers:1,direction:pi},getTouchAction:function(){var m=this.options.direction,E=[];return m&Te&&E.push(Vn),m&ee&&E.push(qn),E},directionTest:function(m){var E=this.options,_=!0,R=m.distance,X=m.direction,et=m.deltaX,At=m.deltaY;return X&E.direction||(E.direction&Te?(X=et===0?Re:et<0?Ve:er,_=et!=this.pX,R=Math.abs(m.deltaX)):(X=At===0?Re:At<0?ie:Pe,_=At!=this.pY,R=Math.abs(m.deltaY))),m.direction=X,_&&R>E.threshold&&X&E.direction},attrTest:function(m){return sr.prototype.attrTest.call(this,m)&&(this.state&nr||!(this.state&nr)&&this.directionTest(m))},emit:function(m){this.pX=m.deltaX,this.pY=m.deltaY;var E=Vo(m.direction);E&&(m.additionalEvent=this.options.event+E),this._super.emit.call(this,m)}});function _s(){sr.apply(this,arguments)}W(_s,sr,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ri]},attrTest:function(m){return this._super.attrTest.call(this,m)&&(Math.abs(m.scale-1)>this.options.threshold||this.state&nr)},emit:function(m){if(m.scale!==1){var E=m.scale<1?"in":"out";m.additionalEvent=this.options.event+E}this._super.emit.call(this,m)}});function zn(){Qr.apply(this,arguments),this._timer=null,this._input=null}W(zn,Qr,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ia]},process:function(m){var E=this.options,_=m.pointers.length===E.pointers,R=m.distance<E.threshold,X=m.deltaTime>E.time;if(this._input=m,!R||!_||m.eventType&(Bt|Zt)&&!X)this.reset();else if(m.eventType&Kt)this.reset(),this._timer=A(function(){this.state=Or,this.tryEmit()},E.time,this);else if(m.eventType&Bt)return Or;return yr},reset:function(){clearTimeout(this._timer)},emit:function(m){this.state===Or&&(m&&m.eventType&Bt?this.manager.emit(this.options.event+"up",m):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}});function Fa(){sr.apply(this,arguments)}W(Fa,sr,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ri]},attrTest:function(m){return this._super.attrTest.call(this,m)&&(Math.abs(m.rotation)>this.options.threshold||this.state&nr)}});function Cs(){sr.apply(this,arguments)}W(Cs,sr,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Te|ee,pointers:1},getTouchAction:function(){return Wn.prototype.getTouchAction.call(this)},attrTest:function(m){var E=this.options.direction,_;return E&(Te|ee)?_=m.overallVelocity:E&Te?_=m.overallVelocityX:E&ee&&(_=m.overallVelocityY),this._super.attrTest.call(this,m)&&E&m.offsetDirection&&m.distance>this.options.threshold&&m.maxPointers==this.options.pointers&&y(_)>this.options.velocity&&m.eventType&Bt},emit:function(m){var E=Vo(m.offsetDirection);E&&this.manager.emit(this.options.event+E,m),this.manager.emit(this.options.event,m)}});function Fi(){Qr.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}W(Fi,Qr,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ra]},process:function(m){var E=this.options,_=m.pointers.length===E.pointers,R=m.distance<E.threshold,X=m.deltaTime<E.time;if(this.reset(),m.eventType&Kt&&this.count===0)return this.failTimeout();if(R&&X&&_){if(m.eventType!=Bt)return this.failTimeout();var et=this.pTime?m.timeStamp-this.pTime<E.interval:!0,At=!this.pCenter||di(this.pCenter,m.center)<E.posThreshold;this.pTime=m.timeStamp,this.pCenter=m.center,!At||!et?this.count=1:this.count+=1,this._input=m;var oe=this.count%E.taps;if(oe===0)return this.hasRequireFailures()?(this._timer=A(function(){this.state=Or,this.tryEmit()},E.interval,this),nr):Or}return yr},failTimeout:function(){return this._timer=A(function(){this.state=yr},this.options.interval,this),yr},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Or&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Kr(m,E){return E=E||{},E.recognizers=Y(E.recognizers,Kr.defaults.preset),new Ds(m,E)}Kr.VERSION="2.0.7",Kr.defaults={domEvents:!1,touchAction:Uo,enable:!0,inputTarget:null,inputClass:null,preset:[[Fa,{enable:!1}],[_s,{enable:!1},["rotate"]],[Cs,{direction:Te}],[Wn,{direction:Te},["swipe"]],[Fi],[Fi,{event:"doubletap",taps:2},["tap"]],[zn]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ql=1,ka=2;function Ds(m,E){this.options=O({},Kr.defaults,E||{}),this.options.inputTarget=this.options.inputTarget||m,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=m,this.input=pr(this),this.touchAction=new Pa(this,this.options.touchAction),Ss(this,!0),C(this.options.recognizers,function(_){var R=this.add(new _[0](_[1]));_[2]&&R.recognizeWith(_[2]),_[3]&&R.requireFailure(_[3])},this)}Ds.prototype={set:function(m){return O(this.options,m),m.touchAction&&this.touchAction.update(),m.inputTarget&&(this.input.destroy(),this.input.target=m.inputTarget,this.input.init()),this},stop:function(m){this.session.stopped=m?ka:ql},recognize:function(m){var E=this.session;if(!E.stopped){this.touchAction.preventDefaults(m);var _,R=this.recognizers,X=E.curRecognizer;(!X||X&&X.state&Or)&&(X=E.curRecognizer=null);for(var et=0;et<R.length;)_=R[et],E.stopped!==ka&&(!X||_==X||_.canRecognizeWith(X))?_.recognize(m):_.reset(),!X&&_.state&(nr|pn|yi)&&(X=E.curRecognizer=_),et++}},get:function(m){if(m instanceof Qr)return m;for(var E=this.recognizers,_=0;_<E.length;_++)if(E[_].options.event==m)return E[_];return null},add:function(m){if(T(m,"add",this))return this;var E=this.get(m.options.event);return E&&this.remove(E),this.recognizers.push(m),m.manager=this,this.touchAction.update(),m},remove:function(m){if(T(m,"remove",this))return this;if(m=this.get(m),m){var E=this.recognizers,_=rt(E,m);_!==-1&&(E.splice(_,1),this.touchAction.update())}return this},on:function(m,E){if(m!==s&&E!==s){var _=this.handlers;return C(K(m),function(R){_[R]=_[R]||[],_[R].push(E)}),this}},off:function(m,E){if(m!==s){var _=this.handlers;return C(K(m),function(R){E?_[R]&&_[R].splice(rt(_[R],E),1):delete _[R]}),this}},emit:function(m,E){this.options.domEvents&&Vl(m,E);var _=this.handlers[m]&&this.handlers[m].slice();if(!(!_||!_.length)){E.type=m,E.preventDefault=function(){E.srcEvent.preventDefault()};for(var R=0;R<_.length;)_[R](E),R++}},destroy:function(){this.element&&Ss(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ss(m,E){var _=m.element;if(_.style){var R;C(m.options.cssProps,function(X,et){R=pt(_.style,et),E?(m.oldCssProps[R]=_.style[R],_.style[R]=X):_.style[R]=m.oldCssProps[R]||""}),E||(m.oldCssProps={})}}function Vl(m,E){var _=t.createEvent("Event");_.initEvent(m,!0,!0),_.gesture=E,E.target.dispatchEvent(_)}O(Kr,{INPUT_START:Kt,INPUT_MOVE:te,INPUT_END:Bt,INPUT_CANCEL:Zt,STATE_POSSIBLE:Pi,STATE_BEGAN:nr,STATE_CHANGED:pn,STATE_ENDED:yi,STATE_RECOGNIZED:Or,STATE_CANCELLED:dn,STATE_FAILED:yr,DIRECTION_NONE:Re,DIRECTION_LEFT:Ve,DIRECTION_RIGHT:er,DIRECTION_UP:ie,DIRECTION_DOWN:Pe,DIRECTION_HORIZONTAL:Te,DIRECTION_VERTICAL:ee,DIRECTION_ALL:pi,Manager:Ds,Input:It,TouchAction:Pa,TouchInput:fn,MouseInput:Et,PointerEventInput:gr,TouchMouseInput:Ba,SingleTouchInput:Hn,Recognizer:Qr,AttrRecognizer:sr,Tap:Fi,Pan:Wn,Swipe:Cs,Pinch:_s,Rotate:Fa,Press:zn,on:z,off:j,each:C,merge:P,extend:L,assign:O,inherit:W,bindFn:V,prefixed:pt});var Wo=typeof e!="undefined"?e:typeof self!="undefined"?self:{};Wo.Hammer=Kr,i.exports?i.exports=Kr:e[r]=Kr})(window,document,"Hammer")})(Lf);var X2=Lf.exports;const tn=Kh(X2),Nf=new k,Yr=new k;class Bf extends Ke{constructor(t,r,s=!1){super();d(this,"name","orbit-controller.ts");d(this,"isSvg",!1);d(this,"dom");d(this,"domOffset",new k);d(this,"camera");d(this,"hammer");d(this,"enabled",!0);d(this,"enablePan",!0);d(this,"enableRotate",!0);d(this,"rotateSpeed",1);d(this,"enableZoom",!0);d(this,"minZoom",0);d(this,"maxZoom",1/0);d(this,"zoomSpeed",1);d(this,"zoomChanged",!1);d(this,"distanceStart",1);d(this,"distanceEnd",1);d(this,"state",-1);d(this,"EPS",1e-6);d(this,"focus",new k);d(this,"target",new k);d(this,"scaled",1);d(this,"rotateTheta",0);d(this,"enableDamping",!1);d(this,"dampingFactor",.05);d(this,"mouseButtons",{LEFT:2,MIDDLE:1,RIGHT:0});d(this,"isWheeling",!1);d(this,"finalTimer");d(this,"rotateStart",new k);d(this,"rotateEnd",new k);d(this,"rotateDelta",new k);d(this,"panStart",new k);d(this,"panEnd",new k);d(this,"panOffset",new k);d(this,"dollyStart",0);d(this,"dollyOffset",new k);d(this,"contextMenuHandler",this.handleContextMenu.bind(this));d(this,"wheelHandler",this.handleWheel.bind(this));d(this,"pointerDownHandler",this.handlePointerDown.bind(this));d(this,"pointerUpHandler",this.handlePointerUp.bind(this));d(this,"pointerMoveHandler",this.handlePointerMove.bind(this));d(this,"pointerOverHandler",Rt.debounce(this.handlePointerOver.bind(this),100));d(this,"pointerLeaveHandler",this.handlePointerLeave.bind(this));d(this,"tapHandler",this.handleTap.bind(this));d(this,"panHandler",this.handlePan.bind(this));d(this,"pinchHandler",this.handlePinch.bind(this));d(this,"pressHandler",this.handlePress.bind(this));d(this,"swipeHandler",this.handleSwipe.bind(this));d(this,"hammerInputHandler",this.handleHammerInput.bind(this));this.isSvg=s,this.dom=t,this.camera=r,this.scaled=r.scaled.x,this.resize(),this.dom.style.touchAction="none",this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}update(){this.camera.position.add(this.panOffset).add(this.dollyOffset),this.camera.scaled.set(this.scaled,this.scaled),this.rotateTheta&&(this.camera.rotation.x-=this.rotateTheta,Nf.copy(this.camera.position).rotateAround(this.focus,-this.rotateTheta),this.camera.position.copy(Nf)),this.camera.update(),this.panOffset.set(0,0),this.dollyOffset.set(0,0),this.scaled=this.camera.scaled.x,this.rotateTheta=0,this.dispatchEvent({type:"cameraChanged",data:{t:this.camera.position,r:this.camera.rotation.x,s:this.camera.scaled.x}})}bindEvents(){this.unbindEvents(),this.hammer=new tn.Manager(this.dom,{domEvents:!0});const t=new tn.Pan({threshold:0,pointers:0}),r=new tn.Pinch({threshold:0}),s=new tn.Tap({event:"singletap",taps:1}),o=new tn.Press({});this.hammer.add([t,s,o,r]),r.recognizeWith(t),this.hammer.on(["panstart","panmove","panend"].join(" "),this.panHandler),this.hammer.on(["pinchstart","pinchmove","pinchend"].join(" "),this.pinchHandler),this.hammer.on("singletap",this.tapHandler),this.hammer.on("press",this.pressHandler),this.hammer.on("swipe",this.swipeHandler),this.hammer.on("hammer.input",this.hammerInputHandler),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("wheel",this.wheelHandler,{passive:!1}),this.dom.addEventListener("mousemove",this.pointerOverHandler),this.isSvg||(this.dom.addEventListener("pointerdown",this.pointerDownHandler),this.dom.addEventListener("pointerleave",this.pointerLeaveHandler))}unbindEvents(){var t,r,s,o,u,h,c,y;(t=this.hammer)==null||t.off(["panstart","panmove","panend"].join(" "),this.panHandler),(r=this.hammer)==null||r.off(["pinchstart","pinchmove","pinchend"].join(" "),this.pinchHandler),(s=this.hammer)==null||s.off("singletap",this.tapHandler),(o=this.hammer)==null||o.off("press",this.pressHandler),(u=this.hammer)==null||u.off("swipe",this.swipeHandler),(h=this.hammer)==null||h.off("hammer.input",this.hammerInputHandler),this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("wheel",this.wheelHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler),this.isSvg||(this.dom.removeEventListener("pointerdown",this.pointerDownHandler),this.dom.removeEventListener("pointerleave",this.pointerLeaveHandler)),(c=this.hammer)==null||c.stop(!0),(y=this.hammer)==null||y.destroy()}setFocus(t,r){this.focus.set(t,r).sub(this.domOffset).unproject(this.camera)}handleTap(t){typeof t.preventDefault=="function"&&t.preventDefault(),Yr.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"tap",data:{screenCoords:{x:Yr.x,y:Yr.y}},e:t})}handleDoubleTap(t){typeof t.preventDefault=="function"&&t.preventDefault(),console.log("【orbitController】DoubleTap: ",t),Yr.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"doubletap",data:{screenCoords:{x:Yr.x,y:Yr.y}}})}handlePress(t){typeof t.preventDefault=="function"&&t.preventDefault(),console.log("【orbitController】Press: ",t)}handlePan(t){var s;if(this.scaled=this.camera.scaled.x,((s=t.pointers)==null?void 0:s.length)!==1)return;typeof t.preventDefault=="function"&&t.preventDefault();const r={type:"panmove",data:{}};(t.isFirst||t.type==="panstart")&&(this.state=2,this.panStart.set(t.center.x,t.center.y),r.type="panstart"),(t.isFinal||t.type==="panend")&&(this.state=-1,r.type="panend"),this.panEnd.set(t.center.x,t.center.y),this.panOffset.subVectors(this.panEnd,this.panStart).multiplyScalar(-this.camera.scaled.x,-this.camera.scaled.y*(this.camera.flipY?1:-1)).rotate(this.camera.rotation.x),this.panStart.copy(this.panEnd),Yr.set(t.center.x,t.center.y).sub(this.domOffset),r.data.screenCoords=Yr.clone(),this.dispatchEvent(r),this.enablePan&&this.update()}handlePinch(t){typeof t.preventDefault=="function"&&t.preventDefault(),t.type==="pinchstart"&&(this.dollyStart=this.camera.scaled.x,this.state=1),(t.isFinal||t.type==="pinchend")&&(this.state=-1),this.scaled=this.dollyStart*(1/t.scale);let r=(this.scaled-this.camera.scaled.x)/this.camera.scaled.x;this.setFocus(t.center.x,t.center.y),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-r).sub(this.camera.position),this.update()}handleRotate(t){typeof t.preventDefault=="function"&&t.preventDefault()}handleSwipe(t){typeof t.preventDefault=="function"&&t.preventDefault()}handleHammerInput(t){t.isFirst&&(this.state=9),t.isFinal&&(this.state=-1)}handleContextMenu(t){this.enabled&&typeof t.preventDefault=="function"&&t.preventDefault()}handleWheel(t){if(typeof t.preventDefault=="function"&&t.preventDefault(),!this.enabled||!this.enableZoom||this.state!==-1)return;this.isWheeling||(this.dispatchEvent({type:"wheelstart"}),this.isWheeling=!0),typeof t.preventDefault=="function"&&t.preventDefault(),typeof t.stopPropagation=="function"&&t.stopPropagation();let r=t.deltaY;(t==null?void 0:t.deltaMode)===1?r*=16:(t==null?void 0:t.deltaMode)===2&&(r*=100),t!=null&&t.ctrlKey&&(r*=10),this.setFocus(t.clientX,t.clientY);let s=this.getZoomScale(r);r<0?this.onDollyIn(s):r>0?this.onDollyOut(s):(this.scaled=this.camera.scaled.x,this.dollyOffset.set(0,0)),this.update(),clearTimeout(this.finalTimer),this.finalTimer=setTimeout(()=>{this.isWheeling&&(this.dispatchEvent({type:"wheelend"}),this.isWheeling=!1)},500)}onDollyIn(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x*t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,1-t).sub(this.camera.position)}onDollyOut(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x/t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-1+t).sub(this.camera.position)}getZoomScale(t){return Math.pow(.95,this.zoomSpeed*Math.abs(t*.03))}handlePointerDown(t){if(this.scaled=this.camera.scaled.x,!this.enabled||t.button!==2)return;this.dom.addEventListener("pointermove",this.pointerMoveHandler),this.dom.addEventListener("pointerup",this.pointerUpHandler);let r=-1;t.button===0?r=this.mouseButtons.LEFT:t.button===1?r=this.mouseButtons.MIDDLE:t.button===2&&(r=this.mouseButtons.RIGHT),r===0&&(this.rotateStart.set(t.clientX,t.clientY),this.setFocus(this.rotateStart.x,this.rotateStart.y),this.state=0)}handlePointerUp(){this.dom.removeEventListener("pointermove",this.pointerMoveHandler),this.dom.removeEventListener("pointerup",this.pointerUpHandler),this.state=-1}handlePointerLeave(){this.state=-1}handlePointerMove(t){if(this.enabled&&this.state===0){if(!this.enableRotate)return;this.onRotate(t.clientX,t.clientY)}}handlePointerOver(t){t.buttons>0||(Yr.set(t.clientX,t.clientY).sub(this.domOffset),this.dispatchEvent({type:"pointerover",data:{screenCoords:{x:Yr.x,y:Yr.y}},e:t}))}onRotate(t,r){this.rotateEnd.set(t,r),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const s=this.rotateDelta.x*Math.PI*2/this.dom.clientHeight;this.rotateTheta-=s,this.rotateStart.copy(this.rotateEnd),this.update()}}var ft=(i=>(i.CONTEXTMENU="contextmenu",i.LOSTPOINTERCAPTURE="lostpointercapture",i.MOUSEOVER="mouseover",i.MOUSEOUT="mouseout",i.MOUSELEAVE="mouseleave",i.MOUSEENTER="mouseenter",i.MOUSEMOVE="mousemove",i.MOUSEDOWN="mousedown",i.MOUSEUP="mouseup",i.POINTERMOVE="pointermove",i.POINTERDOWN="pointerdown",i.POINTERUP="pointerup",i.POINTERCANCEL="pointercancel",i.POINTEROUT="pointerout",i.POINTERLEAVE="pointerleave",i.POINTEROVER="pointerover",i.POINTERENTER="pointerenter",i.TOUCHSTART="touchstart",i.TOUCHEND="touchend",i.TOUCHMOVE="touchmove",i.TOUCHCANCEL="touchcancel",i.WHEEL="wheel",i.WHEEL_START="wheelstart",i.WHEEL_END="wheelend",i.MOUSEWHEEL="mousewheel",i.CLICK="click",i.DBLCLICK="dblclick",i.CONTEXT_LOST="contextlost",i.CONTEXT_RESTORED="contextrestored",i.CONTROLS_CHANGED="controlschanged",i.TAP="tap",i.SINGLE_TAP="singletap",i.DOUBLE_TAP="doubletap",i.PRESS="press",i.PAN="pan",i.PAN_START="panstart",i.PAN_MOVE="panmove",i.PAN_END="panend",i.ROTATE="rotate",i.ROTATE_START="rotatestart",i.ROTATE_MOVE="rotatemove",i.ROTATE_END="rotateend",i.PINCH="pinch",i.PINCH_START="pinchstart",i.PINCH_MOVE="pinchmove",i.PINCH_END="pinchend",i.PINCH_IN="pinchin",i.PINCH_OUT="pinchout",i.SWIPE="swipe",i.CHANGE_START="change_start",i.CHANGE_END="change_end",i.CAMERA_CHANGED="cameraChanged",i))(ft||{});const ya=new k;class If extends ef{constructor(t){super();d(this,"isCamera",!0);d(this,"type","Camera2");d(this,"name","Camera2");d(this,"params");d(this,"matrixAutoUpdate",!1);d(this,"matrixWorldAutoUpdate",!1);d(this,"projectionMatrix",new ce);d(this,"projectionMatrixInverse",new ce);d(this,"viewMatrix",new ce);d(this,"viewMatrixNeedsUpdate",!0);d(this,"viewArea",0);d(this,"left",-1);d(this,"right",1);d(this,"top",1);d(this,"bottom",-1);d(this,"width",2);d(this,"height",2);d(this,"aspect",1);d(this,"view");this.params=t,this.width=(t==null?void 0:t.width)!==void 0?t.width:2,this.height=(t==null?void 0:t.height)!==void 0?t.height:2,this.aspect=(t==null?void 0:t.aspect)!==void 0?t.aspect:1,(t==null?void 0:t.left)!==void 0&&(this.left=t.left),(t==null?void 0:t.right)!==void 0&&(this.right=t.right),(t==null?void 0:t.top)!==void 0&&(this.top=t.top),(t==null?void 0:t.bottom)!==void 0&&(this.bottom=t.bottom);const r=(this.right+this.left)/2,s=(this.top+this.bottom)/2;if(this.aspect>1){const o=Math.round((this.right-this.left)/2/this.aspect);this.top=s+o,this.bottom=s-o}else if(this.aspect<1){const o=Math.round((this.top-this.bottom)/2*this.aspect);this.left=r-o,this.right=r+o}this.flipY=(t==null?void 0:t.flipY)===!0,this.updateProjectionMatrix(),t!=null&&t.eye&&this.position.fromArray(t.eye),t!=null&&t.up&&this.up.fromArray(t.up),this.computeBoundingBox(),this.update()}destroy(){super.destroy()}get pixelWidth(){return this.scaled.x}set(t=-1,r=1,s=1,o=-1){ya.set(t+r,o+s).multiplyScalar(.5);const u=Math.max((r-t)/this.width,(s-o)/this.height);this.setTRS(ya,0,u)}setByBox(t){if(!t||t.isEmpty()){console.error(`setByBox: ${t==null?void 0:t.toString()}`);return}this.set(t.min.x,t.max.x,t.max.y,t.min.y)}setTRS(t={x:0,y:0},r=0,s=0){this.position.set(t.x||0,t.y||0),this.rotation.set(r,r),this.scaled.set(s,s),this.update()}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,r){this.width=t||2,this.height=r||2,this.left=this.params.left||-1,this.right=this.params.right||1,this.top=this.params.top||1,this.bottom=this.params.bottom||-1,this.aspect=t/r;const s=(this.right+this.left)/2,o=(this.top+this.bottom)/2;if(this.aspect>1){const u=Math.round((this.right-this.left)/2/this.aspect);this.top=o+u,this.bottom=o-u}else if(this.aspect<1){const u=Math.round((this.top-this.bottom)/2*this.aspect);this.left=s-u,this.right=s+u}this.updateProjectionMatrix(),this.update(),this.matrix.decompose(this.position,this.rotation,this.scaled)}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const r=this.matrixWorld.elements;return t.set(-r[6],-r[7]).normalize()}getCameraPosition(){return{x:this.position.x,y:this.position.y,z:this.position.z,s:this.scaled.x,r:this.rotation.x}}updateMatrixWorld(t=!1){super.updateMatrixWorld(t),this.updateViewMatrix()}updateProjectionMatrix(){this.parent===void 0&&this.matrixWorldAutoUpdate&&this.updateMatrixWorld(),this.projectionMatrix.makeProjection(this.left,this.right,this.top,this.bottom,this.width,this.height),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}updateViewMatrix(){this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.viewMatrix.multiplyMatrices(this.projectionMatrix,this.matrixWorldInverse)}update(t=!0){this.matrixAutoUpdate||this.updateMatrix(),this.updateMatrixWorld(),this.needsUpdate=!0,this.updateBoundingBox(),t&&this.dispatchEvent({type:"update",data:{t:this.position,r:this.rotation.x,s:this.scaled.x}})}computeBoundingBox(){return ya.set(this.width,this.height).multiplyScalar(.5).multiplyScalar(this.scaled.x),this.boundingBox.min.subVectors(this.position,ya),this.boundingBox.max.addVectors(this.position,ya),this.boundingBox}updateBoundingBox(){super.updateBoundingBox(),this.viewArea=this.boundingBoxWorld.getArea()}toJSON(){const t={};return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.width=this.width,t.height=this.height,t.aspect=this.aspect,t.position=this.position.toArray(),t.rotation=this.rotation.toArray(),t.scaled=this.scaled.toArray(),t}fromJSON(t){this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.position.fromArray(t.position),this.rotation.fromArray(t.rotation),this.scaled.fromArray(t.scaled),this.updateProjectionMatrix(),this.update(!1)}clone(){return new this.constructor.prototype.constructor().copy(this)}copy(t,r=!0,s=!1){return super.copy(t,r,s),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this}}var bo=(i=>(i.UPDATE="update",i))(bo||{});class ol extends Ke{constructor(t){super();d(this,"name","SvgSelectRect");d(this,"container");d(this,"el");t?this.container=t:this.container=document.getElementsByTagName("body")[0],this.el=document.createElement("div"),this.el.setAttribute("id",cs+"SvgSelectRect"),this.el.setAttribute("class",cs+"-svg-select-rect"),this.el.style.display="none",this.container.appendChild(this.el)}destroy(){super.destroy(),this.el&&this.el.remove()}draw(t){Rf.copy(t).getSize(ll),ul.copy(Rf.min),this.el.style.display="none",this.el.style.position="absolute",this.el.style.left=ul.x+"px",this.el.style.top=ul.y+"px",this.el.style.width=ll.x+"px",this.el.style.height=ll.y+"px",this.el.style.display="block",this.el.style.background=new Yt(Qt.darkBlue).setA(.1).getStyle(),this.el.style.border=Qt.darkBlue+" 1px dashed"}hide(){this.el.style.display="none"}}const Rf=new Ot,ul=new k,ll=new k;class Q2 extends Ke{constructor(t,r){super();d(this,"name","SvgMultiSelector");d(this,"controller");d(this,"scene");d(this,"container");d(this,"p1",new k);d(this,"p2",new k);d(this,"graph");d(this,"selectEnable",!1);d(this,"multiSelectEnable",!1);d(this,"fnEnable",!1);d(this,"controllerTapHandler",this.handleControllerTap.bind(this));d(this,"controllerPanStartHandler",this.handleControllerPanStart.bind(this));d(this,"controllerPanMoveHandler",this.handleControllerPanMove.bind(this));d(this,"controllerPanEndHandler",this.handleControllerPanEnd.bind(this));this.container=t,this.controller=r,this.graph=new ol(t),this.bindControllerEvents()}destroy(){this.unbindControllerEvents(),super.destroy()}bindScene(t){this.scene=t}selectEnableChanged(t){var r;(r=this.scene)==null||r.clearSelected(),this.selectEnable=!!t}multiSelectEnableChanged(t){var r;(r=this.scene)==null||r.clearSelected(),this.multiSelectEnable=!!t,this.controller.enablePan=!this.multiSelectEnable||this.multiSelectEnable&&!this.fnEnable}fnEnableChanged(t){this.fnEnable=!!t,this.controller.enablePan=!this.multiSelectEnable||this.multiSelectEnable&&!this.fnEnable}bindControllerEvents(){this.controller.addEventListener(ft.TAP,this.controllerTapHandler),this.controller.addEventListener(ft.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ft.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ft.PAN_END,this.controllerPanEndHandler)}unbindControllerEvents(){this.controller.removeEventListener(ft.TAP,this.controllerTapHandler),this.controller.removeEventListener(ft.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ft.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ft.PAN_END,this.controllerPanEndHandler)}handleControllerTap(t){var s,o,u,h,c,y;if((t==null?void 0:t.type)!==ft.TAP||!this.selectEnable&&!this.multiSelectEnable)return;const r=((s=t==null?void 0:t.e)==null?void 0:s.target)||((u=(o=t==null?void 0:t.e)==null?void 0:o.srcEvent)==null?void 0:u.target)||((c=(h=t==null?void 0:t.e)==null?void 0:h.srcEvent)==null?void 0:c.srcElement);r!=null&&r.id&&(y=this.scene)!=null&&y.isBelongsToAssetType(r==null?void 0:r.id)&&this.dispatchEvent({type:"SELECTED",data:Ou(Vs({},t.data),{target:[r],selected:[r==null?void 0:r.id]})})}handleControllerPanStart(t){(t==null?void 0:t.type)===ft.PAN_START&&this.multiSelectEnable&&(this.controller.enablePan||(this.p1.copy(t.data.screenCoords),On.makeEmpty().expandByPoint(this.p1),this.graph.draw(On)))}handleControllerPanMove(t){(t==null?void 0:t.type)===ft.PAN_MOVE&&this.multiSelectEnable&&(this.controller.enablePan||(this.p2.copy(t.data.screenCoords),On.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw(On)))}handleControllerPanEnd(t){var o;if((t==null?void 0:t.type)!==ft.PAN_END||!this.multiSelectEnable||this.controller.enablePan)return;this.p2.copy(t.data.screenCoords),On.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera);const r=(o=this.scene)==null?void 0:o.getElementsByBox(On),s=[];(r||[]).forEach(u=>s.push(u.id)),this.graph.hide(),On.makeEmpty(),this.dispatchEvent({type:"SELECTED",data:{target:r,selected:s}})}}var hl=(i=>(i.SELECTED="SELECTED",i))(hl||{});const On=new Ot;var Mn=(i=>(i.DEFAULT="default",i.INFO="info",i.PRIMARY="primary",i.SUCCESS="success",i.WARNING="warning",i.DANGER="danger",i))(Mn||{});class Pf{constructor(){d(this,"camera");d(this,"screenCoords",new k);d(this,"worldCoords",new k);d(this,"params",{Shape:{},Line:{threshold:1},Points:{threshold:1},Sprite:{}})}setFromCamera(e,t){return this.camera=t,this.screenCoords.set(e.x,e.y),this.worldCoords.copy(this.screenCoords).unproject(t),this}intersectObjects(e,t=!0,r=[]){for(let s=0,o=e.length;s<o;s++)this.intersectObject(e[s],t,r)}intersectObject(e,t=!1,r=[]){if(!e.selectable||(e.raycast(this,r),!t||e.composeNode))return r;for(let s=0,o=e.children.length;s<o;s++)this.intersectObject(e.children[s],t,r);return r}}var je="top",wr="bottom",Tr="right",Je="left",cl="auto",ma=[je,wr,Tr,Je],ps="start",va="end",K2="clippingParents",Ff="viewport",xa="popper",j2="reference",kf=ma.reduce(function(i,e){return i.concat([e+"-"+ps,e+"-"+va])},[]),Hf=[].concat(ma,[cl]).reduce(function(i,e){return i.concat([e,e+"-"+ps,e+"-"+va])},[]),J2="beforeRead",ty="read",ey="afterRead",ry="beforeMain",iy="main",ny="afterMain",sy="beforeWrite",ay="write",oy="afterWrite",uy=[J2,ty,ey,ry,iy,ny,sy,ay,oy];function oi(i){return i?(i.nodeName||"").toLowerCase():null}function cr(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function Ln(i){var e=cr(i).Element;return i instanceof e||i instanceof Element}function _r(i){var e=cr(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function fl(i){if(typeof ShadowRoot=="undefined")return!1;var e=cr(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function ly(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},s=e.attributes[t]||{},o=e.elements[t];!_r(o)||!oi(o)||(Object.assign(o.style,r),Object.keys(s).forEach(function(u){var h=s[u];h===!1?o.removeAttribute(u):o.setAttribute(u,h===!0?"":h)}))})}function hy(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var s=e.elements[r],o=e.attributes[r]||{},u=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),h=u.reduce(function(c,y){return c[y]="",c},{});!_r(s)||!oi(s)||(Object.assign(s.style,h),Object.keys(o).forEach(function(c){s.removeAttribute(c)}))})}}const Uf={name:"applyStyles",enabled:!0,phase:"write",fn:ly,effect:hy,requires:["computeStyles"]};function ui(i){return i.split("-")[0]}var Nn=Math.max,wo=Math.min,ds=Math.round;function pl(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function qf(){return!/^((?!chrome|android).)*safari/i.test(pl())}function gs(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),s=1,o=1;e&&_r(i)&&(s=i.offsetWidth>0&&ds(r.width)/i.offsetWidth||1,o=i.offsetHeight>0&&ds(r.height)/i.offsetHeight||1);var u=Ln(i)?cr(i):window,h=u.visualViewport,c=!qf()&&t,y=(r.left+(c&&h?h.offsetLeft:0))/s,p=(r.top+(c&&h?h.offsetTop:0))/o,A=r.width/s,T=r.height/o;return{width:A,height:T,top:p,right:y+A,bottom:p+T,left:y,x:y,y:p}}function dl(i){var e=gs(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function Vf(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&fl(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Si(i){return cr(i).getComputedStyle(i)}function cy(i){return["table","td","th"].indexOf(oi(i))>=0}function en(i){return((Ln(i)?i.ownerDocument:i.document)||window.document).documentElement}function To(i){return oi(i)==="html"?i:i.assignedSlot||i.parentNode||(fl(i)?i.host:null)||en(i)}function Wf(i){return!_r(i)||Si(i).position==="fixed"?null:i.offsetParent}function fy(i){var e=/firefox/i.test(pl()),t=/Trident/i.test(pl());if(t&&_r(i)){var r=Si(i);if(r.position==="fixed")return null}var s=To(i);for(fl(s)&&(s=s.host);_r(s)&&["html","body"].indexOf(oi(s))<0;){var o=Si(s);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return s;s=s.parentNode}return null}function Ea(i){for(var e=cr(i),t=Wf(i);t&&cy(t)&&Si(t).position==="static";)t=Wf(t);return t&&(oi(t)==="html"||oi(t)==="body"&&Si(t).position==="static")?e:t||fy(i)||e}function gl(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function Aa(i,e,t){return Nn(i,wo(e,t))}function py(i,e,t){var r=Aa(i,e,t);return r>t?t:r}function zf(){return{top:0,right:0,bottom:0,left:0}}function $f(i){return Object.assign({},zf(),i)}function Gf(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var dy=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,$f(typeof e!="number"?e:Gf(e,ma))};function gy(i){var e,t=i.state,r=i.name,s=i.options,o=t.elements.arrow,u=t.modifiersData.popperOffsets,h=ui(t.placement),c=gl(h),y=[Je,Tr].indexOf(h)>=0,p=y?"height":"width";if(!(!o||!u)){var A=dy(s.padding,t),T=dl(o),C=c==="y"?je:Je,N=c==="y"?wr:Tr,O=t.rects.reference[p]+t.rects.reference[c]-u[c]-t.rects.popper[p],L=u[c]-t.rects.reference[c],P=Ea(o),W=P?c==="y"?P.clientHeight||0:P.clientWidth||0:0,V=O/2-L/2,b=A[C],Y=W-T[p]-A[N],z=W/2-T[p]/2+V,j=Aa(b,z,Y),tt=c;t.modifiersData[r]=(e={},e[tt]=j,e.centerOffset=j-z,e)}}function yy(i){var e=i.state,t=i.options,r=t.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||Vf(e.elements.popper,s)&&(e.elements.arrow=s))}const my={name:"arrow",enabled:!0,phase:"main",fn:gy,effect:yy,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ys(i){return i.split("-")[1]}var vy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xy(i,e){var t=i.x,r=i.y,s=e.devicePixelRatio||1;return{x:ds(t*s)/s||0,y:ds(r*s)/s||0}}function Yf(i){var e,t=i.popper,r=i.popperRect,s=i.placement,o=i.variation,u=i.offsets,h=i.position,c=i.gpuAcceleration,y=i.adaptive,p=i.roundOffsets,A=i.isFixed,T=u.x,C=T===void 0?0:T,N=u.y,O=N===void 0?0:N,L=typeof p=="function"?p({x:C,y:O}):{x:C,y:O};C=L.x,O=L.y;var P=u.hasOwnProperty("x"),W=u.hasOwnProperty("y"),V=Je,b=je,Y=window;if(y){var z=Ea(t),j="clientHeight",tt="clientWidth";if(z===cr(t)&&(z=en(t),Si(z).position!=="static"&&h==="absolute"&&(j="scrollHeight",tt="scrollWidth")),z=z,s===je||(s===Je||s===Tr)&&o===va){b=wr;var Q=A&&z===Y&&Y.visualViewport?Y.visualViewport.height:z[j];O-=Q-r.height,O*=c?1:-1}if(s===Je||(s===je||s===wr)&&o===va){V=Tr;var K=A&&z===Y&&Y.visualViewport?Y.visualViewport.width:z[tt];C-=K-r.width,C*=c?1:-1}}var rt=Object.assign({position:h},y&&vy),at=p===!0?xy({x:C,y:O},cr(t)):{x:C,y:O};if(C=at.x,O=at.y,c){var ct;return Object.assign({},rt,(ct={},ct[b]=W?"0":"",ct[V]=P?"0":"",ct.transform=(Y.devicePixelRatio||1)<=1?"translate("+C+"px, "+O+"px)":"translate3d("+C+"px, "+O+"px, 0)",ct))}return Object.assign({},rt,(e={},e[b]=W?O+"px":"",e[V]=P?C+"px":"",e.transform="",e))}function Ey(i){var e=i.state,t=i.options,r=t.gpuAcceleration,s=r===void 0?!0:r,o=t.adaptive,u=o===void 0?!0:o,h=t.roundOffsets,c=h===void 0?!0:h,y={placement:ui(e.placement),variation:ys(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Yf(Object.assign({},y,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:u,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Yf(Object.assign({},y,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Ay={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ey,data:{}};var _o={passive:!0};function by(i){var e=i.state,t=i.instance,r=i.options,s=r.scroll,o=s===void 0?!0:s,u=r.resize,h=u===void 0?!0:u,c=cr(e.elements.popper),y=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&y.forEach(function(p){p.addEventListener("scroll",t.update,_o)}),h&&c.addEventListener("resize",t.update,_o),function(){o&&y.forEach(function(p){p.removeEventListener("scroll",t.update,_o)}),h&&c.removeEventListener("resize",t.update,_o)}}const wy={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:by,data:{}};var Ty={left:"right",right:"left",bottom:"top",top:"bottom"};function Co(i){return i.replace(/left|right|bottom|top/g,function(e){return Ty[e]})}var _y={start:"end",end:"start"};function Zf(i){return i.replace(/start|end/g,function(e){return _y[e]})}function yl(i){var e=cr(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function ml(i){return gs(en(i)).left+yl(i).scrollLeft}function Cy(i,e){var t=cr(i),r=en(i),s=t.visualViewport,o=r.clientWidth,u=r.clientHeight,h=0,c=0;if(s){o=s.width,u=s.height;var y=qf();(y||!y&&e==="fixed")&&(h=s.offsetLeft,c=s.offsetTop)}return{width:o,height:u,x:h+ml(i),y:c}}function Dy(i){var e,t=en(i),r=yl(i),s=(e=i.ownerDocument)==null?void 0:e.body,o=Nn(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=Nn(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),h=-r.scrollLeft+ml(i),c=-r.scrollTop;return Si(s||t).direction==="rtl"&&(h+=Nn(t.clientWidth,s?s.clientWidth:0)-o),{width:o,height:u,x:h,y:c}}function vl(i){var e=Si(i),t=e.overflow,r=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+r)}function Xf(i){return["html","body","#document"].indexOf(oi(i))>=0?i.ownerDocument.body:_r(i)&&vl(i)?i:Xf(To(i))}function ba(i,e){var t;e===void 0&&(e=[]);var r=Xf(i),s=r===((t=i.ownerDocument)==null?void 0:t.body),o=cr(r),u=s?[o].concat(o.visualViewport||[],vl(r)?r:[]):r,h=e.concat(u);return s?h:h.concat(ba(To(u)))}function xl(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function Sy(i,e){var t=gs(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function Qf(i,e,t){return e===Ff?xl(Cy(i,t)):Ln(e)?Sy(e,t):xl(Dy(en(i)))}function Oy(i){var e=ba(To(i)),t=["absolute","fixed"].indexOf(Si(i).position)>=0,r=t&&_r(i)?Ea(i):i;return Ln(r)?e.filter(function(s){return Ln(s)&&Vf(s,r)&&oi(s)!=="body"}):[]}function My(i,e,t,r){var s=e==="clippingParents"?Oy(i):[].concat(e),o=[].concat(s,[t]),u=o[0],h=o.reduce(function(c,y){var p=Qf(i,y,r);return c.top=Nn(p.top,c.top),c.right=wo(p.right,c.right),c.bottom=wo(p.bottom,c.bottom),c.left=Nn(p.left,c.left),c},Qf(i,u,r));return h.width=h.right-h.left,h.height=h.bottom-h.top,h.x=h.left,h.y=h.top,h}function Kf(i){var e=i.reference,t=i.element,r=i.placement,s=r?ui(r):null,o=r?ys(r):null,u=e.x+e.width/2-t.width/2,h=e.y+e.height/2-t.height/2,c;switch(s){case je:c={x:u,y:e.y-t.height};break;case wr:c={x:u,y:e.y+e.height};break;case Tr:c={x:e.x+e.width,y:h};break;case Je:c={x:e.x-t.width,y:h};break;default:c={x:e.x,y:e.y}}var y=s?gl(s):null;if(y!=null){var p=y==="y"?"height":"width";switch(o){case ps:c[y]=c[y]-(e[p]/2-t[p]/2);break;case va:c[y]=c[y]+(e[p]/2-t[p]/2);break}}return c}function wa(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=r===void 0?i.placement:r,o=t.strategy,u=o===void 0?i.strategy:o,h=t.boundary,c=h===void 0?K2:h,y=t.rootBoundary,p=y===void 0?Ff:y,A=t.elementContext,T=A===void 0?xa:A,C=t.altBoundary,N=C===void 0?!1:C,O=t.padding,L=O===void 0?0:O,P=$f(typeof L!="number"?L:Gf(L,ma)),W=T===xa?j2:xa,V=i.rects.popper,b=i.elements[N?W:T],Y=My(Ln(b)?b:b.contextElement||en(i.elements.popper),c,p,u),z=gs(i.elements.reference),j=Kf({reference:z,element:V,strategy:"absolute",placement:s}),tt=xl(Object.assign({},V,j)),Q=T===xa?tt:z,K={top:Y.top-Q.top+P.top,bottom:Q.bottom-Y.bottom+P.bottom,left:Y.left-Q.left+P.left,right:Q.right-Y.right+P.right},rt=i.modifiersData.offset;if(T===xa&&rt){var at=rt[s];Object.keys(K).forEach(function(ct){var pt=[Tr,wr].indexOf(ct)>=0?1:-1,dt=[je,wr].indexOf(ct)>=0?"y":"x";K[ct]+=at[dt]*pt})}return K}function Ly(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=t.boundary,o=t.rootBoundary,u=t.padding,h=t.flipVariations,c=t.allowedAutoPlacements,y=c===void 0?Hf:c,p=ys(r),A=p?h?kf:kf.filter(function(N){return ys(N)===p}):ma,T=A.filter(function(N){return y.indexOf(N)>=0});T.length===0&&(T=A);var C=T.reduce(function(N,O){return N[O]=wa(i,{placement:O,boundary:s,rootBoundary:o,padding:u})[ui(O)],N},{});return Object.keys(C).sort(function(N,O){return C[N]-C[O]})}function Ny(i){if(ui(i)===cl)return[];var e=Co(i);return[Zf(i),e,Zf(e)]}function By(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var s=t.mainAxis,o=s===void 0?!0:s,u=t.altAxis,h=u===void 0?!0:u,c=t.fallbackPlacements,y=t.padding,p=t.boundary,A=t.rootBoundary,T=t.altBoundary,C=t.flipVariations,N=C===void 0?!0:C,O=t.allowedAutoPlacements,L=e.options.placement,P=ui(L),W=P===L,V=c||(W||!N?[Co(L)]:Ny(L)),b=[L].concat(V).reduce(function(qe,ye){return qe.concat(ui(ye)===cl?Ly(e,{placement:ye,boundary:p,rootBoundary:A,padding:y,flipVariations:N,allowedAutoPlacements:O}):ye)},[]),Y=e.rects.reference,z=e.rects.popper,j=new Map,tt=!0,Q=b[0],K=0;K<b.length;K++){var rt=b[K],at=ui(rt),ct=ys(rt)===ps,pt=[je,wr].indexOf(at)>=0,dt=pt?"width":"height",B=wa(e,{placement:rt,boundary:p,rootBoundary:A,altBoundary:T,padding:y}),xt=pt?ct?Tr:Je:ct?wr:je;Y[dt]>z[dt]&&(xt=Co(xt));var kt=Co(xt),Ue=[];if(o&&Ue.push(B[at]<=0),h&&Ue.push(B[xt]<=0,B[kt]<=0),Ue.every(function(qe){return qe})){Q=rt,tt=!1;break}j.set(rt,Ue)}if(tt)for(var Se=N?3:1,ge=function(ye){var Ie=b.find(function(Kt){var te=j.get(Kt);if(te)return te.slice(0,ye).every(function(Bt){return Bt})});if(Ie)return Q=Ie,"break"},we=Se;we>0;we--){var Xr=ge(we);if(Xr==="break")break}e.placement!==Q&&(e.modifiersData[r]._skip=!0,e.placement=Q,e.reset=!0)}}const Iy={name:"flip",enabled:!0,phase:"main",fn:By,requiresIfExists:["offset"],data:{_skip:!1}};function jf(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function Jf(i){return[je,Tr,wr,Je].some(function(e){return i[e]>=0})}function Ry(i){var e=i.state,t=i.name,r=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,u=wa(e,{elementContext:"reference"}),h=wa(e,{altBoundary:!0}),c=jf(u,r),y=jf(h,s,o),p=Jf(c),A=Jf(y);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:y,isReferenceHidden:p,hasPopperEscaped:A},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":A})}const Py={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ry};function Fy(i,e,t){var r=ui(i),s=[Je,je].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,u=o[0],h=o[1];return u=u||0,h=(h||0)*s,[Je,Tr].indexOf(r)>=0?{x:h,y:u}:{x:u,y:h}}function ky(i){var e=i.state,t=i.options,r=i.name,s=t.offset,o=s===void 0?[0,0]:s,u=Hf.reduce(function(p,A){return p[A]=Fy(A,e.rects,o),p},{}),h=u[e.placement],c=h.x,y=h.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=y),e.modifiersData[r]=u}const Hy={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ky};function Uy(i){var e=i.state,t=i.name;e.modifiersData[t]=Kf({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const qy={name:"popperOffsets",enabled:!0,phase:"read",fn:Uy,data:{}};function Vy(i){return i==="x"?"y":"x"}function Wy(i){var e=i.state,t=i.options,r=i.name,s=t.mainAxis,o=s===void 0?!0:s,u=t.altAxis,h=u===void 0?!1:u,c=t.boundary,y=t.rootBoundary,p=t.altBoundary,A=t.padding,T=t.tether,C=T===void 0?!0:T,N=t.tetherOffset,O=N===void 0?0:N,L=wa(e,{boundary:c,rootBoundary:y,padding:A,altBoundary:p}),P=ui(e.placement),W=ys(e.placement),V=!W,b=gl(P),Y=Vy(b),z=e.modifiersData.popperOffsets,j=e.rects.reference,tt=e.rects.popper,Q=typeof O=="function"?O(Object.assign({},e.rects,{placement:e.placement})):O,K=typeof Q=="number"?{mainAxis:Q,altAxis:Q}:Object.assign({mainAxis:0,altAxis:0},Q),rt=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,at={x:0,y:0};if(z){if(o){var ct,pt=b==="y"?je:Je,dt=b==="y"?wr:Tr,B=b==="y"?"height":"width",xt=z[b],kt=xt+L[pt],Ue=xt-L[dt],Se=C?-tt[B]/2:0,ge=W===ps?j[B]:tt[B],we=W===ps?-tt[B]:-j[B],Xr=e.elements.arrow,qe=C&&Xr?dl(Xr):{width:0,height:0},ye=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:zf(),Ie=ye[pt],Kt=ye[dt],te=Aa(0,j[B],qe[B]),Bt=V?j[B]/2-Se-te-Ie-K.mainAxis:ge-te-Ie-K.mainAxis,Zt=V?-j[B]/2+Se+te+Kt+K.mainAxis:we+te+Kt+K.mainAxis,Re=e.elements.arrow&&Ea(e.elements.arrow),Ve=Re?b==="y"?Re.clientTop||0:Re.clientLeft||0:0,er=(ct=rt==null?void 0:rt[b])!=null?ct:0,ie=xt+Bt-er-Ve,Pe=xt+Zt-er,Te=Aa(C?wo(kt,ie):kt,xt,C?Nn(Ue,Pe):Ue);z[b]=Te,at[b]=Te-xt}if(h){var ee,pi=b==="x"?je:Je,Ni=b==="x"?wr:Tr,me=z[Y],It=Y==="y"?"height":"width",pr=me+L[pi],rr=me-L[Ni],Bi=[je,Je].indexOf(P)!==-1,Dr=(ee=rt==null?void 0:rt[Y])!=null?ee:0,an=Bi?pr:me-j[It]-tt[It]-Dr+K.altAxis,dr=Bi?me+j[It]+tt[It]-Dr-K.altAxis:rr,ir=C&&Bi?py(an,me,dr):Aa(C?an:pr,me,C?dr:rr);z[Y]=ir,at[Y]=ir-me}e.modifiersData[r]=at}}const zy={name:"preventOverflow",enabled:!0,phase:"main",fn:Wy,requiresIfExists:["offset"]};function $y(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function Gy(i){return i===cr(i)||!_r(i)?yl(i):$y(i)}function Yy(i){var e=i.getBoundingClientRect(),t=ds(e.width)/i.offsetWidth||1,r=ds(e.height)/i.offsetHeight||1;return t!==1||r!==1}function Zy(i,e,t){t===void 0&&(t=!1);var r=_r(e),s=_r(e)&&Yy(e),o=en(e),u=gs(i,s,t),h={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((oi(e)!=="body"||vl(o))&&(h=Gy(e)),_r(e)?(c=gs(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=ml(o))),{x:u.left+h.scrollLeft-c.x,y:u.top+h.scrollTop-c.y,width:u.width,height:u.height}}function Xy(i){var e=new Map,t=new Set,r=[];i.forEach(function(o){e.set(o.name,o)});function s(o){t.add(o.name);var u=[].concat(o.requires||[],o.requiresIfExists||[]);u.forEach(function(h){if(!t.has(h)){var c=e.get(h);c&&s(c)}}),r.push(o)}return i.forEach(function(o){t.has(o.name)||s(o)}),r}function Qy(i){var e=Xy(i);return uy.reduce(function(t,r){return t.concat(e.filter(function(s){return s.phase===r}))},[])}function Ky(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function jy(i){var e=i.reduce(function(t,r){var s=t[r.name];return t[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var tp={placement:"bottom",modifiers:[],strategy:"absolute"};function ep(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Jy(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,s=e.defaultOptions,o=s===void 0?tp:s;return function(h,c,y){y===void 0&&(y=o);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},tp,o),modifiersData:{},elements:{reference:h,popper:c},attributes:{},styles:{}},A=[],T=!1,C={state:p,setOptions:function(P){var W=typeof P=="function"?P(p.options):P;O(),p.options=Object.assign({},o,p.options,W),p.scrollParents={reference:Ln(h)?ba(h):h.contextElement?ba(h.contextElement):[],popper:ba(c)};var V=Qy(jy([].concat(r,p.options.modifiers)));return p.orderedModifiers=V.filter(function(b){return b.enabled}),N(),C.update()},forceUpdate:function(){if(!T){var P=p.elements,W=P.reference,V=P.popper;if(ep(W,V)){p.rects={reference:Zy(W,Ea(V),p.options.strategy==="fixed"),popper:dl(V)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(K){return p.modifiersData[K.name]=Object.assign({},K.data)});for(var b=0;b<p.orderedModifiers.length;b++){if(p.reset===!0){p.reset=!1,b=-1;continue}var Y=p.orderedModifiers[b],z=Y.fn,j=Y.options,tt=j===void 0?{}:j,Q=Y.name;typeof z=="function"&&(p=z({state:p,options:tt,name:Q,instance:C})||p)}}}},update:Ky(function(){return new Promise(function(L){C.forceUpdate(),L(p)})}),destroy:function(){O(),T=!0}};if(!ep(h,c))return C;C.setOptions(y).then(function(L){!T&&y.onFirstUpdate&&y.onFirstUpdate(L)});function N(){p.orderedModifiers.forEach(function(L){var P=L.name,W=L.options,V=W===void 0?{}:W,b=L.effect;if(typeof b=="function"){var Y=b({state:p,name:P,instance:C,options:V}),z=function(){};A.push(Y||z)}})}function O(){A.forEach(function(L){return L()}),A=[]}return C}}var tm=[wy,qy,Ay,Uf,Hy,Iy,zy,my,Py],em=Jy({defaultModifiers:tm}),rm="tippy-box",rp="tippy-content",im="tippy-backdrop",ip="tippy-arrow",np="tippy-svg-arrow",Bn={passive:!0,capture:!0},sp=function(){return document.body};function nm(i,e){return{}.hasOwnProperty.call(i,e)}function El(i,e,t){if(Array.isArray(i)){var r=i[e];return r==null?Array.isArray(t)?t[e]:t:r}return i}function Al(i,e){var t={}.toString.call(i);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function ap(i,e){return typeof i=="function"?i.apply(void 0,e):i}function op(i,e){if(e===0)return i;var t;return function(r){clearTimeout(t),t=setTimeout(function(){i(r)},e)}}function sm(i,e){var t=Object.assign({},i);return e.forEach(function(r){delete t[r]}),t}function am(i){return i.split(/\s+/).filter(Boolean)}function ms(i){return[].concat(i)}function up(i,e){i.indexOf(e)===-1&&i.push(e)}function om(i){return i.filter(function(e,t){return i.indexOf(e)===t})}function um(i){return i.split("-")[0]}function Do(i){return[].slice.call(i)}function lp(i){return Object.keys(i).reduce(function(e,t){return i[t]!==void 0&&(e[t]=i[t]),e},{})}function Ta(){return document.createElement("div")}function _a(i){return["Element","Fragment"].some(function(e){return Al(i,e)})}function lm(i){return Al(i,"NodeList")}function hm(i){return Al(i,"MouseEvent")}function cm(i){return!!(i&&i._tippy&&i._tippy.reference===i)}function fm(i){return _a(i)?[i]:lm(i)?Do(i):Array.isArray(i)?i:Do(document.querySelectorAll(i))}function bl(i,e){i.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function hp(i,e){i.forEach(function(t){t&&t.setAttribute("data-state",e)})}function pm(i){var e,t=ms(i),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function dm(i,e){var t=e.clientX,r=e.clientY;return i.every(function(s){var o=s.popperRect,u=s.popperState,h=s.props,c=h.interactiveBorder,y=um(u.placement),p=u.modifiersData.offset;if(!p)return!0;var A=y==="bottom"?p.top.y:0,T=y==="top"?p.bottom.y:0,C=y==="right"?p.left.x:0,N=y==="left"?p.right.x:0,O=o.top-r+A>c,L=r-o.bottom-T>c,P=o.left-t+C>c,W=t-o.right-N>c;return O||L||P||W})}function wl(i,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(s){i[r](s,t)})}function cp(i,e){for(var t=e;t;){var r;if(i.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var li={isTouch:!1},fp=0;function gm(){li.isTouch||(li.isTouch=!0,window.performance&&document.addEventListener("mousemove",pp))}function pp(){var i=performance.now();i-fp<20&&(li.isTouch=!1,document.removeEventListener("mousemove",pp)),fp=i}function ym(){var i=document.activeElement;if(cm(i)){var e=i._tippy;i.blur&&!e.state.isVisible&&i.blur()}}function mm(){document.addEventListener("touchstart",gm,Bn),window.addEventListener("blur",ym)}var vm=typeof window!="undefined"&&typeof document!="undefined",xm=vm?!!window.msCrypto:!1;function vs(i){var e=i==="destroy"?"n already-":" ";return[i+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function dp(i){var e=/[ \t]{2,}/g,t=/^[ \t]*/gm;return i.replace(e," ").replace(t,"").trim()}function Em(i){return dp(`
84
- %ctippy.js
85
-
86
- %c`+dp(i)+`
87
-
88
- %c👷‍ This is a development-only message. It will be removed in production.
89
- `)}function gp(i){return[Em(i),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Ca;process.env.NODE_ENV!=="production"&&Am();function Am(){Ca=new Set}function Oi(i,e){if(i&&!Ca.has(e)){var t;Ca.add(e),(t=console).warn.apply(t,gp(e))}}function Tl(i,e){if(i&&!Ca.has(e)){var t;Ca.add(e),(t=console).error.apply(t,gp(e))}}function bm(i){var e=!i,t=Object.prototype.toString.call(i)==="[object Object]"&&!i.addEventListener;Tl(e,["tippy() was passed","`"+String(i)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Tl(t,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var yp={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},wm={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},fr=Object.assign({appendTo:sp,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},yp,wm),Tm=Object.keys(fr),_m=function(e){process.env.NODE_ENV!=="production"&&xp(e,[]);var t=Object.keys(e);t.forEach(function(r){fr[r]=e[r]})};function mp(i){var e=i.plugins||[],t=e.reduce(function(r,s){var o=s.name,u=s.defaultValue;if(o){var h;r[o]=i[o]!==void 0?i[o]:(h=fr[o])!=null?h:u}return r},{});return Object.assign({},i,t)}function Cm(i,e){var t=e?Object.keys(mp(Object.assign({},fr,{plugins:e}))):Tm,r=t.reduce(function(s,o){var u=(i.getAttribute("data-tippy-"+o)||"").trim();if(!u)return s;if(o==="content")s[o]=u;else try{s[o]=JSON.parse(u)}catch(h){s[o]=u}return s},{});return r}function vp(i,e){var t=Object.assign({},e,{content:ap(e.content,[i])},e.ignoreAttributes?{}:Cm(i,e.plugins));return t.aria=Object.assign({},fr.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}function xp(i,e){i===void 0&&(i={}),e===void 0&&(e=[]);var t=Object.keys(i);t.forEach(function(r){var s=sm(fr,Object.keys(yp)),o=!nm(s,r);o&&(o=e.filter(function(u){return u.name===r}).length===0),Oi(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
90
-
91
- `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
92
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var Dm=function(){return"innerHTML"};function _l(i,e){i[Dm()]=e}function Ep(i){var e=Ta();return i===!0?e.className=ip:(e.className=np,_a(i)?e.appendChild(i):_l(e,i)),e}function Ap(i,e){_a(e.content)?(_l(i,""),i.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?_l(i,e.content):i.textContent=e.content)}function Cl(i){var e=i.firstElementChild,t=Do(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(rp)}),arrow:t.find(function(r){return r.classList.contains(ip)||r.classList.contains(np)}),backdrop:t.find(function(r){return r.classList.contains(im)})}}function bp(i){var e=Ta(),t=Ta();t.className=rm,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=Ta();r.className=rp,r.setAttribute("data-state","hidden"),Ap(r,i.props),e.appendChild(t),t.appendChild(r),s(i.props,i.props);function s(o,u){var h=Cl(e),c=h.box,y=h.content,p=h.arrow;u.theme?c.setAttribute("data-theme",u.theme):c.removeAttribute("data-theme"),typeof u.animation=="string"?c.setAttribute("data-animation",u.animation):c.removeAttribute("data-animation"),u.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof u.maxWidth=="number"?u.maxWidth+"px":u.maxWidth,u.role?c.setAttribute("role",u.role):c.removeAttribute("role"),(o.content!==u.content||o.allowHTML!==u.allowHTML)&&Ap(y,i.props),u.arrow?p?o.arrow!==u.arrow&&(c.removeChild(p),c.appendChild(Ep(u.arrow))):c.appendChild(Ep(u.arrow)):p&&c.removeChild(p)}return{popper:e,onUpdate:s}}bp.$$tippy=!0;var Sm=1,So=[],Dl=[];function Om(i,e){var t=vp(i,Object.assign({},fr,mp(lp(e)))),r,s,o,u=!1,h=!1,c=!1,y=!1,p,A,T,C=[],N=op(ie,t.interactiveDebounce),O,L=Sm++,P=null,W=om(t.plugins),V={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:L,reference:i,popper:Ta(),popperInstance:P,props:t,state:V,plugins:W,clearDelayTimeouts:an,setProps:dr,setContent:ir,show:on,hide:un,hideWithInteractivity:di,enable:Bi,disable:Dr,unmount:Ii,destroy:Fn};if(!t.render)return process.env.NODE_ENV!=="production"&&Tl(!0,"render() function has not been supplied."),b;var Y=t.render(b),z=Y.popper,j=Y.onUpdate;z.setAttribute("data-tippy-root",""),z.id="tippy-"+b.id,b.popper=z,i._tippy=b,z._tippy=b;var tt=W.map(function(H){return H.fn(b)}),Q=i.hasAttribute("aria-expanded");return Re(),Se(),xt(),kt("onCreate",[b]),t.showOnCreate&&pr(),z.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),z.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&pt().addEventListener("mousemove",N)}),b;function K(){var H=b.props.touch;return Array.isArray(H)?H:[H,0]}function rt(){return K()[0]==="hold"}function at(){var H;return!!((H=b.props.render)!=null&&H.$$tippy)}function ct(){return O||i}function pt(){var H=ct().parentNode;return H?pm(H):document}function dt(){return Cl(z)}function B(H){return b.state.isMounted&&!b.state.isVisible||li.isTouch||p&&p.type==="focus"?0:El(b.props.delay,H?0:1,fr.delay)}function xt(H){H===void 0&&(H=!1),z.style.pointerEvents=b.props.interactive&&!H?"":"none",z.style.zIndex=""+b.props.zIndex}function kt(H,nt,ot){if(ot===void 0&&(ot=!0),tt.forEach(function(Et){Et[H]&&Et[H].apply(Et,nt)}),ot){var Mt;(Mt=b.props)[H].apply(Mt,nt)}}function Ue(){var H=b.props.aria;if(H.content){var nt="aria-"+H.content,ot=z.id,Mt=ms(b.props.triggerTarget||i);Mt.forEach(function(Et){var xe=Et.getAttribute(nt);if(b.state.isVisible)Et.setAttribute(nt,xe?xe+" "+ot:ot);else{var Fe=xe&&xe.replace(ot,"").trim();Fe?Et.setAttribute(nt,Fe):Et.removeAttribute(nt)}})}}function Se(){if(!(Q||!b.props.aria.expanded)){var H=ms(b.props.triggerTarget||i);H.forEach(function(nt){b.props.interactive?nt.setAttribute("aria-expanded",b.state.isVisible&&nt===ct()?"true":"false"):nt.removeAttribute("aria-expanded")})}}function ge(){pt().removeEventListener("mousemove",N),So=So.filter(function(H){return H!==N})}function we(H){if(!(li.isTouch&&(c||H.type==="mousedown"))){var nt=H.composedPath&&H.composedPath()[0]||H.target;if(!(b.props.interactive&&cp(z,nt))){if(ms(b.props.triggerTarget||i).some(function(ot){return cp(ot,nt)})){if(li.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else kt("onClickOutside",[b,H]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),h=!0,setTimeout(function(){h=!1}),b.state.isMounted||Ie())}}}function Xr(){c=!0}function qe(){c=!1}function ye(){var H=pt();H.addEventListener("mousedown",we,!0),H.addEventListener("touchend",we,Bn),H.addEventListener("touchstart",qe,Bn),H.addEventListener("touchmove",Xr,Bn)}function Ie(){var H=pt();H.removeEventListener("mousedown",we,!0),H.removeEventListener("touchend",we,Bn),H.removeEventListener("touchstart",qe,Bn),H.removeEventListener("touchmove",Xr,Bn)}function Kt(H,nt){Bt(H,function(){!b.state.isVisible&&z.parentNode&&z.parentNode.contains(z)&&nt()})}function te(H,nt){Bt(H,nt)}function Bt(H,nt){var ot=dt().box;function Mt(Et){Et.target===ot&&(wl(ot,"remove",Mt),nt())}if(H===0)return nt();wl(ot,"remove",A),wl(ot,"add",Mt),A=Mt}function Zt(H,nt,ot){ot===void 0&&(ot=!1);var Mt=ms(b.props.triggerTarget||i);Mt.forEach(function(Et){Et.addEventListener(H,nt,ot),C.push({node:Et,eventType:H,handler:nt,options:ot})})}function Re(){rt()&&(Zt("touchstart",er,{passive:!0}),Zt("touchend",Pe,{passive:!0})),am(b.props.trigger).forEach(function(H){if(H!=="manual")switch(Zt(H,er),H){case"mouseenter":Zt("mouseleave",Pe);break;case"focus":Zt(xm?"focusout":"blur",Te);break;case"focusin":Zt("focusout",Te);break}})}function Ve(){C.forEach(function(H){var nt=H.node,ot=H.eventType,Mt=H.handler,Et=H.options;nt.removeEventListener(ot,Mt,Et)}),C=[]}function er(H){var nt,ot=!1;if(!(!b.state.isEnabled||ee(H)||h)){var Mt=((nt=p)==null?void 0:nt.type)==="focus";p=H,O=H.currentTarget,Se(),!b.state.isVisible&&hm(H)&&So.forEach(function(Et){return Et(H)}),H.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||u)&&b.props.hideOnClick!==!1&&b.state.isVisible?ot=!0:pr(H),H.type==="click"&&(u=!ot),ot&&!Mt&&rr(H)}}function ie(H){var nt=H.target,ot=ct().contains(nt)||z.contains(nt);if(!(H.type==="mousemove"&&ot)){var Mt=It().concat(z).map(function(Et){var xe,Fe=Et._tippy,Sr=(xe=Fe.popperInstance)==null?void 0:xe.state;return Sr?{popperRect:Et.getBoundingClientRect(),popperState:Sr,props:t}:null}).filter(Boolean);dm(Mt,H)&&(ge(),rr(H))}}function Pe(H){var nt=ee(H)||b.props.trigger.indexOf("click")>=0&&u;if(!nt){if(b.props.interactive){b.hideWithInteractivity(H);return}rr(H)}}function Te(H){b.props.trigger.indexOf("focusin")<0&&H.target!==ct()||b.props.interactive&&H.relatedTarget&&z.contains(H.relatedTarget)||rr(H)}function ee(H){return li.isTouch?rt()!==H.type.indexOf("touch")>=0:!1}function pi(){Ni();var H=b.props,nt=H.popperOptions,ot=H.placement,Mt=H.offset,Et=H.getReferenceClientRect,xe=H.moveTransition,Fe=at()?Cl(z).arrow:null,Sr=Et?{getBoundingClientRect:Et,contextElement:Et.contextElement||ct()}:i,ln={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(hn){var gi=hn.state;if(at()){var Hn=dt(),Un=Hn.box;["placement","reference-hidden","escaped"].forEach(function(cn){cn==="placement"?Un.setAttribute("data-placement",gi.placement):gi.attributes.popper["data-popper-"+cn]?Un.setAttribute("data-"+cn,""):Un.removeAttribute("data-"+cn)}),gi.attributes.popper={}}}},gr=[{name:"offset",options:{offset:Mt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!xe}},ln];at()&&Fe&&gr.push({name:"arrow",options:{element:Fe,padding:3}}),gr.push.apply(gr,(nt==null?void 0:nt.modifiers)||[]),b.popperInstance=em(Sr,z,Object.assign({},nt,{placement:ot,onFirstUpdate:T,modifiers:gr}))}function Ni(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function me(){var H=b.props.appendTo,nt,ot=ct();b.props.interactive&&H===sp||H==="parent"?nt=ot.parentNode:nt=ap(H,[ot]),nt.contains(z)||nt.appendChild(z),b.state.isMounted=!0,pi(),process.env.NODE_ENV!=="production"&&Oi(b.props.interactive&&H===fr.appendTo&&ot.nextElementSibling!==z,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
93
-
94
- `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
95
-
96
- `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
97
-
98
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function It(){return Do(z.querySelectorAll("[data-tippy-root]"))}function pr(H){b.clearDelayTimeouts(),H&&kt("onTrigger",[b,H]),ye();var nt=B(!0),ot=K(),Mt=ot[0],Et=ot[1];li.isTouch&&Mt==="hold"&&Et&&(nt=Et),nt?r=setTimeout(function(){b.show()},nt):b.show()}function rr(H){if(b.clearDelayTimeouts(),kt("onUntrigger",[b,H]),!b.state.isVisible){Ie();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(H.type)>=0&&u)){var nt=B(!1);nt?s=setTimeout(function(){b.state.isVisible&&b.hide()},nt):o=requestAnimationFrame(function(){b.hide()})}}function Bi(){b.state.isEnabled=!0}function Dr(){b.hide(),b.state.isEnabled=!1}function an(){clearTimeout(r),clearTimeout(s),cancelAnimationFrame(o)}function dr(H){if(process.env.NODE_ENV!=="production"&&Oi(b.state.isDestroyed,vs("setProps")),!b.state.isDestroyed){kt("onBeforeUpdate",[b,H]),Ve();var nt=b.props,ot=vp(i,Object.assign({},nt,lp(H),{ignoreAttributes:!0}));b.props=ot,Re(),nt.interactiveDebounce!==ot.interactiveDebounce&&(ge(),N=op(ie,ot.interactiveDebounce)),nt.triggerTarget&&!ot.triggerTarget?ms(nt.triggerTarget).forEach(function(Mt){Mt.removeAttribute("aria-expanded")}):ot.triggerTarget&&i.removeAttribute("aria-expanded"),Se(),xt(),j&&j(nt,ot),b.popperInstance&&(pi(),It().forEach(function(Mt){requestAnimationFrame(Mt._tippy.popperInstance.forceUpdate)})),kt("onAfterUpdate",[b,H])}}function ir(H){b.setProps({content:H})}function on(){process.env.NODE_ENV!=="production"&&Oi(b.state.isDestroyed,vs("show"));var H=b.state.isVisible,nt=b.state.isDestroyed,ot=!b.state.isEnabled,Mt=li.isTouch&&!b.props.touch,Et=El(b.props.duration,0,fr.duration);if(!(H||nt||ot||Mt)&&!ct().hasAttribute("disabled")&&(kt("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,at()&&(z.style.visibility="visible"),xt(),ye(),b.state.isMounted||(z.style.transition="none"),at()){var xe=dt(),Fe=xe.box,Sr=xe.content;bl([Fe,Sr],0)}T=function(){var gr;if(!(!b.state.isVisible||y)){if(y=!0,z.offsetHeight,z.style.transition=b.props.moveTransition,at()&&b.props.animation){var kn=dt(),hn=kn.box,gi=kn.content;bl([hn,gi],Et),hp([hn,gi],"visible")}Ue(),Se(),up(Dl,b),(gr=b.popperInstance)==null||gr.forceUpdate(),kt("onMount",[b]),b.props.animation&&at()&&te(Et,function(){b.state.isShown=!0,kt("onShown",[b])})}},me()}}function un(){process.env.NODE_ENV!=="production"&&Oi(b.state.isDestroyed,vs("hide"));var H=!b.state.isVisible,nt=b.state.isDestroyed,ot=!b.state.isEnabled,Mt=El(b.props.duration,1,fr.duration);if(!(H||nt||ot)&&(kt("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,y=!1,u=!1,at()&&(z.style.visibility="hidden"),ge(),Ie(),xt(!0),at()){var Et=dt(),xe=Et.box,Fe=Et.content;b.props.animation&&(bl([xe,Fe],Mt),hp([xe,Fe],"hidden"))}Ue(),Se(),b.props.animation?at()&&Kt(Mt,b.unmount):b.unmount()}}function di(H){process.env.NODE_ENV!=="production"&&Oi(b.state.isDestroyed,vs("hideWithInteractivity")),pt().addEventListener("mousemove",N),up(So,N),N(H)}function Ii(){process.env.NODE_ENV!=="production"&&Oi(b.state.isDestroyed,vs("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(Ni(),It().forEach(function(H){H._tippy.unmount()}),z.parentNode&&z.parentNode.removeChild(z),Dl=Dl.filter(function(H){return H!==b}),b.state.isMounted=!1,kt("onHidden",[b]))}function Fn(){process.env.NODE_ENV!=="production"&&Oi(b.state.isDestroyed,vs("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),Ve(),delete i._tippy,b.state.isDestroyed=!0,kt("onDestroy",[b]))}}function Da(i,e){e===void 0&&(e={});var t=fr.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(bm(i),xp(e,t)),mm();var r=Object.assign({},e,{plugins:t}),s=fm(i);if(process.env.NODE_ENV!=="production"){var o=_a(r.content),u=s.length>1;Oi(o&&u,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
99
-
100
- `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
101
-
102
- `,`1) content: element.innerHTML
103
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var h=s.reduce(function(c,y){var p=y&&Om(y,r);return p&&c.push(p),c},[]);return _a(i)?h[0]:h}Da.defaultProps=fr,Da.setDefaultProps=_m,Da.currentInput=li,Object.assign({},Uf,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),Da.setDefaultProps({render:bp});let Mm=0;const rn=Da(document.body,{theme:"translucent",animation:"scale",inertia:!0,delay:[200,100],content:"",allowHTML:!0,placement:"left-start",trigger:"manual",arrow:!0});class Sl{constructor(e,t){d(this,"name","Label");d(this,"id","Label"+Mm++);d(this,"el");d(this,"position",new k);this.container=e,this.text=t,e?this.container=e:this.container=document.getElementsByTagName("body")[0],this.text=t}get isMounted(){return rn.state.isMounted}get isShown(){return rn.state.isShown}destroy(){this.text="",this.position.identity()}setHtml(e=""){return this.text=e,this}update(e){e&&(this.position.copy(e),rn.show())}show(e){return Tt(this,null,function*(){if(e)return yield this.hide(),this.position.copy(e),rn.setContent(this.text),rn.setProps({getReferenceClientRect:()=>({width:0,height:0,right:this.position.x,left:this.position.x,bottom:this.position.y,top:this.position.y,x:this.position.x,y:this.position.y,toJSON(){}})}),rn.clearDelayTimeouts(),rn.show(),new Promise(t=>{Rt.delay(function(){t()},300)})})}hide(){return Tt(this,null,function*(){return rn.hide(),new Promise(e=>{Rt.delay(function(){e()},100)})})}}let Lm=0;class Nm extends Ke{constructor(t,r){var o,u;super();d(this,"name","DummyPoint");d(this,"id","dummyPoint"+Lm++);d(this,"container");d(this,"offset",new k);d(this,"el");d(this,"label");d(this,"radius",10);d(this,"position",new k);d(this,"worldPosition",new k);d(this,"userData");t?this.container=t:this.container=document.getElementsByTagName("body")[0];let s=this.container.getBoundingClientRect();this.offset.set(s.left,s.top),this.userData=r,(o=this.userData)!=null&&o.type||Rt.set(this,"userData.type",Mn.DEFAULT),this.initDom(),this.setType((u=this.userData)==null?void 0:u.type),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){var t;this.el&&((t=this.el)!=null&&t.parentNode||this.container.appendChild(this.el))}unmount(){var t,r,s,o;(r=(t=this.el)==null?void 0:t.parentNode)==null||r.removeChild(this.el),(s=this.el)==null||s.remove(),(o=this.label)==null||o.hide()}setText(t=""){return this.el?(this.el.innerText=t,this):this}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-point"),this.el.setAttribute(cs+"-id",(t=this.userData)==null?void 0:t.value)}initLabel(){var t;(t=this.userData)!=null&&t.label&&(this.label=new Sl(this.container,this.userData.label))}setActive(t){return t?(da(this.el,"active"),this.showLabel()):(ga(this.el,"active"),this.hideLabel()),this}showLabel(){var t;(t=this.label)==null||t.show(Bm.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var s;if(!this.userData)return this;const r=(s=this.userData)==null?void 0:s.type;return t||(t=Mn.DEFAULT),r&&Ao(this.el,r)&&ga(this.el,r),this.userData.type=t,da(this.el,this.userData.type),this}update(t,r=!1){!t||!this.isMounted||(r||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const Bm=new k;let Im=0;class Rm extends Ke{constructor(t,r){super();d(this,"name","DummyRect");d(this,"id","dummyRect"+Im++);d(this,"container");d(this,"offset",new k);d(this,"el");d(this,"radius",10);d(this,"position",new k);d(this,"worldPosition",new k);d(this,"label");d(this,"userData");t?this.container=t:this.container=document.getElementsByTagName("body")[0];let s=this.container.getBoundingClientRect();this.offset.set(s.left,s.top),this.userData=r,this.initDom(),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){this.container.appendChild(this.el)}unmount(){var t,r,s,o;this.setText(""),(r=(t=this.el)==null?void 0:t.parentNode)==null||r.removeChild(this.el),(s=this.el)==null||s.remove(),(o=this.label)==null||o.hide()}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-rect"),this.el.setAttribute(cs+"-id",((t=this.userData)==null?void 0:t.rmId)||"undefined")}initLabel(){this.label=new Sl(this.container,"")}setText(t=""){return this.el.innerText=t,this}setActive(t){return t?da(this.el,"active"):ga(this.el,"active"),this}showLabel(){var t;(t=this.label)==null||t.show(Pm.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var s;if(!this.userData)return this;const r=(s=this.userData)==null?void 0:s.type;return t=Mn.DEFAULT,r&&Ao(this.el,r)&&ga(this.el,r),this.userData.type=t,da(this.el,this.userData.type),this}update(t,r=!1){!t||!this.isMounted||(r||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const Pm=new k;class Fm extends Ke{constructor(t,r){super();d(this,"name","Dummies");d(this,"container");d(this,"controller");d(this,"scene");d(this,"viewMatrix",new ce);d(this,"dummies",[]);d(this,"rmMap",new Map);d(this,"mergedMap",new Map);d(this,"cameraUpdateHandler",this.handleCameraUpdate.bind(this));d(this,"controllerTapHandler",this.handleControllerTap.bind(this));this.container=t,this.controller=r,this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.clearDummies()}bindEvents(){this.controller.camera.addEventListener(bo.UPDATE,this.cameraUpdateHandler),this.controller.addEventListener(ft.TAP,this.controllerTapHandler)}unbindEvents(){this.controller.camera.removeEventListener(bo.UPDATE,this.cameraUpdateHandler),this.controller.removeEventListener(ft.TAP,this.controllerTapHandler)}bindScene(t){this.scene=t}update(t){var r,s,o;if(t){this.viewMatrix.copy(t);for(let u=0,h=(this.dummies||[]).length;u<h;u++){const c=this.dummies[u],y=(s=this.scene)==null?void 0:s.getElementById((r=c.userData)==null?void 0:r.rmId);if(y){const p=(o=this.scene)==null?void 0:o.chef.getElementBoundingBox(y.id);p==null||p.getCenter(nn),nn.applyMatrix3(this.viewMatrix).round(),c.position.copy(nn)}else nn.copy(c.worldPosition).applyMatrix3(this.viewMatrix).round(),c.update(nn)}this.mergeDummies()}}setDummies(t){this.clearDummies();for(let r=0,s=(t||[]).length;r<s;r++)this.addDummy(t[r])}addDummy(t){var o,u;const r=new Nm(this.container,t);this.dummies.push(r);const s=(o=r.userData)==null?void 0:o.rmId;return s&&(this.rmMap.has(s)||this.rmMap.set(s,[]),(u=this.rmMap.get(s))==null||u.push(r)),r}removeDummy(t){var o;const r=this.dummies.indexOf(t);r>-1&&this.dummies.splice(r,1);const s=(o=t.userData)==null?void 0:o.rmId;if(s){const u=this.mergedMap.get(s);u==null||u.destroy(),this.mergedMap.delete(s);const h=this.rmMap.get(s);if(!h)return;if(h.length===1)this.rmMap.delete(s);else{const c=h.indexOf(t);c>-1&&(h.splice(c,1),this.rmMap.set(s,h))}}t.destroy()}clearDummies(t){var r,s,o;for(let u=(((r=this.dummies)==null?void 0:r.length)||0)-1;u>=0;u--){const h=this.dummies[u];(!t||(s=h==null?void 0:h.userData)!=null&&s.type&&(t!=null&&t.includes((o=h.userData)==null?void 0:o.type)))&&this.removeDummy(h)}t||(this.dummies.length=0,this.mergedMap.clear(),this.rmMap.clear())}mergeDummies(){this.rmMap.forEach((t,r)=>{var o,u,h,c;if((o=this.scene)==null?void 0:o.getElementById(r)){const y=(u=this.scene)==null?void 0:u.chef.getElementBoundingBox(r);if(!y)return;Ol.copy(y).applyMatrix3(this.viewMatrix).round(),Ol.getSize(nn);const p=t[0].radius,A=Ol.centralArrange(t.length,p*2,p*2);if(nn.x<p*3||nn.y<p*3){t.forEach(C=>C.unmount());const T=this.mergedMap.get(r);T==null||T.unmount()}else if(Array.isArray(A))this.mergedMap.has(r)&&((h=this.mergedMap.get(r))==null||h.unmount()),t.forEach((T,C)=>{T.isMounted||T.mount(),T.update(A[C])});else{t.forEach(N=>N.unmount());let T=this.mergedMap.get(r);if(T)T.isMounted||T.mount();else{const N=Rt.cloneDeep(t[0].userData)||{},O=Rt.reduce(t,(P,W)=>{var V,b;return(V=W.userData)!=null&&V.label&&P.push((b=W.userData)==null?void 0:b.label),P},[]);N.label=O.join(", ");const L=Rt.reduce(t,(P,W)=>{var V,b;return(V=W.userData)!=null&&V.value&&P.push((b=W.userData)==null?void 0:b.value),P},[]);N.value=L.join(","),N.rmId=r,T=new Rm(this.container,N),this.mergedMap.set(r,T)}T.setText(t.length.toString());const C=Rt.reduce(t,(N,O)=>{var L,P;return(L=O.userData)!=null&&L.label&&N.push((P=O.userData)==null?void 0:P.label),N},[]);(c=T.label)==null||c.setHtml(C.join(", <br />")),T.update(t[0].position)}}})}getDummyById(t){return this.dummies.find(r=>{var s;return((s=r.userData)==null?void 0:s.value)===t})}setActiveByIds(t){var r,s;if(this.resetActives(),!!t&&(Array.isArray(t)||(t=[t]),!!(t!=null&&t.length)))for(let o=0,u=t.length;o<u;o++){const h=this.getDummyById(t[o]);if(h&&h.setActive(!0),h&&((r=h.userData)!=null&&r.rmId)){const c=this.mergedMap.get((s=h.userData)==null?void 0:s.rmId);c&&c.setActive(!0)}}}resetActives(){this.dummies.forEach(t=>t.setActive(!1)),this.mergedMap.forEach(t=>t.setActive(!1))}showDummyLabel(t){if(!t)return;const r=this.getDummyById(t);r&&r.showLabel();const s=this.mergedMap.get(t);s&&s.showLabel()}hideDummyLabel(){return Tt(this,null,function*(){this.dummies.forEach(t=>t.hideLabel()),this.mergedMap.forEach(t=>t.hideLabel())})}handleCameraUpdate(){this.update(this.controller.camera.viewMatrix)}handleControllerTap(t){var o,u,h,c,y;if((t==null?void 0:t.type)!==ft.TAP)return;const r=((o=t==null?void 0:t.e)==null?void 0:o.target)||((h=(u=t==null?void 0:t.e)==null?void 0:u.srcEvent)==null?void 0:h.target)||((y=(c=t==null?void 0:t.e)==null?void 0:c.srcEvent)==null?void 0:y.srcElement),s=r==null?void 0:r.getAttribute(cs+"-id");s&&console.warn("【TODO】handleControllerTap: ",s)}}const nn=new k,Ol=new Ot;(function(){return window[tn.prefixed(window,"requestAnimationFrame")]||function(i){window.setTimeout(i,1e3/60)}})();class km extends Ke{constructor(t,r,s=!0){super();d(this,"name","DragController");d(this,"dragFake",!1);d(this,"container");d(this,"offset",new k);d(this,"controller");d(this,"scene");d(this,"raycaster");d(this,"dummies");d(this,"_els",[]);d(this,"_hms",new Map);d(this,"_vos",new Map);d(this,"_elMap",new Map);d(this,"_panType",Mn.SUCCESS);d(this,"onPanHandler",this.handleOnPan.bind(this));d(this,"panEndHandler",Rt.debounce(this.handlePanEnd.bind(this),500));this.container=t;let o=this.container.getBoundingClientRect();this.offset.set(o.left,o.top),this.controller=r,this.dummies=new Fm(t,r),this.raycaster=new Pf,this.dragFake=s}destroy(){var t;super.destroy();for(let r=(((t=this._els)==null?void 0:t.length)||0)-1;r>=0;r--)this.drop(this._els[r]);this.dummies.destroy()}bindScene(t){var r;this.scene=t,(r=this.dummies)==null||r.bindScene(t)}drag(t,r){t&&(this._els.includes(t)||(this.bindEvent(t),this._els.push(t),this._vos.set(t,r)))}drop(t){if(!t)return;this.unbindEvent(t),this._vos.delete(t),this._elMap.delete(t);const r=this._els.findIndex(s=>s===t);r>-1&&this._els.splice(r,1)}bindEvent(t){if(!t)return;const r=new tn.Manager(t,{domEvents:!0});r.add(new tn.Pan({threshold:0,pointers:0})),r.on(["panstart","panmove","panend"].join(" "),this.onPanHandler),this._hms.set(t,r)}unbindEvent(t){if(!t)return;const r=this._hms.get(t);r&&(r.off(["panstart","panmove","panend"].join(" "),this.onPanHandler),r.destroy(),this._hms.delete(t))}handleOnPan(t){if(typeof t.preventDefault=="function"&&t.preventDefault(),typeof t.srcEvent.stopPropagation=="function"&&t.srcEvent.stopPropagation(),typeof t.srcEvent.stopImmediatePropagation=="function"&&t.srcEvent.stopImmediatePropagation(),!this.controller)return;t.type==="panstart"||t.isFirst?this.controller.enablePan=!1:t.type==="panmove"||t.type==="panend"&&(this.controller.enablePan=!0);const r=this._vos.get(t.target);if(!r)return;const s=Rt.cloneDeep(r);s.type=this._panType;const o=this._getDummy(t.target,s);Sa.set(t.center.x,t.center.y).sub(this.offset),o.worldPosition.copy(Sa).unproject(this.controller.camera),o.update(Sa),this.panEndHandler({type:"panend",e:t})}handlePanEnd(t){if((t==null?void 0:t.type)!=="panend")return;const r=this.getDummies(!0);this.dispatchEvent({type:"panend",data:r})}getDummies(t=!0){const r=[];return this._els.forEach(s=>{var u;let o=this._vos.get(s);if(!(!o||o.type!==Mn.SUCCESS)){if(t){const h=this._elMap.get(s);if(!h||!this.controller.camera)return;Sa.copy(h.position),this.raycaster.setFromCamera(Sa,this.controller.camera);const c=[];if((u=this.scene)==null||u.getIntersectObjects(this.raycaster,Qe.RM,c),!(c!=null&&c.length))return;o=Rt.cloneDeep(o),o.rmId=c[0].id}r.push(o)}}),r}setDummiesByVos(t){var r,s;for(let o=0,u=(t||[]).length;o<u;o++){const h=(r=this.dummies)==null?void 0:r.addDummy(t[o]);if(!h)continue;const c=Rt.cloneDeep(t[o]);delete c.rmId,delete c.wsId,this.drag(h.el,c)}(s=this.dummies)==null||s.update(this.controller.camera.viewMatrix)}clearDummies(t){var r,s;for(let o=(((r=this._els)==null?void 0:r.length)||0)-1;o>=0;o--){const u=this._vos.get(this._els[o]);(!t||t&&(u!=null&&u.type)&&t.includes(u.type))&&this.drop(this._els[o])}(s=this.dummies)==null||s.clearDummies(t)}getDummyById(t){return this.dummies.getDummyById(t)}highlightDummies(t){var r;(r=this.dummies)==null||r.setActiveByIds(t)}resetHighlightDummies(){var t;(t=this.dummies)==null||t.resetActives()}showDummyLabel(t){var r;(r=this.dummies)==null||r.showDummyLabel(t)}start(){}_getDummy(t,r){let s=this._elMap.get(t);if(s||(s=this.dummies.addDummy(r).setType(Mn.SUCCESS),this._elMap.set(t,s)),s.isMounted||s.mount(),this.dummies.dummies.includes(s)||this.dummies.dummies.push(s),!this._elMap.get(s.el)){this._elMap.set(s.el,s);const u=Rt.cloneDeep(r);delete u.rmId,delete u.wsId,this.drag(s.el,u)}return s}}const Sa=new k;var xs=Object.freeze({Linear:Object.freeze({None:function(i){return i},In:function(i){return i},Out:function(i){return i},InOut:function(i){return i}}),Quadratic:Object.freeze({In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}}),Cubic:Object.freeze({In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}}),Quartic:Object.freeze({In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}}),Quintic:Object.freeze({In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}}),Sinusoidal:Object.freeze({In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}}),Exponential:Object.freeze({In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}}),Circular:Object.freeze({In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}}),Elastic:Object.freeze({In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(i){var e=1.70158;return i===1?1:i*i*((e+1)*i-e)},Out:function(i){var e=1.70158;return i===0?0:--i*i*((e+1)*i+e)+1},InOut:function(i){var e=2.5949095;return(i*=2)<1?.5*(i*i*((e+1)*i-e)):.5*((i-=2)*i*((e+1)*i+e)+2)}}),Bounce:Object.freeze({In:function(i){return 1-xs.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?xs.Bounce.In(i*2)*.5:xs.Bounce.Out(i*2-1)*.5+.5}}),generatePow:function(i){return i===void 0&&(i=4),i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(e){return Math.pow(e,i)},Out:function(e){return 1-Math.pow(1-e,i)},InOut:function(e){return e<.5?Math.pow(e*2,i)/2:(1-Math.pow(2-e*2,i))/2+.5}}}}),Es=function(){return performance.now()},wp=function(){function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return i.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},i.prototype.removeAll=function(){this._tweens={}},i.prototype.add=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var s=0,o=t;s<o.length;s++){var u=o[s];(e=u._group)===null||e===void 0||e.remove(u),u._group=this,this._tweens[u.getId()]=u,this._tweensAddedDuringUpdate[u.getId()]=u}},i.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,s=e;r<s.length;r++){var o=s[r];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},i.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},i.prototype.update=function(e,t){e===void 0&&(e=Es()),t===void 0&&(t=!0);var r=Object.keys(this._tweens);if(r.length!==0)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<r.length;s++){var o=this._tweens[r[s]],u=!t;o&&o.update(e,u)===!1&&!t&&this.remove(o)}r=Object.keys(this._tweensAddedDuringUpdate)}},i}(),In={Linear:function(i,e){var t=i.length-1,r=t*e,s=Math.floor(r),o=In.Utils.Linear;return e<0?o(i[0],i[1],r):e>1?o(i[t],i[t-1],t-r):o(i[s],i[s+1>t?t:s+1],r-s)},Bezier:function(i,e){for(var t=0,r=i.length-1,s=Math.pow,o=In.Utils.Bernstein,u=0;u<=r;u++)t+=s(1-e,r-u)*s(e,u)*i[u]*o(r,u);return t},CatmullRom:function(i,e){var t=i.length-1,r=t*e,s=Math.floor(r),o=In.Utils.CatmullRom;return i[0]===i[t]?(e<0&&(s=Math.floor(r=t*(1+e))),o(i[(s-1+t)%t],i[s],i[(s+1)%t],i[(s+2)%t],r-s)):e<0?i[0]-(o(i[0],i[0],i[1],i[1],-r)-i[0]):e>1?i[t]-(o(i[t],i[t],i[t-1],i[t-1],r-t)-i[t]):o(i[s?s-1:0],i[s],i[t<s+1?t:s+1],i[t<s+2?t:s+2],r-s)},Utils:{Linear:function(i,e,t){return(e-i)*t+i},Bernstein:function(i,e){var t=In.Utils.Factorial;return t(i)/t(e)/t(i-e)},Factorial:function(){var i=[1];return function(e){var t=1;if(i[e])return i[e];for(var r=e;r>1;r--)t*=r;return i[e]=t,t}}(),CatmullRom:function(i,e,t,r,s){var o=(t-i)*.5,u=(r-e)*.5,h=s*s,c=s*h;return(2*e-2*t+o+u)*c+(-3*e+3*t-2*o-u)*h+o*s+e}}},Ml=function(){function i(){}return i.nextId=function(){return i._nextId++},i._nextId=0,i}(),Ll=new wp,Hm=function(){function i(e,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=xs.Linear.None,this._interpolationFunction=In.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Ml.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof t=="object"?(this._group=t,t.add(this)):t===!0&&(this._group=Ll,Ll.add(this))}return i.prototype.getId=function(){return this._id},i.prototype.isPlaying=function(){return this._isPlaying},i.prototype.isPaused=function(){return this._isPaused},i.prototype.getDuration=function(){return this._duration},i.prototype.to=function(e,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},i.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},i.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},i.prototype.start=function(e,t){if(e===void 0&&(e=Es()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},i.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},i.prototype._setupProperties=function(e,t,r,s,o){for(var u in r){var h=e[u],c=Array.isArray(h),y=c?"array":typeof h,p=!c&&Array.isArray(r[u]);if(!(y==="undefined"||y==="function")){if(p){var A=r[u];if(A.length===0)continue;for(var T=[h],C=0,N=A.length;C<N;C+=1){var O=this._handleRelativeValue(h,A[C]);if(isNaN(O)){p=!1,console.warn("Found invalid interpolation list. Skipping.");break}T.push(O)}p&&(r[u]=T)}if((y==="object"||c)&&h&&!p){t[u]=c?[]:{};var L=h;for(var P in L)t[u][P]=L[P];s[u]=c?[]:{};var A=r[u];if(!this._isDynamic){var W={};for(var P in A)W[P]=A[P];r[u]=A=W}this._setupProperties(L,t[u],A,s[u],o)}else(typeof t[u]=="undefined"||o)&&(t[u]=h),c||(t[u]*=1),p?s[u]=r[u].slice().reverse():s[u]=t[u]||0}}},i.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},i.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},i.prototype.pause=function(e){return e===void 0&&(e=Es()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},i.prototype.resume=function(e){return e===void 0&&(e=Es()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},i.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},i.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},i.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},i.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},i.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},i.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},i.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},i.prototype.easing=function(e){return e===void 0&&(e=xs.Linear.None),this._easingFunction=e,this},i.prototype.interpolation=function(e){return e===void 0&&(e=In.Linear),this._interpolationFunction=e,this},i.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},i.prototype.onStart=function(e){return this._onStartCallback=e,this},i.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},i.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},i.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},i.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},i.prototype.onStop=function(e){return this._onStopCallback=e,this},i.prototype.update=function(e,t){var r=this,s;if(e===void 0&&(e=Es()),t===void 0&&(t=i.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(t)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var u=e-this._startTime,h=this._duration+((s=this._repeatDelayTime)!==null&&s!==void 0?s:this._delayTime),c=this._duration+this._repeat*h,y=function(){if(r._duration===0||u>c)return 1;var O=Math.trunc(u/h),L=u-O*h,P=Math.min(L/r._duration,1);return P===0&&u===r._duration?1:P},p=y(),A=this._easingFunction(p);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,A),this._onUpdateCallback&&this._onUpdateCallback(this._object,p),this._duration===0||u>=this._duration)if(this._repeat>0){var T=Math.min(Math.trunc((u-this._duration)/h)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=T);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=h*T,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var C=0,N=this._chainedTweens.length;C<N;C++)this._chainedTweens[C].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},i.prototype._updateProperties=function(e,t,r,s){for(var o in r)if(t[o]!==void 0){var u=t[o]||0,h=r[o],c=Array.isArray(e[o]),y=Array.isArray(h),p=!c&&y;p?e[o]=this._interpolationFunction(h,s):typeof h=="object"&&h?this._updateProperties(e[o],u,h,s):(h=this._handleRelativeValue(u,h),typeof h=="number"&&(e[o]=u+(h-u)*s))}},i.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},i.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},i.autoStartOnUpdate=!1,i}(),Um="25.0.0",qm=Ml.nextId,hi=Ll,Vm=hi.getAll.bind(hi),Wm=hi.removeAll.bind(hi),zm=hi.add.bind(hi),$m=hi.remove.bind(hi),Gm=hi.update.bind(hi),Oo={Easing:xs,Group:wp,Interpolation:In,now:Es,Sequence:Ml,nextId:qm,Tween:Hm,VERSION:Um,getAll:Vm,removeAll:Wm,add:zm,remove:$m,update:Gm};class Ym extends Ke{constructor(t={}){super();d(this,"name","View");d(this,"params");d(this,"visible",!0);d(this,"cvs");d(this,"scene");d(this,"scenes",[]);d(this,"camera");d(this,"controller");d(this,"tween");d(this,"animateDuration");this.params=t,this.animateDuration=this.params.animateDuration||300,this.cvs=t.cvs,this.camera=new If(t.camera||{})}destroy(){this.controller&&this.controller.destroy(),this.camera&&this.camera.destroy(),this.scene&&this.scene.destroy(),this.scenes.forEach(t=>t.destroy()),this.scenes.length=0,super.destroy()}bindScene(t){this.scenes.push(t),this.reset(),this.scene=t,t.isStatic}saveCameraPosition(t){As.copy(this.camera.boundingBoxWorld);const r=t?Cr+t:Cr;sessionStorage.setItem(r,JSON.stringify(As))}clearCameraPosition(t){const r=t?Cr+t:Cr;sessionStorage.setItem(r,"")}restoreCameraPosition(t){const r=t?Cr+t:Cr,s=sessionStorage.getItem(r);s&&(As.copy(JSON.parse(s)),this.resetCameraByBoundingBox(As,!0))}fullscreen(t=10,r=!1){this.scene&&(this.scene.boundingBox.isEmpty()&&this.scene.computeBoundingBox(),As.copy(this.scene.boundingBox).expandByVector(Mo.set(t,t)),this.resetCameraByBoundingBox(As,r))}handleCameraChanged(t){console.warn("handleCameraChanged: ",t.target.camera.position.z,t.target.camera.scaled.x)}reset(){}resetCameraByBoundingBox(t,r=!1){return Tt(this,null,function*(){if(!this.camera)return;if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!r)return this.camera.setByBox(t),Promise.resolve();const s=this.camera.getCameraPosition();t.getCenter(Mo),t.getSize(Nl);const o=Math.max(Nl.x/this.camera.width,Nl.y/this.camera.height),u={x:Mo.x,y:Mo.y,z:0,s:o,r:0};yield this.animateCamera(s,u)})}animateCamera(t,r){return Tt(this,null,function*(){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(s=>{this.tween=new Oo.Tween(t).to(r,this.animateDuration).easing(Oo.Easing.Exponential.Out).onUpdate(o=>{this.camera.position.set(o.x,o.y),this.camera.scaled.set(o.s,o.s),this.camera.rotation.set(o.r,o.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),s()}).start()})})}computeBoundingBox(t,r=new Ot){return!t||!t.length||(r.makeEmpty(),t.forEach(s=>r.union(s.computeBoundingBox()))),r}expandScenesBoundingBox(t,r=new Ot){t.forEach(s=>s.boundingBox.union(r))}update(t){this.tween&&this.tween.update(t)}}const Cr="camera_position_",Mo=new k,Nl=new k,As=new Ot;class Zm extends Ke{constructor(t={}){super();d(this,"name","SvgView");d(this,"params");d(this,"container");d(this,"offset",new k);d(this,"camera");d(this,"controller");d(this,"scene");d(this,"p1",new k);d(this,"p2",new k);d(this,"graph");d(this,"multiSelector");d(this,"dummiesController");d(this,"zoomToSelectEnable",!1);d(this,"zoomBox",new Ot);d(this,"selectEnable",!1);d(this,"multiSelectEnable",!1);d(this,"fnEnable",!1);d(this,"tween");d(this,"animateDuration");d(this,"label");d(this,"controllerPanStartHandler",this.handlePanStart.bind(this));d(this,"controllerPanEndHandler",this.handlePanEnd.bind(this));d(this,"controllerPanMoveHandler",this.handleControllerPanMove.bind(this));d(this,"controllerPointerOverHandler",this.handleControllerPointerOver.bind(this));d(this,"multiSelectorSelectedHandler",this.handleMultiSelectorSelected.bind(this));d(this,"_currentAssetId");this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.camera||(this.params.camera={}),this.params.camera.flipY=!0,this.animateDuration=this.params.animateDuration||300,this.camera=new If(this.params.camera),this.container=this.params.containerId?document.getElementById(this.params.containerId):Vt.window.document.getElementsByTagName("body")[0];let r=this.container.getBoundingClientRect();this.offset.set(r.left,r.top),this.controller=new Bf(this.container,this.camera,!0),this.graph=new ol(this.container),this.multiSelector=new Q2(this.container,this.controller),this.dummiesController=new km(this.container,this.controller),this.bindControllerEvents(),this.initLabel()}destroy(){var t;this.unbindControllerEvents(),super.destroy(),(t=this.label)==null||t.destroy()}initLabel(){this.label=new Sl(this.container,"")}showAssetsLabel(t,r,s){var u,h,c,y,p;if(!r)return;t||(t=(u=this.scene)==null?void 0:u.assetType);const o=(h=this.scene)==null?void 0:h.chef.getElementBoundingBox(r);o&&!o.isEmpty()&&(s||(s=(c=this.scene)==null?void 0:c.getAssetLabelById(t,r),s||(s=r)),(y=this.label)==null||y.setHtml(s),Rn.copy(o.min).applyMatrix3(this.camera.viewMatrix).add(this.offset).round(),(p=this.label)==null||p.show(Rn))}hideAssetsLabel(){return Tt(this,null,function*(){var t;return(t=this.label)==null?void 0:t.hide()})}bindScene(t){var r;this.scene=t,this.multiSelector.bindScene(this.scene),(r=this.dummiesController)==null||r.bindScene(this.scene)}resize(){var t,r;(t=this.camera)==null||t.resize(),(r=this.controller)==null||r.resize(),console.log("【svgView】resize: ",this.params.width,this.params.height)}setByBox(t,r=!0){return Tt(this,null,function*(){yield this.resetCameraByBoundingBox(t,r)})}zoomIn(){this.controller.scaled=this.camera.scaled.x*.9,this.controller.update()}zoomOut(){this.controller.scaled=this.camera.scaled.x*1.1,this.controller.update()}zoomToSelectEnableChanged(t){console.log("TODO: zoomToSelectEnableChanged: ",t),this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}selectEnableChanged(t){this.selectEnable=!!t,this.multiSelector.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.multiSelector.multiSelectEnableChanged(t)}fnEnableChanged(t){this.fnEnable=!!t,this.multiSelector.fnEnableChanged(t)}getIntersectObjects(t,r,s=[]){return this.scene?this.scene.getIntersectObjects(t,r,s):s}focusAt(t,r=500){return Tt(this,null,function*(){return this.camera?(Jt.setFromCenterAndSize(t,Rn.set(r*2,r*2)),this.resetCameraByBoundingBox(Jt,!0)):Promise.resolve()})}focusAtById(t,r=500){return Tt(this,null,function*(){var o;const s=(o=this.scene)==null?void 0:o.getBoundingBoxById(t);if(console.log("focusAtById: ",t,s==null?void 0:s.toString()),s){s.expandByScalar(r),Jt.copy(this.camera.boundingBoxWorld),Jt.containsBox(s)||(yield this.resetCameraByBoundingBox(s,!0));return}})}focusAtDummy(t,r=500){return Tt(this,null,function*(){var u,h;const s=this.dummiesController.getDummyById(t),o=(u=s==null?void 0:s.userData)==null?void 0:u.rmId;if(o){const c=(h=this.scene)==null?void 0:h.getBoundingBoxById(o);if(c){c.expandByScalar(r),Jt.copy(this.camera.boundingBoxWorld),Jt.containsBox(c)||(yield this.resetCameraByBoundingBox(c,!0));return}}if(s!=null&&s.position&&!(s!=null&&s.position.isEmpty())){Jt.setFromCenterAndSize(s.worldPosition,Rn.set(r*2,r*2)),this.camera.boundingBoxWorld.containsBox(Jt)||(yield this.resetCameraByBoundingBox(Jt,!0));return}})}resetCameraByBoundingBox(t,r=!1){return Tt(this,null,function*(){if(!this.camera)return Promise.resolve();if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!r)return this.camera.setByBox(t),Promise.resolve();const s=this.camera.getCameraPosition();t.getCenter(Rn),t.getSize(Bl);const o=Math.max(Bl.x/this.camera.width,Bl.y/this.camera.height),u={x:Rn.x,y:Rn.y,z:0,s:o,r:0};yield this.animateCamera(s,u)})}animateCamera(t,r){return Tt(this,null,function*(){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(s=>{this.tween=new Oo.Tween(t).to(r,this.animateDuration).easing(Oo.Easing.Exponential.Out).onUpdate(o=>{this.camera.position.set(o.x,o.y),this.camera.scaled.set(o.s,o.s),this.camera.rotation.set(o.r,o.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),s()}).start()})})}fullscreen(){this.scene&&(this.scene&&!this.scene.viewBox.isEmpty()?Jt.copy(this.scene.viewBox):(this.scene.updateMatrixWorld(!0),this.scene.computeBoundingBox(),Jt.copy(this.scene.boundingBox)),this.resetCameraByBoundingBox(Jt,!0))}saveCameraPosition(t){Jt.copy(this.camera.boundingBoxWorld);const r=t?Cr+t:Cr;sessionStorage.setItem(r,JSON.stringify(Jt))}restoreCameraPosition(t){const r=t?Cr+t:Cr,s=sessionStorage.getItem(r);if(!s)return this.fullscreen();Jt.copy(JSON.parse(s)),this.resetCameraByBoundingBox(Jt,!0)}clearCameraPosition(t){const r=t?Cr+t:Cr;sessionStorage.setItem(r,"")}bindControllerEvents(){this.controller.addEventListener(ft.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ft.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(ft.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ft.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.addEventListener(hl.SELECTED,this.multiSelectorSelectedHandler)}unbindControllerEvents(){this.controller.removeEventListener(ft.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ft.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(ft.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ft.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.removeEventListener(hl.SELECTED,this.multiSelectorSelectedHandler)}handlePanStart(t){if(!((t==null?void 0:t.type)!==ft.PAN_START&&(t==null?void 0:t.type)!==ft.WHEEL_START)&&this.zoomToSelectEnable){this.p1.copy(t.data.screenCoords),Jt.makeEmpty().expandByPoint(this.p1),this.graph.draw(Jt);return}}handlePanEnd(t){if(!((t==null?void 0:t.type)!==ft.PAN_END&&(t==null?void 0:t.type)!==ft.WHEEL_END)&&this.zoomToSelectEnable){this.p2.copy(t.data.screenCoords),Jt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera),this.setByBox(Jt),this.graph.hide(),Jt.makeEmpty();return}}handleControllerPanMove(t){(t==null?void 0:t.type)===ft.PAN_MOVE&&this.zoomToSelectEnable&&(this.p2.copy(t.data.screenCoords),Jt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw(Jt))}handleControllerPointerOver(t){var o,u,h,c,y;const r=((o=t==null?void 0:t.e)==null?void 0:o.target)||((h=(u=t==null?void 0:t.e)==null?void 0:u.srcEvent)==null?void 0:h.target);let s=r==null?void 0:r.id;(s==null?void 0:s.indexOf("dummy"))>-1?(s=r.getAttribute(cs+"-id"),s&&this._currentAssetId!==s&&this.dispatchEvent({type:"POINTEROVER",data:{id:s,assetType:"dummy"},e:t.e})):s&&((c=this.scene)!=null&&c.isBelongsToAssetType(s,Qe.WS))?this._currentAssetId!==s&&this.dispatchEvent({type:"POINTEROVER",data:{id:s,assetType:Qe.WS},e:t.e}):s&&((y=this.scene)!=null&&y.isBelongsToAssetType(s,Qe.RM))?this._currentAssetId!==s&&this.dispatchEvent({type:"POINTEROVER",data:{id:s,assetType:Qe.RM},e:t.e}):(this._currentAssetId=void 0,this.dispatchEvent({type:"POINTERLEAVE",e:t.e})),this._currentAssetId=s}handleMultiSelectorSelected(t){console.warn("handleMultiSelectorSelected:",t.data),this.dispatchEvent({type:"SELECTED",data:t.data})}setDummies(t){this.dummiesController.setDummiesByVos(t)}clearDummies(t){this.dummiesController.clearDummies(t)}update(t){this.tween&&this.tween.update(t)}}const Jt=new Ot,Rn=new k,Bl=new k;var Pn=(i=>(i.SELECTED="SELECTED",i.POINTEROVER="POINTEROVER",i.POINTERLEAVE="POINTERLEAVE",i))(Pn||{});class Xm extends al{constructor(t){super(t);d(this,"name","SvgEmptyScene");this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
104
- <view id="defaultView" viewBox="-200 -200 500 500" />
105
- <style>
106
- /*#svg-loading-fast path {*/
107
- /* fill: #2E3032;*/
108
- /* animation: svg-loading-fast 2s ease infinite;*/
109
- /*}*/
110
- /*@keyframes svg-loading-fast {*/
111
- /* 0%, 100% {stroke-dasharray: 250; stroke-dashoffset: 250;}*/
112
- /* 68% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}*/
113
- /*}*/
114
- /*#svg-loading-fast .line {animation: svg-loading-fast 6s ease infinite;}*/
115
- /*@keyframes svg-loading-fast {*/
116
- /* 0% {stroke-dasharray: 250; stroke-dashoffset: 250; opacity: 1;}*/
117
- /* 50% {stroke-dasharray: 250; stroke-dashoffset: 0; opacity: 0.5;}*/
118
- /*}*/
119
- #svg-loading-fast path {animation: pathFrames 6s ease infinite;}
120
- @keyframes pathFrames {
121
- 0% {opacity: 1;}
122
- 50% {opacity: 0.5;}
123
- }
124
- #svg-loading-fast .triangle {animation: triangleFrames 3s ease infinite;}
125
- @keyframes triangleFrames {
126
- 0% {opacity: 1;}
127
- 50% {opacity: 0.3;}
128
- }
129
- #svg-loading-fast {fill: #525252}
130
- .line {stroke: #525252; stroke-width: 4px}
131
- .triangle {fill: #F26666}
132
- </style>
133
- <g id="svg-loading-fast">
134
- <g transform="scale(2, 2) translate(12, 0)">
135
- <!-- <path d="M17.7 14L16.82 15.5L5 15.5L5 4L17.66 4L16.76 5.5L9.04 5.5L9.04 8.86L17.32 8.86L16.44 10.38L9.04 10.38L9.04 14L17.7 14Z" />-->
136
- <!-- <path d="M22.98 15.44L19.3 15.44L19.3 7.38L31.38 7.38L30.18 8.82L29.02 8.82L29.02 15.44L25.3 15.44L25.3 8.82L22.98 8.82L22.98 15.44ZM35.06 15.44L31.38 15.44L31.38 7.38L35.06 7.38L35.06 15.44Z" />-->
137
- <!-- <path d="M40.44 14.02L44.12 14.02L44.12 7.42L47.96 7.42L47.96 15.48L40.44 15.48L40.44 18.56L36.66 18.56L36.66 7.42L44.12 7.42L42.9 8.86L40.44 8.86L40.44 14.02Z" />-->
138
- <!-- <path d="M51.62 7.42L51.62 4.78L55.48 4.78L55.48 7.42L59 7.42L58.02 8.86L55.48 8.86L55.48 14.08L58.82 14.08L57.98 15.48L51.62 15.48L51.62 8.86L49.56 8.86L49.56 7.42L51.62 7.42Z" />-->
139
- <!-- <path d="M67.08 11.8L69.66 7.42L73.66 7.42L67.08 18.58L63.06 18.58L65.06 15.42L60.6 7.42L64.66 7.42L67.08 11.8Z" />-->
140
-
141
- <path d="M13.5 15.8L12.62 17.3L0.799999 17.3L0.799999 5.8L13.46 5.8L12.56 7.3L4.84 7.3L4.84 10.66L13.12 10.66L12.24 12.18L4.84 12.18L4.84 15.8L13.5 15.8Z" />
142
- <path d="M32.12 17.3L28.52 17.3L28.52 9.9L25.18 17.3L22.1 17.3L18.8 10L18.8 17.3L15.1 17.3L15.1 5.8L20.06 5.8L23.68 13.68L27.32 5.8L32.12 5.8L32.12 17.3Z" />
143
- <path d="M37.72 12.8L37.72 17.3L33.72 17.3L33.72 5.8L42.22 5.8L41.06 7.34L37.72 7.34L37.72 11.3L42.22 11.3L42.22 5.8L46.28 5.8L46.28 12.8L37.72 12.8Z" />
144
- <path d="M57 17.3L53 17.3L53 7.34L47.88 7.34L47.88 5.8L62.48 5.8L61.6 7.34L57 7.34L57 17.3Z" />
145
- <path d="M69.92 13.52L64.08 5.78L68.62 5.78L71.92 10.58L75.14 5.78L79.64 5.78L73.92 13.56L73.92 17.28L69.92 17.28L69.92 13.52Z" />
146
- </g>
147
-
148
- <path class="line" d="M103.5 46L20 46" />
149
- <path class="line" d="M103.5 46L187 46" />
150
- <path class="triangle" d="M103.5 56L133.5 90L73.5 90Z" />
151
- </g>
152
- </svg>`)}}class Qm extends Ke{constructor(t={}){super();d(this,"name","SvgApp");d(this,"params");d(this,"renderer");d(this,"view");d(this,"scene");d(this,"loadingScene");d(this,"emptyScene");d(this,"mainScene");d(this,"zoomToSelectEnable",!1);d(this,"zoomBox",new Ot);d(this,"selectEnable",!1);d(this,"multiSelectEnable",!1);d(this,"fnEnable",!1);d(this,"requestHeader",{});d(this,"runningHandler",this.running.bind(this));d(this,"pointerOverHandler",this.handlePointerOver.bind(this));d(this,"pointerLeaveHandler",this.handlePointerLeave.bind(this));d(this,"multiSelectorSelectedHandler",this.handleMultiSelectorSelected.bind(this));d(this,"dragEndHandler",this.handleDragEnd.bind(this));this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.defaultFill||(this.params.defaultFill=Yt.getMoreTransparent(Qt.white,.3)),this.params.defaultStroke||(this.params.defaultStroke=Yt.getMoreTransparent(Qt.darkWhite,.8)),this.params.infoFill||(this.params.infoFill=Yt.getMoreTransparent(Qt.gray,.3)),this.params.infoStroke||(this.params.infoStroke=Yt.getMoreTransparent(Qt.darkGray,.8)),this.params.primaryFill||(this.params.primaryFill=Yt.getMoreTransparent(Qt.blue,.3)),this.params.primaryStroke||(this.params.primaryStroke=Yt.getMoreTransparent(Qt.darkBlue,.8)),this.params.successFill||(this.params.successFill=Yt.getMoreTransparent(Qt.green,.3)),this.params.successStroke||(this.params.successStroke=Yt.getMoreTransparent(Qt.darkGreen,.8)),this.params.warningFill||(this.params.warningFill=Yt.getMoreTransparent(Qt.yellow,.3)),this.params.warningStroke||(this.params.warningStroke=Yt.getMoreTransparent(Qt.darkYellow,.8)),this.params.dangerFill||(this.params.dangerFill=Yt.getMoreTransparent(Qt.red,.3)),this.params.dangerStroke||(this.params.dangerStroke=Yt.getMoreTransparent(Qt.darkRed,.8)),this.params.activeFill||(this.params.activeFill=Yt.getMoreTransparent(Qt.brown,.3)),this.params.activeStroke||(this.params.activeStroke=Yt.getMoreTransparent(Qt.darkBrown,.8)),this.renderer=new q0(t),this.view=new Zm(t),this.trans2LoadingScene()}get isLoadingScene(){var t;return((t=this.scene)==null?void 0:t.name)==="SvgLoadingScene"}destroy(){var t,r;this.unbindAssetsEvents(),super.destroy(),(t=this.view)==null||t.destroy(),(r=this.renderer)==null||r.destroy()}resize(){var t,r;(t=this.renderer)==null||t.resize(),(r=this.view)==null||r.resize()}isScene(t){var r;return((r=this.scene)==null?void 0:r.uuid)===t.uuid}removeScene(t){this.scene=void 0,t==null||t.destroy()}trans2MainScene(){var t,r;(t=this.scene)==null||t.unmount(),this.scene=this.mainScene,this.scene.isMounted||this.scene.mount(),this.view.bindScene(this.scene),(r=this.loadingScene)==null||r.destroy()}trans2LoadingScene(){var r,s;console.log("trans2LoadingScene: ",this.params),this.loadingScene=new Z2(this.params),(r=this.scene)==null||r.unmount(),this.scene=this.loadingScene,this.scene.isMounted||this.scene.mount();const t=new Ot().copy(this.loadingScene.viewBox).expandByVector(new k(1,1).multiplyScalar(150));console.log("trans2LoadingScene: ",t.toString()),this.view.setByBox(t,!1),(s=this.mainScene)==null||s.destroy()}trans2EmptyScene(){var r,s;console.log("trans2EmptyScene: ",this.params),this.emptyScene=new Xm(this.params),(r=this.scene)==null||r.unmount(),this.scene=this.emptyScene,this.scene.isMounted||this.scene.mount();const t=new Ot().copy(this.emptyScene.viewBox).expandByVector(new k(1,1).multiplyScalar(150));console.log("trans2EmptyScene: ",t.toString()),this.view.setByBox(t,!1),(s=this.mainScene)==null||s.destroy()}start(){requestAnimationFrame(this.runningHandler)}running(t){this.scene&&(this.scene.update(),this.renderer.render(this.scene,this.view.camera),this.view.update(t),requestAnimationFrame(this.runningHandler))}setRequestHeader(t){return this.requestHeader=t,this}load(t,r,s=2,o){return Tt(this,null,function*(){this.isLoadingScene||this.trans2LoadingScene(),yield go(this.params.syncDelay);const u=yield new af().setRequestHeader(this.requestHeader).loadAsync(t).catch(()=>{this.trans2EmptyScene()});return this.loadByString(u,r,s)})}loadByString(t,r,s=2){return Tt(this,null,function*(){if(this.mainScene=new al(this.params),!this.mainScene.bind(t))return this.trans2EmptyScene(),[];this.view.setByBox(this.mainScene.viewBox);const u=this.mainScene.getLayers(s);return r!=null&&r.length||(r=Rt.map(u,"label")),this.mainScene.showDefaultLayers(r,!0),this.trans2MainScene(),this.bindAssetsEvents(),console.log("svgApp.loadByString: ",u),u})}recompute(t){var r;(r=this.scene)==null||r.recompute(t),this.fullscreen()}setSkeletons(t){var r;(r=this.scene)==null||r.setSkeletonLayers(t)}getLayers(t=2){var r;return(r=this.scene)==null?void 0:r.getLayers(t)}getLayerVisible(t){var r;return(r=this.scene)==null?void 0:r.getLayerVisible(t)}updateLayersVisibility(t,r=!1,s=!0){var o;(o=this.scene)==null||o.updateLayersVisibility(t,r,s)}selectByIds(t){var r;(r=this.scene)==null||r.selectByIds(t,this.multiSelectEnable)}clearSelectedByIds(t){var r;Array.isArray(t)?t.forEach(s=>{var o;return(o=this.scene)==null?void 0:o.clearSelectedById(s)}):(r=this.scene)==null||r.clearSelectedById(t)}clearSelected(){var t;(t=this.scene)==null||t.clearSelected()}getSelectedIds(){var t;return(t=this.scene)==null?void 0:t.getSelectedIds()}targetByIds(t,r=100){return Tt(this,null,function*(){var s;this.scene&&((s=this.scene)==null||s.selectByIds(t,!1),Il.copy(this.scene.getSelectedBoundingBox()).expandByVector(new k(1,1).multiplyScalar(r)),yield go(100),Il.isEmpty()||(yield this.view.setByBox(Il)))})}linkAssetsByTree(t){var r;(r=this.scene)==null||r.linkAssetsByTree(t)}setViewAreaLimit(t){this.renderer.viewAreaLimit=t}setAssetType(t,r){var s;(s=this.scene)==null||s.setAssetType(t,r)}getAssetIdsByType(t){var r;return(r=this.scene)==null?void 0:r.getAssetIdsByType(t)}clearFill(){var t;(t=this.scene)==null||t.clearFillOrStroke("fill")}clearFillByIds(t){var r;(r=this.scene)==null||r.clearFillOrStrokeByIds(t,"fill")}setFillByIds(t,r){var s;(s=this.scene)==null||s.setFillOrStrokeByIds(t,r,"fill")}clearStroke(){var t;(t=this.scene)==null||t.clearFillOrStroke("stroke")}clearStrokeByIds(t){var r;(r=this.scene)==null||r.clearFillOrStrokeByIds(t,"stroke")}setStrokeByIds(t,r,s){var o;(o=this.scene)==null||o.setFillOrStrokeByIds(t,r,"stroke",s)}getLegend(){var t;return(t=this.scene)==null?void 0:t.getLegend()}setAssetLabels(t,r){var s;(s=this.scene)==null||s.setAssetLabels(t,r)}clearAssetLabels(){var t;(t=this.scene)==null||t.clearAssetLabels()}fullscreen(){this.view.fullscreen()}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}zoomIn(){this.view.zoomIn()}zoomOut(){this.view.zoomOut()}focusAt(t,r=1e3){var s;(s=this.view)==null||s.focusAt(t,r)}focusAtIds(t,r=100){return Tt(this,null,function*(){if(!this.scene)return;const s=this.scene.getBoundingBoxByIds(t);s&&(s.expandByVector(new k(1,1).multiplyScalar(r)),yield go(100),s.isEmpty()||(yield this.view.setByBox(s)))})}focusAtById(t,r=1e3){return Tt(this,null,function*(){var s;return(s=this.view)==null?void 0:s.focusAtById(t,r)})}focusAtDummy(t,r=1e3){return Tt(this,null,function*(){var s;return(s=this.view)==null?void 0:s.focusAtDummy(t,r)})}showAssetsLabel(t,r,s){var o,u,h,c;r?t==="dummy"?(h=(u=(o=this.view)==null?void 0:o.dummiesController)==null?void 0:u.dummies)==null||h.showDummyLabel(r):(c=this.view)==null||c.showAssetsLabel(t,r,s):this.hideAssetsLabel()}hideAssetsLabel(){var t,r,s,o;(s=(r=(t=this.view)==null?void 0:t.dummiesController)==null?void 0:r.dummies)==null||s.hideDummyLabel(),(o=this.view)==null||o.hideAssetsLabel()}highlightAssets(t,r){var s;(s=this.scene)==null||s.highlightAssets(t,r)}resetHighlightAssets(t){var r;(r=this.scene)==null||r.resetHighlightAssets(t)}fontZoomIn(){var t;(t=this.scene)==null||t.chef.fontZoom("asset-labels",1.1)}fontZoomOut(){var t;(t=this.scene)==null||t.chef.fontZoom("asset-labels",.9)}strokeMore(){var t;(t=this.scene)==null||t.chef.strokeWidthChanged(1.1)}strokeLess(){var t;(t=this.scene)==null||t.chef.strokeWidthChanged(.9)}zoomToSelectEnableChanged(t){this.view.zoomToSelectEnableChanged(t)}selectEnableChanged(t){this.selectEnable=!!t,this.view.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.view.multiSelectEnableChanged(t)}socialDistanceEnableChanged(t){var r;(r=this.scene)==null||r.socialDistanceEnableChanged(t)}fnEnableChanged(t){this.fnEnable=!!t,this.view.fnEnableChanged(t)}getBoundingBoxById(t,r=!0){var o;if(!t)return;const s=(o=this.scene)==null?void 0:o.getBoundingBoxById(t);return s&&r&&s.applyMatrix3(this.view.camera.viewMatrix).round(),s}setDummies(t){var r;(r=this.view)==null||r.setDummies(t)}clearDummies(t){var r;(r=this.view)==null||r.clearDummies(t)}highlightDummies(t){var r,s;(s=(r=this.view)==null?void 0:r.dummiesController)==null||s.highlightDummies(t)}resetHighlightDummies(){var t,r;(r=(t=this.view)==null?void 0:t.dummiesController)==null||r.resetHighlightDummies()}bindAssetsEvents(){var t,r;this.view.addEventListener(Pn.POINTEROVER,this.pointerOverHandler),this.view.addEventListener(Pn.POINTERLEAVE,this.pointerLeaveHandler),this.view.addEventListener(Pn.SELECTED,this.multiSelectorSelectedHandler),(r=(t=this.view)==null?void 0:t.dummiesController)==null||r.addEventListener("panend",this.dragEndHandler)}unbindAssetsEvents(){var t,r;this.view.removeEventListener(Pn.POINTEROVER,this.pointerOverHandler),this.view.removeEventListener(Pn.POINTERLEAVE,this.pointerLeaveHandler),this.view.removeEventListener(Pn.SELECTED,this.multiSelectorSelectedHandler),(r=(t=this.view)==null?void 0:t.dummiesController)==null||r.removeEventListener("panend",this.dragEndHandler)}handleMultiSelectorSelected(t){this.dispatchEvent({type:"SELECTED",data:t.data})}handlePointerOver(t){this.dispatchEvent({type:"pointerover",data:t.data,e:t.e})}handlePointerLeave(t){this.dispatchEvent({type:"pointerleave",data:t.data,e:t.e})}handleInitializeStart(){console.log("App.initializeStart ...")}handleInitializeComplete(t){return Tt(this,null,function*(){console.log("App.initializeComplete ...",t),t!=null&&t.data&&this.launch()})}handleDragEnd(t){this.dispatchEvent(t)}launch(){console.log("App.launch ...")}}const Il=new Ot;var Tp=(i=>(i.SELECTED="SELECTED",i.POINTEROVER="pointerover",i.POINTERLEAVE="pointerleave",i.DRAG_END="panend",i))(Tp||{}),Dt=(i=>(i.INIT="init",i.LOAD="load",i.LOADED="loaded",i.GET_LAYERS="getLayers",i.GET_ASSET_IDS_BY_TYPE="getAssetIdsByType",i.SET_FILL_BY_IDS="setFillByIds",i.CLEAR_FILL="clearFill",i.SET_STROKE_BY_IDS="setStrokeByIds",i.CLEAR_STROKE="clearStroke",i.TERMINATE="terminate",i.CAMERA_SYNC="cameraSync",i.ASSET_TYPE_CHANGED="assetTypeChanged",i.SVG_LOADING_TYPE_CHANGED="svgLoadingTypeChanged",i.USED_CACHE_CHANGED="usedCacheChanged",i.DEBOUNCE_CACHE_CHANGED="debounceCacheChanged",i.WIREFRAME_CHANGED="wireframeChanged",i.BG_PASS_CHANGED="bgPass",i.SELECT_ENABLE_CHANGED="selectEnableChanged",i.MULTI_SELECT_ENABLE_CHANGED="multiSelectEnableChanged",i.MULTI_SELECT_BY_RANGE="multiSelectByRange",i.ZOOM_TO_SELECT_ENABLE_CHANGED="zoomToSelectEnableChanged",i.FONT_ZOOM_IN="fontZoomIn",i.FONT_ZOOM_OUT="fontZoomOut",i.STROKE_MORE="strokeMore",i.STROKE_LESS="strokeLess",i.CAMERA_CHANGED="cameraChanged",i.SCENES_CHANGED="scenesChanged",i.UPDATE_LAYERS_VISIBILITY="updateLayersVisibility",i.DYNAMIC_LOADED="dynamicLoaded",i.SYNC_TEXTURE_HELPER_CACHED="syncTextureHelperCached",i.INITIALIZATION_START="INITIALIZATION_START",i.INITIALIZATION_COMPLETE="INITIALIZATION_COMPLETE",i.SELECTED="selected",i.SELECT_BY_IDS="selectByIds",i.CLEAR_SELECTED="clearSelected",i.TARGET_BY_IDS="targetByIds",i.TAP="tap",i.SINGLE_TAP="singletap",i.DOUBLE_TAP="doubletap",i.PRESS="press",i.PAN="pan",i.PAN_START="panstart",i.PAN_MOVE="panmove",i.PAN_END="panend",i.ROTATE="rotate",i.ROTATE_START="rotatestart",i.ROTATE_MOVE="rotatemove",i.ROTATE_END="rotateend",i.PINCH="pinch",i.PINCH_START="pinchstart",i.PINCH_MOVE="pinchmove",i.PINCH_END="pinchend",i.PINCH_IN="pinchin",i.PINCH_OUT="pinchout",i.SWIPE="swipe",i))(Dt||{});class Km extends Ym{constructor(t={}){super(t);d(this,"name","OpeView");d(this,"container");d(this,"graph");d(this,"zoomToSelectEnable");d(this,"multiSelectEnable");d(this,"rayCaster",new Pf);d(this,"intersects",[]);d(this,"controllerPanStartHandler",this.handlePanStart.bind(this));d(this,"controllerPanEndHandler",this.handlePanEnd.bind(this));d(this,"controllerPanMoveHandler",this.handleControllerPanMove.bind(this));d(this,"controllerPointerOverHandler",this.handleControllerPointerOver.bind(this));this.container=this.params.cvs?this.params.cvs:this.params.canvasId?document.getElementById(this.params.canvasId):Vt.window.document.getElementsByTagName("body")[0],console.warn("opeView.constructor: ",this.container,this.container.tagName),this.controller=new Bf(this.container,this.camera),this.bindControllerEvents();let r=this.container.tagName.toLowerCase()!=="body"?this.container.parentNode:this.container;this.graph=new ol(r)}destroy(){this.unbindControllerEvents(),this.controller&&this.controller.destroy(),super.destroy()}zoomToSelectEnableChanged(t=!1){this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}multiSelectEnableChanged(t=!1){this.multiSelectEnable=t,this.controller.enablePan=!this.multiSelectEnable}bindControllerEvents(){this.controller.addEventListener(ft.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ft.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(ft.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ft.POINTEROVER,this.controllerPointerOverHandler)}unbindControllerEvents(){this.controller.removeEventListener(ft.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ft.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(ft.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ft.POINTEROVER,this.controllerPointerOverHandler)}handlePanStart(t){(t==null?void 0:t.type)!==ft.PAN_START&&(t==null?void 0:t.type)!==ft.WHEEL_START||(this.zoomToSelectEnable||this.multiSelectEnable)&&(Lo.copy(t.data.screenCoords),sn.makeEmpty().expandByPoint(Lo),this.graph.draw(sn))}handlePanEnd(t){return Tt(this,null,function*(){(t==null?void 0:t.type)!==ft.PAN_END&&(t==null?void 0:t.type)!==ft.WHEEL_END||((this.zoomToSelectEnable||this.multiSelectEnable)&&(No.copy(t.data.screenCoords),sn.makeEmpty().expandByPoint(Lo).expandByPoint(No).unproject(this.controller.camera),this.graph.hide()),this.zoomToSelectEnable&&(yield this.resetCameraByBoundingBox(sn,!0)),this.multiSelectEnable&&this.dispatchEvent({type:Dt.MULTI_SELECT_BY_RANGE,data:sn.clone()}),sn.makeEmpty())})}handleControllerPanMove(t){(t==null?void 0:t.type)===ft.PAN_MOVE&&(this.zoomToSelectEnable||this.multiSelectEnable)&&(No.copy(t.data.screenCoords),sn.makeEmpty().expandByPoint(Lo).expandByPoint(No),this.graph.draw(sn))}handleControllerPointerOver(t){t==null||t.type,ft.POINTEROVER}handleMultiSelectorSelected(t){}handleCameraChanged(t){console.warn("handleCameraChanged: ",t.target.camera.position.z,t.target.camera.scaled.x)}}const Lo=new k,No=new k,sn=new Ot;function _p(i){return!!(i&&i.constructor&&i.call&&i.apply)}const jm="children",Jm="get",tv="set",Rl="Changed";class ev extends Ke{constructor(t){super();d(this,"name","Node2");d(this,"userData",{});d(this,"_cache",new Map);d(this,"_attachedDepsListeners",new Map);this.setAttrs(t)}destroy(){super.destroy(),this._clearCache()}setAttrs(t){if(!t)return this;let r;for(const s in t)s!==jm&&(r=tv+s,_p(this[r])?this[r](t[s]):this.setAttr(s,t[s]));return this}setAttr(t,r){Object.hasOwnProperty.call(this,t)&&(this.userData[t]=r,this[t]=r)}getAttrs(){return this.userData||{}}getAttr(t){const r=Jm+Rt.capitalize(t);return _p(this[r])?this[r]():this.userData[t]}getAttrKey(){return Object.values(this.userData).filter(t=>!(t instanceof Array||t instanceof Object)).join("_")}_getCache(t,r){let s=this._cache.get(t);return(s===void 0||s.dirty===!0)&&(s=r.call(this),this._cache.set(t,s)),s}_clearCache(t){t===void 0?this._cache.clear():this._cache.has(t)&&this._cache.get(t).isMatrix3?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_setProperty(t){Object.hasOwnProperty.call(this,t)&&delete this[t],Object.defineProperty(this,t,{get(){return this.userData[t]},set(r){const s=this.userData[t];this.userData[t]=r,s!==r&&this.dispatchEvent({type:t+Rl,data:{oldVal:s,newVal:r}})},enumerable:!0,configurable:!0})}computed(t,r,s){if(!this._attachedDepsListeners.get(t)){const o=r.map(u=>u+Rl).join(",");this.addEventListeners(o,()=>this._clearCache(t)),r.forEach(u=>this._setProperty(u)),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,s)}watch(t,r){(t||[]).forEach(s=>{this._setProperty(s),this.addEventListener(s+Rl,r)})}}const Zr=new k;class rv extends ev{constructor(t={}){super(t);d(this,"isTexture",!0);d(this,"isRenderTargetTexture",!1);d(this,"type","Texture");d(this,"name","Texture");d(this,"uuid",tf());d(this,"originSize",new k);d(this,"originCenter",new k);d(this,"size",new k);d(this,"matrix",new ce);d(this,"matrixAutoUpdate",!0);d(this,"userData",{});d(this,"version",0);d(this,"_needsUpdate",!1);d(this,"image");d(this,"offset",new k);d(this,"repeat",new k(1,1));d(this,"center",new k);d(this,"rotate",0);d(this,"scale",1);d(this,"flipY",!0);this.setAttrs(t)}destroy(){super.destroy()}set needsUpdate(t){t&&(this.version++,this._needsUpdate=!0)}get needsUpdate(){return this._needsUpdate}updateSize(t,r,s,o){return this.originSize.copy(t),this.originCenter.copy(r),this.flipY&&this.originCenter.multiplyScalar(1,-1),this.updateFinalSize(s,o)}updateFinalSize(t,r){t&&!k.isZero(t)&&!k.isEmpty(t)?Zr.copy(t):Zr.copy(this.originSize),Zr.maxXY(1,1);const s=Math.sqrt(Zr.x*Zr.x+Zr.y*Zr.y)/Math.sqrt(r.x*r.x+r.y*r.y);return s>1&&Zr.multiplyScalar(1/s),this.scale=Zr.length()/this.originSize.length(),this.repeat.multiplyScalar(this.originSize.length()/Zr.length()),this.size.copy(Zr),this.offset.copy(this.originSize).multiplyScalar(-.5).add(this.originCenter),this.updateMatrix(),this}reset(t,r){t&&this.originSize.copy(t),r&&this.size.copy(r),this.scale=this.size.x/this.originSize.x,this.repeat.set(1,1),this.center.set(0,0),this.rotate=0,this.offset.copy(this.originSize).multiplyScalar(.5).sub(this.originCenter).multiplyScalar(this.scale),this.updateMatrix()}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotate,this.center.x,this.center.y)}clone(){const t=this.constructor;return new t(this.attrs).copy(this)}copy(t){return this.name=t.name,this.originSize.copy(t.originSize),this.originCenter.copy(t.originCenter),this.size.copy(t.size),this.matrix.copy(t.matrix),this.matrixAutoUpdate=t.matrixAutoUpdate,this.userData=JSON.parse(JSON.stringify(t.userData)),this.image=t.image,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotate=t.rotate,this.scale=t.scale,this.flipY=t.flipY,this}}const tr=class tr{static destroy(){Object.values(this.cached).forEach(e=>{e.destroy()}),this.cached=new Map}static has(e){return this.cached.has(e)}static get(e,t){if(e)return!this.precisionOptimized||!t?this.cached.get(e):t&&t<this.precisionOptimizeLevels[2]?this.get(e+"_3"):t&&t<this.precisionOptimizeLevels[1]?this.get(e+"_2"):t&&t<this.precisionOptimizeLevels[0]?this.get(e+"_1"):this.get(e)}static set(e,t){if(!e||!t)throw new Error("error input");return this.cached.set(e,t),t}static remove(e){if(!e||!this.cached.has(e))return;const t=this.cached.get(e);if(t&&t.destroy(),this.cached.delete(e),this.precisionOptimized)for(let r=1,s=this.precisionOptimizeLevels.length;r<=s;r++){const o=e+"_"+r;let u;this.cached.has(o)&&(u=this.cached.get(o),u&&u.destroy(),this.cached.delete(o))}}static clear(){this.destroy()}static setTextureMaxSize(){this.initialized||(this.textureMaxSize.set(Vt.config.width,Vt.config.height).multiplyScalar(.5).round(),this.initialized=!0)}static getTextureMaxSize(){return this.initialized||this.setTextureMaxSize(),this.textureMaxSize}static getTextureByShape(e,t,r,s){var u;const o=new rv;if(this.setTextureMaxSize(),o.scale=1,o.repeat.set(1,1),o.rotate=0,o.image=void 0,o.version=0,console.warn("getTextureByShape: ============================",e.name),t&&!k.isZero(t)&&!k.isEmpty(t))Oa.copy(t),e.alignCenter?e.boundingBox.getCenter(Ma):Ma.set(0,0);else{if(e.isShape&&((u=e.geometry)!=null&&u.boundingBox))Ro.copy(e.geometry.boundingBox);else if(e.boundingBox)Ro.copy(e.boundingBox);else throw new Error("get boundingBox error");Ro.getSize(Oa),e.alignCenter?e.boundingBox.getCenter(Ma):Ro.getCenter(Ma)}return r&&!k.isZero(r)&&!k.isEmpty(r)?Mi.copy(r):Mi.copy(Oa),(Mi.x<Cp.x||Mi.y<Cp.y)&&Mi.normalize().multiplyScalar(10).round(),fi.copy(this.getTextureMaxSize()),s&&(La.set((s==null?void 0:s.shadowBlur)||0,(s==null?void 0:s.shadowBlur)||0),Mi.add(La.clone().multiplyScalar(2)),Oa.multiplyScalar(3),fi.multiplyScalar(.3)),o.updateSize(Oa,Ma,Mi,fi),o}static setPrecisionOptimizeTextures(e,t,r,s,o){if(!this.precisionOptimized)return;let u;for(let h=0,c=this.precisionOptimizeLevels.length;h<c;h++){fi.copy(r.size).multiplyScalar(this.precisionOptimizeLevels[h]);const y=this.getTextureByShape(t,s,fi,o);this.renderShapeTexture(t,y,o),u=e+"_"+(h+1),y.userData.textureKey=u,tr.set(u,y)}}static renderShapeTexture(e,t,r){r?(La.set(r.shadowBlur||0,r.shadowBlur||0),ci.copy(t.originSize).multiplyScalar(-.5).sub(t.originCenter).multiplyScalar(t.scale),e.alignCenter?Io.copy(t.originSize).multiplyScalar(t.scale):Io.copy(t.originSize).add(La.clone().multiplyScalar(1)).multiplyScalar(t.scale)):ci.copy(t.offset).negate().multiplyScalar(t.scale);const s=Gr.create(t.size.x,t.size.y),o=Gr.getContext2D(s,{alpha:!0});if(e.isText||!e.matrix.hasChange())o.clearRect(0,0,s.width,s.height),o.translate(ci.x,ci.y),o.scale(t.scale,-t.scale);else{e.matrix.decompose(Dp,iv,Sp);const u=1/Sp.x;ci.sub(Dp.multiplyScalar(u,-u)),o.clearRect(0,0,s.width,s.height),o.translate(ci.x,ci.y),o.scale(u,-u)}r&&(o.shadowColor=Qt.black,o.shadowOffsetX=Io.x,o.shadowOffsetY=Io.y,o.shadowBlur=La.x),e.render(o),t.image=s}static setByShape(e,t,r,s){const o=this.getTextureByShape(t,r,s);return o.userData.textureKey=e,this.renderShapeTexture(t,o),tr.set(e,o),t.featureKey=e,o}static setShadowByShape(e,t,r){const s=this.getTextureByShape(t,void 0,void 0,r);return s.userData.textureKey=e,this.renderShapeTexture(t,s,r),tr.set(e,s),s}static setPointsByShape(e,t){var y,p,A,T,C;const r=[];t.isGroup?t.traverse(N=>N.isShape?r.push(...N.geometry.points):void 0):t.isShape&&t.geometry.points?r.push(...t.geometry.points):t.boundingBox&&r.push(t.boundingBox.min,t.boundingBox.max);const s=this.getTextureByShape(t),o=((y=t.material)==null?void 0:y.lineWidth)*2||3;Li.set(1,1).multiplyScalar(o),s.size.copy(Li).multiplyScalar(s.scale).multiplyScalar(2).add(Mi),s.offset.sub(Li),s.updateMatrix();const u=Gr.create(s.size.x,s.size.y),h=Gr.getContext2D(u,{alpha:!0});ci.subVectors(s.originSize.clone().multiplyScalar(.5),s.originCenter).add(Li),h.clearRect(0,0,u.width,u.height),h.scale(s.scale,s.scale),h.translate(ci.x,ci.y);let c=Qt.black;t.material?c=((p=t.material)==null?void 0:p.stroke)||((A=t.material)==null?void 0:A.fill):t.isGroup&&t.children.length&&t.children[0].isShape&&(c=((T=t.children[0].material)==null?void 0:T.stroke)||((C=t.children[0].material)==null?void 0:C.fill)),h.fillStyle=Yt.getDarken(c);for(let N=0,O=r.length||0;N<O;N++)fi.copy(r[N]),h.moveTo(fi.x,fi.y),h.arc(fi.x,fi.y,Li.x,0,Math.PI*2);return h.fill(),s.image=u,tr.set(e,s),s}static setWireframeByShape(e,t){var h;const r=this.getTextureByShape(t);Li.set(1,1).multiplyScalar(((h=t.mat)==null?void 0:h.lineWidth)||1),r.size.copy(Li).multiplyScalar(r.scale).multiplyScalar(2).add(Mi),r.offset.sub(Li),r.updateMatrix();const s=Gr.create(r.size.x,r.size.y),o=Gr.getContext2D(s,{alpha:!0}),u=Li.x*r.scale*5;return o.clearRect(0,0,s.width,s.height),o.strokeStyle=Qt.darkGray,o.lineWidth=u,o.setLineDash([u*3,u]),o.strokeRect(0,0,r.size.x,r.size.y),r.image=s,tr.set(e,r),r}};d(tr,"cached",new Map),d(tr,"precisionOptimized",!0),d(tr,"precisionOptimizeLevels",[.5,.25,1e-4]),d(tr,"initialized",!1),d(tr,"textureMaxSize",new k),d(tr,"DEBUG_DisplayCachedTexture",Rt.throttle((e=80,t=.8)=>{let r=nv();if(r||(r=sv(e,t)),!r)throw new Error("dom not found");av(r,tr.cached)},5e3));let Bo=tr;const Cp=new k(10,10),Oa=new k,Ma=new k,Mi=new k,ci=new k,Io=new k,La=new k,fi=new k,Li=new k,Ro=new Ot,Dp=new k,iv=new k,Sp=new k;function nv(){return window.document.getElementById("DEBUG_Displaycached")}function sv(i=80,e=.8){const t=document.createElement("div");function r(){t.style.opacity="1"}function s(){t.style.opacity=e.toString()}return t.setAttribute("id","DEBUG_Displaycached"),t.style.position="absolute",t.style.width=i+"px",t.style.height="92vh",t.style.background=`rgba(255, 255, 255, ${e})`,t.style.left="20px",t.style.top="20px",t.style.overflow="auto",t.style.padding="6px",t.style.opacity=e.toString(),t.addEventListener("mouseenter",r),t.addEventListener("mouseleave",s),document.body.appendChild(t),t}function av(i,e){e.forEach((t,r)=>{!t||!t.image||ov(i,r,t)})}function ov(i,e,t){let r;for(let s=0,o=i.childNodes.length;s<o;s++)if(i.childNodes[s].getAttribute("id")===e){r=i.childNodes[s];break}r?lv(r,t):uv(i,e,t)}function uv(i,e,t){if(!t.image)return;const r=Vt.document.createElement("div");r.setAttribute("id",e),r.style.display="flex",r.style.flexDirection="column";const s=Gr.createCanvas({containerId:i.id,width:t.image.width,height:t.image.height,dpr:window.devicePixelRatio});s.style.border=`${Qt.yellow} 1px solid`,s.style.maxWidth=parseInt(i.style.width)-2+"px",s.style.maxHeight=parseInt(s.style.maxWidth)/(t.image.width/t.image.height)+"px";const o=s.getContext("2d",{alpha:!0});if(!o)throw new Error("getContext error");o.save(),o.scale(window.devicePixelRatio,window.devicePixelRatio),o.drawImage(t.image,0,0),o.restore(),r.appendChild(s);const u=Vt.document.createElement("p");u.innerHTML=t.image.width+" * "+t.image.height,u.innerHTML+="<br/>"+e,u.style.margin="0",u.style.padding="0",u.style.lineHeight="1.2",u.style.fontSize="10px",u.style.padding="3px 0 6px 0",u.style.color=Qt.black,r.appendChild(u),i.appendChild(r);function h(){const c=s.toDataURL("image/png",.6),y=document.createElement("a"),p=new MouseEvent("click");y.download=`thumb.${Date.now()}.png`,y.href=c,y.dispatchEvent(p)}r.addEventListener("click",h)}function lv(i,e){if(!e.image)return;const t=i.querySelector("canvas");if(!t)return;const r=t.getContext("2d",{alpha:!0});if(!r)throw new Error("getContext error");r.clearRect(0,0,t.width,t.height),r.save(),r.scale(window.devicePixelRatio,window.devicePixelRatio),r.drawImage(e.image,0,0),r.restore()}class hv extends Ke{constructor(t={},r){super();d(this,"cvs");d(this,"worker");d(this,"view");d(this,"boundingBox",new Ot);d(this,"viewTapHandler",this.handleViewTap.bind(this));d(this,"multiSelectByRangeHandler",this.handleMultiSelectByRange.bind(this));d(this,"workerMessageHandler",this.handleWorkerMessage.bind(this));d(this,"cameraHandler",this.handleCameraChanged.bind(this));d(this,"runningHandler",this.running.bind(this));t.workerRender=!0,this.params=t,Vt.config=t;const s=Gr.createCanvas(t);if(!s.transferControlToOffscreen)throw new Error("not support transferControlToOffscreen");this.cvs=s.transferControlToOffscreen(),this.view=new Km(t),this.view.camera.name="mainCamera",this.view.camera.resize(),this.worker=r,this.bindEvents()}destroy(){super.destroy(),this.unbindEvents(),this.worker.postMessage({task:Dt.TERMINATE}),this.worker.terminate()}bindEvents(){var t,r,s,o,u;(r=(t=this.view)==null?void 0:t.controller)==null||r.addEventListener(ft.TAP,this.viewTapHandler),(s=this.view)==null||s.addEventListener(Dt.MULTI_SELECT_BY_RANGE,this.multiSelectByRangeHandler),(u=(o=this.view)==null?void 0:o.camera)==null||u.addEventListener(bo.UPDATE,this.cameraHandler),this.worker.addEventListener("message",this.workerMessageHandler)}unbindEvents(){var t,r,s,o;(r=(t=this.view)==null?void 0:t.controller)==null||r.removeEventListener(ft.TAP,this.viewTapHandler),(o=(s=this.view)==null?void 0:s.controller)==null||o.removeEventListener(ft.CAMERA_CHANGED,this.cameraHandler),this.worker.removeEventListener("message",this.workerMessageHandler)}handleViewTap(t){return Tt(this,null,function*(){if((t==null?void 0:t.type)!==ft.TAP)return;const r=yield this.promiseWorkerResponse(Dt.TAP,t.data);this.dispatchEvent({type:Dt.SELECTED,data:r})})}handleWorkerMessage(t){var r,s,o,u,h,c;switch(t.data.task){case Dt.CAMERA_SYNC:if(!((r=t==null?void 0:t.data)!=null&&r.data))break;const y=JSON.parse(t.data.data);(o=(s=this.view)==null?void 0:s.camera)==null||o.fromJSON(y),this.view.camera.computeBoundingBox();break;case Dt.CAMERA_CHANGED:const{t:p,r:A,s:T}=t.data.data;(h=(u=this.view)==null?void 0:u.camera)==null||h.setTRS(p,A,T);break;case Dt.SCENES_CHANGED:const{box:C}=t.data.data;if(!C)return;this.boundingBox.fromString(C);break;case"syncTextureHelperCached":(((c=t.data)==null?void 0:c.data)||[]).forEach((N,O)=>Bo.set(O,N));break;case"pong":console.log("response: pong");break}}handleCameraChanged(t){this.worker.postMessage({task:Dt.CAMERA_CHANGED,data:t.data})}promiseWorkerResponse(t,r){return new Promise((s,o)=>{const u=c=>{var y;((y=c==null?void 0:c.data)==null?void 0:y.task)===t&&(this.worker.removeEventListener("message",u),this.worker.removeEventListener("error",h),s(c.data.data))},h=c=>{this.worker.removeEventListener("message",u),this.worker.removeEventListener("error",h),o(c.error)};this.worker.addEventListener("message",u),this.worker.addEventListener("error",h),this.worker.postMessage({task:t,data:r})})}handleMultiSelectByRange(t){return Tt(this,null,function*(){return this.promiseWorkerResponse(Dt.MULTI_SELECT_BY_RANGE,t.data)})}resize(){var t;(t=this.view.camera)==null||t.resize()}load(t,r){return Tt(this,null,function*(){return this.promiseWorkerResponse(Dt.LOAD,{url:t,layers:r})})}getLayers(t=2){return Tt(this,null,function*(){return this.promiseWorkerResponse(Dt.GET_LAYERS,{lv:t})})}assetTypeChanged(t=Qe.RM){this.params.assetType=t,this.worker.postMessage({task:Dt.ASSET_TYPE_CHANGED,data:t})}usedCacheChanged(t=!1){this.params.usedCache=t,this.worker.postMessage({task:Dt.USED_CACHE_CHANGED,data:t})}debounceCacheChanged(t=!1){this.params.debounceCache=t,this.worker.postMessage({task:Dt.DEBOUNCE_CACHE_CHANGED,data:t})}wireframeChanged(t=!1){this.params.wireframe=t,this.worker.postMessage({task:Dt.WIREFRAME_CHANGED,data:t})}bgPassChanged(t=!1){this.params.bgPass=t,this.worker.postMessage({task:Dt.BG_PASS_CHANGED,data:t})}selectEnableChanged(t=!1){return Tt(this,null,function*(){yield this.clearSelected(),this.params.selectEnable=t,this.worker.postMessage({task:Dt.SELECT_ENABLE_CHANGED,data:t})})}multiSelectEnableChanged(t=!1){return Tt(this,null,function*(){yield this.clearSelected(),this.params.multiSelectEnable=t,this.view.multiSelectEnableChanged(t),this.worker.postMessage({task:Dt.MULTI_SELECT_ENABLE_CHANGED,data:t})})}zoomToSelectEnableChanged(t=!1){return Tt(this,null,function*(){return this.params.zoomToSelectEnable=t,this.view.zoomToSelectEnableChanged(t),this.promiseWorkerResponse(Dt.ZOOM_TO_SELECT_ENABLE_CHANGED,{data:t})})}svgLoadingTypeChanged(t){return Tt(this,null,function*(){return this.params.svgLoadingType=t,this.promiseWorkerResponse(Dt.SVG_LOADING_TYPE_CHANGED,t)})}fullscreen(){return Tt(this,null,function*(){yield this.view.resetCameraByBoundingBox(this.boundingBox,!0)})}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}updateLayersVisibility(t,r=!1){this.worker.postMessage({task:Dt.UPDATE_LAYERS_VISIBILITY,data:{ids:t,visible:r}})}clearSelected(t){return this.promiseWorkerResponse(Dt.CLEAR_SELECTED,{data:t})}selectByIds(t){this.worker.postMessage({task:Dt.SELECT_BY_IDS,data:t})}targetByIds(t){this.worker.postMessage({task:Dt.TARGET_BY_IDS,data:t})}getAssetIdsByType(t){return Tt(this,null,function*(){return this.promiseWorkerResponse(Dt.GET_ASSET_IDS_BY_TYPE,{assetType:t})})}setFillByIds(t,r){this.worker.postMessage({task:Dt.SET_FILL_BY_IDS,data:{ids:t,c:r}})}clearFill(){this.worker.postMessage({task:Dt.CLEAR_FILL})}setStrokeByIds(t,r){this.worker.postMessage({task:Dt.SET_STROKE_BY_IDS,data:{ids:t,c:r}})}clearStroke(){this.worker.postMessage({task:Dt.CLEAR_STROKE})}fontZoomIn(t=1.1){return Tt(this,null,function*(){return this.promiseWorkerResponse(Dt.FONT_ZOOM_IN,t)})}fontZoomOut(t=.9){return Tt(this,null,function*(){return this.promiseWorkerResponse(Dt.FONT_ZOOM_OUT,t)})}strokeMore(t=1.1){return Tt(this,null,function*(){return this.promiseWorkerResponse(Dt.STROKE_MORE,t)})}strokeLess(t=.9){return Tt(this,null,function*(){return this.promiseWorkerResponse(Dt.STROKE_LESS,t)})}start(){const t=this.cvs,r=JSON.stringify(this.params);this.worker.postMessage({task:Dt.INIT,data:{cvs:t,config:r}},[t]),requestAnimationFrame(this.runningHandler)}running(t){var r;(r=this.view)==null||r.update(t),requestAnimationFrame(this.runningHandler),Bo.DEBUG_DisplayCachedTexture()}stop(){}}function cv(i){return new Worker("/environment.worker.js",{type:"module",name:i==null?void 0:i.name})}function fv(i){return new Worker("/renderer.worker.js",{type:"module",name:i==null?void 0:i.name})}_t.AppEnum=Tp,_t.AppOffscreen=hv,_t.AssetTypeEnum=Qe,_t.Box2=T0,_t.Color=Yt,_t.ColorsEnum=Qt,_t.EnvironmentWorker=cv,_t.GLOB=Vt,_t.LayerTypeEnum=ua,_t.Monitor=hs,_t.RendererWorker=fv,_t.SvgApp=Qm,_t.Vector2=b0,_t.assetTypeConflicts=Yc,_t.defaultConfig=Gt,_t.getAssetLabelByType=la,_t.getAssetLayerByType=fs,_t.randomDelay=go,Object.defineProperty(_t,Symbol.toStringTag,{value:"Module"})});
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).archgine={})}(this,(function(t){"use strict";var e,i,n=Object.defineProperty,s=Object.defineProperties,r=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,l=(t,e,i)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,u=(t,e)=>{for(var i in e||(e={}))o.call(e,i)&&l(t,i,e[i]);if(a)for(var i of a(e))h.call(e,i)&&l(t,i,e[i]);return t},c=(t,e)=>s(t,r(e)),d=(t,e,i)=>l(t,"symbol"!=typeof e?e+"":e,i),p=(t,e,i)=>new Promise(((n,s)=>{var r=t=>{try{o(i.next(t))}catch(t){s(t)}},a=t=>{try{o(i.throw(t))}catch(t){s(t)}},o=t=>t.done?n(t.value):Promise.resolve(t.value).then(r,a);o((i=i.apply(t,e)).next())}));function f(t,e){const i=t.x*Math.cos(e)-t.y*Math.sin(e),n=t.y*Math.cos(e)+t.x*Math.sin(e);t.x=i,t.y=n}function m(t,e){t.x*=e,t.y*=e}let g=class t{constructor(e){d(this,"commands"),this.commands=[],e&&e instanceof t?this.commands.push(...e.commands):e&&(this.commands=function(t){const e=[],i=String(t).trim();return"M"!==i[0]&&"m"!==i[0]||i.replace(x,((t,i,n)=>{const s=function(t){const e=t.match(b);return e?e.map(Number):[]}(n);let r=i.toLowerCase(),a=i;if("m"===r&&s.length>2&&(e.push([a,...s.splice(0,2)]),r="l",a="m"===a?"l":"L"),s.length<v[r])return"";for(e.push([a,...s.splice(0,v[r])]);s.length>=v[r]&&s.length&&v[r];)e.push([a,...s.splice(0,v[r])]);return""})),e}(e))}addPath(e){e&&e instanceof t&&this.commands.push(...e.commands)}moveTo(t,e){this.commands.push(["M",t,e])}lineTo(t,e){this.commands.push(["L",t,e])}arc(t,e,i,n,s,r){this.commands.push(["AC",t,e,i,n,s,!!r])}arcTo(t,e,i,n,s){this.commands.push(["AT",t,e,i,n,s])}ellipse(t,e,i,n,s,r,a,o){this.commands.push(["E",t,e,i,n,s,r,a,!!o])}closePath(){this.commands.push(["Z"])}bezierCurveTo(t,e,i,n,s,r){this.commands.push(["C",t,e,i,n,s,r])}quadraticCurveTo(t,e,i,n){this.commands.push(["Q",t,e,i,n])}rect(t,e,i,n){this.commands.push(["R",t,e,i,n])}roundRect(t,e,i,n,s){void 0===s?this.commands.push(["RR",t,e,i,n,0]):this.commands.push(["RR",t,e,i,n,s])}};function y(t,e){let i,n,s,r,a,o,h,l,u,c,d,p,g,y,v,x,b,w,_,S,E,A=0,M=0,T=null,C=null,I=null,D=null,L=null,B=null;t.beginPath();for(let O=0;O<e.length;++O){let R;switch(w=e[O][0],"S"!==w&&"s"!==w&&"C"!==w&&"c"!==w&&(T=null,C=null),"T"!==w&&"t"!==w&&"Q"!==w&&"q"!==w&&(I=null,D=null),w){case"m":case"M":R=e[O],"m"===w?(A+=R[1],M+=R[2]):(A=R[1],M=R[2]),"M"!==w&&L||(L={x:A,y:M}),t.moveTo(A,M);break;case"l":R=e[O],A+=R[1],M+=R[2],t.lineTo(A,M);break;case"L":R=e[O],A=R[1],M=R[2],t.lineTo(A,M);break;case"H":R=e[O],A=R[1],t.lineTo(A,M);break;case"h":R=e[O],A+=R[1],t.lineTo(A,M);break;case"V":R=e[O],M=R[1],t.lineTo(A,M);break;case"v":R=e[O],M+=R[1],t.lineTo(A,M);break;case"a":case"A":if(R=e[O],null===B)throw new Error("This should never happen");"a"===w?(A+=R[6],M+=R[7]):(A=R[6],M=R[7]),y=R[1],v=R[2],h=R[3]*Math.PI/180,s=!!R[4],r=!!R[5],a={x:A,y:M},o={x:(B.x-a.x)/2,y:(B.y-a.y)/2},f(o,-h),l=o.x*o.x/(y*y)+o.y*o.y/(v*v),l>1&&(l=Math.sqrt(l),y*=l,v*=l),_={x:y*o.y/v,y:-v*o.x/y},u=y*y*v*v,c=y*y*o.y*o.y+v*v*o.x*o.x,m(_,r!==s?Math.sqrt((u-c)/c)||0:-Math.sqrt((u-c)/c)||0),n=Math.atan2((o.y-_.y)/v,(o.x-_.x)/y),i=Math.atan2(-(o.y+_.y)/v,-(o.x+_.x)/y),f(_,h),P=_,k=(a.x+B.x)/2,N=(a.y+B.y)/2,P.x+=k,P.y+=N,t.save(),t.translate(_.x,_.y),t.rotate(h),t.scale(y,v),t.arc(0,0,1,n,i,!r),t.restore();break;case"C":R=e[O],T=R[3],C=R[4],A=R[5],M=R[6],t.bezierCurveTo(R[1],R[2],T,C,A,M);break;case"c":R=e[O],t.bezierCurveTo(R[1]+A,R[2]+M,R[3]+A,R[4]+M,R[5]+A,R[6]+M),T=R[3]+A,C=R[4]+M,A+=R[5],M+=R[6];break;case"S":R=e[O],null!==T&&null!==C||(T=A,C=M),t.bezierCurveTo(2*A-T,2*M-C,R[1],R[2],R[3],R[4]),T=R[1],C=R[2],A=R[3],M=R[4];break;case"s":R=e[O],null!==T&&null!==C||(T=A,C=M),t.bezierCurveTo(2*A-T,2*M-C,R[1]+A,R[2]+M,R[3]+A,R[4]+M),T=R[1]+A,C=R[2]+M,A+=R[3],M+=R[4];break;case"Q":R=e[O],I=R[1],D=R[2],A=R[3],M=R[4],t.quadraticCurveTo(I,D,A,M);break;case"q":R=e[O],I=R[1]+A,D=R[2]+M,A+=R[3],M+=R[4],t.quadraticCurveTo(I,D,A,M);break;case"T":R=e[O],null!==I&&null!==D||(I=A,D=M),I=2*A-I,D=2*M-D,A=R[1],M=R[2],t.quadraticCurveTo(I,D,A,M);break;case"t":R=e[O],null!==I&&null!==D||(I=A,D=M),I=2*A-I,D=2*M-D,A+=R[1],M+=R[2],t.quadraticCurveTo(I,D,A,M);break;case"z":case"Z":L&&(A=L.x,M=L.y),L=null,t.closePath();break;case"AC":R=e[O],A=R[1],M=R[2],g=R[3],n=R[4],i=R[5],S=R[6],t.arc(A,M,g,n,i,S);break;case"AT":R=e[O],d=R[1],p=R[2],A=R[3],M=R[4],g=R[5],t.arcTo(d,p,A,M,g);break;case"E":R=e[O],A=R[1],M=R[2],y=R[3],v=R[4],h=R[5],n=R[6],i=R[7],S=R[8],t.save(),t.translate(A,M),t.rotate(h),t.scale(y,v),t.arc(0,0,1,n,i,S),t.restore();break;case"R":R=e[O],A=R[1],M=R[2],x=R[3],b=R[4],L={x:A,y:M},t.rect(A,M,x,b);break;case"RR":R=e[O],A=R[1],M=R[2],x=R[3],b=R[4],E=R[5],L={x:A,y:M},t.roundRect(A,M,x,b,E)}B?(B.x=A,B.y=M):B={x:A,y:M}}var P,k,N}const v={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},x=/([astvzqmhlc])([^astvzqmhlc]*)/gi,b=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,w={name:"TinyEngine",containerId:"tinyEngine",canvas:"tinyEngine",width:0,height:0,aspect:1,dpr:1,alpha:!0,color:"#232323",fps:60,syncDelay:1500,animateDuration:500,fnEnable:!1,pointerPosition:!0,editorMode:0,mergeRendering:!1,sliceRendering:!0,sliceDuration:15,usedCache:!1,separateCache:!1,debounceCache:!0,dynamicLoading:!0,svgLoadingType:0,instancedMesh:!0,showPoints:!1,wireframe:!1,castShadow:!1,workerRender:!1,monitorDuration:1e4,light:{color:"#ffffff",intensity:.8,position:[-6,6,0],castShadow:!0,shadowBlur:16,helperSize:100,helperColor:16776960,helperEnable:!1},camera:{type:0,left:-1,right:1,top:1,bottom:-1,aspect:1,near:1,far:2e3,eye:[0,0,0],up:[0,0,1],helperEnable:!1},controls:{target:[0,0,0],minDistance:.1,maxDistance:1e3,enableHover:!0,enablePan:!0,enableRotate:!1,enableZoom:!0,focusMode:!0,autoRotate:!1,autoRotateSpeed:.5,enableDamping:!0,dampingFactor:.2},gridHelper:{fill:"#e3e3e3"},axesHelper:{},displayUnits:"",tooltip:!0,assetType:"rm",zoomToSelectEnable:!1,selectEnable:!1,multiSelectEnable:!1,socialDistanceEnable:!1,socialDistance:{radius:3},editor:{fill:"#F26666",stroke:"#D95970",strokeWidth:5,fontSize:25},dummy:{radius:15}};var _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var E={},A={};function M(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(t):t}var T=M({HTML:"text/html",isHTML:function(t){return t===T.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),C=M({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===C.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});A.assign=function(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},A.find=function(t,e,i){if(void 0===i&&(i=Array.prototype),t&&"function"==typeof i.find)return i.find.call(t,e);for(var n=0;n<t.length;n++)if(Object.prototype.hasOwnProperty.call(t,n)){var s=t[n];if(e.call(void 0,s,n,t))return s}},A.freeze=M,A.MIME_TYPE=T,A.NAMESPACE=C;var I=A,D=I.find,L=I.NAMESPACE;function B(t){return""!==t}function P(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function k(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(B):[]}(t);return Object.keys(e.reduce(P,{}))}function N(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function O(t,e){var i=t.prototype;if(!(i instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,N(i,n),t.prototype=i=n}i.constructor!=t&&(i.constructor=t)}var R={},z=R.ELEMENT_NODE=1,H=R.ATTRIBUTE_NODE=2,F=R.TEXT_NODE=3,W=R.CDATA_SECTION_NODE=4,U=R.ENTITY_REFERENCE_NODE=5,V=R.ENTITY_NODE=6,q=R.PROCESSING_INSTRUCTION_NODE=7,j=R.COMMENT_NODE=8,Y=R.DOCUMENT_NODE=9,G=R.DOCUMENT_TYPE_NODE=10,$=R.DOCUMENT_FRAGMENT_NODE=11,X=R.NOTATION_NODE=12,Z={},J={};Z.INDEX_SIZE_ERR=(J[1]="Index size error",1),Z.DOMSTRING_SIZE_ERR=(J[2]="DOMString size error",2);var Q=Z.HIERARCHY_REQUEST_ERR=(J[3]="Hierarchy request error",3);Z.WRONG_DOCUMENT_ERR=(J[4]="Wrong document",4),Z.INVALID_CHARACTER_ERR=(J[5]="Invalid character",5),Z.NO_DATA_ALLOWED_ERR=(J[6]="No data allowed",6),Z.NO_MODIFICATION_ALLOWED_ERR=(J[7]="No modification allowed",7);var K=Z.NOT_FOUND_ERR=(J[8]="Not found",8);Z.NOT_SUPPORTED_ERR=(J[9]="Not supported",9);var tt=Z.INUSE_ATTRIBUTE_ERR=(J[10]="Attribute in use",10);function et(t,e){if(e instanceof Error)var i=e;else i=this,Error.call(this,J[t]),this.message=J[t],Error.captureStackTrace&&Error.captureStackTrace(this,et);return i.code=t,e&&(this.message=this.message+": "+e),i}function it(){}function nt(t,e){this._node=t,this._refresh=e,st(this)}function st(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var i=t._refresh(t._node);if(qt(t,"length",i.length),!t.$$length||i.length<t.$$length)for(var n=i.length;n in t;n++)Object.prototype.hasOwnProperty.call(t,n)&&delete t[n];N(i,t),t._inc=e}}function rt(){}function at(t,e){for(var i=t.length;i--;)if(t[i]===e)return i}function ot(t,e,i,n){if(n?e[at(e,n)]=i:e[e.length++]=i,t){i.ownerElement=t;var s=t.ownerDocument;s&&(n&&ft(s,t,n),function(t,e,i){t&&t._inc++,i.namespaceURI===L.XMLNS&&(e._nsMap[i.prefix?i.localName:""]=i.value)}(s,t,i))}}function ht(t,e,i){var n=at(e,i);if(!(n>=0))throw new et(K,new Error(t.tagName+"@"+i));for(var s=e.length-1;n<s;)e[n]=e[++n];if(e.length=s,t){var r=t.ownerDocument;r&&(ft(r,t,i),i.ownerElement=null)}}function lt(){}function ut(){}function ct(t){return("<"==t?"&lt;":">"==t&&"&gt;")||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function dt(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(dt(t,e))return!0}while(t=t.nextSibling)}function pt(){this.ownerDocument=this}function ft(t,e,i,n){t&&t._inc++,i.namespaceURI===L.XMLNS&&delete e._nsMap[i.prefix?i.localName:""]}function mt(t,e,i){if(t&&t._inc){t._inc++;var n=e.childNodes;if(i)n[n.length++]=i;else{for(var s=e.firstChild,r=0;s;)n[r++]=s,s=s.nextSibling;n.length=r,delete n[n.length]}}}function gt(t,e){var i=e.previousSibling,n=e.nextSibling;return i?i.nextSibling=n:t.firstChild=n,n?n.previousSibling=i:t.lastChild=i,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,mt(t.ownerDocument,t),e}function yt(t){return t&&t.nodeType===ut.DOCUMENT_TYPE_NODE}function vt(t){return t&&t.nodeType===ut.ELEMENT_NODE}function xt(t){return t&&t.nodeType===ut.TEXT_NODE}function bt(t,e){var i=t.childNodes||[];if(D(i,vt)||yt(e))return!1;var n=D(i,yt);return!(e&&n&&i.indexOf(n)>i.indexOf(e))}function wt(t,e){var i=t.childNodes||[];if(D(i,(function(t){return vt(t)&&t!==e})))return!1;var n=D(i,yt);return!(e&&n&&i.indexOf(n)>i.indexOf(e))}function _t(t,e,i){var n=t.childNodes||[],s=e.childNodes||[];if(e.nodeType===ut.DOCUMENT_FRAGMENT_NODE){var r=s.filter(vt);if(r.length>1||D(s,xt))throw new et(Q,"More than one element or text in fragment");if(1===r.length&&!bt(t,i))throw new et(Q,"Element in fragment can not be inserted before doctype")}if(vt(e)&&!bt(t,i))throw new et(Q,"Only one element can be added and only after doctype");if(yt(e)){if(D(n,yt))throw new et(Q,"Only one doctype is allowed");var a=D(n,vt);if(i&&n.indexOf(a)<n.indexOf(i))throw new et(Q,"Doctype can only be inserted before an element");if(!i&&a)throw new et(Q,"Doctype can not be appended since element is present")}}function St(t,e,i){var n=t.childNodes||[],s=e.childNodes||[];if(e.nodeType===ut.DOCUMENT_FRAGMENT_NODE){var r=s.filter(vt);if(r.length>1||D(s,xt))throw new et(Q,"More than one element or text in fragment");if(1===r.length&&!wt(t,i))throw new et(Q,"Element in fragment can not be inserted before doctype")}if(vt(e)&&!wt(t,i))throw new et(Q,"Only one element can be added and only after doctype");if(yt(e)){if(D(n,(function(t){return yt(t)&&t!==i})))throw new et(Q,"Only one doctype is allowed");var a=D(n,vt);if(i&&n.indexOf(a)<n.indexOf(i))throw new et(Q,"Doctype can only be inserted before an element")}}function Et(t,e,i,n){(function(t,e,i){if(!function(t){return t&&(t.nodeType===ut.DOCUMENT_NODE||t.nodeType===ut.DOCUMENT_FRAGMENT_NODE||t.nodeType===ut.ELEMENT_NODE)}(t))throw new et(Q,"Unexpected parent node type "+t.nodeType);if(i&&i.parentNode!==t)throw new et(K,"child not in parent");if(!function(t){return t&&(vt(t)||xt(t)||yt(t)||t.nodeType===ut.DOCUMENT_FRAGMENT_NODE||t.nodeType===ut.COMMENT_NODE||t.nodeType===ut.PROCESSING_INSTRUCTION_NODE)}(e)||yt(e)&&t.nodeType!==ut.DOCUMENT_NODE)throw new et(Q,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)})(t,e,i),t.nodeType===ut.DOCUMENT_NODE&&(n||_t)(t,e,i);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===$){var r=e.firstChild;if(null==r)return e;var a=e.lastChild}else r=a=e;var o=i?i.previousSibling:t.lastChild;r.previousSibling=o,a.nextSibling=i,o?o.nextSibling=r:t.firstChild=r,null==i?t.lastChild=a:i.previousSibling=a;do{r.parentNode=t}while(r!==a&&(r=r.nextSibling));return mt(t.ownerDocument||t,t),e.nodeType==$&&(e.firstChild=e.lastChild=null),e}function At(){this._nsMap={}}function Mt(){}function Tt(){}function Ct(){}function It(){}function Dt(){}function Lt(){}function Bt(){}function Pt(){}function kt(){}function Nt(){}function Ot(){}function Rt(){}function zt(t,e){var i=[],n=9==this.nodeType&&this.documentElement||this,s=n.prefix,r=n.namespaceURI;if(r&&null==s&&null==(s=n.lookupPrefix(r)))var a=[{namespace:r,prefix:null}];return Wt(this,i,t,e,a),i.join("")}function Ht(t,e,i){var n=t.prefix||"",s=t.namespaceURI;if(!s)return!1;if("xml"===n&&s===L.XML||s===L.XMLNS)return!1;for(var r=i.length;r--;){var a=i[r];if(a.prefix===n)return a.namespace!==s}return!0}function Ft(t,e,i){t.push(" ",e,'="',i.replace(/[<>&"\t\n\r]/g,ct),'"')}function Wt(t,e,i,n,s){if(s||(s=[]),n){if(!(t=n(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case z:var r=t.attributes,a=r.length,o=t.firstChild,h=t.tagName,l=h;if(!(i=L.isHTML(t.namespaceURI)||i)&&!t.prefix&&t.namespaceURI){for(var u,c=0;c<r.length;c++)if("xmlns"===r.item(c).name){u=r.item(c).value;break}if(!u)for(var d=s.length-1;d>=0;d--)if(""===(p=s[d]).prefix&&p.namespace===t.namespaceURI){u=p.namespace;break}if(u!==t.namespaceURI)for(d=s.length-1;d>=0;d--){var p;if((p=s[d]).namespace===t.namespaceURI){p.prefix&&(l=p.prefix+":"+h);break}}}e.push("<",l);for(var f=0;f<a;f++)"xmlns"==(m=r.item(f)).prefix?s.push({prefix:m.localName,namespace:m.value}):"xmlns"==m.nodeName&&s.push({prefix:"",namespace:m.value});for(f=0;f<a;f++){var m,g,y;Ht(m=r.item(f),0,s)&&(Ft(e,(g=m.prefix||"")?"xmlns:"+g:"xmlns",y=m.namespaceURI),s.push({prefix:g,namespace:y})),Wt(m,e,i,n,s)}if(h===l&&Ht(t,0,s)&&(Ft(e,(g=t.prefix||"")?"xmlns:"+g:"xmlns",y=t.namespaceURI),s.push({prefix:g,namespace:y})),o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(h)){if(e.push(">"),i&&/^script$/i.test(h))for(;o;)o.data?e.push(o.data):Wt(o,e,i,n,s.slice()),o=o.nextSibling;else for(;o;)Wt(o,e,i,n,s.slice()),o=o.nextSibling;e.push("</",l,">")}else e.push("/>");return;case Y:case $:for(o=t.firstChild;o;)Wt(o,e,i,n,s.slice()),o=o.nextSibling;return;case H:return Ft(e,t.name,t.value);case F:return e.push(t.data.replace(/[<&>]/g,ct));case W:return e.push("<![CDATA[",t.data,"]]>");case j:return e.push("\x3c!--",t.data,"--\x3e");case G:var v=t.publicId,x=t.systemId;if(e.push("<!DOCTYPE ",t.name),v)e.push(" PUBLIC ",v),x&&"."!=x&&e.push(" ",x),e.push(">");else if(x&&"."!=x)e.push(" SYSTEM ",x,">");else{var b=t.internalSubset;b&&e.push(" [",b,"]"),e.push(">")}return;case q:return e.push("<?",t.target," ",t.data,"?>");case U:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function Ut(t,e,i){var n;switch(e.nodeType){case z:(n=e.cloneNode(!1)).ownerDocument=t;case $:break;case H:i=!0}if(n||(n=e.cloneNode(!1)),n.ownerDocument=t,n.parentNode=null,i)for(var s=e.firstChild;s;)n.appendChild(Ut(t,s,i)),s=s.nextSibling;return n}function Vt(t,e,i){var n=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var r=e[s];"object"!=typeof r&&r!=n[s]&&(n[s]=r)}switch(e.childNodes&&(n.childNodes=new it),n.ownerDocument=t,n.nodeType){case z:var a=e.attributes,o=n.attributes=new rt,h=a.length;o._ownerElement=n;for(var l=0;l<h;l++)n.setAttributeNode(Vt(t,a.item(l),!0));break;case H:i=!0}if(i)for(var u=e.firstChild;u;)n.appendChild(Vt(t,u,i)),u=u.nextSibling;return n}function qt(t,e,i){t[e]=i}Z.INVALID_STATE_ERR=(J[11]="Invalid state",11),Z.SYNTAX_ERR=(J[12]="Syntax error",12),Z.INVALID_MODIFICATION_ERR=(J[13]="Invalid modification",13),Z.NAMESPACE_ERR=(J[14]="Invalid namespace",14),Z.INVALID_ACCESS_ERR=(J[15]="Invalid access",15),et.prototype=Error.prototype,N(Z,et),it.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t,e){for(var i=[],n=0;n<this.length;n++)Wt(this[n],i,t,e);return i.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},nt.prototype.item=function(t){return st(this),this[t]||null},O(nt,it),rt.prototype={length:0,item:it.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var i=this[e];if(i.nodeName==t)return i}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new et(tt);var i=this.getNamedItem(t.nodeName);return ot(this._ownerElement,this,t,i),i},setNamedItemNS:function(t){var e,i=t.ownerElement;if(i&&i!=this._ownerElement)throw new et(tt);return e=this.getNamedItemNS(t.namespaceURI,t.localName),ot(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return ht(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var i=this.getNamedItemNS(t,e);return ht(this._ownerElement,this,i),i},getNamedItemNS:function(t,e){for(var i=this.length;i--;){var n=this[i];if(n.localName==e&&n.namespaceURI==t)return n}return null}},lt.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,i){var n=new pt;if(n.implementation=this,n.childNodes=new it,n.doctype=i||null,i&&n.appendChild(i),e){var s=n.createElementNS(t,e);n.appendChild(s)}return n},createDocumentType:function(t,e,i){var n=new Lt;return n.name=t,n.nodeName=t,n.publicId=e||"",n.systemId=i||"",n}},ut.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return Et(this,t,e)},replaceChild:function(t,e){Et(this,t,e,St),e&&this.removeChild(e)},removeChild:function(t){return gt(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return Vt(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==F&&t.nodeType==F?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var i=e._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===t)return n;e=e.nodeType==H?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var i=e._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,t))return i[t];e=e.nodeType==H?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},N(R,ut),N(R,ut.prototype),pt.prototype={nodeName:"#document",nodeType:Y,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==$){for(var i=t.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,e),i=n}return t}return Et(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===z&&(this.documentElement=t),t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),gt(this,t)},replaceChild:function(t,e){Et(this,t,e,St),t.ownerDocument=this,e&&this.removeChild(e),vt(t)&&(this.documentElement=t)},importNode:function(t,e){return Ut(this,t,e)},getElementById:function(t){var e=null;return dt(this.documentElement,(function(i){if(i.nodeType==z&&i.getAttribute("id")==t)return e=i,!0})),e},getElementsByClassName:function(t){var e=k(t);return new nt(this,(function(i){var n=[];return e.length>0&&dt(i.documentElement,(function(s){if(s!==i&&s.nodeType===z){var r=s.getAttribute("class");if(r){var a=t===r;if(!a){var o=k(r);a=e.every((h=o,function(t){return h&&-1!==h.indexOf(t)}))}a&&n.push(s)}}var h})),n}))},createElement:function(t){var e=new At;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new it,(e.attributes=new rt)._ownerElement=e,e},createDocumentFragment:function(){var t=new Nt;return t.ownerDocument=this,t.childNodes=new it,t},createTextNode:function(t){var e=new Ct;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new It;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new Dt;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var i=new Ot;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=t,i.nodeValue=i.data=e,i},createAttribute:function(t){var e=new Mt;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new kt;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var i=new At,n=e.split(":"),s=i.attributes=new rt;return i.childNodes=new it,i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.namespaceURI=t,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,s._ownerElement=i,i},createAttributeNS:function(t,e){var i=new Mt,n=e.split(":");return i.ownerDocument=this,i.nodeName=e,i.name=e,i.namespaceURI=t,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,i}},O(pt,ut),At.prototype={nodeType:z,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var i=this.ownerDocument.createAttribute(t);i.value=i.nodeValue=""+e,this.setAttributeNode(i)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===$?this.insertBefore(t,null):function(t,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=t,e.previousSibling=t.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,t.lastChild=e,mt(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);i&&this.removeAttributeNode(i)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);return i&&i.value||""},setAttributeNS:function(t,e,i){var n=this.ownerDocument.createAttributeNS(t,e);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new nt(this,(function(e){var i=[];return dt(e,(function(n){n===e||n.nodeType!=z||"*"!==t&&n.tagName!=t||i.push(n)})),i}))},getElementsByTagNameNS:function(t,e){return new nt(this,(function(i){var n=[];return dt(i,(function(s){s===i||s.nodeType!==z||"*"!==t&&s.namespaceURI!==t||"*"!==e&&s.localName!=e||n.push(s)})),n}))}},pt.prototype.getElementsByTagName=At.prototype.getElementsByTagName,pt.prototype.getElementsByTagNameNS=At.prototype.getElementsByTagNameNS,O(At,ut),Mt.prototype.nodeType=H,O(Mt,ut),Tt.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(J[Q])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){i=this.data.substring(0,t)+i+this.data.substring(t+e),this.nodeValue=this.data=i,this.length=i.length}},O(Tt,ut),Ct.prototype={nodeName:"#text",nodeType:F,splitText:function(t){var e=this.data,i=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},O(Ct,Tt),It.prototype={nodeName:"#comment",nodeType:j},O(It,Tt),Dt.prototype={nodeName:"#cdata-section",nodeType:W},O(Dt,Tt),Lt.prototype.nodeType=G,O(Lt,ut),Bt.prototype.nodeType=X,O(Bt,ut),Pt.prototype.nodeType=V,O(Pt,ut),kt.prototype.nodeType=U,O(kt,ut),Nt.prototype.nodeName="#document-fragment",Nt.prototype.nodeType=$,O(Nt,ut),Ot.prototype.nodeType=q,O(Ot,ut),Rt.prototype.serializeToString=function(t,e,i){return zt.call(t,e,i)},ut.prototype.toString=zt;try{if(Object.defineProperty){let t=function(e){switch(e.nodeType){case z:case $:var i=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&i.push(t(e)),e=e.nextSibling;return i.join("");default:return e.nodeValue}};Object.defineProperty(nt.prototype,"length",{get:function(){return st(this),this.$$length}}),Object.defineProperty(ut.prototype,"textContent",{get:function(){return t(this)},set:function(t){switch(this.nodeType){case z:case $:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),qt=function(t,e,i){t["$$"+e]=i}}}catch(t){}E.DocumentType=Lt,E.DOMException=et,E.DOMImplementation=lt,E.Element=At,E.Node=ut,E.NodeList=it,E.XMLSerializer=Rt;var jt,Yt,Gt={},$t={};jt=$t,Yt=A.freeze,jt.XML_ENTITIES=Yt({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),jt.HTML_ENTITIES=Yt({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),jt.entityMap=jt.HTML_ENTITIES;var Xt={},Zt=A.NAMESPACE,Jt=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Qt=new RegExp("[\\-\\.0-9"+Jt.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Kt=new RegExp("^"+Jt.source+Qt.source+"*(?::"+Jt.source+Qt.source+"*)?$");function te(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,te)}function ee(){}function ie(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function ne(t,e,i,n,s,r){function a(t,e,n){i.attributeNames.hasOwnProperty(t)&&r.fatalError("Attribute "+t+" redefined"),i.addValue(t,e.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),n)}for(var o,h=++e,l=0;;){var u=t.charAt(h);switch(u){case"=":if(1===l)o=t.slice(e,h),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(r.warning('attribute value must after "="'),o=t.slice(e,h)),e=h+1,!((h=t.indexOf(u,e))>0))throw new Error("attribute value no end '"+u+"' match");a(o,c=t.slice(e,h),e-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');a(o,c=t.slice(e,h),e),r.warning('attribute "'+o+'" missed start quot('+u+")!!"),e=h+1,l=5}break;case"/":switch(l){case 0:i.setTagName(t.slice(e,h));case 5:case 6:case 7:l=7,i.closed=!0;case 4:case 1:break;case 2:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return r.error("unexpected end of input"),0==l&&i.setTagName(t.slice(e,h)),h;case">":switch(l){case 0:i.setTagName(t.slice(e,h));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=t.slice(e,h)).slice(-1)&&(i.closed=!0,c=c.slice(0,-1));case 2:2===l&&(c=o),4==l?(r.warning('attribute "'+c+'" missed quot(")!'),a(o,c,e)):(Zt.isHTML(n[""])&&c.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),a(c,c,e));break;case 3:throw new Error("attribute value missed!!")}return h;case"€":u=" ";default:if(u<=" ")switch(l){case 0:i.setTagName(t.slice(e,h)),l=6;break;case 1:o=t.slice(e,h),l=2;break;case 4:var c=t.slice(e,h);r.warning('attribute "'+c+'" missed quot(")!!'),a(o,c,e);case 5:l=6}else switch(l){case 2:i.tagName,Zt.isHTML(n[""])&&o.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=h,l=1;break;case 5:r.warning('attribute space is required"'+o+'"!!');case 6:l=1,e=h;break;case 3:l=4,e=h;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function se(t,e,i){for(var n=t.tagName,s=null,r=t.length;r--;){var a=t[r],o=a.qName,h=a.value;if((d=o.indexOf(":"))>0)var l=a.prefix=o.slice(0,d),u=o.slice(d+1),c="xmlns"===l&&u;else u=o,l=null,c="xmlns"===o&&"";a.localName=u,!1!==c&&(null==s&&(s={},oe(i,i={})),i[c]=s[c]=h,a.uri=Zt.XMLNS,e.startPrefixMapping(c,h))}for(r=t.length;r--;)(l=(a=t[r]).prefix)&&("xml"===l&&(a.uri=Zt.XML),"xmlns"!==l&&(a.uri=i[l||""]));var d;(d=n.indexOf(":"))>0?(l=t.prefix=n.slice(0,d),u=t.localName=n.slice(d+1)):(l=null,u=t.localName=n);var p=t.uri=i[l||""];if(e.startElement(p,u,n,t),!t.closed)return t.currentNSMap=i,t.localNSMap=s,!0;if(e.endElement(p,u,n),s)for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&e.endPrefixMapping(l)}function re(t,e,i,n,s){if(/^(?:script|textarea)$/i.test(i)){var r=t.indexOf("</"+i+">",e),a=t.substring(e+1,r);if(/[&<]/.test(a))return/^script$/i.test(i)?(s.characters(a,0,a.length),r):(a=a.replace(/&#?\w+;/g,n),s.characters(a,0,a.length),r)}return e+1}function ae(t,e,i,n){var s=n[i];return null==s&&((s=t.lastIndexOf("</"+i+">"))<e&&(s=t.lastIndexOf("</"+i)),n[i]=s),s<e}function oe(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function he(t,e,i,n){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(s=t.indexOf("--\x3e",e+4))>e?(i.comment(t,e+4,s-e-4),s+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var s=t.indexOf("]]>",e+9);return i.startCDATA(),i.characters(t,e+9,s-e-9),i.endCDATA(),s+3}var r=function(t,e){var i,n=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(t);i=s.exec(t);)if(n.push(i),i[1])return n}(t,e),a=r.length;if(a>1&&/!doctype/i.test(r[0][0])){var o=r[1][0],h=!1,l=!1;a>3&&(/^public$/i.test(r[2][0])?(h=r[3][0],l=a>4&&r[4][0]):/^system$/i.test(r[2][0])&&(l=r[3][0]));var u=r[a-1];return i.startDTD(o,h,l),i.endDTD(),u.index+u[0].length}return-1}function le(t,e,i){var n=t.indexOf("?>",e);if(n){var s=t.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return s?(s[0].length,i.processingInstruction(s[1],s[2]),n+2):-1}return-1}function ue(){this.attributeNames={}}te.prototype=new Error,te.prototype.name=te.name,ee.prototype={parse:function(t,e,i){var n=this.domBuilder;n.startDocument(),oe(e,e={}),function(t,e,i,n,s){function r(t){var e=t.slice(1,-1);return Object.hasOwnProperty.call(i,e)?i[e]:"#"===e.charAt(0)?function(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}(parseInt(e.substr(1).replace("x","0x"))):(s.error("entity not found:"+t),t)}function a(e){if(e>f){var i=t.substring(f,e).replace(/&#?\w+;/g,r);c&&o(f),n.characters(i,0,e-f),f=e}}function o(e,i){for(;e>=l&&(i=u.exec(t));)h=i.index,l=h+i[0].length,c.lineNumber++;c.columnNumber=e-h+1}for(var h=0,l=0,u=/.*(?:\r\n?|\n)|.*$/g,c=n.locator,d=[{currentNSMap:e}],p={},f=0;;){try{var m=t.indexOf("<",f);if(m<0){if(!t.substr(f).match(/^\s*$/)){var g=n.doc,y=g.createTextNode(t.substr(f));g.appendChild(y),n.currentElement=y}return}switch(m>f&&a(m),t.charAt(m+1)){case"/":var v=t.indexOf(">",m+3),x=t.substring(m+2,v).replace(/[ \t\n\r]+$/g,""),b=d.pop();v<0?(x=t.substring(m+2).replace(/[\s<].*/,""),s.error("end tag name: "+x+" is not complete:"+b.tagName),v=m+1+x.length):x.match(/\s</)&&(x=x.replace(/[\s<].*/,""),s.error("end tag name: "+x+" maybe not complete"),v=m+1+x.length);var w=b.localNSMap,_=b.tagName==x;if(_||b.tagName&&b.tagName.toLowerCase()==x.toLowerCase()){if(n.endElement(b.uri,b.localName,x),w)for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&n.endPrefixMapping(S);_||s.fatalError("end tag name: "+x+" is not match the current start tagName:"+b.tagName)}else d.push(b);v++;break;case"?":c&&o(m),v=le(t,m,n);break;case"!":c&&o(m),v=he(t,m,n,s);break;default:c&&o(m);var E=new ue,A=d[d.length-1].currentNSMap,M=(v=ne(t,m,E,A,r,s),E.length);if(!E.closed&&ae(t,v,E.tagName,p)&&(E.closed=!0,i.nbsp||s.warning("unclosed xml attribute")),c&&M){for(var T=ie(c,{}),C=0;C<M;C++){var I=E[C];o(I.offset),I.locator=ie(c,{})}n.locator=T,se(E,n,A)&&d.push(E),n.locator=c}else se(E,n,A)&&d.push(E);Zt.isHTML(E.uri)&&!E.closed?v=re(t,v,E.tagName,r,n):v++}}catch(t){if(t instanceof te)throw t;s.error("element parse error: "+t),v=-1}v>f?f=v:a(Math.max(m,f)+1)}}(t,e,i,n,this.errorHandler),n.endDocument()}},ue.prototype={setTagName:function(t){if(!Kt.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,i){if(!Kt.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:i}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},Xt.XMLReader=ee,Xt.ParseError=te;var ce=A,de=$t,pe=Xt,fe=E.DOMImplementation,me=ce.NAMESPACE,ge=pe.ParseError,ye=pe.XMLReader;function ve(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function xe(t){this.options=t||{locator:{}}}function be(){this.cdata=!1}function we(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function _e(t,e,i){return"string"==typeof t?t.substr(e,i):t.length>=e+i||e?new java.lang.String(t,e,i)+"":t}function Se(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}xe.prototype.parseFromString=function(t,e){var i=this.options,n=new ye,s=i.domBuilder||new be,r=i.errorHandler,a=i.locator,o=i.xmlns||{},h=/\/x?html?$/.test(e),l=h?de.HTML_ENTITIES:de.XML_ENTITIES;a&&s.setDocumentLocator(a),n.errorHandler=function(t,e,i){if(!t){if(e instanceof be)return e;t=e}var n={},s=t instanceof Function;function r(e){var r=t[e];!r&&s&&(r=2==t.length?function(i){t(e,i)}:t),n[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+function(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(i))}||function(){}}return i=i||{},r("warning"),r("error"),r("fatalError"),n}(r,s,a),n.domBuilder=i.domBuilder||s,h&&(o[""]=me.HTML),o.xml=o.xml||me.XML;var u=i.normalizeLineEndings||ve;return t&&"string"==typeof t?n.parse(u(t),o,l):n.errorHandler.error("invalid doc source"),s.doc},be.prototype={startDocument:function(){this.doc=(new fe).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,i,n){var s=this.doc,r=s.createElementNS(t,i||e),a=n.length;Se(this,r),this.currentElement=r,this.locator&&we(this.locator,r);for(var o=0;o<a;o++){t=n.getURI(o);var h=n.getValue(o),l=(i=n.getQName(o),s.createAttributeNS(t,i));this.locator&&we(n.getLocator(o),l),l.value=l.nodeValue=h,r.setAttributeNode(l)}},endElement:function(t,e,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var i=this.doc.createProcessingInstruction(t,e);this.locator&&we(this.locator,i),Se(this,i)},ignorableWhitespace:function(t,e,i){},characters:function(t,e,i){if(t=_e.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(t);else n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&we(this.locator,n)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,i){t=_e.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&we(this.locator,n),Se(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(t,e,i);this.locator&&we(this.locator,s),Se(this,s),this.doc.doctype=s}},warning:function(t){},error:function(t){},fatalError:function(t){throw new ge(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){be.prototype[t]=function(){return null}})),Gt.__DOMHandler=be,Gt.normalizeLineEndings=ve,Gt.DOMParser=xe;var Ee=Gt.DOMParser;const Ae="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{document:void 0,tinyEngine:void 0};Ae.Path2D||function(t){if(!t||!t.CanvasRenderingContext2D||t.Path2D)return;const{CanvasRenderingContext2D:e}=t,i=null==e?void 0:e.prototype.fill,n=null==e?void 0:e.prototype.stroke,s=null==e?void 0:e.prototype.isPointInPath;e.prototype.fill=function(...t){if(!(t[0]instanceof g)){const e=t[0]||"nonzero";return i.apply(this,[e])}{const e=t[0],n=t[1]||"nonzero";y(this,e.commands),i.apply(this,[n])}},e.prototype.stroke=function(t){t&&y(this,t.commands),n.apply(this)},e.prototype.isPointInPath=function(...t){if(t[0]instanceof g){const e=t[0],i=t[1],n=t[2],r=t[3]||"nonzero";return y(this,e.commands),s.apply(this,[i,n,r])}return s.apply(this,t)},t.Path2D=g}(Ae),Ae.DOMParser||(Ae.DOMParser=Ee);const Me={window:Ae,version:"2.0.2",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),dpr:1,document:Ae.document,time:0,deltaTime:0,config:w},Te=(t,e,i)=>Math.max(e,Math.min(i,t)),Ce=(t,e=1e-6)=>Math.abs(t)<e?0:t<0?-1:1,Ie=t=>t*(Math.PI/180),De=(t,e,i)=>(1-i)*t+i*e,Le={transparent:"rgba(1, 1, 1, 0)",green:"#45b787",darkGreen:"#21532fff",blue:"#6e9bc5",darkBlue:"#2775b6",red:"#F26666",darkRed:"#D95970",brown:"#ECD2B9",darkBrown:"#BF9D8A",yellow:"#ECDEC0",darkYellow:"#D0AC57",lightGray:"#e0e0e0",gray:"#beb6b6",darkGray:"#918883",white:"#F2F2F2",darkWhite:"#ececec",lightBlack:"#2E3032",black:"#182327",blackAlpha5:"rgba(0, 0, 0, 0.5)"},Be={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},Pe={h:0,s:0,l:0},ke={h:0,s:0,l:0};function Ne(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}const Oe=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;let Re=class t{constructor(t,e,i,n){return d(this,"isColor",!0),d(this,"r",1),d(this,"g",1),d(this,"b",1),d(this,"a",1),void 0===e&&void 0===i?this.set(t):this.setRGBA(t,e,i,n)}static isColor(t){return"string"==typeof t?Oe.test(t):"number"==typeof t&&Number.isInteger(t)&&t>=0&&t<=16777215&&6===t.toString(6).length}static getRandomStyle(t){return t?ze.random().setA(t).getStyle():ze.random().getStyle()}static getDarken(t,e=.8){return ze.set(t).getHSL(He),ze.setHSL(He.h,He.s,He.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return ze.set(t),ze.getContrastString()}static getArray(t){return ze.set(t).toArray()}static getComplementary(t){return ze.set(t),ze.getComplementaryString()}static getMoreTransparent(t,e){return ze.set(t).setA(e).getStyle()}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(t){return this.r=t,this.g=t,this.b=t,this.a=1,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this.a=1,this}setR(t){return this.r=t,this}setG(t){return this.g=t,this}setB(t){return this.b=t,this}setA(t){return this.a=t,this}setRGB(t,e,i){return this.setRGBA(t,e,i,this.a)}setRGBA(t,e,i,n=1){return this.r=t,this.g=e,this.b=i,this.a=n,this}setHSL(t,e,i,n=1){if(t=(t%1+1)%1,e=Te(e,0,1),i=Te(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,s=2*i-n;this.r=Ne(s,n,t+1/3),this.g=Ne(s,n,t),this.b=Ne(s,n,t-1/3)}return this.a=n,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const i=e[1],n=e[2];switch(i){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,this.a=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,this.a=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n)){const e=parseFloat(t[1])/360,i=parseInt(t[2],10)/100,n=parseInt(t[3],10)/100,s=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0);return this.setHSL(e,i,n,s)}}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=e[1],i=t.length;if(3===i)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this.a=1,this;if(6===i)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=Be[t.toLowerCase()];return void 0!==e&&this.setHex(e),this}clone(){return new t(this.r,this.g,this.b,this.a)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}getRGB(e=new t){return e.setRGB(this.r,this.g,this.b)}getRGBByBg(e=new t){const i=this.a,n=i*this.r+(1-i)*e.r,s=i*this.g+(1-i)*e.g,r=i*this.b+(1-i)*e.b;return new t(n,s,r)}getHex(){return Te(255*this.r,0,255)<<16^Te(255*this.g,0,255)<<8^Te(255*this.b,0,255)}getHSL(t){const e=this.r,i=this.g,n=this.b,s=Math.max(e,i,n),r=Math.min(e,i,n);let a,o=0;const h=(r+s)/2;if(r===s)o=0,a=0;else{const t=s-r;switch(a=h<=.5?t/(s+r):t/(2-s-r),s){case e:o=(i-n)/t+(i<n?6:0);break;case i:o=(n-e)/t+2;break;case n:o=(e-i)/t+4}o/=6}return t.h=o,t.s=a,t.l=h,t}getStyle(){return 1===this.a?`rgb(${255*this.r|0},${255*this.g|0},${255*this.b|0})`:`rgba(${255*this.r|0},${255*this.g|0},${255*this.b|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let t=(255*this.r*299+255*this.g*587+255*this.b*144)/1e3;return t+=(255-t)*(255-255*this.a)/255,t}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(e=new t){const i=this.toArray(),n=[0,0,0,1];for(let t=0;t<i.length;t++)if(t<3)n[t]=1-i[t];else{if(3!==t)continue;i[t]>1||i[t]<=0?n[t]=1:n[t]=Math.max(Math.min(parseFloat(i[t].toFixed(2)),1),0)}return e.setRGBA(n[0],n[1],n[2],parseFloat(n[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(e){if(void 0===e||e>=1)return this.getHexString();const i=this.getRGBByBg(),n=i.r*e+(1-e),s=i.g*e+(1-e),r=i.b*e+(1-e);return new t(n,s,r).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(t,e,i){return this.getHSL(Pe),Pe.h+=t,Pe.s+=e,Pe.l+=i,this.setHSL(Pe.h,Pe.s,Pe.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(Pe),t.getHSL(ke);const i=De(Pe.h,ke.h,e),n=De(Pe.s,ke.s,e),s=De(Pe.l,ke.l,e);return this.setHSL(i,n,s),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[0,0,0,0],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const ze=new Re,He={h:0,s:0,l:0};let Fe=class t{constructor(t=0,e=0,i){d(this,"isVector2",!0),d(this,"x",0),d(this,"y",0),d(this,"z"),this.x=t,this.y=e,this.z=i||0}static isZero(t){return 0===t.x&&0===t.y}static isEmpty(t){return!Number.isFinite(t.x)&&!Number.isFinite(t.y)}static equals(t,e,i=!0){return i?t.x===e.x&&t.y===e.y:Math.abs(t.x-e.x)<Ue&&Math.abs(t.y-e.y)<Ue}static getInt32Array(t,e=2){const i=new ArrayBuffer(t.length*e*4),n=new Int32Array(i);for(let e=0,i=t.length;e<i;e++)n[2*e]=t[e].x,n[2*e+1]=t[e].y;return n}static getFloat64Array(t,e=2){const i=new ArrayBuffer(t.length*e*8),n=new Float64Array(i);for(let e=0,i=t.length;e<i;e++)n[2*e]=t[e].x,n[2*e+1]=t[e].y;return n}static getVectors(e){const i=[];for(let n=0,s=e.length;n<s;n++)i.push(new t(e[n].x,e[n].y));return i}static getStrings(e){const i=[];if(!e||!e.length)return"";for(let n=0,s=e.length;n<s;n++)i.push(t.getString(e[n]));return i.join(",")}static getString(t){return`${t.x},${t.y}`}static getLength(t){return Math.sqrt(t.x*t.x+t.y*t.y)}static getDistance(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}static distanceToPolygon(t,e){let i=1/0;for(let n=0,s=e.length-1;n<e.length;s=n++){const r=e[n].x,a=e[n].y,o=e[s].x-r,h=e[s].y-a,l=Math.sqrt(o*o+h*h);if(l>0){const e=Math.max(0,Math.min(1,((t.x-r)*o+(t.y-a)*h)/(l*l))),n=r+e*o,s=a+e*h,u=Math.sqrt((t.x-n)*(t.x-n)+(t.y-s)*(t.y-s));i=Math.min(i,u)}}return i}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(e,i){return(new t).subVectors(e,i)}static isPointOnSegment(t,e,i){return 0===Ce(this.sub(t,i).cross(this.sub(e,i)))&&Ce(this.sub(t,i).dot(this.sub(e,i)))<=0}static angle(t,e,i){return i?Math.atan2(t.y-e.y,t.x-e.x):(t=>{let e=t*(180/Math.PI);return e<0&&(e+=360),e>360&&(e-=360),e})(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let i=this.getClothoidPoints(t,e),n=0;for(let t=0,e=i.length;t<e;t++){let e=Math.max(0,t-1);t>0?n+=this.getDistance(i[e],i[e+1]):n=0,i[t].l=Math.round(n);let s=this.angle(i[e+1],i[e]);i[t].a=Math.round(100*s)/100}return i}static getClothoidPoints(e,i=100){let n=[],s=e.concat([]);if(!s||s.length<2)return n;2===s.length?(s.push(s[1]),s.unshift(s[0])):3===s.length&&s.splice(2,0,s[1]);for(let e=0;e<s.length-3;e+=3){let r=new t(s[e].x,s[e].y),a=new t(s[e+1].x,s[e+1].y),o=new t(s[e+2].x,s[e+2].y),h=new t(s[e+3].x,s[e+3].y),l=0;l+=r.distanceTo(a),l+=a.distanceTo(o),l+=o.distanceTo(h);let u=Math.min(.5,1/(l/i));for(let t=u;t<1;t+=u){let e=3*(a.x-r.x),i=3*(o.x-a.x)-e,s=h.x-r.x-e-i,l=3*(a.y-r.y),u=3*(o.y-a.y)-l,c=h.y-r.y-l-u,d=s*Math.pow(t,3)+i*Math.pow(t,2)+e*t+r.x,p=c*Math.pow(t,3)+u*Math.pow(t,2)+l*t+r.y;n.push({x:Math.round(d),y:Math.round(p),a:0,l:0})}}return n.unshift({x:s[0].x,y:s[0].y,a:0,l:0}),n.push({x:s[s.length-1].x,y:s[s.length-1].y,a:0,l:0}),n}static getClothoidLength(t){let e=0;if(t.length>2)for(let i=0;i<t.length;i++){let n=Math.max(0,i-1);i>0&&(e+=this.getDistance(t[n],t[n+1]))}return e}static getCircleCenterByChord(e,i,n,s=!0,r=new t){const a=this.getDistance(e,i);if(0===a)return r.x=1/0,r.y=1/0,r;We.set((e.x+i.x)/2,(e.y+i.y)/2);const o=Math.sqrt(n*n-a*a/4),h=s?-1:1;return r.x=We.x+h*o*(i.y-e.y)/a,r.y=We.y-h*o*(i.x-e.x)/a,r}static isPointInCircle(t,e,i){return this.getDistance(i,t)<e}static isPointInConvexHull(t,e){let i=!1;const n=e.length;for(let s=0,r=n-1;s<n;r=s++){const n=e[s],a=e[r];if(Math.min(n.x,a.x)<=t.x&&t.x<=Math.max(n.x,a.x)&&Math.min(n.y,a.y)<=t.y&&t.y<=Math.max(n.y,a.y)){const e=(a.x-n.x)*(t.y-n.y)-(a.y-n.y)*(t.x-n.x);if(Math.abs(e)<1e-12)return!0}n.y>t.y!=a.y>t.y&&t.x<(a.x-n.x)*(t.y-n.y)/(a.y-n.y)+n.x&&(i=!i)}return i}static isPointInPolygon(t,e){let i=!1;for(let n=0,s=e.length-1;n<e.length;s=n++){const r=e[n].x,a=e[n].y,o=e[s].x,h=e[s].y;a>t.y!=h>t.y&&t.x<(o-r)*(t.y-a)/(h-a)+r&&(i=!i)}return i}static isPointInPolygonByRay(e,i){let n=0;const s=(new t).copy(e),r=new t,a=new t;for(let t=0;t<i.length;t++){t===i.length-1?(r.copy(i[t]),a.copy(i[0])):(r.copy(i[t]),a.copy(i[t+1]));let e=[r.y,a.y].sort(((t,e)=>t-e));e[0]<s.y&&e[1]>s.y&&(r.x<s.x||a.x<s.x)&&n++}return n%2==1}static getIntersectionOfSegments(e,i,n,s,r=!1,a=new t){const o=(s.y-n.y)*(i.x-e.x)-(s.x-n.x)*(i.y-e.y);if(0===o)return a.makeEmpty();const h=((s.x-n.x)*(e.y-n.y)-(s.y-n.y)*(e.x-n.x))/o,l=((i.x-e.x)*(e.y-n.y)-(i.y-e.y)*(e.x-n.x))/o;return r&&(h<0||h>1||l<0||l>1)?a.makeEmpty():(a.x=e.x+h*(i.x-e.x),a.y=e.y+h*(i.y-e.y),a)}static getConvexHullByGrahamScan(t,e=!1,i=[]){if(!t||!t.length)return i;const n=t.length;let s=0;for(let e=0;e<n;e++)t[e].x<t[s].x&&(s=e);let r,a=s;do{i.push(t[a]),r=(a+1)%n;for(let e=0;e<n;e++)this.whichSideOfSegment(t[a],t[e],t[r])>0&&(r=e);a=r}while(a!==s);return e&&i.push(t[s]),i}static whichSideOfSegment(t,e,i){return(e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)}static getPointsWithMatrix3(t,e){const i=[];if(!t)return i;for(let n=0,s=t.length;n<s;n++)i.push({x:e.elements[0]*t[n].x+e.elements[3]*t[n].y+e.elements[6],y:e.elements[1]*t[n].x+e.elements[4]*t[n].y+e.elements[7]});return i}static getPointsApplyMatrix3(t,e=[]){for(let i=0,n=e.length;i<n;i++){const n=t.elements[0]*e[i].x+t.elements[3]*e[i].y+t.elements[6],s=t.elements[1]*e[i].x+t.elements[4]*e[i].y+t.elements[7];e[i].x=n,e[i].y=s}return e}static getCentral(e,i=new t){let n=0,s=0;for(let t=0,i=e.length;t<i;t++)n+=e[t].x,s+=e[t].y;return i.set(n/e.length,s/e.length)}static getCentralByNumbers2(e,i=new t){let n=0,s=0;for(let t=0,i=e.length;t<i;t+=2)n+=e[t],s+=e[t+1];const r=e.length/2;return i.set(n/r,s/r)}static getCentroidByNumbers2(e,i=new t){if(!e||0===e.length)return i.set(0,0);if(e.length<6)return this.getCentralByNumbers2(e,i);let n=0,s=0,r=0;for(let t=0;t<e.length;t+=2){const i=(t+2)%e.length,a=e[t]*e[i+1]-e[i]*e[t+1];n+=a,s+=(e[t]+e[i])*a,r+=(e[t+1]+e[i+1])*a}return n/=2,Math.abs(n)<1e-10?this.getCentralByNumbers2(e,i):(s/=6*n,r/=6*n,i.set(s,r))}static getPoleOfInaccessibility(e,i=new t,n=1){const s=new t;t.getCentroidByNumbers2(e,s);const r=[];for(let t=0;t<e.length;t+=2)r.push({x:e[t],y:e[t+1]});let a={x:s.x,y:s.y},o=this.distanceToPolygon(a,r);for(let t=0;t<20;t++){const e=2*Math.PI*t/20,i=20*Math.random(),n={x:s.x+i*Math.cos(e),y:s.y+i*Math.sin(e)};if(this.isPointInPolygon(n,r)){const t=this.distanceToPolygon(n,r);t>o&&(o=t,a=n)}}return i.set(a.x,a.y),i.z=o,i}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clone(){return new t(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}cross(t){return this.x*t.y-this.y*t.x}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}dot(t){return this.x*t.x+this.y*t.y}equals(t,e=!0){return e?t.x===this.x&&t.y===this.y:Math.abs(t.x-this.x)<Ue&&Math.abs(t.y-this.y)<Ue}equalsXY(){return Math.abs(this.x-this.y)<Ue}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+t)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}length(){return Math.sqrt(this.dot(this))}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}maxXY(t,e){return this.x=Math.max(this.x,t),this.y=Math.max(this.y,e),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}minXY(t,e){return this.x=Math.min(this.x,t),this.y=Math.min(this.y,e),this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t,e){return this.x*=t,this.y*=e||t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(t){return this.applyMatrix3(t.matrixWorldInverse).applyMatrix3(t.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.x,s=this.y;return this.x=n*e-s*i,this.y=n*i+s*e,this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),s=this.x-t.x,r=this.y-t.y;return this.x=s*i-r*n+t.x,this.y=s*n+r*i+t.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(t,e,i){return this.x=t,this.y=e,i&&(this.z=i),this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("out of range: "+t)}return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,3*e)}setLength(t){return this.normalize().multiplyScalar(t)}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(t,e=!1){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}};const We=new Fe,Ue=1e-8;function Ve(t){return t>-1e-8&&t<1e-8}function qe(t,e,i,n,s){const r=1-s;return r*r*(r*t+3*s*e)+s*s*(s*n+3*r*i)}function je(t,e,i,n,s){const r=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let h=0;if(Ve(a)){if((l=r)>1e-8||l<-1e-8){const t=-o/r;t>=0&&t<=1&&(s[h++]=t)}}else{const t=r*r-4*a*o;if(Ve(t))s[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),n=(-r-e)/(2*a);i>=0&&i<=1&&(s[h++]=i),n>=0&&n<=1&&(s[h++]=n)}}var l;return h}function Ye(t,e,i,n,s,r,a,o,h){let l=t,u=e,c=0;const d=1/h;for(let p=1;p<=h;p++){let h=p*d;const f=qe(t,i,s,a,h),m=qe(e,n,r,o,h),g=f-l,y=m-u;c+=Math.sqrt(g*g+y*y),l=f,u=m}return c}function Ge(t,e,i,n,s,r){const a=(e-t)*s+t,o=(i-e)*s+e,h=(n-i)*s+i,l=(o-a)*s+a,u=(h-o)*s+o,c=(u-l)*s+l;r[0]=t,r[1]=a,r[2]=l,r[3]=c,r[4]=c,r[5]=u,r[6]=h,r[7]=n}function $e(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}function Xe(t,e,i,n){const s=1-n;return s*(s*t+2*n*e)+n*n*i}function Ze(t,e,i,n,s,r,a){let o=t,h=e,l=0;const u=1/a;for(let c=1;c<=a;c++){let a=c*u;const d=Xe(t,i,s,a),p=Xe(e,n,r,a),f=d-o,m=p-h;l+=Math.sqrt(f*f+m*m),o=d,h=p}return l}function Je(t,e,i,n,s){const r=(e-t)*n+t,a=(i-e)*n+e,o=(a-r)*n+r;s[0]=t,s[1]=r,s[2]=o,s[3]=o,s[4]=a,s[5]=i}const Qe=Math.PI,Ke=2*Qe;function ti(t){return(t%=Ke)<0&&(t+=Ke),t}function ei(t,e){let i=ti(t[0]),n=ti(t[1]);e?i<n&&(i+=Ke):n<i&&(n+=Ke),t[0]=i,t[1]=n}function ii(t,e,i,n){if(Ve(e-i))return!0;const s=1e-8;return t=ti(t),e=ti(e),i=ti(i),n?i<=e?t-s>=i&&t+s<=e:t-s>=i||t+s<=e:e<=i?t+s>=e&&t-s<=i:t+s>=e||t-s<=i}var ni={exports:{}};!function(t,e){(function(){var i,n="Expected a function",s="__lodash_hash_undefined__",r="__lodash_placeholder__",a=32,o=128,h=1/0,l=9007199254740991,u=NaN,c=4294967295,d=[["ary",o],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],p="[object Arguments]",f="[object Array]",m="[object Boolean]",g="[object Date]",y="[object Error]",v="[object Function]",x="[object GeneratorFunction]",b="[object Map]",w="[object Number]",S="[object Object]",E="[object Promise]",A="[object RegExp]",M="[object Set]",T="[object String]",C="[object Symbol]",I="[object WeakMap]",D="[object ArrayBuffer]",L="[object DataView]",B="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",O="[object Int32Array]",R="[object Uint8Array]",z="[object Uint8ClampedArray]",H="[object Uint16Array]",F="[object Uint32Array]",W=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,j=/[&<>"']/g,Y=RegExp(q.source),G=RegExp(j.source),$=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),it=/^\s+/,nt=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,rt=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ot=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ct=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,ft=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,gt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,bt="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_t="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",Mt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tt="["+bt+"]",Ct="["+Mt+"]",It="["+wt+"]",Dt="\\d+",Lt="["+_t+"]",Bt="["+St+"]",Pt="[^"+bt+Mt+Dt+_t+St+Et+"]",kt="\\ud83c[\\udffb-\\udfff]",Nt="[^"+bt+"]",Ot="(?:\\ud83c[\\udde6-\\uddff]){2}",Rt="[\\ud800-\\udbff][\\udc00-\\udfff]",zt="["+Et+"]",Ht="\\u200d",Ft="(?:"+Bt+"|"+Pt+")",Wt="(?:"+zt+"|"+Pt+")",Ut="(?:['’](?:d|ll|m|re|s|t|ve))?",Vt="(?:['’](?:D|LL|M|RE|S|T|VE))?",qt="(?:"+It+"|"+kt+")?",jt="["+At+"]?",Yt=jt+qt+"(?:"+Ht+"(?:"+[Nt,Ot,Rt].join("|")+")"+jt+qt+")*",Gt="(?:"+[Lt,Ot,Rt].join("|")+")"+Yt,$t="(?:"+[Nt+It+"?",It,Ot,Rt,Tt].join("|")+")",Xt=RegExp("['’]","g"),Zt=RegExp(It,"g"),Jt=RegExp(kt+"(?="+kt+")|"+$t+Yt,"g"),Qt=RegExp([zt+"?"+Bt+"+"+Ut+"(?="+[Ct,zt,"$"].join("|")+")",Wt+"+"+Vt+"(?="+[Ct,zt+Ft,"$"].join("|")+")",zt+"?"+Ft+"+"+Ut,zt+"+"+Vt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt,Gt].join("|"),"g"),Kt=RegExp("["+Ht+bt+wt+At+"]"),te=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ee=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,ne={};ne[B]=ne[P]=ne[k]=ne[N]=ne[O]=ne[R]=ne[z]=ne[H]=ne[F]=!0,ne[p]=ne[f]=ne[D]=ne[m]=ne[L]=ne[g]=ne[y]=ne[v]=ne[b]=ne[w]=ne[S]=ne[A]=ne[M]=ne[T]=ne[I]=!1;var se={};se[p]=se[f]=se[D]=se[L]=se[m]=se[g]=se[B]=se[P]=se[k]=se[N]=se[O]=se[b]=se[w]=se[S]=se[A]=se[M]=se[T]=se[C]=se[R]=se[z]=se[H]=se[F]=!0,se[y]=se[v]=se[I]=!1;var re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,oe=parseInt,he="object"==typeof _&&_&&_.Object===Object&&_,le="object"==typeof self&&self&&self.Object===Object&&self,ue=he||le||Function("return this")(),ce=e&&!e.nodeType&&e,de=ce&&t&&!t.nodeType&&t,pe=de&&de.exports===ce,fe=pe&&he.process,me=function(){try{return de&&de.require&&de.require("util").types||fe&&fe.binding&&fe.binding("util")}catch(t){}}(),ge=me&&me.isArrayBuffer,ye=me&&me.isDate,ve=me&&me.isMap,xe=me&&me.isRegExp,be=me&&me.isSet,we=me&&me.isTypedArray;function _e(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}function Se(t,e,i,n){for(var s=-1,r=null==t?0:t.length;++s<r;){var a=t[s];e(n,a,i(a),t)}return n}function Ee(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}function Ae(t,e){for(var i=null==t?0:t.length;i--&&!1!==e(t[i],i,t););return t}function Me(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(!e(t[i],i,t))return!1;return!0}function Te(t,e){for(var i=-1,n=null==t?0:t.length,s=0,r=[];++i<n;){var a=t[i];e(a,i,t)&&(r[s++]=a)}return r}function Ce(t,e){return!(null==t||!t.length)&&ze(t,e,0)>-1}function Ie(t,e,i){for(var n=-1,s=null==t?0:t.length;++n<s;)if(i(e,t[n]))return!0;return!1}function De(t,e){for(var i=-1,n=null==t?0:t.length,s=Array(n);++i<n;)s[i]=e(t[i],i,t);return s}function Le(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t}function Be(t,e,i,n){var s=-1,r=null==t?0:t.length;for(n&&r&&(i=t[++s]);++s<r;)i=e(i,t[s],s,t);return i}function Pe(t,e,i,n){var s=null==t?0:t.length;for(n&&s&&(i=t[--s]);s--;)i=e(i,t[s],s,t);return i}function ke(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}var Ne=Ue("length");function Oe(t,e,i){var n;return i(t,(function(t,i,s){if(e(t,i,s))return n=i,!1})),n}function Re(t,e,i,n){for(var s=t.length,r=i+(n?1:-1);n?r--:++r<s;)if(e(t[r],r,t))return r;return-1}function ze(t,e,i){return e==e?function(t,e,i){for(var n=i-1,s=t.length;++n<s;)if(t[n]===e)return n;return-1}(t,e,i):Re(t,Fe,i)}function He(t,e,i,n){for(var s=i-1,r=t.length;++s<r;)if(n(t[s],e))return s;return-1}function Fe(t){return t!=t}function We(t,e){var i=null==t?0:t.length;return i?je(t,e)/i:u}function Ue(t){return function(e){return null==e?i:e[t]}}function Ve(t){return function(e){return null==t?i:t[e]}}function qe(t,e,i,n,s){return s(t,(function(t,s,r){i=n?(n=!1,t):e(i,t,s,r)})),i}function je(t,e){for(var n,s=-1,r=t.length;++s<r;){var a=e(t[s]);a!==i&&(n=n===i?a:n+a)}return n}function Ye(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}function Ge(t){return t?t.slice(0,li(t)+1).replace(it,""):t}function $e(t){return function(e){return t(e)}}function Xe(t,e){return De(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function Je(t,e){for(var i=-1,n=t.length;++i<n&&ze(e,t[i],0)>-1;);return i}function Qe(t,e){for(var i=t.length;i--&&ze(e,t[i],0)>-1;);return i}var Ke=Ve({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ti=Ve({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ei(t){return"\\"+re[t]}function ii(t){return Kt.test(t)}function ni(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function si(t,e){return function(i){return t(e(i))}}function ri(t,e){for(var i=-1,n=t.length,s=0,a=[];++i<n;){var o=t[i];o!==e&&o!==r||(t[i]=r,a[s++]=i)}return a}function ai(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}function oi(t){return ii(t)?function(t){for(var e=Jt.lastIndex=0;Jt.test(t);)++e;return e}(t):Ne(t)}function hi(t){return ii(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function li(t){for(var e=t.length;e--&&nt.test(t.charAt(e)););return e}var ui=Ve({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),ci=function t(e){var _,nt=(e=null==e?ue:ci.defaults(ue.Object(),e,ci.pick(ue,ee))).Array,bt=e.Date,wt=e.Error,_t=e.Function,St=e.Math,Et=e.Object,At=e.RegExp,Mt=e.String,Tt=e.TypeError,Ct=nt.prototype,It=_t.prototype,Dt=Et.prototype,Lt=e["__core-js_shared__"],Bt=It.toString,Pt=Dt.hasOwnProperty,kt=0,Nt=(_=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||""))?"Symbol(src)_1."+_:"",Ot=Dt.toString,Rt=Bt.call(Et),zt=ue._,Ht=At("^"+Bt.call(Pt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ft=pe?e.Buffer:i,Wt=e.Symbol,Ut=e.Uint8Array,Vt=Ft?Ft.allocUnsafe:i,qt=si(Et.getPrototypeOf,Et),jt=Et.create,Yt=Dt.propertyIsEnumerable,Gt=Ct.splice,$t=Wt?Wt.isConcatSpreadable:i,Jt=Wt?Wt.iterator:i,Kt=Wt?Wt.toStringTag:i,re=function(){try{var t=or(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),he=e.clearTimeout!==ue.clearTimeout&&e.clearTimeout,le=bt&&bt.now!==ue.Date.now&&bt.now,ce=e.setTimeout!==ue.setTimeout&&e.setTimeout,de=St.ceil,fe=St.floor,me=Et.getOwnPropertySymbols,Ne=Ft?Ft.isBuffer:i,Ve=e.isFinite,di=Ct.join,pi=si(Et.keys,Et),fi=St.max,mi=St.min,gi=bt.now,yi=e.parseInt,vi=St.random,xi=Ct.reverse,bi=or(e,"DataView"),wi=or(e,"Map"),_i=or(e,"Promise"),Si=or(e,"Set"),Ei=or(e,"WeakMap"),Ai=or(Et,"create"),Mi=Ei&&new Ei,Ti={},Ci=Or(bi),Ii=Or(wi),Di=Or(_i),Li=Or(Si),Bi=Or(Ei),Pi=Wt?Wt.prototype:i,ki=Pi?Pi.valueOf:i,Ni=Pi?Pi.toString:i;function Oi(t){if(Ka(t)&&!Ua(t)&&!(t instanceof Fi)){if(t instanceof Hi)return t;if(Pt.call(t,"__wrapped__"))return Rr(t)}return new Hi(t)}var Ri=function(){function t(){}return function(e){if(!Qa(e))return{};if(jt)return jt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zi(){}function Hi(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Fi(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=c,this.__views__=[]}function Wi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Ui(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Vi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function qi(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new Vi;++e<i;)this.add(t[e])}function ji(t){var e=this.__data__=new Ui(t);this.size=e.size}function Yi(t,e){var i=Ua(t),n=!i&&Wa(t),s=!i&&!n&&Ya(t),r=!i&&!n&&!s&&oo(t),a=i||n||s||r,o=a?Ye(t.length,Mt):[],h=o.length;for(var l in t)!e&&!Pt.call(t,l)||a&&("length"==l||s&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||fr(l,h))||o.push(l);return o}function Gi(t){var e=t.length;return e?t[qn(0,e-1)]:i}function $i(t,e){return Dr(As(t),sn(e,0,t.length))}function Xi(t){return Dr(As(t))}function Zi(t,e,n){(n!==i&&!za(t[e],n)||n===i&&!(e in t))&&en(t,e,n)}function Ji(t,e,n){var s=t[e];Pt.call(t,e)&&za(s,n)&&(n!==i||e in t)||en(t,e,n)}function Qi(t,e){for(var i=t.length;i--;)if(za(t[i][0],e))return i;return-1}function Ki(t,e,i,n){return ln(t,(function(t,s,r){e(n,t,i(t),r)})),n}function tn(t,e){return t&&Ms(e,Do(e),t)}function en(t,e,i){"__proto__"==e&&re?re(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function nn(t,e){for(var n=-1,s=e.length,r=nt(s),a=null==t;++n<s;)r[n]=a?i:Ao(t,e[n]);return r}function sn(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function rn(t,e,n,s,r,a){var o,h=1&e,l=2&e,u=4&e;if(n&&(o=r?n(t,s,r,a):n(t)),o!==i)return o;if(!Qa(t))return t;var c=Ua(t);if(c){if(o=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&Pt.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(t),!h)return As(t,o)}else{var d=ur(t),f=d==v||d==x;if(Ya(t))return xs(t,h);if(d==S||d==p||f&&!r){if(o=l||f?{}:dr(t),!h)return l?function(t,e){return Ms(t,lr(t),e)}(t,function(t,e){return t&&Ms(e,Lo(e),t)}(o,t)):function(t,e){return Ms(t,hr(t),e)}(t,tn(o,t))}else{if(!se[d])return r?t:{};o=function(t,e,i){var n,s=t.constructor;switch(e){case D:return bs(t);case m:case g:return new s(+t);case L:return function(t,e){var i=e?bs(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,i);case B:case P:case k:case N:case O:case R:case z:case H:case F:return ws(t,i);case b:return new s;case w:case T:return new s(t);case A:return function(t){var e=new t.constructor(t.source,ct.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new s;case C:return n=t,ki?Et(ki.call(n)):{}}}(t,d,h)}}a||(a=new ji);var y=a.get(t);if(y)return y;a.set(t,o),so(t)?t.forEach((function(i){o.add(rn(i,e,n,i,t,a))})):to(t)&&t.forEach((function(i,s){o.set(s,rn(i,e,n,s,t,a))}));var _=c?i:(u?l?tr:Ks:l?Lo:Do)(t);return Ee(_||t,(function(i,s){_&&(i=t[s=i]),Ji(o,s,rn(i,e,n,s,t,a))})),o}function an(t,e,n){var s=n.length;if(null==t)return!s;for(t=Et(t);s--;){var r=n[s],a=e[r],o=t[r];if(o===i&&!(r in t)||!a(o))return!1}return!0}function on(t,e,s){if("function"!=typeof t)throw new Tt(n);return Mr((function(){t.apply(i,s)}),e)}function hn(t,e,i,n){var s=-1,r=Ce,a=!0,o=t.length,h=[],l=e.length;if(!o)return h;i&&(e=De(e,$e(i))),n?(r=Ie,a=!1):e.length>=200&&(r=Ze,a=!1,e=new qi(e));t:for(;++s<o;){var u=t[s],c=null==i?u:i(u);if(u=n||0!==u?u:0,a&&c==c){for(var d=l;d--;)if(e[d]===c)continue t;h.push(u)}else r(e,c,n)||h.push(u)}return h}Oi.templateSettings={escape:$,evaluate:X,interpolate:Z,variable:"",imports:{_:Oi}},Oi.prototype=zi.prototype,Oi.prototype.constructor=Oi,Hi.prototype=Ri(zi.prototype),Hi.prototype.constructor=Hi,Fi.prototype=Ri(zi.prototype),Fi.prototype.constructor=Fi,Wi.prototype.clear=function(){this.__data__=Ai?Ai(null):{},this.size=0},Wi.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Wi.prototype.get=function(t){var e=this.__data__;if(Ai){var n=e[t];return n===s?i:n}return Pt.call(e,t)?e[t]:i},Wi.prototype.has=function(t){var e=this.__data__;return Ai?e[t]!==i:Pt.call(e,t)},Wi.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ai&&e===i?s:e,this},Ui.prototype.clear=function(){this.__data__=[],this.size=0},Ui.prototype.delete=function(t){var e=this.__data__,i=Qi(e,t);return!(i<0||(i==e.length-1?e.pop():Gt.call(e,i,1),--this.size,0))},Ui.prototype.get=function(t){var e=this.__data__,n=Qi(e,t);return n<0?i:e[n][1]},Ui.prototype.has=function(t){return Qi(this.__data__,t)>-1},Ui.prototype.set=function(t,e){var i=this.__data__,n=Qi(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},Vi.prototype.clear=function(){this.size=0,this.__data__={hash:new Wi,map:new(wi||Ui),string:new Wi}},Vi.prototype.delete=function(t){var e=rr(this,t).delete(t);return this.size-=e?1:0,e},Vi.prototype.get=function(t){return rr(this,t).get(t)},Vi.prototype.has=function(t){return rr(this,t).has(t)},Vi.prototype.set=function(t,e){var i=rr(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},qi.prototype.add=qi.prototype.push=function(t){return this.__data__.set(t,s),this},qi.prototype.has=function(t){return this.__data__.has(t)},ji.prototype.clear=function(){this.__data__=new Ui,this.size=0},ji.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},ji.prototype.get=function(t){return this.__data__.get(t)},ji.prototype.has=function(t){return this.__data__.has(t)},ji.prototype.set=function(t,e){var i=this.__data__;if(i instanceof Ui){var n=i.__data__;if(!wi||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new Vi(n)}return i.set(t,e),this.size=i.size,this};var ln=Is(yn),un=Is(vn,!0);function cn(t,e){var i=!0;return ln(t,(function(t,n,s){return i=!!e(t,n,s)})),i}function dn(t,e,n){for(var s=-1,r=t.length;++s<r;){var a=t[s],o=e(a);if(null!=o&&(h===i?o==o&&!ao(o):n(o,h)))var h=o,l=a}return l}function pn(t,e){var i=[];return ln(t,(function(t,n,s){e(t,n,s)&&i.push(t)})),i}function fn(t,e,i,n,s){var r=-1,a=t.length;for(i||(i=pr),s||(s=[]);++r<a;){var o=t[r];e>0&&i(o)?e>1?fn(o,e-1,i,n,s):Le(s,o):n||(s[s.length]=o)}return s}var mn=Ds(),gn=Ds(!0);function yn(t,e){return t&&mn(t,e,Do)}function vn(t,e){return t&&gn(t,e,Do)}function xn(t,e){return Te(e,(function(e){return Xa(t[e])}))}function bn(t,e){for(var n=0,s=(e=ms(e,t)).length;null!=t&&n<s;)t=t[Nr(e[n++])];return n&&n==s?t:i}function wn(t,e,i){var n=e(t);return Ua(t)?n:Le(n,i(t))}function _n(t){return null==t?t===i?"[object Undefined]":"[object Null]":Kt&&Kt in Et(t)?function(t){var e=Pt.call(t,Kt),n=t[Kt];try{t[Kt]=i;var s=!0}catch(t){}var r=Ot.call(t);return s&&(e?t[Kt]=n:delete t[Kt]),r}(t):function(t){return Ot.call(t)}(t)}function Sn(t,e){return t>e}function En(t,e){return null!=t&&Pt.call(t,e)}function An(t,e){return null!=t&&e in Et(t)}function Mn(t,e,n){for(var s=n?Ie:Ce,r=t[0].length,a=t.length,o=a,h=nt(a),l=1/0,u=[];o--;){var c=t[o];o&&e&&(c=De(c,$e(e))),l=mi(c.length,l),h[o]=!n&&(e||r>=120&&c.length>=120)?new qi(o&&c):i}c=t[0];var d=-1,p=h[0];t:for(;++d<r&&u.length<l;){var f=c[d],m=e?e(f):f;if(f=n||0!==f?f:0,!(p?Ze(p,m):s(u,m,n))){for(o=a;--o;){var g=h[o];if(!(g?Ze(g,m):s(t[o],m,n)))continue t}p&&p.push(m),u.push(f)}}return u}function Tn(t,e,n){var s=null==(t=Sr(t,e=ms(e,t)))?t:t[Nr($r(e))];return null==s?i:_e(s,t,n)}function Cn(t){return Ka(t)&&_n(t)==p}function In(t,e,n,s,r){return t===e||(null==t||null==e||!Ka(t)&&!Ka(e)?t!=t&&e!=e:function(t,e,n,s,r,a){var o=Ua(t),h=Ua(e),l=o?f:ur(t),u=h?f:ur(e),c=(l=l==p?S:l)==S,d=(u=u==p?S:u)==S,v=l==u;if(v&&Ya(t)){if(!Ya(e))return!1;o=!0,c=!1}if(v&&!c)return a||(a=new ji),o||oo(t)?Js(t,e,n,s,r,a):function(t,e,i,n,s,r,a){switch(i){case L:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case D:return!(t.byteLength!=e.byteLength||!r(new Ut(t),new Ut(e)));case m:case g:case w:return za(+t,+e);case y:return t.name==e.name&&t.message==e.message;case A:case T:return t==e+"";case b:var o=ni;case M:var h=1&n;if(o||(o=ai),t.size!=e.size&&!h)return!1;var l=a.get(t);if(l)return l==e;n|=2,a.set(t,e);var u=Js(o(t),o(e),n,s,r,a);return a.delete(t),u;case C:if(ki)return ki.call(t)==ki.call(e)}return!1}(t,e,l,n,s,r,a);if(!(1&n)){var x=c&&Pt.call(t,"__wrapped__"),_=d&&Pt.call(e,"__wrapped__");if(x||_){var E=x?t.value():t,I=_?e.value():e;return a||(a=new ji),r(E,I,n,s,a)}}return!!v&&(a||(a=new ji),function(t,e,n,s,r,a){var o=1&n,h=Ks(t),l=h.length;if(l!=Ks(e).length&&!o)return!1;for(var u=l;u--;){var c=h[u];if(!(o?c in e:Pt.call(e,c)))return!1}var d=a.get(t),p=a.get(e);if(d&&p)return d==e&&p==t;var f=!0;a.set(t,e),a.set(e,t);for(var m=o;++u<l;){var g=t[c=h[u]],y=e[c];if(s)var v=o?s(y,g,c,e,t,a):s(g,y,c,t,e,a);if(!(v===i?g===y||r(g,y,n,s,a):v)){f=!1;break}m||(m="constructor"==c)}if(f&&!m){var x=t.constructor,b=e.constructor;x==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b||(f=!1)}return a.delete(t),a.delete(e),f}(t,e,n,s,r,a))}(t,e,n,s,In,r))}function Dn(t,e,n,s){var r=n.length,a=r,o=!s;if(null==t)return!a;for(t=Et(t);r--;){var h=n[r];if(o&&h[2]?h[1]!==t[h[0]]:!(h[0]in t))return!1}for(;++r<a;){var l=(h=n[r])[0],u=t[l],c=h[1];if(o&&h[2]){if(u===i&&!(l in t))return!1}else{var d=new ji;if(s)var p=s(u,c,l,t,e,d);if(!(p===i?In(c,u,3,s,d):p))return!1}}return!0}function Ln(t){return!(!Qa(t)||(e=t,Nt&&Nt in e))&&(Xa(t)?Ht:ft).test(Or(t));var e}function Bn(t){return"function"==typeof t?t:null==t?ih:"object"==typeof t?Ua(t)?Rn(t[0],t[1]):On(t):ch(t)}function Pn(t){if(!xr(t))return pi(t);var e=[];for(var i in Et(t))Pt.call(t,i)&&"constructor"!=i&&e.push(i);return e}function kn(t,e){return t<e}function Nn(t,e){var i=-1,n=qa(t)?nt(t.length):[];return ln(t,(function(t,s,r){n[++i]=e(t,s,r)})),n}function On(t){var e=ar(t);return 1==e.length&&e[0][2]?wr(e[0][0],e[0][1]):function(i){return i===t||Dn(i,t,e)}}function Rn(t,e){return gr(t)&&br(e)?wr(Nr(t),e):function(n){var s=Ao(n,t);return s===i&&s===e?Mo(n,t):In(e,s,3)}}function zn(t,e,n,s,r){t!==e&&mn(e,(function(a,o){if(r||(r=new ji),Qa(a))!function(t,e,n,s,r,a,o){var h=Er(t,n),l=Er(e,n),u=o.get(l);if(u)Zi(t,n,u);else{var c=a?a(h,l,n+"",t,e,o):i,d=c===i;if(d){var p=Ua(l),f=!p&&Ya(l),m=!p&&!f&&oo(l);c=l,p||f||m?Ua(h)?c=h:ja(h)?c=As(h):f?(d=!1,c=xs(l,!0)):m?(d=!1,c=ws(l,!0)):c=[]:io(l)||Wa(l)?(c=h,Wa(h)?c=go(h):Qa(h)&&!Xa(h)||(c=dr(l))):d=!1}d&&(o.set(l,c),r(c,l,s,a,o),o.delete(l)),Zi(t,n,c)}}(t,e,o,n,zn,s,r);else{var h=s?s(Er(t,o),a,o+"",t,e,r):i;h===i&&(h=a),Zi(t,o,h)}}),Lo)}function Hn(t,e){var n=t.length;if(n)return fr(e+=e<0?n:0,n)?t[e]:i}function Fn(t,e,i){e=e.length?De(e,(function(t){return Ua(t)?function(e){return bn(e,1===t.length?t[0]:t)}:t})):[ih];var n=-1;return e=De(e,$e(sr())),function(t,e){var i=t.length;for(t.sort(e);i--;)t[i]=t[i].value;return t}(Nn(t,(function(t,i,s){return{criteria:De(e,(function(e){return e(t)})),index:++n,value:t}})),(function(t,e){return function(t,e,i){for(var n=-1,s=t.criteria,r=e.criteria,a=s.length,o=i.length;++n<a;){var h=_s(s[n],r[n]);if(h)return n>=o?h:h*("desc"==i[n]?-1:1)}return t.index-e.index}(t,e,i)}))}function Wn(t,e,i){for(var n=-1,s=e.length,r={};++n<s;){var a=e[n],o=bn(t,a);i(o,a)&&Xn(r,ms(a,t),o)}return r}function Un(t,e,i,n){var s=n?He:ze,r=-1,a=e.length,o=t;for(t===e&&(e=As(e)),i&&(o=De(t,$e(i)));++r<a;)for(var h=0,l=e[r],u=i?i(l):l;(h=s(o,u,h,n))>-1;)o!==t&&Gt.call(o,h,1),Gt.call(t,h,1);return t}function Vn(t,e){for(var i=t?e.length:0,n=i-1;i--;){var s=e[i];if(i==n||s!==r){var r=s;fr(s)?Gt.call(t,s,1):os(t,s)}}return t}function qn(t,e){return t+fe(vi()*(e-t+1))}function jn(t,e){var i="";if(!t||e<1||e>l)return i;do{e%2&&(i+=t),(e=fe(e/2))&&(t+=t)}while(e);return i}function Yn(t,e){return Tr(_r(t,e,ih),t+"")}function Gn(t){return Gi(Ho(t))}function $n(t,e){var i=Ho(t);return Dr(i,sn(e,0,i.length))}function Xn(t,e,n,s){if(!Qa(t))return t;for(var r=-1,a=(e=ms(e,t)).length,o=a-1,h=t;null!=h&&++r<a;){var l=Nr(e[r]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(r!=o){var c=h[l];(u=s?s(c,l,h):i)===i&&(u=Qa(c)?c:fr(e[r+1])?[]:{})}Ji(h,l,u),h=h[l]}return t}var Zn=Mi?function(t,e){return Mi.set(t,e),t}:ih,Jn=re?function(t,e){return re(t,"toString",{configurable:!0,enumerable:!1,value:Ko(e),writable:!0})}:ih;function Qn(t){return Dr(Ho(t))}function Kn(t,e,i){var n=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var r=nt(s);++n<s;)r[n]=t[n+e];return r}function ts(t,e){var i;return ln(t,(function(t,n,s){return!(i=e(t,n,s))})),!!i}function es(t,e,i){var n=0,s=null==t?n:t.length;if("number"==typeof e&&e==e&&s<=2147483647){for(;n<s;){var r=n+s>>>1,a=t[r];null!==a&&!ao(a)&&(i?a<=e:a<e)?n=r+1:s=r}return s}return is(t,e,ih,i)}function is(t,e,n,s){var r=0,a=null==t?0:t.length;if(0===a)return 0;for(var o=(e=n(e))!=e,h=null===e,l=ao(e),u=e===i;r<a;){var c=fe((r+a)/2),d=n(t[c]),p=d!==i,f=null===d,m=d==d,g=ao(d);if(o)var y=s||m;else y=u?m&&(s||p):h?m&&p&&(s||!f):l?m&&p&&!f&&(s||!g):!f&&!g&&(s?d<=e:d<e);y?r=c+1:a=c}return mi(a,4294967294)}function ns(t,e){for(var i=-1,n=t.length,s=0,r=[];++i<n;){var a=t[i],o=e?e(a):a;if(!i||!za(o,h)){var h=o;r[s++]=0===a?0:a}}return r}function ss(t){return"number"==typeof t?t:ao(t)?u:+t}function rs(t){if("string"==typeof t)return t;if(Ua(t))return De(t,rs)+"";if(ao(t))return Ni?Ni.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function as(t,e,i){var n=-1,s=Ce,r=t.length,a=!0,o=[],h=o;if(i)a=!1,s=Ie;else if(r>=200){var l=e?null:js(t);if(l)return ai(l);a=!1,s=Ze,h=new qi}else h=e?[]:o;t:for(;++n<r;){var u=t[n],c=e?e(u):u;if(u=i||0!==u?u:0,a&&c==c){for(var d=h.length;d--;)if(h[d]===c)continue t;e&&h.push(c),o.push(u)}else s(h,c,i)||(h!==o&&h.push(c),o.push(u))}return o}function os(t,e){return null==(t=Sr(t,e=ms(e,t)))||delete t[Nr($r(e))]}function hs(t,e,i,n){return Xn(t,e,i(bn(t,e)),n)}function ls(t,e,i,n){for(var s=t.length,r=n?s:-1;(n?r--:++r<s)&&e(t[r],r,t););return i?Kn(t,n?0:r,n?r+1:s):Kn(t,n?r+1:0,n?s:r)}function us(t,e){var i=t;return i instanceof Fi&&(i=i.value()),Be(e,(function(t,e){return e.func.apply(e.thisArg,Le([t],e.args))}),i)}function cs(t,e,i){var n=t.length;if(n<2)return n?as(t[0]):[];for(var s=-1,r=nt(n);++s<n;)for(var a=t[s],o=-1;++o<n;)o!=s&&(r[s]=hn(r[s]||a,t[o],e,i));return as(fn(r,1),e,i)}function ds(t,e,n){for(var s=-1,r=t.length,a=e.length,o={};++s<r;){var h=s<a?e[s]:i;n(o,t[s],h)}return o}function ps(t){return ja(t)?t:[]}function fs(t){return"function"==typeof t?t:ih}function ms(t,e){return Ua(t)?t:gr(t,e)?[t]:kr(yo(t))}var gs=Yn;function ys(t,e,n){var s=t.length;return n=n===i?s:n,!e&&n>=s?t:Kn(t,e,n)}var vs=he||function(t){return ue.clearTimeout(t)};function xs(t,e){if(e)return t.slice();var i=t.length,n=Vt?Vt(i):new t.constructor(i);return t.copy(n),n}function bs(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function ws(t,e){var i=e?bs(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function _s(t,e){if(t!==e){var n=t!==i,s=null===t,r=t==t,a=ao(t),o=e!==i,h=null===e,l=e==e,u=ao(e);if(!h&&!u&&!a&&t>e||a&&o&&l&&!h&&!u||s&&o&&l||!n&&l||!r)return 1;if(!s&&!a&&!u&&t<e||u&&n&&r&&!s&&!a||h&&n&&r||!o&&r||!l)return-1}return 0}function Ss(t,e,i,n){for(var s=-1,r=t.length,a=i.length,o=-1,h=e.length,l=fi(r-a,0),u=nt(h+l),c=!n;++o<h;)u[o]=e[o];for(;++s<a;)(c||s<r)&&(u[i[s]]=t[s]);for(;l--;)u[o++]=t[s++];return u}function Es(t,e,i,n){for(var s=-1,r=t.length,a=-1,o=i.length,h=-1,l=e.length,u=fi(r-o,0),c=nt(u+l),d=!n;++s<u;)c[s]=t[s];for(var p=s;++h<l;)c[p+h]=e[h];for(;++a<o;)(d||s<r)&&(c[p+i[a]]=t[s++]);return c}function As(t,e){var i=-1,n=t.length;for(e||(e=nt(n));++i<n;)e[i]=t[i];return e}function Ms(t,e,n,s){var r=!n;n||(n={});for(var a=-1,o=e.length;++a<o;){var h=e[a],l=s?s(n[h],t[h],h,n,t):i;l===i&&(l=t[h]),r?en(n,h,l):Ji(n,h,l)}return n}function Ts(t,e){return function(i,n){var s=Ua(i)?Se:Ki,r=e?e():{};return s(i,t,sr(n,2),r)}}function Cs(t){return Yn((function(e,n){var s=-1,r=n.length,a=r>1?n[r-1]:i,o=r>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(r--,a):i,o&&mr(n[0],n[1],o)&&(a=r<3?i:a,r=1),e=Et(e);++s<r;){var h=n[s];h&&t(e,h,s,a)}return e}))}function Is(t,e){return function(i,n){if(null==i)return i;if(!qa(i))return t(i,n);for(var s=i.length,r=e?s:-1,a=Et(i);(e?r--:++r<s)&&!1!==n(a[r],r,a););return i}}function Ds(t){return function(e,i,n){for(var s=-1,r=Et(e),a=n(e),o=a.length;o--;){var h=a[t?o:++s];if(!1===i(r[h],h,r))break}return e}}function Ls(t){return function(e){var n=ii(e=yo(e))?hi(e):i,s=n?n[0]:e.charAt(0),r=n?ys(n,1).join(""):e.slice(1);return s[t]()+r}}function Bs(t){return function(e){return Be(Zo(Uo(e).replace(Xt,"")),t,"")}}function Ps(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var i=Ri(t.prototype),n=t.apply(i,e);return Qa(n)?n:i}}function ks(t){return function(e,n,s){var r=Et(e);if(!qa(e)){var a=sr(n,3);e=Do(e),n=function(t){return a(r[t],t,r)}}var o=t(e,n,s);return o>-1?r[a?e[o]:o]:i}}function Ns(t){return Qs((function(e){var s=e.length,r=s,a=Hi.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new Tt(n);if(a&&!h&&"wrapper"==ir(o))var h=new Hi([],!0)}for(r=h?r:s;++r<s;){var l=ir(o=e[r]),u="wrapper"==l?er(o):i;h=u&&yr(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?h[ir(u[0])].apply(h,u[3]):1==o.length&&yr(o)?h[l]():h.thru(o)}return function(){var t=arguments,i=t[0];if(h&&1==t.length&&Ua(i))return h.plant(i).value();for(var n=0,r=s?e[n].apply(this,t):i;++n<s;)r=e[n].call(this,r);return r}}))}function Os(t,e,n,s,r,a,h,l,u,c){var d=e&o,p=1&e,f=2&e,m=24&e,g=512&e,y=f?i:Ps(t);return function o(){for(var v=arguments.length,x=nt(v),b=v;b--;)x[b]=arguments[b];if(m)var w=nr(o),_=function(t,e){for(var i=t.length,n=0;i--;)t[i]===e&&++n;return n}(x,w);if(s&&(x=Ss(x,s,r,m)),a&&(x=Es(x,a,h,m)),v-=_,m&&v<c){var S=ri(x,w);return Vs(t,e,Os,o.placeholder,n,x,S,l,u,c-v)}var E=p?n:this,A=f?E[t]:t;return v=x.length,l?x=function(t,e){for(var n=t.length,s=mi(e.length,n),r=As(t);s--;){var a=e[s];t[s]=fr(a,n)?r[a]:i}return t}(x,l):g&&v>1&&x.reverse(),d&&u<v&&(x.length=u),this&&this!==ue&&this instanceof o&&(A=y||Ps(A)),A.apply(E,x)}}function Rs(t,e){return function(i,n){return function(t,e,i,n){return yn(t,(function(t,s,r){e(n,i(t),s,r)})),n}(i,t,e(n),{})}}function zs(t,e){return function(n,s){var r;if(n===i&&s===i)return e;if(n!==i&&(r=n),s!==i){if(r===i)return s;"string"==typeof n||"string"==typeof s?(n=rs(n),s=rs(s)):(n=ss(n),s=ss(s)),r=t(n,s)}return r}}function Hs(t){return Qs((function(e){return e=De(e,$e(sr())),Yn((function(i){var n=this;return t(e,(function(t){return _e(t,n,i)}))}))}))}function Fs(t,e){var n=(e=e===i?" ":rs(e)).length;if(n<2)return n?jn(e,t):e;var s=jn(e,de(t/oi(e)));return ii(e)?ys(hi(s),0,t).join(""):s.slice(0,t)}function Ws(t){return function(e,n,s){return s&&"number"!=typeof s&&mr(e,n,s)&&(n=s=i),e=co(e),n===i?(n=e,e=0):n=co(n),function(t,e,i,n){for(var s=-1,r=fi(de((e-t)/(i||1)),0),a=nt(r);r--;)a[n?r:++s]=t,t+=i;return a}(e,n,s=s===i?e<n?1:-1:co(s),t)}}function Us(t){return function(e,i){return"string"==typeof e&&"string"==typeof i||(e=mo(e),i=mo(i)),t(e,i)}}function Vs(t,e,n,s,r,o,h,l,u,c){var d=8&e;e|=d?a:64,4&(e&=~(d?64:a))||(e&=-4);var p=[t,e,r,d?o:i,d?h:i,d?i:o,d?i:h,l,u,c],f=n.apply(i,p);return yr(t)&&Ar(f,p),f.placeholder=s,Cr(f,t,e)}function qs(t){var e=St[t];return function(t,i){if(t=mo(t),(i=null==i?0:mi(po(i),292))&&Ve(t)){var n=(yo(t)+"e").split("e");return+((n=(yo(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}var js=Si&&1/ai(new Si([,-0]))[1]==h?function(t){return new Si(t)}:oh;function Ys(t){return function(e){var i=ur(e);return i==b?ni(e):i==M?function(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=[t,t]})),i}(e):function(t,e){return De(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Gs(t,e,s,h,l,u,c,d){var p=2&e;if(!p&&"function"!=typeof t)throw new Tt(n);var f=h?h.length:0;if(f||(e&=-97,h=l=i),c=c===i?c:fi(po(c),0),d=d===i?d:po(d),f-=l?l.length:0,64&e){var m=h,g=l;h=l=i}var y=p?i:er(t),v=[t,e,s,h,l,m,g,u,c,d];if(y&&function(t,e){var i=t[1],n=e[1],s=i|n,a=s<131,h=n==o&&8==i||n==o&&256==i&&t[7].length<=e[8]||384==n&&e[7].length<=e[8]&&8==i;if(!a&&!h)return t;1&n&&(t[2]=e[2],s|=1&i?0:4);var l=e[3];if(l){var u=t[3];t[3]=u?Ss(u,l,e[4]):l,t[4]=u?ri(t[3],r):e[4]}(l=e[5])&&(u=t[5],t[5]=u?Es(u,l,e[6]):l,t[6]=u?ri(t[5],r):e[6]),(l=e[7])&&(t[7]=l),n&o&&(t[8]=null==t[8]?e[8]:mi(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=s}(v,y),t=v[0],e=v[1],s=v[2],h=v[3],l=v[4],!(d=v[9]=v[9]===i?p?0:t.length:fi(v[9]-f,0))&&24&e&&(e&=-25),e&&1!=e)x=8==e||16==e?function(t,e,n){var s=Ps(t);return function r(){for(var a=arguments.length,o=nt(a),h=a,l=nr(r);h--;)o[h]=arguments[h];var u=a<3&&o[0]!==l&&o[a-1]!==l?[]:ri(o,l);return(a-=u.length)<n?Vs(t,e,Os,r.placeholder,i,o,u,i,i,n-a):_e(this&&this!==ue&&this instanceof r?s:t,this,o)}}(t,e,d):e!=a&&33!=e||l.length?Os.apply(i,v):function(t,e,i,n){var s=1&e,r=Ps(t);return function e(){for(var a=-1,o=arguments.length,h=-1,l=n.length,u=nt(l+o),c=this&&this!==ue&&this instanceof e?r:t;++h<l;)u[h]=n[h];for(;o--;)u[h++]=arguments[++a];return _e(c,s?i:this,u)}}(t,e,s,h);else var x=function(t,e,i){var n=1&e,s=Ps(t);return function e(){return(this&&this!==ue&&this instanceof e?s:t).apply(n?i:this,arguments)}}(t,e,s);return Cr((y?Zn:Ar)(x,v),t,e)}function $s(t,e,n,s){return t===i||za(t,Dt[n])&&!Pt.call(s,n)?e:t}function Xs(t,e,n,s,r,a){return Qa(t)&&Qa(e)&&(a.set(e,t),zn(t,e,i,Xs,a),a.delete(e)),t}function Zs(t){return io(t)?i:t}function Js(t,e,n,s,r,a){var o=1&n,h=t.length,l=e.length;if(h!=l&&!(o&&l>h))return!1;var u=a.get(t),c=a.get(e);if(u&&c)return u==e&&c==t;var d=-1,p=!0,f=2&n?new qi:i;for(a.set(t,e),a.set(e,t);++d<h;){var m=t[d],g=e[d];if(s)var y=o?s(g,m,d,e,t,a):s(m,g,d,t,e,a);if(y!==i){if(y)continue;p=!1;break}if(f){if(!ke(e,(function(t,e){if(!Ze(f,e)&&(m===t||r(m,t,n,s,a)))return f.push(e)}))){p=!1;break}}else if(m!==g&&!r(m,g,n,s,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function Qs(t){return Tr(_r(t,i,Vr),t+"")}function Ks(t){return wn(t,Do,hr)}function tr(t){return wn(t,Lo,lr)}var er=Mi?function(t){return Mi.get(t)}:oh;function ir(t){for(var e=t.name+"",i=Ti[e],n=Pt.call(Ti,e)?i.length:0;n--;){var s=i[n],r=s.func;if(null==r||r==t)return s.name}return e}function nr(t){return(Pt.call(Oi,"placeholder")?Oi:t).placeholder}function sr(){var t=Oi.iteratee||nh;return t=t===nh?Bn:t,arguments.length?t(arguments[0],arguments[1]):t}function rr(t,e){var i,n,s=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?s["string"==typeof e?"string":"hash"]:s.map}function ar(t){for(var e=Do(t),i=e.length;i--;){var n=e[i],s=t[n];e[i]=[n,s,br(s)]}return e}function or(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Ln(n)?n:i}var hr=me?function(t){return null==t?[]:(t=Et(t),Te(me(t),(function(e){return Yt.call(t,e)})))}:fh,lr=me?function(t){for(var e=[];t;)Le(e,hr(t)),t=qt(t);return e}:fh,ur=_n;function cr(t,e,i){for(var n=-1,s=(e=ms(e,t)).length,r=!1;++n<s;){var a=Nr(e[n]);if(!(r=null!=t&&i(t,a)))break;t=t[a]}return r||++n!=s?r:!!(s=null==t?0:t.length)&&Ja(s)&&fr(a,s)&&(Ua(t)||Wa(t))}function dr(t){return"function"!=typeof t.constructor||xr(t)?{}:Ri(qt(t))}function pr(t){return Ua(t)||Wa(t)||!!($t&&t&&t[$t])}function fr(t,e){var i=typeof t;return!!(e=null==e?l:e)&&("number"==i||"symbol"!=i&&gt.test(t))&&t>-1&&t%1==0&&t<e}function mr(t,e,i){if(!Qa(i))return!1;var n=typeof e;return!!("number"==n?qa(i)&&fr(e,i.length):"string"==n&&e in i)&&za(i[e],t)}function gr(t,e){if(Ua(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!ao(t))||Q.test(t)||!J.test(t)||null!=e&&t in Et(e)}function yr(t){var e=ir(t),i=Oi[e];if("function"!=typeof i||!(e in Fi.prototype))return!1;if(t===i)return!0;var n=er(i);return!!n&&t===n[0]}(bi&&ur(new bi(new ArrayBuffer(1)))!=L||wi&&ur(new wi)!=b||_i&&ur(_i.resolve())!=E||Si&&ur(new Si)!=M||Ei&&ur(new Ei)!=I)&&(ur=function(t){var e=_n(t),n=e==S?t.constructor:i,s=n?Or(n):"";if(s)switch(s){case Ci:return L;case Ii:return b;case Di:return E;case Li:return M;case Bi:return I}return e});var vr=Lt?Xa:mh;function xr(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Dt)}function br(t){return t==t&&!Qa(t)}function wr(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in Et(n))}}function _r(t,e,n){return e=fi(e===i?t.length-1:e,0),function(){for(var i=arguments,s=-1,r=fi(i.length-e,0),a=nt(r);++s<r;)a[s]=i[e+s];s=-1;for(var o=nt(e+1);++s<e;)o[s]=i[s];return o[e]=n(a),_e(t,this,o)}}function Sr(t,e){return e.length<2?t:bn(t,Kn(e,0,-1))}function Er(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ar=Ir(Zn),Mr=ce||function(t,e){return ue.setTimeout(t,e)},Tr=Ir(Jn);function Cr(t,e,i){var n=e+"";return Tr(t,function(t,e){var i=e.length;if(!i)return t;var n=i-1;return e[n]=(i>1?"& ":"")+e[n],e=e.join(i>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Ee(d,(function(i){var n="_."+i[0];e&i[1]&&!Ce(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(rt);return e?e[1].split(at):[]}(n),i)))}function Ir(t){var e=0,n=0;return function(){var s=gi(),r=16-(s-n);if(n=s,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Dr(t,e){var n=-1,s=t.length,r=s-1;for(e=e===i?s:e;++n<e;){var a=qn(n,r),o=t[a];t[a]=t[n],t[n]=o}return t.length=e,t}var Lr,Br,Pr,kr=(Lr=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(K,(function(t,i,n,s){e.push(n?s.replace(lt,"$1"):i||t)})),e},Br=Ba(Lr,(function(t){return 500===Pr.size&&Pr.clear(),t})),Pr=Br.cache,Br);function Nr(t){if("string"==typeof t||ao(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Or(t){if(null!=t){try{return Bt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Rr(t){if(t instanceof Fi)return t.clone();var e=new Hi(t.__wrapped__,t.__chain__);return e.__actions__=As(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var zr=Yn((function(t,e){return ja(t)?hn(t,fn(e,1,ja,!0)):[]})),Hr=Yn((function(t,e){var n=$r(e);return ja(n)&&(n=i),ja(t)?hn(t,fn(e,1,ja,!0),sr(n,2)):[]})),Fr=Yn((function(t,e){var n=$r(e);return ja(n)&&(n=i),ja(t)?hn(t,fn(e,1,ja,!0),i,n):[]}));function Wr(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=null==i?0:po(i);return s<0&&(s=fi(n+s,0)),Re(t,sr(e,3),s)}function Ur(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var r=s-1;return n!==i&&(r=po(n),r=n<0?fi(s+r,0):mi(r,s-1)),Re(t,sr(e,3),r,!0)}function Vr(t){return null!=t&&t.length?fn(t,1):[]}function qr(t){return t&&t.length?t[0]:i}var jr=Yn((function(t){var e=De(t,ps);return e.length&&e[0]===t[0]?Mn(e):[]})),Yr=Yn((function(t){var e=$r(t),n=De(t,ps);return e===$r(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Mn(n,sr(e,2)):[]})),Gr=Yn((function(t){var e=$r(t),n=De(t,ps);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Mn(n,i,e):[]}));function $r(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Xr=Yn(Zr);function Zr(t,e){return t&&t.length&&e&&e.length?Un(t,e):t}var Jr=Qs((function(t,e){var i=null==t?0:t.length,n=nn(t,e);return Vn(t,De(e,(function(t){return fr(t,i)?+t:t})).sort(_s)),n}));function Qr(t){return null==t?t:xi.call(t)}var Kr=Yn((function(t){return as(fn(t,1,ja,!0))})),ta=Yn((function(t){var e=$r(t);return ja(e)&&(e=i),as(fn(t,1,ja,!0),sr(e,2))})),ea=Yn((function(t){var e=$r(t);return e="function"==typeof e?e:i,as(fn(t,1,ja,!0),i,e)}));function ia(t){if(!t||!t.length)return[];var e=0;return t=Te(t,(function(t){if(ja(t))return e=fi(t.length,e),!0})),Ye(e,(function(e){return De(t,Ue(e))}))}function na(t,e){if(!t||!t.length)return[];var n=ia(t);return null==e?n:De(n,(function(t){return _e(e,i,t)}))}var sa=Yn((function(t,e){return ja(t)?hn(t,e):[]})),ra=Yn((function(t){return cs(Te(t,ja))})),aa=Yn((function(t){var e=$r(t);return ja(e)&&(e=i),cs(Te(t,ja),sr(e,2))})),oa=Yn((function(t){var e=$r(t);return e="function"==typeof e?e:i,cs(Te(t,ja),i,e)})),ha=Yn(ia),la=Yn((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,na(t,n)}));function ua(t){var e=Oi(t);return e.__chain__=!0,e}function ca(t,e){return e(t)}var da=Qs((function(t){var e=t.length,n=e?t[0]:0,s=this.__wrapped__,r=function(e){return nn(e,t)};return!(e>1||this.__actions__.length)&&s instanceof Fi&&fr(n)?((s=s.slice(n,+n+(e?1:0))).__actions__.push({func:ca,args:[r],thisArg:i}),new Hi(s,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(r)})),pa=Ts((function(t,e,i){Pt.call(t,i)?++t[i]:en(t,i,1)})),fa=ks(Wr),ma=ks(Ur);function ga(t,e){return(Ua(t)?Ee:ln)(t,sr(e,3))}function ya(t,e){return(Ua(t)?Ae:un)(t,sr(e,3))}var va=Ts((function(t,e,i){Pt.call(t,i)?t[i].push(e):en(t,i,[e])})),xa=Yn((function(t,e,i){var n=-1,s="function"==typeof e,r=qa(t)?nt(t.length):[];return ln(t,(function(t){r[++n]=s?_e(e,t,i):Tn(t,e,i)})),r})),ba=Ts((function(t,e,i){en(t,i,e)}));function wa(t,e){return(Ua(t)?De:Nn)(t,sr(e,3))}var _a=Ts((function(t,e,i){t[i?0:1].push(e)}),(function(){return[[],[]]})),Sa=Yn((function(t,e){if(null==t)return[];var i=e.length;return i>1&&mr(t,e[0],e[1])?e=[]:i>2&&mr(e[0],e[1],e[2])&&(e=[e[0]]),Fn(t,fn(e,1),[])})),Ea=le||function(){return ue.Date.now()};function Aa(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Gs(t,o,i,i,i,i,e)}function Ma(t,e){var s;if("function"!=typeof e)throw new Tt(n);return t=po(t),function(){return--t>0&&(s=e.apply(this,arguments)),t<=1&&(e=i),s}}var Ta=Yn((function(t,e,i){var n=1;if(i.length){var s=ri(i,nr(Ta));n|=a}return Gs(t,n,e,i,s)})),Ca=Yn((function(t,e,i){var n=3;if(i.length){var s=ri(i,nr(Ca));n|=a}return Gs(e,n,t,i,s)}));function Ia(t,e,s){var r,a,o,h,l,u,c=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new Tt(n);function m(e){var n=r,s=a;return r=a=i,c=e,h=t.apply(s,n)}function g(t){var n=t-u;return u===i||n>=e||n<0||p&&t-c>=o}function y(){var t=Ea();if(g(t))return v(t);l=Mr(y,function(t){var i=e-(t-u);return p?mi(i,o-(t-c)):i}(t))}function v(t){return l=i,f&&r?m(t):(r=a=i,h)}function x(){var t=Ea(),n=g(t);if(r=arguments,a=this,u=t,n){if(l===i)return function(t){return c=t,l=Mr(y,e),d?m(t):h}(u);if(p)return vs(l),l=Mr(y,e),m(u)}return l===i&&(l=Mr(y,e)),h}return e=mo(e)||0,Qa(s)&&(d=!!s.leading,o=(p="maxWait"in s)?fi(mo(s.maxWait)||0,e):o,f="trailing"in s?!!s.trailing:f),x.cancel=function(){l!==i&&vs(l),c=0,r=u=a=l=i},x.flush=function(){return l===i?h:v(Ea())},x}var Da=Yn((function(t,e){return on(t,1,e)})),La=Yn((function(t,e,i){return on(t,mo(e)||0,i)}));function Ba(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Tt(n);var i=function(){var n=arguments,s=e?e.apply(this,n):n[0],r=i.cache;if(r.has(s))return r.get(s);var a=t.apply(this,n);return i.cache=r.set(s,a)||r,a};return i.cache=new(Ba.Cache||Vi),i}function Pa(t){if("function"!=typeof t)throw new Tt(n);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ba.Cache=Vi;var ka=gs((function(t,e){var i=(e=1==e.length&&Ua(e[0])?De(e[0],$e(sr())):De(fn(e,1),$e(sr()))).length;return Yn((function(n){for(var s=-1,r=mi(n.length,i);++s<r;)n[s]=e[s].call(this,n[s]);return _e(t,this,n)}))})),Na=Yn((function(t,e){var n=ri(e,nr(Na));return Gs(t,a,i,e,n)})),Oa=Yn((function(t,e){var n=ri(e,nr(Oa));return Gs(t,64,i,e,n)})),Ra=Qs((function(t,e){return Gs(t,256,i,i,i,e)}));function za(t,e){return t===e||t!=t&&e!=e}var Ha=Us(Sn),Fa=Us((function(t,e){return t>=e})),Wa=Cn(function(){return arguments}())?Cn:function(t){return Ka(t)&&Pt.call(t,"callee")&&!Yt.call(t,"callee")},Ua=nt.isArray,Va=ge?$e(ge):function(t){return Ka(t)&&_n(t)==D};function qa(t){return null!=t&&Ja(t.length)&&!Xa(t)}function ja(t){return Ka(t)&&qa(t)}var Ya=Ne||mh,Ga=ye?$e(ye):function(t){return Ka(t)&&_n(t)==g};function $a(t){if(!Ka(t))return!1;var e=_n(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!io(t)}function Xa(t){if(!Qa(t))return!1;var e=_n(t);return e==v||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Za(t){return"number"==typeof t&&t==po(t)}function Ja(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function Qa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ka(t){return null!=t&&"object"==typeof t}var to=ve?$e(ve):function(t){return Ka(t)&&ur(t)==b};function eo(t){return"number"==typeof t||Ka(t)&&_n(t)==w}function io(t){if(!Ka(t)||_n(t)!=S)return!1;var e=qt(t);if(null===e)return!0;var i=Pt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Bt.call(i)==Rt}var no=xe?$e(xe):function(t){return Ka(t)&&_n(t)==A},so=be?$e(be):function(t){return Ka(t)&&ur(t)==M};function ro(t){return"string"==typeof t||!Ua(t)&&Ka(t)&&_n(t)==T}function ao(t){return"symbol"==typeof t||Ka(t)&&_n(t)==C}var oo=we?$e(we):function(t){return Ka(t)&&Ja(t.length)&&!!ne[_n(t)]},ho=Us(kn),lo=Us((function(t,e){return t<=e}));function uo(t){if(!t)return[];if(qa(t))return ro(t)?hi(t):As(t);if(Jt&&t[Jt])return function(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}(t[Jt]());var e=ur(t);return(e==b?ni:e==M?ai:Ho)(t)}function co(t){return t?(t=mo(t))===h||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function po(t){var e=co(t),i=e%1;return e==e?i?e-i:e:0}function fo(t){return t?sn(po(t),0,c):0}function mo(t){if("number"==typeof t)return t;if(ao(t))return u;if(Qa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var i=pt.test(t);return i||mt.test(t)?oe(t.slice(2),i?2:8):dt.test(t)?u:+t}function go(t){return Ms(t,Lo(t))}function yo(t){return null==t?"":rs(t)}var vo=Cs((function(t,e){if(xr(e)||qa(e))Ms(e,Do(e),t);else for(var i in e)Pt.call(e,i)&&Ji(t,i,e[i])})),xo=Cs((function(t,e){Ms(e,Lo(e),t)})),bo=Cs((function(t,e,i,n){Ms(e,Lo(e),t,n)})),wo=Cs((function(t,e,i,n){Ms(e,Do(e),t,n)})),_o=Qs(nn),So=Yn((function(t,e){t=Et(t);var n=-1,s=e.length,r=s>2?e[2]:i;for(r&&mr(e[0],e[1],r)&&(s=1);++n<s;)for(var a=e[n],o=Lo(a),h=-1,l=o.length;++h<l;){var u=o[h],c=t[u];(c===i||za(c,Dt[u])&&!Pt.call(t,u))&&(t[u]=a[u])}return t})),Eo=Yn((function(t){return t.push(i,Xs),_e(Po,i,t)}));function Ao(t,e,n){var s=null==t?i:bn(t,e);return s===i?n:s}function Mo(t,e){return null!=t&&cr(t,e,An)}var To=Rs((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=Ot.call(e)),t[e]=i}),Ko(ih)),Co=Rs((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=Ot.call(e)),Pt.call(t,e)?t[e].push(i):t[e]=[i]}),sr),Io=Yn(Tn);function Do(t){return qa(t)?Yi(t):Pn(t)}function Lo(t){return qa(t)?Yi(t,!0):function(t){if(!Qa(t))return function(t){var e=[];if(null!=t)for(var i in Et(t))e.push(i);return e}(t);var e=xr(t),i=[];for(var n in t)("constructor"!=n||!e&&Pt.call(t,n))&&i.push(n);return i}(t)}var Bo=Cs((function(t,e,i){zn(t,e,i)})),Po=Cs((function(t,e,i,n){zn(t,e,i,n)})),ko=Qs((function(t,e){var i={};if(null==t)return i;var n=!1;e=De(e,(function(e){return e=ms(e,t),n||(n=e.length>1),e})),Ms(t,tr(t),i),n&&(i=rn(i,7,Zs));for(var s=e.length;s--;)os(i,e[s]);return i})),No=Qs((function(t,e){return null==t?{}:function(t,e){return Wn(t,e,(function(e,i){return Mo(t,i)}))}(t,e)}));function Oo(t,e){if(null==t)return{};var i=De(tr(t),(function(t){return[t]}));return e=sr(e),Wn(t,i,(function(t,i){return e(t,i[0])}))}var Ro=Ys(Do),zo=Ys(Lo);function Ho(t){return null==t?[]:Xe(t,Do(t))}var Fo=Bs((function(t,e,i){return e=e.toLowerCase(),t+(i?Wo(e):e)}));function Wo(t){return Xo(yo(t).toLowerCase())}function Uo(t){return(t=yo(t))&&t.replace(yt,Ke).replace(Zt,"")}var Vo=Bs((function(t,e,i){return t+(i?"-":"")+e.toLowerCase()})),qo=Bs((function(t,e,i){return t+(i?" ":"")+e.toLowerCase()})),jo=Ls("toLowerCase"),Yo=Bs((function(t,e,i){return t+(i?"_":"")+e.toLowerCase()})),Go=Bs((function(t,e,i){return t+(i?" ":"")+Xo(e)})),$o=Bs((function(t,e,i){return t+(i?" ":"")+e.toUpperCase()})),Xo=Ls("toUpperCase");function Zo(t,e,n){return t=yo(t),(e=n?i:e)===i?function(t){return te.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(ot)||[]}(t):t.match(e)||[]}var Jo=Yn((function(t,e){try{return _e(t,i,e)}catch(t){return $a(t)?t:new wt(t)}})),Qo=Qs((function(t,e){return Ee(e,(function(e){e=Nr(e),en(t,e,Ta(t[e],t))})),t}));function Ko(t){return function(){return t}}var th=Ns(),eh=Ns(!0);function ih(t){return t}function nh(t){return Bn("function"==typeof t?t:rn(t,1))}var sh=Yn((function(t,e){return function(i){return Tn(i,t,e)}})),rh=Yn((function(t,e){return function(i){return Tn(t,i,e)}}));function ah(t,e,i){var n=Do(e),s=xn(e,n);null!=i||Qa(e)&&(s.length||!n.length)||(i=e,e=t,t=this,s=xn(e,Do(e)));var r=!(Qa(i)&&"chain"in i&&!i.chain),a=Xa(t);return Ee(s,(function(i){var n=e[i];t[i]=n,a&&(t.prototype[i]=function(){var e=this.__chain__;if(r||e){var i=t(this.__wrapped__);return(i.__actions__=As(this.__actions__)).push({func:n,args:arguments,thisArg:t}),i.__chain__=e,i}return n.apply(t,Le([this.value()],arguments))})})),t}function oh(){}var hh=Hs(De),lh=Hs(Me),uh=Hs(ke);function ch(t){return gr(t)?Ue(Nr(t)):function(t){return function(e){return bn(e,t)}}(t)}var dh=Ws(),ph=Ws(!0);function fh(){return[]}function mh(){return!1}var gh,yh=zs((function(t,e){return t+e}),0),vh=qs("ceil"),xh=zs((function(t,e){return t/e}),1),bh=qs("floor"),wh=zs((function(t,e){return t*e}),1),_h=qs("round"),Sh=zs((function(t,e){return t-e}),0);return Oi.after=function(t,e){if("function"!=typeof e)throw new Tt(n);return t=po(t),function(){if(--t<1)return e.apply(this,arguments)}},Oi.ary=Aa,Oi.assign=vo,Oi.assignIn=xo,Oi.assignInWith=bo,Oi.assignWith=wo,Oi.at=_o,Oi.before=Ma,Oi.bind=Ta,Oi.bindAll=Qo,Oi.bindKey=Ca,Oi.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ua(t)?t:[t]},Oi.chain=ua,Oi.chunk=function(t,e,n){e=(n?mr(t,e,n):e===i)?1:fi(po(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var r=0,a=0,o=nt(de(s/e));r<s;)o[a++]=Kn(t,r,r+=e);return o},Oi.compact=function(t){for(var e=-1,i=null==t?0:t.length,n=0,s=[];++e<i;){var r=t[e];r&&(s[n++]=r)}return s},Oi.concat=function(){var t=arguments.length;if(!t)return[];for(var e=nt(t-1),i=arguments[0],n=t;n--;)e[n-1]=arguments[n];return Le(Ua(i)?As(i):[i],fn(e,1))},Oi.cond=function(t){var e=null==t?0:t.length,i=sr();return t=e?De(t,(function(t){if("function"!=typeof t[1])throw new Tt(n);return[i(t[0]),t[1]]})):[],Yn((function(i){for(var n=-1;++n<e;){var s=t[n];if(_e(s[0],this,i))return _e(s[1],this,i)}}))},Oi.conforms=function(t){return function(t){var e=Do(t);return function(i){return an(i,t,e)}}(rn(t,1))},Oi.constant=Ko,Oi.countBy=pa,Oi.create=function(t,e){var i=Ri(t);return null==e?i:tn(i,e)},Oi.curry=function t(e,n,s){var r=Gs(e,8,i,i,i,i,i,n=s?i:n);return r.placeholder=t.placeholder,r},Oi.curryRight=function t(e,n,s){var r=Gs(e,16,i,i,i,i,i,n=s?i:n);return r.placeholder=t.placeholder,r},Oi.debounce=Ia,Oi.defaults=So,Oi.defaultsDeep=Eo,Oi.defer=Da,Oi.delay=La,Oi.difference=zr,Oi.differenceBy=Hr,Oi.differenceWith=Fr,Oi.drop=function(t,e,n){var s=null==t?0:t.length;return s?Kn(t,(e=n||e===i?1:po(e))<0?0:e,s):[]},Oi.dropRight=function(t,e,n){var s=null==t?0:t.length;return s?Kn(t,0,(e=s-(e=n||e===i?1:po(e)))<0?0:e):[]},Oi.dropRightWhile=function(t,e){return t&&t.length?ls(t,sr(e,3),!0,!0):[]},Oi.dropWhile=function(t,e){return t&&t.length?ls(t,sr(e,3),!0):[]},Oi.fill=function(t,e,n,s){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&mr(t,e,n)&&(n=0,s=r),function(t,e,n,s){var r=t.length;for((n=po(n))<0&&(n=-n>r?0:r+n),(s=s===i||s>r?r:po(s))<0&&(s+=r),s=n>s?0:fo(s);n<s;)t[n++]=e;return t}(t,e,n,s)):[]},Oi.filter=function(t,e){return(Ua(t)?Te:pn)(t,sr(e,3))},Oi.flatMap=function(t,e){return fn(wa(t,e),1)},Oi.flatMapDeep=function(t,e){return fn(wa(t,e),h)},Oi.flatMapDepth=function(t,e,n){return n=n===i?1:po(n),fn(wa(t,e),n)},Oi.flatten=Vr,Oi.flattenDeep=function(t){return null!=t&&t.length?fn(t,h):[]},Oi.flattenDepth=function(t,e){return null!=t&&t.length?fn(t,e=e===i?1:po(e)):[]},Oi.flip=function(t){return Gs(t,512)},Oi.flow=th,Oi.flowRight=eh,Oi.fromPairs=function(t){for(var e=-1,i=null==t?0:t.length,n={};++e<i;){var s=t[e];n[s[0]]=s[1]}return n},Oi.functions=function(t){return null==t?[]:xn(t,Do(t))},Oi.functionsIn=function(t){return null==t?[]:xn(t,Lo(t))},Oi.groupBy=va,Oi.initial=function(t){return null!=t&&t.length?Kn(t,0,-1):[]},Oi.intersection=jr,Oi.intersectionBy=Yr,Oi.intersectionWith=Gr,Oi.invert=To,Oi.invertBy=Co,Oi.invokeMap=xa,Oi.iteratee=nh,Oi.keyBy=ba,Oi.keys=Do,Oi.keysIn=Lo,Oi.map=wa,Oi.mapKeys=function(t,e){var i={};return e=sr(e,3),yn(t,(function(t,n,s){en(i,e(t,n,s),t)})),i},Oi.mapValues=function(t,e){var i={};return e=sr(e,3),yn(t,(function(t,n,s){en(i,n,e(t,n,s))})),i},Oi.matches=function(t){return On(rn(t,1))},Oi.matchesProperty=function(t,e){return Rn(t,rn(e,1))},Oi.memoize=Ba,Oi.merge=Bo,Oi.mergeWith=Po,Oi.method=sh,Oi.methodOf=rh,Oi.mixin=ah,Oi.negate=Pa,Oi.nthArg=function(t){return t=po(t),Yn((function(e){return Hn(e,t)}))},Oi.omit=ko,Oi.omitBy=function(t,e){return Oo(t,Pa(sr(e)))},Oi.once=function(t){return Ma(2,t)},Oi.orderBy=function(t,e,n,s){return null==t?[]:(Ua(e)||(e=null==e?[]:[e]),Ua(n=s?i:n)||(n=null==n?[]:[n]),Fn(t,e,n))},Oi.over=hh,Oi.overArgs=ka,Oi.overEvery=lh,Oi.overSome=uh,Oi.partial=Na,Oi.partialRight=Oa,Oi.partition=_a,Oi.pick=No,Oi.pickBy=Oo,Oi.property=ch,Oi.propertyOf=function(t){return function(e){return null==t?i:bn(t,e)}},Oi.pull=Xr,Oi.pullAll=Zr,Oi.pullAllBy=function(t,e,i){return t&&t.length&&e&&e.length?Un(t,e,sr(i,2)):t},Oi.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Un(t,e,i,n):t},Oi.pullAt=Jr,Oi.range=dh,Oi.rangeRight=ph,Oi.rearg=Ra,Oi.reject=function(t,e){return(Ua(t)?Te:pn)(t,Pa(sr(e,3)))},Oi.remove=function(t,e){var i=[];if(!t||!t.length)return i;var n=-1,s=[],r=t.length;for(e=sr(e,3);++n<r;){var a=t[n];e(a,n,t)&&(i.push(a),s.push(n))}return Vn(t,s),i},Oi.rest=function(t,e){if("function"!=typeof t)throw new Tt(n);return Yn(t,e=e===i?e:po(e))},Oi.reverse=Qr,Oi.sampleSize=function(t,e,n){return e=(n?mr(t,e,n):e===i)?1:po(e),(Ua(t)?$i:$n)(t,e)},Oi.set=function(t,e,i){return null==t?t:Xn(t,e,i)},Oi.setWith=function(t,e,n,s){return s="function"==typeof s?s:i,null==t?t:Xn(t,e,n,s)},Oi.shuffle=function(t){return(Ua(t)?Xi:Qn)(t)},Oi.slice=function(t,e,n){var s=null==t?0:t.length;return s?(n&&"number"!=typeof n&&mr(t,e,n)?(e=0,n=s):(e=null==e?0:po(e),n=n===i?s:po(n)),Kn(t,e,n)):[]},Oi.sortBy=Sa,Oi.sortedUniq=function(t){return t&&t.length?ns(t):[]},Oi.sortedUniqBy=function(t,e){return t&&t.length?ns(t,sr(e,2)):[]},Oi.split=function(t,e,n){return n&&"number"!=typeof n&&mr(t,e,n)&&(e=n=i),(n=n===i?c:n>>>0)?(t=yo(t))&&("string"==typeof e||null!=e&&!no(e))&&!(e=rs(e))&&ii(t)?ys(hi(t),0,n):t.split(e,n):[]},Oi.spread=function(t,e){if("function"!=typeof t)throw new Tt(n);return e=null==e?0:fi(po(e),0),Yn((function(i){var n=i[e],s=ys(i,0,e);return n&&Le(s,n),_e(t,this,s)}))},Oi.tail=function(t){var e=null==t?0:t.length;return e?Kn(t,1,e):[]},Oi.take=function(t,e,n){return t&&t.length?Kn(t,0,(e=n||e===i?1:po(e))<0?0:e):[]},Oi.takeRight=function(t,e,n){var s=null==t?0:t.length;return s?Kn(t,(e=s-(e=n||e===i?1:po(e)))<0?0:e,s):[]},Oi.takeRightWhile=function(t,e){return t&&t.length?ls(t,sr(e,3),!1,!0):[]},Oi.takeWhile=function(t,e){return t&&t.length?ls(t,sr(e,3)):[]},Oi.tap=function(t,e){return e(t),t},Oi.throttle=function(t,e,i){var s=!0,r=!0;if("function"!=typeof t)throw new Tt(n);return Qa(i)&&(s="leading"in i?!!i.leading:s,r="trailing"in i?!!i.trailing:r),Ia(t,e,{leading:s,maxWait:e,trailing:r})},Oi.thru=ca,Oi.toArray=uo,Oi.toPairs=Ro,Oi.toPairsIn=zo,Oi.toPath=function(t){return Ua(t)?De(t,Nr):ao(t)?[t]:As(kr(yo(t)))},Oi.toPlainObject=go,Oi.transform=function(t,e,i){var n=Ua(t),s=n||Ya(t)||oo(t);if(e=sr(e,4),null==i){var r=t&&t.constructor;i=s?n?new r:[]:Qa(t)&&Xa(r)?Ri(qt(t)):{}}return(s?Ee:yn)(t,(function(t,n,s){return e(i,t,n,s)})),i},Oi.unary=function(t){return Aa(t,1)},Oi.union=Kr,Oi.unionBy=ta,Oi.unionWith=ea,Oi.uniq=function(t){return t&&t.length?as(t):[]},Oi.uniqBy=function(t,e){return t&&t.length?as(t,sr(e,2)):[]},Oi.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?as(t,i,e):[]},Oi.unset=function(t,e){return null==t||os(t,e)},Oi.unzip=ia,Oi.unzipWith=na,Oi.update=function(t,e,i){return null==t?t:hs(t,e,fs(i))},Oi.updateWith=function(t,e,n,s){return s="function"==typeof s?s:i,null==t?t:hs(t,e,fs(n),s)},Oi.values=Ho,Oi.valuesIn=function(t){return null==t?[]:Xe(t,Lo(t))},Oi.without=sa,Oi.words=Zo,Oi.wrap=function(t,e){return Na(fs(e),t)},Oi.xor=ra,Oi.xorBy=aa,Oi.xorWith=oa,Oi.zip=ha,Oi.zipObject=function(t,e){return ds(t||[],e||[],Ji)},Oi.zipObjectDeep=function(t,e){return ds(t||[],e||[],Xn)},Oi.zipWith=la,Oi.entries=Ro,Oi.entriesIn=zo,Oi.extend=xo,Oi.extendWith=bo,ah(Oi,Oi),Oi.add=yh,Oi.attempt=Jo,Oi.camelCase=Fo,Oi.capitalize=Wo,Oi.ceil=vh,Oi.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=mo(n))==n?n:0),e!==i&&(e=(e=mo(e))==e?e:0),sn(mo(t),e,n)},Oi.clone=function(t){return rn(t,4)},Oi.cloneDeep=function(t){return rn(t,5)},Oi.cloneDeepWith=function(t,e){return rn(t,5,e="function"==typeof e?e:i)},Oi.cloneWith=function(t,e){return rn(t,4,e="function"==typeof e?e:i)},Oi.conformsTo=function(t,e){return null==e||an(t,e,Do(e))},Oi.deburr=Uo,Oi.defaultTo=function(t,e){return null==t||t!=t?e:t},Oi.divide=xh,Oi.endsWith=function(t,e,n){t=yo(t),e=rs(e);var s=t.length,r=n=n===i?s:sn(po(n),0,s);return(n-=e.length)>=0&&t.slice(n,r)==e},Oi.eq=za,Oi.escape=function(t){return(t=yo(t))&&G.test(t)?t.replace(j,ti):t},Oi.escapeRegExp=function(t){return(t=yo(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Oi.every=function(t,e,n){var s=Ua(t)?Me:cn;return n&&mr(t,e,n)&&(e=i),s(t,sr(e,3))},Oi.find=fa,Oi.findIndex=Wr,Oi.findKey=function(t,e){return Oe(t,sr(e,3),yn)},Oi.findLast=ma,Oi.findLastIndex=Ur,Oi.findLastKey=function(t,e){return Oe(t,sr(e,3),vn)},Oi.floor=bh,Oi.forEach=ga,Oi.forEachRight=ya,Oi.forIn=function(t,e){return null==t?t:mn(t,sr(e,3),Lo)},Oi.forInRight=function(t,e){return null==t?t:gn(t,sr(e,3),Lo)},Oi.forOwn=function(t,e){return t&&yn(t,sr(e,3))},Oi.forOwnRight=function(t,e){return t&&vn(t,sr(e,3))},Oi.get=Ao,Oi.gt=Ha,Oi.gte=Fa,Oi.has=function(t,e){return null!=t&&cr(t,e,En)},Oi.hasIn=Mo,Oi.head=qr,Oi.identity=ih,Oi.includes=function(t,e,i,n){t=qa(t)?t:Ho(t),i=i&&!n?po(i):0;var s=t.length;return i<0&&(i=fi(s+i,0)),ro(t)?i<=s&&t.indexOf(e,i)>-1:!!s&&ze(t,e,i)>-1},Oi.indexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=null==i?0:po(i);return s<0&&(s=fi(n+s,0)),ze(t,e,s)},Oi.inRange=function(t,e,n){return e=co(e),n===i?(n=e,e=0):n=co(n),function(t,e,i){return t>=mi(e,i)&&t<fi(e,i)}(t=mo(t),e,n)},Oi.invoke=Io,Oi.isArguments=Wa,Oi.isArray=Ua,Oi.isArrayBuffer=Va,Oi.isArrayLike=qa,Oi.isArrayLikeObject=ja,Oi.isBoolean=function(t){return!0===t||!1===t||Ka(t)&&_n(t)==m},Oi.isBuffer=Ya,Oi.isDate=Ga,Oi.isElement=function(t){return Ka(t)&&1===t.nodeType&&!io(t)},Oi.isEmpty=function(t){if(null==t)return!0;if(qa(t)&&(Ua(t)||"string"==typeof t||"function"==typeof t.splice||Ya(t)||oo(t)||Wa(t)))return!t.length;var e=ur(t);if(e==b||e==M)return!t.size;if(xr(t))return!Pn(t).length;for(var i in t)if(Pt.call(t,i))return!1;return!0},Oi.isEqual=function(t,e){return In(t,e)},Oi.isEqualWith=function(t,e,n){var s=(n="function"==typeof n?n:i)?n(t,e):i;return s===i?In(t,e,i,n):!!s},Oi.isError=$a,Oi.isFinite=function(t){return"number"==typeof t&&Ve(t)},Oi.isFunction=Xa,Oi.isInteger=Za,Oi.isLength=Ja,Oi.isMap=to,Oi.isMatch=function(t,e){return t===e||Dn(t,e,ar(e))},Oi.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Dn(t,e,ar(e),n)},Oi.isNaN=function(t){return eo(t)&&t!=+t},Oi.isNative=function(t){if(vr(t))throw new wt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ln(t)},Oi.isNil=function(t){return null==t},Oi.isNull=function(t){return null===t},Oi.isNumber=eo,Oi.isObject=Qa,Oi.isObjectLike=Ka,Oi.isPlainObject=io,Oi.isRegExp=no,Oi.isSafeInteger=function(t){return Za(t)&&t>=-9007199254740991&&t<=l},Oi.isSet=so,Oi.isString=ro,Oi.isSymbol=ao,Oi.isTypedArray=oo,Oi.isUndefined=function(t){return t===i},Oi.isWeakMap=function(t){return Ka(t)&&ur(t)==I},Oi.isWeakSet=function(t){return Ka(t)&&"[object WeakSet]"==_n(t)},Oi.join=function(t,e){return null==t?"":di.call(t,e)},Oi.kebabCase=Vo,Oi.last=$r,Oi.lastIndexOf=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var r=s;return n!==i&&(r=(r=po(n))<0?fi(s+r,0):mi(r,s-1)),e==e?function(t,e,i){for(var n=i+1;n--;)if(t[n]===e)return n;return n}(t,e,r):Re(t,Fe,r,!0)},Oi.lowerCase=qo,Oi.lowerFirst=jo,Oi.lt=ho,Oi.lte=lo,Oi.max=function(t){return t&&t.length?dn(t,ih,Sn):i},Oi.maxBy=function(t,e){return t&&t.length?dn(t,sr(e,2),Sn):i},Oi.mean=function(t){return We(t,ih)},Oi.meanBy=function(t,e){return We(t,sr(e,2))},Oi.min=function(t){return t&&t.length?dn(t,ih,kn):i},Oi.minBy=function(t,e){return t&&t.length?dn(t,sr(e,2),kn):i},Oi.stubArray=fh,Oi.stubFalse=mh,Oi.stubObject=function(){return{}},Oi.stubString=function(){return""},Oi.stubTrue=function(){return!0},Oi.multiply=wh,Oi.nth=function(t,e){return t&&t.length?Hn(t,po(e)):i},Oi.noConflict=function(){return ue._===this&&(ue._=zt),this},Oi.noop=oh,Oi.now=Ea,Oi.pad=function(t,e,i){t=yo(t);var n=(e=po(e))?oi(t):0;if(!e||n>=e)return t;var s=(e-n)/2;return Fs(fe(s),i)+t+Fs(de(s),i)},Oi.padEnd=function(t,e,i){t=yo(t);var n=(e=po(e))?oi(t):0;return e&&n<e?t+Fs(e-n,i):t},Oi.padStart=function(t,e,i){t=yo(t);var n=(e=po(e))?oi(t):0;return e&&n<e?Fs(e-n,i)+t:t},Oi.parseInt=function(t,e,i){return i||null==e?e=0:e&&(e=+e),yi(yo(t).replace(it,""),e||0)},Oi.random=function(t,e,n){if(n&&"boolean"!=typeof n&&mr(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=co(t),e===i?(e=t,t=0):e=co(e)),t>e){var s=t;t=e,e=s}if(n||t%1||e%1){var r=vi();return mi(t+r*(e-t+ae("1e-"+((r+"").length-1))),e)}return qn(t,e)},Oi.reduce=function(t,e,i){var n=Ua(t)?Be:qe,s=arguments.length<3;return n(t,sr(e,4),i,s,ln)},Oi.reduceRight=function(t,e,i){var n=Ua(t)?Pe:qe,s=arguments.length<3;return n(t,sr(e,4),i,s,un)},Oi.repeat=function(t,e,n){return e=(n?mr(t,e,n):e===i)?1:po(e),jn(yo(t),e)},Oi.replace=function(){var t=arguments,e=yo(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Oi.result=function(t,e,n){var s=-1,r=(e=ms(e,t)).length;for(r||(r=1,t=i);++s<r;){var a=null==t?i:t[Nr(e[s])];a===i&&(s=r,a=n),t=Xa(a)?a.call(t):a}return t},Oi.round=_h,Oi.runInContext=t,Oi.sample=function(t){return(Ua(t)?Gi:Gn)(t)},Oi.size=function(t){if(null==t)return 0;if(qa(t))return ro(t)?oi(t):t.length;var e=ur(t);return e==b||e==M?t.size:Pn(t).length},Oi.snakeCase=Yo,Oi.some=function(t,e,n){var s=Ua(t)?ke:ts;return n&&mr(t,e,n)&&(e=i),s(t,sr(e,3))},Oi.sortedIndex=function(t,e){return es(t,e)},Oi.sortedIndexBy=function(t,e,i){return is(t,e,sr(i,2))},Oi.sortedIndexOf=function(t,e){var i=null==t?0:t.length;if(i){var n=es(t,e);if(n<i&&za(t[n],e))return n}return-1},Oi.sortedLastIndex=function(t,e){return es(t,e,!0)},Oi.sortedLastIndexBy=function(t,e,i){return is(t,e,sr(i,2),!0)},Oi.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var i=es(t,e,!0)-1;if(za(t[i],e))return i}return-1},Oi.startCase=Go,Oi.startsWith=function(t,e,i){return t=yo(t),i=null==i?0:sn(po(i),0,t.length),e=rs(e),t.slice(i,i+e.length)==e},Oi.subtract=Sh,Oi.sum=function(t){return t&&t.length?je(t,ih):0},Oi.sumBy=function(t,e){return t&&t.length?je(t,sr(e,2)):0},Oi.template=function(t,e,n){var s=Oi.templateSettings;n&&mr(t,e,n)&&(e=i),t=yo(t),e=bo({},e,s,$s);var r,a,o=bo({},e.imports,s.imports,$s),h=Do(o),l=Xe(o,h),u=0,c=e.interpolate||vt,d="__p += '",p=At((e.escape||vt).source+"|"+c.source+"|"+(c===Z?ut:vt).source+"|"+(e.evaluate||vt).source+"|$","g"),f="//# sourceURL="+(Pt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ie+"]")+"\n";t.replace(p,(function(e,i,n,s,o,h){return n||(n=s),d+=t.slice(u,h).replace(xt,ei),i&&(r=!0,d+="' +\n__e("+i+") +\n'"),o&&(a=!0,d+="';\n"+o+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=h+e.length,e})),d+="';\n";var m=Pt.call(e,"variable")&&e.variable;if(m){if(ht.test(m))throw new wt("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(W,""):d).replace(U,"$1").replace(V,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Jo((function(){return _t(h,f+"return "+d).apply(i,l)}));if(g.source=d,$a(g))throw g;return g},Oi.times=function(t,e){if((t=po(t))<1||t>l)return[];var i=c,n=mi(t,c);e=sr(e),t-=c;for(var s=Ye(n,e);++i<t;)e(i);return s},Oi.toFinite=co,Oi.toInteger=po,Oi.toLength=fo,Oi.toLower=function(t){return yo(t).toLowerCase()},Oi.toNumber=mo,Oi.toSafeInteger=function(t){return t?sn(po(t),-9007199254740991,l):0===t?t:0},Oi.toString=yo,Oi.toUpper=function(t){return yo(t).toUpperCase()},Oi.trim=function(t,e,n){if((t=yo(t))&&(n||e===i))return Ge(t);if(!t||!(e=rs(e)))return t;var s=hi(t),r=hi(e);return ys(s,Je(s,r),Qe(s,r)+1).join("")},Oi.trimEnd=function(t,e,n){if((t=yo(t))&&(n||e===i))return t.slice(0,li(t)+1);if(!t||!(e=rs(e)))return t;var s=hi(t);return ys(s,0,Qe(s,hi(e))+1).join("")},Oi.trimStart=function(t,e,n){if((t=yo(t))&&(n||e===i))return t.replace(it,"");if(!t||!(e=rs(e)))return t;var s=hi(t);return ys(s,Je(s,hi(e))).join("")},Oi.truncate=function(t,e){var n=30,s="...";if(Qa(e)){var r="separator"in e?e.separator:r;n="length"in e?po(e.length):n,s="omission"in e?rs(e.omission):s}var a=(t=yo(t)).length;if(ii(t)){var o=hi(t);a=o.length}if(n>=a)return t;var h=n-oi(s);if(h<1)return s;var l=o?ys(o,0,h).join(""):t.slice(0,h);if(r===i)return l+s;if(o&&(h+=l.length-h),no(r)){if(t.slice(h).search(r)){var u,c=l;for(r.global||(r=At(r.source,yo(ct.exec(r))+"g")),r.lastIndex=0;u=r.exec(c);)var d=u.index;l=l.slice(0,d===i?h:d)}}else if(t.indexOf(rs(r),h)!=h){var p=l.lastIndexOf(r);p>-1&&(l=l.slice(0,p))}return l+s},Oi.unescape=function(t){return(t=yo(t))&&Y.test(t)?t.replace(q,ui):t},Oi.uniqueId=function(t){var e=++kt;return yo(t)+e},Oi.upperCase=$o,Oi.upperFirst=Xo,Oi.each=ga,Oi.eachRight=ya,Oi.first=qr,ah(Oi,(gh={},yn(Oi,(function(t,e){Pt.call(Oi.prototype,e)||(gh[e]=t)})),gh),{chain:!1}),Oi.VERSION="4.17.21",Ee(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Oi[t].placeholder=Oi})),Ee(["drop","take"],(function(t,e){Fi.prototype[t]=function(n){n=n===i?1:fi(po(n),0);var s=this.__filtered__&&!e?new Fi(this):this.clone();return s.__filtered__?s.__takeCount__=mi(n,s.__takeCount__):s.__views__.push({size:mi(n,c),type:t+(s.__dir__<0?"Right":"")}),s},Fi.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ee(["filter","map","takeWhile"],(function(t,e){var i=e+1,n=1==i||3==i;Fi.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:sr(t,3),type:i}),e.__filtered__=e.__filtered__||n,e}})),Ee(["head","last"],(function(t,e){var i="take"+(e?"Right":"");Fi.prototype[t]=function(){return this[i](1).value()[0]}})),Ee(["initial","tail"],(function(t,e){var i="drop"+(e?"":"Right");Fi.prototype[t]=function(){return this.__filtered__?new Fi(this):this[i](1)}})),Fi.prototype.compact=function(){return this.filter(ih)},Fi.prototype.find=function(t){return this.filter(t).head()},Fi.prototype.findLast=function(t){return this.reverse().find(t)},Fi.prototype.invokeMap=Yn((function(t,e){return"function"==typeof t?new Fi(this):this.map((function(i){return Tn(i,t,e)}))})),Fi.prototype.reject=function(t){return this.filter(Pa(sr(t)))},Fi.prototype.slice=function(t,e){t=po(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Fi(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=po(e))<0?n.dropRight(-e):n.take(e-t)),n)},Fi.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Fi.prototype.toArray=function(){return this.take(c)},yn(Fi.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),s=/^(?:head|last)$/.test(e),r=Oi[s?"take"+("last"==e?"Right":""):e],a=s||/^find/.test(e);r&&(Oi.prototype[e]=function(){var e=this.__wrapped__,o=s?[1]:arguments,h=e instanceof Fi,l=o[0],u=h||Ua(e),c=function(t){var e=r.apply(Oi,Le([t],o));return s&&d?e[0]:e};u&&n&&"function"==typeof l&&1!=l.length&&(h=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,m=h&&!p;if(!a&&u){e=m?e:new Fi(this);var g=t.apply(e,o);return g.__actions__.push({func:ca,args:[c],thisArg:i}),new Hi(g,d)}return f&&m?t.apply(this,o):(g=this.thru(c),f?s?g.value()[0]:g.value():g)})})),Ee(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Oi.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var s=this.value();return e.apply(Ua(s)?s:[],t)}return this[i]((function(i){return e.apply(Ua(i)?i:[],t)}))}})),yn(Fi.prototype,(function(t,e){var i=Oi[e];if(i){var n=i.name+"";Pt.call(Ti,n)||(Ti[n]=[]),Ti[n].push({name:e,func:i})}})),Ti[Os(i,2).name]=[{name:"wrapper",func:i}],Fi.prototype.clone=function(){var t=new Fi(this.__wrapped__);return t.__actions__=As(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=As(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=As(this.__views__),t},Fi.prototype.reverse=function(){if(this.__filtered__){var t=new Fi(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Fi.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,i=Ua(t),n=e<0,s=i?t.length:0,r=function(t,e,i){for(var n=-1,s=i.length;++n<s;){var r=i[n],a=r.size;switch(r.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=mi(e,t+a);break;case"takeRight":t=fi(t,e-a)}}return{start:t,end:e}}(0,s,this.__views__),a=r.start,o=r.end,h=o-a,l=n?o:a-1,u=this.__iteratees__,c=u.length,d=0,p=mi(h,this.__takeCount__);if(!i||!n&&s==h&&p==h)return us(t,this.__actions__);var f=[];t:for(;h--&&d<p;){for(var m=-1,g=t[l+=e];++m<c;){var y=u[m],v=y.iteratee,x=y.type,b=v(g);if(2==x)g=b;else if(!b){if(1==x)continue t;break t}}f[d++]=g}return f},Oi.prototype.at=da,Oi.prototype.chain=function(){return ua(this)},Oi.prototype.commit=function(){return new Hi(this.value(),this.__chain__)},Oi.prototype.next=function(){this.__values__===i&&(this.__values__=uo(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Oi.prototype.plant=function(t){for(var e,n=this;n instanceof zi;){var s=Rr(n);s.__index__=0,s.__values__=i,e?r.__wrapped__=s:e=s;var r=s;n=n.__wrapped__}return r.__wrapped__=t,e},Oi.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Fi){var e=t;return this.__actions__.length&&(e=new Fi(this)),(e=e.reverse()).__actions__.push({func:ca,args:[Qr],thisArg:i}),new Hi(e,this.__chain__)}return this.thru(Qr)},Oi.prototype.toJSON=Oi.prototype.valueOf=Oi.prototype.value=function(){return us(this.__wrapped__,this.__actions__)},Oi.prototype.first=Oi.prototype.head,Jt&&(Oi.prototype[Jt]=function(){return this}),Oi}();de?((de.exports=ci)._=ci,ce._=ci):ue._=ci}).call(_)}(ni,ni.exports);var si=ni.exports;const ri=S(si);let ai=class t{constructor(t=new Fe(1/0,1/0),e=new Fe(-1/0,-1/0)){d(this,"isBox2",!0),d(this,"min"),d(this,"max"),this.min=t,this.max=e}applyMatrix3(t){return this.isEmpty()||(oi[0].set(this.min.x,this.min.y).applyMatrix3(t),oi[1].set(this.min.x,this.max.y).applyMatrix3(t),oi[3].set(this.max.x,this.max.y).applyMatrix3(t),oi[2].set(this.max.x,this.min.y).applyMatrix3(t),this.setFromPoints(oi)),this}clone(){return(new t).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}ceil(){return this.min.ceilToZero(),this.max.ceilToZero(),this}distanceToPoint(t){return hi.copy(t).clamp(this.min,this.max).sub(t).length()}expandByXY(t,e){return this.min.minXY(t,e),this.max.maxXY(t,e),this}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByPoints(t){if(!t||!t.length)return this;for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){var e;this.union(t.boundingBoxWorld);for(let i=0,n=(null==(e=t.children)?void 0:e.length)||0;i<n;i++)this.expandByObject(t.children[i]);return this}expandByObjects(t){for(let e=0,i=t.length;e<i;e++)this.expandByObject(t[e]);return this}expandByBox(t){t.isEmpty()||(this.expandByPoint(t.min),this.expandByPoint(t.max))}expandByCubic(t,e,i,n,s,r,a,o){this.makeEmpty();let h=je(t,i,s,a,ui);for(let e=0;e<h;e++){const n=qe(t,i,s,a,ui[e]);this.min.x=Math.min(n,this.min.x),this.max.x=Math.max(n,this.max.x)}h=je(e,n,r,o,ci);for(let t=0;t<h;t++){const i=qe(e,n,r,o,ci[t]);this.min.y=Math.min(i,this.min.y),this.max.y=Math.max(i,this.max.y)}return this.expandByXY(t,e),this.expandByXY(a,o),this}expandByQuadratic(t,e,i,n,s,r){const a=Math.max(0,Math.min(1,$e(t,i,s))),o=Math.max(0,Math.min(1,$e(e,n,r))),h=Xe(t,i,s,a),l=Xe(e,n,r,o);return this.expandByXY(t,e),this.expandByXY(s,r),this.expandByXY(h,l),this}expandByArc(t,e,i,n,s,r,a){let o=s%(2*Math.PI);o<0&&(o+=2*Math.PI);let h=r%(2*Math.PI);if(h<0&&(h+=2*Math.PI),o===h)return this.expandByXY(t-i,e-n),this.expandByXY(t+i,e+n),this;if(a){const t=o;o=h,h=t}return h<o&&(h+=2*Math.PI),this.expandByXY(t+i*Math.cos(o),e+n*Math.sin(o)),this.expandByXY(t+i*Math.cos(h),e+n*Math.sin(h)),o>.5*Math.PI&&h<2*Math.PI+.5*Math.PI&&this.expandByXY(t,e+n),o>Math.PI&&h<2*Math.PI+Math.PI&&this.expandByXY(t-i,e),o>1.5*Math.PI&&h<2*Math.PI+1.5*Math.PI&&this.expandByXY(t,e-n),o>0&&h<2*Math.PI&&this.expandByXY(t+i,e),this}expandByEllipse(t,e,i,n,s,r,a,o){di[0]=r,di[1]=a,ei(di,o),r=di[0],a=di[1];const h=t+i*Math.cos(r),l=e+n*Math.sin(r),u=t+i*Math.cos(a),c=e+n*Math.sin(a);this.expandByXY(h,l),this.expandByXY(u,c);const d=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const h of d)if(ii(h,r,a,o)){const r=t+i*Math.cos(h),a=e+n*Math.sin(h),o=t+(r-t)*Math.cos(s)-(a-e)*Math.sin(s),l=e+(r-t)*Math.sin(s)+(a-e)*Math.cos(s);this.expandByXY(o,l)}return this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}floor(){return this.min.floorToZero(),this.max.floorToZero(),this}getCenter(t=new Fe){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t=new Fe){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}getPoints(t=[]){return t.length=0,t[0]={x:this.min.x,y:this.min.y},t[1]={x:this.min.x,y:this.max.y},t[2]={x:this.max.x,y:this.max.y},t[3]={x:this.max.x,y:this.min.y},t}getNumbersArray(t=[]){return[this.min.x,this.min.y,this.min.x,this.max.y,this.max.x,this.max.y,this.max.x,this.min.y]}getArea(){return this.getSize(hi),hi.x*hi.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}intersectsBox(t){return!!t&&!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}intersectsObject(t){return!(!t||!t.geometry)&&this.intersectsBox(t.geometry.boundingBox)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}round(){return this.min.roundToZero(),this.max.roundToZero(),this}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(hi.fromArray(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=hi.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromProjectionMatrix(t){return this.min.set(t.elements[6],t.elements[7]),this.max.set(t.elements[6],t.elements[7]),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}setFromMinMaxString(t,e=" "){if(this.makeEmpty(),!(null==t?void 0:t.length))return this;let i=t.split(e),n=ri.map(i,(t=>parseFloat(t)));for(let t=0,e=n.length;t<e;t+=2)this.expandByPoint(hi.fromArray(n,t));return this}setFromXYXY(t,e,i,n){return this.makeEmpty(),this.expandByXY(t,e),this.expandByXY(i,n),this}translate(t){return this.min.add(t),this.max.add(t),this}toString(){return`{"min":${this.min.toString()},"max":${this.max.toString()}}`}fromString(t){return t?(this.copy(JSON.parse(t)),this):this}union(t){return t.validate()?(this.min.min(t.min),this.max.max(t.max),this):this}validate(){return this.min.validate()&&this.max.validate()}unproject(t){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}centralArrange(t=1,e=20,i=10,n){const s=e+i;n?hi.copy(n):this.getCenter(hi),this.getSize(li),li.subScalar(e);const r=Math.floor(li.x/s),a=r*s,o=Math.ceil(t/r)*s;if(li.x<s||li.y<s||a>=li.x||o>=li.y)return hi.clone();let h=[],l=0,u=0;for(let e=0;e<t;e++){const e=r>t?t*s:a,i=hi.x-e/2+u*s+s/2,n=hi.y-o/2+l*s+s/2;h.push(new Fe(i,n)),u++,u>=r&&(u=0,l++)}return h}flipY(){return hi.copy(this.min).multiplyScalar(1,-1),li.copy(this.max).multiplyScalar(1,-1),this.min.set(hi.x,li.y),this.max.set(li.x,hi.y),this}};const oi=[new Fe,new Fe,new Fe,new Fe],hi=new Fe,li=new Fe,ui=[],ci=[],di=[],pi=Me.window.requestAnimationFrame,fi=Me.window.performance?()=>Me.window.performance.now():()=>(new Date).getTime(),mi=pi,gi=class t{constructor(){d(this,"id",t.idCounter++),d(this,"timers",new Map),d(this,"timersDuration",new Map),d(this,"counters",new Map),d(this,"countersAmount",new Map),d(this,"out",[])}static active(e){t.actived=!!e,t.duration=e||0}static add(t){this.children.push(t),this.handleStart()}static remove(e){for(let i=0,n=t.children.length;i<n;i++)if(t.children[i].id===e.id){this.children.splice(i,1);break}}static handleStart(){this.isRunning||(this.isRunning=!0,mi(this.runLoop))}static runLoop(){t.children.length?(t.runFrames(),mi(t.runLoop)):t.isRunning=!1}static runFrames(){let e,i=fi();if(!(i-t.lastTime<t.duration)){t.lastTime=i;for(let i=0,n=this.children.length;i<n;i++)e=this.children[i],e.calculateTimers(),e.calculateCounters(),t.messages=t.messages.concat(e.out),e.out.length=0;if(t.messages.length){if(t.actived){let t=[];t.push(bi),t.push(wi),t.push(_i),this.messages.forEach((e=>t.push(function(t,e=20){let i="│";i+=" ".repeat(Math.max(e-t.name.length,0)),i+=t.name,i+="│";const n="string"==typeof t.avg?xi-t.avg.length:xi-t.avg.toString().length;return i+=" ".repeat(Math.max(n,0)),i+=t.avg+" ",i+=" ".repeat(Math.max(xi-t.min.toString().length,0)),i+=t.min+" ",i+=" ".repeat(Math.max(xi-t.max.toString().length,0)),i+=t.max+" ",i+=" ".repeat(Math.max(xi-t.stdDev.toString().length,0)),i+=t.stdDev+" ",i+=" ".repeat(Math.max(xi-t.count.toString().length,0)),i+=t.count+" ",i+=" ".repeat(Math.max(xi-t.FPS.toString().length,0)),i+=t.FPS,i}(e,this.maxLetters)))),t.push(Si)}t.messages.length=0}}}destroy(){t.remove(this)}addTimer(t,e=fi(),i=fi()-(this.timersDuration.get(t)||fi())){this.addTimerDuration(t,i),this.timersDuration.set(t,e)}addTimerDuration(t,e){var i;this.timers.has(t)||this.timers.set(t,[]),null==(i=this.timers.get(t))||i.push(e)}calculateTimers(){this.timers.forEach(((t,e)=>{t&&t.length&&(this.out.push(this.calculateDurations(e,t)),t.length=0)}))}addCounterAmount(t,e){var i;this.counters.has(t)||this.counters.set(t,[]),null==(i=this.counters.get(t))||i.push(e)}calculateCounters(){this.counters.forEach(((t,e)=>{t&&t.length&&(this.out.push(this.calculateAmounts(e,t)),t.length=0)}))}start(){return this.stop(),t.add(this),this}stop(){return t.remove(this),this}calculateDurations(e,i){const n={name:e,avg:0,min:0,max:0,stdDev:0,count:0,FPS:0};if(!i||!i.length)return n;const s=i.length,{min:r,max:a,avg:o}=this.minMaxAvg(i),h=parseFloat(this.stdDev(i,o).toFixed(2));return{name:e,avg:this.fd(o),min:this.fd(r),max:this.fd(a),stdDev:h,count:s,FPS:Math.ceil(s/t.duration*1e3)}}calculateAmounts(e,i){const n={name:e,avg:0,min:0,max:0,stdDev:0,count:0,FPS:0};if(!i||!i.length)return n;const s=i.length,{min:r,max:a,avg:o}=this.minMaxAvg(i);return{name:e,avg:o,min:r,max:a,stdDev:this.stdDev(i,o),count:s,FPS:Math.ceil(s/t.duration*1e3)}}minMaxAvg(t){let e=t[0],i=t[0],n=t.length,s=0;for(let n=0;n<t.length;n++){const r=t[n];s+=r,r<e&&(e=r),r>i&&(i=r)}const r=s/n;return{min:this.fx(e),max:this.fx(i),avg:this.fx(r)}}stdDev(t,e){let i=0;for(let n=0;n<t.length;n++){const s=t[n];i+=(s-e)*(s-e)}const n=t.length;return this.fx(Math.sqrt(i/n))}fd(t){return t>1e3?(t/1e3).toFixed(1)+"s":t.toFixed(1)+"ms"}fx(t,e=1){return 1===e?Math.round(10*t)/10:2===e?Math.round(100*t)/100:3===e?Math.round(1e3*t)/1e3:t}};d(gi,"idCounter",0),d(gi,"children",[]),d(gi,"isRunning",!1),d(gi,"actived",!1),d(gi,"duration",0),d(gi,"lastTime",fi()),d(gi,"messages",[]),d(gi,"maxLetters",20);let yi=gi;const vi=["avg","min","max","stdDev","count","FPS"],xi=function(t,e=0){let i=0;for(let e=0,n=t.length;e<n;e++)i=Math.max(i,t[e].length);return i+e}(vi,1),bi=function(t,e=20){let i="┌";i+="─".repeat(e),i+="┬";for(let e=0,n=t.length;e<n;e++)i+="─".repeat(xi),i+=e<n-1?"┬":"┐";return i}(vi,20),wi=function(t,e=20){let i="│";i+=" ".repeat(e),i+="│";for(let e=0,n=t.length;e<n;e++)i+=" ".repeat(Math.max(xi-t[e].length-1,0)),i+=t[e],i+=" │";return i}(vi,20),_i=function(t,e=20){let i="├";i+="─".repeat(e),i+="┼";for(let e=0,n=t.length;e<n;e++)i+="─".repeat(xi),i+=e<n-1?"┴":"┘";return i}(vi,20),Si=function(t=20){let e="└";for(let i=0;i<t;i++)e+="─";return e+="┘",e}(20);function Ei(t,e="http://www.w3.org/2000/svg"){var i,n;return null==(n=null==(i=Me.window)?void 0:i.document)?void 0:n.createElementNS(e,t)}function Ai(t=2e3){return p(this,null,(function*(){return new Promise((e=>setTimeout(e,(Math.random()+.5)*t)))}))}function Mi(t,e=[]){var i,n;return t&&t.value?(e.push(t.value),(null==(i=t.children)?void 0:i.length)&&(null==(n=t.children)||n.forEach((t=>Mi(t,e)))),e):e}var Ti=(t=>(t.GROS="gros",t.RM="rm",t.WS="ws",t.SU="su",t.EQ="eq",t.FN="fn",t.GL="gl",t.IP="ip",t))(Ti||{});const Ci="dummy";var Ii=(t=>(t.BACKGROUND="background",t.BACKGROUND_LABELS="background-labels",t.ASSETS="assets",t.ANNOTATIONS="annotations",t.TEXT="text",t.ASSET_LABELS="asset-labels",t.LABELS="labels",t))(Ii||{});const Di="ae",Li="rm-assets",Bi="ws-assets",Pi="ws-labels";function ki(t){return t+"-"+Ii.ASSETS}function Ni(t){return t+"-"+Ii.LABELS}const Oi={rm:["su-assets","su-labels","eq-assets","eq-labels","fn-assets","fn-labels"],ws:["su-assets","su-labels","eq-assets","eq-labels","fn-assets","fn-labels"],su:[Li,"rm-labels",Bi,Pi,"eq-assets","eq-labels","fn-assets","fn-labels"],eq:[Bi,Pi,"su-assets","su-labels","fn-assets","fn-labels"]};var Ri=(t=>(t.INIT="init",t.LOAD="load",t.LOADED="loaded",t.RESIZE="resize",t.SET_SIZE="setSize",t.GET_LAYERS="getLayers",t.GET_ASSET_IDS_BY_TYPE="getAssetIdsByType",t.SET_FILL_BY_IDS="setFillByIds",t.CLEAR_FILL_BY_IDS="clearFillByIds",t.CLEAR_FILL="clearFill",t.SET_STROKE_BY_IDS="setStrokeByIds",t.CLEAR_STROKE="clearStroke",t.TERMINATE="terminate",t.CAMERA_SYNC="cameraSync",t.SLICE_DURATION_CHANGED="sliceDurationChanged",t.ASSET_TYPE_CHANGED="assetTypeChanged",t.FN_ENABLE_CHANGED="fnEnableChanged",t.SVG_LOADING_TYPE_CHANGED="svgLoadingTypeChanged",t.USED_CACHE_CHANGED="usedCacheChanged",t.DEBOUNCE_CACHE_CHANGED="debounceCacheChanged",t.WIREFRAME_CHANGED="wireframeChanged",t.BG_PASS_CHANGED="bgPass",t.SELECT_ENABLE_CHANGED="selectEnableChanged",t.MULTI_SELECT_ENABLE_CHANGED="multiSelectEnableChanged",t.MULTI_SELECT_BY_RANGE="multiSelectByRange",t.ZOOM_TO_SELECT_ENABLE_CHANGED="zoomToSelectEnableChanged",t.SOCIAL_DISTANCE_ENABLE_CHANGED="socialDistanceEnableChanged",t.ENABLE_HOVER_CHANGED="enableHover",t.FONT_ZOOM_IN="fontZoomIn",t.FONT_ZOOM_OUT="fontZoomOut",t.UNPROJECT="unproject",t.STROKE_MORE="strokeMore",t.STROKE_LESS="strokeLess",t.CAMERA_CHANGED="cameraChanged",t.SCENES_CHANGED="scenesChanged",t.UPDATE_LAYERS_VISIBILITY="updateLayersVisibility",t.DYNAMIC_LOADED="dynamicLoaded",t.SYNC_TEXTURE_HELPER_CACHED="syncTextureHelperCached",t.INIT_FONT="initFont",t.INIT_LOADING_FONT="initLoadingFont",t.REFRESH="refresh",t.FULLSCREEN="fullscreen",t.GET_CAMERA_POSITION="getCameraPosition",t.SET_CAMERA_POSITION="setCameraPosition",t.SAVE_CAMERA_POSITION="saveCameraPosition",t.RESTORE_CAMERA_POSITION="restoreCameraPosition",t.FOCUS_AT_IDS="focusAtIds",t.GET_LEGEND="getLegend",t.GET_ASSET_LABELS="getAssetLabels",t.SET_ASSET_LABELS="setAssetLabels",t.CLEAR_ASSET_LABELS="clearAssetLabels",t.CLEAR_DUMMIES="clearDummies",t.SET_DUMMIES="setDummies",t.FOCUS_AT_DUMMY="focusAtDummy",t.HIGHLIGHT_DUMMIES="highlightDummies",t.RESET_HIGHLIGHT_DUMMIES="resetHighlightDummies",t.SET_EDITOR_MODE="setEditorMode",t.BIND_EDITOR_DRAG="bindEditorDrag",t.SET_EDITOR_DRAGGING_OBJECT="setEditorDraggingObject",t.HANDLE_EXTERNAL_EVENT="handleExternalEvent",t.GET_DUMMIES="getDummies",t.ZOOM_IN="zoomIn",t.ZOOM_OUT="zoomOut",t.INITIALIZATION_START="INITIALIZATION_START",t.INITIALIZATION_COMPLETE="INITIALIZATION_COMPLETE",t.POINTER_OVER="pointerover",t.POINTER_OUT="pointerout",t.POINTER_LEAVE="pointerleave",t.SELECTED="selected",t.SELECT_BY_IDS="selectByIds",t.GET_ASSET_BOUNDING_BOX="getAssetBoundingBox",t.SET_ASSET_TYPE="setAssetType",t.LINK_ASSETS_BY_TREE="linkAssetsByTree",t.CLEAR_SELECTED="clearSelected",t.TARGET_BY_IDS="targetByIds",t.SHOW_ASSETS_LABEL="showAssetsLabel",t.HIDE_ASSETS_LABEL="hideAssetsLabel",t.TAP="tap",t.SINGLE_TAP="singletap",t.DOUBLE_TAP="doubletap",t.PRESS="press",t.PAN="pan",t.PAN_START="panstart",t.PAN_MOVE="panmove",t.PAN_END="panend",t.ROTATE="rotate",t.ROTATE_START="rotatestart",t.ROTATE_MOVE="rotatemove",t.ROTATE_END="rotateend",t.PINCH="pinch",t.PINCH_START="pinchstart",t.PINCH_MOVE="pinchmove",t.PINCH_END="pinchend",t.PINCH_IN="pinchin",t.PINCH_OUT="pinchout",t.SWIPE="swipe",t.SET_CURSOR="setCursor",t.DRAG_END="dragEnd",t))(Ri||{});let zi=class{constructor(){d(this,"_listeners",new Map)}destroy(){this._listeners.clear()}addEventListener(t,e){let i=this._listeners.get(t);i||(i=[],this._listeners.set(t,i)),i.includes(e)||i.push(e)}addEventListeners(t,e){const i=t.split(","),n=i.length;for(let t=0;t<n;t++)this.addEventListener(i[t].trim(),e)}isListening(t){var e;return this._listeners.has(t)&&!!(null==(e=this._listeners.get(t))?void 0:e.length)}hasEventListener(t,e){var i;return 0!==this._listeners.size&&this._listeners.has(t)&&!!(null==(i=this._listeners.get(t))?void 0:i.includes(e))}removeEventListener(t,e){const i=this._listeners.get(t);if(i){const t=i.indexOf(e);t>-1&&i.splice(t,1)}}dispatchEvent(t){const e=this._listeners.get(t.type);if(e){t.target=this;const i=e.slice(0);for(let e=0,n=i.length;e<n;e++)i[e].call(this,t);t.target=void 0}}dispatchEventAsync(t){const e=this._listeners.get(t.type);e&&setTimeout((()=>{for(const i of e)i.call(this,t)}))}},Hi=class t{constructor(){d(this,"isMatrix3",!0),d(this,"elements",[1,0,0,0,1,0,0,0,1])}static equals(t,e,i=1e-6){if(t.elements.length!=e.elements.length)return!1;for(let n=0,s=t.elements.length;n<s;n++){const s=t.elements[n]-e.elements[n];if(Math.abs(s)>i)return!1}return!0}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}clone(){return(new t).fromArray(this.elements)}compose(t,e,i){const n=Math.sin(e.x),s=Math.cos(e.x);return this.set(i.x*s,i.y*n*-1,t.x,i.x*n,i.y*s,t.y,0,0,1)}composeWithCenter(t,e,i,n){return qi.identity(),ji.makeTranslation(t.x,t.y),Yi.makeRotation(e.x),Gi.makeScale(i.x,i.y),Ui.copy(n).applyMatrix3(Gi),qi.multiply($i.makeTranslation(-Ui.x,-Ui.y)).multiply(ji).multiply($i.makeTranslation(Ui.x,Ui.y)).multiply(Yi).multiply($i.makeTranslation(-Ui.x,-Ui.y)).multiply(Gi),this.copy(qi)}decompose(t,e,i){const n=qi.copy(this).elements,s=Math.sqrt(n[0]*n[0]+n[3]*n[3]),r=Math.sqrt(n[1]*n[1]+n[4]*n[4]),a=n[0]*n[4]-n[3]*n[1];n[0]||n[3]?i.set(s,a/s):n[1]||n[4]?i.set(a/r,r):i.set(0,0);let o=0;o=n[0]||n[3]?n[3]>0?-Math.acos(n[0]/s):Math.acos(n[0]/s):n[1]||n[4]?Math.PI/2-(n[4]>0?Math.acos(-n[1]/r):-Math.acos(n[1]/r)):0,0!==o&&i.y<0&&(o*=-1),e.set(o,o),t.set(n[6],n[7])}compose2(t,e,i){return this.identity().translate(t.x,t.y).rotate(e.x).scale(i.x,i.y),this}decompose2(t,e,i){const n=this.clone();n.scale(-1,1);const s=n.elements[0],r=n.elements[1],a=n.elements[3],o=n.elements[4];let h=0,l=0,u=0;if(0!==s||0!==a){const t=Math.hypot(s,a);h=t,l=(s*o-r*a)/t;const e=Math.acos(s/t);u=a>0?-e:e}else if(0!==r||0!==o){const t=Math.hypot(r,o);h=(s*o-r*a)/t,l=t;const e=Math.acos(r/t);u=Math.PI/2+(o>0?-e:e)}else h=0,l=0,u=0;h=-h,t.x=n.elements[6],t.y=n.elements[7],e.x=e.y=u/Math.PI/180,i.x=h,i.y=l}composeSvgTransform(t=0,e=0,i,n=!1){if(!i&&!t&&!e)return this;this.identity(),qi.identity();let s=i.split(") ").map((t=>t.trim()+")")).filter((t=>")"!==t));return s||(s=[]),(t||e)&&s.push(`translate(${t},${e})`),s.forEach((t=>{const e=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(t),i=/rotate\(\s*(-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+))?)?\s*\)/.exec(t),n=/translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(t);if(e){const t=Number(e[1])||1,i=Number(e[2])||t;qi.multiply(Gi.makeScale(t,i))}else if(i){const t=Ie(Number(i[1])||0);Number(i[2])||Number(i[3])?(Wi.set(Number(i[2]||"0"),Number(i[3]||"0")),qi.multiply(Yi.makeRotationByPoint(t,Wi))):qi.multiply(Yi.makeRotation(t))}else n&&qi.multiply(ji.makeTranslation(Number(n[1])||0,Number(n[2])||0))})),this.copy(qi),n&&this.premultiply(Gi.makeScale(1,-1)),this}decomposeSvgMatrix(t,e,i){const n=qi.copy(this).elements;Wi.set(n[0],n[1]),Ui.set(n[3],n[4]);let s=Wi.length();Wi.normalize();let r=Wi.dot(Ui);Vi.copy(Wi).multiplyScalar(-r),Ui.add(Vi);const a=Ui.length()||0;Ui.normalize(),Wi.x*Ui.y<Ui.x*Wi.y&&(Wi.x=-Wi.x,Wi.y=-Wi.y,s=-s,r=-r);const o=s?Math.atan2(Wi.y,Wi.x):Math.atan2(-Wi.x,Ui.y);t.set(n[6],n[7]),e.set(o,o),i.set(s,a)}determinant(){const t=this.elements,e=t[0],i=t[3],n=t[6],s=t[1],r=t[4],a=t[7],o=t[2],h=t[5],l=t[8];return e*r*l-e*h*a-s*i*l+s*h*n+o*i*a-o*r*n}equals(t,e=0){const i=this.elements,n=t.elements;for(let t=0;t<9;t++)if(Math.abs(i[t]-n[t])>e)return!1;return!0}extractBasis2(t,e){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),this}flipY(){return this.premultiply(Gi.makeScale(1,-1))}flipSvgY(){return this.elements[1]*=-1,this.elements[3]*=-1,this.elements[7]*=-1,this}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}getComponents(t=[1,0,0,1,0,0]){return t[0]=this.elements[0],t[1]=this.elements[1],t[2]=this.elements[3],t[3]=this.elements[4],t[4]=this.elements[6],t[5]=this.elements[7],t}fromComponents(t){return this}getNormalMatrix(t){return this.setFromMatrix(t).invert().transpose()}getRotation(t){let e=this.elements;const i=Math.sqrt(e[0]*e[0]+e[3]*e[3]),n=Math.sqrt(e[1]*e[1]+e[4]*e[4]);let s=0;s=e[0]||e[3]?e[3]>0?-Math.acos(e[0]/i):Math.acos(e[0]/i):e[1]||e[4]?Math.PI/2-(e[4]>0?Math.acos(-e[1]/n):-Math.acos(e[1]/n)):0,this.getScale(Ui),0!==s&&Ui.x<0&&(s*=-1),t.set(s,s)}getScale(t){let e=this.elements,i=Math.sqrt(e[0]*e[0]+e[1]*e[1]),n=Math.sqrt(e[3]*e[3]+e[4]*e[4]),s=e[0]*e[4]-e[3]*e[1];e[0]||e[1]?t.set(s/n,n):e[3]||e[4]?t.set(i,s/i):t.set(0,0)}getTransition(t){t.set(this.elements[6],this.elements[7])}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}hasChange(){for(let t=0,e=this.elements.length;t<e;t++)if(Math.abs(this.elements[t]-Fi[t])>Number.EPSILON)return!0;return!1}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*r-a*h,c=a*o-l*s,d=h*s-r*o,p=e*u+i*c+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=u*f,t[1]=(n*h-l*i)*f,t[2]=(a*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(n*s-a*e)*f,t[6]=d*f,t[7]=(i*o-h*e)*f,t[8]=(r*e-i*s)*f,this}lookAt(t,e,i){return this.identity().rotate(e.angle()-t.angle()+i.angle())}makeProjection(t,e,i,n,s,r){const a=s/(e-t),o=r/(i-n),h=s/2-(e+t)*a,l=r/2+(i+n)*o;return this.elements[0]=a,this.elements[3]=0,this.elements[6]=h,this.elements[1]=0,this.elements[4]=-o,this.elements[7]=l,this.elements[2]=0,this.elements[5]=0,this.elements[8]=1,this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeRotationByPoint(t,e){const i=Math.cos(t),n=Math.sin(t),s=-e.x*i+e.y*n+e.x,r=-e.x*n-e.y*i+e.y;return this.set(i,-n,s,n,i,r,0,0,1),this}makeRotationFromQuaternion(t){return this.compose(Xi,t,Zi)}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}multiply(t){return this.multiplyMatrices(this,t)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,s=this.elements,r=i[0],a=i[3],o=i[6],h=i[1],l=i[4],u=i[7],c=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],y=n[1],v=n[4],x=n[7],b=n[2],w=n[5],_=n[8];return s[0]=r*f+a*y+o*b,s[3]=r*m+a*v+o*w,s[6]=r*g+a*x+o*_,s[1]=h*f+l*y+u*b,s[4]=h*m+l*v+u*w,s[7]=h*g+l*x+u*_,s[2]=c*f+d*y+p*b,s[5]=c*m+d*v+p*w,s[8]=c*g+d*x+p*_,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}premultiply(t){return this.multiplyMatrices(t,this)}rotate(t){return this.premultiply(Yi.makeRotation(-t))}scale(t,e){return this.premultiply(Gi.makeScale(t,e))}set(t,e,i,n,s,r,a,o,h){return this.elements[0]=t,this.elements[3]=e,this.elements[6]=i,this.elements[1]=n,this.elements[4]=s,this.elements[7]=r,this.elements[2]=a,this.elements[5]=o,this.elements[8]=h,this}setFromDomMatrix(t){return void 0!==t.m11&&void 0!==t.m21&&void 0!==t.m41&&void 0!==t.m12&&void 0!==t.m22&&void 0!==t.m42&&void 0!==t.m14&&void 0!==t.m24&&void 0!==t.m44?this.set(t.m11,t.m21,t.m41,t.m12,t.m22,t.m42,t.m14,t.m24,t.m44):void 0!==t.a&&void 0!==t.b&&void 0!==t.c&&void 0!==t.d&&void 0!==t.e&&void 0!==t.f&&this.set(t.a,t.c,t.e,t.b,t.d,t.f,0,0,1),this}setFromMatrix(t){const e=t.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this}setUvTransform(t,e,i,n,s,r,a){const o=Math.cos(s),h=Math.sin(s);return this.set(i*o,i*h,-i*(o*r+h*a)+r+t,-n*h,n*o,-n*(-h*r+o*a)+a+e,0,0,1),this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}toString(){return`[${this.elements[0]},${this.elements[1]}, ${this.elements[3]},${this.elements[4]}, ${this.elements[6]},${this.elements[7]}]`}translate(t,e){return this.premultiply(ji.makeTranslation(t,e))}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}getTransformScaleX(){return Math.sqrt(this.elements[0]*this.elements[0]+this.elements[1]*this.elements[1])}getTransformScaleY(){return Math.sqrt(this.elements[3]*this.elements[3]+this.elements[4]*this.elements[4])}isTransformSkewed(){const t=this.elements[0]*this.elements[3]+this.elements[1]*this.elements[4];return 0!==t&&Math.abs(t/(this.getTransformScaleX()*this.getTransformScaleY()))>Number.EPSILON}isTransformFlipped(){return this.elements[0]*this.elements[4]-this.elements[1]*this.elements[3]<0}hasMirror(){return this.elements[0]*this.elements[4]-this.elements[1]*this.elements[3]<0}hasMirrorY(){return this.elements[0]<0&&this.elements[4]>0}hasMirrorX(){return this.elements[4]<0&&this.elements[0]>0}};const Fi=[1,0,0,0,1,0,0,0,1],Wi=new Fe,Ui=new Fe,Vi=new Fe,qi=new Hi,ji=new Hi,Yi=new Hi,Gi=new Hi,$i=new Hi,Xi=new Fe(0,0,0),Zi=new Fe(1,1,1),Ji=["view"],Qi=["viewer","mirror"];function Ki(t,e){var i;if(t.tagName&&!Ji.includes(t.tagName)&&("g"!==t.tagName||0!==(null==(i=t.childNodes)?void 0:i.length))){Qi.includes(t.id)||e(t);for(let i=0,n=t.childNodes.length;i<n;i++)Ki(t.childNodes[i],e)}}let tn=0;function en(t,e=0,i=0,n=[]){var s,r;if(!t)return n;const a=rn(t,"id","");if(Ji.includes(t.nodeName)||"defs"===t.nodeName)return tn--,n;if(e&&tn>e)return n;let o;a&&!Qi.includes(a)&&(o={label:a,value:a,children:[]},n.push(o)),tn++;for(let i=0,r=null==(s=t.childNodes)?void 0:s.length;i<r;i++)en(t.childNodes[i],e,tn,o?o.children:n);return 0===(null==(r=null==o?void 0:o.children)?void 0:r.length)&&delete o.children,tn=i,n}function nn(t,e){var i;if(Array.isArray(t))for(let i=0,n=t.length||0;i<n;i++)nn(t[i],e);else if(e(t),null==(i=t.children)?void 0:i.length)for(let i=0,n=t.children.length;i<n;i++)nn(t.children[i],e)}function sn(t){var e,i,n;const s=[];if(!(null==(e=null==t?void 0:t.children)?void 0:e.length))return s;for(let e,r=0,a=(null==(i=null==t?void 0:t.children)?void 0:i.length)||0;r<a;r++)e=t.children[r],s.push(e),(null==(n=e.children)?void 0:n.length)&&s.push(...sn(e));return s}function rn(t,e,i){if(!t)return i;let n=i;if("function"==typeof t.getAttribute?n=null==t?void 0:t.getAttribute(e):Object.hasOwnProperty.call(t,"attributes")&&(n=t.attributes[e]),!n)return i;if(void 0!==i){if("string"==typeof i)return n;if("number"==typeof i)return Number(n)}return n}const an=-1,on=51,hn=52;class ln{constructor(t=!0){d(this,"dpr",1),d(this,"data"),d(this,"userData",{}),d(this,"autoClose",!1),d(this,"_saveData",!0),d(this,"_len",0),d(this,"_x0",0),d(this,"_y0",0),d(this,"_xi",0),d(this,"_yi",0),d(this,"_version",0),d(this,"_ctx"),d(this,"_ppx",0),d(this,"_ppy",0),d(this,"_ppl",0),d(this,"_ux",0),d(this,"_uy",0),d(this,"_pathSegLen"),d(this,"_pathLen",0),this._saveData=!!t,this._saveData&&(this.data=[])}dispose(){return this.reset(),this.data=[],this._len=0,this.userData={},this._ctx=void 0,this._version=0,this._ppx=0,this._ppy=0,this._ppl=0,this._ux=0,this._uy=0,this}reset(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=void 0,this._pathLen=0),this.needsUpdate=!0}set needsUpdate(t){!0===t&&this._version++}get version(){return this._version}clone(){const t=new ln(this._saveData),e=this.data;return t.data=(null==e?void 0:e.slice)?e.slice():Array.prototype.slice.call(e),t._len=this._len,t._ux=this._ux,t._uy=this._uy,t._ppx=this._ppx,t._ppy=this._ppy,t._ppl=this._ppl,t.autoClose=this.autoClose,t.userData=ri.cloneDeep(this.userData),t}setDpr(t){return this.dpr=t||1,this}setScale(t,e,i){return i&&(this._ux=Math.abs(i/(Me.config.dpr||1)/(t||1)),this._uy=Math.abs(i/(Me.config.dpr||1)/(e||1))),this}setContext(t){return this._ctx=t,this}getContext(){return this._ctx}len(){return this._len}setData(t){if(!this._saveData)return;const e=(null==t?void 0:t.length)||0;this.data&&this.data.length===e||(this.data=new Float32Array(e));for(let i=0;i<e;i++)this.data[i]=t[i];this._len=e}addData(...t){if(!this._saveData)return;let e=this.data;this._len+(null==t?void 0:t.length)>((null==e?void 0:e.length)||0)&&(this._expandData(),e=this.data);for(let i=0,n=(null==t?void 0:t.length)||0;i<n;i++)e[this._len++]=t[i]}insertData(t,...e){if(!this._saveData||!e||0===e.length)return;const i=this.getCmds();t<0&&(t=0),t>i.length&&(t=i.length),e.length>0&&i.splice(t,0,[...e]);const n=ri.flatten(i);this.setData(n),this.needsUpdate=!0}removeData(t){if(!this._saveData||!this.data||this._len<=0)return;const e=this.getCmds();if(t<0||t>=e.length)return;e.splice(t,1);const i=ri.flatten(e);this.setData(i),this.needsUpdate=!0}_expandData(){if(!(this.data instanceof Array)){const t=[];for(let e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}}appendPath(t){if(!this._saveData||!t)return;t instanceof Array||(t=[t]);const e=t.length;let i=0,n=this._len;for(let n=0;n<e;n++)i+=t[n].len()||0;const s=this.data;if((s instanceof Float32Array||!s)&&(this.data=new Float32Array(n+i),n>0&&s))for(let t=0;t<n;t++)this.data[t]=s[t];for(let i=0;i<e;i++){const e=t[i].data;for(let i=0,s=(null==t?void 0:t.length)||0;i<s;i++)this.data[n++]=e[i]}this._len=n}toStatic(){this._saveData&&(this._pendingLine(),this.data instanceof Array&&(this.data.length=this._len,this._len>11&&(this.data=new Float32Array(this.data))))}rebuildPath(t,e){if(!this.data||!this._len||e<=0)return;const i=this.data,n=this._ux,s=this._uy,r=this._len;let a=0,o=0,h=0,l=0,u=0,c=0;const d=e<1;let p,f,m,g,y=0,v=0,x=0,b=0;if(!d||(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,f=this._pathLen,x=f*e,x))t:for(let e=0;e<r;){const r=i[e++],f=1===e;switch(f&&(a=h=i[e],o=l=i[e+1]),2!==r&&b>0&&(t.lineTo(m,g),b=0),r){case 1:a=h=i[e++],o=l=i[e++],t.moveTo(h,l);break;case 2:{u=i[e++],c=i[e++];const r=Math.abs(u-h),a=Math.abs(c-l);if(r>n||a>s){if(d){const e=p[v++];if(y+e>x){const i=(x-y)/e;t.lineTo(h*(1-i)+u*i,l*(1-i)+c*i);break t}y+=e}t.lineTo(u,c),h=u,l=c,b=0}else{const t=r*r+a*a;t>b&&(m=u,g=c,b=t)}break}case 3:{const n=i[e++],s=i[e++],r=i[e++],a=i[e++],o=i[e++],u=i[e++];if(d){const e=p[v++];if(y+e>x){const i=(x-y)/e;Ge(h,n,r,o,i,cn),Ge(l,s,a,u,i,dn),t.bezierCurveTo(cn[1],dn[1],cn[2],dn[2],cn[3],dn[3]);break t}y+=e}t.bezierCurveTo(n,s,r,a,o,u),h=o,l=u;break}case 4:{const n=i[e++],s=i[e++],r=i[e++],a=i[e++];if(d){const e=p[v++];if(y+e>x){const i=(x-y)/e;Je(h,n,r,i,cn),Je(l,s,a,i,dn),t.quadraticCurveTo(cn[1],dn[1],cn[2],dn[2]);break t}y+=e}t.quadraticCurveTo(n,s,r,a),h=r,l=a;break}case 5:const r=i[e++],w=i[e++],_=i[e++],S=i[e++];let E=i[e++],A=i[e++];const M=i[e++],T=!i[e++],C=_>S?_:S,I=Math.abs(_-S)>.001;let D=E+A,L=!1;if(d){const t=p[v++];y+t>x&&(D=E+A*(x-y)/t,L=!0),y+=t}if(I&&"function"==typeof t.ellipse?t.ellipse(r,w,_,S,M,E,D,T):t.arc(r,w,C,E,D,T),L)break t;f&&(a=r+Math.cos(E)*_,o=w+Math.sin(E)*S),h=Math.cos(D)*_+r,l=Math.sin(D)*S+w;break;case on:a=h=i[e],o=l=i[e+1],u=i[e++],c=i[e++];const B=i[e++],P=i[e++];if(d){const e=p[v++];if(y+e>x){let e=x-y;t.moveTo(u,c),t.lineTo(u+Math.min(B,e),c),e-=B,e>0&&t.lineTo(u+B,c+Math.min(P,e)),e-=P,e>0&&t.lineTo(u+Math.max(B-e,0),c+P),e-=B,e>0&&t.lineTo(u,c+Math.max(P-e,0));break t}y+=e}t.rect(u,c,B,P);break;case an:if(d){const e=p[v++];if(y+e>x){const i=(x-y)/e;t.lineTo(h*(1-i)+a*i,l*(1-i)+o*i);break t}y+=e}t.closePath(),h=a,l=o}}}_calculateLength(){let t=0;if(!this.data||!this._len)return t;const e=this.data,i=this._len,n=this._ux,s=this._uy;let r=0,a=0,o=0,h=0;this._pathSegLen||(this._pathSegLen=[]);const l=this._pathSegLen;let u=0;for(let c=0;c<i;){const d=e[c++],p=1===c;p&&(r=o=e[c],a=h=e[c+1]);let f=-1;switch(d){case 1:r=o=e[c++],a=h=e[c++];break;case 2:{const t=e[c++],r=e[c++],a=t-o,l=r-h;(Math.abs(a)>n||Math.abs(l)>s||c==i-1)&&(f=Math.sqrt(a*a+l*l),o=t,h=r);break}case 3:{const t=e[c++],i=e[c++],n=e[c++],s=e[c++],r=e[c++],a=e[c++];f=Ye(o,h,t,i,n,s,r,a,10),o=r,h=a;break}case 4:{const t=e[c++],i=e[c++],n=e[c++],s=e[c++];f=Ze(o,h,t,i,n,s,10),o=n,h=s;break}case 5:{const t=e[c++],i=e[c++],n=e[c++],s=e[c++],l=e[c++];let u=e[c++];const d=l+u;c+=1,p&&(r=t+Math.cos(l)*n,a=i+Math.sin(l)*s),f=Math.max(n,s)*Math.min(Math.abs(u),2*Qe),o=Math.cos(d)*n+t,h=Math.sin(d)*s+i;break}case on:r=o=e[c++],a=h=e[c++],f=2*(e[c++]+e[c++]);break;case an:{const t=r-o,e=a-h;f=Math.sqrt(t*t+e*e),o=r,h=a;break}}f>=0&&(l[u++]=f,t+=1)}return this._pathLen=t,t}computeBoundingBox(t=new ai){if(t.makeEmpty(),un.makeEmpty(),!this.data||!this._len)return t;const e=this.data;let i=0,n=0,s=0,r=0,a=0;for(a=0;a<this._len;){const o=e[a++],h=1===a;switch(h&&(i=s=e[a],n=r=e[a+1]),o){case 1:i=s=e[a++],n=r=e[a++],un.setFromXYXY(i,n,i,n);break;case 2:t.expandByXY(s,r),t.expandByXY(e[a],e[a+1]),s=e[a++],r=e[a++];break;case 3:t.expandByCubic(s,r,e[a++],e[a++],e[a++],e[a++],e[a],e[a+1]),s=e[a++],r=e[a++];break;case 4:t.expandByQuadratic(s,r,e[a++],e[a++],e[a],e[a+1]),s=e[a++],r=e[a++];break;case 5:const o=e[a++],l=e[a++],u=Math.abs(e[a++]),c=Math.abs(e[a++]);let d=e[a++],p=e[a++]+d;a+=1;const f=!e[a++];h&&(i=o+Math.cos(d)*u,n=l+Math.sin(d)*c),t.expandByArc(o,l,u,c,d,p,f),s=Math.cos(p)*u+o,r=Math.sin(p)*c+l;break;case on:i=s=e[a++],n=r=e[a++];const m=e[a++],g=e[a++];t.expandByXY(i,n),t.expandByXY(i+m,n+g);break;case hn:{const i=e[a++],n=e[a++],s=Math.abs(e[a++]),r=Math.abs(e[a++]),o=e[a++];let h=e[a++],l=e[a++];const u=!!e[a++];t.expandByEllipse(i,n,s,r,o,h,l,u);break}case an:s=i,r=n}t.expandByBox(un)}return t}applyMatrix3(t){if(!this.data||!this._len)return this;const e=this.data,i=this._len;let n=0;for(t.getScale(yn);n<i;)switch(e[n++]){case 1:case 2:gn.set(e[n],e[n+1]).applyMatrix3(t),e[n]=gn.x,e[n+1]=gn.y,n+=2;break;case 3:for(let i=0;i<3;i++)gn.set(e[n+2*i],e[n+2*i+1]).applyMatrix3(t),e[n+2*i]=gn.x,e[n+2*i+1]=gn.y;n+=6;break;case 4:for(let i=0;i<2;i++)gn.set(e[n+2*i],e[n+2*i+1]).applyMatrix3(t),e[n+2*i]=gn.x,e[n+2*i+1]=gn.y;n+=4;break;case 5:gn.set(e[n],e[n+1]).applyMatrix3(t),e[n+5]=gn.x,e[n+6]=gn.y,e[n]*=yn.x,e[n+1]*=yn.y,n+=7;break;case on:gn.set(e[n],e[n+1]).applyMatrix3(t),e[n]=gn.x,e[n+1]=gn.y,e[n+2]*=yn.x,e[n+3]*=yn.y,n+=4;break;case hn:gn.set(e[n],e[n+1]).applyMatrix3(t);let i=[e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]];t.isTransformSkewed()?Sn([e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]],t,i):En([e[n],e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6],e[n+7]],t,i),e[n]=gn.x,e[n+1]=gn.y,e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],n+=8}return this.needsUpdate=!0,this}_pendingLine(){var t;this._ppl>0&&(null==(t=this._ctx)||t.lineTo(this._ppx,this._ppy),this._ppl=0)}beginPath(){var t;return null==(t=this._ctx)||t.beginPath(),this.reset(),this}moveTo(t,e){var i;return this._pendingLine(),this.addData(1,t,e),null==(i=this._ctx)||i.moveTo(t,e),this._x0=this._xi=t,this._y0=this._yi=e,this}lineTo(t,e){var i;const n=Math.abs(t-this._xi),s=Math.abs(e-this._yi);if(this.addData(2,t,e),n>this._ux||s>this._uy)null==(i=this._ctx)||i.lineTo(t,e),this._xi=t,this._yi=e,this._ppl=0;else{const i=n*n+s*s;i>this._ppl&&(this._ppx=t,this._ppy=e,this._ppl=i)}return this}bezierCurveTo(t,e,i,n,s,r){var a;return this._pendingLine(),this.addData(3,t,e,i,n,s,r),null==(a=this._ctx)||a.bezierCurveTo(t,e,i,n,s,r),this._xi=s,this._yi=r,this}quadraticCurveTo(t,e,i,n){var s;return this._pendingLine(),this.addData(4,t,e,i,n),null==(s=this._ctx)||s.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this}arc(t,e,i,n,s,r){var a;this._pendingLine(),pn[0]=n,pn[1]=s,ei(pn,!!r),n=pn[0];const o=(s=pn[1])-n;return this.addData(5,t,e,i,i,n,o,0,r?0:1),null==(a=this._ctx)||a.arc(t,e,i,n,s,r),this._xi=t+Math.cos(s)*i,this._yi=e+Math.sin(s)*i,this}arcTo(t,e,i,n,s){var r;return this._pendingLine(),null==(r=this._ctx)||r.arcTo(t,e,i,n,s),this}rect(t,e,i,n){var s;return this._pendingLine(),this.addData(on,t,e,i,n),null==(s=this._ctx)||s.rect(t,e,i,n),this}closePath(){var t;return this._pendingLine(),this.addData(an),null==(t=this._ctx)||t.closePath(),this._xi=this._x0,this._yi=this._y0,this}ellipse(t,e,i,n,s,r,a,o){var h;return this._pendingLine(),this.addData(hn,t,e,i,n,s,r,a,o?1:0),null==(h=this._ctx)||h.ellipse(t,e,i,n,s,r,a,o),this}absellipse(t,e,i,n,s,r,a,o=!1){return this._pendingLine(),this.addData(hn,t,e,i,n,s,r,a,o?1:0),this}absarc(t,e,i,n,s,r=!1){return this.absellipse(t,e,i,i,0,n,s,r),this}fill(t){t.fill(),this.toStatic()}stroke(t){this._pendingLine(),t.stroke(),this.toStatic()}addArrow(t,e,i=30){if(!t||!e)return this;const n=this.getVertices();return!(null==n?void 0:n.length)||n.length<4||(t>0?(fn.set(n[2],n[3]),gn.set(n[0],n[1]),mn.subVectors(fn,gn),yn.lerpVectors(gn,fn,e/mn.length()),vn.copy(yn).rotateAround(gn,Ie(i)),xn.copy(yn).rotateAround(gn,-Ie(i)),this.moveTo(vn.x,vn.y),this.lineTo(gn.x,gn.y),this.lineTo(xn.x,xn.y)):(fn.set(n[n.length-4],n[n.length-3]),gn.set(n[n.length-2],n[n.length-1]),mn.subVectors(fn,gn),yn.lerpVectors(gn,fn,e/mn.length()),vn.copy(yn).rotateAround(gn,Ie(i)),xn.copy(yn).rotateAround(gn,-Ie(i)),this.moveTo(vn.x,vn.y),this.lineTo(gn.x,gn.y),this.lineTo(xn.x,xn.y))),this}getVertices(t=[]){if(!this.data||!this._len)return t;const e=this.data;for(let i=0;i<this._len;){const n=e[i++];switch(n){case 1:case 2:t.push(e[i++],e[i++]);break;case 3:i+=4,t.push(e[i++],e[i++]);break;case 4:i+=2,t.push(e[i++],e[i++]);break;case 5:const s=e[i++],r=e[i++],a=e[i++],o=e[i++],h=e[i++],l=e[i++]+h;i+=2;const u=s+Math.cos(h)*a,c=r+Math.sin(h)*o;t.push(u,c);const d=s+Math.cos(l)*a,p=r+Math.sin(l)*o;t.push(d,p);break;case on:const f=e[i++],m=e[i++],g=e[i++],y=e[i++];t.push(f,m,f+g,m,f+g,m+y,f,m+y);break;case hn:const v=e[i++],x=e[i++],b=e[i++],w=e[i++];e[i++];const _=e[i++],S=e[i++];e[i++];const E=v+b*Math.cos(_),A=x+w*Math.sin(_);t.push(E,A);const M=v+b*Math.cos(S),T=x+w*Math.sin(S);t.push(M,T);break;case an:break;default:throw new Error("Invalid command "+n)}}return t}getCmds(){var t;if(!(null==(t=this.data)?void 0:t.length))throw new Error("PathProxy.getCmds: empty path.data.");const e=this.data,i=[];let n=0;for(n=0;n<e.length;)switch(e[n++]){case 1:i.push([1,e[n++],e[n++]]);break;case 2:i.push([2,e[n++],e[n++]]);break;case 3:i.push([3,e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]]);break;case 4:i.push([4,e[n++],e[n++],e[n++],e[n++]]);break;case 5:i.push([5,e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]]);break;case on:i.push([on,e[n++],e[n++],e[n++],e[n++]]);break;case hn:i.push([hn,e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]]);break;case an:i.push([an])}return i}getControlPoints(t=[]){if(t.length=0,!this.data||!this._len)return t;const e=this.data;let i=0,n=0,s=0;for(i=0;i<this._len;)switch(e[i++]){case 1:n=e[i],s=e[i+1],i+=2,t.push(new Fe(n,s));break;case 2:{const r=e[i++],a=e[i++];t.push(new Fe(r,a)),n=r,s=a;break}case 3:{const r=n,a=s,o=e[i++],h=e[i++],l=e[i++],u=e[i++],c=e[i++],d=e[i++];t.push(new Fe(r,a)),t.push(new Fe(o,h)),t.push(new Fe(l,u)),t.push(new Fe(c,d)),n=c,s=d;break}case 4:{const r=n,a=s,o=e[i++],h=e[i++],l=e[i++],u=e[i++];t.push(new Fe(r,a)),t.push(new Fe(o,h)),t.push(new Fe(l,u)),n=l,s=u;break}case 5:{const r=e[i++],a=e[i++],o=e[i++],h=e[i++],l=e[i++],u=e[i++];e[i++],e[i++];const c=l+u,d=r+Math.cos(l)*o,p=a+Math.sin(l)*h;t.push(new Fe(d,p));const f=r+Math.cos(c)*o,m=a+Math.sin(c)*h;t.push(new Fe(f,m)),t.push(new Fe(r,a)),n=f,s=m;break}case on:{const r=e[i++],a=e[i++],o=e[i++],h=e[i++];t.push(new Fe(r,a)),t.push(new Fe(r+o,a)),t.push(new Fe(r+o,a+h)),t.push(new Fe(r,a+h)),n=r,s=a;break}case hn:{const r=e[i++],a=e[i++],o=e[i++],h=e[i++];t.push(new Fe(r,a)),o>h?(t.push(new Fe(r+o,a)),t.push(new Fe(r,a+h)),o!==h&&(t.push(new Fe(r-o,a)),t.push(new Fe(r,a-h)))):h>o?(t.push(new Fe(r+o,a)),t.push(new Fe(r,a+h)),t.push(new Fe(r-o,a)),t.push(new Fe(r,a-h))):t.push(new Fe(r+o,a)),n=r,s=a;break}}return t}getStartPoint(t=new Fe){return t.set(this._x0,this._y0)}getEndPoint(t=new Fe){return t.set(this._xi,this._yi)}}const un=new ai,cn=[],dn=[],pn=[],fn=new Fe,mn=new Fe,gn=new Fe,yn=new Fe,vn=new Fe,xn=new Fe,bn=new Hi,wn=new Hi,_n=new Hi;function Sn(t,e,i=[0,0,0,0,0,0,0,0]){const[n,s,r,a,o,h,l,u]=t;i[0]=n,i[1]=s;const c=Math.cos(o),d=Math.sin(o);gn.set(r*c,r*d).applyMatrix3(e),yn.set(-a*d,a*c).applyMatrix3(e);const p=bn.set(gn.x,yn.x,0,gn.y,yn.y,0,0,0,1),f=wn.copy(p).invert(),m=_n.copy(f).transpose().multiply(f).elements,g=function(t,e,i){let n,s,r,a,o=0;const h=t+i,l=t-i,u=Math.sqrt(l*l+4*e*e);return h>0?(o=.5*(h+u),a=1/o,n=t*a*i-e*a*e):h<0?n=.5*(h-u):(o=.5*u,n=-.5*u),s=l>0?l+u:l-u,Math.abs(s)>2*Math.abs(e)?(a=-2*e/s,r=1/Math.sqrt(1+a*a),s=a*r):0===Math.abs(e)?(s=1,r=0):(a=-.5*s/e,s=1/Math.sqrt(1+a*a),r=a*s),l>0&&(a=s,s=-r,r=a),{rt1:o,rt2:n,cs:s,sn:r}}(m[0],m[1],m[4]),y=Math.sqrt(g.rt1),v=Math.sqrt(g.rt2);if(i[2]=1/y,i[3]=1/v,i[4]=Math.atan2(g.sn,g.cs),!((l-h)%(2*Math.PI)<Number.EPSILON)){const t=wn.set(y,0,0,0,v,0,0,0,1),n=_n.set(g.cs,g.sn,0,-g.sn,g.cs,0,0,0,1),s=t.multiply(n).multiply(p),r=t=>{const{x:e,y:i}=new Fe(Math.cos(t),Math.sin(t)).applyMatrix3(s);return Math.atan2(i,e)};i[5]=r(h),i[6]=r(l),e.isTransformFlipped()&&(i[7]=u?0:1)}return i}function En(t,e,i=[0,0,0,0,0,0,0,0]){const[n,s,r,a,o,h,l,u]=t;i[0]=n,i[1]=s;const c=e.getTransformScaleX(),d=e.getTransformScaleY();i[2]=r*c,i[3]=a*d;const p=c>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);return i[4]=o+p,e.isTransformFlipped()&&(i[5]=-1*h,i[6]=-1*l,i[7]=u?0:1),i}class An{static destroy(){this.cached.clear(),this.cachedCanvas.clear()}static createCanvas(t){var e;if(!(null==(e=Me.window)?void 0:e.document))throw new Error("environment not support");let i,n;if(t.containerId&&(i=Me.window.document.getElementById(t.containerId)),i||(i=Me.window.document.getElementsByTagName("body")[0]),t.canvasId&&(n=Me.window.document.getElementById(t.canvasId)||void 0),t.width||(t.width=(null==i?void 0:i.offsetWidth)||100),t.height||(t.height=(null==i?void 0:i.offsetHeight)||100),t.dpr||(t.dpr=Me.config.dpr),n)this.resizeCanvas(n,t.width,t.height,t.dpr);else{if(n=this.createHtmlCanvas(t.width,t.height,t.dpr),!n)throw new Error("error environment");t.canvasId&&n.setAttribute("id",t.canvasId),null==i||i.appendChild(n)}return n.style.background=t.background||"transparent",n}static getContext2D(t,e={}){const i={alpha:!0,willReadFrequently:!!e.willReadFrequently},n=t.getContext("2d",i);if(!n)throw new Error("getContext2D error");return n.scale(e.dpr||1,e.dpr||1),n}static resizeCanvas(t,e,i,n=1){t instanceof OffscreenCanvas?(t.width=e,t.height=i):t instanceof HTMLCanvasElement&&(t.setAttribute("width",(e*n).toString()),t.setAttribute("height",(i*n).toString()),t.style.width=e+"px",t.style.height=i+"px",t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.imageRendering="pixelated",t.style.transform="translateZ(0)")}static getImageBitmapByCanvasAsync(t){return p(this,null,(function*(){if(t)return t instanceof OffscreenCanvas?t.transferToImageBitmap():t instanceof HTMLCanvasElement?yield createImageBitmap(t):void 0}))}static get(t,e,i,n=1){let s=this.cached.get(t);return s||(s=this.create(e,i,n),this.set(t,s)),this.resizeCanvas(s,e,i,n),s}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e)}static remove(t){this.cached.has(t)&&this.cached.delete(t)}static create(t,e,i=1){var n;if(null==(n=Me.window)?void 0:n.OffscreenCanvas)return new OffscreenCanvas(t,e);throw new Error("environment does not support")}static createHtmlCanvas(t,e,i=1){if(!Me.window.document)throw new Error("environment does not support");const n=Me.window.document.createElement("canvas");return this.resizeCanvas(n,t,e,i),n}static measureText(t,e,i=new Fe){if(!t)throw new Error("input error");const n=this.get("measureText",1,1).getContext("2d");if(!n)throw new Error("bufferCtx not found");e.render(n);const s=n.measureText(t);if(!s)throw new Error("measureText error");const r=s.actualBoundingBoxRight+s.actualBoundingBoxLeft,a=s.actualBoundingBoxAscent+s.actualBoundingBoxDescent;return i.set(r,a),i}static measureText2(t,e=12,i=new Fe){if(!t)throw new Error("input error");const n=this.get("measureText",1,1).getContext("2d");if(!n)throw new Error("bufferCtx not found");n.font=`${e}px sans-serif`;const s=n.measureText(t);if(!s)throw new Error("measureText error");const r=s.actualBoundingBoxRight+s.actualBoundingBoxLeft,a=s.actualBoundingBoxAscent+s.actualBoundingBoxDescent;return i.set(r,a),i}static getCtx(t,e,i,n=1){if(!Mn[t]){const s=this.create(e,i,n);Mn[t]={cvs:s,ctx:s.getContext("2d")},this.resizeCanvas(s,e,i,n)}return Mn[t].ctx}}d(An,"cached",new Map),d(An,"cachedCanvas",new Map);const Mn={};class Tn{constructor(){d(this,"instancedMesh",!1),d(this,"_xml"),d(this,"_symbolsNodeMap",{}),d(this,"paths",[]),d(this,"labels",[]),d(this,"symbolsMap",{}),d(this,"instances",[]),d(this,"_viewBox",new ai),d(this,"_isInDefs",!1),d(this,"_transformStack",[]),d(this,"_currentTransform",new Hi),d(this,"centralInitialized",!1),d(this,"centralPoint",new Fe),d(this,"defaultUnit","px"),d(this,"defaultDPI",90),d(this,"stylesheets",{}),d(this,"float2Int",!0),d(this,"scaleFactor",1),d(this,"ASSET_TYPES",[])}static createSVG(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.setAttribute("width",t.toString()),i.setAttribute("height",e.toString()),i}static createSVGPath(t){const e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("d",t),e}static createSVGText(t,e,i){const n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x",e.toString()),n.setAttribute("y",i.toString()),n.textContent=t,n}static getInstance(){return Cn}static setInstancedMesh(t){return this.getInstance().setInstancedMesh(t)}static parse(t,e={}){return this.getInstance().parse(t,e)}static getBoundingBoxByNode(t,e=new ai){if(e.makeEmpty(),!t)return e;if("text"===t.nodeName){if("function"==typeof t.getBBox){const i=t.getBBox();e.min.set(i.x,i.y),e.max.set(i.x+i.width,i.y+i.height)}const i=t.textContent||"",n=parseInt(t.getAttribute("font-size")||"12");return An.measureText2(i,n,zn),zn.validate()&&(e.getCenter(Hn),e.min.setY(Hn.y-zn.y/2),e.max.setY(Hn.y+zn.y/2)),this.parseNodeTransform(t,Pn),parseInt(t.getAttribute("stroke-width")||"0"),e.applyMatrix3(Pn),e}const i=Tn.getInstance().parseNode(t);if(!i.length)return e;for(let t=0,n=i.length;t<n;t++)i[t].computeBoundingBox(Fn),e.union(Fn);return e}static parseNodeTransform(t,e){return Tn.getInstance().parseNodeTransform(t,void 0,e)}static getSvgPathDByData(t){if(!t||0===t.length)return"";const e=Array.isArray(t)?t:Array.from(t);let i="",n=0;for(;n<e.length;)switch(e[n++]){case 1:i+=`M${e[n++]} ${e[n++]}`;break;case 2:i+=`L${e[n++]} ${e[n++]}`;break;case 3:i+=`C${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]}`;break;case 4:i+=`Q${e[n++]} ${e[n++]} ${e[n++]} ${e[n++]}`;break;case 5:const t=e[n++],s=e[n++],r=e[n++],a=e[n++],o=e[n++],h=e[n++],l=e[n++],u=e[n++],c=t+Math.cos(o+h)*r,d=s+Math.sin(o+h)*a;i+=`A${r} ${a} ${l} ${Math.abs(h)>Math.PI?1:0} ${u?0:1} ${c} ${d}`;break;case on:const p=e[n++],f=e[n++],m=e[n++],g=e[n++];i+=`M${p} ${f} L${p+m} ${f} L${p+m} ${f+g} L${p} ${f+g} Z`;break;case hn:const y=e[n++],v=e[n++],x=e[n++],b=e[n++],w=e[n++],_=e[n++],S=e[n++],E=e[n++],A=y+Math.cos(_)*x,M=v+Math.sin(_)*b,T=y+Math.cos(S)*x,C=v+Math.sin(S)*b;i+=`M${A} ${M} A${x} ${b} ${w} ${Math.abs(S-_)>Math.PI?1:0} ${E?0:1} ${T} ${C}`;break;case an:i+="Z"}return i}static getPathProxyBySvgPathD(t,e){return Tn.getInstance().getPathProxyBySvgPathD(t,e)}setInstancedMesh(t){return this.instancedMesh=t,this}dispose(){this._xml=void 0,this._symbolsNodeMap={},this.paths=[],this.labels=[],this.symbolsMap={},this.instances=[],this._viewBox.makeEmpty(),this._isInDefs=!1,this._transformStack=[],this._currentTransform.identity(),this.centralPoint.identity(),this.centralInitialized=!1,this.stylesheets={},this.ASSET_TYPES=[]}parse(t,e={}){var i;this.dispose();const n=(new DOMParser).parseFromString(t,"image/svg+xml");this._xml=n.documentElement,Un((null==(i=this._xml)?void 0:i.getAttribute("viewBox"))||"",this._viewBox),this._viewBox.getCenter(this.centralPoint);const s=en(this._xml),r=function(t,e=[]){return e.length=0,nn(t||[],(t=>{var i;if("assets"===t.label&&(null==(i=t.children)?void 0:i.length))for(let i,n=0,s=t.children.length;n<s;n++)i=t.children[n],i.label&&e.push(ri.head(ri.split(i.label,"-"))||"")})),e=ri.uniq(ri.compact(e))}(s);this.ASSET_TYPES=ri.uniq(ri.compact([...r,...Object.values(Ti)])),this.parseNode(this._xml,e,this.paths);const a={xml:this._xml,viewBox:this._viewBox.clone(),idsTree:s,assetTypes:r,paths:this.paths,labels:this.labels};return this.instancedMesh&&(a.symbolsMap=this.symbolsMap,a.instances=this.instances),a}getViewBox(t,e=new ai){let i=((null==t?void 0:t.getAttribute("viewBox"))||"").split(" "),n=ri.map(i,(t=>parseFloat(t)));return 4!==(null==n?void 0:n.length)||(e.min.set(n[0],n[1]),e.max.set(n[0]+n[2],n[1]+n[3])),e}parseNode(t,e={},i=[],n,s){var r,a,o;if(1!==t.nodeType)return i;let h=!1;const l="function"==typeof t.getAttribute?t.getAttribute("id"):null,u=this.getNodeTransform(t,e);let c;const d=(t={},e,i)=>{if(!t)return;const s=(null==i?void 0:i.assetType)||this.getAssetType(e),r=(null==i?void 0:i.layerType)||this.getAssetType(e,"layer");return ri.set(t,"userData",{pid:n,id:l||n,nodeName:e.nodeName,layerType:r,assetType:s,style:Object.assign({},i)}),t};switch(t.nodeName){case"svg":case"g":e=this.parseStyle(t,e);break;case"defs":h=!0,this._isInDefs=!0;break;case"style":this.parseCSSStylesheetByTextContent(t);break;case"symbol":if(!l||!this._isInDefs&&this.symbolsMap[l]){if(!this._isInDefs&&l){const t=this.symbolsMap[l],e=(null==t?void 0:t.paths)||[];for(let n=0,s=(null==e?void 0:e.length)||0;n<s;n++)c=e[n],c&&(c=c.clone(),ri.set(c,"userData",Object.assign({},t.userData)),this.transformPath(c,this._currentTransform),i.push(c));return u&&(this._transformStack.pop(),this._transformStack.length>0?this._currentTransform.copy(this._transformStack[this._transformStack.length-1]):this._currentTransform.identity()),i}}else e=this.parseStyle(t,e),this._symbolsNodeMap[l]=t,ri.set(this.symbolsMap,`[${l}].symbolId`,l),ri.set(this.symbolsMap,`[${l}].style`,e);break;case"use":const p=(t.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),f=this._symbolsNodeMap[p],m=this.symbolsMap[p];if(f&&(e=this.parseStyle(f,e)),void 0===(e=this.parseStyle(t,e)).assetType&&(e.assetType=this.getAssetType(t)),void 0===e.layerType&&(e.layerType=this.getAssetType(t,"layer")),!this._isInDefs&&this.instancedMesh&&m){const i={symbolId:p,transform:this._currentTransform.clone(),userData:{}};d(i,t,e),this.instances.push(i)}else f&&(d(m,t,e),this.parseNode(f,e,i,l||n,s));break;case"path":e=this.parseStyle(t,e),t.hasAttribute("d")&&(c=this.parsePathNode(t,s));break;case"rect":e=this.parseStyle(t,e),c=this.parseRectNode(t,s);break;case"polygon":e=this.parseStyle(t,e),c=this.parsePolygonNode(t,s);break;case"polyline":e=this.parseStyle(t,e),c=this.parsePolylineNode(t,s);break;case"circle":e=this.parseStyle(t,e),c=this.parseCircleNode(t,s);break;case"ellipse":e=this.parseStyle(t,e),c=this.parseEllipseNode(t,s);break;case"line":e=this.parseStyle(t,e),c=this.parseLineNode(t,s);break;case"text":e=this.parseStyle(t,e);const g=this.parseTextNode(t,e,s);if(!g)return i;d(g,t,e),n||ri.set(g,"userData.pid",this.getId(t)),ri.set(g,"userData.textContent",t.textContent),ri.set(g,"transform",this._currentTransform.clone()),ri.set(g,"userData.id",ri.get(g,"userData.id")),ri.set(g,"userData.pid",this.getParentId(t,n));const y=this.getLabelAssetId(t);if(y?ri.set(g,"userData.aid",y):ri.set(g,"userData.aid",ri.split((null==(r=null==g?void 0:g.userData)?void 0:r.id)||"","-").splice(2).join("-")),this._isInDefs&&this.symbolsMap[null==(a=g.userData)?void 0:a.pid]){const t=g.userData.pid,e=(null==(o=this.symbolsMap[t])?void 0:o.labels)||[];e.push(g),ri.set(this.symbolsMap,`[${t}].labels`,e)}else this.labels.push(g)}c&&(d(c,t,e),this.transformPath(c,this._currentTransform),i.push(c));const p=t.childNodes;for(let t,n=0,r=p.length;n<r;n++)if(t=p[n],!h||"style"===t.nodeName||"symbol"===t.nodeName)if(this._isInDefs&&"symbol"===t.nodeName){const i=t.getAttribute("id");if(i){const n=this.parseNode(t,e);ri.set(this.symbolsMap,`[${i}].paths`,n)}}else this.parseNode(t,e,i,l,s);return u&&(this._transformStack.pop(),this._transformStack.length>0?this._currentTransform.copy(this._transformStack[this._transformStack.length-1]):this._currentTransform.identity()),h&&(this._isInDefs=!1),i}transformPath(t,e){t.applyMatrix3(e)}getNodeTransform(t,e){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))||"text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))))return null;const i=this.parseNodeTransform(t,e);return this._transformStack.length>0&&i.premultiply(this._transformStack[this._transformStack.length-1]),this._currentTransform.copy(i),this._transformStack.push(i),i}parseNodeTransform(t,e,i=new Hi){var n;i.identity(),this.centralInitialized&&(i.translate(-this.centralPoint.x,-this.centralPoint.y),this.centralInitialized=!0);const s=kn;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){const e=this.parseFloatWithUnits(t.getAttribute("x")),n=this.parseFloatWithUnits(t.getAttribute("y"));i.translate(e,n)}else if("text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))){const n=t.hasAttribute("dx")?this.parseFloatWithUnits(t.getAttribute("dx")||0,{fontSize:null==e?void 0:e.fontSize}):0,s=t.hasAttribute("dy")?this.parseFloatWithUnits(t.getAttribute("dy")||0,{fontSize:null==e?void 0:e.fontSize}):0;i.translate(n,s)}if(t.hasAttribute("transform")){const e=null==(n=t.getAttribute("transform"))?void 0:n.split(")");if(!(null==e?void 0:e.length))return i;for(let t=((null==e?void 0:e.length)||0)-1;t>=0;t--){const n=e[t].trim();if(""===n)continue;const r=n.indexOf("("),a=n.length;if(r>0&&r<a){const t=n.slice(0,r),e=this.parseFloats(n.slice(r+1));switch(s.identity(),t){case"translate":if(e.length>=1){const t=e[0];let i=0;e.length>=2&&(i=e[1]),s.translate(t,i)}break;case"rotate":if(e.length>=1){let t=0,i=0,n=0;t=e[0]*Math.PI/180,e.length>=3&&(i=e[1],n=e[2]),Nn.makeTranslation(-i,-n),On.makeRotation(t),Rn.multiplyMatrices(On,Nn),Nn.makeTranslation(i,n),s.multiplyMatrices(Nn,Rn)}break;case"scale":if(e.length>=1){const t=e[0];let i=t;e.length>=2&&(i=e[1]),s.scale(t,i)}break;case"skewX":1===e.length&&s.set(1,Math.tan(e[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===e.length&&s.set(1,0,0,Math.tan(e[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===e.length&&s.set(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}}i.premultiply(s)}}return i}parseStyle(t,e){var i;e=Object.assign({},e);let n={};if(t.hasAttribute("class")){const e=null==(i=t.getAttribute("class"))?void 0:i.split(/\s/).filter(Boolean).map((t=>t.trim())).map((t=>t.startsWith(".")?t.substring(1):t));for(let t=0,i=(null==e?void 0:e.length)||0;t<i;t++)n=Object.assign(n,this.stylesheets["."+e[t]])}function s(i,s,r){void 0===r&&(r=function(t){return t.startsWith("url"),t}),t.hasAttribute(i)&&(e[s]=r(t.getAttribute(i))),n[i]&&(e[s]=r(n[i])),t.style&&""!==t.style[i]&&(e[s]=r(t.style[i]))}t.hasAttribute("id")&&(n=Object.assign(n,this.stylesheets["#"+t.getAttribute("id")]));const{fontSize:r,strokeWidth:a}=e,o=this;function h(t){return Math.max(0,Math.min(1,o.parseFloatWithUnits(t)))}function l(t){return Math.max(0,o.parseFloatWithUnits(t,{fontSize:r}))}s("font-size","fontSize",l),s("fill","fill"),s("fill-opacity","fillOpacity",h),s("fill-rule","fillRule"),s("opacity","opacity",h),s("stroke","stroke"),s("stroke-opacity","strokeOpacity",h),s("stroke-width","strokeWidth",(function(t){return Math.max(0,o.parseFloatWithUnits(t,{strokeWidth:a,noDef:!0}))})),s("stroke-linejoin","strokeLineJoin"),s("stroke-linecap","strokeLineCap"),s("stroke-miterlimit","strokeMiterLimit",l),s("visibility","visibility");const u=t.getAttribute("stroke-width")||e.strokeWidth;return ri.endsWith(u,"%")&&(e.thinLine=!0),"none"!==e.fill&&"transparent"!==e.fill||delete e.fill,"none"!==e.stroke&&"transparent"!==e.stroke||delete e.stroke,e}parseCSSStylesheetByTextContent(t){const e=t.textContent.replace(/\/\*[\s\S]*?\*\//g,"").replace(/([^;])}/g,"$1;}"),i=[];let n="",s=0;for(const t of e)"{"===t?s++:"}"===t&&s--,n+=t,"}"===t&&0===s&&(i.push(n.trim()),n="");for(const t of i){if(!t.includes("{"))continue;const[e,i]=t.split(/\s*\{\s*/);if(!e||!i)continue;const n=e.split(",").map((t=>t.trim())).filter(Boolean),s={};i.replace(/}\s*$/,"").split(";").map((t=>t.trim())).filter(Boolean).forEach((t=>{const[e,i]=t.split(/:\s*/);if(e&&i){const t=i.replace(/\s*!important\s*$/,"").trim();s[e.trim()]=t}})),n.forEach((t=>{t&&(this.stylesheets[t]=u(u({},this.stylesheets[t]||{}),s))}))}}parsePathNode(t,e=!1){const i=t.getAttribute("d");if(i&&""!==i&&"none"!==i)return this.getPathProxyBySvgPathD(i,void 0,e)}getPathProxyBySvgPathD(t,e=new ln,i=!1){if(!t)return;const n=new Fe,s=new Fe,r=new Fe;let a=!0,o=!1;const h=t.match(/[a-df-z][^a-df-z]*/gi);if(null==h?void 0:h.length){for(let t=0,l=(null==h?void 0:h.length)||0;t<l;t++){const l=h[t],u=l.charAt(0),c=l.slice(1).trim();let d;switch(!0===a&&(o=!0,a=!1),u){case"M":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x=i?d[t]:this.normalizeX(d[t]),n.y=i?d[t+1]:this.normalizeY(d[t+1]),s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&r.copy(n);break;case"H":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.x=i?d[t]:this.normalizeX(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"V":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.y=i?d[t]:this.normalizeY(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"L":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x=i?d[t]:this.normalizeX(d[t]),n.y=i?d[t+1]:this.normalizeY(d[t+1]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"C":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=6)t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),this.normalizeX(d[a+2]),this.normalizeY(d[a+3]),this.normalizeX(d[a+4]),this.normalizeY(d[a+5])],e.bezierCurveTo(...t),s.x=t[2],s.y=t[3],n.x=t[4],n.y=t[5],0===a&&!0===o&&r.copy(n);break;case"S":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),this.normalizeX(d[a+2]),this.normalizeY(d[a+3])],e.bezierCurveTo(this.getReflection(n.x,s.x),this.getReflection(n.y,s.y),t[0],t[1],t[2],t[3]),s.x=t[0],s.y=t[1],n.x=t[2],n.y=t[3],0===a&&!0===o&&r.copy(n);break;case"Q":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),this.normalizeX(d[a+2]),this.normalizeY(d[a+3])],e.quadraticCurveTo(t[0],t[1],t[2],t[3]),s.x=t[0],s.y=t[1],n.x=t[2],n.y=t[3],0===a&&!0===o&&r.copy(n);break;case"T":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=2){const h=this.getReflection(n.x,s.x),l=this.getReflection(n.y,s.y);t=i?[d[a],d[a+1]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1])],e.quadraticCurveTo(h,l,t[0],t[1]),s.x=h,s.y=l,n.x=t[0],n.y=t[1],0===a&&!0===o&&r.copy(n)}break;case"A":d=this.parseFloats(c,[3,4],7);for(let t,a=0,h=d.length;a<h;a+=7){if(t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5],d[a+6]]:[this.normalizeX(d[a]),this.normalizeY(d[a+1]),d[a+2],d[a+3],d[a+4],this.normalizeW(d[a+5]),this.normalizeH(d[a+6])],t[5]==n.x&&t[6]==n.y)continue;const h=n.clone();n.x=t[5],n.y=t[6],s.x=n.x,s.y=n.y,this.parseArcCommand(e,t[a],t[1],t[2],t[3],t[4],h,n),0===a&&!0===o&&r.copy(n)}break;case"m":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x+=i?d[t]:this.normalizeW(d[t]),n.y+=i?d[t+1]:this.normalizeH(d[t+1]),s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&r.copy(n);break;case"h":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.x+=i?d[t]:this.normalizeW(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"v":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t++)n.y+=i?d[t]:this.normalizeH(d[t]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"l":d=this.parseFloats(c);for(let t=0,a=d.length;t<a;t+=2)n.x+=i?d[t]:this.normalizeW(d[t]),n.y+=i?d[t+1]:this.normalizeH(d[t+1]),s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===o&&r.copy(n);break;case"c":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=6)t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),this.normalizeW(d[a+2]),this.normalizeH(d[a+3]),this.normalizeW(d[a+4]),this.normalizeH(d[a+5])],e.bezierCurveTo(n.x+t[0],n.y+t[1],n.x+t[2],n.y+t[3],n.x+t[4],n.y+t[5]),s.x=n.x+t[2],s.y=n.y+t[3],n.x+=t[4],n.y+=t[5],0===a&&!0===o&&r.copy(n);break;case"s":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),this.normalizeW(d[a+2]),this.normalizeH(d[a+3])],e.bezierCurveTo(this.getReflection(n.x,s.x),this.getReflection(n.y,s.y),n.x+t[0],n.y+t[1],n.x+t[2],n.y+t[3]),s.x=n.x+t[0],s.y=n.y+t[1],n.x+=t[2],n.y+=t[3],0===a&&!0===o&&r.copy(n);break;case"q":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=4)t=i?[d[a],d[a+1],d[a+2],d[a+3]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),this.normalizeW(d[a+2]),this.normalizeH(d[a+3])],e.quadraticCurveTo(n.x+t[0],n.y+t[1],n.x+t[2],n.y+t[3]),s.x=n.x+t[0],s.y=n.y+t[1],n.x+=t[2],n.y+=t[3],0===a&&!0===o&&r.copy(n);break;case"t":d=this.parseFloats(c);for(let t,a=0,h=d.length;a<h;a+=2){const h=this.getReflection(n.x,s.x),l=this.getReflection(n.y,s.y);t=i?[d[a],d[a+1]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1])],e.quadraticCurveTo(h,l,n.x+t[0],n.y+t[1]),s.x=h,s.y=l,n.x=n.x+t[0],n.y=n.y+t[1],0===a&&!0===o&&r.copy(n)}break;case"a":d=this.parseFloats(c,[3,4],7);for(let t,a=0,h=d.length;a<h;a+=7){if(t=i?[d[a],d[a+1],d[a+2],d[a+3],d[a+4],d[a+5],d[a+6]]:[this.normalizeW(d[a]),this.normalizeH(d[a+1]),d[a+2],d[a+3],d[a+4],this.normalizeW(d[a+5]),this.normalizeH(d[a+6])],0==t[5]&&0==t[6])continue;const h=n.clone();n.x+=t[5],n.y+=t[6],s.x=n.x,s.y=n.y,this.parseArcCommand(e,t[0],t[1],t[2],t[3],t[4],h,n),0===a&&!0===o&&r.copy(n)}break;case"Z":case"z":e.closePath()}o=!1}return e}}parseArcCommand(t,e,i,n,s,r,a,o){if(0==e||0==i)return void t.lineTo(o.x,o.y);n=n*Math.PI/180,e=Math.abs(e),i=Math.abs(i);const h=(a.x-o.x)/2,l=(a.y-o.y)/2,u=Math.cos(n)*h+Math.sin(n)*l,c=-Math.sin(n)*h+Math.cos(n)*l;let d=e*e,p=i*i;const f=u*u,m=c*c,g=f/d+m/p;if(g>1){const t=Math.sqrt(g);d=(e*=t)*e,p=(i*=t)*i}const y=d*m+p*f,v=(d*p-y)/y;let x=Math.sqrt(Math.max(0,v));s===r&&(x=-x);const b=x*e*c/i,w=-x*i*u/e,_=Math.cos(n)*b-Math.sin(n)*w+(a.x+o.x)/2,S=Math.sin(n)*b+Math.cos(n)*w+(a.y+o.y)/2,E=this.svgAngle(1,0,(u-b)/e,(c-w)/i),A=this.svgAngle((u-b)/e,(c-w)/i,(-u-b)/e,(-c-w)/i)%(2*Math.PI);t.absellipse(_,S,e,i,n,E,E+A,0===r)}svgAngle(t,e,i,n){const s=t*i+e*n,r=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n);let a=Math.acos(Math.max(-1,Math.min(1,s/r)));return t*n-e*i<0&&(a=-a),a}parseRectNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("x")||0),n=this.parseFloatWithUnits(t.getAttribute("y")||0),s=this.parseFloatWithUnits(t.getAttribute("rx")||t.getAttribute("ry")||0),r=this.parseFloatWithUnits(t.getAttribute("ry")||t.getAttribute("rx")||0),a=this.parseFloatWithUnits(t.getAttribute("width")),o=this.parseFloatWithUnits(t.getAttribute("height"));e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeW(s),r=this.normalizeH(r),a=this.normalizeW(a),o=this.normalizeH(o));const h=.448084975506,l=new ln;return l.moveTo(i+s,n),l.lineTo(i+a-s,n),0===s&&0===r||l.bezierCurveTo(i+a-s*h,n,i+a,n+r*h,i+a,n+r),l.lineTo(i+a,n+o-r),0===s&&0===r||l.bezierCurveTo(i+a,n+o-r*h,i+a-s*h,n+o,i+a-s,n+o),l.lineTo(i+s,n+o),0===s&&0===r||l.bezierCurveTo(i+s*h,n+o,i,n+o-r*h,i,n+o-r),l.lineTo(i,n+r),0===s&&0===r||l.bezierCurveTo(i,n+r*h,i+s*h,n,i+s,n),l}parsePolygonNode(t,e=!1){var i;const n=this,s=new ln;let r=0;return null==(i=t.getAttribute("points"))||i.replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,i,a){const o=e?n.parseFloatWithUnits(i):n.normalizeX(n.parseFloatWithUnits(i)),h=e?n.parseFloatWithUnits(a):n.normalizeY(n.parseFloatWithUnits(a));return 0===r?s.moveTo(o,h):s.lineTo(o,h),r++,t})),s.autoClose=!0,s}parsePolylineNode(t,e=!1){var i;const n=this,s=new ln;let r=0;return null==(i=t.getAttribute("points"))||i.replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,i,a){const o=e?n.parseFloatWithUnits(i):n.normalizeX(n.parseFloatWithUnits(i)),h=e?n.parseFloatWithUnits(a):n.normalizeY(n.parseFloatWithUnits(a));return 0===r?s.moveTo(o,h):s.lineTo(o,h),r++,t})),s.autoClose=!1,s}parseCircleNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("cx")||0),n=this.parseFloatWithUnits(t.getAttribute("cy")||0),s=this.parseFloatWithUnits(t.getAttribute("r")||0);e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeW(s));const r=new ln;return r.absarc(i,n,s,0,2*Math.PI),r}parseEllipseNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("cx")||0),n=this.parseFloatWithUnits(t.getAttribute("cy")||0),s=this.parseFloatWithUnits(t.getAttribute("rx")||0),r=this.parseFloatWithUnits(t.getAttribute("ry")||0);e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeW(s),r=this.normalizeH(r));const a=new ln;return a.absellipse(i,n,s,r,0,0,2*Math.PI,!1),a}parseLineNode(t,e=!1){let i=this.parseFloatWithUnits(t.getAttribute("x1")||0),n=this.parseFloatWithUnits(t.getAttribute("y1")||0),s=this.parseFloatWithUnits(t.getAttribute("x2")||0),r=this.parseFloatWithUnits(t.getAttribute("y2")||0);e||(i=this.normalizeX(i),n=this.normalizeY(n),s=this.normalizeX(s),r=this.normalizeY(r));const a=new ln;return a.moveTo(i,n),a.lineTo(s,r),a}parseTextNode(t,e,i=!1){let n=parseFloat(t.getAttribute("x")||"0"),s=parseFloat(t.getAttribute("y")||"0");i||(n=this.normalizeX(n),s=this.normalizeY(s));const r=t.textContent;if(!r||!e.fontSize)return;const a=Object.assign({},e);return a.fill=t.getAttribute("fill")||e.fill||"#000",a.fontSize=parseFloat(t.getAttribute("font-size")||"0")||parseFloat(e.fontSize)||72,a.fontFamily=t.getAttribute("font-family")||e.fontFamily||"Arial",{textContent:r,style:a,userData:{}}}parseFloatWithUnits(t,e){let i,n="px";if("string"==typeof t||t instanceof String){t=null==t?void 0:t.trim();for(let e=0,i=In.length;e<i;e++){const i=In[e];if(t.endsWith(i)){n=i,t=t.substring(0,t.length-i.length);break}}}if("px"===n&&"px"!==this.defaultUnit)i=Dn.in[this.defaultUnit]/this.defaultDPI;else if("%"===n){this._viewBox.getSize(zn),Rn.copy(this._currentTransform).getScale(Hn);const t=Math.abs(Hn.x||1);i=zn.x/100*t}else"em"===n?i=(null==e?void 0:e.fontSize)||Ln:(i=Dn[n][this.defaultUnit],i<0&&(i=Dn[n].in*this.defaultDPI));return i*parseFloat(t)}getReflection(t,e){return t-(e-t)}parseFloats(t,e,i){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);const n={WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let s=0,r=!0,a="",o="";const h=[];function l(t,e,i){const n=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw n.partial=i,n}function u(){""!==a&&(""===o?h.push(Number(a)):h.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let c;const d=t.length;for(let p=0;p<d;p++)if(c=t[p],Array.isArray(e)&&e.includes(h.length%(i||0))&&n.FLAGS.test(c))s=1,a=c,u();else{if(0===s){if(n.WHITESPACE.test(c))continue;if(n.DIGIT.test(c)||n.SIGN.test(c)){s=1,a=c;continue}if(n.POINT.test(c)){s=2,a=c;continue}n.COMMA.test(c)&&(r&&l(c,p,h),r=!0)}if(1===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.POINT.test(c)){a+=c,s=2;continue}if(n.EXP.test(c)){s=3;continue}n.SIGN.test(c)&&1===a.length&&n.SIGN.test(a[0])&&l(c,p,h)}if(2===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.EXP.test(c)){s=3;continue}n.POINT.test(c)&&"."===a[a.length-1]&&l(c,p,h)}if(3===s){if(n.DIGIT.test(c)){o+=c;continue}if(n.SIGN.test(c)){if(""===o){o+=c;continue}1===o.length&&n.SIGN.test(o)&&l(c,p,h)}}n.WHITESPACE.test(c)?(u(),s=0,r=!1):n.COMMA.test(c)?(u(),s=0,r=!0):n.SIGN.test(c)?(u(),s=1,a=c):n.POINT.test(c)?(u(),s=2,a=c):l(c,p,h)}return u(),h}normalizeX(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}normalizeY(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}normalizeW(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}normalizeH(t){return this.float2Int?Math.round(t*this.scaleFactor*100)/100:t*this.scaleFactor}getAssetType(t,e="asset"){let i;const n="function"==typeof t.getAttribute?t.getAttribute("id"):"";if(!n&&t.parentNode)return this.getAssetType(t.parentNode,e);if(!n)return i;if("layer"===e)i=Bn.find((t=>n===t));else{const t=null==n?void 0:n.replace(/-assets/g,"");i=this.ASSET_TYPES.find((e=>t===e))}return!i&&t.parentNode&&(i=this.getAssetType(t.parentNode,e)),i}getId(t){let e;const i="function"==typeof t.getAttribute?t.getAttribute("id"):"";return e=!i&&t.parentNode?this.getId(t.parentNode):i,e}getParentId(t,e){let i;const n=this.getId(t);return i=t.parentNode&&this.getId(t.parentNode),i&&n!==e||(i=this.getParentId(t.parentNode,e)),i||n||""}getLabelAssetId(t){let e;return this.getId(t),e="function"==typeof t.getAttribute?t.getAttribute("aid"):"",!e&&t.parentNode&&(e=this.getLabelAssetId(t.parentNode)),e}}const Cn=new Tn,In=["mm","cm","in","pt","pc","px","em","%"],Dn={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1},"%":{"%":1,px:-1}},Ln=16,Bn=Object.values(Ii),Pn=new Hi,kn=new Hi,Nn=new Hi,On=new Hi,Rn=new Hi,zn=new Fe,Hn=new Fe,Fn=new ai;function Wn(t){if(!t)return"inches";let e=t.querySelector("#defaultView");return(null==e?void 0:e.getAttribute("units"))||"inches"}function Un(t,e=new ai){if(!t)return e;let i=t.split(" "),n=ri.map(i,(t=>parseFloat(t)));return 4!==(null==n?void 0:n.length)||(e.min.set(n[0],n[1]),e.max.set(n[0]+n[2],n[1]+n[3])),e}function Vn(t){var e;if(null==(e=null==t?void 0:t.children)?void 0:e.length)for(let e=0,i=t.children.length;e<i;e++)if("g"===t.children[e].nodeName)return t.children[e]}function qn(t){const e=document.createElementNS("http://www.w3.org/2000/svg","circle");return(null==t?void 0:t.id)&&e.setAttribute("id",t.id),e.setAttribute("cx",((null==t?void 0:t.x)||0).toString()),e.setAttribute("cy",((null==t?void 0:t.y)||0).toString()),e.setAttribute("r",((null==t?void 0:t.r)||1).toString()),(null==t?void 0:t.fill)&&e.setAttribute("fill",t.fill),(null==t?void 0:t.stroke)&&(e.setAttribute("stroke",t.stroke),e.setAttribute("stroke-width",(t.strokeWidth||1).toString())),e}function jn(t){const e=document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttribute("stroke-linecap","round"),(null==t?void 0:t.id)&&e.setAttribute("id",t.id),(null==t?void 0:t.d)&&e.setAttribute("d",Tn.getSvgPathDByData(t.d)),(null==t?void 0:t.fill)&&e.setAttribute("fill",t.fill),(null==t?void 0:t.stroke)&&(e.setAttribute("stroke",t.stroke),e.setAttribute("stroke-width",(t.strokeWidth||1).toString())),(null==t?void 0:t.strokeDasharray)&&e.setAttribute("stroke-dasharray",t.strokeDasharray),e}function Yn(t,e){t&&(null==t||t.setAttribute("transform",`translate(${(null==e?void 0:e.x)||0}, ${(null==e?void 0:e.y)||0})`))}function Gn(t){const e=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttribute("id",t),e}function $n(t,e){t&&e&&(parseInt(t.getAttribute(`${Di}-type`)),Yn(t,e))}const Xn=(new yi).start();class Zn extends zi{constructor(t){super(),d(this,"isSvgRenderer",!0),d(this,"id"),d(this,"params"),d(this,"container",Me.window.document.getElementsByTagName("body")[0]),d(this,"cameraVersion",-1),d(this,"viewAreaLimit",-1),d(this,"autoClear"),this.id="SvgRenderer@"+Date.now(),this.params=t,Me.config=t,this.initSvg(),yi.active(this.params.monitorDuration)}destroy(){yi.active(0)}initSvg(){if(this.params.containerId&&(this.container=Me.window.document.getElementById(this.params.containerId)),this.container||(this.container=Me.window.document.getElementsByTagName("body")[0]),!this.params.width||!this.params.height){const t=this.container.getBoundingClientRect();this.params.width=t.width,this.params.height=t.height}this.container.style.overflow="hidden",this.container.style.transform="translateZ(0)",this.setSize(this.params.width,this.params.height)}resize(){var t,e;const i=(null==(t=this.container)?void 0:t.parentElement)||document.body,n=i.getBoundingClientRect();if(!n)return;const s=window.getComputedStyle(i),r=n.width-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight),a=n.height-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom),o=null==(e=this.container)?void 0:e.getBoundingClientRect();if(!o)return;const h=r-o.left+n.left,l=a-o.top+n.top;this.setSize(h,l)}setSize(t,e){this.container.style.width=t+"px",this.container.style.height=e+"px",this.params.width=t,this.params.height=e,this.params.camera||(this.params.camera={}),this.params.camera.width=this.params.width,this.params.camera.height=this.params.height,this.params.aspect=this.params.width/this.params.height,this.params.camera.aspect=this.params.aspect,this.params.camera.left=-.5*this.params.width,this.params.camera.right=.5*this.params.width,this.params.camera.top=.5*this.params.height,this.params.camera.bottom=-.5*this.params.height}getSize(t){return t.set(this.params.width,this.params.height)}clean(){}render(t,e){return p(this,null,(function*(){var i;if(!t||!e)return;if(this.cameraVersion===(null==e?void 0:e.version))return;e.updateMatrixWorld(),Qn.set(0,0).unproject(e),Kn.set(this.params.width,this.params.height).unproject(e),Jn.setFromPoints([Qn,Kn]);let n=function(t=new ai){let e="";const i=[];return i.push(t.min.x),i.push(t.min.y),i.push(Math.abs(t.max.x-t.min.x)),i.push(Math.abs(t.max.y-t.min.y)),e=i.join(" "),e}(Jn);null==(i=t.svg)||i.setAttribute("viewBox",n),this.cameraVersion=e.version||-1,Xn.addTimer("render cycle")}))}getRenderTarget(){}setRenderTarget(t){}renderTexture(t,e){}}const Jn=new ai,Qn=new Fe,Kn=new Fe,ts=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],es=()=>{const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(ts[255&t]+ts[t>>8&255]+ts[t>>16&255]+ts[t>>24&255]+"-"+ts[255&e]+ts[e>>8&255]+"-"+ts[e>>16&15|64]+ts[e>>24&255]+"-"+ts[63&i|128]+ts[i>>8&255]+"-"+ts[i>>16&255]+ts[i>>24&255]+ts[255&n]+ts[n>>8&255]+ts[n>>16&255]+ts[n>>24&255]).toLowerCase()};class is extends zi{constructor(t={}){super(),d(this,"isObject2",!0),d(this,"id",ns++),d(this,"uuid",es()),d(this,"name"),d(this,"type","Object2"),d(this,"featureKey","Object2_"+this.id),d(this,"parent"),d(this,"children",[]),d(this,"up",new Fe(0,1)),d(this,"position",new Fe),d(this,"rotation",new Fe),d(this,"scaled",new Fe(1,1)),d(this,"flipY",!1),d(this,"selectable",!1),d(this,"matrix",new Hi),d(this,"matrixWorld",new Hi),d(this,"matrixWorldInverse",new Hi),d(this,"modelViewMatrix",new Hi),d(this,"normalMatrix",new Hi),d(this,"fixed",!1),d(this,"dynamically",!1),d(this,"matrixAutoUpdate",!1),d(this,"matrixWorldNeedsUpdate",!1),d(this,"matrixWorldAutoUpdate",!1),d(this,"composeNode",!1),d(this,"isInComposeNode",!1),d(this,"alignCenter",!1),d(this,"boundingBox",new ai),d(this,"boundingBoxWorld",new ai),d(this,"boundingBoxNeedsUpdate",!1),d(this,"centerPoint",new Fe),d(this,"visible",!0),d(this,"castShadow",!1),d(this,"receiveShadow",!1),d(this,"renderOrder",0),d(this,"animations",[]),d(this,"finalSize"),d(this,"userData",{}),d(this,"DefaultUp",new Fe(0,1)),d(this,"_autoSort",!0),d(this,"_version",0),void 0!==t.name?this.name=t.name:this.name="Object2",void 0!==t.flipY&&(this.flipY=t.flipY),void 0!==t.selectable&&(this.selectable=t.selectable),void 0!==t.finalSize&&(this.finalSize=t.finalSize),this.setAttrs(t)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}destroy(){super.destroy(),this.clear(),this.removeFromParent(),this.dispatchEvent(ps)}setVisible(t){return this.visible=t,this}setPosition(t){return this.position.set(t.x,t.y),this}translate(t,e){this.position.x+=t,this.position.y+=e}setScale(t,e){return this.scaled.set(t,e),this}setRotationFromMatrix(t){t.decompose(hs,this.rotation,ls)}setRotation(t){return this.rotation.set(t,t),this}rotate(t){this.rotation.x+=t}scale(t,e){e?(this.scaled.x*=t,this.scaled.y*=e):this.scaled.multiplyScalar(t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(rs.copy(this.matrixWorld).invert())}lookAt(t){as.copy(t),this.updateWorldMatrix(!0,!1),this.matrixWorld.getTransition(hs),rs.lookAt(hs,as,cs),rs.getRotation(us),this.rotation.set(us.x,us.x),this.parent&&(this.parent.matrixWorld.getRotation(us),this.rotate(us.x))}applyMatrix3(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.rotation,this.scaled)}updateMatrix(){ss.copy(this.scaled),this.flipY&&(ss.y*=-1),this.matrix.compose(this.position,this.rotation,ss),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.matrixWorldNeedsUpdate=!1,t=!0,this.boundingBoxNeedsUpdate=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t);this.boundingBoxNeedsUpdate&&(this.updateBoundingBox(),this.boundingBoxNeedsUpdate=!1)}updateWorldMatrix(t=!1,e=!1){const i=this.parent;if(t&&i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),e){const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}updateModelViewMatrix(t){rs.copy(this.matrixWorld),t&&this.fixed?this.modelViewMatrix.copy(t.projectionMatrix):t?this.modelViewMatrix.multiplyMatrices(t.viewMatrix,rs):this.modelViewMatrix.copy(rs);for(let e=0,i=this.children.length;e<i;e++)this.children[e].updateModelViewMatrix(t)}computeBoundingBox(){this.boundingBox.makeEmpty(),this.centerPoint.set(0,0);for(let t=0,e=this.children.length;t<e;t++)this.children[t].updateMatrixWorld(),os.copy(this.children[t].computeBoundingBox()),os.applyMatrix3(rs.copy(this.children[t].matrixWorld)),this.boundingBox.union(os);return this.boundingBox.applyMatrix3(this.matrixWorldInverse),this.boundingBox}updateBoundingBox(){this.boundingBox.isEmpty()||this.boundingBoxWorld.copy(this.boundingBox).applyMatrix3(this.matrixWorld)}setAttrs(t){if(!t)return this;for(const e in t)"children"!==e&&void 0!==t[e]&&("userData"===e&&t[e]?Object.keys(t[e]).forEach((i=>this.userData[i]=t[e][i])):this.userData[e]=t[e]);return this}add(t){return t&&t.isObject2&&t!==this?(t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.isInComposeNode=this.composeNode||this.isInComposeNode,t.selectable&&t.parent.setSelectable(t.selectable),this._autoSort&&this.children.sort(((t,e)=>t.renderOrder-e.renderOrder)),t.dispatchEvent(ds),this.matrixAutoUpdate||(this.matrixWorldNeedsUpdate=!0),this.visible&&(this.needsUpdate=!0),this):this}adds(t){if(!t||!t.length)return this;this._autoSort=!1;for(let e=0,i=t.length;e<i;e++)e===t.length-1&&(this._autoSort=!0),this.add(t[e]);return this}remove(t){const e=this.children.indexOf(t);return-1!==e&&(t.parent=void 0,this.children.splice(e,1),t.dispatchEvent(ps)),this}removes(t){for(let e=0,i=t.length;e<i;e++)this.remove(t[e]);return this}removeFromParent(){const t=this.parent;return t&&t.remove(this),this.parent=void 0,this}moveToLast(){const t=this.parent;t&&(this.removeFromParent(),t.add(this))}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=void 0,e.destroy(),e.dispatchEvent(ps)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),rs.copy(this.matrixWorld).invert(),t.parent&&(t.parent.updateWorldMatrix(!0,!1),rs.multiply(t.parent.matrixWorld)),t.applyMatrix3(rs),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(t,us,ls),t}getWorldRotation(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(hs,t,ls),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(hs,us,t),t}getWorldDirection(t){return this.updateWorldMatrix(!0,!1),t.set(this.matrixWorld.elements[6],this.matrixWorld.elements[7]).normalize()}traverse(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)}traverseVisible(t){if(this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e&&(t(e),e.traverseAncestors(t))}traverseSome(t){if(t(this))return!0;const e=this.children;for(let i=0,n=e.length;i<n;i++)if(e[i].traverseSome(t))return!0;return!1}onBeforeRender(t,e,i,n){}render(t){}onAfterRender(t,e,i){}setSelectable(t){this.selectable=t,this.parent&&this.parent.setSelectable(t)}raycast(t,e=[]){}getByRange(t,e=!1,i=[]){if(os.copy(t),os.containsBox(this.boundingBoxWorld)&&i.push(this),!e||this.composeNode)return i;for(let n=0,s=this.children.length;n<s;n++)this.children[n].getByRange(t,e,i);return i}clone(t=!0,e=!1){return new(0,this.constructor)(this.userData).copy(this,t,e)}copy(t,e=!0,i=!1){if(this.name=t.name,this.type=t.type,this.featureKey=t.featureKey,this._version=0,this.parent=t.parent,this.up.copy(t.up),this.position.copy(t.position),this.rotation.copy(t.rotation),this.scaled.copy(t.scaled),this.flipY=t.flipY,this.selectable=t.selectable,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.modelViewMatrix.copy(t.modelViewMatrix),this.normalMatrix.copy(t.normalMatrix),this.fixed=t.fixed,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.composeNode=t.composeNode,this.alignCenter=t.alignCenter,this.boundingBox.copy(t.boundingBox),this.boundingBoxWorld.copy(t.boundingBoxWorld),this.boundingBoxNeedsUpdate=t.boundingBoxNeedsUpdate,this.centerPoint.copy(t.centerPoint),this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e)for(let n=0;n<t.children.length;n++){const s=t.children[n];this.add(s.clone(e,i))}return this}}let ns=0;const ss=new Fe,rs=new Hi,as=new Fe,os=new ai,hs=new Fe,ls=new Fe,us=new Fe,cs=new Fe(0,1),ds={type:"added"},ps={type:"removed"};class fs extends is{constructor(){super(),d(this,"name","Scene"),d(this,"type","Scene"),d(this,"isScene",!0),d(this,"view"),d(this,"background"),d(this,"featureKey","Scene_"+this.id),d(this,"matrixAutoUpdate",!1)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}setup(t){this.view=t}render(t){var e;this.visible&&(null==(e=this.children)||e.forEach((function(e){e.isShape&&e.render(t)})))}getIntersectObjects(t,e=Ti.RM,i=[]){throw new Error("must be implemented in derived")}getByIds(t,e=[]){return e.length=0,t?(this.traverse((function(i){var n,s;(null==(n=i.userData)?void 0:n.id)&&(Array.isArray(t)&&t.includes(null==(s=i.userData)?void 0:s.id)||i.userData.id===t)&&e.push(i)})),e):e}}const ms={enabled:!1,files:{},add:function(t,e){this.enabled&&(this.files[t]=e)},get:function(t){if(this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},gs=new class{constructor(t,e,i){d(this,"isLoading",!1),d(this,"itemsLoaded",0),d(this,"itemsTotal",0),d(this,"urlModifier"),d(this,"handlers",[]),d(this,"onStart"),d(this,"onLoad"),d(this,"onProgress"),d(this,"onError"),this.onLoad=t,this.onProgress=e,this.onError=i}itemStart(t){this.itemsTotal++,this.isLoading||void 0!==this.onStart&&this.onStart(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,void 0!==this.onProgress&&this.onProgress(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,void 0!==this.onLoad&&this.onLoad())}itemError(t){void 0!==this.onError&&this.onError(t)}resolveURL(t){return void 0!==this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return-1!==e&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,i=this.handlers.length;e<i;e+=2){const i=this.handlers[e],n=this.handlers[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}};let ys=class{constructor(t=gs){d(this,"manager"),d(this,"crossOrigin","anonymous"),d(this,"withCredentials",!1),d(this,"path",""),d(this,"resourcePath",""),d(this,"requestHeader",{}),this.manager=t}loadAsync(t,e){const i=this;return new Promise((function(n,s){i.load(t,n,e,s)}))}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};const vs={};let xs=class extends Error{constructor(t,e){super(t),d(this,"response"),this.response=e}},bs=class extends ys{constructor(t){super(t),d(this,"mimeType"),d(this,"responseType")}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ms.get(t);if(void 0!==s)return this.manager.itemStart(t),setTimeout((()=>{e&&e(s),this.manager.itemEnd(t)}),0),s;if(void 0!==vs[t])return void vs[t].push({onLoad:e,onProgress:i,onError:n});vs[t]=[],vs[t].push({onLoad:e,onProgress:i,onError:n});const r=new Me.window.Request(t,{headers:new Me.window.Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(r).then((e=>{if(200===e.status||0===e.status){if(e.status,"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const i=vs[t],n=e.body.getReader(),s=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),r=s?parseInt(s):0,a=0!==r;let o=0;const h=new ReadableStream({start(t){!function e(){n.read().then((({done:n,value:s})=>{if(n)t.close();else{o+=s.byteLength;const n=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:r});for(let t=0,e=i.length;t<e;t++){const e=i[t];e.onProgress&&e.onProgress(n)}t.enqueue(s),e()}}))}()}});return new Response(h)}throw new xs(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)})).then((t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then((t=>n.decode(t)))}}})).then((e=>{ms.add(t,e);const i=vs[t];delete vs[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onLoad&&n.onLoad(e)}})).catch((e=>{const i=vs[t];if(void 0===i)throw this.manager.itemError(t),e;delete vs[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}this.manager.itemError(t)})).finally((()=>{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setMimeType(t){return this.mimeType=t,this}setResponseType(t){return this.responseType=t,this}};class ws extends ys{constructor(t){super(t)}load(t,e,i,n){const s=this,r=new bs(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(t,(function(i){try{e&&e(i)}catch(e){n&&n(e),s.manager.itemError(t)}}),i,n)}}class _s{constructor(){d(this,"svg"),d(this,"offset",new Fe),d(this,"svgRoot"),d(this,"layers",[]),d(this,"elementsMap",{}),d(this,"boundingBoxMap",{}),d(this,"boundingBox",new ai),d(this,"svgSkeletons",[]),d(this,"_exceptTypes",["view"]),d(this,"_exceptIds",["viewer","mirror"]),d(this,"_lvi",0),d(this,"_lastLinked",[])}bindSvg(t){return this.svg=t,this.svgRoot=Vn(this.svg),this.layers=this.getLayers(2),this.elementsMap={},this.boundingBoxMap={},this.boundingBox.makeEmpty(),this.getElementsMap(this.svg,this.elementsMap),this}getLayers(t){var e;if(!this.svg)throw new Error("please bind svg first");return 2===t&&(null==(e=this.layers)?void 0:e.length)||(this.layers=this._getSvgLayer(this.svg,t)),this.layers}_getSvgLayer(t,e=0,i=0,n=[]){var s;let r,a=t.id;if(this._exceptTypes.includes(t.tagName)||"defs"===t.tagName)return this._lvi--,n;if(e&&this._lvi>e)return n;a&&!this._exceptIds.includes(a)&&(r={value:a,label:a,children:[]},n.push(r)),this._lvi++;for(let i=0,s=t.children.length;i<s;i++)r?this._getSvgLayer(t.children[i],e,this._lvi,r.children):this._getSvgLayer(t.children[i],e,this._lvi,n);return 0===(null==(s=null==r?void 0:r.children)?void 0:s.length)&&delete r.children,this._lvi=i,n}getElementsMap(t,e={}){return this.traverseSvg(t,(i=>{i!==t&&i.id&&(e[i.id]=i)})),e}computeBoundingBoxMap(){var t;if(Object.keys(this.boundingBoxMap).length)return this.boundingBoxMap;let e=null==(t=this.svg)?void 0:t.getBoundingClientRect();return e&&this.offset.set(e.left,e.top),this.traverseSvg(this.svg,(t=>{if(!t.id)return;if("use"===t.tagName){const e=this.getUseSymbolId(t);if(!e)return;const i=this.boundingBoxMap[e];if(i&&!i.isEmpty()){Es.set(Number(t.getAttribute("x")||"0"),Number(t.getAttribute("y")||"0")),As.composeSvgTransform(Es.x,Es.y,t.getAttribute("transform"));const e=(new ai).copy(i).applyMatrix3(As);return void(this.boundingBoxMap[t.id]=e)}const n=this.getUseElementBoundingBoxWithSymbol(t);if(!n)return;this.boundingBoxMap[e]=n,Es.set(Number(t.getAttribute("x")||"0"),Number(t.getAttribute("y")||"0")),As.composeSvgTransform(Es.x,Es.y,t.getAttribute("transform"));const s=(new ai).copy(n).applyMatrix3(As);return this.boundingBoxMap[t.id]=s,void this.boundingBox.expandByBox(s)}if("function"!=typeof t.getBBox)return;const e=t.getBBox();if(e.width&&e.height||"path"!==t.tagName||(Tn.getBoundingBoxByNode(t,Ss),Ss.isEmpty()||(Ss.getSize(Es),e.x=Ss.min.x,e.y=Ss.max.y,e.width=Es.x,e.height=Es.y)),!e.width||!e.height)return;const i=new ai(new Fe(e.x,e.y),new Fe(e.x+e.width,e.y+e.height));this.boundingBoxMap[t.id]=i.round(),this.boundingBox.expandByBox(i)})),this.boundingBoxMap}getLayerVisible(t){var e;const i=this.getElementById(t);if(i)return"none"!==(null==(e=i.style)?void 0:e.display)}updateLayersVisibility(t,e=!1,i=!0){if(!this.elementsMap)throw new Error("please bind svg first");i&&this._updateAllLayersVisibility(!e),(null==t?void 0:t.length)||(t=["background"]);for(let i=0,n=t.length;i<n;i++){const n=this.getElementById(t[i]);n&&this._updateLayersVisibility(n,e,!0,!0)}}_updateAllLayersVisibility(t=!1){Object.values(this.elementsMap).forEach((e=>{"svg"!==e.tagName&&"symbol"!==e.tagName&&e.getAttribute("id")&&(e.style.display=t?"block":"none")}))}_updateLayersVisibility(t,e=!1,i=!1,n=!1){var s,r;if(t&&"svg"!==t.tagName&&t.getAttribute("id")){if(t.style.display=e?"block":"none",i&&e){let i=t.parentElement;for(;i&&"svg"!==i.tagName;)i.style.display=e?"block":"none",i=i.parentElement}if(n&&(null==(s=t.children)?void 0:s.length)>0)for(let i=0,n=null==(r=t.children)?void 0:r.length;i<n;i++)this._updateLayersVisibility(t.children[i],e,!1,!0)}}updateVisibilityByAssetType(t,e=!1,i){i||(i=Oi[t]),this.updateLayersVisibility(i,!e)}updateVisibilityByAssetTypes(t,e=!1,i){if(Array.isArray(t)||(t=[t]),null==t?void 0:t.length)for(let n=0,s=t.length;n<s;n++)this.updateVisibilityByAssetType(t[n],e,i)}getElementById(t){if(!this.elementsMap)throw new Error("please bind svg first");return this.elementsMap[t]}getElementBoundingBox(t){return this.boundingBoxMap[t]}findSkeletonByPath(t=[]){let e,i=0;const n=Object.keys(this.elementsMap);for(let t=0,s=n.length;t<s;t++){const s=this.elementsMap[n[t]];if(!s)continue;const r=s.getAttribute("d");r&&(r.length<i||(i=r.length,e=s.id?s:s.parent))}return e?(t.push(e),t):t}setTextInChildren2(t,e){var i;let n;(null==(i=null==t?void 0:t.children)?void 0:i.length)<2?(n=Ei("text"),n.setAttribute("dy","1em"),t.appendChild(n)):n=t.children[t.children.length-1],n.innerHTML=e}traverseSvg(t,e){var i;if(!this._exceptTypes.includes(t.tagName)&&("svg"===t.tagName||"defs"===t.tagName||t.id)&&("g"!==t.tagName||0!==(null==(i=t.children)?void 0:i.length))){this._exceptIds.includes(t.id)||e(t);for(let i=0,n=t.children.length;i<n;i++)this.traverseSvg(t.children[i],e)}}traverseSvgTLayers(t,e){var i;if(Array.isArray(t))for(let i=0,n=t.length;i<n;i++)this.traverseSvgTLayers(t[i],e);else if(e(t),null==(i=t.children)?void 0:i.length)for(let i=0,n=t.children.length;i<n;i++)this.traverseSvgTLayers(t.children[i],e)}getLabelElementsByType(t,e={}){const i=this.getElementById(Ni(t));return i?(this.getElementsMap(i,e),e):e}getLabelElementById(t,e="rm"){if(!t)return;const i=this.getElementById(t);if(!i)return;let n=i.getAttribute("aid");return n||(n="l-"+e+"-"+t),this.getElementById(n)}setLabelsById(t,e,i="rm"){var n,s;const r=this.getLabelElementById(t,i);if(!r)return;const a=(null==(n=r.children)?void 0:n.length)||0;for(let t=0,i=((null==e?void 0:e.length)||0)-(a-1);t<i;t++){const e=Ei("text");e.setAttribute("x","0"),e.setAttribute("y",a+t+"em"),r.appendChild(e)}for(let t=1,i=null==(s=r.children)?void 0:s.length;t<i;t++)r.children[t].textContent=e&&t<=e.length?e[t-1]:""}clearAssetLabelsByType(t="rm"){var e;const i=this.getLabelElementsByType(t),n=ri.keys(i);for(let t=0,s=n.length;t<s;t++){const s=i[n[t]];for(let t=1,i=(null==(e=s.children)?void 0:e.length)||0;t<i;t++)s.children[t].textContent=""}}getUseSymbolId(t){var e;if(t&&"use"===t.tagName)return null==(e=t.getAttribute("xlink:href"))?void 0:e.substring(1)}getUseSymbol(t){if(!t||"use"!==t.tagName)return;const e=this.getUseSymbolId(t);return e?this.getElementById(e):void 0}setElementState2selected(t,e=!1){var i;if(!t)return;if("use"===t.tagName){const n=this._getSymbolBox(t);if(!n)return;return void(e?null==(i=t.parentNode)||i.insertBefore(n,t):t.parentNode&&t.parentNode.contains(n)&&t.parentNode.removeChild(n))}let n=t.getAttribute("class");n||(n=""),n=e?"danger":ri.replace(n,"danger","").trim(),t.setAttribute("class",n)}_getSymbolBox(t){if(!t)return;const e=t.id+"-boundingBox";let i=this.getElementById(e);if(i)return i;const n=this.getUseSymbol(t);if(!n)return;let s=this.getElementBoundingBox(t.id);if(!s||s.isEmpty())return;i=document.createElementNS("http://www.w3.org/2000/svg","rect"),i.setAttribute("id",e),i.setAttribute("class","danger"),i.setAttribute("x",s.min.x.toString()),i.setAttribute("y",s.min.y.toString());const r=new Fe;return s.getSize(r),i.setAttribute("width",r.x.toString()),i.setAttribute("height",r.y.toString()),n.getAttribute("transform")&&i.setAttribute("transform",n.getAttribute("transform")||""),n.getAttribute("style")&&i.setAttribute("style",n.getAttribute("style")||""),this.elementsMap[e]=i,i}getUseElementBoundingBoxWithSymbol(t){var e;if(!t)return;const i=null==(e=t.getAttribute("xlink:href"))?void 0:e.substring(1);if(!i)return;let n=this.getElementById(i);if(!n)return;const s=document.createElementNS("http://www.w3.org/2000/svg","svg");let r;if(s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px","symbol"===ri.lowerCase(n.tagName)){r=document.createElementNS("http://www.w3.org/2000/svg","g");for(let t=0,e=n.childNodes.length;t<e;t++){const e=n.childNodes[t].cloneNode(!0);r.appendChild(e)}}else r=n.cloneNode(!0);s.appendChild(r),r.setAttribute("style","stroke: #333333;"),document.body.appendChild(s);const a=s.getBBox();if(document.body.removeChild(s),!a)return;const o=new ai;return o.set(new Fe(a.x,a.y),new Fe(a.x+a.width,a.y+a.height)),o}fontZoom(t,e=1){const i=this.getElementById(t);if(!i)return;let n=i.getAttribute("font-size");n||(n="12");const s=/(\d+)([a-zA-Z%]+)/.exec(n),r=s&&(null==s?void 0:s.length)>2?s[2]:"";let a=Math.round(parseFloat(n)*e*100)/100;i.setAttribute("font-size",a+r)}strokeWidthChanged(t=1){var e,i;const n=null==(e=this.svg)?void 0:e.querySelector("#mirror");if(!n)return;let s=null!=(i=rn(n,"stroke-width"))?i:"1em";const r=String(s).match(/^([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(%|[a-z]*)$/i);if(!r)return;const a=parseFloat(r[1]),o=r[2]||"em",h=a*t,l=Number.isInteger(h)?h.toFixed(0):h.toString().replace(/\.?0+$/,"");n.setAttribute("stroke-width",`${l}${o}`),"em"===o&&(this.fontZoom("background-labels",1),this.fontZoom("asset-labels",1),n.style.fontSize=`${l}${o}`)}getCentroid(t,e=new Fe){const i=t.getAttribute("insX"),n=t.getAttribute("insY");return i||n?e.set(Number(i||"0"),Number(n||"0")):this.getCentroidByDom(t,e)}getCentroidByDom(t,e=new Fe){const i=Number(t.getAttribute("x")||"0"),n=Number(t.getAttribute("y")||"0"),s=t.getBBox();let r=1,a=1,o=t.getAttribute("transform");if(!o)return e.set(i,n);const h=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(o);if(void 0===h||null==h){const i=t.transform.baseVal;if(!(o&&i.numberOfItems>0))return e.set((s.x+s.width/2)*r,(s.y+s.height/2)*a);{let t=i.getItem(0);t&&t.type===SVGTransform.SVG_TRANSFORM_SCALE&&(r=0!==t.matrix.a?t.matrix.a:1,a=0!==t.matrix.d?t.matrix.d:r)}}else r=h[1]&&Number(h[1])>0?Number(h[1]):1,a=h[2]&&Number(h[2])>0?Number(h[2]):r;return i&&n?e.set(i*r,n*a):e.set((s.x+s.width/2)*r,(s.y+s.height/2)*a),e}linkAssetsByTree(t,e){if(t||(t=Ti.RM),this.clearLinkedLines(t),!e||!e.value)return;const i=this.getLinesByTree(e);this.drawLinkedLines(t,i)}clearLinkedLines(t){var e;const i=ki(t);if(this.getElementById(i)){for(let t=(null==(e=this._lastLinked)?void 0:e.length)-1;t>=0;t--){const e=this._lastLinked[t];e.parentNode&&e.parentNode.removeChild(e),this._lastLinked.splice(t,1)}this._lastLinked.length=0}}drawLinkedLines(t,e){var i;if(!(null==e?void 0:e.length))return;const n=ki(t),s=this.getElementById(n);if(s)for(let t=0,n=e.length;t<n;t++){const n=e[t][0],r=e[t][(null==(i=e[t])?void 0:i.length)-1],a=Ei("line");a.setAttribute("x1",n.x.toString()),a.setAttribute("y1",n.y.toString()),a.setAttribute("x2",r.x.toString()),a.setAttribute("y2",r.y.toString()),a.setAttribute("class","danger"),a.setAttribute("style","stroke-width: 2;"),s.appendChild(a),this._lastLinked.push(a)}}getLinesByTree(t,e=[]){var i;if(!(null==t?void 0:t.value))return e;const n=this.getElementBoundingBox(t.value);if(!n)return e;const s=n.getCenter();return null==(i=t.children)||i.forEach((t=>{var i;const n=this.getElementBoundingBox(null==t?void 0:t.value);if(!n)return;const r=n.getCenter();e.push([s,r]),(null==(i=t.children)?void 0:i.length)&&this.getLinesByTree(t,e)})),e}}const Ss=new ai,Es=new Fe,As=new Hi;class Ms{constructor(t={},e){d(this,"name","SvgPainter"),d(this,"params"),d(this,"chef"),this.params=t,this.chef=e}drawSocialDistanceCircles(t,e="http://www.w3.org/2000/svg"){var i,n,s;if(!t)return;const r=function(t){if(!t)return 1;let e=1;switch(Wn(t)){case"mm":e=500/39.3701;break;case"cm":e=50/39.3701;break;case"Metres":case"m":e=.5/39.3701;break;default:e=1}return e}(t),a=Wn(t),o=2*r,h=(null==(n=null==(i=this.params.socialDistance)?void 0:i.colors)?void 0:n.length)?null==(s=this.params.socialDistance)?void 0:s.colors:[Le.green,Le.red],l=this.getRadius(a),u=t.querySelector(`#${Li}`),c=null==u?void 0:u.querySelectorAll("path");if(!u||!(null==c?void 0:c.length))return;let d,p;const f=new Array;for(let t=0,e=(null==c?void 0:c.length)||0;t<e;t++){if(d=c[t],p=d.getAttribute("id"),!p)continue;const e=this.chef.getElementBoundingBox(p);if(!e)continue;const i=new Fe;e.getCenter(i),f.push({id:p,cp:i})}for(let t=0,e=f.length;t<e;t++){f[t].color=h[0];for(let i=0,n=e;i<n;i++)f[t]!==f[i]&&Fe.getDistance(f[t].cp,f[i].cp)<2*l&&(f[t].color=h[1])}for(let t=0,i=f.length;t<i;t++){let i=this.createCircle(f[t],l,o,e);u.appendChild(i)}}clearSocialDistanceCircles(t){if(!t)return;const e=t.querySelector(`#${Li}`),i=null==e?void 0:e.querySelectorAll("circle");if(e&&(null==i?void 0:i.length))for(let t=0,n=(null==i?void 0:i.length)||0;t<n;t++){const n=i[t].getAttribute("id");n&&(null==n?void 0:n.indexOf("_circle"))>-1&&e.removeChild(i[t])}}getRadius(t){var e,i,n;let s=(null==(i=null==(e=this.params)?void 0:e.socialDistance)?void 0:i.radius)||3;return"imperial"===(null==(n=this.params)?void 0:n.displayUnits)?"Metres"===t||"m"===t?s/=3.28084:"cm"===t?s=s/3.28084*100:"mm"===t?s=s/3.28084*1e3:"INCH"!==t&&"inches"!==t||(s*=12):"INCH"===t||"inches"===t?s=3.28084*s*12:"cm"===t?s*=100:"mm"===t&&(s*=1e3),s}createCircle(t,e,i,n){const s=document.createElementNS(n,"circle");return s.setAttributeNS(null,"id",t.id+"_circle"),s.setAttributeNS(null,"cx",t.cp.x),s.setAttributeNS(null,"cy",t.cp.y),s.setAttributeNS(null,"r",String(e)),s.setAttributeNS(null,"style",`pointer-events:none;fill-opacity:0.1;stroke:${t.color};stroke-width:${i}px;`),s}}function Ts(t,e){if(!t||!e)return!1;if(-1!==e.indexOf(" "))throw new Error("className should not contain space.");return t.classList?t.classList.contains(e):(" "+t.className+" ").indexOf(" "+e+" ")>-1}function Cs(t,e){if(!t)return;let i=t.className;const n=(e||"").split(" ");for(let e=0,s=n.length;e<s;e++){const s=n[e];s&&(t.classList?t.classList.add(s):Ts(t,s)||(i+=" "+s))}t.classList||(t.className=i)}function Is(t,e){if(!t||!e)return;const i=e.split(" ");let n=" "+t.className+" ";for(let e=0,s=i.length;e<s;e++){const s=i[e];s&&(t.classList?t.classList.remove(s):Ts(t,s)&&(n=n.replace(" "+s+" "," ")))}t.classList||(t.className=(n||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,""))}class Ds extends fs{constructor(t={}){super(),d(this,"isSvgScene",!0),d(this,"name","SvgScene"),d(this,"dynamically",!0),d(this,"params"),d(this,"socialDistanceEnable",!1),d(this,"container"),d(this,"svg"),d(this,"svgStr",""),d(this,"svgRoot"),d(this,"viewBox",new ai),d(this,"chef"),d(this,"defaultLayers",[]),d(this,"skeletonLayers",[]),d(this,"currentLayers",[]),d(this,"assetType"),d(this,"assetsMap",{}),d(this,"legend",[]),d(this,"selectedList",[]),d(this,"painter"),d(this,"_lastHighlightType",""),d(this,"_lastHighlightIds",[]),d(this,"clickSvgElementHandler",this.handleClickSvgElement.bind(this)),d(this,"_lastLinkedIds",[]),this.params=t,this.assetType=t.assetType||Ti.RM,this.params.socialDistanceEnable&&(this.socialDistanceEnable=!0),this.container=this.params.containerId?document.getElementById(this.params.containerId):Me.window.document.getElementsByTagName("body")[0],this.chef=new _s,this.painter=new Ms(t,this.chef)}get isMounted(){var t;return(null==(t=this.container.querySelectorAll("svg"))?void 0:t.length)>0}destroy(){var t;super.destroy(),this.unmount(),null==(t=this.camera)||t.destroy()}mount(){this.svg&&(this.container.contains(this.svg)||this.container.appendChild(this.svg),this.chef.computeBoundingBoxMap())}unmount(){this.svg&&this.svg.parentNode&&this.container.contains(this.svg)&&this.container.removeChild(this.svg)}computeBoundingBox(){return this.boundingBox.makeEmpty(),this.chef&&this.svg?(this.chef.computeBoundingBoxMap(),this.boundingBox.copy(this.chef.boundingBox),this.boundingBox):this.boundingBox}load(t){return p(this,null,(function*(){return(new ws).loadAsync(t)}))}bind(t){this.svgStr=t;const e=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;return this.bindSvg(e),!0}bindSvg(t){if(this.svg=t,!this.svg)throw new Error("svg load failed");let e=this.svg.getAttribute("viewBox");e&&(Un(e,this.viewBox),this.chef.bindSvg(this.svg),this.svgRoot=Vn(this.svg),this.svg.setAttribute("viewBox",`0 0 ${this.params.width} ${this.params.height}`),this.svg.setAttribute("style","transform: translateZ(0);"),this.appendStyles(),this.setAssetsMap(this.assetType,this.assetsMap))}recompute(t){t&&(this.bindSvg(t),this.computeBoundingBox(),this.viewBox.copy(this.boundingBox))}appendStyles(){var t;let e=null==(t=this.svg)?void 0:t.querySelector("style");e&&(e.appendChild(document.createTextNode(".centered-texts { text-anchor:middle; dominant-baseline:middle; }")),e.appendChild(document.createTextNode(`.default { stroke: ${this.params.defaultStroke}; fill: ${this.params.defaultFill}; }`)),e.appendChild(document.createTextNode(`.info { stroke: ${this.params.infoStroke}; fill: ${this.params.infoFill}; }`)),e.appendChild(document.createTextNode(`.primary { stroke: ${this.params.primaryStroke}; fill: ${this.params.primaryFill}; }`)),e.appendChild(document.createTextNode(`.success { stroke: ${this.params.successStroke}; fill: ${this.params.successFill}; }`)),e.appendChild(document.createTextNode(`.warning { stroke: ${this.params.warningStroke}; fill: ${this.params.warningFill}; }`)),e.appendChild(document.createTextNode(`.danger { stroke: ${this.params.dangerStroke}; fill: ${this.params.dangerFill}; }`)),e.appendChild(document.createTextNode(`.active { stroke: ${this.params.activeStroke}; fill: ${this.params.activeFill}; }`)),e.appendChild(document.createTextNode(`text { font-family: ${this.params.fontFamily||"simhei"}; }`)),Ki(this.svg,(t=>{"asset-labels"===rn(t,"id")&&Cs(t,"centered-texts")})),e.appendChild(document.createTextNode("@keyframes fillAnimate {\n 100% { fill-opacity: 0.3; }\n 30% { fill-opacity: 1; }\n 0% { fill-opacity: 0.3; }\n }")),e.appendChild(document.createTextNode("@keyframes dashedAnimate {\n 100% { stroke-dashoffset: -850; }\n 0% { stroke-dashoffset: -0; }\n }")),e.appendChild(document.createTextNode(".cursor { cursor: pointer; }")),e.appendChild(document.createTextNode(".hover { fill: rgba(185, 28, 28, 0.5); animation: fillAnimate 1s infinite; cursor: pointer; }")))}getLayers(t=2){return this.svg?this.chef.getLayers(t):[]}setDefaultLayers(t){(null==t?void 0:t.length)&&(this.defaultLayers=t)}setSkeletonLayers(t){(null==t?void 0:t.length)&&(this.skeletonLayers=t)}setCurrentLayers(t){(null==t?void 0:t.length)&&(this.currentLayers=t)}showDefaultLayers(t,e=!1){this.setDefaultLayers(t),this.chef.updateLayersVisibility(t,e)}getLayerVisible(t){return this.chef.getLayerVisible(t)}updateLayersVisibility(t,e=!1,i=!0){this.chef.updateLayersVisibility(t,e,i)}setAssetType(t,e){this.assetsMap={},this.assetType=t,this.setAssetsMap(this.assetType,this.assetsMap),e||(e=[ki(t)],t!==Ti.RM&&e.unshift(ki(Ti.RM))),this.setDefaultLayers(e),this.updateLayersVisibility(this.defaultLayers,!0)}isBelongsToAssetType(t,e){e||(e=this.assetType);const i=this.getAssetsByType(e);return!!i&&!!(null==i?void 0:i.hasOwnProperty(t))}setAssetsMap(t,e={}){const i=this.chef.getElementById(ki(t));if(!i)return e;e[t]=this.chef.getElementsMap(i);const n=Ni(t),s=this.chef.getElementById(n);if(!s)return e;const r=this.chef.getElementsMap(s),a=ri.keys(r);if(!(null==a?void 0:a.length))return e;if(ri.startsWith(a[0],`l-${t}-`)){const e=`l-${t}-`.length;for(let t=0,i=a.length;t<i;t++)r[a[t].slice(e)]=r[a[t]],delete r[a[t]]}return e[n]=r,e}getAssetsByType(t){return this.assetsMap.hasOwnProperty(t)||this.setAssetsMap(t,this.assetsMap),this.assetsMap[t]}getElementById(t){if(!t)return;const e=this.getAssetsByType(this.assetType);return e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0}getAssetIdsByType(t){const e=this.getAssetsByType(t);return e?ri.keys(e):[]}clearFillOrStroke(t="fill"){const e=this.getAssetsByType(this.assetType);if(!e)return;const i=ri.keys(e);let n;for(let s=0,r=i.length;s<r;s++)n=e[i[s]],n&&(n.hasAttribute(t)&&n.removeAttribute(t),"stroke"===t&&n.removeAttribute("stroke-width"));this.clearLegendBy(t)}clearFillOrStrokeByIds(t,e="fill"){const i=this.getAssetsByType(this.assetType);if(!i)return;const n=ri.keys(i);let s;for(let r=0,a=n.length;r<a;r++)(null==t?void 0:t.length)&&!t.includes(n[r])||(s=i[n[r]],s&&s.hasAttribute(e)&&(s.removeAttribute(e),"stroke"===e&&s.removeAttribute("stroke-width")));this.clearLegendBy(e)}setFillOrStrokeByIds(t,e,i="fill",n="7em"){const s=this.getAssetsByType(this.assetType);if(!s)return;const r=ri.keys(s);let a;for(let o=0,h=r.length;o<h;o++)t.includes(r[o])&&(a=s[r[o]],a&&(a.setAttribute(i,e),"stroke"===i&&a.setAttribute("stroke-width",n),this.addLegend(i,e,r[o])))}addLegend(t,e,i){let n=this.legend.find((t=>t.color===e));n||(n={type:t,color:e,ids:[]},this.legend.push(n)),n.ids.push(i)}clearLegendBy(t){var e;t||(this.legend.length=0);for(let i=(null==(e=this.legend)?void 0:e.length)-1;i>=0;i--)this.legend[i].type===t&&this.legend.splice(i,i)}getLegend(){return this.legend}showSkeleton(){var t;(null==(t=this.skeletonLayers)?void 0:t.length)&&(this.chef.updateLayersVisibility(this.defaultLayers,!1),this.chef.updateLayersVisibility(this.skeletonLayers,!0))}hideSkeleton(){var t;(null==(t=this.skeletonLayers)?void 0:t.length)&&(this.chef.updateLayersVisibility(this.skeletonLayers,!1),this.chef.updateLayersVisibility(this.defaultLayers,!0))}setAssetLabels(t,e){this.chef.setLabelsById(t,e,this.assetType)}getAssetLabelsMap(t){var e,i;if(!t)return;const n=Ni(t);let s=this.getAssetsByType(n);if(!s||!(null==(e=Object.keys(s))?void 0:e.length)){let e=this.chef.getElementById(n);if(e||(e=this.chef.getElementById(t+"-txt-label")),!e)return;s=this.chef.getElementsMap(e),this.assetsMap[n]=s}return s&&(null==(i=Object.keys(s))?void 0:i.length)?s:void 0}getAssetLabelById(t,e){var i,n;const s=this.getAssetLabelsMap(t);if(!s)return;let r=s[e];return r&&(null==(i=null==r?void 0:r.childNodes)?void 0:i.length)?r.childNodes[0].textContent||"":(r=s["l-"+t+"-"+e],r&&(null==(n=null==r?void 0:r.children)?void 0:n.length)?r.children[0].textContent||"":void 0)}clearAssetLabels(){this.chef.clearAssetLabelsByType(this.assetType)}bindAssetsEvents(t){var e;const i=null==(e=this.svg)?void 0:e.querySelector("#"+t);i&&i.querySelectorAll("[id]").forEach((t=>{t instanceof SVGElement&&t.addEventListener("click",this.clickSvgElementHandler)}))}handleClickSvgElement(t){"function"==typeof t.preventDefault&&t.preventDefault(),this.dispatchEvent({type:"click",data:t})}socialDistanceEnableChanged(t){this.socialDistanceEnable=!!t,t?this.painter.drawSocialDistanceCircles(this.svg):this.painter.clearSocialDistanceCircles(this.svg)}highlightAssets(t,e){var i;this.resetHighlightAssets(t);const n=this.getAssetsByType(t);n&&(null==(i=Object.keys(n))?void 0:i.length)&&(this._lastHighlightType=t,this._lastHighlightIds=Array.isArray(e)?e:[e],this._lastHighlightIds.forEach((t=>{t&&n[t]&&Cs(n[t],"active")})))}resetHighlightAssets(t){var e;const i=this.getAssetsByType(t||this._lastHighlightType);i&&(null==(e=Object.keys(i))?void 0:e.length)&&(this._lastHighlightIds.forEach((t=>{t&&i[t]&&Is(i[t],"active")})),this._lastHighlightIds.length=0)}getIntersectObjects(t,e=Ti.RM,i=[]){i.length=0;const n=[],s=this.getAssetsByType(e);if(!s)return i;const r=ri.keys(s);for(let e=0,i=r.length;e<i;e++){const i=this.chef.getElementBoundingBox(s[r[e]].id);i&&i.containsPoint(t.worldCoords)&&n.push(s[r[e]])}const a=ri.sortBy(n,(t=>{var e;return null==(e=this.chef.getElementBoundingBox(t.id))?void 0:e.getArea()}));return i.push(...a),i}clearSelected(){var t,e;if(null==(t=this.selectedList)?void 0:t.length)for(let t=(null==(e=this.selectedList)?void 0:e.length)-1;t>=0;t--){let e=this.selectedList[t];this.selectedList.splice(t,1),this.chef.setElementState2selected(e,!1)}}clearSelectedById(t){var e,i;let n=null==(e=this.selectedList)?void 0:e.findIndex((e=>e.getAttribute("id")===t));n>-1&&(this.chef.setElementState2selected(this.selectedList[n],!1),null==(i=this.selectedList)||i.splice(n||0,1))}selectByIds(t,e=!1){Array.isArray(t)||(t=[t]),e||this.clearSelected();const i=ri.uniq(ri.map(this.selectedList,(t=>t.getAttribute("id")||""))),n=this.getAssetsByType(this.assetType);if(n){for(let e=t.length-1;e>=0;e--)i.includes(t[e])?(this.clearSelectedById(t[e]),t.splice(e,1)):Object.hasOwnProperty.call(n,t[e])&&this.selectedList.push(n[t[e]]);this.selectedList.forEach((t=>{this.chef.setElementState2selected(t,!0)}))}}getSelectedIds(){var t;if(!(null==(t=this.selectedList)?void 0:t.length))return;const e=[];for(let t=0,i=this.selectedList.length;t<i;t++)this.selectedList[t].id&&e.push(this.selectedList[t].id);return e}getSelectedBoundingBox(){var t;const e=new ai;return(null==(t=this.selectedList)?void 0:t.length)?(this.selectedList.forEach((t=>{const i=this.chef.boundingBoxMap[t.id];i&&e.expandByBox(i)})),e):e.copy(this.boundingBox)}getElementsByBox(t){const e=[],i=Object.keys(this.chef.boundingBoxMap),n=this.getAssetsByType(this.assetType);if(!n)return e;for(let s=0,r=i.length;s<r;s++)if(n.hasOwnProperty(i[s])&&!(i[s].indexOf("-assets")>-1)&&t.intersectsBox(this.chef.boundingBoxMap[i[s]])){const t=n[i[s]];t&&e.push(t)}return e}getBoundingBoxByIds(t){var e,i;if(!t||Array.isArray(t)&&!t.length)return;Array.isArray(t)||(t=[t]);const n=new ai;for(let s=0,r=null==t?void 0:t.length;s<r;s++)(null==(i=null==(e=this.chef)?void 0:e.boundingBoxMap)?void 0:i.hasOwnProperty(t[s]))&&n.expandByBox(this.chef.boundingBoxMap[t[s]]);return n}getBoundingBoxById(t){if(this.chef.boundingBoxMap.hasOwnProperty(t))return(new ai).copy(this.chef.boundingBoxMap[t])}linkAssetsByTree(t){this.chef.linkAssetsByTree(this.assetType,t);const e=this.chef.getElementById(Ii.ASSET_LABELS);e&&(e.style.display="block");const i=Ni(this.assetType),n=this.chef.getElementById(i);n&&(n.style.display="block");const s=this.assetsMap[i];s&&(this._lastLinkedIds.forEach((t=>{s[t]&&(s[t].style.display="none")})),this._lastLinkedIds=Mi(t),this._lastLinkedIds.forEach((t=>{s[t]&&(s[t].style.display="block")})))}onBeforeRender(){}fullscreen(t=1e3,e=!1){}update(){}}class Ls extends Ds{constructor(t){super(t),d(this,"name","SvgLoadingScene"),this.bind('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">\n <view id="defaultView" viewBox="-200 -200 500 500" />\n <style>\n /*#svg-loading-fast circle {animation: svg-loading-fast 2s ease infinite;}*/\n /*@keyframes svg-loading-fast {*/\n /* 0% {stroke-dasharray: 250; stroke-dashoffset: 250;}*/\n /* 50% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}*/\n /*}*/\n #svg-loading-fast .line {animation: svg-loading-fast 3s ease infinite;}\n @keyframes svg-loading-fast {\n 0% {stroke-dasharray: 250; stroke-dashoffset: 250; opacity: 1;}\n 50% {stroke-dasharray: 250; stroke-dashoffset: 0; opacity: 0.5;}\n }\n #svg-loading-fast path {animation: pathFrames 6s ease infinite;}\n @keyframes pathFrames {\n 0% {opacity: 1;}\n 50% {opacity: 0.5;}\n }\n #svg-loading-fast .triangle {animation: triangleFrames 1s ease infinite;}\n @keyframes triangleFrames {\n 0% {opacity: 1;}\n 50% {opacity: 0.3;}\n }\n #svg-loading-fast {fill: #525252}\n .line {stroke: #525252; stroke-width: 4px}\n .triangle {fill: #F26666}\n </style>\n <g id="svg-loading-fast">\n\x3c!-- <text x="50" y="55" style="text-anchor: middle; fill: #5CC9F5; font-size: 15px;">loading</text>--\x3e\n\x3c!-- <circle cx="103" cy="25" r="103" style="fill: none; stroke: #5CC9F5; stroke-width: 1px;" />--\x3e\n <path d="M14 35.7L14 15L21.27 15L21.27 33L34.59 33L33.08 35.7L14 35.7Z" />\n <path d="M44.78 17.77L44.78 32.93L55.4 32.93L55.4 15L62.71 15L62.71 35.7L37.47 35.7L37.47 15L55.4 15L52.88 17.77L44.78 17.77Z" />\n <path d="M76.39 27.92L85.03 27.92L82.9 30.77L75.2 30.77L73.29 35.7L65.59 35.7L73.94 15L87.19 15L95.58 35.7L87.94 35.7L85.03 27.92L81.14 17.77L79.99 17.77L76.39 27.92Z" />\n <path d="M123.73 32.78L120.88 35.7L98.46 35.7L98.46 15L116.53 15L113.97 17.84L105.66 17.84L105.66 32.93L116.53 32.93L116.53 15L121.14 15L123.73 17.7L123.73 32.78Z" />\n <path d="M133.63 35.7L126.61 35.7L126.61 15L133.63 15L133.63 35.7Z" />\n <path d="M153.75 35.7L143.78 21.3L143.78 35.7L136.51 35.7L136.51 15L144.64 15L154.58 29.65L154.58 15L161.78 15L161.78 35.7L153.75 35.7Z" />\n <path d="M182.73 33L182.73 25.73L177.37 25.73L177.37 22.99L189.93 22.99L189.93 35.7L182.73 35.7L182.73 33.5L180.57 35.7L164.66 35.7L164.66 15L190.04 15L188.46 17.7L172.04 17.7L172.04 33L182.73 33Z" />\n\x3c!-- <rect class="line" width="207" height="5" x="0" y="43" />--\x3e\n\x3c!-- <path class="line" d="M0 43L207 43" />--\x3e\n <path class="line" d="M103.5 46L0 46" />\n <path class="line" d="M103.5 46L207 46" />\n <path class="triangle" d="M103.5 56L133.5 90L73.5 90Z" />\n </g>\n </svg>')}}var Bs,Ps={exports:{}};Bs=Ps,function(t,e,i,n){var s,r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o=Math.round,h=Math.abs,l=Date.now;function u(t,e,i){return setTimeout(y(t,i),e)}function c(t,e,i){return!!Array.isArray(t)&&(d(t,i[e],i),!0)}function d(t,e,i){var s;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==n)for(s=0;s<t.length;)e.call(i,t[s],s,t),s++;else for(s in t)t.hasOwnProperty(s)&&e.call(i,t[s],s,t)}function p(e,i,n){var s="DEPRECATED METHOD: "+i+"\n"+n+" AT \n";return function(){var i=new Error("get-stack-trace"),n=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=t.console&&(t.console.warn||t.console.log);return r&&r.call(t.console,s,n),e.apply(this,arguments)}}s="function"!=typeof Object.assign?function(t){if(t===n||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var s=arguments[i];if(s!==n&&null!==s)for(var r in s)s.hasOwnProperty(r)&&(e[r]=s[r])}return e}:Object.assign;var f=p((function(t,e,i){for(var s=Object.keys(e),r=0;r<s.length;)(!i||i&&t[s[r]]===n)&&(t[s[r]]=e[s[r]]),r++;return t}),"extend","Use `assign`."),m=p((function(t,e){return f(t,e,!0)}),"merge","Use `assign`.");function g(t,e,i){var n,r=e.prototype;(n=t.prototype=Object.create(r)).constructor=t,n._super=r,i&&s(n,i)}function y(t,e){return function(){return t.apply(e,arguments)}}function v(t,e){return"function"==typeof t?t.apply(e&&e[0]||n,e):t}function x(t,e){return t===n?e:t}function b(t,e,i){d(E(e),(function(e){t.addEventListener(e,i,!1)}))}function w(t,e,i){d(E(e),(function(e){t.removeEventListener(e,i,!1)}))}function _(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function S(t,e){return t.indexOf(e)>-1}function E(t){return t.trim().split(/\s+/g)}function A(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function M(t){return Array.prototype.slice.call(t,0)}function T(t,e,i){for(var n=[],s=[],r=0;r<t.length;){var a=t[r][e];A(s,a)<0&&n.push(t[r]),s[r]=a,r++}return n.sort((function(t,i){return t[e]>i[e]}))}function C(t,e){for(var i,s,a=e[0].toUpperCase()+e.slice(1),o=0;o<r.length;){if((s=(i=r[o])?i+a:e)in t)return s;o++}return n}var I=1;function D(e){var i=e.ownerDocument||e;return i.defaultView||i.parentWindow||t}var L="ontouchstart"in t,B=C(t,"PointerEvent")!==n,P=L&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),k="touch",N="mouse",O=["x","y"],R=["clientX","clientY"];function z(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){v(t.options.enable,[t])&&i.handler(e)},this.init()}function H(t,e,i){var s=i.pointers.length,r=i.changedPointers.length,a=1&e&&s-r==0,o=12&e&&s-r==0;i.isFirst=!!a,i.isFinal=!!o,a&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,s=e.pointers,r=s.length;i.firstInput||(i.firstInput=F(e)),r>1&&!i.firstMultiple?i.firstMultiple=F(e):1===r&&(i.firstMultiple=!1);var a=i.firstInput,o=i.firstMultiple,u=o?o.center:a.center,c=e.center=W(s);e.timeStamp=l(),e.deltaTime=e.timeStamp-a.timeStamp,e.angle=j(u,c),e.distance=q(u,c),function(t,e){var i=e.center,n=t.offsetDelta||{},s=t.prevDelta||{},r=t.prevInput||{};1!==e.eventType&&4!==r.eventType||(s=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=s.x+(i.x-n.x),e.deltaY=s.y+(i.y-n.y)}(i,e),e.offsetDirection=V(e.deltaX,e.deltaY);var d,p,f=U(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=f.x,e.overallVelocityY=f.y,e.overallVelocity=h(f.x)>h(f.y)?f.x:f.y,e.scale=o?(d=o.pointers,q((p=s)[0],p[1],R)/q(d[0],d[1],R)):1,e.rotation=o?function(t,e){return j(e[1],e[0],R)+j(t[1],t[0],R)}(o.pointers,s):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,s,r,a,o=t.lastInterval||e,l=e.timeStamp-o.timeStamp;if(8!=e.eventType&&(l>25||o.velocity===n)){var u=e.deltaX-o.deltaX,c=e.deltaY-o.deltaY,d=U(l,u,c);s=d.x,r=d.y,i=h(d.x)>h(d.y)?d.x:d.y,a=V(u,c),t.lastInterval=e}else i=o.velocity,s=o.velocityX,r=o.velocityY,a=o.direction;e.velocity=i,e.velocityX=s,e.velocityY=r,e.direction=a}(i,e);var m=t.element;_(e.srcEvent.target,m)&&(m=e.srcEvent.target),e.target=m}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function F(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:o(t.pointers[i].clientX),clientY:o(t.pointers[i].clientY)},i++;return{timeStamp:l(),pointers:e,center:W(e),deltaX:t.deltaX,deltaY:t.deltaY}}function W(t){var e=t.length;if(1===e)return{x:o(t[0].clientX),y:o(t[0].clientY)};for(var i=0,n=0,s=0;s<e;)i+=t[s].clientX,n+=t[s].clientY,s++;return{x:o(i/e),y:o(n/e)}}function U(t,e,i){return{x:e/t||0,y:i/t||0}}function V(t,e){return t===e?1:h(t)>=h(e)?t<0?2:4:e<0?8:16}function q(t,e,i){i||(i=O);var n=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return Math.sqrt(n*n+s*s)}function j(t,e,i){i||(i=O);var n=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return 180*Math.atan2(s,n)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&b(this.element,this.evEl,this.domHandler),this.evTarget&&b(this.target,this.evTarget,this.domHandler),this.evWin&&b(D(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(D(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4};function G(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,z.apply(this,arguments)}g(G,z,{handler:function(t){var e=Y[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:N,srcEvent:t}))}});var $={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},X={2:k,3:"pen",4:N,5:"kinect"},Z="pointerdown",J="pointermove pointerup pointercancel";function Q(){this.evEl=Z,this.evWin=J,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(Z="MSPointerDown",J="MSPointerMove MSPointerUp MSPointerCancel"),g(Q,z,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),s=$[n],r=X[t.pointerType]||t.pointerType,a=r==k,o=A(e,t.pointerId,"pointerId");1&s&&(0===t.button||a)?o<0&&(e.push(t),o=e.length-1):12&s&&(i=!0),o<0||(e[o]=t,this.callback(this.manager,s,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(o,1))}});var K={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function tt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,z.apply(this,arguments)}function et(t,e){var i=M(t.touches),n=M(t.changedTouches);return 12&e&&(i=T(i.concat(n),"identifier")),[i,n]}g(tt,z,{handler:function(t){var e=K[t.type];if(1===e&&(this.started=!0),this.started){var i=et.call(this,t,e);12&e&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:k,srcEvent:t})}}});var it={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function nt(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},z.apply(this,arguments)}function st(t,e){var i=M(t.touches),n=this.targetIds;if(3&e&&1===i.length)return n[i[0].identifier]=!0,[i,i];var s,r,a=M(t.changedTouches),o=[],h=this.target;if(r=i.filter((function(t){return _(t.target,h)})),1===e)for(s=0;s<r.length;)n[r[s].identifier]=!0,s++;for(s=0;s<a.length;)n[a[s].identifier]&&o.push(a[s]),12&e&&delete n[a[s].identifier],s++;return o.length?[T(r.concat(o),"identifier"),o]:void 0}function rt(){z.apply(this,arguments);var t=y(this.handler,this);this.touch=new nt(this.manager,t),this.mouse=new G(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function at(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,ot.call(this,e)):12&t&&ot.call(this,e)}function ot(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),2500)}}function ht(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var s=this.lastTouches[n],r=Math.abs(e-s.x),a=Math.abs(i-s.y);if(r<=25&&a<=25)return!0}return!1}g(nt,z,{handler:function(t){var e=it[t.type],i=st.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:k,srcEvent:t})}}),g(rt,z,{handler:function(t,e,i){var n=i.pointerType==k,s=i.pointerType==N;if(!(s&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)at.call(this,e,i);else if(s&&ht.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var lt=C(a.style,"touchAction"),ut=lt!==n,ct="compute",dt="auto",pt="manipulation",ft="none",mt="pan-x",gt="pan-y",yt=function(){if(!ut)return!1;var e={},i=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){e[n]=!i||t.CSS.supports("touch-action",n)})),e}();function vt(t,e){this.manager=t,this.set(e)}vt.prototype={set:function(t){t==ct&&(t=this.compute()),ut&&this.manager.element.style&&yt[t]&&(this.manager.element.style[lt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return d(this.manager.recognizers,(function(e){v(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(S(t,ft))return ft;var e=S(t,mt),i=S(t,gt);return e&&i?ft:e||i?e?mt:gt:S(t,pt)?pt:dt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,s=S(n,ft)&&!yt[ft],r=S(n,gt)&&!yt[gt],a=S(n,mt)&&!yt[mt];if(s){var o=1===t.pointers.length,h=t.distance<2,l=t.deltaTime<250;if(o&&h&&l)return}if(!a||!r)return s||r&&6&i||a&&24&i?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var xt=32;function bt(t){this.options=s({},this.defaults,t||{}),this.id=I++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function wt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function _t(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function St(t,e){var i=e.manager;return i?i.get(t):t}function Et(){bt.apply(this,arguments)}function At(){Et.apply(this,arguments),this.pX=null,this.pY=null}function Mt(){Et.apply(this,arguments)}function Tt(){bt.apply(this,arguments),this._timer=null,this._input=null}function Ct(){Et.apply(this,arguments)}function It(){Et.apply(this,arguments)}function Dt(){bt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Lt(t,e){return(e=e||{}).recognizers=x(e.recognizers,Lt.defaults.preset),new Bt(t,e)}function Bt(t,e){this.options=s({},Lt.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new(this.options.inputClass||(B?Q:P?nt:L?rt:G))(this,H),this.touchAction=new vt(this,this.options.touchAction),Pt(this,!0),d(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function Pt(t,e){var i,n=t.element;n.style&&(d(t.options.cssProps,(function(s,r){i=C(n.style,r),e?(t.oldCssProps[i]=n.style[i],n.style[i]=s):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}bt.prototype={defaults:{},set:function(t){return s(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(c(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=St(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return c(t,"dropRecognizeWith",this)||(t=St(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(c(t,"requireFailure",this))return this;var e=this.requireFail;return-1===A(e,t=St(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(c(t,"dropRequireFailure",this))return this;t=St(t,this);var e=A(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+wt(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+wt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=xt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=s({},t);if(!v(this.options.enable,[this,e]))return this.reset(),void(this.state=xt);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},g(Et,bt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=6&e,s=this.attrTest(t);return n&&(8&i||!s)?16|e:n||s?4&i?8|e:2&e?4|e:2:xt}}),g(At,Et,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push(gt),24&t&&e.push(mt),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,s=t.direction,r=t.deltaX,a=t.deltaY;return s&e.direction||(6&e.direction?(s=0===r?1:r<0?2:4,i=r!=this.pX,n=Math.abs(t.deltaX)):(s=0===a?1:a<0?8:16,i=a!=this.pY,n=Math.abs(t.deltaY))),t.direction=s,i&&n>e.threshold&&s&e.direction},attrTest:function(t){return Et.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=_t(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),g(Mt,Et,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ft]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),g(Tt,bt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[dt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,s=t.deltaTime>e.time;if(this._input=t,!n||!i||12&t.eventType&&!s)this.reset();else if(1&t.eventType)this.reset(),this._timer=u((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return xt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}}),g(Ct,Et,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ft]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),g(It,Et,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return At.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return 30&i?e=t.overallVelocity:6&i?e=t.overallVelocityX:24&i&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&h(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=_t(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),g(Dt,bt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[pt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,s=t.deltaTime<e.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(n&&s&&i){if(4!=t.eventType)return this.failTimeout();var r=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||q(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&r?this.count+=1:this.count=1,this._input=t,0==this.count%e.taps)return this.hasRequireFailures()?(this._timer=u((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return xt},failTimeout:function(){return this._timer=u((function(){this.state=xt}),this.options.interval,this),xt},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Lt.VERSION="2.0.7",Lt.defaults={domEvents:!1,touchAction:ct,enable:!0,inputTarget:null,inputClass:null,preset:[[Ct,{enable:!1}],[Mt,{enable:!1},["rotate"]],[It,{direction:6}],[At,{direction:6},["swipe"]],[Dt],[Dt,{event:"doubletap",taps:2},["tap"]],[Tt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Bt.prototype={set:function(t){return s(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,s=e.curRecognizer;(!s||s&&8&s.state)&&(s=e.curRecognizer=null);for(var r=0;r<n.length;)i=n[r],2===e.stopped||s&&i!=s&&!i.canRecognizeWith(s)?i.reset():i.recognize(t),!s&&14&i.state&&(s=e.curRecognizer=i),r++}},get:function(t){if(t instanceof bt)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(c(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(c(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=A(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==n&&e!==n){var i=this.handlers;return d(E(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this}},off:function(t,e){if(t!==n){var i=this.handlers;return d(E(t),(function(t){e?i[t]&&i[t].splice(A(i[t],e),1):delete i[t]})),this}},emit:function(t,i){this.options.domEvents&&function(t,i){var n=e.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=i,i.target.dispatchEvent(n)}(t,i);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){i.type=t,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var s=0;s<n.length;)n[s](i),s++}},destroy:function(){this.element&&Pt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},s(Lt,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:xt,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Bt,Input:z,TouchAction:vt,TouchInput:nt,MouseInput:G,PointerEventInput:Q,TouchMouseInput:rt,SingleTouchInput:tt,Recognizer:bt,AttrRecognizer:Et,Tap:Dt,Pan:At,Swipe:It,Pinch:Mt,Rotate:Ct,Press:Tt,on:b,off:w,each:d,merge:m,extend:f,assign:s,inherit:g,bindFn:y,prefixed:C}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Lt,Bs.exports?Bs.exports=Lt:t.Hammer=Lt}(window,document);const ks=S(Ps.exports),Ns=new Fe,Os=new Fe;class Rs extends zi{constructor(t,e,i=!1){super(),d(this,"name","orbit-controller.ts"),d(this,"isSvg",!1),d(this,"dom"),d(this,"domOffset",new Fe),d(this,"camera"),d(this,"hammer"),d(this,"enabled",!0),d(this,"enablePan",!0),d(this,"enableRotate",!0),d(this,"rotateSpeed",1),d(this,"enableZoom",!0),d(this,"minZoom",0),d(this,"maxZoom",1/0),d(this,"zoomSpeed",1),d(this,"zoomChanged",!1),d(this,"distanceStart",1),d(this,"distanceEnd",1),d(this,"state",-1),d(this,"EPS",1e-6),d(this,"focus",new Fe),d(this,"target",new Fe),d(this,"scaled",1),d(this,"rotateTheta",0),d(this,"enableDamping",!1),d(this,"dampingFactor",.05),d(this,"mouseButtons",{LEFT:2,MIDDLE:1,RIGHT:0}),d(this,"isWheeling",!1),d(this,"finalTimer"),d(this,"rotateStart",new Fe),d(this,"rotateEnd",new Fe),d(this,"rotateDelta",new Fe),d(this,"panStart",new Fe),d(this,"panEnd",new Fe),d(this,"panOffset",new Fe),d(this,"dollyStart",0),d(this,"dollyOffset",new Fe),d(this,"contextMenuHandler",this.handleContextMenu.bind(this)),d(this,"wheelHandler",this.handleWheel.bind(this)),d(this,"pointerDownHandler",this.handlePointerDown.bind(this)),d(this,"pointerUpHandler",this.handlePointerUp.bind(this)),d(this,"pointerMoveHandler",this.handlePointerMove.bind(this)),d(this,"pointerOverHandler",ri.debounce(this.handlePointerOver.bind(this),50)),d(this,"pointerLeaveHandler",this.handlePointerLeave.bind(this)),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"doubleTapHandler",this.handleDoubleTap.bind(this)),d(this,"panHandler",this.handlePan.bind(this)),d(this,"pinchHandler",this.handlePinch.bind(this)),d(this,"pressHandler",this.handlePress.bind(this)),d(this,"swipeHandler",this.handleSwipe.bind(this)),d(this,"hammerInputHandler",this.handleHammerInput.bind(this)),this.isSvg=i,this.dom=t,this.camera=e,this.scaled=e.scaled.x,this.resize(),this.dom.style.touchAction="none",this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}update(){this.camera.position.add(this.panOffset).add(this.dollyOffset),this.camera.scaled.set(this.scaled,this.scaled),this.rotateTheta&&(this.camera.rotation.x-=this.rotateTheta,Ns.copy(this.camera.position).rotateAround(this.focus,-this.rotateTheta),this.camera.position.copy(Ns)),this.camera.update(),this.panOffset.set(0,0),this.dollyOffset.set(0,0),this.scaled=this.camera.scaled.x,this.rotateTheta=0,this.dispatchEvent({type:"cameraChanged",data:{t:this.camera.position,r:this.camera.rotation.x,s:this.camera.scaled.x}})}bindEvents(){this.unbindEvents(),this.hammer=new ks.Manager(this.dom,{domEvents:!0});const t=new ks.Pan({threshold:0,pointers:0}),e=new ks.Pinch({threshold:0}),i=new ks.Tap({event:"singletap",taps:1}),n=new ks.Tap({event:"doubletap",taps:2}),s=new ks.Press({});this.hammer.add([t,n,i,s,e]),e.recognizeWith(t),n.recognizeWith(i),i.requireFailure(n),this.hammer.on(["panstart","panmove","panend"].join(" "),this.panHandler),this.hammer.on(["pinchstart","pinchmove","pinchend"].join(" "),this.pinchHandler),this.hammer.on("singletap",this.tapHandler),this.hammer.on("doubletap",this.doubleTapHandler),this.hammer.on("press",this.pressHandler),this.hammer.on("swipe",this.swipeHandler),this.hammer.on("hammer.input",this.hammerInputHandler),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("wheel",this.wheelHandler,{passive:!1}),this.dom.addEventListener("mousemove",this.pointerOverHandler),this.isSvg||(this.dom.addEventListener("pointerdown",this.pointerDownHandler),this.dom.addEventListener("pointerleave",this.pointerLeaveHandler))}unbindEvents(){var t,e,i,n,s,r,a,o,h;null==(t=this.hammer)||t.off(["panstart","panmove","panend"].join(" "),this.panHandler),null==(e=this.hammer)||e.off(["pinchstart","pinchmove","pinchend"].join(" "),this.pinchHandler),null==(i=this.hammer)||i.off("singletap",this.tapHandler),null==(n=this.hammer)||n.off("doubletap",this.doubleTapHandler),null==(s=this.hammer)||s.off("press",this.pressHandler),null==(r=this.hammer)||r.off("swipe",this.swipeHandler),null==(a=this.hammer)||a.off("hammer.input",this.hammerInputHandler),this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("wheel",this.wheelHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler),this.isSvg||(this.dom.removeEventListener("pointerdown",this.pointerDownHandler),this.dom.removeEventListener("pointerleave",this.pointerLeaveHandler)),null==(o=this.hammer)||o.stop(!0),null==(h=this.hammer)||h.destroy()}setFocus(t,e){this.focus.set(t,e).sub(this.domOffset).unproject(this.camera)}handleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),Os.set(t.center.x,t.center.y).sub(this.domOffset);const e={x:Os.x,y:Os.y};this.camera&&Os.unproject(this.camera);const i={x:Os.x,y:Os.y};this.dispatchEvent({type:"tap",data:{screenCoords:e,worldCoords:i},e:t})}handleDoubleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),Os.set(t.center.x,t.center.y).sub(this.domOffset);const e={x:Os.x,y:Os.y};this.camera&&Os.unproject(this.camera);const i={x:Os.x,y:Os.y};this.dispatchEvent({type:"doubletap",data:{screenCoords:e,worldCoords:i}})}handlePress(t){"function"==typeof t.preventDefault&&t.preventDefault()}handlePan(t){var e;if(this.scaled=this.camera.scaled.x,1!==(null==(e=t.pointers)?void 0:e.length))return;"function"==typeof t.preventDefault&&t.preventDefault();const i={type:"panmove",data:{}};(t.isFirst||"panstart"===t.type)&&(this.state=2,this.panStart.set(t.center.x,t.center.y),i.type="panstart"),(t.isFinal||"panend"===t.type)&&(this.state=-1,i.type="panend"),this.panEnd.set(t.center.x,t.center.y),this.panOffset.subVectors(this.panEnd,this.panStart).multiplyScalar(-this.camera.scaled.x,-this.camera.scaled.y*(this.camera.flipY?1:-1)).rotate(this.camera.rotation.x),this.panStart.copy(this.panEnd),Os.set(t.center.x,t.center.y).sub(this.domOffset),i.data.screenCoords=Os.clone(),this.dispatchEvent(i),this.enablePan&&this.update()}handlePinch(t){"function"==typeof t.preventDefault&&t.preventDefault(),"pinchstart"===t.type&&(this.dollyStart=this.camera.scaled.x,this.state=1),(t.isFinal||"pinchend"===t.type)&&(this.state=-1),this.scaled=this.dollyStart*(1/t.scale);let e=(this.scaled-this.camera.scaled.x)/this.camera.scaled.x;this.setFocus(t.center.x,t.center.y),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-e).sub(this.camera.position),this.update()}handleRotate(t){"function"==typeof t.preventDefault&&t.preventDefault()}handleSwipe(t){"function"==typeof t.preventDefault&&t.preventDefault()}handleHammerInput(t){t.isFirst&&(this.state=9),t.isFinal&&(this.state=-1)}handleContextMenu(t){this.enabled&&"function"==typeof t.preventDefault&&t.preventDefault()}handleWheel(t){if("function"==typeof t.preventDefault&&t.preventDefault(),!this.enabled||!this.enableZoom||-1!==this.state)return;this.isWheeling||(this.dispatchEvent({type:"wheelstart"}),this.isWheeling=!0),"function"==typeof t.preventDefault&&t.preventDefault(),"function"==typeof t.stopPropagation&&t.stopPropagation();let e=t.deltaY;1===(null==t?void 0:t.deltaMode)?e*=16:2===(null==t?void 0:t.deltaMode)&&(e*=100),(null==t?void 0:t.ctrlKey)&&(e*=10),this.setFocus(t.clientX,t.clientY);let i=this.getZoomScale(e);e<0?this.onDollyIn(i):e>0?this.onDollyOut(i):(this.scaled=this.camera.scaled.x,this.dollyOffset.set(0,0)),this.update(),clearTimeout(this.finalTimer),this.finalTimer=setTimeout((()=>{this.isWheeling&&(this.dispatchEvent({type:"wheelend"}),this.isWheeling=!1)}),500)}onDollyIn(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x*t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,1-t).sub(this.camera.position)}onDollyOut(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x/t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-1+t).sub(this.camera.position)}getZoomScale(t){return Math.pow(.95,this.zoomSpeed*Math.abs(.03*t))}handlePointerDown(t){if(this.scaled=this.camera.scaled.x,!this.enabled)return;if(2!==t.button)return;this.dom.addEventListener("pointermove",this.pointerMoveHandler),this.dom.addEventListener("pointerup",this.pointerUpHandler);let e=-1;0===t.button?e=this.mouseButtons.LEFT:1===t.button?e=this.mouseButtons.MIDDLE:2===t.button&&(e=this.mouseButtons.RIGHT),0===e&&(this.rotateStart.set(t.clientX,t.clientY),this.setFocus(this.rotateStart.x,this.rotateStart.y),this.state=0)}handlePointerUp(){this.dom.removeEventListener("pointermove",this.pointerMoveHandler),this.dom.removeEventListener("pointerup",this.pointerUpHandler),this.state=-1}handlePointerLeave(){this.state=-1}handlePointerMove(t){if(this.enabled&&0===this.state){if(!this.enableRotate)return;this.onRotate(t.clientX,t.clientY)}}handlePointerOver(t){if(t.buttons>0)return;Os.set(t.clientX,t.clientY).sub(this.domOffset);const e={x:Os.x,y:Os.y};Os.unproject(this.camera);const i={x:Os.x,y:Os.y};this.dispatchEvent({type:"pointerover",data:{screenCoords:e,worldCoords:i},e:t})}onRotate(t,e){this.rotateEnd.set(t,e),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const i=this.rotateDelta.x*Math.PI*2/this.dom.clientHeight;this.rotateTheta-=i,this.rotateStart.copy(this.rotateEnd),this.update()}}var zs=(t=>(t.CONTEXTMENU="contextmenu",t.LOSTPOINTERCAPTURE="lostpointercapture",t.MOUSEOVER="mouseover",t.MOUSEOUT="mouseout",t.MOUSELEAVE="mouseleave",t.MOUSEENTER="mouseenter",t.MOUSEMOVE="mousemove",t.MOUSEDOWN="mousedown",t.MOUSEUP="mouseup",t.POINTERMOVE="pointermove",t.POINTERDOWN="pointerdown",t.POINTERUP="pointerup",t.POINTERCANCEL="pointercancel",t.POINTEROUT="pointerout",t.POINTERLEAVE="pointerleave",t.POINTEROVER="pointerover",t.POINTERENTER="pointerenter",t.TOUCHSTART="touchstart",t.TOUCHEND="touchend",t.TOUCHMOVE="touchmove",t.TOUCHCANCEL="touchcancel",t.WHEEL="wheel",t.WHEEL_START="wheelstart",t.WHEEL_END="wheelend",t.MOUSEWHEEL="mousewheel",t.CLICK="click",t.DBLCLICK="dblclick",t.CONTEXT_LOST="contextlost",t.CONTEXT_RESTORED="contextrestored",t.CONTROLS_CHANGED="controlschanged",t.TAP="tap",t.SINGLE_TAP="singletap",t.DOUBLE_TAP="doubletap",t.PRESS="press",t.PAN="pan",t.PAN_START="panstart",t.PAN_MOVE="panmove",t.PAN_END="panend",t.ROTATE="rotate",t.ROTATE_START="rotatestart",t.ROTATE_MOVE="rotatemove",t.ROTATE_END="rotateend",t.PINCH="pinch",t.PINCH_START="pinchstart",t.PINCH_MOVE="pinchmove",t.PINCH_END="pinchend",t.PINCH_IN="pinchin",t.PINCH_OUT="pinchout",t.SWIPE="swipe",t.CHANGE_START="change_start",t.CHANGE_END="change_end",t.CAMERA_CHANGED="cameraChanged",t))(zs||{});const Hs=new Fe;class Fs extends is{constructor(t){super(),d(this,"isCamera",!0),d(this,"type","Camera2"),d(this,"name","Camera2"),d(this,"params"),d(this,"matrixAutoUpdate",!1),d(this,"matrixWorldAutoUpdate",!1),d(this,"projectionMatrix",new Hi),d(this,"projectionMatrixInverse",new Hi),d(this,"viewMatrix",new Hi),d(this,"viewMatrixNeedsUpdate",!0),d(this,"viewArea",0),d(this,"left",-1),d(this,"right",1),d(this,"top",1),d(this,"bottom",-1),d(this,"width",2),d(this,"height",2),d(this,"aspect",1),d(this,"view"),this.params=t,this.width=void 0!==(null==t?void 0:t.width)?t.width:2,this.height=void 0!==(null==t?void 0:t.height)?t.height:2,this.aspect=void 0!==(null==t?void 0:t.aspect)?t.aspect:1,void 0!==(null==t?void 0:t.left)&&(this.left=t.left),void 0!==(null==t?void 0:t.right)&&(this.right=t.right),void 0!==(null==t?void 0:t.top)&&(this.top=t.top),void 0!==(null==t?void 0:t.bottom)&&(this.bottom=t.bottom);const e=(this.right+this.left)/2,i=(this.top+this.bottom)/2;if(this.aspect>1){const t=Math.round((this.right-this.left)/2/this.aspect);this.top=i+t,this.bottom=i-t}else if(this.aspect<1){const t=Math.round((this.top-this.bottom)/2*this.aspect);this.left=e-t,this.right=e+t}this.flipY=!0===(null==t?void 0:t.flipY),this.updateProjectionMatrix(),(null==t?void 0:t.eye)&&this.position.fromArray(t.eye),(null==t?void 0:t.up)&&this.up.fromArray(t.up),this.computeBoundingBox(),this.update()}destroy(){super.destroy()}get pixelWidth(){return this.scaled.x}set(t=-1,e=1,i=1,n=-1){Hs.set(t+e,n+i).multiplyScalar(.5);const s=Math.max((e-t)/this.width,(i-n)/this.height);this.setTRS(Hs,0,s)}setByBox(t){t&&!t.isEmpty()&&this.set(t.min.x,t.max.x,t.max.y,t.min.y)}setTRS(t={x:0,y:0},e=0,i=0){this.position.set(t.x||0,t.y||0),this.rotation.set(e,e),this.scaled.set(i,i),this.update()}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.width=t||2,this.height=e||2,this.left=this.params.left||-1,this.right=this.params.right||1,this.top=this.params.top||1,this.bottom=this.params.bottom||-1,this.aspect=t/e;const i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;if(this.aspect>1){const t=Math.round((this.right-this.left)/2/this.aspect);this.top=n+t,this.bottom=n-t}else if(this.aspect<1){const t=Math.round((this.top-this.bottom)/2*this.aspect);this.left=i-t,this.right=i+t}this.updateProjectionMatrix(),this.boundingBox.min.set(this.left,this.bottom),this.boundingBox.max.set(this.right,this.top),this.update(),this.matrix.decompose(this.position,this.rotation,this.scaled)}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[6],-e[7]).normalize()}getCameraPosition(){return{x:this.position.x,y:this.position.y,z:this.position.z,s:this.scaled.x,r:this.rotation.x}}updateMatrixWorld(t=!1){super.updateMatrixWorld(t),this.updateViewMatrix()}updateProjectionMatrix(){void 0===this.parent&&this.matrixWorldAutoUpdate&&this.updateMatrixWorld(),this.projectionMatrix.makeProjection(this.left,this.right,this.top,this.bottom,this.width,this.height),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}updateViewMatrix(){this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.viewMatrix.multiplyMatrices(this.projectionMatrix,this.matrixWorldInverse)}update(t=!0){this.matrixAutoUpdate||this.updateMatrix(),this.updateMatrixWorld(),this.needsUpdate=!0,this.updateBoundingBox(),t&&this.dispatchEvent({type:"update",data:{t:this.position,r:this.rotation.x,s:this.scaled.x}})}computeBoundingBox(){return this.boundingBox.min.set(this.left,this.bottom),this.boundingBox.max.set(this.right,this.top),this.boundingBox}updateBoundingBox(){super.updateBoundingBox(),this.viewArea=this.boundingBoxWorld.getArea()}toJSON(){const t={};return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.width=this.width,t.height=this.height,t.aspect=this.aspect,t.position=this.position.toArray(),t.rotation=this.rotation.toArray(),t.scaled=this.scaled.toArray(),t}fromJSON(t){this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.position.fromArray(t.position),this.rotation.fromArray(t.rotation),this.scaled.fromArray(t.scaled),this.updateProjectionMatrix(),this.update(!1)}clone(){return(new this.constructor.prototype.constructor).copy(this)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this}}var Ws=(t=>(t.UPDATE="update",t))(Ws||{});class Us extends zi{constructor(t){super(),d(this,"name","SvgSelectRect"),d(this,"container"),d(this,"el"),this.container=t||document.getElementsByTagName("body")[0],this.el=document.createElement("div"),this.el.setAttribute("id","aeSvgSelectRect"),this.el.setAttribute("class","ae-svg-select-rect"),this.el.style.display="none",this.container.appendChild(this.el)}destroy(){super.destroy(),this.el&&this.el.remove()}draw(t){Vs.copy(t).getSize(js),qs.copy(Vs.min),this.el.style.display="none",this.el.style.position="absolute",this.el.style.left=qs.x+"px",this.el.style.top=qs.y+"px",this.el.style.width=js.x+"px",this.el.style.height=js.y+"px",this.el.style.display="block",this.el.style.background=new Re(Le.darkBlue).setA(.1).getStyle(),this.el.style.border=Le.darkBlue+" 1px dashed"}hide(){this.el.style.display="none"}}const Vs=new ai,qs=new Fe,js=new Fe;class Ys extends zi{constructor(t,e){super(),d(this,"name","SvgMultiSelector"),d(this,"controller"),d(this,"scene"),d(this,"container"),d(this,"p1",new Fe),d(this,"p2",new Fe),d(this,"graph"),d(this,"selectEnable",!1),d(this,"multiSelectEnable",!1),d(this,"fnEnable",!1),d(this,"controllerTapHandler",this.handleControllerTap.bind(this)),d(this,"controllerPanStartHandler",this.handleControllerPanStart.bind(this)),d(this,"controllerPanMoveHandler",this.handleControllerPanMove.bind(this)),d(this,"controllerPanEndHandler",this.handleControllerPanEnd.bind(this)),this.container=t,this.controller=e,this.graph=new Us(t),this.bindControllerEvents()}destroy(){this.unbindControllerEvents(),super.destroy()}bindScene(t){this.scene=t}selectEnableChanged(t){var e;null==(e=this.scene)||e.clearSelected(),this.selectEnable=!!t}multiSelectEnableChanged(t){var e;null==(e=this.scene)||e.clearSelected(),this.multiSelectEnable=!!t,this.controller.enablePan=!this.multiSelectEnable||this.multiSelectEnable&&!this.fnEnable}fnEnableChanged(t){this.fnEnable=!!t,this.controller.enablePan=!this.multiSelectEnable||this.multiSelectEnable&&!this.fnEnable}bindControllerEvents(){this.controller.addEventListener(zs.TAP,this.controllerTapHandler),this.controller.addEventListener(zs.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(zs.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(zs.PAN_END,this.controllerPanEndHandler)}unbindControllerEvents(){this.controller.removeEventListener(zs.TAP,this.controllerTapHandler),this.controller.removeEventListener(zs.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(zs.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(zs.PAN_END,this.controllerPanEndHandler)}handleControllerTap(t){var e,i,n,s,r,a;if((null==t?void 0:t.type)!==zs.TAP)return;if(!this.selectEnable&&!this.multiSelectEnable)return;const o=(null==(e=null==t?void 0:t.e)?void 0:e.target)||(null==(n=null==(i=null==t?void 0:t.e)?void 0:i.srcEvent)?void 0:n.target)||(null==(r=null==(s=null==t?void 0:t.e)?void 0:s.srcEvent)?void 0:r.srcElement);(null==o?void 0:o.id)&&(null==(a=this.scene)?void 0:a.isBelongsToAssetType(null==o?void 0:o.id))&&this.dispatchEvent({type:"SELECTED",data:c(u({},t.data),{target:[o],selected:[null==o?void 0:o.id]})})}handleControllerPanStart(t){(null==t?void 0:t.type)===zs.PAN_START&&this.multiSelectEnable&&(this.controller.enablePan||(this.p1.copy(t.data.screenCoords),$s.makeEmpty().expandByPoint(this.p1),this.graph.draw($s)))}handleControllerPanMove(t){(null==t?void 0:t.type)===zs.PAN_MOVE&&this.multiSelectEnable&&(this.controller.enablePan||(this.p2.copy(t.data.screenCoords),$s.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw($s)))}handleControllerPanEnd(t){var e;if((null==t?void 0:t.type)!==zs.PAN_END)return;if(!this.multiSelectEnable)return;if(this.controller.enablePan)return;this.p2.copy(t.data.screenCoords),$s.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera);const i=null==(e=this.scene)?void 0:e.getElementsByBox($s),n=[];(i||[]).forEach((t=>n.push(t.id))),this.graph.hide(),$s.makeEmpty(),this.dispatchEvent({type:"SELECTED",data:{target:i,selected:n}})}}var Gs=(t=>(t.SELECTED="SELECTED",t))(Gs||{});const $s=new ai;var Xs=(t=>(t.DEFAULT="default",t.INFO="info",t.PRIMARY="primary",t.SUCCESS="success",t.WARNING="warning",t.DANGER="danger",t))(Xs||{});class Zs{constructor(){d(this,"camera"),d(this,"screenCoords",new Fe),d(this,"worldCoords",new Fe),d(this,"worldBox",new ai),d(this,"intersectType",0),d(this,"params",{Shape:{},Line:{threshold:1},Points:{threshold:1},Sprite:{}})}setFromCamera(t,e){return this.camera=e,this.screenCoords.set(t.x,t.y),this.worldCoords.copy(this.screenCoords).unproject(e),this}init(t,e){return this.camera=e,(null==t?void 0:t.screenCoords)&&this.screenCoords.set(t.screenCoords.x,t.screenCoords.y),(null==t?void 0:t.worldCoords)?this.worldCoords.set(t.worldCoords.x,t.worldCoords.y):e&&this.worldCoords.copy(this.screenCoords).unproject(e),(null==t?void 0:t.worldBox)&&this.worldBox.copy(t.worldBox),this.intersectType=void 0!==(null==t?void 0:t.worldBox)?1:0,this}intersectObjects(t,e=!0,i=[]){for(let n=0,s=t.length;n<s;n++)this.intersectObject(t[n],e,i)}intersectObject(t,e=!1,i=[]){if(!t.selectable||!t.visible)return i;if(t.raycast(this,i),!e||t.composeNode)return i;for(let n=0,s=t.children.length;n<s;n++)this.intersectObject(t.children[n],e,i);return i}intersectObjectBy(t,e,i=!0,n=[]){if(!t.selectable||!t.visible)return n;if("function"==typeof e&&e(t)&&t.raycast(this,n),!i||t.composeNode)return n;for(let s=0,r=t.children.length;s<r;s++)this.intersectObjectBy(t.children[s],e,i,n);return n}}var Js="top",Qs="bottom",Ks="right",tr="left",er="auto",ir=[Js,Qs,Ks,tr],nr="start",sr="end",rr="viewport",ar="popper",or=ir.reduce((function(t,e){return t.concat([e+"-"+nr,e+"-"+sr])}),[]),hr=[].concat(ir,[er]).reduce((function(t,e){return t.concat([e,e+"-"+nr,e+"-"+sr])}),[]),lr=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ur(t){return t?(t.nodeName||"").toLowerCase():null}function cr(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function dr(t){return t instanceof cr(t).Element||t instanceof Element}function pr(t){return t instanceof cr(t).HTMLElement||t instanceof HTMLElement}function fr(t){return"undefined"!=typeof ShadowRoot&&(t instanceof cr(t).ShadowRoot||t instanceof ShadowRoot)}const mr={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];pr(s)&&ur(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});pr(n)&&ur(n)&&(Object.assign(n.style,r),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function gr(t){return t.split("-")[0]}var yr=Math.max,vr=Math.min,xr=Math.round;function br(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function wr(){return!/^((?!chrome|android).)*safari/i.test(br())}function _r(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,r=1;e&&pr(t)&&(s=t.offsetWidth>0&&xr(n.width)/t.offsetWidth||1,r=t.offsetHeight>0&&xr(n.height)/t.offsetHeight||1);var a=(dr(t)?cr(t):window).visualViewport,o=!wr()&&i,h=(n.left+(o&&a?a.offsetLeft:0))/s,l=(n.top+(o&&a?a.offsetTop:0))/r,u=n.width/s,c=n.height/r;return{width:u,height:c,top:l,right:h+u,bottom:l+c,left:h,x:h,y:l}}function Sr(t){var e=_r(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Er(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&fr(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ar(t){return cr(t).getComputedStyle(t)}function Mr(t){return["table","td","th"].indexOf(ur(t))>=0}function Tr(t){return((dr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Cr(t){return"html"===ur(t)?t:t.assignedSlot||t.parentNode||(fr(t)?t.host:null)||Tr(t)}function Ir(t){return pr(t)&&"fixed"!==Ar(t).position?t.offsetParent:null}function Dr(t){for(var e=cr(t),i=Ir(t);i&&Mr(i)&&"static"===Ar(i).position;)i=Ir(i);return i&&("html"===ur(i)||"body"===ur(i)&&"static"===Ar(i).position)?e:i||function(t){var e=/firefox/i.test(br());if(/Trident/i.test(br())&&pr(t)&&"fixed"===Ar(t).position)return null;var i=Cr(t);for(fr(i)&&(i=i.host);pr(i)&&["html","body"].indexOf(ur(i))<0;){var n=Ar(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Lr(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Br(t,e,i){return yr(t,vr(e,i))}function Pr(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function kr(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}function Nr(t){return t.split("-")[1]}var Or={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Rr(t){var e,i=t.popper,n=t.popperRect,s=t.placement,r=t.variation,a=t.offsets,o=t.position,h=t.gpuAcceleration,l=t.adaptive,u=t.roundOffsets,c=t.isFixed,d=a.x,p=void 0===d?0:d,f=a.y,m=void 0===f?0:f,g="function"==typeof u?u({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=a.hasOwnProperty("x"),v=a.hasOwnProperty("y"),x=tr,b=Js,w=window;if(l){var _=Dr(i),S="clientHeight",E="clientWidth";_===cr(i)&&"static"!==Ar(_=Tr(i)).position&&"absolute"===o&&(S="scrollHeight",E="scrollWidth"),(s===Js||(s===tr||s===Ks)&&r===sr)&&(b=Qs,m-=(c&&_===w&&w.visualViewport?w.visualViewport.height:_[S])-n.height,m*=h?1:-1),s!==tr&&(s!==Js&&s!==Qs||r!==sr)||(x=Ks,p-=(c&&_===w&&w.visualViewport?w.visualViewport.width:_[E])-n.width,p*=h?1:-1)}var A,M=Object.assign({position:o},l&&Or),T=!0===u?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:xr(i*s)/s||0,y:xr(n*s)/s||0}}({x:p,y:m},cr(i)):{x:p,y:m};return p=T.x,m=T.y,h?Object.assign({},M,((A={})[b]=v?"0":"",A[x]=y?"0":"",A.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",A)):Object.assign({},M,((e={})[b]=v?m+"px":"",e[x]=y?p+"px":"",e.transform="",e))}var zr={passive:!0},Hr={left:"right",right:"left",bottom:"top",top:"bottom"};function Fr(t){return t.replace(/left|right|bottom|top/g,(function(t){return Hr[t]}))}var Wr={start:"end",end:"start"};function Ur(t){return t.replace(/start|end/g,(function(t){return Wr[t]}))}function Vr(t){var e=cr(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function qr(t){return _r(Tr(t)).left+Vr(t).scrollLeft}function jr(t){var e=Ar(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Yr(t){return["html","body","#document"].indexOf(ur(t))>=0?t.ownerDocument.body:pr(t)&&jr(t)?t:Yr(Cr(t))}function Gr(t,e){var i;void 0===e&&(e=[]);var n=Yr(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),r=cr(n),a=s?[r].concat(r.visualViewport||[],jr(n)?n:[]):n,o=e.concat(a);return s?o:o.concat(Gr(Cr(a)))}function $r(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Xr(t,e,i){return e===rr?$r(function(t,e){var i=cr(t),n=Tr(t),s=i.visualViewport,r=n.clientWidth,a=n.clientHeight,o=0,h=0;if(s){r=s.width,a=s.height;var l=wr();(l||!l&&"fixed"===e)&&(o=s.offsetLeft,h=s.offsetTop)}return{width:r,height:a,x:o+qr(t),y:h}}(t,i)):dr(e)?function(t,e){var i=_r(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):$r(function(t){var e,i=Tr(t),n=Vr(t),s=null==(e=t.ownerDocument)?void 0:e.body,r=yr(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=yr(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),o=-n.scrollLeft+qr(t),h=-n.scrollTop;return"rtl"===Ar(s||i).direction&&(o+=yr(i.clientWidth,s?s.clientWidth:0)-r),{width:r,height:a,x:o,y:h}}(Tr(t)))}function Zr(t){var e,i=t.reference,n=t.element,s=t.placement,r=s?gr(s):null,a=s?Nr(s):null,o=i.x+i.width/2-n.width/2,h=i.y+i.height/2-n.height/2;switch(r){case Js:e={x:o,y:i.y-n.height};break;case Qs:e={x:o,y:i.y+i.height};break;case Ks:e={x:i.x+i.width,y:h};break;case tr:e={x:i.x-n.width,y:h};break;default:e={x:i.x,y:i.y}}var l=r?Lr(r):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case nr:e[l]=e[l]-(i[u]/2-n[u]/2);break;case sr:e[l]=e[l]+(i[u]/2-n[u]/2)}}return e}function Jr(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,r=i.strategy,a=void 0===r?t.strategy:r,o=i.boundary,h=void 0===o?"clippingParents":o,l=i.rootBoundary,u=void 0===l?rr:l,c=i.elementContext,d=void 0===c?ar:c,p=i.altBoundary,f=void 0!==p&&p,m=i.padding,g=void 0===m?0:m,y=Pr("number"!=typeof g?g:kr(g,ir)),v=d===ar?"reference":ar,x=t.rects.popper,b=t.elements[f?v:d],w=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=Gr(Cr(t)),i=["absolute","fixed"].indexOf(Ar(t).position)>=0&&pr(t)?Dr(t):t;return dr(i)?e.filter((function(t){return dr(t)&&Er(t,i)&&"body"!==ur(t)})):[]}(t):[].concat(e),r=[].concat(s,[i]),a=r[0],o=r.reduce((function(e,i){var s=Xr(t,i,n);return e.top=yr(s.top,e.top),e.right=vr(s.right,e.right),e.bottom=vr(s.bottom,e.bottom),e.left=yr(s.left,e.left),e}),Xr(t,a,n));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(dr(b)?b:b.contextElement||Tr(t.elements.popper),h,u,a),_=_r(t.elements.reference),S=Zr({reference:_,element:x,placement:s}),E=$r(Object.assign({},x,S)),A=d===ar?E:_,M={top:w.top-A.top+y.top,bottom:A.bottom-w.bottom+y.bottom,left:w.left-A.left+y.left,right:A.right-w.right+y.right},T=t.modifiersData.offset;if(d===ar&&T){var C=T[s];Object.keys(M).forEach((function(t){var e=[Ks,Qs].indexOf(t)>=0?1:-1,i=[Js,Qs].indexOf(t)>=0?"y":"x";M[t]+=C[i]*e}))}return M}function Qr(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Kr(t){return[Js,Ks,Qs,tr].some((function(e){return t[e]>=0}))}function ta(t,e,i){void 0===i&&(i=!1);var n,s,r=pr(e),a=pr(e)&&function(t){var e=t.getBoundingClientRect(),i=xr(e.width)/t.offsetWidth||1,n=xr(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),o=Tr(e),h=_r(t,a,i),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!i)&&(("body"!==ur(e)||jr(o))&&(l=(n=e)!==cr(n)&&pr(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:Vr(n)),pr(e)?((u=_r(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=qr(o))),{x:h.left+l.scrollLeft-u.x,y:h.top+l.scrollTop-u.y,width:h.width,height:h.height}}function ea(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var ia={placement:"bottom",modifiers:[],strategy:"absolute"};function na(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}var sa=function(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,s=e.defaultOptions,r=void 0===s?ia:s;return function(t,e,i){void 0===i&&(i=r);var s,a,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},ia,r),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},h=[],l=!1,u={state:o,setOptions:function(i){var s="function"==typeof i?i(o.options):i;c(),o.options=Object.assign({},r,o.options,s),o.scrollParents={reference:dr(t)?Gr(t):t.contextElement?Gr(t.contextElement):[],popper:Gr(e)};var a,l,d=function(t){var e=ea(t);return lr.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}((a=[].concat(n,o.options.modifiers),l=a.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{}),Object.keys(l).map((function(t){return l[t]}))));return o.orderedModifiers=d.filter((function(t){return t.enabled})),o.orderedModifiers.forEach((function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,s=t.effect;if("function"==typeof s){var r=s({state:o,name:e,instance:u,options:n});h.push(r||function(){})}})),u.update()},forceUpdate:function(){if(!l){var t=o.elements,e=t.reference,i=t.popper;if(na(e,i)){o.rects={reference:ta(e,Dr(i),"fixed"===o.options.strategy),popper:Sr(i)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach((function(t){return o.modifiersData[t.name]=Object.assign({},t.data)}));for(var n=0;n<o.orderedModifiers.length;n++)if(!0!==o.reset){var s=o.orderedModifiers[n],r=s.fn,a=s.options,h=void 0===a?{}:a,c=s.name;"function"==typeof r&&(o=r({state:o,options:h,name:c,instance:u})||o)}else o.reset=!1,n=-1}}},update:(s=function(){return new Promise((function(t){u.forceUpdate(),t(o)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(s())}))}))),a}),destroy:function(){c(),l=!0}};if(!na(t,e))return u;function c(){h.forEach((function(t){return t()})),h=[]}return u.setOptions(i).then((function(t){!l&&i.onFirstUpdate&&i.onFirstUpdate(t)})),u}}({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,r=void 0===s||s,a=n.resize,o=void 0===a||a,h=cr(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&l.forEach((function(t){t.addEventListener("scroll",i.update,zr)})),o&&h.addEventListener("resize",i.update,zr),function(){r&&l.forEach((function(t){t.removeEventListener("scroll",i.update,zr)})),o&&h.removeEventListener("resize",i.update,zr)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Zr({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,r=i.adaptive,a=void 0===r||r,o=i.roundOffsets,h=void 0===o||o,l={placement:gr(e.placement),variation:Nr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Rr(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:h})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Rr(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:h})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},mr,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,r=void 0===s?[0,0]:s,a=hr.reduce((function(t,i){return t[i]=function(t,e,i){var n=gr(t),s=[tr,Js].indexOf(n)>=0?-1:1,r="function"==typeof i?i(Object.assign({},e,{placement:t})):i,a=r[0],o=r[1];return a=a||0,o=(o||0)*s,[tr,Ks].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}(i,e.rects,r),t}),{}),o=a[e.placement],h=o.x,l=o.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=h,e.modifiersData.popperOffsets.y+=l),e.modifiersData[n]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,r=void 0===s||s,a=i.altAxis,o=void 0===a||a,h=i.fallbackPlacements,l=i.padding,u=i.boundary,c=i.rootBoundary,d=i.altBoundary,p=i.flipVariations,f=void 0===p||p,m=i.allowedAutoPlacements,g=e.options.placement,y=gr(g),v=h||(y!==g&&f?function(t){if(gr(t)===er)return[];var e=Fr(t);return[Ur(t),e,Ur(e)]}(g):[Fr(g)]),x=[g].concat(v).reduce((function(t,i){return t.concat(gr(i)===er?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,r=i.rootBoundary,a=i.padding,o=i.flipVariations,h=i.allowedAutoPlacements,l=void 0===h?hr:h,u=Nr(n),c=u?o?or:or.filter((function(t){return Nr(t)===u})):ir,d=c.filter((function(t){return l.indexOf(t)>=0}));0===d.length&&(d=c);var p=d.reduce((function(e,i){return e[i]=Jr(t,{placement:i,boundary:s,rootBoundary:r,padding:a})[gr(i)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}(e,{placement:i,boundary:u,rootBoundary:c,padding:l,flipVariations:f,allowedAutoPlacements:m}):i)}),[]),b=e.rects.reference,w=e.rects.popper,_=new Map,S=!0,E=x[0],A=0;A<x.length;A++){var M=x[A],T=gr(M),C=Nr(M)===nr,I=[Js,Qs].indexOf(T)>=0,D=I?"width":"height",L=Jr(e,{placement:M,boundary:u,rootBoundary:c,altBoundary:d,padding:l}),B=I?C?Ks:tr:C?Qs:Js;b[D]>w[D]&&(B=Fr(B));var P=Fr(B),k=[];if(r&&k.push(L[T]<=0),o&&k.push(L[B]<=0,L[P]<=0),k.every((function(t){return t}))){E=M,S=!1;break}_.set(M,k)}if(S)for(var N=function(t){var e=x.find((function(e){var i=_.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return E=e,"break"},O=f?3:1;O>0&&"break"!==N(O);O--);e.placement!==E&&(e.modifiersData[n]._skip=!0,e.placement=E,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,r=void 0===s||s,a=i.altAxis,o=void 0!==a&&a,h=i.boundary,l=i.rootBoundary,u=i.altBoundary,c=i.padding,d=i.tether,p=void 0===d||d,f=i.tetherOffset,m=void 0===f?0:f,g=Jr(e,{boundary:h,rootBoundary:l,padding:c,altBoundary:u}),y=gr(e.placement),v=Nr(e.placement),x=!v,b=Lr(y),w="x"===b?"y":"x",_=e.modifiersData.popperOffsets,S=e.rects.reference,E=e.rects.popper,A="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,M="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,C={x:0,y:0};if(_){if(r){var I,D="y"===b?Js:tr,L="y"===b?Qs:Ks,B="y"===b?"height":"width",P=_[b],k=P+g[D],N=P-g[L],O=p?-E[B]/2:0,R=v===nr?S[B]:E[B],z=v===nr?-E[B]:-S[B],H=e.elements.arrow,F=p&&H?Sr(H):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},U=W[D],V=W[L],q=Br(0,S[B],F[B]),j=x?S[B]/2-O-q-U-M.mainAxis:R-q-U-M.mainAxis,Y=x?-S[B]/2+O+q+V+M.mainAxis:z+q+V+M.mainAxis,G=e.elements.arrow&&Dr(e.elements.arrow),$=G?"y"===b?G.clientTop||0:G.clientLeft||0:0,X=null!=(I=null==T?void 0:T[b])?I:0,Z=P+Y-X,J=Br(p?vr(k,P+j-X-$):k,P,p?yr(N,Z):N);_[b]=J,C[b]=J-P}if(o){var Q,K="x"===b?Js:tr,tt="x"===b?Qs:Ks,et=_[w],it="y"===w?"height":"width",nt=et+g[K],st=et-g[tt],rt=-1!==[Js,tr].indexOf(y),at=null!=(Q=null==T?void 0:T[w])?Q:0,ot=rt?nt:et-S[it]-E[it]-at+M.altAxis,ht=rt?et+S[it]+E[it]-at-M.altAxis:st,lt=p&&rt?(ct=Br(ot,et,ut=ht))>ut?ut:ct:Br(p?ot:nt,et,p?ht:st);_[w]=lt,C[w]=lt-et}var ut,ct;e.modifiersData[n]=C}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,r=i.elements.arrow,a=i.modifiersData.popperOffsets,o=gr(i.placement),h=Lr(o),l=[tr,Ks].indexOf(o)>=0?"height":"width";if(r&&a){var u=function(t,e){return Pr("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:kr(t,ir))}(s.padding,i),c=Sr(r),d="y"===h?Js:tr,p="y"===h?Qs:Ks,f=i.rects.reference[l]+i.rects.reference[h]-a[h]-i.rects.popper[l],m=a[h]-i.rects.reference[h],g=Dr(r),y=g?"y"===h?g.clientHeight||0:g.clientWidth||0:0,v=f/2-m/2,x=u[d],b=y-c[l]-u[p],w=y/2-c[l]/2+v,_=Br(x,w,b),S=h;i.modifiersData[n]=((e={})[S]=_,e.centerOffset=_-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Er(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,a=Jr(e,{elementContext:"reference"}),o=Jr(e,{altBoundary:!0}),h=Qr(a,n),l=Qr(o,s,r),u=Kr(h),c=Kr(l);e.modifiersData[i]={referenceClippingOffsets:h,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:c},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":c})}}]}),ra="tippy-content",aa="tippy-arrow",oa="tippy-svg-arrow",ha={passive:!0,capture:!0},la=function(){return document.body};function ua(t,e,i){if(Array.isArray(t)){var n=t[e];return null==n?Array.isArray(i)?i[e]:i:n}return t}function ca(t,e){var i={}.toString.call(t);return 0===i.indexOf("[object")&&i.indexOf(e+"]")>-1}function da(t,e){return"function"==typeof t?t.apply(void 0,e):t}function pa(t,e){return 0===e?t:function(n){clearTimeout(i),i=setTimeout((function(){t(n)}),e)};var i}function fa(t){return[].concat(t)}function ma(t,e){-1===t.indexOf(e)&&t.push(e)}function ga(t){return[].slice.call(t)}function ya(t){return Object.keys(t).reduce((function(e,i){return void 0!==t[i]&&(e[i]=t[i]),e}),{})}function va(){return document.createElement("div")}function xa(t){return["Element","Fragment"].some((function(e){return ca(t,e)}))}function ba(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function wa(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function _a(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[n](e,i)}))}function Sa(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var Ea={isTouch:!1},Aa=0;function Ma(){Ea.isTouch||(Ea.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ta))}function Ta(){var t=performance.now();t-Aa<20&&(Ea.isTouch=!1,document.removeEventListener("mousemove",Ta)),Aa=t}function Ca(){var t,e=document.activeElement;if((t=e)&&t._tippy&&t._tippy.reference===t){var i=e._tippy;e.blur&&!i.state.isVisible&&e.blur()}}var Ia,Da=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto);function La(t){return[t+"() was called on a"+("destroy"===t?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Ba(t){return t.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function Pa(t){return Ba("\n %ctippy.js\n\n %c"+Ba(t)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function ka(t){return[Pa(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function Na(t,e){var i;t&&!Ia.has(e)&&(Ia.add(e),(i=console).warn.apply(i,ka(e)))}function Oa(t,e){var i;t&&!Ia.has(e)&&(Ia.add(e),(i=console).error.apply(i,ka(e)))}"production"!==process.env.NODE_ENV&&(Ia=new Set);var Ra={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},za=Object.assign({appendTo:la,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ra,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Ha=Object.keys(za);function Fa(t){var e=(t.plugins||[]).reduce((function(e,i){var n,s=i.name,r=i.defaultValue;return s&&(e[s]=void 0!==t[s]?t[s]:null!=(n=za[s])?n:r),e}),{});return Object.assign({},t,e)}function Wa(t,e){var i=Object.assign({},e,{content:da(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Fa(Object.assign({},za,{plugins:e}))):Ha).reduce((function(e,i){var n=(t.getAttribute("data-tippy-"+i)||"").trim();if(!n)return e;if("content"===i)e[i]=n;else try{e[i]=JSON.parse(n)}catch(t){e[i]=n}return e}),{})}(t,e.plugins));return i.aria=Object.assign({},za.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?e.interactive:i.aria.expanded,content:"auto"===i.aria.content?e.interactive?null:"describedby":i.aria.content},i}function Ua(t,e){void 0===t&&(t={}),void 0===e&&(e=[]),Object.keys(t).forEach((function(t){var i,n,s=function(t,e){var i=Object.assign({},t);return e.forEach((function(t){delete i[t]})),i}(za,Object.keys(Ra)),r=(i=s,n=t,!{}.hasOwnProperty.call(i,n));r&&(r=0===e.filter((function(e){return e.name===t})).length),Na(r,["`"+t+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function Va(t,e){t.innerHTML=e}function qa(t){var e=va();return!0===t?e.className=aa:(e.className=oa,xa(t)?e.appendChild(t):Va(e,t)),e}function ja(t,e){xa(e.content)?(Va(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Va(t,e.content):t.textContent=e.content)}function Ya(t){var e=t.firstElementChild,i=ga(e.children);return{box:e,content:i.find((function(t){return t.classList.contains(ra)})),arrow:i.find((function(t){return t.classList.contains(aa)||t.classList.contains(oa)})),backdrop:i.find((function(t){return t.classList.contains("tippy-backdrop")}))}}function Ga(t){var e=va(),i=va();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=va();function s(i,n){var s=Ya(e),r=s.box,a=s.content,o=s.arrow;n.theme?r.setAttribute("data-theme",n.theme):r.removeAttribute("data-theme"),"string"==typeof n.animation?r.setAttribute("data-animation",n.animation):r.removeAttribute("data-animation"),n.inertia?r.setAttribute("data-inertia",""):r.removeAttribute("data-inertia"),r.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?r.setAttribute("role",n.role):r.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||ja(a,t.props),n.arrow?o?i.arrow!==n.arrow&&(r.removeChild(o),r.appendChild(qa(n.arrow))):r.appendChild(qa(n.arrow)):o&&r.removeChild(o)}return n.className=ra,n.setAttribute("data-state","hidden"),ja(n,t.props),e.appendChild(i),i.appendChild(n),s(t.props,t.props),{popper:e,onUpdate:s}}Ga.$$tippy=!0;var $a=1,Xa=[],Za=[];function Ja(t,e){var i,n,s,r,a,o,h,l,u=Wa(t,Object.assign({},za,Fa(ya(e)))),c=!1,d=!1,p=!1,f=!1,m=[],g=pa(G,u.interactiveDebounce),y=$a++,v=(l=u.plugins).filter((function(t,e){return l.indexOf(t)===e})),x={id:y,reference:t,popper:va(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)},setProps:function(e){if("production"!==process.env.NODE_ENV&&Na(x.state.isDestroyed,La("setProps")),!x.state.isDestroyed){P("onBeforeUpdate",[x,e]),j();var i=x.props,n=Wa(t,Object.assign({},i,ya(e),{ignoreAttributes:!0}));x.props=n,q(),i.interactiveDebounce!==n.interactiveDebounce&&(O(),g=pa(G,n.interactiveDebounce)),i.triggerTarget&&!n.triggerTarget?fa(i.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):n.triggerTarget&&t.removeAttribute("aria-expanded"),N(),B(),_&&_(i,n),x.popperInstance&&(J(),K().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),P("onAfterUpdate",[x,e])}},setContent:function(t){x.setProps({content:t})},show:function(){"production"!==process.env.NODE_ENV&&Na(x.state.isDestroyed,La("show"));var t=x.state.isVisible,e=x.state.isDestroyed,i=!x.state.isEnabled,n=Ea.isTouch&&!x.props.touch,s=ua(x.props.duration,0,za.duration);if(!(t||e||i||n||C().hasAttribute("disabled")||(P("onShow",[x],!1),!1===x.props.onShow(x)))){if(x.state.isVisible=!0,T()&&(w.style.visibility="visible"),B(),F(),x.state.isMounted||(w.style.transition="none"),T()){var r=D();ba([r.box,r.content],0)}o=function(){var t;if(x.state.isVisible&&!f){if(f=!0,w.offsetHeight,w.style.transition=x.props.moveTransition,T()&&x.props.animation){var e=D(),i=e.box,n=e.content;ba([i,n],s),wa([i,n],"visible")}k(),N(),ma(Za,x),null==(t=x.popperInstance)||t.forceUpdate(),P("onMount",[x]),x.props.animation&&T()&&function(t){U(t,(function(){x.state.isShown=!0,P("onShown",[x])}))}(s)}},function(){var t,e=x.props.appendTo,i=C();(t=x.props.interactive&&e===la||"parent"===e?i.parentNode:da(e,[i])).contains(w)||t.appendChild(w),x.state.isMounted=!0,J(),"production"!==process.env.NODE_ENV&&Na(x.props.interactive&&e===za.appendTo&&i.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()}},hide:function(){"production"!==process.env.NODE_ENV&&Na(x.state.isDestroyed,La("hide"));var t=!x.state.isVisible,e=x.state.isDestroyed,i=!x.state.isEnabled,n=ua(x.props.duration,1,za.duration);if(!(t||e||i)&&(P("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,f=!1,c=!1,T()&&(w.style.visibility="hidden"),O(),W(),B(!0),T()){var s=D(),r=s.box,a=s.content;x.props.animation&&(ba([r,a],n),wa([r,a],"hidden"))}k(),N(),x.props.animation?T()&&function(t,e){U(t,(function(){!x.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&e()}))}(n,x.unmount):x.unmount()}},hideWithInteractivity:function(t){"production"!==process.env.NODE_ENV&&Na(x.state.isDestroyed,La("hideWithInteractivity")),I().addEventListener("mousemove",g),ma(Xa,g),g(t)},enable:function(){x.state.isEnabled=!0},disable:function(){x.hide(),x.state.isEnabled=!1},unmount:function(){"production"!==process.env.NODE_ENV&&Na(x.state.isDestroyed,La("unmount")),x.state.isVisible&&x.hide(),x.state.isMounted&&(Q(),K().forEach((function(t){t._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w),Za=Za.filter((function(t){return t!==x})),x.state.isMounted=!1,P("onHidden",[x]))},destroy:function(){"production"!==process.env.NODE_ENV&&Na(x.state.isDestroyed,La("destroy")),x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),j(),delete t._tippy,x.state.isDestroyed=!0,P("onDestroy",[x]))}};if(!u.render)return"production"!==process.env.NODE_ENV&&Oa(!0,"render() function has not been supplied."),x;var b=u.render(x),w=b.popper,_=b.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+x.id,x.popper=w,t._tippy=x,w._tippy=x;var S=v.map((function(t){return t.fn(x)})),E=t.hasAttribute("aria-expanded");return q(),N(),B(),P("onCreate",[x]),u.showOnCreate&&tt(),w.addEventListener("mouseenter",(function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&I().addEventListener("mousemove",g)})),x;function A(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function M(){return"hold"===A()[0]}function T(){var t;return!(null==(t=x.props.render)||!t.$$tippy)}function C(){return h||t}function I(){var t,e,i=C().parentNode;return i&&null!=(e=fa(i)[0])&&null!=(t=e.ownerDocument)&&t.body?e.ownerDocument:document}function D(){return Ya(w)}function L(t){return x.state.isMounted&&!x.state.isVisible||Ea.isTouch||r&&"focus"===r.type?0:ua(x.props.delay,t?0:1,za.delay)}function B(t){void 0===t&&(t=!1),w.style.pointerEvents=x.props.interactive&&!t?"":"none",w.style.zIndex=""+x.props.zIndex}function P(t,e,i){var n;void 0===i&&(i=!0),S.forEach((function(i){i[t]&&i[t].apply(i,e)})),i&&(n=x.props)[t].apply(n,e)}function k(){var e=x.props.aria;if(e.content){var i="aria-"+e.content,n=w.id;fa(x.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(i);if(x.state.isVisible)t.setAttribute(i,e?e+" "+n:n);else{var s=e&&e.replace(n,"").trim();s?t.setAttribute(i,s):t.removeAttribute(i)}}))}}function N(){!E&&x.props.aria.expanded&&fa(x.props.triggerTarget||t).forEach((function(t){x.props.interactive?t.setAttribute("aria-expanded",x.state.isVisible&&t===C()?"true":"false"):t.removeAttribute("aria-expanded")}))}function O(){I().removeEventListener("mousemove",g),Xa=Xa.filter((function(t){return t!==g}))}function R(e){if(!Ea.isTouch||!p&&"mousedown"!==e.type){var i=e.composedPath&&e.composedPath()[0]||e.target;if(!x.props.interactive||!Sa(w,i)){if(fa(x.props.triggerTarget||t).some((function(t){return Sa(t,i)}))){if(Ea.isTouch)return;if(x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else P("onClickOutside",[x,e]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),d=!0,setTimeout((function(){d=!1})),x.state.isMounted||W())}}}function z(){p=!0}function H(){p=!1}function F(){var t=I();t.addEventListener("mousedown",R,!0),t.addEventListener("touchend",R,ha),t.addEventListener("touchstart",H,ha),t.addEventListener("touchmove",z,ha)}function W(){var t=I();t.removeEventListener("mousedown",R,!0),t.removeEventListener("touchend",R,ha),t.removeEventListener("touchstart",H,ha),t.removeEventListener("touchmove",z,ha)}function U(t,e){var i=D().box;function n(t){t.target===i&&(_a(i,"remove",n),e())}if(0===t)return e();_a(i,"remove",a),_a(i,"add",n),a=n}function V(e,i,n){void 0===n&&(n=!1),fa(x.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,i,n),m.push({node:t,eventType:e,handler:i,options:n})}))}function q(){var t;M()&&(V("touchstart",Y,{passive:!0}),V("touchend",$,{passive:!0})),(t=x.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(V(t,Y),t){case"mouseenter":V("mouseleave",$);break;case"focus":V(Da?"focusout":"blur",X);break;case"focusin":V("focusout",X)}}))}function j(){m.forEach((function(t){var e=t.node,i=t.eventType,n=t.handler,s=t.options;e.removeEventListener(i,n,s)})),m=[]}function Y(t){var e,i=!1;if(x.state.isEnabled&&!Z(t)&&!d){var n="focus"===(null==(e=r)?void 0:e.type);r=t,h=t.currentTarget,N(),!x.state.isVisible&&ca(t,"MouseEvent")&&Xa.forEach((function(e){return e(t)})),"click"===t.type&&(x.props.trigger.indexOf("mouseenter")<0||c)&&!1!==x.props.hideOnClick&&x.state.isVisible?i=!0:tt(t),"click"===t.type&&(c=!i),i&&!n&&et(t)}}function G(t){var e=t.target,i=C().contains(e)||w.contains(e);"mousemove"===t.type&&i||function(t,e){var i=e.clientX,n=e.clientY;return t.every((function(t){var e=t.popperRect,s=t.popperState,r=t.props.interactiveBorder,a=s.placement.split("-")[0],o=s.modifiersData.offset;if(!o)return!0;var h="bottom"===a?o.top.y:0,l="top"===a?o.bottom.y:0,u="right"===a?o.left.x:0,c="left"===a?o.right.x:0,d=e.top-n+h>r,p=n-e.bottom-l>r,f=e.left-i+u>r,m=i-e.right-c>r;return d||p||f||m}))}(K().concat(w).map((function(t){var e,i=null==(e=t._tippy.popperInstance)?void 0:e.state;return i?{popperRect:t.getBoundingClientRect(),popperState:i,props:u}:null})).filter(Boolean),t)&&(O(),et(t))}function $(t){Z(t)||x.props.trigger.indexOf("click")>=0&&c||(x.props.interactive?x.hideWithInteractivity(t):et(t))}function X(t){x.props.trigger.indexOf("focusin")<0&&t.target!==C()||x.props.interactive&&t.relatedTarget&&w.contains(t.relatedTarget)||et(t)}function Z(t){return!!Ea.isTouch&&M()!==t.type.indexOf("touch")>=0}function J(){Q();var e=x.props,i=e.popperOptions,n=e.placement,s=e.offset,r=e.getReferenceClientRect,a=e.moveTransition,h=T()?Ya(w).arrow:null,l=r?{getBoundingClientRect:r,contextElement:r.contextElement||C()}:t,u=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(T()){var i=D().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?i.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?i.setAttribute("data-"+t,""):i.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];T()&&h&&u.push({name:"arrow",options:{element:h,padding:3}}),u.push.apply(u,(null==i?void 0:i.modifiers)||[]),x.popperInstance=sa(l,w,Object.assign({},i,{placement:n,onFirstUpdate:o,modifiers:u}))}function Q(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function K(){return ga(w.querySelectorAll("[data-tippy-root]"))}function tt(t){x.clearDelayTimeouts(),t&&P("onTrigger",[x,t]),F();var e=L(!0),n=A(),s=n[0],r=n[1];Ea.isTouch&&"hold"===s&&r&&(e=r),e?i=setTimeout((function(){x.show()}),e):x.show()}function et(t){if(x.clearDelayTimeouts(),P("onUntrigger",[x,t]),x.state.isVisible){if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&c)){var e=L(!1);e?n=setTimeout((function(){x.state.isVisible&&x.hide()}),e):s=requestAnimationFrame((function(){x.hide()}))}}else W()}}function Qa(t,e){void 0===e&&(e={});var i=za.plugins.concat(e.plugins||[]);"production"!==process.env.NODE_ENV&&(function(t){var e=!t,i="[object Object]"===Object.prototype.toString.call(t)&&!t.addEventListener;Oa(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Oa(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(t),Ua(e,i)),document.addEventListener("touchstart",Ma,ha),window.addEventListener("blur",Ca);var n=Object.assign({},e,{plugins:i}),s=function(t){return xa(t)?[t]:function(t){return ca(t,"NodeList")}(t)?ga(t):Array.isArray(t)?t:ga(document.querySelectorAll(t))}(t);if("production"!==process.env.NODE_ENV){var r=xa(n.content),a=s.length>1;Na(r&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var o=s.reduce((function(t,e){var i=e&&Ja(e,n);return i&&t.push(i),t}),[]);return xa(t)?o[0]:o}Qa.defaultProps=za,Qa.setDefaultProps=function(t){"production"!==process.env.NODE_ENV&&Ua(t,[]),Object.keys(t).forEach((function(e){za[e]=t[e]}))},Qa.currentInput=Ea,Object.assign({},mr,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}}),Qa.setDefaultProps({render:Ga});let Ka=0;const to=Qa(document.body,{theme:"translucent",animation:"scale",inertia:!0,delay:[200,100],content:"",allowHTML:!0,placement:"left-start",trigger:"manual",arrow:!0});class eo{constructor(t,e){d(this,"name","Label"),d(this,"id","Label"+Ka++),d(this,"el"),d(this,"position",new Fe),this.container=t,this.text=e,this.container=t||document.getElementsByTagName("body")[0],this.text=e}get isMounted(){return to.state.isMounted}get isShown(){return to.state.isShown}destroy(){this.text="",this.position.identity()}setHtml(t=""){return this.text=t,this}update(t){t&&(this.position.copy(t),to.show())}show(t){return p(this,null,(function*(){if(t)return yield this.hide(),this.position.copy(t),to.setContent(this.text),to.setProps({getReferenceClientRect:()=>({width:0,height:0,right:this.position.x,left:this.position.x,bottom:this.position.y,top:this.position.y,x:this.position.x,y:this.position.y,toJSON(){}})}),to.clearDelayTimeouts(),to.show(),new Promise((t=>{ri.delay((function(){t()}),300)}))}))}hide(){return p(this,null,(function*(){return to.hide(),new Promise((t=>{ri.delay((function(){t()}),100)}))}))}}let io=0;class no extends zi{constructor(t,e){var i,n;super(),d(this,"name","DummyPoint"),d(this,"id","dummyPoint"+io++),d(this,"container"),d(this,"offset",new Fe),d(this,"el"),d(this,"label"),d(this,"radius",10),d(this,"position",new Fe),d(this,"worldPosition",new Fe),d(this,"userData"),this.container=t||document.getElementsByTagName("body")[0];let s=this.container.getBoundingClientRect();this.offset.set(s.left,s.top),this.userData=e,(null==(i=this.userData)?void 0:i.type)||ri.set(this,"userData.type",Xs.DEFAULT),this.initDom(),this.setType(null==(n=this.userData)?void 0:n.type),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),null==(t=this.label)||t.destroy()}get isMounted(){var t;return!!(null==(t=this.el)?void 0:t.parentNode)}mount(){var t;this.el&&((null==(t=this.el)?void 0:t.parentNode)||this.container.appendChild(this.el))}unmount(){var t,e,i,n;null==(e=null==(t=this.el)?void 0:t.parentNode)||e.removeChild(this.el),null==(i=this.el)||i.remove(),null==(n=this.label)||n.hide()}setText(t=""){return this.el?(this.el.innerText=t,this):this}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-point"),this.el.setAttribute("ae-id",null==(t=this.userData)?void 0:t.value)}initLabel(){var t;(null==(t=this.userData)?void 0:t.label)&&(this.label=new eo(this.container,this.userData.label))}setActive(t){return t?(Cs(this.el,"active"),this.showLabel()):(Is(this.el,"active"),this.hideLabel()),this}showLabel(){var t;null==(t=this.label)||t.show(so.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;null==(t=this.label)||t.hide()}setType(t){var e;if(!this.userData)return this;const i=null==(e=this.userData)?void 0:e.type;return t||(t=Xs.DEFAULT),i&&Ts(this.el,i)&&Is(this.el,i),this.userData.type=t,Cs(this.el,this.userData.type),this}update(t,e=!1){t&&this.isMounted&&(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const so=new Fe;let ro=0;class ao extends zi{constructor(t,e){super(),d(this,"name","DummyRect"),d(this,"id","dummyRect"+ro++),d(this,"container"),d(this,"offset",new Fe),d(this,"el"),d(this,"radius",10),d(this,"position",new Fe),d(this,"worldPosition",new Fe),d(this,"label"),d(this,"userData"),this.container=t||document.getElementsByTagName("body")[0];let i=this.container.getBoundingClientRect();this.offset.set(i.left,i.top),this.userData=e,this.initDom(),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),null==(t=this.label)||t.destroy()}get isMounted(){var t;return!!(null==(t=this.el)?void 0:t.parentNode)}mount(){this.container.appendChild(this.el)}unmount(){var t,e,i,n;this.setText(""),null==(e=null==(t=this.el)?void 0:t.parentNode)||e.removeChild(this.el),null==(i=this.el)||i.remove(),null==(n=this.label)||n.hide()}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-rect"),this.el.setAttribute("ae-id",(null==(t=this.userData)?void 0:t.rmId)||"undefined")}initLabel(){this.label=new eo(this.container,"")}setText(t=""){return this.el.innerText=t,this}setActive(t){return t?Cs(this.el,"active"):Is(this.el,"active"),this}showLabel(){var t;null==(t=this.label)||t.show(oo.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;null==(t=this.label)||t.hide()}setType(t){var e;if(!this.userData)return this;const i=null==(e=this.userData)?void 0:e.type;return t=Xs.DEFAULT,i&&Ts(this.el,i)&&Is(this.el,i),this.userData.type=t,Cs(this.el,this.userData.type),this}update(t,e=!1){t&&this.isMounted&&(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const oo=new Fe;class ho extends zi{constructor(t,e){super(),d(this,"name","Dummies"),d(this,"container"),d(this,"controller"),d(this,"scene"),d(this,"viewMatrix",new Hi),d(this,"dummies",[]),d(this,"rmMap",new Map),d(this,"mergedMap",new Map),d(this,"cameraUpdateHandler",this.handleCameraUpdate.bind(this)),d(this,"controllerTapHandler",this.handleControllerTap.bind(this)),this.container=t,this.controller=e,this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.clearDummies()}bindEvents(){this.controller.camera.addEventListener(Ws.UPDATE,this.cameraUpdateHandler),this.controller.addEventListener(zs.TAP,this.controllerTapHandler)}unbindEvents(){this.controller.camera.removeEventListener(Ws.UPDATE,this.cameraUpdateHandler),this.controller.removeEventListener(zs.TAP,this.controllerTapHandler)}bindScene(t){this.scene=t}update(t){var e,i,n;if(t){this.viewMatrix.copy(t);for(let t=0,s=(this.dummies||[]).length;t<s;t++){const s=this.dummies[t],r=null==(i=this.scene)?void 0:i.getElementById(null==(e=s.userData)?void 0:e.rmId);if(r){const t=null==(n=this.scene)?void 0:n.chef.getElementBoundingBox(r.id);null==t||t.getCenter(lo),lo.applyMatrix3(this.viewMatrix).round(),s.position.copy(lo)}else lo.copy(s.worldPosition).applyMatrix3(this.viewMatrix).round(),s.update(lo)}this.mergeDummies()}}setDummies(t){this.clearDummies();for(let e=0,i=(t||[]).length;e<i;e++)this.addDummy(t[e])}addDummy(t){var e,i;const n=new no(this.container,t);this.dummies.push(n);const s=null==(e=n.userData)?void 0:e.rmId;return s&&(this.rmMap.has(s)||this.rmMap.set(s,[]),null==(i=this.rmMap.get(s))||i.push(n)),n}removeDummy(t){var e;const i=this.dummies.indexOf(t);i>-1&&this.dummies.splice(i,1);const n=null==(e=t.userData)?void 0:e.rmId;if(n){const e=this.mergedMap.get(n);null==e||e.destroy(),this.mergedMap.delete(n);const i=this.rmMap.get(n);if(!i)return;if(1===i.length)this.rmMap.delete(n);else{const e=i.indexOf(t);e>-1&&(i.splice(e,1),this.rmMap.set(n,i))}}t.destroy()}clearDummies(t){var e,i,n;for(let s=((null==(e=this.dummies)?void 0:e.length)||0)-1;s>=0;s--){const e=this.dummies[s];(!t||(null==(i=null==e?void 0:e.userData)?void 0:i.type)&&(null==t?void 0:t.includes(null==(n=e.userData)?void 0:n.type)))&&this.removeDummy(e)}t||(this.dummies.length=0,this.mergedMap.clear(),this.rmMap.clear())}mergeDummies(){this.rmMap.forEach(((t,e)=>{var i,n,s,r;if(null==(i=this.scene)?void 0:i.getElementById(e)){const i=null==(n=this.scene)?void 0:n.chef.getElementBoundingBox(e);if(!i)return;uo.copy(i).applyMatrix3(this.viewMatrix).round(),uo.getSize(lo);const a=t[0].radius,o=uo.centralArrange(t.length,2*a,2*a);if(lo.x<3*a||lo.y<3*a){t.forEach((t=>t.unmount()));const i=this.mergedMap.get(e);null==i||i.unmount()}else if(Array.isArray(o))this.mergedMap.has(e)&&(null==(s=this.mergedMap.get(e))||s.unmount()),t.forEach(((t,e)=>{t.isMounted||t.mount(),t.update(o[e])}));else{t.forEach((t=>t.unmount()));let i=this.mergedMap.get(e);if(i)i.isMounted||i.mount();else{const n=ri.cloneDeep(t[0].userData)||{},s=ri.reduce(t,((t,e)=>{var i,n;return(null==(i=e.userData)?void 0:i.label)&&t.push(null==(n=e.userData)?void 0:n.label),t}),[]);n.label=s.join(", ");const r=ri.reduce(t,((t,e)=>{var i,n;return(null==(i=e.userData)?void 0:i.value)&&t.push(null==(n=e.userData)?void 0:n.value),t}),[]);n.value=r.join(","),n.rmId=e,i=new ao(this.container,n),this.mergedMap.set(e,i)}i.setText(t.length.toString());const n=ri.reduce(t,((t,e)=>{var i,n;return(null==(i=e.userData)?void 0:i.label)&&t.push(null==(n=e.userData)?void 0:n.label),t}),[]);null==(r=i.label)||r.setHtml(n.join(", <br />")),i.update(t[0].position)}}}))}getDummyById(t){return this.dummies.find((e=>{var i;return(null==(i=e.userData)?void 0:i.value)===t}))}setActiveByIds(t){var e,i;if(this.resetActives(),t&&(Array.isArray(t)||(t=[t]),null==t?void 0:t.length))for(let n=0,s=t.length;n<s;n++){const s=this.getDummyById(t[n]);if(s&&s.setActive(!0),s&&(null==(e=s.userData)?void 0:e.rmId)){const t=this.mergedMap.get(null==(i=s.userData)?void 0:i.rmId);t&&t.setActive(!0)}}}resetActives(){this.dummies.forEach((t=>t.setActive(!1))),this.mergedMap.forEach((t=>t.setActive(!1)))}showDummyLabel(t){if(!t)return;const e=this.getDummyById(t);e&&e.showLabel();const i=this.mergedMap.get(t);i&&i.showLabel()}hideDummyLabel(){return p(this,null,(function*(){this.dummies.forEach((t=>t.hideLabel())),this.mergedMap.forEach((t=>t.hideLabel()))}))}handleCameraUpdate(){this.update(this.controller.camera.viewMatrix)}handleControllerTap(t){var e,i,n,s,r;if((null==t?void 0:t.type)!==zs.TAP)return;const a=(null==(e=null==t?void 0:t.e)?void 0:e.target)||(null==(n=null==(i=null==t?void 0:t.e)?void 0:i.srcEvent)?void 0:n.target)||(null==(r=null==(s=null==t?void 0:t.e)?void 0:s.srcEvent)?void 0:r.srcElement);null==a||a.getAttribute("ae-id")}}const lo=new Fe,uo=new ai;window[ks.prefixed(window,"requestAnimationFrame")];class co extends zi{constructor(t,e,i=!0){super(),d(this,"name","DragController"),d(this,"dragFake",!1),d(this,"container"),d(this,"offset",new Fe),d(this,"controller"),d(this,"scene"),d(this,"raycaster"),d(this,"dummies"),d(this,"_els",[]),d(this,"_hms",new Map),d(this,"_vos",new Map),d(this,"_elMap",new Map),d(this,"_panType",Xs.SUCCESS),d(this,"onPanHandler",this.handleOnPan.bind(this)),d(this,"panEndHandler",ri.debounce(this.handlePanEnd.bind(this),500)),this.container=t;let n=this.container.getBoundingClientRect();this.offset.set(n.left,n.top),this.controller=e,this.dummies=new ho(t,e),this.raycaster=new Zs,this.dragFake=i}destroy(){var t;super.destroy();for(let e=((null==(t=this._els)?void 0:t.length)||0)-1;e>=0;e--)this.drop(this._els[e]);this.dummies.destroy()}bindScene(t){var e;this.scene=t,null==(e=this.dummies)||e.bindScene(t)}drag(t,e){t&&(this._els.includes(t)||(this.bindEvent(t),this._els.push(t),this._vos.set(t,e)))}drop(t){if(!t)return;this.unbindEvent(t),this._vos.delete(t),this._elMap.delete(t);const e=this._els.findIndex((e=>e===t));e>-1&&this._els.splice(e,1)}bindEvent(t){if(!t)return;const e=new ks.Manager(t,{domEvents:!0});e.add(new ks.Pan({threshold:0,pointers:0})),e.on(["panstart","panmove","panend"].join(" "),this.onPanHandler),this._hms.set(t,e)}unbindEvent(t){if(!t)return;const e=this._hms.get(t);e&&(e.off(["panstart","panmove","panend"].join(" "),this.onPanHandler),e.destroy(),this._hms.delete(t))}handleOnPan(t){if("function"==typeof t.preventDefault&&t.preventDefault(),"function"==typeof t.srcEvent.stopPropagation&&t.srcEvent.stopPropagation(),"function"==typeof t.srcEvent.stopImmediatePropagation&&t.srcEvent.stopImmediatePropagation(),!this.controller)return;"panstart"===t.type||t.isFirst?this.controller.enablePan=!1:"panmove"===t.type||"panend"===t.type&&(this.controller.enablePan=!0);const e=this._vos.get(t.target);if(!e)return;const i=ri.cloneDeep(e);i.type=this._panType;const n=this._getDummy(t.target,i);po.set(t.center.x,t.center.y).sub(this.offset),n.worldPosition.copy(po).unproject(this.controller.camera),n.update(po),this.panEndHandler({type:"panend",e:t})}handlePanEnd(t){if("panend"!==(null==t?void 0:t.type))return;const e=this.getDummies(!0);this.dispatchEvent({type:"panend",data:e})}getDummies(t=!0){const e=[];return this._els.forEach((i=>{var n;let s=this._vos.get(i);if(s&&s.type===Xs.SUCCESS){if(t){const t=this._elMap.get(i);if(!t)return;if(!this.controller.camera)return;po.copy(t.position),this.raycaster.setFromCamera(po,this.controller.camera);const e=[];if(null==(n=this.scene)||n.getIntersectObjects(this.raycaster,Ti.RM,e),!(null==e?void 0:e.length))return;s=ri.cloneDeep(s),s.rmId=e[0].id}e.push(s)}})),e}setDummiesByVos(t){var e,i;for(let i=0,n=(t||[]).length;i<n;i++){const n=null==(e=this.dummies)?void 0:e.addDummy(t[i]);if(!n)continue;const s=ri.cloneDeep(t[i]);delete s.rmId,delete s.wsId,this.drag(n.el,s)}null==(i=this.dummies)||i.update(this.controller.camera.viewMatrix)}clearDummies(t){var e,i;for(let i=((null==(e=this._els)?void 0:e.length)||0)-1;i>=0;i--){const e=this._vos.get(this._els[i]);(!t||t&&(null==e?void 0:e.type)&&t.includes(e.type))&&this.drop(this._els[i])}null==(i=this.dummies)||i.clearDummies(t)}getDummyById(t){return this.dummies.getDummyById(t)}highlightDummies(t){var e;null==(e=this.dummies)||e.setActiveByIds(t)}resetHighlightDummies(){var t;null==(t=this.dummies)||t.resetActives()}showDummyLabel(t){var e;null==(e=this.dummies)||e.showDummyLabel(t)}start(){}_getDummy(t,e){let i=this._elMap.get(t);if(i||(i=this.dummies.addDummy(e).setType(Xs.SUCCESS),this._elMap.set(t,i)),i.isMounted||i.mount(),this.dummies.dummies.includes(i)||this.dummies.dummies.push(i),!this._elMap.get(i.el)){this._elMap.set(i.el,i);const t=ri.cloneDeep(e);delete t.rmId,delete t.wsId,this.drag(i.el,t)}return i}}const po=new Fe;var fo=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return t},Out:function(t){return t},InOut:function(t){return t}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-fo.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*fo.Bounce.In(2*t):.5*fo.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),mo=function(){return performance.now()},go=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var n=0,s=e;n<s.length;n++){var r=s[n];null===(t=r._group)||void 0===t||t.remove(r),r._group=this,this._tweens[r.getId()]=r,this._tweensAddedDuringUpdate[r.getId()]=r}},t.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var s=n[i];s._group=void 0,delete this._tweens[s.getId()],delete this._tweensAddedDuringUpdate[s.getId()]}},t.prototype.allStopped=function(){return this.getAll().every((function(t){return!t.isPlaying()}))},t.prototype.update=function(t,e){void 0===t&&(t=mo()),void 0===e&&(e=!0);var i=Object.keys(this._tweens);if(0!==i.length)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var s=this._tweens[i[n]],r=!e;s&&!1===s.update(t,r)&&!e&&this.remove(s)}i=Object.keys(this._tweensAddedDuringUpdate)}},t}(),yo={Linear:function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n),r=yo.Utils.Linear;return e<0?r(t[0],t[1],n):e>1?r(t[i],t[i-1],i-n):r(t[s],t[s+1>i?i:s+1],n-s)},Utils:{Linear:function(t,e,i){return(e-t)*i+t}}},vo=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),xo=new go,bo=function(){function t(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=fo.Linear.None,this._interpolationFunction=yo.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=vo.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,"object"==typeof e?(this._group=e,e.add(this)):!0===e&&(this._group=xo,xo.add(this))}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=mo()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var i in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var s in this._valuesEnd)n[s]=this._valuesEnd[s];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,i,n,s){for(var r in i){var a=t[r],o=Array.isArray(a),h=o?"array":typeof a,l=!o&&Array.isArray(i[r]);if("undefined"!==h&&"function"!==h){if(l){if(0===(g=i[r]).length)continue;for(var u=[a],c=0,d=g.length;c<d;c+=1){var p=this._handleRelativeValue(a,g[c]);if(isNaN(p)){l=!1;break}u.push(p)}l&&(i[r]=u)}if("object"!==h&&!o||!a||l)(void 0===e[r]||s)&&(e[r]=a),o||(e[r]*=1),n[r]=l?i[r].slice().reverse():e[r]||0;else{e[r]=o?[]:{};var f=a;for(var m in f)e[r][m]=f[m];n[r]=o?[]:{};var g=i[r];if(!this._isDynamic){var y={};for(var m in g)y[m]=g[m];i[r]=g=y}this._setupProperties(f,e[r],g,n[r],s)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},t.prototype.pause=function(t){return void 0===t&&(t=mo()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t),this},t.prototype.resume=function(t){return void 0===t&&(t=mo()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return t?(t.add(this),this):this},t.prototype.remove=function(){var t;return null===(t=this._group)||void 0===t||t.remove(this),this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=fo.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=yo.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(e,i){var n,s,r=this;if(void 0===e&&(e=mo()),void 0===i&&(i=t.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!i)return!1;this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,o=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),h=this._duration+this._repeat*o,l=function(){if(0===r._duration)return 1;if(a>h)return 1;var t=Math.trunc(a/o),e=a-t*o,i=Math.min(e/r._duration,1);return 0===i&&a===r._duration?1:i}(),u=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),0===this._duration||a>=this._duration){if(this._repeat>0){var c=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);for(s in isFinite(this._repeat)&&(this._repeat-=c),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[s]||(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*c,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var d=0,p=this._chainedTweens.length;d<p;d++)this._chainedTweens[d].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,i,n){for(var s in i)if(void 0!==e[s]){var r=e[s]||0,a=i[s],o=Array.isArray(t[s]),h=Array.isArray(a);!o&&h?t[s]=this._interpolationFunction(a,n):"object"==typeof a&&a?this._updateProperties(t[s],r,a,n):"number"==typeof(a=this._handleRelativeValue(r,a))&&(t[s]=r+(a-r)*n)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof i?this._valuesStartRepeat[t]+parseFloat(i):this._valuesEnd[t],this._valuesEnd[t]=e},t.autoStartOnUpdate=!1,t}();vo.nextId;var wo=xo;wo.getAll.bind(wo),wo.removeAll.bind(wo),wo.add.bind(wo),wo.remove.bind(wo),wo.update.bind(wo);var _o={Easing:fo,Tween:bo};class So extends zi{constructor(t={}){super(),d(this,"name","SvgView"),d(this,"params"),d(this,"container"),d(this,"offset",new Fe),d(this,"camera"),d(this,"controller"),d(this,"scene"),d(this,"p1",new Fe),d(this,"p2",new Fe),d(this,"graph"),d(this,"multiSelector"),d(this,"dummiesController"),d(this,"zoomToSelectEnable",!1),d(this,"zoomBox",new ai),d(this,"selectEnable",!1),d(this,"multiSelectEnable",!1),d(this,"fnEnable",!1),d(this,"tween"),d(this,"animateDuration"),d(this,"label"),d(this,"controllerPanStartHandler",this.handlePanStart.bind(this)),d(this,"controllerPanEndHandler",this.handlePanEnd.bind(this)),d(this,"controllerPanMoveHandler",this.handleControllerPanMove.bind(this)),d(this,"controllerPointerOverHandler",this.handleControllerPointerOver.bind(this)),d(this,"multiSelectorSelectedHandler",this.handleMultiSelectorSelected.bind(this)),d(this,"_currentAssetId"),this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.camera||(this.params.camera={}),this.params.camera.flipY=!0,this.animateDuration=this.params.animateDuration||300,this.camera=new Fs(this.params.camera),this.container=this.params.containerId?document.getElementById(this.params.containerId):Me.window.document.getElementsByTagName("body")[0];let e=this.container.getBoundingClientRect();this.offset.set(e.left,e.top),this.controller=new Rs(this.container,this.camera,!0),this.graph=new Us(this.container),this.multiSelector=new Ys(this.container,this.controller),this.dummiesController=new co(this.container,this.controller),this.bindControllerEvents(),this.initLabel()}destroy(){var t;this.unbindControllerEvents(),super.destroy(),null==(t=this.label)||t.destroy()}initLabel(){this.label=new eo(this.container,"")}showAssetsLabel(t,e,i){var n,s,r,a,o;if(!e)return;t||(t=null==(n=this.scene)?void 0:n.assetType);const h=null==(s=this.scene)?void 0:s.chef.getElementBoundingBox(e);h&&!h.isEmpty()&&(i||(i=null==(r=this.scene)?void 0:r.getAssetLabelById(t,e))||(i=e),null==(a=this.label)||a.setHtml(i),Ao.copy(h.min).applyMatrix3(this.camera.viewMatrix).add(this.offset).round(),null==(o=this.label)||o.show(Ao))}hideAssetsLabel(){return p(this,null,(function*(){var t;return null==(t=this.label)?void 0:t.hide()}))}bindScene(t){var e;this.scene=t,this.multiSelector.bindScene(this.scene),null==(e=this.dummiesController)||e.bindScene(this.scene)}resize(){var t,e;null==(t=this.camera)||t.resize(),null==(e=this.controller)||e.resize()}setEnablePan(t){this.controller&&(this.controller.enablePan=!!t)}setByBox(t,e=!0){return p(this,null,(function*(){yield this.resetCameraByBoundingBox(t,e)}))}zoomIn(){this.controller.scaled=.9*this.camera.scaled.x,this.controller.update()}zoomOut(){this.controller.scaled=1.1*this.camera.scaled.x,this.controller.update()}zoomToSelectEnableChanged(t){this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}selectEnableChanged(t){this.selectEnable=!!t,this.multiSelector.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.multiSelector.multiSelectEnableChanged(t)}fnEnableChanged(t){this.fnEnable=!!t,this.multiSelector.fnEnableChanged(t)}getIntersectObjects(t,e,i=[]){return this.scene?this.scene.getIntersectObjects(t,e,i):i}focusAt(t,e=500){return p(this,null,(function*(){return this.camera?(Eo.setFromCenterAndSize(t,Ao.set(2*e,2*e)),this.resetCameraByBoundingBox(Eo,!0)):Promise.resolve()}))}focusAtById(t,e=500){return p(this,null,(function*(){var i;const n=null==(i=this.scene)?void 0:i.getBoundingBoxById(t);if(n)return n.expandByScalar(e),Eo.copy(this.camera.boundingBoxWorld),void(Eo.containsBox(n)||(yield this.resetCameraByBoundingBox(n,!0)))}))}focusAtDummy(t,e=500){return p(this,null,(function*(){var i,n;const s=this.dummiesController.getDummyById(t),r=null==(i=null==s?void 0:s.userData)?void 0:i.rmId;if(r){const t=null==(n=this.scene)?void 0:n.getBoundingBoxById(r);if(t)return t.expandByScalar(e),Eo.copy(this.camera.boundingBoxWorld),void(Eo.containsBox(t)||(yield this.resetCameraByBoundingBox(t,!0)))}if((null==s?void 0:s.position)&&!(null==s?void 0:s.position.isEmpty()))return Eo.setFromCenterAndSize(s.worldPosition,Ao.set(2*e,2*e)),void(this.camera.boundingBoxWorld.containsBox(Eo)||(yield this.resetCameraByBoundingBox(Eo,!0)))}))}resetCameraByBoundingBox(t,e=!1){return p(this,null,(function*(){if(!this.camera)return Promise.resolve();if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(Ao),t.getSize(Mo);const n=Math.max(Mo.x/this.camera.width,Mo.y/this.camera.height),s={x:Ao.x,y:Ao.y,z:0,s:n,r:0};yield this.animateCamera(i,s)}))}animateCamera(t,e){return p(this,null,(function*(){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise((i=>{this.tween=new _o.Tween(t).to(e,this.animateDuration).easing(_o.Easing.Exponential.Out).onUpdate((t=>{this.camera.position.set(t.x,t.y),this.camera.scaled.set(t.s,t.s),this.camera.rotation.set(t.r,t.r),this.camera.update()})).onComplete((()=>{this.controller&&(this.controller.enabled=!0),i()})).start()}))}))}fullscreen(){this.scene&&(this.scene&&!this.scene.viewBox.isEmpty()?Eo.copy(this.scene.viewBox):(this.scene.updateMatrixWorld(!0),this.scene.computeBoundingBox(),Eo.copy(this.scene.boundingBox)),this.resetCameraByBoundingBox(Eo,!0))}saveCameraPosition(t){Eo.copy(this.camera.boundingBoxWorld);const e=t?Co+t:Co;sessionStorage.setItem(e,JSON.stringify(Eo))}restoreCameraPosition(t){const e=t?Co+t:Co,i=sessionStorage.getItem(e);if(!i)return this.fullscreen();Eo.copy(JSON.parse(i)),this.resetCameraByBoundingBox(Eo,!0)}clearCameraPosition(t){const e=t?Co+t:Co;sessionStorage.setItem(e,"")}bindControllerEvents(){this.controller.addEventListener(zs.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(zs.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(zs.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(zs.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.addEventListener(Gs.SELECTED,this.multiSelectorSelectedHandler)}unbindControllerEvents(){this.controller.removeEventListener(zs.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(zs.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(zs.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(zs.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.removeEventListener(Gs.SELECTED,this.multiSelectorSelectedHandler)}handlePanStart(t){if((null==t?void 0:t.type)===zs.PAN_START||(null==t?void 0:t.type)===zs.WHEEL_START)return this.zoomToSelectEnable?(this.p1.copy(t.data.screenCoords),Eo.makeEmpty().expandByPoint(this.p1),void this.graph.draw(Eo)):void 0}handlePanEnd(t){if((null==t?void 0:t.type)===zs.PAN_END||(null==t?void 0:t.type)===zs.WHEEL_END)return this.zoomToSelectEnable?(this.p2.copy(t.data.screenCoords),Eo.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera),this.setByBox(Eo),this.graph.hide(),void Eo.makeEmpty()):void 0}handleControllerPanMove(t){(null==t?void 0:t.type)===zs.PAN_MOVE&&this.zoomToSelectEnable&&(this.p2.copy(t.data.screenCoords),Eo.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw(Eo))}handleControllerPointerOver(t){var e,i,n,s,r;const a=(null==(e=null==t?void 0:t.e)?void 0:e.target)||(null==(n=null==(i=null==t?void 0:t.e)?void 0:i.srcEvent)?void 0:n.target);let o=null==a?void 0:a.id;(null==o?void 0:o.indexOf("dummy"))>-1?(o=a.getAttribute("ae-id"),o&&this._currentAssetId!==o&&this.dispatchEvent({type:"POINTEROVER",data:{id:o,assetType:"dummy"},e:t.e})):o&&(null==(s=this.scene)?void 0:s.isBelongsToAssetType(o,Ti.WS))?this._currentAssetId!==o&&this.dispatchEvent({type:"POINTEROVER",data:{id:o,assetType:Ti.WS},e:t.e}):o&&(null==(r=this.scene)?void 0:r.isBelongsToAssetType(o,Ti.RM))?this._currentAssetId!==o&&this.dispatchEvent({type:"POINTEROVER",data:{id:o,assetType:Ti.RM},e:t.e}):(this._currentAssetId=void 0,this.dispatchEvent({type:"POINTERLEAVE",e:t.e})),this._currentAssetId=o}handleMultiSelectorSelected(t){this.dispatchEvent({type:"SELECTED",data:t.data})}setDummies(t){this.dummiesController.setDummiesByVos(t)}clearDummies(t){this.dummiesController.clearDummies(t)}update(t){this.tween&&this.tween.update(t)}}const Eo=new ai,Ao=new Fe,Mo=new Fe;var To=(t=>(t.SELECTED="SELECTED",t.POINTEROVER="POINTEROVER",t.POINTERLEAVE="POINTERLEAVE",t))(To||{});const Co="svg_camera_position_";class Io extends Ds{constructor(t){super(t),d(this,"name","SvgEmptyScene"),this.bind('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">\n <view id="defaultView" viewBox="-200 -200 500 500" />\n <style>\n /*#svg-loading-fast path {*/\n /* fill: #2E3032;*/\n /* animation: svg-loading-fast 2s ease infinite;*/\n /*}*/\n /*@keyframes svg-loading-fast {*/\n /* 0%, 100% {stroke-dasharray: 250; stroke-dashoffset: 250;}*/\n /* 68% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}*/\n /*}*/\n /*#svg-loading-fast .line {animation: svg-loading-fast 6s ease infinite;}*/\n /*@keyframes svg-loading-fast {*/\n /* 0% {stroke-dasharray: 250; stroke-dashoffset: 250; opacity: 1;}*/\n /* 50% {stroke-dasharray: 250; stroke-dashoffset: 0; opacity: 0.5;}*/\n /*}*/\n #svg-loading-fast path {animation: pathFrames 6s ease infinite;}\n @keyframes pathFrames {\n 0% {opacity: 1;}\n 50% {opacity: 0.5;}\n }\n #svg-loading-fast .triangle {animation: triangleFrames 3s ease infinite;}\n @keyframes triangleFrames {\n 0% {opacity: 1;}\n 50% {opacity: 0.3;}\n }\n #svg-loading-fast {fill: #525252}\n .line {stroke: #525252; stroke-width: 4px}\n .triangle {fill: #F26666}\n </style>\n <g id="svg-loading-fast">\n <g transform="scale(2, 2) translate(12, 0)">\n\x3c!-- <path d="M17.7 14L16.82 15.5L5 15.5L5 4L17.66 4L16.76 5.5L9.04 5.5L9.04 8.86L17.32 8.86L16.44 10.38L9.04 10.38L9.04 14L17.7 14Z" />--\x3e\n\x3c!-- <path d="M22.98 15.44L19.3 15.44L19.3 7.38L31.38 7.38L30.18 8.82L29.02 8.82L29.02 15.44L25.3 15.44L25.3 8.82L22.98 8.82L22.98 15.44ZM35.06 15.44L31.38 15.44L31.38 7.38L35.06 7.38L35.06 15.44Z" />--\x3e\n\x3c!-- <path d="M40.44 14.02L44.12 14.02L44.12 7.42L47.96 7.42L47.96 15.48L40.44 15.48L40.44 18.56L36.66 18.56L36.66 7.42L44.12 7.42L42.9 8.86L40.44 8.86L40.44 14.02Z" />--\x3e\n\x3c!-- <path d="M51.62 7.42L51.62 4.78L55.48 4.78L55.48 7.42L59 7.42L58.02 8.86L55.48 8.86L55.48 14.08L58.82 14.08L57.98 15.48L51.62 15.48L51.62 8.86L49.56 8.86L49.56 7.42L51.62 7.42Z" />--\x3e\n\x3c!-- <path d="M67.08 11.8L69.66 7.42L73.66 7.42L67.08 18.58L63.06 18.58L65.06 15.42L60.6 7.42L64.66 7.42L67.08 11.8Z" />--\x3e\n\n <path d="M13.5 15.8L12.62 17.3L0.799999 17.3L0.799999 5.8L13.46 5.8L12.56 7.3L4.84 7.3L4.84 10.66L13.12 10.66L12.24 12.18L4.84 12.18L4.84 15.8L13.5 15.8Z" />\n <path d="M32.12 17.3L28.52 17.3L28.52 9.9L25.18 17.3L22.1 17.3L18.8 10L18.8 17.3L15.1 17.3L15.1 5.8L20.06 5.8L23.68 13.68L27.32 5.8L32.12 5.8L32.12 17.3Z" />\n <path d="M37.72 12.8L37.72 17.3L33.72 17.3L33.72 5.8L42.22 5.8L41.06 7.34L37.72 7.34L37.72 11.3L42.22 11.3L42.22 5.8L46.28 5.8L46.28 12.8L37.72 12.8Z" />\n <path d="M57 17.3L53 17.3L53 7.34L47.88 7.34L47.88 5.8L62.48 5.8L61.6 7.34L57 7.34L57 17.3Z" />\n <path d="M69.92 13.52L64.08 5.78L68.62 5.78L71.92 10.58L75.14 5.78L79.64 5.78L73.92 13.56L73.92 17.28L69.92 17.28L69.92 13.52Z" />\n </g>\n\n <path class="line" d="M103.5 46L20 46" />\n <path class="line" d="M103.5 46L187 46" />\n <path class="triangle" d="M103.5 56L133.5 90L73.5 90Z" />\n </g>\n </svg>')}}var Do=(t=>(t[t.TIPS=1]="TIPS",t[t.HOVER=2]="HOVER",t[t.SELECT=4]="SELECT",t[t.SELECTOR_RECT=8]="SELECTOR_RECT",t[t.DISTRIBUTION=16]="DISTRIBUTION",t[t.DRAG=32]="DRAG",t[t.DUMMY=64]="DUMMY",t[t.LINKER=128]="LINKER",t[t.DRAW_POINT=1024]="DRAW_POINT",t[t.DRAW_POLYLINE=2048]="DRAW_POLYLINE",t[t.DRAW_POLYGON=4096]="DRAW_POLYGON",t[t.DRAW_TEXT=8192]="DRAW_TEXT",t))(Do||{}),Lo=(t=>(t[t.DEFAULT=1]="DEFAULT",t[t.HOVER=3]="HOVER",t[t.PICKER=15]="PICKER",t[t.DISTRIBUTION=31]="DISTRIBUTION",t[t.DUMMY=119]="DUMMY",t[t.LINKER=135]="LINKER",t[t.DRAWING=15399]="DRAWING",t))(Lo||{}),Bo=(t=>(t[t.HOVER=1]="HOVER",t[t.SELECT=2]="SELECT",t[t.HILIGHT=4]="HILIGHT",t[t.DYNAMIC_LINE=8]="DYNAMIC_LINE",t))(Bo||{}),Po=(t=>(t[t.KEEP_ORIGIN=1]="KEEP_ORIGIN",t[t.MAKE_COPY=2]="MAKE_COPY",t))(Po||{}),ko=(t=>(t[t.NONE=0]="NONE",t[t.DEFAULT=1]="DEFAULT",t[t.MODIFIED=2]="MODIFIED",t[t.NEW=3]="NEW",t))(ko||{});class No{constructor(t,i){d(this,"parent"),d(this,"_fnEnable",null==(e=Me.config)?void 0:e.fnEnable),d(this,"view"),d(this,"offset",new Fe),d(this,"scene"),d(this,"raycaster"),d(this,"boundingBoxPadding",15),d(this,"boundingBoxMap",new WeakMap),this.parent=t,this.view=i;const{container:n}=this.view||{};let s=n.getBoundingClientRect();this.offset.set(s.left,s.top),this.raycaster=new Zs}activate(){}deactivate(){this.scene=void 0}fnEnableChanged(t){this._fnEnable=!!t}bindScene(...t){return this.scene=t[0],this}mountShape(t,e){const{svgRoot:i}=this.scene||{};i&&(i.contains(t)||(e?i.insertBefore(t,e):i.appendChild(t)))}unmountShape(t){const{svgRoot:e}=this.scene||{};e&&e.removeChild(t)}showShape(t){t.style.display=""}hideShape(t){t.style.display="none"}getDynamicObjectsByIds(t){var e;const i=[];Array.isArray(t)||(t=[t]);for(let n=0,s=t.length;n<s;n++)(null==(e=this.scene)?void 0:e.getElementById(t[n]))&&i.push(this.scene.getElementById(t[n]));return i}_getIntersectObject(t){var e,i;this.raycaster.init(t.data,null==(e=this.view)?void 0:e.camera);const n=[];return null==(i=this.scene)||i.getIntersectObjects(this.raycaster,this.scene.assetType,n),n}_getIntersect(t,e,i=this.boundingBoxPadding){var n,s,r;this.raycaster.init({worldCoords:e},null==(n=this.view)?void 0:n.camera);for(let e=0,n=t.length;e<n;e++){let n=null==(r=null==(s=this.scene)?void 0:s.chef)?void 0:r.getElementBoundingBox(t[e].id);if(n||(this.getBoundingBoxByNode(t[e],Oo),Oo.isEmpty()||(n=Oo.clone())),n&&(n.expandByScalar(i),n.containsPoint(this.raycaster.worldCoords)))return t[e]}}getBoundingBoxByNode(t,e=new ai){return e.makeEmpty(),Tn.getBoundingBoxByNode(t,e),e}}const Oo=new ai;class Ro extends No{constructor(t,e){super(t,e),d(this,"_locals",[]),d(this,"currentShape"),d(this,"_dragMap",new Map),d(this,"_bindedShape"),d(this,"_bindedControlPoint"),d(this,"_cpOffset",new Fe),d(this,"_cpFill",Le.darkRed),d(this,"_cpStroke",Le.darkBlue),d(this,"_mpFill",Le.white),d(this,"_mpStroke",Le.darkBlue),d(this,"_bbox")}activate(){super.activate(),this.parent.enableHover(!1),this.mountControlPoints()}deactivate(){super.deactivate(),this._dragMap.size>0&&(this._dragMap.forEach((t=>{this.unmountShape(t),this.parent.drop(t)})),this._dragMap.clear()),this.unmountShape(this._controlPoints),this.unbindShape()}initShapes(t){if(!t)return;Array.isArray(t)||(t=[t]);const e=this.type===Do.DRAW_POINT,i=this.type===Do.DRAW_POLYLINE,n=this.type===Do.DRAW_POLYGON,s=this.type===Do.DRAW_TEXT;for(let r=0,a=(null==t?void 0:t.length)||0;r<a;r++){const{nodeName:a}=t[r];if(e&&"circle"!==a||s&&"text"!==a)continue;const o=zo.test((t[r].getAttribute("d")||"").trim());if(i&&"path"!==a||i&&"path"===a&&o)continue;if(n&&"path"!==a||n&&"path"===a&&!o)continue;const h=document.createElementNS("http://www.w3.org/2000/svg",a);Array.from(t[r].attributes).forEach((t=>h.setAttribute(t.name,t.value))),t[r].children.length>0?h.innerHTML=t[r].innerHTML:t[r].textContent&&(h.textContent=t[r].textContent),this.mountShape(h),this._locals.push(h);const l=h.id||es();this.parent.drag(h,{id:l,type:this.type})}}editorFillChanged(t){this._bindedShape&&(t?this._bindedShape.setAttribute("fill",t.toString()):this._bindedShape.removeAttribute("fill"))}editorStrokeChanged(t){this._bindedShape&&(t?this._bindedShape.setAttribute("stroke",t.toString()):this._bindedShape.removeAttribute("stroke"))}editorStrokeWidthChanged(t){var e,i;if(this._bindedShape){this._bindedShape.setAttribute("stroke-width",t.toString());for(let n,s=0,r=(null==(i=null==(e=this._controlPoints)?void 0:e.children)?void 0:i.length)||0;s<r;s++)n=this._controlPoints.children[s],n.setAttribute("r",t.toString())}}editorStrokeDasharrayChanged(t){this._bindedShape&&(t?this._bindedShape.setAttribute("stroke-dasharray",t):this._bindedShape.removeAttribute("stroke-dasharray"))}editorFontSizeChanged(t){var e;this._bindedShape&&"text"===(null==(e=this._bindedShape)?void 0:e.nodeName)&&(this._bindedShape.setAttribute("font-size",t.toString()),this.updateControlPoints())}editorTextContentChanged(t){var e,i;this._bindedShape&&"text"===(null==(e=this._bindedShape)?void 0:e.nodeName)&&(this._bindedShape.textContent=t,null==(i=this._bindedShape)||i.getBBox())}deleteCurrentShape(){if(!this._bindedShape)return;const t=ri.findIndex(this._locals,(t=>t===this._bindedShape));t>-1&&this._locals.splice(t,1),this.unmountShape(this._bindedShape),this.unbindControlPoint(),this.unbindShape(),this.currentShape=void 0}bindEditorDrag(t){}getDraggingObject(t){}beforeDragStart(t){}handleDragStart(t){var e,i,n;if((null==t?void 0:t.type)!==zs.PAN_START||(null==(e=null==t?void 0:t.targetVo)?void 0:e.type)!==this.type)return;const{target:s,targetVo:r,center:a}=t||{},o=(null==r?void 0:r.id)||es(),h=this.isControlPoints(s);if(Ho.set(a.x,a.y).sub(this.offset),(null==(i=this.view)?void 0:i.camera)&&Ho.unproject(null==(n=this.view)?void 0:n.camera),h)this.bindControlPoint(s),this.currentShape=s,this.beforeDragStart(t),this.updateControlPoints(this.currentShape,Ho),this.updateByControlPoints(Ho);else{this.bindShape(t);const e=this.hasShape(o);this.currentShape=this.getShape(o),e?(Tn.parseNodeTransform(this.currentShape,Wo).getTransition(Fo),this._cpOffset.copy(Ho).sub(Fo)):this._cpOffset.identity(),Ho.sub(this._cpOffset),Yn(this.currentShape,Ho),this.updateControlPoints(this._controlPoints,Ho)}}handleDragMove(t){var e,i;if((null==t?void 0:t.type)!==zs.PAN_MOVE)return;if(!this.currentShape)return;const{target:n,center:s}=t||{};Ho.set(s.x,s.y).sub(this.offset),(null==(e=this.view)?void 0:e.camera)&&Ho.unproject(null==(i=this.view)?void 0:i.camera),this.isControlPoints(n)?(this.updateControlPoints(this.currentShape,Ho),this.updateByControlPoints(Ho)):(Ho.sub(this._cpOffset),Yn(this.currentShape,Ho),this.updateControlPoints(this._controlPoints,Ho))}handleDragEnd(t){var e,i,n;if((null==t?void 0:t.type)!==zs.PAN_END)return;if(!this.currentShape)return;const{target:s,center:r}=t||{};Ho.set(r.x,r.y).sub(this.offset),(null==(e=this.view)?void 0:e.camera)&&Ho.unproject(null==(i=this.view)?void 0:i.camera),this.isControlPoints(s)?(this.updateControlPoints(this.currentShape,Ho),this.updateByControlPoints(Ho),this.unbindControlPoint()):(Ho.sub(this._cpOffset),Yn(this.currentShape,Ho),this.updateControlPoints(this._controlPoints,Ho));const a=null==(n=this.currentShape)?void 0:n.id;a&&!this._dragMap.has(a)&&(this.parent.drag(this.currentShape,{id:a,type:this.type}),this._dragMap.set(a,this.currentShape)),this.currentShape=void 0,this._cpOffset.identity()}hasShape(t){return void 0!==ri.find(this._locals,(e=>e.id===t))}getShape(t){throw new Error("Method not implemented.")}handleTap(t){(null==t?void 0:t.type)===zs.TAP&&this.bindShape(t)}getControlPoints(){throw new Error("Method not implemented.")}resetControlPoints(){this._controlPoints&&(this.unmountShape(this._controlPoints),this._controlPoints=this.getControlPoints(),this.mountControlPoints())}mountControlPoints(){if(!this._controlPoints)return;this.hideShape(this._controlPoints),this.mountShape(this._controlPoints);const t=ri.filter(this._controlPoints.children,(t=>"circle"===t.nodeName));for(let e=0,i=t.length;e<i;e++){const i=t[e].id;i&&(this.parent.drag(t[e],{id:i,type:this.type}),this._dragMap.set(i,t[e]))}}fnEnableChanged(t){super.fnEnableChanged(t),t?this.showShape(this._controlPoints):this.hideShape(this._controlPoints)}isControlPoints(t){return!!t&&(!!this._cpId&&ri.startsWith(null==t?void 0:t.id,this._cpId)||!!this._mpId&&ri.startsWith(null==t?void 0:t.id,this._mpId))}bindShape(t){var e;const i=this._getIntersect(this._locals,null==(e=null==t?void 0:t.data)?void 0:e.worldCoords);this._bindedShape=i,this._bindedShape?(this.resetControlPoints(),Tn.parseNodeTransform(this._bindedShape,Wo).getTransition(Fo),this.updateControlPoints(this._controlPoints,Fo),this.showShape(this._controlPoints)):this.unbindShape()}unbindShape(){this._bindedShape=void 0,this.hideShape(this._controlPoints)}bindControlPoint(t){this._bindedControlPoint=t}unbindControlPoint(){this._bindedControlPoint=void 0}updateControlPoints(t,e){throw new Error("Method not implemented.")}updateByControlPoints(t){throw new Error("Method not implemented.")}getCpIdx(t){return parseInt(t.slice(t.lastIndexOf("-")+1))-1}splitByControlPoint(t,e){var i;if(!this._bindedShape||!t||!e)return;if(!ri.startsWith(null==t?void 0:t.id,this._mpId))return;const n=null==t?void 0:t.id,s=this.getCpIdx(n);Tn.getPathProxyBySvgPathD(null==(i=this._bindedShape)?void 0:i.getAttribute("d"),Uo.dispose()),Uo.insertData(s,2,Fo.x,Fo.y);const r=Tn.getSvgPathDByData(Uo.data);this._bindedShape.setAttribute("d",r),this.resetControlPoints();const a=ri.find(this._controlPoints.children,(t=>t.id===`${this._cpId}${s+1}`));this.bindControlPoint(a),this.currentShape=a,this.showShape(this._controlPoints),Tn.parseNodeTransform(this._bindedShape,Wo).getTransition(Fo),this.updateControlPoints(this._controlPoints,Fo)}mergeByControlPoint(t,e){var i;if(!this._bindedShape||!t||!e)return;const n=null==t?void 0:t.id;if(!ri.startsWith(n,this._cpId))return;const s=this.getCpIdx(n);if(!s)return;if(ri.filter(this._controlPoints.children,(t=>t.id.startsWith(this._cpId))).length<=this._cpsLimit)return;Tn.getPathProxyBySvgPathD(null==(i=this._bindedShape)?void 0:i.getAttribute("d"),Uo.dispose()),Uo.removeData(s);const r=Tn.getSvgPathDByData(Uo.data);this._bindedShape.setAttribute("d",r),this.resetControlPoints(),this.showShape(this._controlPoints),Tn.parseNodeTransform(this._bindedShape,Wo).getTransition(Fo),this.updateControlPoints(this._controlPoints,Fo)}}const zo=/z\s*$/i,Ho=new Fe,Fo=new Fe,Wo=new Hi,Uo=new ln;class Vo extends Ro{constructor(t,e){super(t,e),d(this,"type",Do.DRAW_POINT),d(this,"_cpsId",`${this.type}-cps`),d(this,"_cpId",`${this._cpsId}-c-`),this._controlPoints=this.getControlPoints()}activate(){super.activate()}deactivate(){super.deactivate()}getShape(t){let e=this._locals.find((e=>e.id===t));if(!e){const i=new Re(Me.config.editor.fill||Le.green).setA(.6).getStyle(),n=new Re(Me.config.editor.stroke||Le.darkGreen).setA(.8).getStyle(),s=Me.config.editor.strokeWidth||5;e=qn({id:t,r:3*s,x:0,y:0,fill:i,stroke:n,strokeWidth:s}),e.setAttribute(`${Di}-type`,this.type.toString()),this._locals.push(e),this.mountShape(e,this._controlPoints)}return e}getControlPoints(){const t=Gn(`${this._cpsId}`),e=Me.config.editor.strokeWidth,i=qn({id:`${this._cpId}1`,x:0,y:0,r:e,fill:this._cpFill,stroke:this._cpStroke});return i.setAttribute(`${Di}-type`,(Do.DRAW_POINT|Do.DRAG).toString()),t.appendChild(i),t}updateControlPoints(t,e){if(t&&e)if(this.getBoundingBoxByNode(this._bindedShape,Go),Go.getCenter(qo),Go.getSize(jo),t===this._controlPoints){Yo.set(e.x+jo.x/2,e.y);const t=ri.filter(this._controlPoints.children,(t=>"circle"===t.nodeName));for(let e=0,i=t.length;e<i;e++)$n(t[e],Yo)}else Yo.set(qo.x+jo.x/2,qo.y),$n(t,Yo)}updateByControlPoints(t){this._bindedShape&&(Tn.getBoundingBoxByNode(this._bindedShape,Go),Go.getCenter(qo),jo.copy(t).sub(qo),this._bindedShape.setAttribute("r",Math.abs(jo.x).toString()))}}const qo=new Fe,jo=new Fe,Yo=new Fe,Go=new ai;class $o extends No{constructor(t,e){super(t,e),d(this,"type",Do.DRAG),d(this,"_els",[]),d(this,"_hms",new Map),d(this,"_vos",new Map),d(this,"onPanHandler",this._handleOnPan.bind(this)),d(this,"panMoveHandler",ri.throttle(this._handlePanMove.bind(this),100)),d(this,"panEndHandler",this._handlePanEnd.bind(this))}activate(){super.activate()}deactivate(){var t;super.deactivate();for(let e=((null==(t=this._els)?void 0:t.length)||0)-1;e>=0;e--)this.drop(this._els[e])}drag(t,e){this._els.includes(t)||(this.bindEvent(t),this._els.push(t),this._vos.set(t,e))}drop(t){if(!t)return;this.unbindEvent(t),this._vos.delete(t);const e=this._els.findIndex((e=>e===t));e>-1&&this._els.splice(e,1)}bindEvent(t){if(!t)return;const e=new Hammer.Manager(t,{domEvents:!0});e.add(new Hammer.Pan({threshold:0,pointers:0})),e.on("panstart",this.onPanHandler),e.on("panmove",this.panMoveHandler),e.on("panend",this.panEndHandler),this._hms.set(t,e)}unbindEvent(t){if(!t)return;const e=this._hms.get(t);e&&(e.off("panstart",this.onPanHandler),e.off("panmove",this.panMoveHandler),e.off("panend",this.panEndHandler),e.destroy(),this._hms.delete(t))}_handleOnPan(t){var e;if((null==t?void 0:t.type)!==zs.PAN_START)return;"function"==typeof t.preventDefault&&t.preventDefault(),"function"==typeof t.srcEvent.stopPropagation&&t.srcEvent.stopPropagation(),"function"==typeof t.srcEvent.stopImmediatePropagation&&t.srcEvent.stopImmediatePropagation();const{target:i,center:n}=t||{};if(!i)return;ri.set(t,"targetVo",this._vos.get(i)),this.parent.setEnablePan(!1),Xo.copy(n).sub(this.offset);const s={x:Xo.x,y:Xo.y};(null==(e=this.view)?void 0:e.camera)&&Xo.unproject(this.view.camera);const r={x:Xo.x,y:Xo.y};ri.set(t,"data",{screenCoords:s,worldCoords:r}),this.parent.handleDragStart(t)}_handlePanMove(t){var e;(null==t?void 0:t.type)===zs.PAN_MOVE&&((null==(e=this.parent)?void 0:e.isEnablePan())||(ri.set(t,"targetVo",this._vos.get(t.target)),this.parent.handleDragMove(t)))}_handlePanEnd(t){var e;this.parent.setEnablePan(!0),(null==t?void 0:t.type)===zs.PAN_END&&(ri.set(t,"targetVo",this._vos.get(t.target)),this.parent.handleDragEnd(t),null==(e=this.view.camera)||e.update())}}const Xo=new Fe;class Zo extends No{constructor(t,e){super(t,e),d(this,"type",Do.HOVER),d(this,"_hoverEnabled",!1),d(this,"_hovered"),d(this,"_hoverId")}activate(){var t;super.activate(),this.enableHover(null==(t=Me.config.controls)?void 0:t.enableHover)}deactivate(){super.deactivate(),this._hoverId=void 0,this._hovered=void 0}enableHover(t){return this._hoverEnabled=t,this}_handlePointerOver(t){var e,i,n,s,r;if((null==(e=null==t?void 0:t.e)?void 0:e.buttons)>0)return;let a=(null==(i=null==t?void 0:t.e)?void 0:i.target)||(null==(s=null==(n=null==t?void 0:t.e)?void 0:n.srcEvent)?void 0:s.target);null==(r=this.scene)||r.assetType;let o=null==a?void 0:a.id;if(!o){const e=this._getIntersectObject(t);o=(null==e?void 0:e.length)&&"function"==typeof e[0].getAttribute?e[0].getAttribute("id"):void 0,a=(null==e?void 0:e.length)?e[0]:void 0}o&&o!==this._hoverId&&(this.parent.handlePointerOver(t),this._hoverEnabled&&this._hover(a)),this._hoverId&&o!==this._hoverId&&(this._clearHover(this._hovered),this.parent.handlePointerOut(t)),this.parent.handlePointerMove(t),this._hoverId=o,this._hovered=a}_hover(t){t&&Cs(t,"hover")}_clearHover(t){t&&Is(t,"hover")}}const Jo="srgb",Qo="srgb-linear",Ko="linear",th="srgb";class eh{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){const i=this._listeners;return void 0!==i&&void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){const i=this._listeners;if(void 0===i)return;const n=i[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){const e=this._listeners;if(void 0===e)return;const i=e[t.type];if(void 0!==i){t.target=this;const e=i.slice(0);for(let i=0,n=e.length;i<n;i++)e[i].call(this,t);t.target=null}}}const ih=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function nh(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(ih[255&t]+ih[t>>8&255]+ih[t>>16&255]+ih[t>>24&255]+"-"+ih[255&e]+ih[e>>8&255]+"-"+ih[e>>16&15|64]+ih[e>>24&255]+"-"+ih[63&i|128]+ih[i>>8&255]+"-"+ih[i>>16&255]+ih[i>>24&255]+ih[255&n]+ih[n>>8&255]+ih[n>>16&255]+ih[n>>24&255]).toLowerCase()}function sh(t,e,i){return Math.max(e,Math.min(i,t))}function rh(t,e,i){return(1-i)*t+i*e}function ah(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function oh(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}class hh{constructor(t=0,e=0){hh.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=sh(this.x,t.x,e.x),this.y=sh(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=sh(this.x,t,e),this.y=sh(this.y,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(sh(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(sh(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),s=this.x-t.x,r=this.y-t.y;return this.x=s*i-r*n+t.x,this.y=s*n+r*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class lh{constructor(t,e,i,n,s,r,a,o,h){lh.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,n,s,r,a,o,h)}set(t,e,i,n,s,r,a,o,h){const l=this.elements;return l[0]=t,l[1]=n,l[2]=a,l[3]=e,l[4]=s,l[5]=o,l[6]=i,l[7]=r,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,s=this.elements,r=i[0],a=i[3],o=i[6],h=i[1],l=i[4],u=i[7],c=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],y=n[1],v=n[4],x=n[7],b=n[2],w=n[5],_=n[8];return s[0]=r*f+a*y+o*b,s[3]=r*m+a*v+o*w,s[6]=r*g+a*x+o*_,s[1]=h*f+l*y+u*b,s[4]=h*m+l*v+u*w,s[7]=h*g+l*x+u*_,s[2]=c*f+d*y+p*b,s[5]=c*m+d*v+p*w,s[8]=c*g+d*x+p*_,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*r*l-e*a*h-i*s*l+i*a*o+n*s*h-n*r*o}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*r-a*h,c=a*o-l*s,d=h*s-r*o,p=e*u+i*c+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=u*f,t[1]=(n*h-l*i)*f,t[2]=(a*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*o)*f,t[5]=(n*s-a*e)*f,t[6]=d*f,t[7]=(i*o-h*e)*f,t[8]=(r*e-i*s)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,s,r,a){const o=Math.cos(s),h=Math.sin(s);return this.set(i*o,i*h,-i*(o*r+h*a)+r+t,-n*h,n*o,-n*(-h*r+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(uh.makeScale(t,e)),this}rotate(t){return this.premultiply(uh.makeRotation(-t)),this}translate(t,e){return this.premultiply(uh.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const uh=new lh;function ch(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const dh=(new lh).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ph=(new lh).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);const fh=function(){const t={enabled:!0,workingColorSpace:Qo,spaces:{},convert:function(t,e,i){return!1!==this.enabled&&e!==i&&e&&i?(this.spaces[e].transfer===th&&(t.r=mh(t.r),t.g=mh(t.g),t.b=mh(t.b)),this.spaces[e].primaries!==this.spaces[i].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[i].fromXYZ)),this.spaces[i].transfer===th&&(t.r=gh(t.r),t.g=gh(t.g),t.b=gh(t.b)),t):t},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return""===t?Ko:this.spaces[t].transfer},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,i){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[i].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],n=[.3127,.329];return t.define({[Qo]:{primaries:e,whitePoint:n,transfer:Ko,toXYZ:dh,fromXYZ:ph,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:Jo},outputColorSpaceConfig:{drawingBufferColorSpace:Jo}},[Jo]:{primaries:e,whitePoint:n,transfer:th,toXYZ:dh,fromXYZ:ph,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:Jo}}}),t}();function mh(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function gh(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let yh;class vh{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{void 0===yh&&(yh=ch("canvas")),yh.width=t.width,yh.height=t.height;const e=yh.getContext("2d");t instanceof ImageData?e.putImageData(t,0,0):e.drawImage(t,0,0,t.width,t.height),i=yh}return i.toDataURL(e)}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=ch("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const n=i.getImageData(0,0,t.width,t.height),s=n.data;for(let t=0;t<s.length;t++)s[t]=255*mh(s[t]/255);return i.putImageData(n,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*mh(e[t]/255)):e[t]=mh(e[t]);return{data:e,width:t.width,height:t.height}}return t}}let xh=0;class bh{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:xh++}),this.uuid=nh(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let t;if(Array.isArray(n)){t=[];for(let e=0,i=n.length;e<i;e++)n[e].isDataTexture?t.push(wh(n[e].image)):t.push(wh(n[e]))}else t=wh(n);i.url=t}return e||(t.images[this.uuid]=i),i}}function wh(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?vh.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:{}}let _h=0,Sh=class t extends eh{constructor(e=t.DEFAULT_IMAGE,i=t.DEFAULT_MAPPING,n=1001,s=1001,r=1006,a=1008,o=1023,h=1009,l=t.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:_h++}),this.uuid=nh(),this.name="",this.source=new bh(e),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=n,this.wrapT=s,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=h,this.offset=new hh(0,0),this.repeat=new hh(1,1),this.center=new hh(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new lh,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isTextureArray=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isTextureArray=t.isTextureArray,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}};Sh.DEFAULT_IMAGE=null,Sh.DEFAULT_MAPPING=300,Sh.DEFAULT_ANISOTROPY=1;class Eh{constructor(t=0,e=0,i=0,n=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=n}static slerpFlat(t,e,i,n,s,r,a){let o=i[n+0],h=i[n+1],l=i[n+2],u=i[n+3];const c=s[r+0],d=s[r+1],p=s[r+2],f=s[r+3];if(0===a)return t[e+0]=o,t[e+1]=h,t[e+2]=l,void(t[e+3]=u);if(1===a)return t[e+0]=c,t[e+1]=d,t[e+2]=p,void(t[e+3]=f);if(u!==f||o!==c||h!==d||l!==p){let t=1-a;const e=o*c+h*d+l*p+u*f,i=e>=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const s=Math.sqrt(n),r=Math.atan2(s,e*i);t=Math.sin(t*r)/s,a=Math.sin(a*r)/s}const s=a*i;if(o=o*t+c*s,h=h*t+d*s,l=l*t+p*s,u=u*t+f*s,t===1-a){const t=1/Math.sqrt(o*o+h*h+l*l+u*u);o*=t,h*=t,l*=t,u*=t}}t[e]=o,t[e+1]=h,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,n,s,r){const a=i[n],o=i[n+1],h=i[n+2],l=i[n+3],u=s[r],c=s[r+1],d=s[r+2],p=s[r+3];return t[e]=a*p+l*u+o*d-h*c,t[e+1]=o*p+l*c+h*u-a*d,t[e+2]=h*p+l*d+a*c-o*u,t[e+3]=l*p-a*u-o*c-h*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,n=t._y,s=t._z,r=t._order,a=Math.cos,o=Math.sin,h=a(i/2),l=a(n/2),u=a(s/2),c=o(i/2),d=o(n/2),p=o(s/2);switch(r){case"XYZ":this._x=c*l*u+h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u-c*d*p;break;case"YXZ":this._x=c*l*u+h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u+c*d*p;break;case"ZXY":this._x=c*l*u-h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u-c*d*p;break;case"ZYX":this._x=c*l*u-h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u+c*d*p;break;case"YZX":this._x=c*l*u+h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u-c*d*p;break;case"XZY":this._x=c*l*u-h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u+c*d*p}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],s=e[8],r=e[1],a=e[5],o=e[9],h=e[2],l=e[6],u=e[10],c=i+a+u;if(c>0){const t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(l-o)*t,this._y=(s-h)*t,this._z=(r-n)*t}else if(i>a&&i>u){const t=2*Math.sqrt(1+i-a-u);this._w=(l-o)/t,this._x=.25*t,this._y=(n+r)/t,this._z=(s+h)/t}else if(a>u){const t=2*Math.sqrt(1+a-i-u);this._w=(s-h)/t,this._x=(n+r)/t,this._y=.25*t,this._z=(o+l)/t}else{const t=2*Math.sqrt(1+u-i-a);this._w=(r-n)/t,this._x=(s+h)/t,this._y=(o+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(sh(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,s=t._z,r=t._w,a=e._x,o=e._y,h=e._z,l=e._w;return this._x=i*l+r*a+n*h-s*o,this._y=n*l+r*o+s*a-i*h,this._z=s*l+r*h+i*o-n*a,this._w=r*l-i*a-n*o-s*h,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,s=this._z,r=this._w;let a=r*t._w+i*t._x+n*t._y+s*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=r,this._x=i,this._y=n,this._z=s,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*r+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*s+e*this._z,this.normalize(),this}const h=Math.sqrt(o),l=Math.atan2(h,a),u=Math.sin((1-e)*l)/h,c=Math.sin(e*l)/h;return this._w=r*u+this._w*c,this._x=i*u+this._x*c,this._y=n*u+this._y*c,this._z=s*u+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(n*Math.sin(t),n*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}let Ah=class t{constructor(e=0,i=0,n=0){t.prototype.isVector3=!0,this.x=e,this.y=i,this.z=n}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Th.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Th.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*n,this.y=s[1]*e+s[4]*i+s[7]*n,this.z=s[2]*e+s[5]*i+s[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,s=t.elements,r=1/(s[3]*e+s[7]*i+s[11]*n+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*n+s[12])*r,this.y=(s[1]*e+s[5]*i+s[9]*n+s[13])*r,this.z=(s[2]*e+s[6]*i+s[10]*n+s[14])*r,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,a=t.z,o=t.w,h=2*(r*n-a*i),l=2*(a*e-s*n),u=2*(s*i-r*e);return this.x=e+o*h+r*u-a*l,this.y=i+o*l+a*h-s*u,this.z=n+o*u+s*l-r*h,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,n=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n,this.y=s[1]*e+s[5]*i+s[9]*n,this.z=s[2]*e+s[6]*i+s[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=sh(this.x,t.x,e.x),this.y=sh(this.y,t.y,e.y),this.z=sh(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=sh(this.x,t,e),this.y=sh(this.y,t,e),this.z=sh(this.z,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(sh(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,s=t.z,r=e.x,a=e.y,o=e.z;return this.x=n*o-s*a,this.y=s*r-i*o,this.z=i*a-n*r,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Mh.copy(this).projectOnVector(t),this.sub(Mh)}reflect(t){return this.sub(Mh.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(sh(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const Mh=new Ah,Th=new Eh;class Ch{constructor(t=new Ah(1/0,1/0,1/0),e=new Ah(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(Dh.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(Dh.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Dh.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const i=t.geometry;if(void 0!==i){const n=i.getAttribute("position");if(!0===e&&void 0!==n&&!0!==t.isInstancedMesh)for(let e=0,i=n.count;e<i;e++)!0===t.isMesh?t.getVertexPosition(e,Dh):Dh.fromBufferAttribute(n,e),Dh.applyMatrix4(t.matrixWorld),this.expandByPoint(Dh);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),Lh.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),Lh.copy(i.boundingBox)),Lh.applyMatrix4(t.matrixWorld),this.union(Lh)}const n=t.children;for(let t=0,i=n.length;t<i;t++)this.expandByObject(n[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Dh),Dh.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(zh),Hh.subVectors(this.max,zh),Bh.subVectors(t.a,zh),Ph.subVectors(t.b,zh),kh.subVectors(t.c,zh),Nh.subVectors(Ph,Bh),Oh.subVectors(kh,Ph),Rh.subVectors(Bh,kh);let e=[0,-Nh.z,Nh.y,0,-Oh.z,Oh.y,0,-Rh.z,Rh.y,Nh.z,0,-Nh.x,Oh.z,0,-Oh.x,Rh.z,0,-Rh.x,-Nh.y,Nh.x,0,-Oh.y,Oh.x,0,-Rh.y,Rh.x,0];return!!Uh(e,Bh,Ph,kh,Hh)&&(e=[1,0,0,0,1,0,0,0,1],!!Uh(e,Bh,Ph,kh,Hh)&&(Fh.crossVectors(Nh,Oh),e=[Fh.x,Fh.y,Fh.z],Uh(e,Bh,Ph,kh,Hh)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Dh).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Dh).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Ih[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ih[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ih[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ih[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ih[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ih[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ih[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ih[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ih)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Ih=[new Ah,new Ah,new Ah,new Ah,new Ah,new Ah,new Ah,new Ah],Dh=new Ah,Lh=new Ch,Bh=new Ah,Ph=new Ah,kh=new Ah,Nh=new Ah,Oh=new Ah,Rh=new Ah,zh=new Ah,Hh=new Ah,Fh=new Ah,Wh=new Ah;function Uh(t,e,i,n,s){for(let r=0,a=t.length-3;r<=a;r+=3){Wh.fromArray(t,r);const a=s.x*Math.abs(Wh.x)+s.y*Math.abs(Wh.y)+s.z*Math.abs(Wh.z),o=e.dot(Wh),h=i.dot(Wh),l=n.dot(Wh);if(Math.max(-Math.max(o,h,l),Math.min(o,h,l))>a)return!1}return!0}const Vh=new Ch,qh=new Ah,jh=new Ah;class Yh{constructor(t=new Ah,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):Vh.setFromPoints(t).getCenter(i);let n=0;for(let e=0,s=t.length;e<s;e++)n=Math.max(n,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(n),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;qh.subVectors(t,this.center);const e=qh.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.addScaledVector(qh,i/t),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(jh.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(qh.copy(t.center).add(jh)),this.expandByPoint(qh.copy(t.center).sub(jh))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}let Gh=class t{constructor(e,i,n,s,r,a,o,h,l,u,c,d,p,f,m,g){t.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,i,n,s,r,a,o,h,l,u,c,d,p,f,m,g)}set(t,e,i,n,s,r,a,o,h,l,u,c,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=s,g[5]=r,g[9]=a,g[13]=o,g[2]=h,g[6]=l,g[10]=u,g[14]=c,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new t).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/$h.setFromMatrixColumn(t,0).length(),s=1/$h.setFromMatrixColumn(t,1).length(),r=1/$h.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*r,e[9]=i[9]*r,e[10]=i[10]*r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,n=t.y,s=t.z,r=Math.cos(i),a=Math.sin(i),o=Math.cos(n),h=Math.sin(n),l=Math.cos(s),u=Math.sin(s);if("XYZ"===t.order){const t=r*l,i=r*u,n=a*l,s=a*u;e[0]=o*l,e[4]=-o*u,e[8]=h,e[1]=i+n*h,e[5]=t-s*h,e[9]=-a*o,e[2]=s-t*h,e[6]=n+i*h,e[10]=r*o}else if("YXZ"===t.order){const t=o*l,i=o*u,n=h*l,s=h*u;e[0]=t+s*a,e[4]=n*a-i,e[8]=r*h,e[1]=r*u,e[5]=r*l,e[9]=-a,e[2]=i*a-n,e[6]=s+t*a,e[10]=r*o}else if("ZXY"===t.order){const t=o*l,i=o*u,n=h*l,s=h*u;e[0]=t-s*a,e[4]=-r*u,e[8]=n+i*a,e[1]=i+n*a,e[5]=r*l,e[9]=s-t*a,e[2]=-r*h,e[6]=a,e[10]=r*o}else if("ZYX"===t.order){const t=r*l,i=r*u,n=a*l,s=a*u;e[0]=o*l,e[4]=n*h-i,e[8]=t*h+s,e[1]=o*u,e[5]=s*h+t,e[9]=i*h-n,e[2]=-h,e[6]=a*o,e[10]=r*o}else if("YZX"===t.order){const t=r*o,i=r*h,n=a*o,s=a*h;e[0]=o*l,e[4]=s-t*u,e[8]=n*u+i,e[1]=u,e[5]=r*l,e[9]=-a*l,e[2]=-h*l,e[6]=i*u+n,e[10]=t-s*u}else if("XZY"===t.order){const t=r*o,i=r*h,n=a*o,s=a*h;e[0]=o*l,e[4]=-u,e[8]=h*l,e[1]=t*u+s,e[5]=r*l,e[9]=i*u-n,e[2]=n*u-i,e[6]=a*l,e[10]=s*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Zh,t,Jh)}lookAt(t,e,i){const n=this.elements;return tl.subVectors(t,e),0===tl.lengthSq()&&(tl.z=1),tl.normalize(),Qh.crossVectors(i,tl),0===Qh.lengthSq()&&(1===Math.abs(i.z)?tl.x+=1e-4:tl.z+=1e-4,tl.normalize(),Qh.crossVectors(i,tl)),Qh.normalize(),Kh.crossVectors(tl,Qh),n[0]=Qh.x,n[4]=Kh.x,n[8]=tl.x,n[1]=Qh.y,n[5]=Kh.y,n[9]=tl.y,n[2]=Qh.z,n[6]=Kh.z,n[10]=tl.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,s=this.elements,r=i[0],a=i[4],o=i[8],h=i[12],l=i[1],u=i[5],c=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],y=i[3],v=i[7],x=i[11],b=i[15],w=n[0],_=n[4],S=n[8],E=n[12],A=n[1],M=n[5],T=n[9],C=n[13],I=n[2],D=n[6],L=n[10],B=n[14],P=n[3],k=n[7],N=n[11],O=n[15];return s[0]=r*w+a*A+o*I+h*P,s[4]=r*_+a*M+o*D+h*k,s[8]=r*S+a*T+o*L+h*N,s[12]=r*E+a*C+o*B+h*O,s[1]=l*w+u*A+c*I+d*P,s[5]=l*_+u*M+c*D+d*k,s[9]=l*S+u*T+c*L+d*N,s[13]=l*E+u*C+c*B+d*O,s[2]=p*w+f*A+m*I+g*P,s[6]=p*_+f*M+m*D+g*k,s[10]=p*S+f*T+m*L+g*N,s[14]=p*E+f*C+m*B+g*O,s[3]=y*w+v*A+x*I+b*P,s[7]=y*_+v*M+x*D+b*k,s[11]=y*S+v*T+x*L+b*N,s[15]=y*E+v*C+x*B+b*O,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],s=t[12],r=t[1],a=t[5],o=t[9],h=t[13],l=t[2],u=t[6],c=t[10],d=t[14];return t[3]*(+s*o*u-n*h*u-s*a*c+i*h*c+n*a*d-i*o*d)+t[7]*(+e*o*d-e*h*c+s*r*c-n*r*d+n*h*l-s*o*l)+t[11]*(+e*h*u-e*a*d-s*r*u+i*r*d+s*a*l-i*h*l)+t[15]*(-n*a*l-e*o*u+e*a*c+n*r*u-i*r*c+i*o*l)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],y=u*m*h-f*c*h+f*o*d-a*m*d-u*o*g+a*c*g,v=p*c*h-l*m*h-p*o*d+r*m*d+l*o*g-r*c*g,x=l*f*h-p*u*h+p*a*d-r*f*d-l*a*g+r*u*g,b=p*u*o-l*f*o-p*a*c+r*f*c+l*a*m-r*u*m,w=e*y+i*v+n*x+s*b;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/w;return t[0]=y*_,t[1]=(f*c*s-u*m*s-f*n*d+i*m*d+u*n*g-i*c*g)*_,t[2]=(a*m*s-f*o*s+f*n*h-i*m*h-a*n*g+i*o*g)*_,t[3]=(u*o*s-a*c*s-u*n*h+i*c*h+a*n*d-i*o*d)*_,t[4]=v*_,t[5]=(l*m*s-p*c*s+p*n*d-e*m*d-l*n*g+e*c*g)*_,t[6]=(p*o*s-r*m*s-p*n*h+e*m*h+r*n*g-e*o*g)*_,t[7]=(r*c*s-l*o*s+l*n*h-e*c*h-r*n*d+e*o*d)*_,t[8]=x*_,t[9]=(p*u*s-l*f*s-p*i*d+e*f*d+l*i*g-e*u*g)*_,t[10]=(r*f*s-p*a*s+p*i*h-e*f*h-r*i*g+e*a*g)*_,t[11]=(l*a*s-r*u*s-l*i*h+e*u*h+r*i*d-e*a*d)*_,t[12]=b*_,t[13]=(l*f*n-p*u*n+p*i*c-e*f*c-l*i*m+e*u*m)*_,t[14]=(p*a*n-r*f*n-p*i*o+e*f*o+r*i*m-e*a*m)*_,t[15]=(r*u*n-l*a*n+l*i*o-e*u*o-r*i*c+e*a*c)*_,this}scale(t){const e=this.elements,i=t.x,n=t.y,s=t.z;return e[0]*=i,e[4]*=n,e[8]*=s,e[1]*=i,e[5]*=n,e[9]*=s,e[2]*=i,e[6]*=n,e[10]*=s,e[3]*=i,e[7]*=n,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,a=t.y,o=t.z,h=s*r,l=s*a;return this.set(h*r+i,h*a-n*o,h*o+n*a,0,h*a+n*o,l*a+i,l*o-n*r,0,h*o-n*a,l*o+n*r,s*o*o+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,n,s,r){return this.set(1,i,s,0,t,1,r,0,e,n,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,s=e._x,r=e._y,a=e._z,o=e._w,h=s+s,l=r+r,u=a+a,c=s*h,d=s*l,p=s*u,f=r*l,m=r*u,g=a*u,y=o*h,v=o*l,x=o*u,b=i.x,w=i.y,_=i.z;return n[0]=(1-(f+g))*b,n[1]=(d+x)*b,n[2]=(p-v)*b,n[3]=0,n[4]=(d-x)*w,n[5]=(1-(c+g))*w,n[6]=(m+y)*w,n[7]=0,n[8]=(p+v)*_,n[9]=(m-y)*_,n[10]=(1-(c+f))*_,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let s=$h.set(n[0],n[1],n[2]).length();const r=$h.set(n[4],n[5],n[6]).length(),a=$h.set(n[8],n[9],n[10]).length();this.determinant()<0&&(s=-s),t.x=n[12],t.y=n[13],t.z=n[14],Xh.copy(this);const o=1/s,h=1/r,l=1/a;return Xh.elements[0]*=o,Xh.elements[1]*=o,Xh.elements[2]*=o,Xh.elements[4]*=h,Xh.elements[5]*=h,Xh.elements[6]*=h,Xh.elements[8]*=l,Xh.elements[9]*=l,Xh.elements[10]*=l,e.setFromRotationMatrix(Xh),i.x=s,i.y=r,i.z=a,this}makePerspective(t,e,i,n,s,r,a=2e3){const o=this.elements,h=2*s/(e-t),l=2*s/(i-n),u=(e+t)/(e-t),c=(i+n)/(i-n);let d,p;if(2e3===a)d=-(r+s)/(r-s),p=-2*r*s/(r-s);else{if(2001!==a)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);d=-r/(r-s),p=-r*s/(r-s)}return o[0]=h,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,n,s,r,a=2e3){const o=this.elements,h=1/(e-t),l=1/(i-n),u=1/(r-s),c=(e+t)*h,d=(i+n)*l;let p,f;if(2e3===a)p=(r+s)*u,f=-2*u;else{if(2001!==a)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);p=s*u,f=-1*u}return o[0]=2*h,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=f,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}};const $h=new Ah,Xh=new Gh,Zh=new Ah(0,0,0),Jh=new Ah(1,1,1),Qh=new Ah,Kh=new Ah,tl=new Ah,el=new Gh,il=new Eh;class nl{constructor(t=0,e=0,i=0,n=nl.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const n=t.elements,s=n[0],r=n[4],a=n[8],o=n[1],h=n[5],l=n[9],u=n[2],c=n[6],d=n[10];switch(e){case"XYZ":this._y=Math.asin(sh(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-r,s)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-sh(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(sh(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-r,h)):(this._y=0,this._z=Math.atan2(o,s));break;case"ZYX":this._y=Math.asin(-sh(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(c,d),this._z=Math.atan2(o,s)):(this._x=0,this._z=Math.atan2(-r,h));break;case"YZX":this._z=Math.asin(sh(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-sh(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(c,h),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-l,d),this._y=0)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return el.makeRotationFromQuaternion(t),this.setFromRotationMatrix(el,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return il.setFromEuler(this),this.setFromQuaternion(il,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}nl.DEFAULT_ORDER="XYZ";class sl{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return!!(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}let rl=0;const al=new Ah,ol=new Eh,hl=new Gh,ll=new Ah,ul=new Ah,cl=new Ah,dl=new Eh,pl=new Ah(1,0,0),fl=new Ah(0,1,0),ml=new Ah(0,0,1),gl={type:"added"},yl={type:"removed"},vl={type:"childadded",child:null},xl={type:"childremoved",child:null};class bl extends eh{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:rl++}),this.uuid=nh(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=bl.DEFAULT_UP.clone();const t=new Ah,e=new nl,i=new Eh,n=new Ah(1,1,1);e._onChange((function(){i.setFromEuler(e,!1)})),i._onChange((function(){e.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Gh},normalMatrix:{value:new lh}}),this.matrix=new Gh,this.matrixWorld=new Gh,this.matrixAutoUpdate=bl.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=bl.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new sl,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return ol.setFromAxisAngle(t,e),this.quaternion.multiply(ol),this}rotateOnWorldAxis(t,e){return ol.setFromAxisAngle(t,e),this.quaternion.premultiply(ol),this}rotateX(t){return this.rotateOnAxis(pl,t)}rotateY(t){return this.rotateOnAxis(fl,t)}rotateZ(t){return this.rotateOnAxis(ml,t)}translateOnAxis(t,e){return al.copy(t).applyQuaternion(this.quaternion),this.position.add(al.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(pl,t)}translateY(t){return this.translateOnAxis(fl,t)}translateZ(t){return this.translateOnAxis(ml,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(hl.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?ll.copy(t):ll.set(t,e,i);const n=this.parent;this.updateWorldMatrix(!0,!1),ul.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?hl.lookAt(ul,ll,this.up):hl.lookAt(ll,ul,this.up),this.quaternion.setFromRotationMatrix(hl),n&&(hl.extractRotation(n.matrixWorld),ol.setFromRotationMatrix(hl),this.quaternion.premultiply(ol.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this||t&&t.isObject3D&&(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(gl),vl.child=t,this.dispatchEvent(vl),vl.child=null),this}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(yl),xl.child=t,this.dispatchEvent(xl),xl.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),hl.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),hl.multiply(t.parent.matrixWorld)),t.applyMatrix4(hl),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(gl),vl.child=t,this.dispatchEvent(vl),vl.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}}getObjectsByProperty(t,e,i=[]){this[t]===e&&i.push(this);const n=this.children;for(let s=0,r=n.length;s<r;s++)n[s].getObjectsByProperty(t,e,i);return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ul,t,cl),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ul,dl,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){const i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}toJSON(t){const e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const n={};function s(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.geometryInfo=this._geometryInfo.map((t=>c(u({},t),{boundingBox:t.boundingBox?{min:t.boundingBox.min.toArray(),max:t.boundingBox.max.toArray()}:void 0,boundingSphere:t.boundingSphere?{radius:t.boundingSphere.radius,center:t.boundingSphere.center.toArray()}:void 0}))),n.instanceInfo=this._instanceInfo.map((t=>u({},t))),n.availableInstanceIds=this._availableInstanceIds.slice(),n.availableGeometryIds=this._availableGeometryIds.slice(),n.nextIndexStart=this._nextIndexStart,n.nextVertexStart=this._nextVertexStart,n.geometryCount=this._geometryCount,n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.matricesTexture=this._matricesTexture.toJSON(t),n.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(n.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(n.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=s(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const i=e.shapes;if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){const n=i[e];s(t.shapes,n)}else s(t.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(s(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let i=0,n=this.material.length;i<n;i++)e.push(s(t.materials,this.material[i]));n.material=e}else n.material=s(t.materials,this.material);if(this.children.length>0){n.children=[];for(let e=0;e<this.children.length;e++)n.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let e=0;e<this.animations.length;e++){const i=this.animations[e];n.animations.push(s(t.animations,i))}}if(e){const e=r(t.geometries),n=r(t.materials),s=r(t.textures),a=r(t.images),o=r(t.shapes),h=r(t.skeletons),l=r(t.animations),u=r(t.nodes);e.length>0&&(i.geometries=e),n.length>0&&(i.materials=n),s.length>0&&(i.textures=s),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),h.length>0&&(i.skeletons=h),l.length>0&&(i.animations=l),u.length>0&&(i.nodes=u)}return i.object=n,i;function r(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const i=t.children[e];this.add(i.clone())}return this}}bl.DEFAULT_UP=new Ah(0,1,0),bl.DEFAULT_MATRIX_AUTO_UPDATE=!0,bl.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const wl={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},_l={h:0,s:0,l:0},Sl={h:0,s:0,l:0};function El(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}class Al{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(void 0===e&&void 0===i){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Jo){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,fh.toWorkingColorSpace(this,e),this}setRGB(t,e,i,n=fh.workingColorSpace){return this.r=t,this.g=e,this.b=i,fh.toWorkingColorSpace(this,n),this}setHSL(t,e,i,n=fh.workingColorSpace){if(t=(t%1+1)%1,e=sh(e,0,1),i=sh(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,s=2*i-n;this.r=El(s,n,t+1/3),this.g=El(s,n,t),this.b=El(s,n,t-1/3)}return fh.toWorkingColorSpace(this,n),this}setStyle(t,e=Jo){function i(t){void 0!==t&&parseFloat(t)}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(t)){let t;const s=n[1],r=n[2];switch(s){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return i(t[4]),this.setRGB(Math.min(255,parseInt(t[1],10))/255,Math.min(255,parseInt(t[2],10))/255,Math.min(255,parseInt(t[3],10))/255,e);if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return i(t[4]),this.setRGB(Math.min(100,parseInt(t[1],10))/100,Math.min(100,parseInt(t[2],10))/100,Math.min(100,parseInt(t[3],10))/100,e);break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return i(t[4]),this.setHSL(parseFloat(t[1])/360,parseFloat(t[2])/100,parseFloat(t[3])/100,e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],i=t.length;if(3===i)return this.setRGB(parseInt(t.charAt(0),16)/15,parseInt(t.charAt(1),16)/15,parseInt(t.charAt(2),16)/15,e);if(6===i)return this.setHex(parseInt(t,16),e)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Jo){const i=wl[t.toLowerCase()];return void 0!==i&&this.setHex(i,e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=mh(t.r),this.g=mh(t.g),this.b=mh(t.b),this}copyLinearToSRGB(t){return this.r=gh(t.r),this.g=gh(t.g),this.b=gh(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Jo){return fh.fromWorkingColorSpace(Ml.copy(this),t),65536*Math.round(sh(255*Ml.r,0,255))+256*Math.round(sh(255*Ml.g,0,255))+Math.round(sh(255*Ml.b,0,255))}getHexString(t=Jo){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=fh.workingColorSpace){fh.fromWorkingColorSpace(Ml.copy(this),e);const i=Ml.r,n=Ml.g,s=Ml.b,r=Math.max(i,n,s),a=Math.min(i,n,s);let o,h;const l=(a+r)/2;if(a===r)o=0,h=0;else{const t=r-a;switch(h=l<=.5?t/(r+a):t/(2-r-a),r){case i:o=(n-s)/t+(n<s?6:0);break;case n:o=(s-i)/t+2;break;case s:o=(i-n)/t+4}o/=6}return t.h=o,t.s=h,t.l=l,t}getRGB(t,e=fh.workingColorSpace){return fh.fromWorkingColorSpace(Ml.copy(this),e),t.r=Ml.r,t.g=Ml.g,t.b=Ml.b,t}getStyle(t=Jo){fh.fromWorkingColorSpace(Ml.copy(this),t);const e=Ml.r,i=Ml.g,n=Ml.b;return t!==Jo?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*i)},${Math.round(255*n)})`}offsetHSL(t,e,i){return this.getHSL(_l),this.setHSL(_l.h+t,_l.s+e,_l.l+i)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(_l),t.getHSL(Sl);const i=rh(_l.h,Sl.h,e),n=rh(_l.s,Sl.s,e),s=rh(_l.l,Sl.l,e);return this.setHSL(i,n,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,i=this.g,n=this.b,s=t.elements;return this.r=s[0]*e+s[3]*i+s[6]*n,this.g=s[1]*e+s[4]*i+s[7]*n,this.b=s[2]*e+s[5]*i+s[8]*n,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Ml=new Al;Al.NAMES=wl;const Tl=new Ah,Cl=new hh;let Il=0;class Dl{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Il++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,s=this.itemSize;n<s;n++)this.array[t+n]=e.array[i+n];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)Cl.fromBufferAttribute(this,e),Cl.applyMatrix3(t),this.setXY(e,Cl.x,Cl.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)Tl.fromBufferAttribute(this,e),Tl.applyMatrix3(t),this.setXYZ(e,Tl.x,Tl.y,Tl.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)Tl.fromBufferAttribute(this,e),Tl.applyMatrix4(t),this.setXYZ(e,Tl.x,Tl.y,Tl.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Tl.fromBufferAttribute(this,e),Tl.applyNormalMatrix(t),this.setXYZ(e,Tl.x,Tl.y,Tl.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Tl.fromBufferAttribute(this,e),Tl.transformDirection(t),this.setXYZ(e,Tl.x,Tl.y,Tl.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let i=this.array[t*this.itemSize+e];return this.normalized&&(i=ah(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=oh(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=ah(e,this.array)),e}setX(t,e){return this.normalized&&(e=oh(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=ah(e,this.array)),e}setY(t,e){return this.normalized&&(e=oh(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=ah(e,this.array)),e}setZ(t,e){return this.normalized&&(e=oh(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=ah(e,this.array)),e}setW(t,e){return this.normalized&&(e=oh(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=oh(e,this.array),i=oh(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,n){return t*=this.itemSize,this.normalized&&(e=oh(e,this.array),i=oh(i,this.array),n=oh(n,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this}setXYZW(t,e,i,n,s){return t*=this.itemSize,this.normalized&&(e=oh(e,this.array),i=oh(i,this.array),n=oh(n,this.array),s=oh(s,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),35044!==this.usage&&(t.usage=this.usage),t}}class Ll extends Dl{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class Bl extends Dl{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class Pl extends Dl{constructor(t,e,i){super(new Float32Array(t),e,i)}}let kl=0;const Nl=new Gh,Ol=new bl,Rl=new Ah,zl=new Ch,Hl=new Ch,Fl=new Ah;class Wl extends eh{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:kl++}),this.uuid=nh(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?Bl:Ll)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new lh).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return Nl.makeRotationFromQuaternion(t),this.applyMatrix4(Nl),this}rotateX(t){return Nl.makeRotationX(t),this.applyMatrix4(Nl),this}rotateY(t){return Nl.makeRotationY(t),this.applyMatrix4(Nl),this}rotateZ(t){return Nl.makeRotationZ(t),this.applyMatrix4(Nl),this}translate(t,e,i){return Nl.makeTranslation(t,e,i),this.applyMatrix4(Nl),this}scale(t,e,i){return Nl.makeScale(t,e,i),this.applyMatrix4(Nl),this}lookAt(t){return Ol.lookAt(t),Ol.updateMatrix(),this.applyMatrix4(Ol.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Rl).negate(),this.translate(Rl.x,Rl.y,Rl.z),this}setFromPoints(t){const e=this.getAttribute("position");if(void 0===e){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(n.x,n.y,n.z||0)}this.setAttribute("position",new Pl(e,3))}else{const i=Math.min(t.length,e.count);for(let n=0;n<i;n++){const i=t[n];e.setXYZ(n,i.x,i.y,i.z||0)}t.length,e.count,e.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Ch);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)this.boundingBox.set(new Ah(-1/0,-1/0,-1/0),new Ah(1/0,1/0,1/0));else{if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];zl.setFromBufferAttribute(i),this.morphTargetsRelative?(Fl.addVectors(this.boundingBox.min,zl.min),this.boundingBox.expandByPoint(Fl),Fl.addVectors(this.boundingBox.max,zl.max),this.boundingBox.expandByPoint(Fl)):(this.boundingBox.expandByPoint(zl.min),this.boundingBox.expandByPoint(zl.max))}}else this.boundingBox.makeEmpty();isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Yh);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)this.boundingSphere.set(new Ah,1/0);else if(t){const i=this.boundingSphere.center;if(zl.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];Hl.setFromBufferAttribute(i),this.morphTargetsRelative?(Fl.addVectors(zl.min,Hl.min),zl.expandByPoint(Fl),Fl.addVectors(zl.max,Hl.max),zl.expandByPoint(Fl)):(zl.expandByPoint(Hl.min),zl.expandByPoint(Hl.max))}zl.getCenter(i);let n=0;for(let e=0,s=t.count;e<s;e++)Fl.fromBufferAttribute(t,e),n=Math.max(n,i.distanceToSquared(Fl));if(e)for(let s=0,r=e.length;s<r;s++){const r=e[s],a=this.morphTargetsRelative;for(let e=0,s=r.count;e<s;e++)Fl.fromBufferAttribute(r,e),a&&(Rl.fromBufferAttribute(t,e),Fl.add(Rl)),n=Math.max(n,i.distanceToSquared(Fl))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return;const i=e.position,n=e.normal,s=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Dl(new Float32Array(4*i.count),4));const r=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<i.count;t++)a[t]=new Ah,o[t]=new Ah;const h=new Ah,l=new Ah,u=new Ah,c=new hh,d=new hh,p=new hh,f=new Ah,m=new Ah;function g(t,e,n){h.fromBufferAttribute(i,t),l.fromBufferAttribute(i,e),u.fromBufferAttribute(i,n),c.fromBufferAttribute(s,t),d.fromBufferAttribute(s,e),p.fromBufferAttribute(s,n),l.sub(h),u.sub(h),d.sub(c),p.sub(c);const r=1/(d.x*p.y-p.x*d.y);isFinite(r)&&(f.copy(l).multiplyScalar(p.y).addScaledVector(u,-d.y).multiplyScalar(r),m.copy(u).multiplyScalar(d.x).addScaledVector(l,-p.x).multiplyScalar(r),a[t].add(f),a[e].add(f),a[n].add(f),o[t].add(m),o[e].add(m),o[n].add(m))}let y=this.groups;0===y.length&&(y=[{start:0,count:t.count}]);for(let e=0,i=y.length;e<i;++e){const i=y[e],n=i.start;for(let e=n,s=n+i.count;e<s;e+=3)g(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const v=new Ah,x=new Ah,b=new Ah,w=new Ah;function _(t){b.fromBufferAttribute(n,t),w.copy(b);const e=a[t];v.copy(e),v.sub(b.multiplyScalar(b.dot(e))).normalize(),x.crossVectors(w,e);const i=x.dot(o[t])<0?-1:1;r.setXYZW(t,v.x,v.y,v.z,i)}for(let e=0,i=y.length;e<i;++e){const i=y[e],n=i.start;for(let e=n,s=n+i.count;e<s;e+=3)_(t.getX(e+0)),_(t.getX(e+1)),_(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new Dl(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);const n=new Ah,s=new Ah,r=new Ah,a=new Ah,o=new Ah,h=new Ah,l=new Ah,u=new Ah;if(t)for(let c=0,d=t.count;c<d;c+=3){const d=t.getX(c+0),p=t.getX(c+1),f=t.getX(c+2);n.fromBufferAttribute(e,d),s.fromBufferAttribute(e,p),r.fromBufferAttribute(e,f),l.subVectors(r,s),u.subVectors(n,s),l.cross(u),a.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),h.fromBufferAttribute(i,f),a.add(l),o.add(l),h.add(l),i.setXYZ(d,a.x,a.y,a.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(f,h.x,h.y,h.z)}else for(let t=0,a=e.count;t<a;t+=3)n.fromBufferAttribute(e,t+0),s.fromBufferAttribute(e,t+1),r.fromBufferAttribute(e,t+2),l.subVectors(r,s),u.subVectors(n,s),l.cross(u),i.setXYZ(t+0,l.x,l.y,l.z),i.setXYZ(t+1,l.x,l.y,l.z),i.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)Fl.fromBufferAttribute(t,e),Fl.normalize(),t.setXYZ(e,Fl.x,Fl.y,Fl.z)}toNonIndexed(){function t(t,e){const i=t.array,n=t.itemSize,s=t.normalized,r=new i.constructor(e.length*n);let a=0,o=0;for(let s=0,h=e.length;s<h;s++){a=t.isInterleavedBufferAttribute?e[s]*t.data.stride+t.offset:e[s]*n;for(let t=0;t<n;t++)r[o++]=i[a++]}return new Dl(r,n,s)}if(null===this.index)return this;const e=new Wl,i=this.index.array,n=this.attributes;for(const s in n){const r=t(n[s],i);e.setAttribute(s,r)}const s=this.morphAttributes;for(const n in s){const r=[],a=s[n];for(let e=0,n=a.length;e<n;e++){const n=t(a[e],i);r.push(n)}e.morphAttributes[n]=r}e.morphTargetsRelative=this.morphTargetsRelative;const r=this.groups;for(let t=0,i=r.length;t<i;t++){const i=r[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e];t.data.attributes[e]=n.toJSON(t.data)}const n={};let s=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],r=[];for(let e=0,n=i.length;e<n;e++){const n=i[e];r.push(n.toJSON(t.data))}r.length>0&&(n[e]=r,s=!0)}s&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(t.data.groups=JSON.parse(JSON.stringify(r)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone());const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const s=t.morphAttributes;for(const t in s){const i=[],n=s[t];for(let t=0,s=n.length;t<s;t++)i.push(n[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;const r=t.groups;for(let t=0,e=r.length;t<e;t++){const e=r[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ul{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),s=0;e.push(0);for(let r=1;r<=t;r++)i=this.getPoint(r/t),s+=i.distanceTo(n),e.push(s),n=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e=null){const i=this.getLengths();let n=0;const s=i.length;let r;r=e||t*i[s-1];let a,o=0,h=s-1;for(;o<=h;)if(n=Math.floor(o+(h-o)/2),a=i[n]-r,a<0)o=n+1;else{if(!(a>0)){h=n;break}h=n-1}if(n=h,i[n]===r)return n/(s-1);const l=i[n];return(n+(r-l)/(i[n+1]-l))/(s-1)}getTangent(t,e){const i=1e-4;let n=t-i,s=t+i;n<0&&(n=0),s>1&&(s=1);const r=this.getPoint(n),a=this.getPoint(s),o=e||(r.isVector2?new hh:new Ah);return o.copy(a).sub(r).normalize(),o}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e=!1){const i=new Ah,n=[],s=[],r=[],a=new Ah,o=new Gh;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new Ah)}s[0]=new Ah,r[0]=new Ah;let h=Number.MAX_VALUE;const l=Math.abs(n[0].x),u=Math.abs(n[0].y),c=Math.abs(n[0].z);l<=h&&(h=l,i.set(1,0,0)),u<=h&&(h=u,i.set(0,1,0)),c<=h&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),s[0].crossVectors(n[0],a),r[0].crossVectors(n[0],s[0]);for(let e=1;e<=t;e++){if(s[e]=s[e-1].clone(),r[e]=r[e-1].clone(),a.crossVectors(n[e-1],n[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(sh(n[e-1].dot(n[e]),-1,1));s[e].applyMatrix4(o.makeRotationAxis(a,t))}r[e].crossVectors(n[e],s[e])}if(!0===e){let e=Math.acos(sh(s[0].dot(s[t]),-1,1));e/=t,n[0].dot(a.crossVectors(s[0],s[t]))>0&&(e=-e);for(let i=1;i<=t;i++)s[i].applyMatrix4(o.makeRotationAxis(n[i],e*i)),r[i].crossVectors(n[i],s[i])}return{tangents:n,normals:s,binormals:r}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Vl extends Ul{constructor(t=0,e=0,i=1,n=1,s=0,r=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=s,this.aEndAngle=r,this.aClockwise=a,this.aRotation=o}getPoint(t,e=new hh){const i=e,n=2*Math.PI;let s=this.aEndAngle-this.aStartAngle;const r=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=n;for(;s>n;)s-=n;s<Number.EPSILON&&(s=r?0:n),!0!==this.aClockwise||r||(s===n?s=-n:s-=n);const a=this.aStartAngle+t*s;let o=this.aX+this.xRadius*Math.cos(a),h=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=o-this.aX,n=h-this.aY;o=i*t-n*e+this.aX,h=i*e+n*t+this.aY}return i.set(o,h)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}function ql(){let t=0,e=0,i=0,n=0;function s(s,r,a,o){t=s,e=a,i=-3*s+3*r-2*a-o,n=2*s-2*r+a+o}return{initCatmullRom:function(t,e,i,n,r){s(e,i,r*(i-t),r*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,r,a,o){let h=(e-t)/r-(i-t)/(r+a)+(i-e)/a,l=(i-e)/a-(n-e)/(a+o)+(n-i)/o;h*=a,l*=a,s(e,i,h,l)},calc:function(s){const r=s*s;return t+e*s+i*r+n*(r*s)}}}const jl=new Ah,Yl=new ql,Gl=new ql,$l=new ql;function Xl(t,e,i,n,s){const r=.5*(n-e),a=.5*(s-i),o=t*t;return(2*i-2*n+r+a)*(t*o)+(-3*i+3*n-2*r-a)*o+r*t+i}function Zl(t,e,i,n){return function(t,e){const i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}function Jl(t,e,i,n,s){return function(t,e){const i=1-t;return i*i*i*e}(t,e)+function(t,e){const i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,s)}class Ql extends Ul{constructor(t=new hh,e=new hh,i=new hh,n=new hh){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new hh){const i=e,n=this.v0,s=this.v1,r=this.v2,a=this.v3;return i.set(Jl(t,n.x,s.x,r.x,a.x),Jl(t,n.y,s.y,r.y,a.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Kl extends Ul{constructor(t=new hh,e=new hh){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new hh){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new hh){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class tu extends Ul{constructor(t=new hh,e=new hh,i=new hh){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new hh){const i=e,n=this.v0,s=this.v1,r=this.v2;return i.set(Zl(t,n.x,s.x,r.x),Zl(t,n.y,s.y,r.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class eu extends Ul{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new hh){const i=e,n=this.points,s=(n.length-1)*t,r=Math.floor(s),a=s-r,o=n[0===r?r:r-1],h=n[r],l=n[r>n.length-2?n.length-1:r+1],u=n[r>n.length-3?n.length-1:r+2];return i.set(Xl(a,o.x,h.x,l.x,u.x),Xl(a,o.y,h.y,l.y,u.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new hh).fromArray(i))}return this}}var iu=Object.freeze({__proto__:null,ArcCurve:class extends Vl{constructor(t,e,i,n,s,r){super(t,e,i,i,n,s,r),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends Ul{constructor(t=[],e=!1,i="centripetal",n=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=n}getPoint(t,e=new Ah){const i=e,n=this.points,s=n.length,r=(s-(this.closed?0:1))*t;let a,o,h=Math.floor(r),l=r-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/s)+1)*s:0===l&&h===s-1&&(h=s-2,l=1),this.closed||h>0?a=n[(h-1)%s]:(jl.subVectors(n[0],n[1]).add(n[0]),a=jl);const u=n[h%s],c=n[(h+1)%s];if(this.closed||h+2<s?o=n[(h+2)%s]:(jl.subVectors(n[s-1],n[s-2]).add(n[s-1]),o=jl),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(a.distanceToSquared(u),t),i=Math.pow(u.distanceToSquared(c),t),n=Math.pow(c.distanceToSquared(o),t);i<1e-4&&(i=1),e<1e-4&&(e=i),n<1e-4&&(n=i),Yl.initNonuniformCatmullRom(a.x,u.x,c.x,o.x,e,i,n),Gl.initNonuniformCatmullRom(a.y,u.y,c.y,o.y,e,i,n),$l.initNonuniformCatmullRom(a.z,u.z,c.z,o.z,e,i,n)}else"catmullrom"===this.curveType&&(Yl.initCatmullRom(a.x,u.x,c.x,o.x,this.tension),Gl.initCatmullRom(a.y,u.y,c.y,o.y,this.tension),$l.initCatmullRom(a.z,u.z,c.z,o.z,this.tension));return i.set(Yl.calc(l),Gl.calc(l),$l.calc(l)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new Ah).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},CubicBezierCurve:Ql,CubicBezierCurve3:class extends Ul{constructor(t=new Ah,e=new Ah,i=new Ah,n=new Ah){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new Ah){const i=e,n=this.v0,s=this.v1,r=this.v2,a=this.v3;return i.set(Jl(t,n.x,s.x,r.x,a.x),Jl(t,n.y,s.y,r.y,a.y),Jl(t,n.z,s.z,r.z,a.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},EllipseCurve:Vl,LineCurve:Kl,LineCurve3:class extends Ul{constructor(t=new Ah,e=new Ah){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new Ah){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Ah){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},QuadraticBezierCurve:tu,QuadraticBezierCurve3:class extends Ul{constructor(t=new Ah,e=new Ah,i=new Ah){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new Ah){const i=e,n=this.v0,s=this.v1,r=this.v2;return i.set(Zl(t,n.x,s.x,r.x),Zl(t,n.y,s.y,r.y),Zl(t,n.z,s.z,r.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},SplineCurve:eu});class nu extends Ul{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const i=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new iu[i](e,t))}return this}getPoint(t,e){const i=t*this.getLength(),n=this.getCurveLengths();let s=0;for(;s<n.length;){if(n[s]>=i){const t=n[s]-i,r=this.curves[s],a=r.getLength(),o=0===a?0:1-t/a;return r.getPointAt(o,e)}s++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let i;for(let n=0,s=this.curves;n<s.length;n++){const r=s[n],a=r.isEllipseCurve?2*t:r.isLineCurve||r.isLineCurve3?1:r.isSplineCurve?t*r.points.length:t,o=r.getPoints(a);for(let t=0;t<o.length;t++){const n=o[t];i&&i.equals(n)||(e.push(n),i=n)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){const i=this.curves[e];t.curves.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push((new iu[i.type]).fromJSON(i))}return this}}class su extends nu{constructor(t){super(),this.type="Path",this.currentPoint=new hh,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const i=new Kl(this.currentPoint.clone(),new hh(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,n){const s=new tu(this.currentPoint.clone(),new hh(t,e),new hh(i,n));return this.curves.push(s),this.currentPoint.set(i,n),this}bezierCurveTo(t,e,i,n,s,r){const a=new Ql(this.currentPoint.clone(),new hh(t,e),new hh(i,n),new hh(s,r));return this.curves.push(a),this.currentPoint.set(s,r),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),i=new eu(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,n,s,r){const a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(t+a,e+o,i,n,s,r),this}absarc(t,e,i,n,s,r){return this.absellipse(t,e,i,i,n,s,r),this}ellipse(t,e,i,n,s,r,a,o){const h=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+h,e+l,i,n,s,r,a,o),this}absellipse(t,e,i,n,s,r,a,o){const h=new Vl(t,e,i,n,s,r,a,o);if(this.curves.length>0){const t=h.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(h);const l=h.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}let ru=class extends su{constructor(t){super(t),this.uuid=nh(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){const i=this.holes[e];t.holes.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push((new su).fromJSON(i))}return this}};function au(t,e,i,n,s){let r;if(s===function(t,e,i,n){let s=0;for(let r=e,a=i-n;r<i;r+=n)s+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return s}(t,e,i,n)>0)for(let s=e;s<i;s+=n)r=Cu(s/n|0,t[s],t[s+1],r);else for(let s=i-n;s>=e;s-=n)r=Cu(s/n|0,t[s],t[s+1],r);return r&&_u(r,r.next)&&(Iu(r),r=r.next),r}function ou(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!_u(n,n.next)&&0!==wu(n.prev,n,n.next))n=n.next;else{if(Iu(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function hu(t,e,i,n,s,r,a){if(!t)return;!a&&r&&function(t,e,i,n){let s=t;do{0===s.z&&(s.z=gu(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){let e,i=1;do{let n,s=t;t=null;let r=null;for(e=0;s;){e++;let a=s,o=0;for(let t=0;t<i&&(o++,a=a.nextZ,a);t++);let h=i;for(;o>0||h>0&&a;)0!==o&&(0===h||!a||s.z<=a.z)?(n=s,s=s.nextZ,o--):(n=a,a=a.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;s=a}r.nextZ=null,i*=2}while(e>1)}(s)}(t,n,s,r);let o=t;for(;t.prev!==t.next;){const h=t.prev,l=t.next;if(r?uu(t,n,s,r):lu(t))e.push(h.i,t.i,l.i),Iu(t),t=l.next,o=l.next;else if((t=l)===o){a?1===a?hu(t=cu(ou(t),e),e,i,n,s,r,2):2===a&&du(t,e,i,n,s,r):hu(ou(t),e,i,n,s,r,1);break}}}function lu(t){const e=t.prev,i=t,n=t.next;if(wu(e,i,n)>=0)return!1;const s=e.x,r=i.x,a=n.x,o=e.y,h=i.y,l=n.y,u=Math.min(s,r,a),c=Math.min(o,h,l),d=Math.max(s,r,a),p=Math.max(o,h,l);let f=n.next;for(;f!==e;){if(f.x>=u&&f.x<=d&&f.y>=c&&f.y<=p&&xu(s,o,r,h,a,l,f.x,f.y)&&wu(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function uu(t,e,i,n){const s=t.prev,r=t,a=t.next;if(wu(s,r,a)>=0)return!1;const o=s.x,h=r.x,l=a.x,u=s.y,c=r.y,d=a.y,p=Math.min(o,h,l),f=Math.min(u,c,d),m=Math.max(o,h,l),g=Math.max(u,c,d),y=gu(p,f,e,i,n),v=gu(m,g,e,i,n);let x=t.prevZ,b=t.nextZ;for(;x&&x.z>=y&&b&&b.z<=v;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==s&&x!==a&&xu(o,u,h,c,l,d,x.x,x.y)&&wu(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==s&&b!==a&&xu(o,u,h,c,l,d,b.x,b.y)&&wu(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;x&&x.z>=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==s&&x!==a&&xu(o,u,h,c,l,d,x.x,x.y)&&wu(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==s&&b!==a&&xu(o,u,h,c,l,d,b.x,b.y)&&wu(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function cu(t,e){let i=t;do{const n=i.prev,s=i.next.next;!_u(n,s)&&Su(n,i,i.next,s)&&Mu(n,s)&&Mu(s,n)&&(e.push(n.i,i.i,s.i),Iu(i),Iu(i.next),i=t=s),i=i.next}while(i!==t);return ou(i)}function du(t,e,i,n,s,r){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&bu(a,t)){let o=Tu(a,t);return a=ou(a,a.next),o=ou(o,o.next),hu(a,e,i,n,s,r,0),void hu(o,e,i,n,s,r,0)}t=t.next}a=a.next}while(a!==t)}function pu(t,e){let i=t.x-e.x;return 0===i&&(i=t.y-e.y,0===i)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function fu(t,e){const i=function(t,e){let i=e;const n=t.x,s=t.y;let r,a=-1/0;if(_u(t,i))return i;do{if(_u(t,i.next))return i.next;if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){const t=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>a&&(a=t,r=i.x<i.next.x?i:i.next,t===n))return r}i=i.next}while(i!==e);if(!r)return null;const o=r,h=r.x,l=r.y;let u=1/0;i=r;do{if(n>=i.x&&i.x>=h&&n!==i.x&&vu(s<l?n:a,s,h,l,s<l?a:n,s,i.x,i.y)){const e=Math.abs(s-i.y)/(n-i.x);Mu(i,t)&&(e<u||e===u&&(i.x>r.x||i.x===r.x&&mu(r,i)))&&(r=i,u=e)}i=i.next}while(i!==o);return r}(t,e);if(!i)return e;const n=Tu(i,t);return ou(n,n.next),ou(i,i.next)}function mu(t,e){return wu(t.prev,t,e.prev)<0&&wu(e.next,t,t.next)<0}function gu(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function yu(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function vu(t,e,i,n,s,r,a,o){return(s-a)*(e-o)>=(t-a)*(r-o)&&(t-a)*(n-o)>=(i-a)*(e-o)&&(i-a)*(r-o)>=(s-a)*(n-o)}function xu(t,e,i,n,s,r,a,o){return!(t===a&&e===o)&&vu(t,e,i,n,s,r,a,o)}function bu(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Su(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Mu(t,e)&&Mu(e,t)&&function(t,e){let i=t,n=!1;const s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(wu(t.prev,t,e.prev)||wu(t,e.prev,e))||_u(t,e)&&wu(t.prev,t,t.next)>0&&wu(e.prev,e,e.next)>0)}function wu(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function _u(t,e){return t.x===e.x&&t.y===e.y}function Su(t,e,i,n){const s=Au(wu(t,e,i)),r=Au(wu(t,e,n)),a=Au(wu(i,n,t)),o=Au(wu(i,n,e));return s!==r&&a!==o||!(0!==s||!Eu(t,i,e))||!(0!==r||!Eu(t,n,e))||!(0!==a||!Eu(i,t,n))||!(0!==o||!Eu(i,e,n))}function Eu(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Au(t){return t>0?1:t<0?-1:0}function Mu(t,e){return wu(t.prev,t,t.next)<0?wu(t,e,t.next)>=0&&wu(t,t.prev,e)>=0:wu(t,e,t.prev)<0||wu(t,t.next,e)<0}function Tu(t,e){const i=Du(t.i,t.x,t.y),n=Du(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function Cu(t,e,i,n){const s=Du(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function Iu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Du(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class Lu{static triangulate(t,e,i=2){return function(t,e,i=2){const n=e&&e.length,s=n?e[0]*i:t.length;let r=au(t,0,s,i,!0);const a=[];if(!r||r.next===r.prev)return a;let o,h,l;if(n&&(r=function(t,e,i,n){const s=[];for(let i=0,r=e.length;i<r;i++){const a=au(t,e[i]*n,i<r-1?e[i+1]*n:t.length,n,!1);a===a.next&&(a.steiner=!0),s.push(yu(a))}s.sort(pu);for(let t=0;t<s.length;t++)i=fu(s[t],i);return i}(t,e,r,i)),t.length>80*i){o=1/0,h=1/0;let e=-1/0,n=-1/0;for(let r=i;r<s;r+=i){const i=t[r],s=t[r+1];i<o&&(o=i),s<h&&(h=s),i>e&&(e=i),s>n&&(n=s)}l=Math.max(e-o,n-h),l=0!==l?32767/l:0}return hu(r,a,i,o,h,l,0),a}(t,e,i)}}class Bu{static area(t){const e=t.length;let i=0;for(let n=e-1,s=0;s<e;n=s++)i+=t[n].x*t[s].y-t[s].x*t[n].y;return.5*i}static isClockWise(t){return Bu.area(t)<0}static triangulateShape(t,e){const i=[],n=[],s=[];Pu(t),ku(i,t);let r=t.length;e.forEach(Pu);for(let t=0;t<e.length;t++)n.push(r),r+=e[t].length,ku(i,e[t]);const a=Lu.triangulate(i,n);for(let t=0;t<a.length;t+=3)s.push(a.slice(t,t+3));return s}}function Pu(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function ku(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}const Nu={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};const Ou=new class{constructor(t,e,i){const n=this;let s,r=!1,a=0,o=0;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,!1===r&&void 0!==n.onStart&&n.onStart(t,a,o),r=!0},this.itemEnd=function(t){a++,void 0!==n.onProgress&&n.onProgress(t,a,o),a===o&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){const e=h.indexOf(t);return-1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=h.length;e<i;e+=2){const i=h[e],n=h[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}}};class Ru{constructor(t){this.manager=void 0!==t?t:Ou,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const i=this;return new Promise((function(n,s){i.load(t,n,e,s)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}Ru.DEFAULT_MATERIAL_NAME="__DEFAULT";const zu={};class Hu extends Error{constructor(t,e){super(t),this.response=e}}class Fu extends Ru{constructor(t){super(t),this.mimeType="",this.responseType=""}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const s=Nu.get(t);if(void 0!==s)return this.manager.itemStart(t),setTimeout((()=>{e&&e(s),this.manager.itemEnd(t)}),0),s;if(void 0!==zu[t])return void zu[t].push({onLoad:e,onProgress:i,onError:n});zu[t]=[],zu[t].push({onLoad:e,onProgress:i,onError:n});const r=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(r).then((e=>{if(200===e.status||0===e.status){if(e.status,"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const i=zu[t],n=e.body.getReader(),s=e.headers.get("X-File-Size")||e.headers.get("Content-Length"),r=s?parseInt(s):0,a=0!==r;let o=0;const h=new ReadableStream({start(t){!function e(){n.read().then((({done:n,value:s})=>{if(n)t.close();else{o+=s.byteLength;const n=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:r});for(let t=0,e=i.length;t<e;t++){const e=i[t];e.onProgress&&e.onProgress(n)}t.enqueue(s),e()}}),(e=>{t.error(e)}))}()}});return new Response(h)}throw new Hu(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)})).then((t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(""===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then((t=>n.decode(t)))}}})).then((e=>{Nu.add(t,e);const i=zu[t];delete zu[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onLoad&&n.onLoad(e)}})).catch((e=>{const i=zu[t];if(void 0===i)throw this.manager.itemError(t),e;delete zu[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}this.manager.itemError(t)})).finally((()=>{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}const Wu=new hh;class Uu{constructor(t=new hh(1/0,1/0),e=new hh(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Wu.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Wu).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}class Vu{constructor(){this.type="ShapePath",this.color=new Al,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new su,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.currentPath.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.currentPath.bezierCurveTo(t,e,i,n,s,r),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const i=e.length;let n=!1;for(let s=i-1,r=0;r<i;s=r++){let i=e[s],a=e[r],o=a.x-i.x,h=a.y-i.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(i=e[r],o=-o,a=e[s],h=-h),t.y<i.y||t.y>a.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{const e=h*(t.x-i.x)-o*(t.y-i.y);if(0===e)return!0;if(e<0)continue;n=!n}}else{if(t.y!==i.y)continue;if(a.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=a.x)return!0}}return n}const i=Bu.isClockWise,n=this.subPaths;if(0===n.length)return[];let s,r,a;const o=[];if(1===n.length)return r=n[0],a=new ru,a.curves=r.curves,o.push(a),o;let h=!i(n[0].getPoints());h=t?!h:h;const l=[],u=[];let c,d,p=[],f=0;u[f]=void 0,p[f]=[];for(let e=0,a=n.length;e<a;e++)r=n[e],c=r.getPoints(),s=i(c),s=t?!s:s,s?(!h&&u[f]&&f++,u[f]={s:new ru,p:c},u[f].s.curves=r.curves,h&&f++,p[f]=[]):p[f].push({h:r,p:c[0]});if(!u[0])return function(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i],s=new ru;s.curves=n.curves,e.push(s)}return e}(n);if(u.length>1){let t=!1,i=0;for(let t=0,e=u.length;t<e;t++)l[t]=[];for(let n=0,s=u.length;n<s;n++){const s=p[n];for(let r=0;r<s.length;r++){const a=s[r];let o=!0;for(let s=0;s<u.length;s++)e(a.p,u[s].p)&&(n!==s&&i++,o?(o=!1,l[s].push(a)):t=!0);o&&l[n].push(a)}}i>0&&!1===t&&(p=l)}for(let t=0,e=u.length;t<e;t++){a=u[t].s,o.push(a),d=p[t];for(let t=0,e=d.length;t<e;t++)a.holes.push(d[t].h)}return o}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"176"}})),"undefined"!=typeof window&&(window.__THREE__||(window.__THREE__="176"));let qu=0;class ju{constructor(t,e,i){var n;d(this,"id",qu++),d(this,"worker"),this.worker=i;let s=t=>{var e;return null==(e=this.worker)?void 0:e.postMessage({type:"event",id:this.id,data:t})};this.worker||(s=t=>{$u.instance().handleEvent({id:this.id,data:t})}),null==(n=this.worker)||n.postMessage({type:"makeProxy",id:this.id}),this.worker||$u.instance().makeProxy({id:this.id}),r();for(const[i,n]of Object.entries(e))t.addEventListener(i,(function(t){n(t,s)}));function r(){const e=t.getBoundingClientRect();s({type:"size",left:e.left,top:e.top,width:t.clientWidth,height:t.clientHeight})}window.addEventListener("resize",r)}}function Yu(){}class Gu extends eh{constructor(){super(),d(this,"isProxy",!0),d(this,"width"),d(this,"height"),d(this,"left"),d(this,"right"),d(this,"top"),d(this,"bottom"),d(this,"style",{})}get clientWidth(){return this.width}get clientHeight(){return this.height}setPointerCapture(){}releasePointerCapture(){}getBoundingClientRect(){return{left:this.left,top:this.top,width:this.width,height:this.height,right:(this.left||0)+(this.width||0),bottom:(this.top||0)+(this.height||0)}}handleEvent(t){if("size"===t.type)return this.left=t.left,this.top=t.top,this.width=t.width,void(this.height=t.height);t.preventDefault=Yu,t.stopPropagation=Yu,this.dispatchEvent(t)}focus(){}getRootNode(){return{addEventListener:Yu,removeEventListener:Yu}}}class $u{constructor(){d(this,"targets",{}),this.handleEvent=this.handleEvent.bind(this)}makeProxy(t){const{id:e}=t,i=new Gu;this.targets[e]=i}getProxy(t){return this.targets[t]}handleEvent(t){var e;null==(e=this.targets[t.id])||e.handleEvent(t.data)}static instance(){return Xu}}const Xu=new $u,Zu=Ju(["ctrlKey","metaKey","shiftKey","button","pointerType","clientX","clientY","pointerId","pageX","pageY"]);function Ju(t){return function(e,i){const n={type:e.type};!function(t,e,i){for(const n of e)i[n]=t[n]}(e,t,n),i(n)}}function Qu(t,e){t.preventDefault();const i=[],n={type:t.type,touches:i};for(let e=0;e<t.touches.length;++e){const n=t.touches[e];i.push({pageX:n.pageX,pageY:n.pageY,clientX:n.clientX,clientY:n.clientY})}e(n)}const Ku=Ju(["deltaMode","deltaX","deltaY","clientX","clientY"]),tc={37:!0,38:!0,39:!0,40:!0},ec=Ju(["ctrlKey","metaKey","shiftKey","keyCode"]),ic={contextmenu:function(t){t.preventDefault()},mousedown:Zu,mousemove:Zu,mouseup:Zu,pointerdown:Zu,pointermove:Zu,pointerup:Zu,touchstart:Qu,touchmove:Qu,touchend:Qu,wheel:function(t,e){t.preventDefault(),Ku(t,e)},keydown:function(t,e){const{keyCode:i}=t;tc[i]&&(t.preventDefault(),ec(t,e))}};class nc extends zi{constructor(t,e){super(),d(this,"name","Handler"),d(this,"dom"),d(this,"camera"),d(this,"domOffset",new Fe),d(this,"enabled",!0),d(this,"_hoverEnabled",!1),d(this,"scenes",[]),d(this,"rayCaster",new Zs),d(this,"contextMenuHandler",this.handleContextMenu.bind(this)),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"pointerOverHandler",ri.debounce(this.handlePointerOver.bind(this),20)),d(this,"panHandler",this.handlePan.bind(this)),d(this,"_hovered"),this.dom=t,this.camera=e,this.resize(),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.dispose()}dispose(){this.scenes=[]}enableHover(t){return this._hoverEnabled=t,this}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}bindScene(...t){return this.scenes.length=0,this.scenes.push(...t),this}bindEvents(){this.unbindEvents(),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("singletap",this.tapHandler),this.dom.addEventListener("panstart",this.panHandler),this.dom.addEventListener("panmove",this.panHandler),this.dom.addEventListener("panend",this.panHandler),this.dom.addEventListener("mousemove",this.pointerOverHandler)}unbindEvents(){this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("singletap",this.tapHandler),this.dom.removeEventListener("panstart",this.panHandler),this.dom.removeEventListener("panmove",this.panHandler),this.dom.removeEventListener("panend",this.panHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler)}handleContextMenu(t){this.enabled&&"function"==typeof t.preventDefault&&t.preventDefault()}handlePointerDown(t){}handlePointerMove(t){}handlePointerUp(t){}handleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),ac.set(t.center.x,t.center.y).sub(this.domOffset),oc.copy(ac).unproject(this.camera),this.dispatchEvent({type:"tap",data:{screenCoords:{x:ac.x,y:ac.y},worldCoords:{x:oc.x,y:oc.y}},e:t})}handlePan(t){var e,i;"function"==typeof t.preventDefault&&t.preventDefault(),ac.set(null==(e=t.center)?void 0:e.x,null==(i=t.center)?void 0:i.y).sub(this.domOffset),oc.copy(ac).unproject(this.camera);const n={screenCoords:{x:ac.x,y:ac.y},worldCoords:{x:oc.x,y:oc.y}},s={type:"panmove",data:n};(t.isFirst||"panstart"===t.type)&&(s.type="panstart"),(t.isLast||"panend"===t.type)&&(s.type="panend");const{id:r,target:a}=this.getHover(n);r&&ri.set(s,"data.id",r),a&&ri.set(s,"data.target",a),this.dispatchEvent(s)}handlePointerOver(t){if(!this._hoverEnabled||t.buttons>0)return;const e=this._hovered;ac.set(t.clientX,t.clientY).sub(this.domOffset),oc.copy(ac).unproject(this.camera);let i={screenCoords:{x:ac.x,y:ac.y},worldCoords:{x:oc.x,y:oc.y}};const n=this._hovered=this.getHover(i),s=u(u({},i),n);this.setCursor((null==n?void 0:n.target)?"pointer":"default"),(null==n?void 0:n.id)!==(null==e?void 0:e.id)&&(null==e?void 0:e.target)&&this.dispatchEventByTarget(e.target,{type:"pointerout",data:u(u({},i),e)}),(null==n?void 0:n.target)&&this.dispatchEventByTarget(n.target,{type:"pointermove",data:s}),(null==n?void 0:n.target)&&(null==n?void 0:n.target)!==(null==e?void 0:e.target)&&this.dispatchEventByTarget(n.target,{type:"pointerover",data:s}),this.dispatchEvent({type:"pointermove",data:s})}getHover(t){var e;const{screenCoords:i,worldCoords:n}=t||{},s={id:void 0,target:void 0},r=[],a=this.scenes.find((t=>t.isDynamic));if(a&&(this.rayCaster.init(t,this.camera).intersectObjectBy(a,sc,!0,r),r.length))return s.isDynamic=!0,rc(r,s),s;for(let i,n=0,s=(null==(e=this.scenes)?void 0:e.length)||0;n<s;n++)i=this.scenes[n],i.isDynamic||this.rayCaster.init(t,this.camera).intersectObjectBy(i,sc,!0,r);return r.length&&(s.isStatic=!0,rc(r,s)),s}dispatchEventByTarget(t,e){var i;if(!(null==t?void 0:t.visible))return;let n=!1;for(;t&&(n=null==(i=t.userData)?void 0:i.cancelBubble,"function"==typeof t.dispatchEvent&&t.dispatchEvent(e),t=t.parent,!n););n||this.dispatchEvent(e)}setCursor(t){this.dom instanceof Gu&&"function"==typeof self.postMessage?self.postMessage({type:"setCursor",cursorStyle:t}):this.dom.style&&(this.dom.style.cursor=t||"default")}}function sc(t){return t.visible}function rc(t,e={}){var i,n,s;let r=t.find((t=>{var e,i;return t.visible&&t.selectable&&(null==(e=t.userData)?void 0:e.assetType)===(null==(i=Me.config)?void 0:i.assetType)}));return r?(e.id=(null==(i=r.userData)?void 0:i.id)||r.name,e.target=r,(null==(n=r.userData)?void 0:n.assetType)&&(e.assetType=null==(s=r.userData)?void 0:s.assetType),r.isDummy&&(e.isDummy=!0),e):e}const ac=new Fe,oc=new Fe;var hc=(t=>(t.CONTEXTMENU="contextmenu",t.MOUSEDOWN="mousedown",t.MOUSEMOVE="mousemove",t.MOUSEUP="mouseup",t.POINTERDOWN="pointerdown",t.POINTERMOVE="pointermove",t.POINTERUP="pointerup",t.POINTEROUT="pointerout",t.POINTEROVER="pointerover",t.TOUCHSTART="touchstart",t.TOUCHMOVE="touchmove",t.TOUCHEND="touchend",t.WHEEL="wheel",t.KEYDOWN="keydown",t.TAP="tap",t.SINGLE_TAP="singletap",t.DOUBLE_TAP="doubletap",t.PRESS="press",t.HOVER="hover",t.PAN_START="panstart",t.PAN_MOVE="panmove",t.PAN_END="panend",t))(hc||{});class lc extends zi{constructor(t,e){super(),d(this,"name","OrbitControls2"),d(this,"isSvg",!1),d(this,"dom"),d(this,"domOffset",new Fe),d(this,"camera"),d(this,"enabled",!0),d(this,"enablePan",!0),d(this,"enableRotate",!0),d(this,"rotateSpeed",1),d(this,"enableZoom",!0),d(this,"minZoom",0),d(this,"maxZoom",1/0),d(this,"zoomSpeed",1),d(this,"zoomChanged",!1),d(this,"distanceStart",1),d(this,"distanceEnd",1),d(this,"state",-1),d(this,"EPS",1e-6),d(this,"focus",new Fe),d(this,"target",new Fe),d(this,"scaled",1),d(this,"rotateTheta",0),d(this,"enableDamping",!1),d(this,"dampingFactor",.05),d(this,"mouseButtons",{LEFT:2,MIDDLE:1,RIGHT:0}),d(this,"isWheeling",!1),d(this,"finalTimer"),d(this,"rotateStart",new Fe),d(this,"rotateEnd",new Fe),d(this,"rotateDelta",new Fe),d(this,"panStart",new Fe),d(this,"panEnd",new Fe),d(this,"panOffset",new Fe),d(this,"dollyStart",0),d(this,"dollyOffset",new Fe),d(this,"contextMenuHandler",this.handleContextMenu.bind(this)),d(this,"wheelHandler",this.handleWheel.bind(this)),d(this,"pointerDownHandler",this.handlePointerDown.bind(this)),d(this,"pointerUpHandler",this.handlePointerUp.bind(this)),d(this,"pointerMoveHandler",this.handlePointerMove.bind(this)),d(this,"pointerOverHandler",ri.debounce(this.handlePointerOver.bind(this),100)),d(this,"pointerLeaveHandler",this.handlePointerLeave.bind(this)),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"panHandler",this.handlePan.bind(this)),d(this,"pinchHandler",this.handlePinch.bind(this)),d(this,"pressHandler",this.handlePress.bind(this)),d(this,"swipeHandler",this.handleSwipe.bind(this)),d(this,"hammerInputHandler",this.handleHammerInput.bind(this)),this.dom=t,this.camera=e,this.scaled=e.scaled.x,this.resize(),this.dom.style.touchAction="none",this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}resize(){let t=this.dom.getBoundingClientRect();this.domOffset.set(t.left,t.top)}update(){this.camera.position.add(this.panOffset).add(this.dollyOffset),this.camera.scaled.set(this.scaled,this.scaled),this.rotateTheta&&(this.camera.rotation.x-=this.rotateTheta,uc.copy(this.camera.position).rotateAround(this.focus,-this.rotateTheta),this.camera.position.copy(uc)),this.camera.update(),this.panOffset.set(0,0),this.dollyOffset.set(0,0),this.scaled=this.camera.scaled.x,this.rotateTheta=0,this.dispatchEvent({type:"cameraChanged",data:{t:this.camera.position,r:this.camera.rotation.x,s:this.camera.scaled.x}})}bindEvents(){this.unbindEvents(),this.dom.addEventListener("panstart",this.panHandler),this.dom.addEventListener("panmove",this.panHandler),this.dom.addEventListener("panend",this.panHandler),this.dom.addEventListener("pinchstart",this.pinchHandler),this.dom.addEventListener("pinchmove",this.pinchHandler),this.dom.addEventListener("pinchend",this.pinchHandler),this.dom.addEventListener("singletap",this.tapHandler),this.dom.addEventListener("press",this.pressHandler),this.dom.addEventListener("hammer.input",this.hammerInputHandler),this.dom.addEventListener("contextmenu",this.contextMenuHandler),this.dom.addEventListener("wheel",this.wheelHandler,{passive:!1}),this.dom.addEventListener("mousemove",this.pointerOverHandler)}unbindEvents(){this.dom.removeEventListener("panstart",this.panHandler),this.dom.removeEventListener("panmove",this.panHandler),this.dom.removeEventListener("panend",this.panHandler),this.dom.removeEventListener("pinchstart",this.pinchHandler),this.dom.removeEventListener("pinchmove",this.pinchHandler),this.dom.removeEventListener("pinchend",this.pinchHandler),this.dom.removeEventListener("singletap",this.tapHandler),this.dom.removeEventListener("press",this.pressHandler),this.dom.removeEventListener("hammer.input",this.hammerInputHandler),this.dom.removeEventListener("contextmenu",this.contextMenuHandler),this.dom.removeEventListener("wheel",this.wheelHandler),this.dom.removeEventListener("mousemove",this.pointerOverHandler)}setFocus(t,e){this.focus.set(t,e).sub(this.domOffset).unproject(this.camera)}handleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),cc.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"tap",data:{screenCoords:{x:cc.x,y:cc.y}},e:t})}handleDoubleTap(t){"function"==typeof t.preventDefault&&t.preventDefault(),cc.set(t.center.x,t.center.y).sub(this.domOffset),this.dispatchEvent({type:"doubletap",data:{screenCoords:{x:cc.x,y:cc.y}}})}handlePress(t){"function"==typeof t.preventDefault&&t.preventDefault()}handlePan(t){var e;if(this.scaled=this.camera.scaled.x,1!==(null==(e=t.pointers)?void 0:e.length))return;"function"==typeof t.preventDefault&&t.preventDefault();const i={type:"panmove",data:{}};(t.isFirst||"panstart"===t.type)&&(this.state=2,this.panStart.set(t.center.x,t.center.y),i.type="panstart"),(t.isFinal||"panend"===t.type)&&(this.state=-1,i.type="panend"),this.panEnd.set(t.center.x,t.center.y),this.panOffset.subVectors(this.panEnd,this.panStart).multiplyScalar(-this.camera.scaled.x,-this.camera.scaled.y*(this.camera.flipY?1:-1)).rotate(this.camera.rotation.x),this.panStart.copy(this.panEnd),cc.set(t.center.x,t.center.y).sub(this.domOffset),i.data.screenCoords=cc.clone(),this.dispatchEvent(i),this.enablePan&&this.update()}handlePinch(t){"function"==typeof t.preventDefault&&t.preventDefault(),"pinchstart"===t.type&&(this.dollyStart=this.camera.scaled.x,this.state=1),(t.isFinal||"pinchend"===t.type)&&(this.state=-1),this.scaled=this.dollyStart*(1/t.scale);let e=(this.scaled-this.camera.scaled.x)/this.camera.scaled.x;this.setFocus(t.center.x,t.center.y),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-e).sub(this.camera.position),this.update()}handleRotate(t){"function"==typeof t.preventDefault&&t.preventDefault()}handleSwipe(t){"function"==typeof t.preventDefault&&t.preventDefault()}handleHammerInput(t){t.isFirst&&(this.state=9),t.isFinal&&(this.state=-1)}handleContextMenu(t){this.enabled&&"function"==typeof t.preventDefault&&t.preventDefault()}handleWheel(t){if("function"==typeof t.preventDefault&&t.preventDefault(),!this.enabled||!this.enableZoom||-1!==this.state)return;this.isWheeling||(this.dispatchEvent({type:"wheelstart"}),this.isWheeling=!0),"function"==typeof t.preventDefault&&t.preventDefault(),"function"==typeof t.stopPropagation&&t.stopPropagation();let e=t.deltaY;1===(null==t?void 0:t.deltaMode)?e*=16:2===(null==t?void 0:t.deltaMode)&&(e*=100),(null==t?void 0:t.ctrlKey)&&(e*=10),this.setFocus(t.clientX,t.clientY);let i=this.getZoomScale(e);e<0?this.onDollyIn(i):e>0?this.onDollyOut(i):(this.scaled=this.camera.scaled.x,this.dollyOffset.set(0,0)),this.update(),clearTimeout(this.finalTimer),this.finalTimer=setTimeout((()=>{this.isWheeling&&(this.dispatchEvent({type:"wheelend"}),this.isWheeling=!1)}),500)}onDollyIn(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x*t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,1-t).sub(this.camera.position)}onDollyOut(t){this.scaled=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.scaled.x/t)),this.dollyOffset.copy(this.camera.position).lerp(this.focus,-1+t).sub(this.camera.position)}getZoomScale(t){return Math.pow(.95,this.zoomSpeed*Math.abs(.03*t))}handlePointerDown(t){if(this.scaled=this.camera.scaled.x,!this.enabled)return;if(2!==t.button)return;this.dom.addEventListener("pointermove",this.pointerMoveHandler),this.dom.addEventListener("pointerup",this.pointerUpHandler);let e=-1;0===t.button?e=this.mouseButtons.LEFT:1===t.button?e=this.mouseButtons.MIDDLE:2===t.button&&(e=this.mouseButtons.RIGHT),0===e&&(this.rotateStart.set(t.clientX,t.clientY),this.setFocus(this.rotateStart.x,this.rotateStart.y),this.state=0)}handlePointerUp(){this.dom.removeEventListener("pointermove",this.pointerMoveHandler),this.dom.removeEventListener("pointerup",this.pointerUpHandler),this.state=-1}handlePointerLeave(){this.state=-1}handlePointerMove(t){if(this.enabled&&0===this.state){if(!this.enableRotate)return;this.onRotate(t.clientX,t.clientY)}}handlePointerOver(t){t.buttons>0||(cc.set(t.clientX,t.clientY).sub(this.domOffset),this.dispatchEvent({type:"pointerover",data:{screenCoords:{x:cc.x,y:cc.y}},e:t}))}onRotate(t,e){this.rotateEnd.set(t,e),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const i=this.rotateDelta.x*Math.PI*2/this.dom.clientHeight;this.rotateTheta-=i,this.rotateStart.copy(this.rotateEnd),this.update()}}const uc=new Fe,cc=new Fe;var dc=(t=>(t.CONTEXTMENU="contextmenu",t.LOSTPOINTERCAPTURE="lostpointercapture",t.MOUSEOVER="mouseover",t.MOUSEOUT="mouseout",t.MOUSELEAVE="mouseleave",t.MOUSEENTER="mouseenter",t.MOUSEMOVE="mousemove",t.MOUSEDOWN="mousedown",t.MOUSEUP="mouseup",t.POINTERMOVE="pointermove",t.POINTERDOWN="pointerdown",t.POINTERUP="pointerup",t.POINTERCANCEL="pointercancel",t.POINTEROUT="pointerout",t.POINTERLEAVE="pointerleave",t.POINTEROVER="pointerover",t.POINTERENTER="pointerenter",t.TOUCHSTART="touchstart",t.TOUCHEND="touchend",t.TOUCHMOVE="touchmove",t.TOUCHCANCEL="touchcancel",t.WHEEL="wheel",t.WHEEL_START="wheelstart",t.WHEEL_END="wheelend",t.MOUSEWHEEL="mousewheel",t.CLICK="click",t.DBLCLICK="dblclick",t.CONTEXT_LOST="contextlost",t.CONTEXT_RESTORED="contextrestored",t.CONTROLS_CHANGED="controlschanged",t.TAP="tap",t.SINGLE_TAP="singletap",t.DOUBLE_TAP="doubletap",t.PRESS="press",t.PAN="pan",t.PAN_START="panstart",t.PAN_MOVE="panmove",t.PAN_END="panend",t.ROTATE="rotate",t.ROTATE_START="rotatestart",t.ROTATE_MOVE="rotatemove",t.ROTATE_END="rotateend",t.PINCH="pinch",t.PINCH_START="pinchstart",t.PINCH_MOVE="pinchmove",t.PINCH_END="pinchend",t.PINCH_IN="pinchin",t.PINCH_OUT="pinchout",t.SWIPE="swipe",t.CHANGE_START="change_start",t.CHANGE_END="change_end",t.CAMERA_CHANGED="cameraChanged",t))(dc||{});class pc{constructor(t){d(this,"params"),d(this,"percent"),d(this,"path"),d(this,"boundingBox",new ai),this.params=t,this.percent=null==t?void 0:t.percent}_init(t){return this.attr(t),this}attr(t,e){if(!t)return this;if("string"==typeof t)this.attrKV(t,e);else if("object"==typeof t){let e=Object.keys(t);for(let i,n=0,s=e.length;n<s;n++)i=e[n],this.attrKV(i,t[i])}return this}attrKV(t,e){return this[t]=e,this}buildPath(t,e,i){}setPoints(t){return t&&t.length?(this.points=t,this):this}computeBoundingBox(t=new ai){return this.boundingBox.makeEmpty(),this.path||(this.path=new ln),this.path.reset(),this.buildPath(this.path,this),this.path.computeBoundingBox(this.boundingBox),t.copy(this.boundingBox),t}isPointInBoundingBox(t){return!!this.boundingBox&&this.boundingBox.containsPoint(t)}isPointInPath(t){return!!this.isPointInBoundingBox(t)&&("function"==typeof Path2D?this.isPointInPathByPath2D(t):this.isPointInPathByCtx(t))}isPointInPathByCtx(t){let e=!1;return fc.save(),this.buildPath(fc,this),e=fc.isPointInPath(t.x,t.y),fc.restore(),e}isPointInPathByPath2D(t){if(!Path2D)return!1;const e=new Path2D;return this.buildPath(e,this),fc.isPointInPath(e,t.x,t.y)}isBoxIntersectsBoundingBox(t){return!!this.boundingBox&&this.boundingBox.intersectsBox(t)}isBoxIntersectsPath(t){return!!this.isBoxIntersectsBoundingBox(t)}}const fc=An.get("RAY_CASTER",10,10).getContext("2d");class mc extends pc{constructor(t){super(t),this._init(t),this.flipY&&this.scale(1,-1)}initByPathProxy(t){var e;if(!t||!(null==(e=t.data)?void 0:e.length))throw new Error("GeoShape.initByPathProxy: path is required.");this.path=t;const i=t.data,n=[];let s=0;for(s=0;s<i.length;)switch(i[s++]){case 1:n.push([1,i[s++],i[s++]]);break;case 2:n.push([2,i[s++],i[s++]]);break;case 3:n.push([3,i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]]);break;case 4:n.push([4,i[s++],i[s++],i[s++],i[s++]]);break;case 5:n.push([5,i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]]);break;case on:n.push([on,i[s++],i[s++],i[s++],i[s++]]);break;case hn:n.push([hn,i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++],i[s++]]);break;case an:n.push([an])}return this.cmds=n,this}computeBoundingBox(t=new ai){return super.computeBoundingBox(t),this.boundingBox}buildPath(t,e,i){if(0===this.percent)return;const{cmds:n}=this;for(let e=0,i=(null==n?void 0:n.length)||0;e<i;e++){const[i,...s]=n[e];switch(i){case 1:t.moveTo(...s);break;case 2:t.lineTo(...s);break;case 3:t.bezierCurveTo(...s);break;case 4:t.quadraticCurveTo(...s);break;case 5:t.arc(s[0],s[1],s[2],s[3],s[4],!!s[5]);break;case an:t.closePath();break;case on:t.rect(...s);break;case hn:t.ellipse(s[0],s[1],s[2],s[3],s[4],s[5],s[6],!!s[7])}}}scale(t,e){this.transform(gc.makeScale(t,e))}transform(t){const e=[],{cmds:i}=this;for(let n=0,s=(null==i?void 0:i.length)||0;n<s;n++){const[s,...r]=i[n];switch(s){case 1:case 2:case on:yc.set(r[0],r[1]).applyMatrix3(t),e[n]=[s,yc.x,yc.y];break;case 3:yc.set(r[0],r[1]).applyMatrix3(t),vc.set(r[2],r[3]).applyMatrix3(t),xc.set(r[4],r[5]).applyMatrix3(t),e[n]=[s,yc.x,yc.y,vc.x,vc.y,xc.x,xc.y];break;case 4:yc.set(r[0],r[1]).applyMatrix3(t),vc.set(r[2],r[3]).applyMatrix3(t),e[n]=[s,yc.x,yc.y,vc.x,vc.y];break;case 5:yc.set(r[0],r[1]).applyMatrix3(t),e[n]=[s,yc.x,yc.y,r[2],r[3],r[4],r[5],r[6]];break;case hn:{yc.set(r[0],r[1]).applyMatrix3(t);const[i,a,o,h,l,u,c,d]=r,p=-l,f=-u,m=-c,g=!d;e[n]=[s,yc.x,yc.y,o,h,p,f,m,g?1:0];break}case an:e[n]=[s]}}this.cmds=e}}const gc=new Hi,yc=new Fe,vc=new Fe,xc=new Fe;class bc{static getPathProxyByNode(t){if(t)return Tn.getInstance().parseNode(t)}static mergeGeoShapes(t,e){var i,n,s;if(!(null==t?void 0:t.length))throw new Error("empty geos");const r={cmds:ri.flatMap(t,(t=>t.cmds||[]))};return(null==(i=t[0])?void 0:i.lineWidth)&&(r.lineWidth=t[0].lineWidth),(null==(n=t[0])?void 0:n.thinLine)&&(r.thinLine=t[0].thinLine),(null==(s=t[0])?void 0:s.closed)&&(r.closed=t[0].closed),new mc(r)}static getArrowByPathProxy(t,e={},i=new ln){i.dispose();const{arrowType:n=0,arrowLength:s=10,arrowDeg:r=30}=e||{};if(!t||!n)return i;const a=t.getVertices();if(!(null==a?void 0:a.length)||a.length<4)return i;if(n>0){if(Sc.set(a[2],a[3]),Ac.set(a[0],a[1]),Sc.equals(Ac))return i;Ec.subVectors(Sc,Ac),Mc.lerpVectors(Ac,Sc,s/Ec.length()),Tc.copy(Mc).rotateAround(Ac,Ie(r)),Cc.copy(Mc).rotateAround(Ac,-Ie(r))}else{const t=a.length;if(Sc.set(a[t-4],a[t-3]),Ac.set(a[t-2],a[t-1]),Sc.equals(Ac))return i;Ec.subVectors(Sc,Ac),Mc.lerpVectors(Ac,Sc,s/Ec.length()),Tc.copy(Mc).rotateAround(Ac,Ie(r)),Cc.copy(Mc).rotateAround(Ac,-Ie(r))}return Mc.lerpVectors(Ac,Mc,.6),_c.subVectors(Ac,Mc),wc.makeTranslation(_c.x,_c.y),Ac.applyMatrix3(wc),Mc.applyMatrix3(wc),Tc.applyMatrix3(wc),Cc.applyMatrix3(wc),i.moveTo(Mc.x,Mc.y),i.lineTo(Tc.x,Tc.y),i.lineTo(Ac.x,Ac.y),i.lineTo(Cc.x,Cc.y),i.lineTo(Mc.x,Mc.y),i}}const wc=new Hi,_c=new Fe,Sc=new Fe,Ec=new Fe,Ac=new Fe,Mc=new Fe,Tc=new Fe,Cc=new Fe;class Ic extends Ro{constructor(t,e){super(t,e),d(this,"type",Do.DRAW_POLYLINE),d(this,"_cpsId",`${this.type}-cps`),d(this,"_cpId",`${this._cpsId}-c-`),d(this,"_mpId",`${this._cpsId}-m-`),d(this,"_cpsLimit",2),d(this,"strokeArrow",0),d(this,"arrowShape"),this._controlPoints=this.getControlPoints()}activate(){super.activate()}deactivate(){super.deactivate()}editorStrokeWidthChanged(t){super.editorStrokeWidthChanged(t),this.updateArrowShape()}editorStrokeArrowChanged(t){this._bindedShape&&(this.strokeArrow=t,this.updateArrowShape())}getShape(t){let e=this._locals.find((e=>e.id===t));if(!e){const i="none",n=new Re(Me.config.editor.stroke||Le.darkGreen).setA(.8).getStyle(),s=Me.config.editor.strokeWidth||5,r=Dc/2,a=(new ln).moveTo(-50,-50).lineTo(r,r);e=jn({id:t,fill:i,stroke:n,strokeWidth:s,d:a.data}),t&&(e.setAttribute(`${Di}-type`,this.type.toString()),this._locals.push(e),this.mountShape(e,this._controlPoints))}return e}getControlPoints(){const t=Gn(this._cpsId);this._bindedShape?Tn.getPathProxyBySvgPathD(this._bindedShape.getAttribute("d"),Nc.dispose()):Tn.getPathProxyBySvgPathD(this.getShape().getAttribute("d"),Nc.dispose());const e=Nc.getControlPoints(),i=Me.config.editor.strokeWidth;for(let n=0,s=e.length;n<s;n++){const s=n?this._cpFill:this._cpStroke,r=qn({id:`${this._cpId}${n+1}`,x:0,y:0,r:i,fill:s,stroke:this._cpStroke});if(r.setAttribute(`${Di}-type`,(Do.DRAW_POLYGON|Do.DRAG).toString()),t.appendChild(r),!n)continue;Bc.copy(e[n-1]),Lc.copy(e[n]).add(Bc).multiplyScalar(.5);const a=qn({id:`${this._mpId}${n+1}`,x:0,y:0,r:i,fill:this._mpFill,stroke:this._mpStroke});a.setAttribute(`${Di}-type`,(Do.DRAW_POLYGON|Do.DRAG).toString()),t.appendChild(a)}return t}getArrowShape(t){if(!t)return;if(!this._bindedShape)return;const e=new Re(Me.config.editor.stroke||Le.darkGreen).setA(1).getStyle(),i=new Re(Me.config.editor.stroke||Le.darkGreen).setA(.8).getStyle(),n=Me.config.editor.strokeWidth||5;if(!this.arrowShape){const i=`${this.type}-${t>0?"st":"ed"}-arrow`;this.arrowShape=jn({id:i,fill:e})}this.arrowShape.setAttribute("fill",e),this.arrowShape.setAttribute("stroke",i),bc.getArrowByPathProxy(Nc,{arrowType:this.strokeArrow,arrowLength:3*n},Oc.dispose());const s=Tn.getSvgPathDByData(Oc.data);return this.arrowShape.setAttribute("d",s),this.arrowShape}beforeDragStart(t){this.splitByControlPoint(null==t?void 0:t.target,null==t?void 0:t.center)}handleDragStart(t){super.handleDragStart(t),this.updateArrowShape()}handleDragMove(t){super.handleDragMove(t),this.updateArrowShape()}handleDragEnd(t){super.handleDragEnd(t),this.updateArrowShape()}handleDoubleTap(t){var e,i;if((null==t?void 0:t.type)!==dc.DOUBLE_TAP)return;const n=this._getIntersect(this._controlPoints.children,null==(e=null==t?void 0:t.data)?void 0:e.worldCoords);this.mergeByControlPoint(n,null==(i=null==t?void 0:t.data)?void 0:i.worldCoords)}updateControlPoints(t,e){var i;if(!t||!e)return;if(!this._bindedShape)return;if(Tn.getPathProxyBySvgPathD(null==(i=this._bindedShape)?void 0:i.getAttribute("d"),Nc.dispose()),Nc.getControlPoints(Rc),!(null==Rc?void 0:Rc.length))return;const n=t.id;if(t===this._controlPoints)for(let t=0,i=Rc.length;t<i;t++)Bc.copy(e).add(Rc[t]),$n(ri.find(this._controlPoints.children,(e=>e.id===`${this._cpId}${t+1}`)),Bc),Bc.addVectors(Bc.copy(Rc[t?t-1:i-1]),Rc[t]).multiplyScalar(.5).add(e),$n(ri.find(this._controlPoints.children,(e=>e.id===`${this._mpId}${t+1}`)),Bc);else if(ri.startsWith(n,this._cpId)){Pc.copy(e),$n(t,Pc);const i=this.getCpIdx(n),s=i?i-1:Rc.length-1,r=i===Rc.length-1?0:i+1;Tn.parseNodeTransform(this._bindedShape,kc),Rc[i].copy(Pc.copy(e).applyMatrix3(kc.invert()));const a=ri.find(this._controlPoints.children,(t=>t.id===`${this._mpId}${i+1}`));Pc.addVectors(Rc[s],Rc[i]).multiplyScalar(.5).sub(Rc[i]).add(e),$n(a,Pc);const o=ri.find(this._controlPoints.children,(t=>t.id===`${this._mpId}${i===Rc.length-1?1:i+2}`));Pc.addVectors(Rc[i],Rc[r]).multiplyScalar(.5).sub(Rc[i]).add(e),$n(o,Pc)}else ri.startsWith(n,this._mpId)&&$n(t,e)}updateByControlPoints(t){var e;if(!this._bindedShape||!this._bindedControlPoint||!(null==(e=Nc.data)?void 0:e.length))return;const i=this._bindedControlPoint.id;if(ri.startsWith(i,this._mpId))return;Tn.parseNodeTransform(this._bindedShape,kc),Bc.copy(t).applyMatrix3(kc.invert()),Nc.getControlPoints(Rc);const n=this.getCpIdx(i);Rc[n].copy(Bc),Nc.dispose();for(let t=0,e=Rc.length;t<e;t++)t?Nc.lineTo(Rc[t].x,Rc[t].y):Nc.moveTo(Rc[t].x,Rc[t].y);const s=Tn.getSvgPathDByData(Nc.data);this._bindedShape.setAttribute("d",s)}updateArrowShape(){var t,e,i;if(!this._bindedShape||!(null==(t=Nc.data)?void 0:t.length))return;this.arrowShape&&this.unmountShape(this.arrowShape),this.arrowShape=this.getArrowShape(this.strokeArrow),this.arrowShape&&this.mountShape(this.arrowShape,this._controlPoints);const n=this._bindedShape.getAttribute("transform");n?null==(e=this.arrowShape)||e.setAttribute("transform",n):null==(i=this.arrowShape)||i.removeAttribute("transform")}}const Dc=100,Lc=new Fe,Bc=new Fe,Pc=new Fe,kc=new Hi,Nc=new ln,Oc=new ln,Rc=[];class zc extends Ro{constructor(t,e){super(t,e),d(this,"type",Do.DRAW_POLYGON),d(this,"_cpsId",`${this.type}-cps`),d(this,"_cpId",`${this._cpsId}-c-`),d(this,"_mpId",`${this._cpsId}-m-`),d(this,"_cpsLimit",3),this._controlPoints=this.getControlPoints()}activate(){super.activate()}deactivate(){super.deactivate()}getShape(t){let e=this._locals.find((e=>e.id===t));if(!e){const i=new Re(Me.config.editor.fill||Le.green).setA(.6).getStyle(),n=new Re(Me.config.editor.stroke||Le.darkGreen).setA(.8).getStyle(),s=Me.config.editor.strokeWidth||5,r=Hc/2,a=(new ln).moveTo(-50,r).lineTo(r,r).lineTo(r,-50).lineTo(-50,-50).closePath();e=jn({id:t,fill:i,stroke:n,strokeWidth:s,d:a.data}),t&&(e.setAttribute(`${Di}-type`,this.type.toString()),this._locals.push(e),this.mountShape(e,this._controlPoints))}return e}getControlPoints(){const t=Gn(this._cpsId);this._bindedShape?Tn.getPathProxyBySvgPathD(this._bindedShape.getAttribute("d"),qc.dispose()):Tn.getPathProxyBySvgPathD(this.getShape().getAttribute("d"),qc.dispose());const e=qc.getControlPoints(),i=Me.config.editor.strokeWidth;for(let n=0,s=e.length;n<s;n++){const r=n?this._cpFill:this._cpStroke,a=qn({id:`${this._cpId}${n+1}`,x:0,y:0,r:i,fill:r,stroke:this._cpStroke});a.setAttribute(`${Di}-type`,(Do.DRAW_POLYGON|Do.DRAG).toString()),t.appendChild(a),n?Wc.copy(e[n-1]):Wc.copy(e[s-1]),Fc.copy(e[n]).add(Wc).multiplyScalar(.5);const o=qn({id:`${this._mpId}${n+1}`,x:0,y:0,r:i,fill:this._mpFill,stroke:this._mpStroke});o.setAttribute(`${Di}-type`,(Do.DRAW_POLYGON|Do.DRAG).toString()),t.appendChild(o)}return t}beforeDragStart(t){this.splitByControlPoint(null==t?void 0:t.target,null==t?void 0:t.center)}handleDoubleTap(t){var e,i;if((null==t?void 0:t.type)!==dc.DOUBLE_TAP)return;const n=this._getIntersect(this._controlPoints.children,null==(e=null==t?void 0:t.data)?void 0:e.worldCoords);this.mergeByControlPoint(n,null==(i=null==t?void 0:t.data)?void 0:i.worldCoords)}updateControlPoints(t,e){var i;if(!t||!e)return;if(!this._bindedShape)return;if(Tn.getPathProxyBySvgPathD(null==(i=this._bindedShape)?void 0:i.getAttribute("d"),qc.dispose()),qc.getControlPoints(jc),!(null==jc?void 0:jc.length))return;const n=t.id;if(t===this._controlPoints)for(let t=0,i=jc.length;t<i;t++)Wc.copy(e).add(jc[t]),$n(ri.find(this._controlPoints.children,(e=>e.id===`${this._cpId}${t+1}`)),Wc),Wc.addVectors(Wc.copy(jc[t?t-1:i-1]),jc[t]).multiplyScalar(.5).add(e),$n(ri.find(this._controlPoints.children,(e=>e.id===`${this._mpId}${t+1}`)),Wc);else if(ri.startsWith(n,this._cpId)){Uc.copy(e),$n(t,Uc);const i=this.getCpIdx(n),s=i?i-1:jc.length-1,r=i===jc.length-1?0:i+1;Tn.parseNodeTransform(this._bindedShape,Vc),jc[i].copy(Uc.copy(e).applyMatrix3(Vc.invert()));const a=ri.find(this._controlPoints.children,(t=>t.id===`${this._mpId}${i+1}`));Uc.addVectors(jc[s],jc[i]).multiplyScalar(.5).sub(jc[i]).add(e),$n(a,Uc);const o=ri.find(this._controlPoints.children,(t=>t.id===`${this._mpId}${i===jc.length-1?1:i+2}`));Uc.addVectors(jc[i],jc[r]).multiplyScalar(.5).sub(jc[i]).add(e),$n(o,Uc)}else ri.startsWith(n,this._mpId)&&$n(t,e)}updateByControlPoints(t){var e;if(!this._bindedShape||!this._bindedControlPoint||!(null==(e=qc.data)?void 0:e.length))return;const i=this._bindedControlPoint.id;if(ri.startsWith(i,this._mpId))return;Tn.parseNodeTransform(this._bindedShape,Vc),Wc.copy(t).applyMatrix3(Vc.invert()),qc.getControlPoints(jc);const n=this.getCpIdx(i);jc[n].copy(Wc),qc.dispose();for(let t=0,e=jc.length;t<e;t++)t?qc.lineTo(jc[t].x,jc[t].y):qc.moveTo(jc[t].x,jc[t].y);qc.closePath();const s=Tn.getSvgPathDByData(qc.data);this._bindedShape.setAttribute("d",s)}}const Hc=100,Fc=new Fe,Wc=new Fe,Uc=new Fe,Vc=new Hi,qc=new ln,jc=[];class Yc extends Ro{constructor(t,e){super(t,e),d(this,"type",Do.DRAW_TEXT),d(this,"_cpsId",`${this.type}-cps`),d(this,"_cpId",`${this._cpsId}-c-`),d(this,"_clId",`${this._cpsId}-cl-`),d(this,"_cpsLimit",3),d(this,"_fspl",1),this._controlPoints=this.getControlPoints()}activate(){super.activate()}deactivate(){super.deactivate()}getShape(t){let e=this._locals.find((e=>e.id===t));if(!e){const i=new Re(Me.config.editor.fill||Le.green).getStyle();e=function(t){var e;const i=document.createElementNS("http://www.w3.org/2000/svg","text");return(null==t?void 0:t.id)&&i.setAttribute("id",t.id),(null==t?void 0:t.fill)&&i.setAttribute("fill",t.fill),(null==t?void 0:t.stroke)&&(i.setAttribute("stroke",t.stroke),i.setAttribute("stroke-width",(t.strokeWidth||1).toString())),i.textContent=t.textContent,(null==t?void 0:t.fontSize)&&i.setAttribute("font-size",null==(e=null==t?void 0:t.fontSize)?void 0:e.toString()),i.setAttribute("text-anchor",null==t?void 0:t.textAnchor),i.setAttribute("text-baseline",null==t?void 0:t.textBaseline),i}({id:`${this.type}-text`,textContent:"Text",fontSize:Me.config.editor.fontSize||Gc,fill:i,textAnchor:"middle",textBaseline:"middle"}),t&&(e.setAttribute(`${Di}-type`,this.type.toString()),this._locals.push(e),this.mountShape(e,this._controlPoints))}return e}getControlPoints(){const t=Gn(this._cpsId),e=jn({id:`${this._clId}1`,fill:"none",stroke:this._cpStroke,strokeWidth:1,d:[],strokeDasharray:"5"});t.appendChild(e);const i=Me.config.editor.strokeWidth,n=this._cpFill,s=qn({id:`${this._cpId}1`,x:0,y:0,r:i,fill:n,stroke:this._cpStroke});return s.setAttribute(`${Di}-type`,(Do.DRAW_POLYGON|Do.DRAG).toString()),t.appendChild(s),t}beforeDragStart(t){this.splitByControlPoint(null==t?void 0:t.target,null==t?void 0:t.center)}handleDoubleTap(t){var e,i;if((null==t?void 0:t.type)!==dc.DOUBLE_TAP)return;const n=this._getIntersect(this._controlPoints.children,null==(e=null==t?void 0:t.data)?void 0:e.worldCoords);this.mergeByControlPoint(n,null==(i=null==t?void 0:t.data)?void 0:i.worldCoords)}updateControlPoints(t,e){if(!this._bindedShape)return;const i=ri.find(this._controlPoints.children,(t=>t.id===`${this._cpId}1`));if(!i)return;Tn.getBoundingBoxByNode(this._bindedShape,Qc).getSize(Xc),Qc.getCenter($c),Jc.copy($c).add(Zc.set(Xc.x/2,-Xc.y/2)),$n(i,Jc);const n=parseInt(this._bindedShape.getAttribute("font-size")||"12")/10;i.setAttribute("r",n.toString());const s=ri.find(this._controlPoints.children,(t=>t.id===`${this._clId}1`));Kc.dispose().moveTo(Qc.min.x,Qc.min.y).lineTo(Qc.max.x,Qc.min.y).lineTo(Qc.max.x,Qc.max.y).lineTo(Qc.min.x,Qc.max.y).lineTo(Qc.min.x,Qc.min.y).closePath();const r=Tn.getSvgPathDByData(Kc.data);s.setAttribute("d",r)}updateByControlPoints(t){if(!this._bindedShape||!this._bindedControlPoint)return;this._bindedControlPoint.id,Tn.getBoundingBoxByNode(this._bindedShape,Qc).getCenter(Xc);const e=Fe.getDistance(Xc,t),i=Math.abs(Math.round(e*this._fspl));this._bindedShape.setAttribute("font-size",i.toString())}}const Gc=20,$c=new Fe,Xc=new Fe,Zc=new Fe,Jc=new Fe,Qc=new ai,Kc=new ln;class td extends zi{constructor(t){super(),d(this,"mode",Lo.DEFAULT),d(this,"view"),d(this,"scene"),d(this,"tools",new Map),d(this,"activedTools",new Map),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"doubleTapHandler",this.handleDoubleTap.bind(this)),d(this,"panStartHandler",this.handlePanStart.bind(this)),d(this,"panMoveHandler",this.handlePanMove.bind(this)),d(this,"panEndHandler",this.handlePanEnd.bind(this)),d(this,"_pointerOverHandler",this._handlePointerOver.bind(this)),this.view=t,this.register([Do.HOVER,Do.DRAG,Do.DRAW_POINT,Do.DRAW_POLYLINE,Do.DRAW_POLYGON,Do.DRAW_TEXT]),this.setMode(this.mode)}destroy(){this.dispose(),this.unbindEvents(),this.tools.clear()}dispose(){this.tools.forEach((t=>{t.deactivate&&t.deactivate()})),this.scene=void 0}register(t){Array.isArray(t)||(t=[t]),this.deactiveAll();for(let e,i=0,n=(null==t?void 0:t.length)||0;i<n;i++){e=t[i];let n=this.tools.get(e);if(!n){switch(e){case Do.HOVER:n=new Zo(this,this.view);break;case Do.DRAG:n=new $o(this,this.view);break;case Do.DRAW_POINT:n=new Vo(this,this.view);break;case Do.DRAW_POLYLINE:n=new Ic(this,this.view);break;case Do.DRAW_POLYGON:n=new zc(this,this.view);break;case Do.DRAW_TEXT:n=new Yc(this,this.view)}n&&this.tools.set(e,n)}}return this}setMode(t){if(t){this.mode=t,Me.config.editorMode=Lo.PICKER,this.deactiveAll();for(let e=1;e<=t;e<<=1)if(t&e){const t=e;this.tools.has(t)&&this.activateTool(t)}}}deactiveAll(t){const e=[];this.activedTools.forEach((i=>{(null==t?void 0:t.includes(i.type))||e.push(i.type)})),e.forEach((t=>{var e;null==(e=this.activedTools.get(t))||e.deactivate(),this.activedTools.delete(t)}))}activateTool(t){const e=this.tools.get(t);e&&(null==e||e.deactivate(),this.activedTools.set(e.type,e),this.scene&&e.bindScene&&e.bindScene(this.scene),e.activate())}bindScene(...t){return this.scene=t[0],this.bindEvents(),this}get(t){return this.tools.get(t)}getActiveTool(t){return this.activedTools.get(t)}fnEnableChanged(t=!1){this.activedTools.forEach((e=>{e.fnEnableChanged&&e.fnEnableChanged(t)}))}editorFillChanged(t){this.activedTools.forEach((e=>{e.editorFillChanged&&e.editorFillChanged(t)}))}editorStrokeChanged(t){this.activedTools.forEach((e=>{e.editorStrokeChanged&&e.editorStrokeChanged(t)}))}editorStrokeWidthChanged(t){this.activedTools.forEach((e=>{e.editorStrokeWidthChanged&&e.editorStrokeWidthChanged(t)}))}editorStrokeDasharrayChanged(t){this.activedTools.forEach((e=>{e.editorStrokeDasharrayChanged&&e.editorStrokeDasharrayChanged(t)}))}editorStrokeArrowChanged(t){this.activedTools.forEach((e=>{e.editorStrokeArrowChanged&&e.editorStrokeArrowChanged(t)}))}editorFontSizeChanged(t){this.activedTools.forEach((e=>{e.editorFontSizeChanged&&e.editorFontSizeChanged(t)}))}editorTextContentChanged(t){this.activedTools.forEach((e=>{e.editorTextContentChanged&&e.editorTextContentChanged(t)}))}editorDeleteCurrentShape(){this.activedTools.forEach((t=>{t.deleteCurrentShape&&t.deleteCurrentShape()}))}getEditorCurrentShapes(){const t=[],e=new XMLSerializer;return this.activedTools.forEach((i=>{var n;null==(n=i._locals)||n.forEach((i=>{let n=e.serializeToString(i);n=n.replace(/\s*xmlns="http:\/\/www\.w3\.org\/2000\/svg"/gi,""),n=n.replace(/\s*xmlns:xlink="[^"]*"/gi,""),n=n.replace(/\sstyle\s*=\s*(['"])(.*?)\1/g,""),t.push(n)}))})),t}editorInitShapes(t){if(!t)return;Array.isArray(t)||(t=[t]);const e=t.map((t=>{var e;return null==(e=(new DOMParser).parseFromString(t,"image/svg+xml"))?void 0:e.documentElement}));this.activedTools.forEach((t=>t.initShapes&&t.initShapes(e)))}bindEvents(){var t,e,i,n,s,r,a,o,h,l,u,c;this.unbindEvents(),null==(e=null==(t=this.view)?void 0:t.controller)||e.addEventListener(hc.TAP,this.tapHandler),null==(n=null==(i=this.view)?void 0:i.controller)||n.addEventListener(hc.DOUBLE_TAP,this.doubleTapHandler),null==(r=null==(s=this.view)?void 0:s.controller)||r.addEventListener(hc.PAN_START,this.panStartHandler),null==(o=null==(a=this.view)?void 0:a.controller)||o.addEventListener(hc.PAN_MOVE,this.panMoveHandler),null==(l=null==(h=this.view)?void 0:h.controller)||l.addEventListener(hc.PAN_END,this.panEndHandler),null==(c=null==(u=this.view)?void 0:u.controller)||c.addEventListener(hc.POINTEROVER,this._pointerOverHandler)}unbindEvents(){var t,e,i,n,s,r,a,o,h,l,u,c;null==(e=null==(t=this.view)?void 0:t.controller)||e.removeEventListener(hc.TAP,this.tapHandler),null==(n=null==(i=this.view)?void 0:i.controller)||n.removeEventListener(hc.DOUBLE_TAP,this.doubleTapHandler),null==(r=null==(s=this.view)?void 0:s.controller)||r.removeEventListener(hc.PAN_START,this.panStartHandler),null==(o=null==(a=this.view)?void 0:a.controller)||o.removeEventListener(hc.PAN_MOVE,this.panMoveHandler),null==(l=null==(h=this.view)?void 0:h.controller)||l.removeEventListener(hc.PAN_END,this.panEndHandler),null==(c=null==(u=this.view)?void 0:u.controller)||c.removeEventListener(hc.POINTEROVER,this._pointerOverHandler)}handleTap(t){this.activedTools.forEach((e=>{e.handleTap&&e.handleTap(t)}))}handleDoubleTap(t){this.activedTools.forEach((e=>{e.handleDoubleTap&&e.handleDoubleTap(t)}))}handlePanStart(t){this.activedTools.forEach((e=>{e.handlePanStart&&e.handlePanStart(t)}))}handlePanMove(t){this.activedTools.forEach((e=>{e.handlePanMove&&e.handlePanMove(t)}))}handlePanEnd(t){this.activedTools.forEach((e=>{e.handlePanEnd&&e.handlePanEnd(t)}))}enableHover(t){var e;null==(e=this.get(Do.HOVER))||e.enableHover(t)}_handlePointerOver(t){var e;null==(e=this.get(Do.HOVER))||e._handlePointerOver(t)}handlePointerOver(t){this.activedTools.forEach((e=>{e.handlePointerOver&&e.handlePointerOver(t)}))}handlePointerOut(t){this.activedTools.forEach((e=>{e.handlePointerOut&&e.handlePointerOut(t)}))}handlePointerMove(t){this.activedTools.forEach((e=>{e.handlePointerMove&&e.handlePointerMove(t)}))}drag(t,e){var i;this.mode===Lo.DRAWING&&(null==(i=this.get(Do.DRAG))||i.drag(t,e))}drop(t){var e;this.mode===Lo.DRAWING&&(null==(e=this.get(Do.DRAG))||e.drop(t))}setEnablePan(t=!1){this.view&&this.view.setEnablePan&&this.view.setEnablePan(t)}isEnablePan(){var t,e;return null==(e=null==(t=this.view)?void 0:t.controller)?void 0:e.enablePan}handleDragStart(t){this.activedTools.forEach((e=>{e.handleDragStart&&e.handleDragStart(t)}))}handleDragMove(t){this.activedTools.forEach((e=>{e.handleDragMove&&e.handleDragMove(t)}))}handleDragEnd(t){this.activedTools.forEach((e=>{e.handleDragEnd&&e.handleDragEnd(t)}))}}const ed=new ai;var id=(t=>(t.SELECTED="SELECTED",t.POINTEROVER="pointerover",t.POINTERLEAVE="pointerleave",t.DRAG_END="panend",t))(id||{});const nd=Jo;class sd extends Ru{constructor(t){super(t),this.defaultDPI=90,this.defaultUnit="px"}load(t,e,i,n){const s=this,r=new Fu(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(t,(function(i){try{e(s.parse(i))}catch(e){n&&n(e),s.manager.itemError(t)}}),i,n)}parse(t){const e=this;function i(t,e,i,s,r,a,o,h){if(0==e||0==i)return void t.lineTo(h.x,h.y);s=s*Math.PI/180,e=Math.abs(e),i=Math.abs(i);const l=(o.x-h.x)/2,u=(o.y-h.y)/2,c=Math.cos(s)*l+Math.sin(s)*u,d=-Math.sin(s)*l+Math.cos(s)*u;let p=e*e,f=i*i;const m=c*c,g=d*d,y=m/p+g/f;if(y>1){const t=Math.sqrt(y);p=(e*=t)*e,f=(i*=t)*i}const v=p*g+f*m,x=(p*f-v)/v;let b=Math.sqrt(Math.max(0,x));r===a&&(b=-b);const w=b*e*d/i,_=-b*i*c/e,S=Math.cos(s)*w-Math.sin(s)*_+(o.x+h.x)/2,E=Math.sin(s)*w+Math.cos(s)*_+(o.y+h.y)/2,A=n(1,0,(c-w)/e,(d-_)/i),M=n((c-w)/e,(d-_)/i,(-c-w)/e,(-d-_)/i)%(2*Math.PI);t.currentPath.absellipse(S,E,e,i,A,A+M,0===a,s)}function n(t,e,i,n){const s=t*i+e*n,r=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n);let a=Math.acos(Math.max(-1,Math.min(1,s/r)));return t*n-e*i<0&&(a=-a),a}function s(t,e){e=Object.assign({},e);let i={};if(t.hasAttribute("class")){const e=t.getAttribute("class").split(/\s/).filter(Boolean).map((t=>t.trim()));for(let t=0;t<e.length;t++)i=Object.assign(i,m["."+e[t]])}function n(n,s,r){void 0===r&&(r=function(t){return t.startsWith("url"),t}),t.hasAttribute(n)&&(e[s]=r(t.getAttribute(n))),i[n]&&(e[s]=r(i[n])),t.style&&""!==t.style[n]&&(e[s]=r(t.style[n]))}function s(t){return Math.max(0,Math.min(1,l(t)))}function r(t){return Math.max(0,l(t))}return t.hasAttribute("id")&&(i=Object.assign(i,m["#"+t.getAttribute("id")])),n("fill","fill"),n("fill-opacity","fillOpacity",s),n("fill-rule","fillRule"),n("opacity","opacity",s),n("stroke","stroke"),n("stroke-opacity","strokeOpacity",s),n("stroke-width","strokeWidth",r),n("stroke-linejoin","strokeLineJoin"),n("stroke-linecap","strokeLineCap"),n("stroke-miterlimit","strokeMiterLimit",r),n("visibility","visibility"),e}function r(t,e){return t-(e-t)}function a(t,e,i){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);const n={WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let s=0,r=!0,a="",o="";const h=[];function l(t,e,i){const n=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw n.partial=i,n}function u(){""!==a&&(""===o?h.push(Number(a)):h.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let c;const d=t.length;for(let p=0;p<d;p++)if(c=t[p],Array.isArray(e)&&e.includes(h.length%i)&&n.FLAGS.test(c))s=1,a=c,u();else{if(0===s){if(n.WHITESPACE.test(c))continue;if(n.DIGIT.test(c)||n.SIGN.test(c)){s=1,a=c;continue}if(n.POINT.test(c)){s=2,a=c;continue}n.COMMA.test(c)&&(r&&l(c,p,h),r=!0)}if(1===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.POINT.test(c)){a+=c,s=2;continue}if(n.EXP.test(c)){s=3;continue}n.SIGN.test(c)&&1===a.length&&n.SIGN.test(a[0])&&l(c,p,h)}if(2===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.EXP.test(c)){s=3;continue}n.POINT.test(c)&&"."===a[a.length-1]&&l(c,p,h)}if(3===s){if(n.DIGIT.test(c)){o+=c;continue}if(n.SIGN.test(c)){if(""===o){o+=c;continue}1===o.length&&n.SIGN.test(o)&&l(c,p,h)}}n.WHITESPACE.test(c)?(u(),s=0,r=!1):n.COMMA.test(c)?(u(),s=0,r=!0):n.SIGN.test(c)?(u(),s=1,a=c):n.POINT.test(c)?(u(),s=2,a=c):l(c,p,h)}return u(),h}const o=["mm","cm","in","pt","pc","px"],h={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function l(t){let i,n="px";if("string"==typeof t||t instanceof String)for(let e=0,i=o.length;e<i;e++){const i=o[e];if(t.endsWith(i)){n=i,t=t.substring(0,t.length-i.length);break}}return"px"===n&&"px"!==e.defaultUnit?i=h.in[e.defaultUnit]/e.defaultDPI:(i=h[n][e.defaultUnit],i<0&&(i=h[n].in*e.defaultDPI)),i*parseFloat(t)}function u(t){const e=t.elements;return e[0]*e[4]-e[1]*e[3]<0}function c(t){const e=t.elements,i=e[0]*e[3]+e[1]*e[4];if(0===i)return!1;const n=d(t),s=p(t);return Math.abs(i/(n*s))>Number.EPSILON}function d(t){const e=t.elements;return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function p(t){const e=t.elements;return Math.sqrt(e[3]*e[3]+e[4]*e[4])}const f=[],m={},g=[],y=new lh,v=new lh,x=new lh,b=new lh,w=new hh,_=new Ah,S=new lh,E=(new DOMParser).parseFromString(t,"image/svg+xml");return function t(e,n){if(1!==e.nodeType)return;const o=function(t){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))))return null;const e=function(t){const e=new lh,i=y;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){const i=l(t.getAttribute("x")),n=l(t.getAttribute("y"));e.translate(i,n)}if(t.hasAttribute("transform")){const n=t.getAttribute("transform").split(")");for(let t=n.length-1;t>=0;t--){const s=n[t].trim();if(""===s)continue;const r=s.indexOf("("),o=s.length;if(r>0&&r<o){const t=s.slice(0,r),e=a(s.slice(r+1));switch(i.identity(),t){case"translate":if(e.length>=1){const t=e[0];let n=0;e.length>=2&&(n=e[1]),i.translate(t,n)}break;case"rotate":if(e.length>=1){let t=0,n=0,s=0;t=e[0]*Math.PI/180,e.length>=3&&(n=e[1],s=e[2]),v.makeTranslation(-n,-s),x.makeRotation(t),b.multiplyMatrices(x,v),v.makeTranslation(n,s),i.multiplyMatrices(v,b)}break;case"scale":if(e.length>=1){const t=e[0];let n=t;e.length>=2&&(n=e[1]),i.scale(t,n)}break;case"skewX":1===e.length&&i.set(1,Math.tan(e[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===e.length&&i.set(1,0,0,Math.tan(e[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===e.length&&i.set(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}}e.premultiply(i)}}return e}(t);return g.length>0&&e.premultiply(g[g.length-1]),S.copy(e),g.push(e),e}(e);let h=!1,E=null;switch(e.nodeName){case"svg":case"g":n=s(e,n);break;case"style":!function(t){if(t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length)for(let e=0;e<t.sheet.cssRules.length;e++){const i=t.sheet.cssRules[e];if(1!==i.type)continue;const n=i.selectorText.split(/,/gm).filter(Boolean).map((t=>t.trim()));for(let t=0;t<n.length;t++){const e=Object.fromEntries(Object.entries(i.style).filter((([,t])=>""!==t)));m[n[t]]=Object.assign(m[n[t]]||{},e)}}}(e);break;case"path":n=s(e,n),e.hasAttribute("d")&&(E=function(t){const e=new Vu,n=new hh,s=new hh,o=new hh;let h=!0,l=!1;const u=t.getAttribute("d");if(""===u||"none"===u)return null;const c=u.match(/[a-df-z][^a-df-z]*/gi);for(let t=0,u=c.length;t<u;t++){const u=c[t],d=u.charAt(0),p=u.slice(1).trim();let f;switch(!0===h&&(l=!0,h=!1),d){case"M":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x=f[t+0],n.y=f[t+1],s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&o.copy(n);break;case"H":f=a(p);for(let t=0,i=f.length;t<i;t++)n.x=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"V":f=a(p);for(let t=0,i=f.length;t<i;t++)n.y=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"L":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x=f[t+0],n.y=f[t+1],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"C":f=a(p);for(let t=0,i=f.length;t<i;t+=6)e.bezierCurveTo(f[t+0],f[t+1],f[t+2],f[t+3],f[t+4],f[t+5]),s.x=f[t+2],s.y=f[t+3],n.x=f[t+4],n.y=f[t+5],0===t&&!0===l&&o.copy(n);break;case"S":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.bezierCurveTo(r(n.x,s.x),r(n.y,s.y),f[t+0],f[t+1],f[t+2],f[t+3]),s.x=f[t+0],s.y=f[t+1],n.x=f[t+2],n.y=f[t+3],0===t&&!0===l&&o.copy(n);break;case"Q":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.quadraticCurveTo(f[t+0],f[t+1],f[t+2],f[t+3]),s.x=f[t+0],s.y=f[t+1],n.x=f[t+2],n.y=f[t+3],0===t&&!0===l&&o.copy(n);break;case"T":f=a(p);for(let t=0,i=f.length;t<i;t+=2){const i=r(n.x,s.x),a=r(n.y,s.y);e.quadraticCurveTo(i,a,f[t+0],f[t+1]),s.x=i,s.y=a,n.x=f[t+0],n.y=f[t+1],0===t&&!0===l&&o.copy(n)}break;case"A":f=a(p,[3,4],7);for(let t=0,r=f.length;t<r;t+=7){if(f[t+5]==n.x&&f[t+6]==n.y)continue;const r=n.clone();n.x=f[t+5],n.y=f[t+6],s.x=n.x,s.y=n.y,i(e,f[t],f[t+1],f[t+2],f[t+3],f[t+4],r,n),0===t&&!0===l&&o.copy(n)}break;case"m":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x+=f[t+0],n.y+=f[t+1],s.x=n.x,s.y=n.y,0===t?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===t&&o.copy(n);break;case"h":f=a(p);for(let t=0,i=f.length;t<i;t++)n.x+=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"v":f=a(p);for(let t=0,i=f.length;t<i;t++)n.y+=f[t],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"l":f=a(p);for(let t=0,i=f.length;t<i;t+=2)n.x+=f[t+0],n.y+=f[t+1],s.x=n.x,s.y=n.y,e.lineTo(n.x,n.y),0===t&&!0===l&&o.copy(n);break;case"c":f=a(p);for(let t=0,i=f.length;t<i;t+=6)e.bezierCurveTo(n.x+f[t+0],n.y+f[t+1],n.x+f[t+2],n.y+f[t+3],n.x+f[t+4],n.y+f[t+5]),s.x=n.x+f[t+2],s.y=n.y+f[t+3],n.x+=f[t+4],n.y+=f[t+5],0===t&&!0===l&&o.copy(n);break;case"s":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.bezierCurveTo(r(n.x,s.x),r(n.y,s.y),n.x+f[t+0],n.y+f[t+1],n.x+f[t+2],n.y+f[t+3]),s.x=n.x+f[t+0],s.y=n.y+f[t+1],n.x+=f[t+2],n.y+=f[t+3],0===t&&!0===l&&o.copy(n);break;case"q":f=a(p);for(let t=0,i=f.length;t<i;t+=4)e.quadraticCurveTo(n.x+f[t+0],n.y+f[t+1],n.x+f[t+2],n.y+f[t+3]),s.x=n.x+f[t+0],s.y=n.y+f[t+1],n.x+=f[t+2],n.y+=f[t+3],0===t&&!0===l&&o.copy(n);break;case"t":f=a(p);for(let t=0,i=f.length;t<i;t+=2){const i=r(n.x,s.x),a=r(n.y,s.y);e.quadraticCurveTo(i,a,n.x+f[t+0],n.y+f[t+1]),s.x=i,s.y=a,n.x=n.x+f[t+0],n.y=n.y+f[t+1],0===t&&!0===l&&o.copy(n)}break;case"a":f=a(p,[3,4],7);for(let t=0,r=f.length;t<r;t+=7){if(0==f[t+5]&&0==f[t+6])continue;const r=n.clone();n.x+=f[t+5],n.y+=f[t+6],s.x=n.x,s.y=n.y,i(e,f[t],f[t+1],f[t+2],f[t+3],f[t+4],r,n),0===t&&!0===l&&o.copy(n)}break;case"Z":case"z":e.currentPath.autoClose=!0,e.currentPath.curves.length>0&&(n.copy(o),e.currentPath.currentPoint.copy(n),h=!0)}l=!1}return e}(e));break;case"rect":n=s(e,n),E=function(t){const e=l(t.getAttribute("x")||0),i=l(t.getAttribute("y")||0),n=l(t.getAttribute("rx")||t.getAttribute("ry")||0),s=l(t.getAttribute("ry")||t.getAttribute("rx")||0),r=l(t.getAttribute("width")),a=l(t.getAttribute("height")),o=.448084975506,h=new Vu;return h.moveTo(e+n,i),h.lineTo(e+r-n,i),(0!==n||0!==s)&&h.bezierCurveTo(e+r-n*o,i,e+r,i+s*o,e+r,i+s),h.lineTo(e+r,i+a-s),(0!==n||0!==s)&&h.bezierCurveTo(e+r,i+a-s*o,e+r-n*o,i+a,e+r-n,i+a),h.lineTo(e+n,i+a),(0!==n||0!==s)&&h.bezierCurveTo(e+n*o,i+a,e,i+a-s*o,e,i+a-s),h.lineTo(e,i+s),(0!==n||0!==s)&&h.bezierCurveTo(e,i+s*o,e+n*o,i,e+n,i),h}(e);break;case"polygon":n=s(e,n),E=function(t){const e=new Vu;let i=0;return t.getAttribute("points").replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,n,s){const r=l(n),a=l(s);0===i?e.moveTo(r,a):e.lineTo(r,a),i++})),e.currentPath.autoClose=!0,e}(e);break;case"polyline":n=s(e,n),E=function(t){const e=new Vu;let i=0;return t.getAttribute("points").replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,n,s){const r=l(n),a=l(s);0===i?e.moveTo(r,a):e.lineTo(r,a),i++})),e.currentPath.autoClose=!1,e}(e);break;case"circle":n=s(e,n),E=function(t){const e=l(t.getAttribute("cx")||0),i=l(t.getAttribute("cy")||0),n=l(t.getAttribute("r")||0),s=new su;s.absarc(e,i,n,0,2*Math.PI);const r=new Vu;return r.subPaths.push(s),r}(e);break;case"ellipse":n=s(e,n),E=function(t){const e=l(t.getAttribute("cx")||0),i=l(t.getAttribute("cy")||0),n=l(t.getAttribute("rx")||0),s=l(t.getAttribute("ry")||0),r=new su;r.absellipse(e,i,n,s,0,2*Math.PI);const a=new Vu;return a.subPaths.push(r),a}(e);break;case"line":n=s(e,n),E=function(t){const e=l(t.getAttribute("x1")||0),i=l(t.getAttribute("y1")||0),n=l(t.getAttribute("x2")||0),s=l(t.getAttribute("y2")||0),r=new Vu;return r.moveTo(e,i),r.lineTo(n,s),r.currentPath.autoClose=!1,r}(e);break;case"defs":h=!0;break;case"use":n=s(e,n);const o=(e.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),u=e.viewportElement.getElementById(o);u&&t(u,n)}E&&(void 0!==n.fill&&"none"!==n.fill&&E.color.setStyle(n.fill,nd),function(t,e){function i(t){_.set(t.x,t.y,1).applyMatrix3(e),t.set(_.x,_.y)}function n(t){const i=t.xRadius,n=t.yRadius,s=Math.cos(t.aRotation),r=Math.sin(t.aRotation),a=new Ah(i*s,i*r,0),o=new Ah(-n*r,n*s,0),h=a.applyMatrix3(e),l=o.applyMatrix3(e),c=y.set(h.x,l.x,0,h.y,l.y,0,0,0,1),d=v.copy(c).invert(),p=x.copy(d).transpose().multiply(d).elements,f=function(t,e,i){let n,s,r,a,o;const h=t+i,l=t-i,u=Math.sqrt(l*l+4*e*e);return h>0?(n=.5*(h+u),o=1/n,s=t*o*i-e*o*e):h<0?s=.5*(h-u):(n=.5*u,s=-.5*u),r=l>0?l+u:l-u,Math.abs(r)>2*Math.abs(e)?(o=-2*e/r,a=1/Math.sqrt(1+o*o),r=o*a):0===Math.abs(e)?(r=1,a=0):(o=-.5*r/e,r=1/Math.sqrt(1+o*o),a=o*r),l>0&&(o=r,r=-a,a=o),{rt1:n,rt2:s,cs:r,sn:a}}(p[0],p[1],p[4]),m=Math.sqrt(f.rt1),g=Math.sqrt(f.rt2);if(t.xRadius=1/m,t.yRadius=1/g,t.aRotation=Math.atan2(f.sn,f.cs),!((t.aEndAngle-t.aStartAngle)%(2*Math.PI)<Number.EPSILON)){const i=v.set(m,0,0,0,g,0,0,0,1),n=x.set(f.cs,f.sn,0,-f.sn,f.cs,0,0,0,1),s=i.multiply(n).multiply(c),r=t=>{const{x:e,y:i}=new Ah(Math.cos(t),Math.sin(t),0).applyMatrix3(s);return Math.atan2(i,e)};t.aStartAngle=r(t.aStartAngle),t.aEndAngle=r(t.aEndAngle),u(e)&&(t.aClockwise=!t.aClockwise)}}function s(t){const i=d(e),n=p(e);t.xRadius*=i,t.yRadius*=n;const s=i>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);t.aRotation+=s,u(e)&&(t.aStartAngle*=-1,t.aEndAngle*=-1,t.aClockwise=!t.aClockwise)}const r=t.subPaths;for(let t=0,a=r.length;t<a;t++){const a=r[t].curves;for(let t=0;t<a.length;t++){const r=a[t];r.isLineCurve?(i(r.v1),i(r.v2)):r.isCubicBezierCurve?(i(r.v0),i(r.v1),i(r.v2),i(r.v3)):r.isQuadraticBezierCurve?(i(r.v0),i(r.v1),i(r.v2)):r.isEllipseCurve&&(w.set(r.aX,r.aY),i(w),r.aX=w.x,r.aY=w.y,c(e)?n(r):s(r))}}}(E,S),f.push(E),E.userData={node:e,style:n});const A=e.childNodes;for(let e=0;e<A.length;e++){const i=A[e];h&&"style"!==i.nodeName&&"defs"!==i.nodeName||t(i,n)}o&&(g.pop(),g.length>0?S.copy(g[g.length-1]):S.identity())}(E.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:f,xml:E.documentElement}}static createShapes(t){const e=999999999,i={loc:0,t:0};function n(t,e,n,r){const a=t.x,o=e.x,h=n.x,l=r.x,u=t.y,c=e.y,d=n.y,p=r.y,f=(l-h)*(u-d)-(p-d)*(a-h),m=(p-d)*(o-a)-(l-h)*(c-u),g=f/m,y=((o-a)*(u-d)-(c-u)*(a-h))/m;if(0===m&&0!==f||g<=0||g>=1||y<0||y>1)return null;if(0===f&&0===m){for(let h=0;h<2;h++){if(s(0===h?n:r,t,e),0==i.loc){const t=0===h?n:r;return{x:t.x,y:t.y,t:i.t}}if(2==i.loc)return{x:+(a+i.t*(o-a)).toPrecision(10),y:+(u+i.t*(c-u)).toPrecision(10),t:i.t}}return null}for(let a=0;a<2;a++)if(s(0===a?n:r,t,e),0==i.loc){const t=0===a?n:r;return{x:t.x,y:t.y,t:i.t}}return{x:+(a+g*(o-a)).toPrecision(10),y:+(u+g*(c-u)).toPrecision(10),t:g}}function s(t,e,n){const s=n.x-e.x,r=n.y-e.y,a=t.x-e.x,o=t.y-e.y,h=s*o-a*r;if(t.x===e.x&&t.y===e.y)return i.loc=0,void(i.t=0);if(t.x===n.x&&t.y===n.y)return i.loc=1,void(i.t=1);if(h<-Number.EPSILON)return void(i.loc=3);if(h>Number.EPSILON)return void(i.loc=4);if(s*a<0||r*o<0)return void(i.loc=5);if(Math.sqrt(s*s+r*r)<Math.sqrt(a*a+o*o))return void(i.loc=6);let l;l=0!==s?a/s:o/r,i.loc=2,i.t=l}function r(t,e,i){const s=new hh;e.getCenter(s);const r=[];return i.forEach((e=>{e.boundingBox.containsPoint(s)&&function(t,e){const i=[],s=[];for(let r=1;r<t.length;r++){const a=t[r-1],o=t[r];for(let t=1;t<e.length;t++){const r=n(a,o,e[t-1],e[t]);null!==r&&void 0===i.find((t=>t.t<=r.t+Number.EPSILON&&t.t>=r.t-Number.EPSILON))&&(i.push(r),s.push(new hh(r.x,r.y)))}}return s}(t,e.points).forEach((t=>{r.push({identifier:e.identifier,isCW:e.isCW,point:t})}))})),r.sort(((t,e)=>t.point.x-e.point.x)),r}let a=e,o=-999999999,h=t.subPaths.map((t=>{const i=t.getPoints();let n=-999999999,s=e,r=-999999999,h=e;for(let t=0;t<i.length;t++){const e=i[t];e.y>n&&(n=e.y),e.y<s&&(s=e.y),e.x>r&&(r=e.x),e.x<h&&(h=e.x)}return o<=r&&(o=r+1),a>=h&&(a=h-1),{curves:t.curves,points:i,isCW:Bu.isClockWise(i),identifier:-1,boundingBox:new Uu(new hh(h,s),new hh(r,n))}}));h=h.filter((t=>t.points.length>1));for(let t=0;t<h.length;t++)h[t].identifier=t;const l=h.map((e=>function(t,e,i,n,s){null!=s&&""!==s||(s="nonzero");const a=new hh;t.boundingBox.getCenter(a);const o=r([new hh(i,a.y),new hh(n,a.y)],t.boundingBox,e);o.sort(((t,e)=>t.point.x-e.point.x));const h=[],l=[];o.forEach((e=>{e.identifier===t.identifier?h.push(e):l.push(e)}));const u=h[0].point.x,c=[];let d=0;for(;d<l.length&&l[d].point.x<u;)c.length>0&&c[c.length-1]===l[d].identifier?c.pop():c.push(l[d].identifier),d++;if(c.push(t.identifier),"evenodd"===s){const e=c.length%2==0,i=c[c.length-2];return{identifier:t.identifier,isHole:e,for:i}}if("nonzero"===s){let i=!0,n=null,s=null;for(let t=0;t<c.length;t++){const r=c[t];i?(s=e[r].isCW,i=!1,n=r):s!==e[r].isCW&&(s=e[r].isCW,i=!0)}return{identifier:t.identifier,isHole:i,for:n}}}(e,h,a,o,t.userData?t.userData.style.fillRule:void 0))),u=[];return h.forEach((t=>{if(!l[t.identifier].isHole){const e=new ru;e.curves=t.curves,l.filter((e=>e.isHole&&e.for===t.identifier)).forEach((t=>{const i=h[t.identifier],n=new su;n.curves=i.curves,e.holes.push(n)})),u.push(e)}})),u}static getStrokeStyle(t,e,i,n,s){return{strokeColor:e=void 0!==e?e:"#000",strokeWidth:t=void 0!==t?t:1,strokeLineJoin:i=void 0!==i?i:"miter",strokeLineCap:n=void 0!==n?n:"butt",strokeMiterLimit:s=void 0!==s?s:4}}static pointsToStroke(t,e,i,n){const s=[],r=[],a=[];if(0===sd.pointsToStrokeWithBuffers(t,e,i,n,s,r,a))return null;const o=new Wl;return o.setAttribute("position",new Pl(s,3)),o.setAttribute("normal",new Pl(r,3)),o.setAttribute("uv",new Pl(a,2)),o}static pointsToStrokeWithBuffers(t,e,i,n,s,r,a,o){const h=new hh,l=new hh,u=new hh,c=new hh,d=new hh,p=new hh,f=new hh,m=new hh,g=new hh,y=new hh,v=new hh,x=new hh,b=new hh,w=new hh,_=new hh,S=new hh,E=new hh;i=void 0!==i?i:12,n=void 0!==n?n:.001,o=void 0!==o?o:0;const A=(t=function(t){let e=!1;for(let i=1,s=t.length-1;i<s;i++)if(t[i].distanceTo(t[i+1])<n){e=!0;break}if(!e)return t;const i=[];i.push(t[0]);for(let e=1,s=t.length-1;e<s;e++)t[e].distanceTo(t[e+1])>=n&&i.push(t[e]);return i.push(t[t.length-1]),i}(t)).length;if(A<2)return 0;const M=t[0].equals(t[A-1]);let T,C,I=t[0];const D=e.strokeWidth/2,L=1/(A-1);let B,P,k,N,O=0,R=!1,z=0,H=3*o,F=2*o;W(t[0],t[1],h).multiplyScalar(D),m.copy(t[0]).sub(h),g.copy(t[0]).add(h),y.copy(m),v.copy(g);for(let i=1;i<A;i++){T=t[i],C=i===A-1?M?t[1]:void 0:t[i+1];const n=h;if(W(I,T,n),u.copy(n).multiplyScalar(D),x.copy(T).sub(u),b.copy(T).add(u),B=O+L,P=!1,void 0!==C){W(T,C,l),u.copy(l).multiplyScalar(D),w.copy(T).sub(u),_.copy(T).add(u),k=!0,u.subVectors(C,I),n.dot(u)<0&&(k=!1),1===i&&(R=k),u.subVectors(C,T),u.normalize();const t=Math.abs(n.dot(u));if(t>Number.EPSILON){const i=D/t;u.multiplyScalar(-i),c.subVectors(T,I),d.copy(c).setLength(i).add(u),S.copy(d).negate();const n=d.length(),s=c.length();c.divideScalar(s),p.subVectors(C,T);const r=p.length();switch(p.divideScalar(r),c.dot(S)<s&&p.dot(S)<r&&(P=!0),E.copy(d).add(T),S.add(T),N=!1,P?k?(_.copy(S),b.copy(S)):(w.copy(S),x.copy(S)):q(),e.strokeLineJoin){case"bevel":j(k,P,B);break;case"round":Y(k,P),k?V(T,x,w,B,0):V(T,_,b,B,1);break;default:const t=D*e.strokeMiterLimit/n;if(t<1){if("miter-clip"!==e.strokeLineJoin){j(k,P,B);break}Y(k,P),k?(p.subVectors(E,x).multiplyScalar(t).add(x),f.subVectors(E,w).multiplyScalar(t).add(w),U(x,B,0),U(p,B,0),U(T,B,.5),U(T,B,.5),U(p,B,0),U(f,B,0),U(T,B,.5),U(f,B,0),U(w,B,0)):(p.subVectors(E,b).multiplyScalar(t).add(b),f.subVectors(E,_).multiplyScalar(t).add(_),U(b,B,1),U(p,B,1),U(T,B,.5),U(T,B,.5),U(p,B,1),U(f,B,1),U(T,B,.5),U(f,B,1),U(_,B,1))}else P?(k?(U(g,O,1),U(m,O,0),U(E,B,0),U(g,O,1),U(E,B,0),U(S,B,1)):(U(g,O,1),U(m,O,0),U(E,B,1),U(m,O,0),U(S,B,0),U(E,B,1)),k?w.copy(E):_.copy(E)):k?(U(x,B,0),U(E,B,0),U(T,B,.5),U(T,B,.5),U(E,B,0),U(w,B,0)):(U(b,B,1),U(E,B,1),U(T,B,.5),U(T,B,.5),U(E,B,1),U(_,B,1)),N=!0}}else q()}else q();M||i!==A-1||G(t[0],y,v,k,!0,O),O=B,I=T,m.copy(w),g.copy(_)}if(M){if(P&&s){let t=E,e=S;R!==k&&(t=S,e=E),k?(N||R)&&(e.toArray(s,0),e.toArray(s,9),N&&t.toArray(s,3)):!N&&R||(e.toArray(s,3),e.toArray(s,9),N&&t.toArray(s,0))}}else G(T,x,b,k,!1,B);return z;function W(t,e,i){return i.subVectors(e,t),i.set(-i.y,i.x).normalize()}function U(t,e,i){s&&(s[H]=t.x,s[H+1]=t.y,s[H+2]=0,r&&(r[H]=0,r[H+1]=0,r[H+2]=1),H+=3,a&&(a[F]=e,a[F+1]=i,F+=2)),z+=3}function V(t,e,n,s,r){h.copy(e).sub(t).normalize(),l.copy(n).sub(t).normalize();let a=Math.PI;const o=h.dot(l);Math.abs(o)<1&&(a=Math.abs(Math.acos(o))),a/=i,u.copy(e);for(let e=0,n=i-1;e<n;e++)c.copy(u).rotateAround(t,a),U(u,s,r),U(c,s,r),U(t,s,.5),u.copy(c);U(c,s,r),U(n,s,r),U(t,s,.5)}function q(){U(g,O,1),U(m,O,0),U(x,B,0),U(g,O,1),U(x,B,0),U(b,B,1)}function j(t,e,i){e?t?(U(g,O,1),U(m,O,0),U(x,B,0),U(g,O,1),U(x,B,0),U(S,B,1),U(x,i,0),U(w,i,0),U(S,i,.5)):(U(g,O,1),U(m,O,0),U(b,B,1),U(m,O,0),U(S,B,0),U(b,B,1),U(b,i,1),U(S,i,0),U(_,i,1)):t?(U(x,i,0),U(w,i,0),U(T,i,.5)):(U(b,i,1),U(_,i,0),U(T,i,.5))}function Y(t,e){e&&(t?(U(g,O,1),U(m,O,0),U(x,B,0),U(g,O,1),U(x,B,0),U(S,B,1),U(x,O,0),U(T,B,.5),U(S,B,1),U(T,B,.5),U(w,O,0),U(S,B,1)):(U(g,O,1),U(m,O,0),U(b,B,1),U(m,O,0),U(S,B,0),U(b,B,1),U(b,O,1),U(S,B,0),U(T,B,.5),U(T,B,.5),U(S,B,0),U(_,O,1)))}function G(t,i,n,r,o,d){switch(e.strokeLineCap){case"round":o?V(t,n,i,d,.5):V(t,i,n,d,.5);break;case"square":if(o)h.subVectors(i,t),l.set(h.y,-h.x),u.addVectors(h,l).add(t),c.subVectors(l,h).add(t),r?(u.toArray(s,3),c.toArray(s,0),c.toArray(s,9)):(u.toArray(s,3),1===a[7]?c.toArray(s,9):u.toArray(s,9),c.toArray(s,0));else{h.subVectors(n,t),l.set(h.y,-h.x),u.addVectors(h,l).add(t),c.subVectors(l,h).add(t);const e=s.length;r?(u.toArray(s,e-3),c.toArray(s,e-6),c.toArray(s,e-12)):(c.toArray(s,e-6),u.toArray(s,e-3),c.toArray(s,e-12))}}}}}class rd extends Ah{constructor(t,e,i){super(t,e,i)}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}floorToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this.z=this.z<0?Math.floor(this.z):Math.ceil(this.z),this}roundToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this.z=this.z<0?Math.floor(this.z):Math.ceil(this.z),this}toString(){return`{x: ${this.x}, y: ${this.y}}`}}class ad extends sd{constructor(t=void 0){super(t),d(this,"viewportElement"),d(this,"instancedMesh",!1),d(this,"dpr",1)}setRequestHeader(t){return this.requestHeader=t,this}setInstancedMesh(t=!1){return this.instancedMesh=t,this}setPixelRatio(t){return this.dpr=t,this}parse(t,e=!0){const i=this;function n(t,e,i,n,r,a,o,h){var l;if(0==e||0==i)return void t.lineTo(h.x,h.y);n=n*Math.PI/180,e=Math.abs(e),i=Math.abs(i);const u=(o.x-h.x)/2,c=(o.y-h.y)/2,d=Math.cos(n)*u+Math.sin(n)*c,p=-Math.sin(n)*u+Math.cos(n)*c;let f=e*e,m=i*i;const g=d*d,y=p*p,v=g/f+y/m;if(v>1){const t=Math.sqrt(v);f=(e*=t)*e,m=(i*=t)*i}const x=f*y+m*g,b=(f*m-x)/x;let w=Math.sqrt(Math.max(0,b));r===a&&(w=-w);const _=w*e*p/i,S=-w*i*d/e,E=Math.cos(n)*_-Math.sin(n)*S+(o.x+h.x)/2,A=Math.sin(n)*_+Math.cos(n)*S+(o.y+h.y)/2,M=s(1,0,(d-_)/e,(p-S)/i),T=s((d-_)/e,(p-S)/i,(-d-_)/e,(-p-S)/i)%(2*Math.PI);null==(l=t.currentPath)||l.absellipse(E,A,e,i,M,M+T,0===a,n)}function s(t,e,i,n){const s=t*i+e*n,r=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n);let a=Math.acos(Math.max(-1,Math.min(1,s/r)));return t*n-e*i<0&&(a=-a),a}function r(t,e){var i;e=Object.assign({},e);let n={};if(t.hasAttribute("class")){const e=null==(i=t.getAttribute("class"))?void 0:i.split(/\s/).filter(Boolean).map((t=>t.trim()));for(let t=0,i=(null==e?void 0:e.length)||0;t<i;t++)n=Object.assign(n,M["."+e[t]])}function s(i,s,r){void 0===r&&(r=function(t){return t.startsWith("url"),t}),t.hasAttribute(i)&&(e[s]=r(t.getAttribute(i))),n[i]&&(e[s]=r(n[i])),t.style&&""!==t.style[i]&&(e[s]=r(t.style[i]))}t.hasAttribute("id")&&(n=Object.assign(n,M["#"+t.getAttribute("id")]));const{fontSize:r,strokeWidth:a}=e;function o(t){return Math.max(0,Math.min(1,c(t)))}function h(t){return Math.max(0,c(t,{fontSize:r}))}s("font-size","fontSize",h),s("fill","fill"),s("fill-opacity","fillOpacity",o),s("fill-rule","fillRule"),s("opacity","opacity",o),s("stroke","stroke"),s("stroke-opacity","strokeOpacity",o),s("stroke-width","strokeWidth",(function(t){return Math.max(0,c(t,{}))})),s("stroke-linejoin","strokeLineJoin"),s("stroke-linecap","strokeLineCap"),s("stroke-miterlimit","strokeMiterLimit",h),s("visibility","visibility");const l=t.getAttribute("stroke-width")||e.strokeWidth;return ri.endsWith(l,"%")&&(e.thinLine=!0),e}function a(t,e){return t-(e-t)}function o(t,e,i){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);const n={WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let s=0,r=!0,a="",o="";const h=[];function l(t,e,i){const n=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw n.partial=i,n}function u(){""!==a&&(""===o?h.push(Number(a)):h.push(Number(a)*Math.pow(10,Number(o)))),a="",o=""}let c;const d=t.length;for(let p=0;p<d;p++)if(c=t[p],Array.isArray(e)&&e.includes(h.length%(i||0))&&n.FLAGS.test(c))s=1,a=c,u();else{if(0===s){if(n.WHITESPACE.test(c))continue;if(n.DIGIT.test(c)||n.SIGN.test(c)){s=1,a=c;continue}if(n.POINT.test(c)){s=2,a=c;continue}n.COMMA.test(c)&&(r&&l(c,p,h),r=!0)}if(1===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.POINT.test(c)){a+=c,s=2;continue}if(n.EXP.test(c)){s=3;continue}n.SIGN.test(c)&&1===a.length&&n.SIGN.test(a[0])&&l(c,p,h)}if(2===s){if(n.DIGIT.test(c)){a+=c;continue}if(n.EXP.test(c)){s=3;continue}n.POINT.test(c)&&"."===a[a.length-1]&&l(c,p,h)}if(3===s){if(n.DIGIT.test(c)){o+=c;continue}if(n.SIGN.test(c)){if(""===o){o+=c;continue}1===o.length&&n.SIGN.test(o)&&l(c,p,h)}}n.WHITESPACE.test(c)?(u(),s=0,r=!1):n.COMMA.test(c)?(u(),s=0,r=!0):n.SIGN.test(c)?(u(),s=1,a=c):n.POINT.test(c)?(u(),s=2,a=c):l(c,p,h)}return u(),h}const h=["mm","cm","in","pt","pc","px","em","%"],l={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1},"%":{"%":1,px:-1}};function c(t,e){let n,s="px";if("string"==typeof t||t instanceof String){t=null==t?void 0:t.trim();for(let e=0,i=h.length;e<i;e++){const i=h[e];if(t.endsWith(i)){s=i,t=t.substring(0,t.length-i.length);break}}}if("px"===s&&"px"!==i.defaultUnit)n=l.in[i.defaultUnit]/i.defaultDPI;else if("%"===s){z.getSize(ld),hd.copy(k).getScale(ud);const t=Math.abs(ud.x||1);n=ld.x/100*t}else"em"===s?n=(null==e?void 0:e.fontSize)||W:(n=l[s][i.defaultUnit],n<0&&(n=l[s].in*i.defaultDPI));return n*parseFloat(t)}function d(t){const e=t.elements;return e[0]*e[4]-e[1]*e[3]<0}function p(t){const e=t.elements,i=e[0]*e[3]+e[1]*e[4];if(0===i)return!1;const n=f(t),s=m(t);return Math.abs(i/(n*s))>Number.EPSILON}function f(t){const e=t.elements;return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function m(t){const e=t.elements;return Math.sqrt(e[3]*e[3]+e[4]*e[4])}function g(t){return Math.round(t*F*100)/100}function y(t){return Math.round(t*F*100)/100}function v(t){return Math.round(t*F*100)/100}function x(t){return Math.round(t*F*100)/100}function b(t,e="asset"){let i;const n="function"==typeof t.getAttribute?t.getAttribute("id"):"";if(!n&&t.parentNode)return b(t.parentNode,e);if(!n)return i;if("layer"===e)i=X.find((t=>n===t));else{const t=null==n?void 0:n.replace(/-assets/g,"");i=$.find((e=>t===e))}return!i&&t.parentNode&&(i=b(t.parentNode,e)),i}function w(t){let e;const i="function"==typeof t.getAttribute?t.getAttribute("id"):"";return e=!i&&t.parentNode?w(t.parentNode):i,e}function _(t,e){let i;const n=w(t);return i=t.parentNode&&w(t.parentNode),i&&n!==e||(i=_(t.parentNode,e)),i||n||""}function S(t){let e;return w(t),e="function"==typeof t.getAttribute?t.getAttribute("aid"):"",!e&&t.parentNode&&(e=S(t.parentNode)),e}const E=[],A=[],M={},T=[],C=new lh,I=new lh,D=new lh,L=new lh,B=new hh,P=new Ah,k=new lh,N={},O={},R=[],z=new ai,H=new Fe,F=1,W=16,U=(new DOMParser).parseFromString(t,"image/svg+xml");i.viewportElement=U.documentElement,function(t,e=new ai){if(!t)return e;let i=t.split(" "),n=ri.map(i,(t=>parseFloat(t)));4!==(null==n?void 0:n.length)||(e.min.set(n[0],n[1]),e.max.set(n[0]+n[2],n[1]+n[3]))}(i.viewportElement.getAttribute("viewBox")||"",z);const V=U.getElementsByTagName("view"),q=(null==V?void 0:V.length)?V[0]:null,j=(null==q?void 0:q.getAttribute("units"))||"";z.getCenter(H);const Y=en(U.documentElement);let G=[];nn(Y||[],(t=>{var e;if("assets"===t.label&&(null==(e=t.children)?void 0:e.length))for(let e,i=0,n=t.children.length;i<n;i++)e=t.children[i],e.label&&G.push(ri.head(ri.split(e.label,"-"))||"")})),G=ri.uniq(ri.compact(G));const $=ri.uniq(ri.compact([...G,...Object.values(Ti)])),X=Object.values(Ii);!function t(e,i,s,h=!1){var l;if(1!==e.nodeType)return;const N=function(t,e){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))||"text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))))return null;const i=function(t,e){var i;const n=new lh,s=C;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){let e=c(t.getAttribute("x")),i=c(t.getAttribute("y"));n.translate(e,i)}else if("text"===t.nodeName&&(t.hasAttribute("dx")||t.hasAttribute("dy"))){let i=0,s=0;i=t.hasAttribute("dx")?c(t.getAttribute("dx")||0,{fontSize:null==e?void 0:e.fontSize}):0,s=t.hasAttribute("dy")?c(t.getAttribute("dy")||0,{fontSize:null==e?void 0:e.fontSize}):0,n.translate(i,s)}if(t.hasAttribute("transform")){const e=null==(i=t.getAttribute("transform"))?void 0:i.split(")");for(let t=((null==e?void 0:e.length)||0)-1;t>=0;t--){const i=e[t].trim();if(""===i)continue;const r=i.indexOf("("),a=i.length;if(r>0&&r<a){const t=i.slice(0,r),e=o(i.slice(r+1));switch(s.identity(),t){case"translate":if(e.length>=1){const t=e[0];let i=0;e.length>=2&&(i=e[1]),s.translate(t,i)}break;case"rotate":if(e.length>=1){let t=0,i=0,n=0;t=e[0]*Math.PI/180,e.length>=3&&(i=e[1],n=e[2]),I.makeTranslation(-i,-n),D.makeRotation(t),L.multiplyMatrices(D,I),I.makeTranslation(i,n),s.multiplyMatrices(I,L)}break;case"scale":if(e.length>=1){const t=e[0];let i=t;e.length>=2&&(i=e[1]),s.scale(t,i)}break;case"skewX":1===e.length&&s.set(1,Math.tan(e[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===e.length&&s.set(1,0,0,Math.tan(e[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===e.length&&s.set(e[0],e[2],e[4],e[1],e[3],e[5],0,0,1)}}n.premultiply(s)}}return n}(t,e);return T.length>0&&i.premultiply(T[T.length-1]),k.copy(i),T.push(i),i}(e,i);let R=!1,z=null,H=[];const F="function"==typeof e.getAttribute?e.getAttribute("id"):null;switch(e.nodeName){case"svg":case"g":i=r(e,i);break;case"style":!function(t){const e=t.textContent,i=null==e?void 0:e.replace(/\/\*[\s\S]*?\*\//g,""),n=null==i?void 0:i.replace(/([^;])}/g,"$1;}");if(!n)return;const s=[];let r="",a=0;for(const t of n)"{"===t?a++:"}"===t&&a--,r+=t,"}"===t&&0===a&&(s.push(r.trim()),r="");for(const t of s){if(!t.includes("{"))continue;const[e,i]=t.split(/\s*\{\s*/);if(!e||!i)continue;const n=e.split(",").map((t=>t.trim())).filter(Boolean),s={};i.replace(/}\s*$/,"").split(";").map((t=>t.trim())).filter(Boolean).forEach((t=>{const[e,i]=t.split(/:\s*/);if(e&&i){const t=i.replace(/\s*!important\s*$/,"").trim();s[e.trim()]=t}})),n.forEach((t=>{t&&(M[t]=u(u({},M[t]||{}),s))}))}}(e);break;case"path":i=r(e,i),e.hasAttribute("d")&&(z=function(t,e=!1){const i=new Vu,s=new Fe,r=new Fe,h=new Fe;let l=!0,u=!1;const c=t.getAttribute("d");if(!c||""===c||"none"===c)return null;const d=c.match(/[a-df-z][^a-df-z]*/gi);if(!(null==d?void 0:d.length))return null;for(let t=0,c=(null==d?void 0:d.length)||0;t<c;t++){const c=d[t],p=c.charAt(0),f=c.slice(1).trim();let m;switch(!0===l&&(u=!0,l=!1),p){case"M":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x=e?m[t]:g(m[t]),s.y=e?m[t+1]:y(m[t+1]),r.x=s.x,r.y=s.y,0===t?i.moveTo(s.x,s.y):i.lineTo(s.x,s.y),0===t&&h.copy(s);break;case"H":m=o(f);for(let t=0,n=m.length;t<n;t++)s.x=e?m[t]:g(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"V":m=o(f);for(let t=0,n=m.length;t<n;t++)s.y=e?m[t]:y(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"L":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x=e?m[t]:g(m[t]),s.y=e?m[t+1]:y(m[t+1]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"C":m=o(f);for(let t,n=0,a=m.length;n<a;n+=6)t=e?[m[n],m[n+1],m[n+2],m[n+3],m[n+4],m[n+5]]:[g(m[n]),y(m[n+1]),g(m[n+2]),y(m[n+3]),g(m[n+4]),y(m[n+5])],i.bezierCurveTo(...t),r.x=t[2],r.y=t[3],s.x=t[4],s.y=t[5],0===n&&!0===u&&h.copy(s);break;case"S":m=o(f);for(let t,n=0,o=m.length;n<o;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[g(m[n]),y(m[n+1]),g(m[n+2]),y(m[n+3])],i.bezierCurveTo(a(s.x,r.x),a(s.y,r.y),t[0],t[1],t[2],t[3]),r.x=t[0],r.y=t[1],s.x=t[2],s.y=t[3],0===n&&!0===u&&h.copy(s);break;case"Q":m=o(f);for(let t,n=0,a=m.length;n<a;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[g(m[n]),y(m[n+1]),g(m[n+2]),y(m[n+3])],i.quadraticCurveTo(t[0],t[1],t[2],t[3]),r.x=t[0],r.y=t[1],s.x=t[2],s.y=t[3],0===n&&!0===u&&h.copy(s);break;case"T":m=o(f);for(let t,n=0,o=m.length;n<o;n+=2){const o=a(s.x,r.x),l=a(s.y,r.y);t=e?[m[n],m[n+1]]:[g(m[n]),y(m[n+1])],i.quadraticCurveTo(o,l,t[0],t[1]),r.x=o,r.y=l,s.x=t[0],s.y=t[1],0===n&&!0===u&&h.copy(s)}break;case"A":m=o(f,[3,4],7);for(let t,a=0,o=m.length;a<o;a+=7){if(t=e?[m[a],m[a+1],m[a+2],m[a+3],m[a+4],m[a+5],m[a+6]]:[g(m[a]),y(m[a+1]),m[a+2],m[a+3],m[a+4],v(m[a+5]),x(m[a+6])],t[5]==s.x&&t[6]==s.y)continue;const o=s.clone();s.x=t[5],s.y=t[6],r.x=s.x,r.y=s.y,n(i,t[a],t[1],t[2],t[3],t[4],o,s),0===a&&!0===u&&h.copy(s)}break;case"m":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x+=e?m[t]:v(m[t]),s.y+=e?m[t+1]:x(m[t+1]),r.x=s.x,r.y=s.y,0===t?i.moveTo(s.x,s.y):i.lineTo(s.x,s.y),0===t&&h.copy(s);break;case"h":m=o(f);for(let t=0,n=m.length;t<n;t++)s.x+=e?m[t]:v(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"v":m=o(f);for(let t=0,n=m.length;t<n;t++)s.y+=e?m[t]:x(m[t]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"l":m=o(f);for(let t=0,n=m.length;t<n;t+=2)s.x+=e?m[t]:v(m[t]),s.y+=e?m[t+1]:x(m[t+1]),r.x=s.x,r.y=s.y,i.lineTo(s.x,s.y),0===t&&!0===u&&h.copy(s);break;case"c":m=o(f);for(let t,n=0,a=m.length;n<a;n+=6)t=e?[m[n],m[n+1],m[n+2],m[n+3],m[n+4],m[n+5]]:[v(m[n]),x(m[n+1]),v(m[n+2]),x(m[n+3]),v(m[n+4]),x(m[n+5])],i.bezierCurveTo(s.x+t[0],s.y+t[1],s.x+t[2],s.y+t[3],s.x+t[4],s.y+t[5]),r.x=s.x+t[2],r.y=s.y+t[3],s.x+=t[4],s.y+=t[5],0===n&&!0===u&&h.copy(s);break;case"s":m=o(f);for(let t,n=0,o=m.length;n<o;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[v(m[n]),x(m[n+1]),v(m[n+2]),x(m[n+3])],i.bezierCurveTo(a(s.x,r.x),a(s.y,r.y),s.x+t[0],s.y+t[1],s.x+t[2],s.y+t[3]),r.x=s.x+t[0],r.y=s.y+t[1],s.x+=t[2],s.y+=t[3],0===n&&!0===u&&h.copy(s);break;case"q":m=o(f);for(let t,n=0,a=m.length;n<a;n+=4)t=e?[m[n],m[n+1],m[n+2],m[n+3]]:[v(m[n]),x(m[n+1]),v(m[n+2]),x(m[n+3])],i.quadraticCurveTo(s.x+t[0],s.y+t[1],s.x+t[2],s.y+t[3]),r.x=s.x+t[0],r.y=s.y+t[1],s.x+=t[2],s.y+=t[3],0===n&&!0===u&&h.copy(s);break;case"t":m=o(f);for(let t,n=0,o=m.length;n<o;n+=2){const o=a(s.x,r.x),l=a(s.y,r.y);t=e?[m[n],m[n+1]]:[v(m[n]),x(m[n+1])],i.quadraticCurveTo(o,l,s.x+t[0],s.y+t[1]),r.x=o,r.y=l,s.x=s.x+t[0],s.y=s.y+t[1],0===n&&!0===u&&h.copy(s)}break;case"a":m=o(f,[3,4],7);for(let t,a=0,o=m.length;a<o;a+=7){if(t=e?[m[a],m[a+1],m[a+2],m[a+3],m[a+4],m[a+5],m[a+6]]:[v(m[a]),x(m[a+1]),m[a+2],m[a+3],m[a+4],v(m[a+5]),x(m[a+6])],0==t[5]&&0==t[6])continue;const o=s.clone();s.x+=t[5],s.y+=t[6],r.x=s.x,r.y=s.y,n(i,t[0],t[1],t[2],t[3],t[4],o,s),0===a&&!0===u&&h.copy(s)}break;case"Z":case"z":i.currentPath.autoClose=!0,i.currentPath.curves.length>0&&(s.copy(h),i.currentPath.currentPoint.copy(s),l=!0)}u=!1}return i}(e,h));break;case"rect":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("x")||0),n=c(t.getAttribute("y")||0),s=c(t.getAttribute("rx")||t.getAttribute("ry")||0),r=c(t.getAttribute("ry")||t.getAttribute("rx")||0),a=c(t.getAttribute("width")),o=c(t.getAttribute("height"));e||(i=g(i),n=y(n),s=v(s),r=x(r),a=v(a),o=x(o));const h=.448084975506,l=new Vu;return l.moveTo(i+s,n),l.lineTo(i+a-s,n),(0!==s||0!==r)&&l.bezierCurveTo(i+a-s*h,n,i+a,n+r*h,i+a,n+r),l.lineTo(i+a,n+o-r),(0!==s||0!==r)&&l.bezierCurveTo(i+a,n+o-r*h,i+a-s*h,n+o,i+a-s,n+o),l.lineTo(i+s,n+o),(0!==s||0!==r)&&l.bezierCurveTo(i+s*h,n+o,i,n+o-r*h,i,n+o-r),l.lineTo(i,n+r),(0!==s||0!==r)&&l.bezierCurveTo(i,n+r*h,i+s*h,n,i+s,n),l}(e,h);break;case"polygon":i=r(e,i),z=function(t,e=!1){var i;const n=new Vu;let s=0;return null==(i=t.getAttribute("points"))||i.replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,i,r){const a=e?c(i):g(c(i)),o=e?c(r):y(c(r));return 0===s?n.moveTo(a,o):n.lineTo(a,o),s++,t})),n.currentPath.autoClose=!0,n}(e,h);break;case"polyline":i=r(e,i),z=function(t,e=!1){var i;const n=new Vu;let s=0;return null==(i=t.getAttribute("points"))||i.replace(/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,(function(t,i,r){const a=e?c(i):g(c(i)),o=e?c(r):y(c(r));return 0===s?n.moveTo(a,o):n.lineTo(a,o),s++,t})),n.currentPath.autoClose=!1,n}(e,h);break;case"circle":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("cx")||0),n=c(t.getAttribute("cy")||0),s=c(t.getAttribute("r")||0);e||(i=g(i),n=y(n),s=v(s));const r=new su;r.absarc(i,n,s,0,2*Math.PI);const a=new Vu;return a.subPaths.push(r),a}(e,h);break;case"ellipse":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("cx")||0),n=c(t.getAttribute("cy")||0),s=c(t.getAttribute("rx")||0),r=c(t.getAttribute("ry")||0);e||(i=g(i),n=y(n),s=v(s),r=x(r));const a=new su;a.absellipse(i,n,s,r,0,2*Math.PI);const o=new Vu;return o.subPaths.push(a),o}(e,h);break;case"line":i=r(e,i),z=function(t,e=!1){let i=c(t.getAttribute("x1")||0),n=c(t.getAttribute("y1")||0),s=c(t.getAttribute("x2")||0),r=c(t.getAttribute("y2")||0);e||(i=g(i),n=y(n),s=g(s),r=y(r));const a=new Vu;return a.moveTo(i,n),a.lineTo(s,r),a.currentPath.autoClose=!1,a}(e,h);break;case"defs":R=!0;break;case"use":const l=(e.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),d=O[l];d&&(i=r(e,i),void 0===(i=r(d,i)).assetType&&(i.assetType=b(e)),void 0===i.layerType&&(i.layerType=b(e,"layer")),t(d,i,F||s,h));break;case"text":i=r(e,i),z=function(t,e){parseFloat(t.getAttribute("x")||"0"),parseFloat(t.getAttribute("y")||"0");const i=t.textContent;if(!i||!e.fontSize)return;const n=Object.assign({},e);return n.fill=t.getAttribute("fill")||e.fill||"#000",n.fontSize=parseFloat(t.getAttribute("font-size")||e.fontSize||"72"),n.fontFamily=t.getAttribute("font-family")||e.fontFamily||"Arial",{type:"text",textContent:i,style:n,color:new Al,subPaths:[],userData:{}}}(e,i)}if(z){void 0!==i.fill&&"transparent"===i.fill||void 0!==i.fill&&"none"!==i.fill&&z.color.setStyle(i.fill,od);const t=i.assetType||b(e),n=i.layerType||b(e,"layer");if(z.userData={pid:s,id:F||s,nodeName:e.nodeName,layerType:n,assetType:t,style:i},"text"===e.nodeName){s||ri.set(z,"userData.pid",w(e)),z.userData.textContent=e.textContent,z.transform=ri.cloneDeep(k),z.userData.id=ri.get(z,"userData.pid"),ri.set(z,"userData.pid",_(e,s));const t=S(e);t?ri.set(z,"userData.aid",t):ri.set(z,"userData.aid",ri.split(null==(l=z.userData)?void 0:l.id,"-").splice(2).join("-")),E.find((t=>t.userData.id===z.userData.aid))}else!function(t,e){function i(t){P.set(t.x,t.y,1).applyMatrix3(e),t.set(P.x,P.y)}function n(t){const i=t.xRadius,n=t.yRadius,s=Math.cos(t.aRotation),r=Math.sin(t.aRotation),a=new rd(i*s,i*r,0),o=new rd(-n*r,n*s,0),h=a.applyMatrix3(e),l=o.applyMatrix3(e),u=C.set(h.x,l.x,0,h.y,l.y,0,0,0,1),c=I.copy(u).invert(),p=D.copy(c).transpose().multiply(c).elements,f=function(t,e,i){let n,s,r,a,o;const h=t+i,l=t-i,u=Math.sqrt(l*l+4*e*e);return h>0?(n=.5*(h+u),o=1/n,s=t*o*i-e*o*e):h<0?s=.5*(h-u):(n=.5*u,s=-.5*u),r=l>0?l+u:l-u,Math.abs(r)>2*Math.abs(e)?(o=-2*e/r,a=1/Math.sqrt(1+o*o),r=o*a):0===Math.abs(e)?(r=1,a=0):(o=-.5*r/e,r=1/Math.sqrt(1+o*o),a=o*r),l>0&&(o=r,r=-a,a=o),{rt1:n,rt2:s,cs:r,sn:a}}(p[0],p[1],p[4]),m=Math.sqrt(f.rt1),g=Math.sqrt(f.rt2);if(t.xRadius=1/m,t.yRadius=1/g,t.aRotation=Math.atan2(f.sn,f.cs),!((t.aEndAngle-t.aStartAngle)%(2*Math.PI)<Number.EPSILON)){const i=I.set(m,0,0,0,g,0,0,0,1),n=D.set(f.cs,f.sn,0,-f.sn,f.cs,0,0,0,1),s=i.multiply(n).multiply(u),r=t=>{const{x:e,y:i}=new rd(Math.cos(t),Math.sin(t),0).applyMatrix3(s);return Math.atan2(i,e)};t.aStartAngle=r(t.aStartAngle),t.aEndAngle=r(t.aEndAngle),d(e)&&(t.aClockwise=!t.aClockwise)}}function s(t){const i=f(e),n=m(e);t.xRadius*=i,t.yRadius*=n;const s=i>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);t.aRotation+=s,d(e)&&(t.aStartAngle*=-1,t.aEndAngle*=-1,t.aClockwise=!t.aClockwise)}const r=t.subPaths;for(let t=0,a=(null==r?void 0:r.length)||0;t<a;t++){const a=r[t].curves;for(let t=0;t<a.length;t++){const r=a[t];r.isLineCurve?(i(r.v1),i(r.v2)):r.isCubicBezierCurve?(i(r.v0),i(r.v1),i(r.v2),i(r.v3)):r.isQuadraticBezierCurve?(i(r.v0),i(r.v1),i(r.v2)):r.isEllipseCurve&&(B.set(r.aX,r.aY),i(B),r.aX=B.x,r.aY=B.y,p(e)?n(r):s(r))}}}(z,k);"text"!==e.nodeName?E.push(z):"text"===e.nodeName&&A.push(z)}const W=e.childNodes,U="symbol"===e.nodeName?s:F;for(let e=0,n=(null==W?void 0:W.length)||0;e<n;e++){const n=W[e];if(R){const t="function"==typeof n.getAttribute?n.getAttribute("id"):null;"symbol"===n.nodeName&&t&&(O[t]=n)}if(R&&"style"!==n.nodeName&&"defs"!==n.nodeName)continue;let s=t(n,i,U,h);s&&H.push(s)}return N&&(T.pop(),T.length>0?k.copy(T[T.length-1]):k.identity()),z||((null==H?void 0:H.length)?H:void 0)}(U.documentElement,{fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4,fontSize:W});for(let t in N)N[t].len=ri.sumBy(R,(e=>e.symbolId===t?1:0));return R.forEach((t=>{var e;return t.len=null==(e=N[t.symbolId])?void 0:e.len})),{xml:U.documentElement,viewBox:z,paths:E,labels:A,idsTree:Y,assetTypes:G,symbolsMap:N,uses:R,units:j}}}const od=Jo,hd=new Hi;new lh,new class extends Gh{constructor(t=1,e=0,i=0,n=0,s=0,r=1,a=0,o=0,h=0,l=0,u=1,c=0,d=0,p=0,f=0,m=1){super(t,e,i,n,s,r,a,o,h,l,u,c,d,p,f,m)}setByMatrix3(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[4]=i[3],e[8]=0,e[12]=i[6],e[1]=i[1],e[5]=i[4],e[9]=0,e[13]=i[7],e[2]=0,e[6]=0,e[10]=1,e[14]=0,e[3]=0,e[7]=0,e[11]=0,e[15]=1,this}getMatrix3Array(t=[]){const e=this.elements;return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[4],t[4]=e[5],t[5]=0,t[6]=e[12],t[7]=e[13],t[8]=1,t}};const ld=new Fe,ud=new hh;new rd,new rd,new rd,new rd;class cd extends is{constructor(t={}){super(t),d(this,"type","Group2"),d(this,"isGroup",!0),d(this,"versions",[]),d(this,"params"),d(this,"alignCenter",!1),d(this,"dynamically",!1),d(this,"usedCache",!1),d(this,"wireframe",!1),d(this,"showPoints",!1),this.params=t,void 0!==t.usedCache&&(this.usedCache=t.usedCache),void 0!==t.wireframe&&(this.wireframe=t.wireframe),void 0!==t.showPoints&&(this.showPoints=t.showPoints),void 0!==t.alignCenter&&(this.alignCenter=t.alignCenter),void 0!==t.dynamically&&(this.dynamically=t.dynamically)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}clone(t=!0,e=!1){return new(0,this.constructor)(this.params).copy(this,t,e)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.params=t.params,this.alignCenter=t.alignCenter,this.dynamically=t.dynamically,this.usedCache=t.usedCache,this.wireframe=t.wireframe,this.showPoints=t.showPoints,this}composeWireframeGeometryPath(t){return this.traverse((e=>{e.isShape&&e.geometry&&e.geometry.path&&t.addPath(e.geometry.path)})),t}raycast(t,e=[]){var i;if(!this.boundingBox||this.boundingBox.isEmpty())return e;if(!this.boundingBoxWorld.containsPoint(t.worldCoords))return e;let n=[];for(let e=0,s=null==(i=this.children)?void 0:i.length;e<s;e++)this.children[e].raycast(t,n);return n.length&&e.push(this),e}}let dd=new WeakMap,pd=-1;function fd(t){var e,i;const n=[];return"string"==typeof t.fill?n.push(t.fill):(null==(e=t.fill)?void 0:e.isColor)?n.push(t.fill.getHexString()):t.fill instanceof CanvasGradient||t.fill instanceof CanvasPattern?dd.has(t.fill)||dd.set(t.fill,"gradientPattern_"+ ++pd):n.push(""),"string"==typeof t.stroke?n.push(t.stroke):(null==(i=t.stroke)?void 0:i.isColor)?n.push(t.stroke.getHexString()):t.stroke instanceof CanvasGradient||t.stroke instanceof CanvasPattern?dd.has(t.stroke)||dd.set(t.stroke,"gradientPattern_"+ ++pd):n.push(""),n.push(void 0!==t.lineWidth?t.lineWidth.toString():""),n.push(void 0!==t.lineDash?t.lineDash.toString():""),n.push(void 0!==t.lineDashOffset?t.lineDashOffset.toString():""),n.push(void 0!==t.lineCap?t.lineCap.toString():""),n.push(void 0!==t.fillOpacity?t.fillOpacity.toString():""),n.push(void 0!==t.strokeOpacity?t.strokeOpacity.toString():""),n.push(void 0!==t.opacity?t.opacity.toString():""),t.isText&&(n.push(void 0!==t.text?t.text:""),n.push(void 0!==t.fontSize?t.fontSize.toString():"")),n.join("_")}class md{constructor(t){d(this,"fill"),d(this,"stroke"),d(this,"lineWidth"),d(this,"lineDash"),d(this,"lineDashOffset"),d(this,"lineCap"),d(this,"lineJoin"),d(this,"fillOpacity"),d(this,"strokeOpacity"),d(this,"opacity"),d(this,"featureKey"),d(this,"map"),this.fill=null==t?void 0:t.fill,this.stroke=null==t?void 0:t.stroke,this.lineWidth=null==t?void 0:t.lineWidth,this.lineDash=null==t?void 0:t.lineDash,this.lineDashOffset=null==t?void 0:t.lineDashOffset,this.lineCap=(null==t?void 0:t.lineCap)||"round",this.lineJoin=(null==t?void 0:t.lineJoin)||"miter",void 0!==(null==t?void 0:t.fillOpacity)?this.fillOpacity=null==t?void 0:t.fillOpacity:this.fillOpacity=1,this.featureKey=fd(this)}}class gd extends pc{constructor(t){super(t),this._init(t)}buildPath(t,e,i){const n=this.percent;if(0===n)return;let{x1:s,y1:r,x2:a,y2:o}=e||this;s&&r&&a&&o&&(t.moveTo(s,r),n&&n<1&&(a=s*(1-n)+a*n,o=r*(1-n)+o*n),t.lineTo(a,o))}}class yd extends is{constructor(t=new gd,e=new md,i){super(i),d(this,"name","Shape"),d(this,"isShape",!0),d(this,"geo"),d(this,"mtl"),d(this,"boundingBox",new ai),this.geo=t,this.mtl=e,(null==i?void 0:i.name)&&(this.name=i.name)}destroy(){super.destroy()}computeBoundingBox(){this.boundingBox.makeEmpty(),this.geo.computeBoundingBox(this.boundingBox);for(let t=0,e=this.children.length;t<e;t++)this.boundingBox.union(this.children[t].computeBoundingBox());return this.boundingBox}buildPath(t,e,i){this.geo.buildPath(t)}raycast(t,e=[]){var i,n;if(super.raycast(t,e),!this.boundingBox||this.boundingBox.isEmpty())return e;if(this.boundingBoxWorld.isEmpty()&&this.updateBoundingBox(),t.intersectType)bd.copy(t.worldBox),(bd.containsBox(this.boundingBoxWorld)||(null==(n=this.geo)?void 0:n.isBoxIntersectsPath(bd.applyMatrix3(xd.copy(this.matrixWorld).invert()))))&&e.push(this);else{if(!this.boundingBoxWorld.containsPoint(t.worldCoords))return e;vd.copy(t.worldCoords).applyMatrix3(xd.copy(this.matrixWorld).invert()),this.composeNode?this.traverseSome((t=>t.geo.isPointInPath(vd)))&&e.push(this):(null==(i=this.geo)?void 0:i.isPointInPath(vd))&&e.push(this)}return e}clone(t=!0,e=!1){return new(0,this.constructor)(this.geo,this.mtl).copy(this,t,e)}copy(t,e=!0,i=!1){return super.copy(t,e,i),this.params=ri.merge(this.params,t),this.renderOrder=t.renderOrder,i?(this.geo=ri.cloneDeep(t.geo),this.mtl=ri.cloneDeep(t.mtl)):(this.geo=t.geo,this.mtl=t.mtl),this}}const vd=new Fe,xd=new Hi,bd=new ai;class wd extends md{constructor(t){super(t),d(this,"text"),d(this,"isText",!0),d(this,"fontFamily","Arial"),d(this,"fontSize",12),d(this,"fontStyle",Ad),d(this,"fontWeight",Ad),d(this,"fontVariant",Ad),d(this,"textDecoration",""),d(this,"textAlign",_d),d(this,"verticalAlign",Sd),d(this,"textBaseline",Ed),d(this,"lineHeight",1),d(this,"letterSpacing",0),d(this,"wrap",Md),d(this,"ellipsis",!1),this.text=null==t?void 0:t.text,this.fill=(null==t?void 0:t.fill)||Le.black,this.fontFamily=(null==t?void 0:t.fontFamily)||"Arial",this.fontSize=(null==t?void 0:t.fontSize)||12,this.fontStyle=(null==t?void 0:t.fontStyle)||Ad,this.fontWeight=(null==t?void 0:t.fontWeight)||Ad,this.textAlign=(null==t?void 0:t.textAlign)||_d,this.textBaseline=(null==t?void 0:t.textBaseline)||Ed,this.featureKey=fd(this)}}const _d="center",Sd="top",Ed="middle",Ad="normal",Md="word";class Td{static hasCache(t){return void 0!==Cd[t]}static setCache(t,e){Cd[t]=e}static getCache(t){return Cd[t]}static getCachedFeatureKeys(){return Object.keys(Cd)}static getMtl(t,e){let i=fd(t);return e&&(i=`${e}_${i}`),this.hasCache(i)||(t.text?this.setCache(i,new wd(t)):this.setCache(i,new md(t))),this.getCache(i)}}const Cd={};class Id extends pc{constructor(t){super(t),this._init(t)}buildPath(t,e,i){if(0===this.percent)return;let{points:n}=e||this;if(n&&n.length&&!(n.length<2)){for(let e=0,i=n.length;e<i;e+=2)e?t.lineTo(n[e],n[e+1]):t.moveTo(n[e],n[e+1]);t.closePath()}}}class Dd extends yd{constructor(t={}){void 0===t.fontSize&&(t.fontSize=12),void 0===t.renderOrder&&(t.renderOrder=1),super(new Id(t),new wd(t)),d(this,"name","Text"),d(this,"isText",!0),d(this,"size",new Fe),t.wireframe&&(this.wireframe=!0)}computeBoundingBox(){var t;if(!(null==(t=this.mtl)?void 0:t.text))return this.boundingBox;this.updateMatrixWorld(!0),An.measureText2(this.mtl.text||"",this.mtl.fontSize,this.size);const e=[];return e.push(-this.size.x/2,-this.size.y/2),e.push(e[0],e[1]+this.size.y),e.push(e[2]+this.size.x,e[3]),e.push(e[3],e[1]),this.geo.setPoints(e),super.computeBoundingBox(),this.boundingBox}buildPath(t,e,i){this.wireframe&&this.geo.buildPath(t)}}class Ld extends pc{constructor(t){super(t),this._init(t)}buildPath(t,e,i){let n,s,r,a,o,{x:h=0,y:l=0,w:u=0,h:c=0,r:d=0}=e||this;u<0&&(h+=u,u=-u),c<0&&(l+=c,c=-c),"number"==typeof d?n=s=r=a=d:d instanceof Array?1===d.length?n=s=r=a=d[0]:2===d.length?(n=r=d[0],s=a=d[1]):3===d.length?(n=d[0],s=a=d[1],r=d[2]):(n=d[0],s=d[1],r=d[2],a=d[3]):n=s=r=a=0,n+s>u&&(o=n+s,n*=u/o,s*=u/o),r+a>u&&(o=r+a,r*=u/o,a*=u/o),s+r>c&&(o=s+r,s*=c/o,r*=c/o),n+a>c&&(o=n+a,n*=c/o,a*=c/o),t.moveTo(h+n,l),t.lineTo(h+u-s,l),0!==s&&t.arc(h+u-s,l+s,s,-Math.PI/2,0),t.lineTo(h+u,l+c-r),0!==r&&t.arc(h+u-r,l+c-r,r,0,Math.PI/2),t.lineTo(h+a,l+c),0!==a&&t.arc(h+a,l+c-a,a,Math.PI/2,Math.PI),t.lineTo(h,l+n),0!==n&&t.arc(h+n,l+n,n,Math.PI,1.5*Math.PI)}}class Bd extends yd{constructor(t,e=new md,i){super(new Ld({x:0,y:0,width:1,height:1}),e,i),d(this,"name","SkinnedShape"),this.boundingBox.copy(t),this.geo.lineWidth=e.lineWidth,this.geo.thinLine=!0,Pd.copy(this.boundingBox),kd.copy(Pd.min),Pd.getSize(Nd),this.geo.x=kd.x,this.geo.y=kd.y,this.geo.w=Nd.x,this.geo.h=Nd.y}computeBoundingBox(){return this.boundingBox}}const Pd=new ai,kd=new Fe,Nd=new Fe;class Od extends zi{constructor(t={}){super(),d(this,"type","Object2"),d(this,"position",new Fe),d(this,"rotation",new Fe),d(this,"scaled",new Fe(1,1)),d(this,"flipY",!1),d(this,"matrix",new Hi),d(this,"matrixAutoUpdate",!1),void 0!==t.flipY&&(this.flipY=t.flipY),this.flipY&&this.setScale(1,-1)}setPosition(t){return this.position.set(t.x,t.y),this}setRotation(t){return this.rotation.set(t,t),this}setScale(t,e){return this.scaled.set(t,e),this}translate(t,e){return this.position.x+=t,this.position.y+=e,this}rotate(t){return this.rotation.x+=t,this}scale(t,e){return e?(this.scaled.x*=t,this.scaled.y*=e):this.scaled.multiplyScalar(t),this}applyMatrix3(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.rotation,this.scaled)}updateMatrix(){this.matrix.compose(this.position,this.rotation,this.scaled)}copy(t){return this.position.copy(t.position),this.rotation.copy(t.rotation),this.scaled.copy(t.scaled),this.flipY=t.flipY,this.matrix.copy(t.matrix),this.matrixAutoUpdate=t.matrixAutoUpdate,this}}class Rd extends Od{constructor(t={}){void 0===t.flipY&&(t.flipY=!0),super(t),d(this,"isTexture",!0),d(this,"type","Texture"),d(this,"params"),d(this,"uuid",es()),d(this,"image"),d(this,"userData",{}),this.params=t}destroy(){}dispose(){}clone(){return new this.constructor(this.params).copy(this)}copy(t){return super.copy(t),this.uuid=es(),this.image=t.image,this.userData=ri.cloneDeep(t.userData),this}}class zd{constructor(t,e){d(this,"bindingStates"),this.ctx=t,this.bindingStates=e}destroy(){}setCtx(t){return this.ctx=t,this}render(t){var e,i,n;if(this.ctx&&(Hd=this.ctx,Hd.save(),t.isText?this.renderText(Hd,t):t.isShape&&(Hd.beginPath(),this.setCtxTransform(Hd,t),this.bindingStyle(Hd,t),this.renderShape(Hd,t),this.renderLineDash(Hd,t)),t.isShape&&(null==(i=null==(e=t.mtl)?void 0:e.map)?void 0:i.image)&&this.renderShapeTexture(Hd,t),Hd.restore(),t.composeNode&&(null==(n=t.children)?void 0:n.length)))for(let e,i=0,n=t.children.length;i<n;i++)e=t.children[i],e.isShape&&this.render(e)}renderFill(t){var e;t.mtl.fill&&(null==(e=this.ctx)||e.fill())}renderStroke(t){var e;t.mtl.stroke&&(null==(e=this.ctx)||e.stroke())}renderText(t,e){if(!t)return;const{text:i,fill:n,stroke:s,fontSize:r,fontFamily:a,fontWeight:o,textAlign:h,textBaseline:l}=e.mtl;if(!i)return;e.modelViewMatrix.decompose(Wd,Ud,Vd);const u=(r||12)*Vd.x;t.font=`${o} ${u}px ${a}`,t.fillStyle=n||Le.black,h&&(t.textAlign=h),l&&(t.textBaseline=l);let c=Wd.y;if("middle"===l){const e=t.measureText(i);c+=(e.actualBoundingBoxAscent-e.actualBoundingBoxDescent)/2}t.fillText(i,Wd.x,c)}renderWireFrame(t){this.ctx&&(Yd.copy(t.boundingBox).applyMatrix3(t.modelViewMatrix).getSize($d),Gd.copy(Yd.min),this.ctx.save(),this.ctx.beginPath(),this.ctx.lineWidth=1,this.ctx.strokeStyle=Le.red,this.ctx.setLineDash([5,10]),this.ctx.strokeRect(Gd.x,Gd.y,$d.x,$d.y),this.ctx.stroke(),this.ctx.restore())}renderMerged(t){this.ctx&&(Hd=this.ctx,Hd.save(),t.isShape&&(Hd.beginPath(),this.setCtxTransform(Hd,t),this.bindingStyle(Hd,t),this.renderShape(Hd,t)),Hd.restore())}setCtxTransform(t,e){const i=Fd.equals(e.modelViewMatrix);Fd.copy(e.modelViewMatrix),i||Fd.getComponents(qd),t.transform(...qd)}bindingStyle(t,e){if(e.mtl.fill){let i;i=e.mtl.fill.isColor?e.mtl.fill.getHexString():e.mtl.fill,void 0!==e.mtl.fillOpacity&&(t.globalAlpha=e.mtl.fillOpacity),i&&(t.fillStyle=i)}if(e.mtl.stroke){if(e.geo.thinLine){const e=Math.sqrt(qd[0]*qd[0]+qd[1]*qd[1]);t.lineWidth=Math.abs(1/e)}else e.geo.lineWidth?t.lineWidth=e.geo.lineWidth:t.lineWidth=1;let i;e.mtl.lineCap&&(t.lineCap=e.mtl.lineCap),e.mtl.lineJoin&&(t.lineJoin=e.mtl.lineJoin),void 0!==e.mtl.strokeOpacity&&(t.globalAlpha=e.mtl.strokeOpacity),i=e.mtl.stroke.isColor?e.mtl.stroke.getHexString():e.mtl.stroke,i&&(t.strokeStyle=i)}}renderShape(t,e){e.buildPath(t),e.geo.closed&&t.closePath(),this.renderFill(e),this.renderStroke(e)}renderLineDash(t,e){if(e.mtl.stroke&&e.mtl.lineDash&&void 0!==e.mtl.lineDashOffset){if(t.beginPath(),e.buildPath(t),e.geo.thinLine){const e=Math.sqrt(qd[0]*qd[0]+qd[1]*qd[1]);t.lineWidth=Math.abs(1/e)}else e.geo.lineWidth?t.lineWidth=e.geo.lineWidth:t.lineWidth=1;t.strokeStyle=Le.white,t.setLineDash(e.mtl.lineDash),t.lineDashOffset=e.mtl.lineDashOffset,t.globalAlpha=1,t.stroke()}}renderShapeTexture(t,e){var i,n,s,r,a,o,h,l;(null==(n=null==(i=null==e?void 0:e.mtl)?void 0:i.map)?void 0:n.image)&&(!(null==(a=null==(r=null==(s=null==e?void 0:e.mtl)?void 0:s.map)?void 0:r.image)?void 0:a.width)||null==(l=null==(h=null==(o=null==e?void 0:e.mtl)?void 0:o.map)?void 0:h.image)||l.height,e.mtl.map.matrix.getComponents(jd),t.transform(...jd),t.drawImage(e.mtl.map.image,0,0))}}let Hd;const Fd=new Hi,Wd=new Fe,Ud=new Fe,Vd=new Fe,qd=[1,0,0,1,0,0],jd=[1,0,0,1,0,0],Yd=new ai,Gd=new Fe,$d=new Fe,Xd=class t{constructor(){d(this,"cache",new Map),d(this,"maxSize",2048),d(this,"renderer",new zd),d(this,"_scaled",new Fe(1,1))}dispose(){this.clear()}static getInstance(){return Zd||(Zd=new t),Zd}static set(t,e){this.getInstance().set(t,e)}static clear(){this.getInstance().clear()}scale(t=1,e=1){return t||e?(this._scaled.set(t,e),this):this}has(t){return this.cache.has(t)}set(t,e){if(!t||!e)throw new Error("error input");this.cache.set(t,e)}get(t){if(!t)throw new Error("error input");return this.cache.get(t)}clear(){Object.values(this.cache).forEach((t=>t.destroy())),this._scaled.identity(),this.cache=new Map,function(){var t;const e=dp();if(null==(t=null==e?void 0:e.children)?void 0:t.length)for(let t=e.children.length-1;t>=0;t--)e.removeChild(e.children[t])}()}calculateMipLevel(t){return t>=1?0:t>=.5?1:t>=.25?2:3}setByShape(t,e,i,n){const s=this.getTextureByShape(e,i,n);return e.userData.textureKey=s.userData.textureKey=t,this.renderShapeTexture(e,s),this.set(t,s),s}getTextureByShape(t,e,i,n){const s=new Rd;if(t.boundingBox.isEmpty())throw new Error("get boundingBox error");Kd.identity(),tp.identity(),e&&!(null==e?void 0:e.isEmpty())?op.copy(e):op.copy(t.boundingBox),op.getSize(Kd),op.getCenter(tp),i&&!i.isEmpty()?i.getSize(ep):ep.copy(Kd),(ep.x<Qd.x||ep.y<Qd.y)&&ep.normalize().multiplyScalar(200),ep.x<1&&(ep.x=1),ep.y<1&&(ep.y=1),np.set(Me.config.width,Me.config.height);const r=ep.length()/np.length();r>1&&ep.multiplyScalar(1/r);const a=ep.length()/Kd.length();return hp.copy(Kd).multiplyScalar(-.5).add(tp).multiplyScalar(a).negate(),lp.identity(),up.set(a,a),sp.compose(hp,lp,up),ip.copy(Kd).multiplyScalar(-.5).add(tp),s.position.copy(ip),s.rotation.copy(lp),s.scaled.multiplyScalar(1/up.x,1/up.y),s.updateMatrix(),s}renderShapeTexture(t,e,i){var n;const s=An.create(ep.x,ep.y),r=An.getContext2D(s,{alpha:!0});r.clearRect(0,0,s.width,s.height),r.beginPath(),r.strokeStyle=Le.darkRed,r.lineWidth=1,r.strokeRect(0,0,s.width,s.height),r.closePath(),this._transform(r,t),this._bindStyle(r,t),t.buildPath(r),this._fill(r,t),this._stroke(r,t),null==(n=t.children)||n.forEach((t=>{t.isShape&&(this._bindStyle(r,t),t.buildPath(r),this._fill(r,t),this._stroke(r,t),t.isText&&this._renderText(r,t))})),e.image=s}_transform(t,e){sp.getComponents(cp),t.transform(...cp)}_bindStyle(t,e){var i,n,s;t.beginPath();const{fill:r,stroke:a}=(null==(i=e.userData)?void 0:i.style)||{};if(r&&(t.fillStyle=r),a){let i=e.mtl.lineWidth;i||(i=1/Math.min(Math.abs(this._scaled.x),Math.abs(this._scaled.y))),t.lineWidth=i,t.strokeStyle=(null==(s=null==(n=e.userData)?void 0:n.style)?void 0:s.stroke)||Le.black}}_fill(t,e){var i,n;(null==(n=null==(i=e.userData)?void 0:i.style)?void 0:n.fill)&&t.fill()}_stroke(t,e){var i,n;(null==(n=null==(i=e.userData)?void 0:i.style)?void 0:n.stroke)&&t.stroke()}_renderText(t,e){const{text:i,fill:n,stroke:s,fontSize:r,fontFamily:a,fontWeight:o,textAlign:h,textBaseline:l}=e.mtl;if(!i)return;rp.set,ap.copy(e.matrix).decompose(hp,lp,up);const u=(r||12)*up.x;t.font=`${o} ${u}px ${a}`,h&&(t.textAlign=h),l&&(t.textBaseline=l);let c=hp.y;s?(t.strokeStyle=s,t.lineWidth=1*Math.abs(1/cp[0]),t.strokeText(i,hp.x,c)):(t.fillStyle=n||Le.black,t.fillText(i,hp.x,c))}};d(Xd,"DEBUG_DisplayCachedTexture",ri.throttle(((t=80,e=.8)=>{const i=Zd;if(!i)return;let n=dp();if(n||(n=function(t=80,e=.8){const i=document.createElement("div");return i.setAttribute("id","DEBUG_Displaycached"),i.style.position="absolute",i.style.width=t+"px",i.style.height="92vh",i.style.background=`rgba(255, 255, 255, ${e})`,i.style.left="20px",i.style.top="20px",i.style.overflow="auto",i.style.padding="6px",i.style.opacity=e.toString(),i.addEventListener("mouseenter",(function(){i.style.opacity="1"})),i.addEventListener("mouseleave",(function(){i.style.opacity=e.toString()})),document.body.appendChild(i),i}(t,e)),!n)throw new Error("dom not found");!function(t,e){e.forEach(((e,i)=>{e&&e.image&&function(t,e,i){let n;for(let i=0,s=t.childNodes.length;i<s;i++)if(t.childNodes[i].getAttribute("id")===e){n=t.childNodes[i];break}n?function(t,e){if(!e.image)return;const i=t.querySelector("canvas");if(!i)return;const n=i.getContext("2d",{alpha:!0});if(!n)throw new Error("getContext error");n.clearRect(0,0,i.width,i.height),n.save(),n.scale(window.devicePixelRatio,window.devicePixelRatio),n.drawImage(e.image,0,0),n.restore()}(n,i):function(t,e,i){if(!i.image)return;!i.image.width||i.image.height;const n=Me.document.createElement("div");n.setAttribute("id",e),n.style.display="flex",n.style.flexDirection="column";const s=An.createCanvas({containerId:t.id,width:i.image.width,height:i.image.height,dpr:window.devicePixelRatio});s.style.border=`${Le.yellow} 1px solid`,s.style.maxWidth=parseInt(t.style.width)-2+"px",s.style.maxHeight=parseInt(s.style.maxWidth)/(i.image.width/i.image.height)+"px";const r=s.getContext("2d",{alpha:!0});if(!r)throw new Error("getContext error");r.save(),r.scale(window.devicePixelRatio,window.devicePixelRatio),r.drawImage(i.image,0,0),r.restore(),n.appendChild(s);const a=Me.document.createElement("p");a.innerHTML=i.image.width+" * "+i.image.height,a.innerHTML+="<br/>"+e,a.style.margin="0",a.style.padding="0",a.style.lineHeight="1.2",a.style.fontSize="10px",a.style.padding="3px 0 6px 0",a.style.color=Le.black,n.appendChild(a),t.appendChild(n),n.addEventListener("click",(function(){const t=s.toDataURL("image/png",.6),e=document.createElement("a"),i=new MouseEvent("click");e.download=`thumb.${Date.now()}.png`,e.href=t,e.dispatchEvent(i)}))}(t,e,i)}(t,i,e)}))}(n,i.cache)}),5e3));let Zd,Jd=Xd;const Qd=new Fe(50,50),Kd=new Fe,tp=new Fe,ep=new Fe,ip=new Fe,np=new Fe,sp=new Hi,rp=new Hi,ap=new Hi,op=new ai,hp=new Fe,lp=new Fe,up=new Fe,cp=[1,0,0,1,0,0];function dp(){var t;return"undefined"==typeof window?null:null==(t=null==window?void 0:window.document)?void 0:t.getElementById("DEBUG_Displaycached")}const pp=class t{static getObject2BySvg(t,e){const i=(new ad).parse(t,this.use3DShape),n=this.getShapesByParsed(i,e);if(1==(null==n?void 0:n.length))return n[0];const s=new cd;return s.adds(n),s}static getShapesBySvg(t,e){const i=(new ad).parse(t,this.use3DShape);return this.getShapesByParsed(i,e)}static getShapesByParsed(t,e){this.use3DShape=!!(null==e?void 0:e.use3DShape);const i=[],n=this.getPolygons2ByPaths(null==t?void 0:t.paths,e);(null==n?void 0:n.length)&&i.push(...n);const s=this.getLabels(null==t?void 0:t.labels,e);return(null==s?void 0:s.length)&&i.push(...s),i}static getPolygons2ByPaths(t,e){if(!t||!t.length)return;const i=[];for(let n=0,s=t.length;n<s;n++){const s=this.getPolygonsByPath(t[n],e);(null==s?void 0:s.length)&&i.push(...s)}return i}static getPolygonsByPath(t,e){var i,n;if(!t)return;const s=[],{userData:r}=t;let{fill:a,stroke:o,strokeWidth:h,thinLine:l,fillOpacity:u,strokeOpacity:c,opacity:d}=(null==r?void 0:r.style)||{};(null==e?void 0:e.fill)&&(a=e.fill),(null==e?void 0:e.stroke)&&(o=e.stroke),(null==e?void 0:e.lineWidth)&&(h=e.lineWidth),(null==e?void 0:e.thinLine)&&(l=!!e.thinLine),(null==e?void 0:e.fillOpacity)&&(u=e.fillOpacity),(null==e?void 0:e.strokeOpacity)&&(c=e.strokeOpacity),(null==e?void 0:e.opacity)&&(d=e.opacity),"none"!==a&&"transparent"!==a||(a=void 0,ri.unset(r,"style.fill")),"none"!==o&&"transparent"!==o||(o=void 0),o&&!h&&(h=1);const p=Td.getMtl({fill:a,stroke:o,lineWidth:h,fillOpacity:u,strokeOpacity:c,opacity:d}),f=[];if(this.use3DShape){const n=ad.createShapes(t),s=(null==(i=t.currentPath)?void 0:i.autoClose)||!1;for(let t,i=0,r=(null==n?void 0:n.length)||0;i<r;i++){t=n[i];const r=bp(t,{flipY:null==e?void 0:e.flipY,strokeWidth:h,thinLine:l,closed:s});r&&f.push(r)}}else{const i=new mc({cmds:t.getCmds(),flipY:null==e?void 0:e.flipY,lineWidth:h,thinLine:l});f.push(i)}if(null==f?void 0:f.length){const t=bc.mergeGeoShapes(f),i=new yd(t,p);i.userData=ri.cloneDeep(r),(null==(n=i.userData)?void 0:n.id)&&(i.name=i.userData.id),void 0!==(null==e?void 0:e.selectable)?i.selectable=e.selectable:i.userData.assetType&&(i.selectable=!0),s.push(i)}return s.length?s:void 0}static getInstanceBySymbol(e,i){var n,s,r,a,o,h,l,c;if(!e||!(null==(n=e.paths)?void 0:n.length))return;const d=[],p=ri.cloneDeep(i.userData),f=[];for(let t,i=0,n=(null==(s=null==e?void 0:e.paths)?void 0:s.length)||0;i<n;i++)t=e.paths[i].clone(),t.userData=p,f.push(t);const m=this.getLabels(null==e?void 0:e.labels);if(!e.symbolId)return;const g=new ai;f.forEach((t=>g.union(t.computeBoundingBox()))),null==m||m.forEach((t=>g.union(xp.copy(t.computeBoundingBox()).applyMatrix3(t.matrix)))),mp.copy(i.transform).decompose(gp,yp,vp);const y=new md(u({},null==(r=i.userData)?void 0:r.style)),v=new Bd(g,y,{flipY:!0});if(v.userData=p,d.push(v),v.applyMatrix3(mp.flipSvgY()),v.computeBoundingBox(),v.updateMatrix(),v.updateMatrixWorld(!0),!Jd.getInstance().has(e.symbolId)){const i=new yd;ri.set(i,"userData.id",e.symbolId),ri.set(i,"userData.style",ri.merge({},e.style,p.style));for(let n,s=0,r=(null==(a=null==e?void 0:e.paths)?void 0:a.length)||0;s<r;s++){n=e.paths[s];const r=ri.merge({},null==(o=n.userData)?void 0:o.style,p.style,{flipY:!1});r.stroke&&!r.lineWidth&&(r.lineWidth=null==(l=null==(h=n.userData)?void 0:h.style)?void 0:l.strokeWidth),r.stroke&&!r.lineWidth&&(r.lineWidth=(null==(c=p.style)?void 0:c.strokeWidth)||1);const a=t.getPolygonsByPath(n,r);(null==a?void 0:a.length)&&i.adds(a)}(null==m?void 0:m.length)&&i.adds(m),i.computeBoundingBox(),i.updateMatrix(),i.updateMatrixWorld(!0),i.updateBoundingBox(),Jd.getInstance().scale(vp.x,vp.y).setByShape(e.symbolId,i,g)}let x=Jd.getInstance().get(e.symbolId);return x?(x=x.clone(),x.scaled.multiplyScalar(1,-1),x.updateMatrix(),v.mtl.map=x,d):void 0}static getLabels(t,e){if(!(null==t?void 0:t.length))return;const i=[];for(let n=0,s=(null==t?void 0:t.length)||0;n<s;n++){const s=this.getLabel(t[n],e);(null==s?void 0:s.length)&&i.push(...s)}return i}static getLabel(t,e){var i,n,s,r;if(!t||!t.textContent)return;const a=[];let{fill:o,stroke:h}=(null==(i=t.userData)?void 0:i.style)||{};o&&"none"!==o&&"transparent"!==o||h||(o=Le.lightBlack);const l=new Dd({text:t.textContent,fontSize:t.userData.style.fontSize,fill:o,stroke:h,flipY:null==e?void 0:e.flipY,wireframe:null==e?void 0:e.wireframe});t.userData&&(l.userData=ri.cloneDeep(t.userData)),(null==(n=l.userData)?void 0:n.id)&&(l.name=l.userData.id),void 0===(null==(r=null==(s=l.userData)?void 0:s.style)?void 0:r.fill)&&ri.set(l.userData,"style.fill",o),l.renderOrder=1,a.push(l),t.transform&&(mp.setFromMatrix(t.transform),(null==e?void 0:e.flipY)&&mp.scale(1,-1),l.applyMatrix3(mp));const{id:u,pid:c,aid:d,assetType:p,layerType:f}=t.userData;return a}};d(pp,"use3DShape",!1);let fp=pp;const mp=new Hi,gp=new Fe,yp=new Fe,vp=new Fe,xp=new ai;function bp(t,e){var i,n;const{closed:s,flipY:r,strokeWidth:a,thinLine:o}=e||{};null==(i=null==t?void 0:t.curves)||i.length;const h=wp(t.curves),l=[];for(let e=0,i=null==(n=null==t?void 0:t.holes)?void 0:n.length;e<i;e++){const i=wp(t.holes[e].curves);l.push(...i)}return h.push(...l),new mc({cmds:h,closed:s,flipY:r,lineWidth:a,thinLine:o})}function wp(t){const e=[];for(let i,n=0,s=t.length;n<s;n++){const s=t[n],r=s.getPoint(0),a=!n;switch(s.type){case"LineCurve":a&&e.push([1,...s.v1.toArray()]),e.push([2,...s.v2.toArray()]);break;case"QuadraticBezierCurve":{a&&e.push([1,r.x,r.y]);const t=[];t.push(4),t.push(...s.v1.toArray()),t.push(...s.v2.toArray()),e.push(t);break}case"CubicBezierCurve":{a&&e.push([1,r.x,r.y]);const t=[];t.push(3),t.push(...s.v0.toArray()),t.push(...s.v1.toArray()),t.push(...s.v2.toArray()),t.push(...s.v3.toArray()),e.push(t);break}case"EllipseCurve":{a&&e.push([1,r.x,r.y]);const t=[];t.push(hn),t.push(s.aX),t.push(s.aY),t.push(s.xRadius),t.push(s.yRadius),t.push(s.aRotation),t.push(s.aStartAngle),t.push(s.aEndAngle),t.push(s.aClockwise?1:0),e.push(t);break}}i=s}return e}const _p=Me.window||window,Sp=_p.requestAnimationFrame||_p.webkitRequestAnimationFrame||_p.mozRequestAnimationFrame||_p.oRequestAnimationFrame||_p.msRequestAnimationFrame||function(t){_p.setTimeout(t,1e3/60)},Ep=_p.cancelAnimationFrame||_p.webkitCancelAnimationFrame||_p.mozCancelAnimationFrame||_p.oCancelAnimationFrame||_p.msCancelAnimationFrame||clearTimeout;class Ap{constructor(t,e,i=16.7,n){var s;if(d(this,"duration",16.7),d(this,"onComplete"),d(this,"generator"),d(this,"t",null),d(this,"stopped",!1),i&&(this.duration=i),this.onComplete=n,!e||"function"!=typeof e)throw new Error("[task] callback method is null!");let r="number"==typeof t&&t||Array.isArray(t)&&t.length;if(!r)throw new Error("[task] task list is empty ...");if(1===r)return e(0),void(null==(s=this.onComplete)||s.call(this));this.generator=this.queue(r,e),this.t=null,this.stopped=!1,this.next()}next(){var t;if(!this.generator||this.stopped)return;const{generator:e}=this,i=performance.now();let n=null;do{if(!e)break;if(n=e.next(),n.done){null==(t=this.onComplete)||t.call(this),this.clear();break}}while(!n.done&&performance.now()-i<this.duration);n.done||this.stopped||(this.t=Sp(this.next.bind(this)))}*queue(t,e){let i=performance.now();for(let n=0;n<t;n++)performance.now()-i>=this.duration&&(i=performance.now(),yield),this.stopped||e(n)}clear(){this.stopped=!0,this.generator=void 0,this.onComplete=void 0,this.t&&(Ep(this.t),this.t=null)}}class Mp extends zi{constructor(t={}){super(),d(this,"name","Adapter2@"+si.now()),d(this,"params"),d(this,"xml"),d(this,"units"),d(this,"paths"),d(this,"symbolsMap"),d(this,"uses"),d(this,"labels"),d(this,"idsTree"),d(this,"scene"),d(this,"boundingBox",new ai),d(this,"requestHeader",{}),d(this,"resources",[]),d(this,"_viewBox",new ai),d(this,"_tic"),d(this,"_tic2"),d(this,"_assetTypes",[]),d(this,"_resourcesMap",{}),d(this,"_assetTypeMap",{}),d(this,"_idsMap",{}),d(this,"_boundingBoxMap",{}),d(this,"use3DShape",!1),this.params=t}destroy(){super.destroy(),this.clear()}clear(){this.xml=void 0,this.paths=[],this.symbolsMap={},this.uses=[],this.labels=[],this.idsTree=[],this._idsMap={},this.boundingBox.makeEmpty(),this._resourcesMap={},this._assetTypeMap={},this._assetTypes=[],Jd.clear()}setRequestHeader(t){return this.requestHeader=t,this}load(t,e){return p(this,null,(function*(){var e,i;if(!t)throw"url not found";let n;if(this.dispatchEvent({type:Ri.INITIALIZATION_START}),this.clear(),fp.use3DShape=this.use3DShape,this.use3DShape)n=yield(new ad).setRequestHeader({}).setPixelRatio((null==(e=this.params)?void 0:e.dpr)||1).loadAsync(t).catch((()=>({})));else{const e=yield(new ws).loadAsync(t).catch((()=>({})));n=yield Tn.setInstancedMesh(null==(i=Me.config)?void 0:i.instancedMesh).parse(e)}return n}))}initResources(t,e){var i,n,s,r,a,o;if(this.clear(),!this.scene)throw new Error("please bind a Scene first");if(this.xml=null==t?void 0:t.xml,!this.xml)return void this.dispatchEvent({type:Ri.INITIALIZATION_COMPLETE});this.units=null==t?void 0:t.units,this.paths=null==t?void 0:t.paths,this.symbolsMap=null==t?void 0:t.symbolsMap,this.uses=null==t?void 0:t.uses,this.labels=null==t?void 0:t.labels,this.idsTree=null==t?void 0:t.idsTree,this._assetTypes=null==t?void 0:t.assetTypes,(null==t?void 0:t.viewBox)&&this._viewBox.copy(t.viewBox).flipY(),this.recomputeIdsMap();const h=this,l=ri.chain(e).flatMap((t=>this._idsMap[t])).commit().uniq().value();if(null==(i=null==t?void 0:t.paths)?void 0:i.length){const e=null==t?void 0:t.paths;this._tic&&this._tic.clear(),this._tic=new Ap(e,(function(t){var i,n,s,r,a,o,u,c,d,p,f;const m=fp.getPolygonsByPath(e[t],{flipY:!0});if(null==m?void 0:m.length)for(let t=0,e=(null==m?void 0:m.length)||0;t<e;t++){const e=null==(n=null==(i=m[t])?void 0:i.userData)?void 0:n.id;(null==l?void 0:l.length)&&!l.includes(e)&&(m[t].visible=!1),h._resourcesMap[e]||(h._resourcesMap[e]=[]),h._resourcesMap[e].push(m[t]),null==(s=h.scene)||s.add(m[t]),(null==(a=null==(r=m[t])?void 0:r.userData)?void 0:a.assetType)&&(h._assetTypeMap[null==(u=null==(o=m[t])?void 0:o.userData)?void 0:u.assetType]||(h._assetTypeMap[null==(d=null==(c=m[t])?void 0:c.userData)?void 0:d.assetType]=[]),h._assetTypeMap[null==(f=null==(p=m[t])?void 0:p.userData)?void 0:f.assetType].push(m[t]))}}),3,(function(){var t;null==(t=h.scene)||t.computeBoundingBox(),h.scene.needsUpdate=!0}))}if(null==(n=null==t?void 0:t.labels)?void 0:n.length){const e=null==t?void 0:t.labels;this._tic2&&this._tic2.clear(),this._tic2=new Ap(e,(function(t){var i,n,s;const r=fp.getLabel(e[t],{flipY:!0});if(null==r?void 0:r.length)for(let t=0,e=(null==r?void 0:r.length)||0;t<e;t++){r[t].renderOrder=9;const e=null==(n=null==(i=r[t])?void 0:i.userData)?void 0:n.id;(null==l?void 0:l.length)&&!l.includes(e)&&(r[t].visible=!1),h._resourcesMap[e]||(h._resourcesMap[e]=[]),h._resourcesMap[e].push(r[t]),null==(s=h.scene)||s.add(r[t])}}),3,(()=>{var t;null==(t=this.scene)||t.computeBoundingBox(),this.scene.needsUpdate=!0}))}if(null==(s=null==t?void 0:t.instances)?void 0:s.length){const e=null==t?void 0:t.instances;for(let t,i=0,n=e.length;i<n;i++){t=e[i];const n=fp.getInstanceBySymbol(this.symbolsMap[t.symbolId],t);if(null==n?void 0:n.length)for(let t=0,e=(null==n?void 0:n.length)||0;t<e;t++){const e=null==(a=null==(r=n[t])?void 0:r.userData)?void 0:a.id;(null==l?void 0:l.length)&&!l.includes(e)&&(n[t].visible=!1),null==(o=this.scene)||o.add(n[t])}}}}bindScene(t){return this.scene=t,this}recomputeIdsMap(){var t;if(!(null==(t=this.idsTree)?void 0:t.length))return;const e=[];nn(this.idsTree,(t=>{var i;if(e.push(t.value),!(null==(i=t.children)?void 0:i.length))return;const n=sn(t);this._idsMap[t.value]=ri.map(n,"value")}))}getAssetIdsByType(t){let e=[];Array.isArray(t)||(t=[t]);for(let i,n=0,s=t.length;n<s;n++){i=t[n];let s=Object.hasOwnProperty.call(this._idsMap,i)?this._idsMap[i]:void 0;(null==s?void 0:s.length)||(s=Object.hasOwnProperty.call(this._idsMap,i+"-assets")?this._idsMap[i+"-assets"]:void 0),(null==s?void 0:s.length)&&(e=e.concat(s))}return e}getLayers(t=2){return this.xml?en(this.xml,t):[]}getViewBox(){return this._viewBox}getAssetTypes(){return this._assetTypes}getByAssetType(t){return this._assetTypeMap[t]||[]}updateLayersVisibility(t,e=!1){if(!this.scene)throw new Error("please bind a Scene first");const i=ri.chain(t).flatMap((t=>this._idsMap[t])).concat(t).compact().uniq().value();this.scene.traverse((t=>{var n,s;(null==(n=t.userData)?void 0:n.id)&&i.includes(t.userData.id)?t.visible=e:(null==(s=t.userData)?void 0:s.id)&&(t.visible=!e)})),this.scene.needsUpdate=!0}getBoundingBoxByIds(t){if(!this._resourcesMap||!Object.keys(this._resourcesMap).length)return;const e=new ai;Array.isArray(t)||(t=[t]);for(let i=0,n=null==t?void 0:t.length;i<n;i++){if(!this._resourcesMap.hasOwnProperty(t[i]))continue;const n=this._resourcesMap[t[i]];if(null==n?void 0:n.length)for(let t=0,i=null==n?void 0:n.length;t<i;t++)n[t].boundingBox.isEmpty()&&n[t].computeBoundingBox(),n[t].boundingBox.isEmpty()||e.union(n[t].boundingBox)}return e}transMmByUtils(t=0){return t*Tp[ri.toLower(this.units||"mm")]}}const Tp={mm:1,cm:.1,m:.001,inches:.0393701,inch:.0393701};class Cp{constructor(t){d(this,"params"),d(this,"currentCamera"),d(this,"bindingStates",new WeakMap),d(this,"forceUpdate",!1),d(this,"currentState"),d(this,"cameraVersion"),d(this,"currentRenderState"),d(this,"ctxMap",{}),this.params=t}destroy(){this.bindingStates=new WeakMap,this.currentState=void 0,this.ctxMap={},this.reset()}reset(){this.forceUpdate=!0}setup(t,e,i){this.currentRenderState=e,this.currentCamera=i,this.currentState=this.getBindingState(t),this.ctxMap={};let n=this.needsUpdate(t);return(this.forceUpdate||n)&&this.saveCache(t),this.currentState}getBindingState(t){return this.bindingStates.has(t)||this.bindingStates.set(t,{id:t.id,uuid:t.uuid,needsUpdate:!0,featureKey:t.featureKey,version:-1,cameraVersion:-1,preShape:Ip}),Ip=t,this.bindingStates.get(t)}clearBindingState(){this.currentState&&(this.currentState.needsUpdate=!1,this.currentState.version=-1,this.currentState.cameraVersion=-1)}needsUpdate(t){return!this.currentState||!!this.currentState.needsUpdate||this.currentState.id!==t.id||this.currentState.version!==t.version}saveCache(t){this.currentState&&(this.clearBindingState(),this.currentState.version=t.version,this.currentState.needsUpdate=!1,this.currentState.ctx=An.getCtx(t.featureKey,this.params.width,this.params.height,this.params.dpr))}updateModelViewMatrix(t,e){void 0!==e?(this.currentState=this.getBindingState(t),(this.currentState.cameraVersion!==e.version||t.dynamically)&&(this.currentState.cameraVersion!==e.version&&(this.currentState.needsUpdate=!0),this.currentState.cameraVersion=e.version,t.updateModelViewMatrix(e))):t.updateModelViewMatrix()}}let Ip;class Dp{constructor(){d(this,"light"),d(this,"lightsArray",[]),d(this,"shadowsArray",[]),d(this,"lastCameraVersion",-1)}destroy(){var t;this.clear(),null==(t=this.light)||t.destroy()}clear(){this.lightsArray.length=0,this.shadowsArray.length=0}pushLight(t){this.light||(this.light=t),this.lightsArray.push(t)}pushShadow(t){this.shadowsArray.push(t)}}class Lp{constructor(){d(this,"renderStates",new WeakMap)}destroy(){this.renderStates=new WeakMap}get(t,e=0){const i=this.renderStates.get(t);let n;return void 0===i?(n=new Dp,this.renderStates.set(t,[n])):e>=i.length?(n=new Dp,i.push(n)):n=i[e],n}}class Bp{constructor(t=1e3){d(this,"cellCapacity"),d(this,"firstIndex"),d(this,"lastIndex"),d(this,"items"),this.cellCapacity=t,this.firstIndex=0,this.lastIndex=0,this.items=[new Array(this.cellCapacity)]}adjustCells(){this.lastIndex<this.cellCapacity||(this.items.push(new Array(this.cellCapacity)),this.lastIndex=0)}enqueue(t,e){if(e)return this.unshift(t);this.items[this.items.length-1][this.lastIndex++]=t,this.adjustCells()}unshift(t){for(let t=this.items.length-1;t>=0;t--)for(let e=this.cellCapacity-1;e>=0;e--)e>0&&void 0===this.items[t][e-1]||(this.items[t][e]=0===e&&t>0?this.items[t-1][this.cellCapacity-1]:this.items[t][e-1]);this.items[0][this.firstIndex]=t,this.lastIndex++,this.adjustCells()}dequeue(){if(this.isEmpty())return;const t=this.items[0][this.firstIndex];return this.firstIndex===this.cellCapacity-1?(this.items.shift(),this.firstIndex=0):this.firstIndex++,t}isEmpty(){return 1===this.items.length&&this.firstIndex===this.lastIndex}peek(){if(!this.isEmpty())return this.items[0][this.firstIndex]}size(){return(this.items.length-1)*this.cellCapacity-this.firstIndex+this.lastIndex}clear(){this.firstIndex=0,this.lastIndex=0,this.items=[new Array(this.cellCapacity)]}toString(){if(this.isEmpty())return"";let t=`${this.items[0][this.firstIndex]}`;for(let e=this.firstIndex+1;e<this.items[0].length;e++)t=`${t},${this.items[0][e]}`;for(let e=1;e<this.items.length-1;e++)for(let i=0;i<this.items[e].length;i++)t=`${t},${this.items[e][i]}`;for(let e=0;e<this.lastIndex;e++)t=`${t},${this.items[this.items.length-1][e]}`;return t}getByIndex(t){if(t>=this.size())return;const e=Math.floor((this.firstIndex+t)/this.cellCapacity),i=(this.firstIndex+t)%this.cellCapacity;return this.items[e][i]}setByIndex(t,e){if(t>=this.size())return!1;const i=Math.floor((this.firstIndex+t)/this.cellCapacity),n=(this.firstIndex+t)%this.cellCapacity;return this.items[i][n]=e,!0}sort(t){const e=this.size(),i=new Array(e);for(let t=0;t<e;t++)i[t]=this.getByIndex(t);i.sort(t),this.clear();for(let t=0;t<i.length;t++)this.enqueue(i[t])}getAll(){const t=[];for(let e=0,i=this.size();e<i;e++)t[e]=this.getByIndex(e);return t}}class Pp{constructor(){d(this,"queue",new Bp),d(this,"mergedQueue",{})}destroy(){this.clear()}clear(){this.queue.clear();const t=ri.keys(this.mergedQueue);for(let e=0,i=null==t?void 0:t.length;e<i;e++)void 0!==this.mergedQueue[t[e]]&&this.mergedQueue[t[e]].clear()}push(t,e){return e&&!t.renderOrder&&(t.renderOrder=e),this.queue.enqueue(t),this}unshift(t){this.queue.enqueue(t,!0)}sort(t){return this.queue.size()&&this.queue.sort(t||kp),this}mergeQueue(){for(let t=0,e=this.queue.size();t<e;t++){const t=this.queue.dequeue();if(!t.isShape)continue;const e=fd(t.mtl);let i=this.mergedQueue[e];i||(i=new Bp,this.mergedQueue[e]=i),i.enqueue(t)}return this}}function kp(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.id-e.id}class Np{constructor(){d(this,"lists",new WeakMap)}destroy(){this.lists=new WeakMap}get(t,e){const i=this.lists.get(t);let n;return void 0===i?(n=new Pp,this.lists.set(t,[n])):e>=i.length?(n=new Pp,i.push(n)):n=i[e],n}}class Op{constructor(t={}){d(this,"name","CvsRenderer@"+si.now()),d(this,"params"),d(this,"autoClear",!0),d(this,"_currentRenderTarget"),d(this,"cvs"),d(this,"ctx"),d(this,"renderStates",new Lp),d(this,"renderStateStack",[]),d(this,"currentRenderState"),d(this,"renderLists",new Np),d(this,"currentRenderList"),d(this,"renderListStack",[]),d(this,"bindingStates"),d(this,"renderer"),d(this,"_frustum",new ai),d(this,"_tic"),d(this,"renderSliceComplete",!1),d(this,"lastTicCompleted",-1),d(this,"_isContextLost",!1),d(this,"contextLostHandler",this.handleContextLost.bind(this)),d(this,"contextRestoreHandler",this.handleContextRestore.bind(this)),this.params=t,Me.config=t,void 0!==t.autoClear&&(this.autoClear=!!t.autoClear),this.init(),this.bindingStates=new Cp(this.params),this.renderer=new zd(this.ctx,this.bindingStates)}destroy(){this.renderer.destroy()}init(){if(this.params.workerRender){if(!this.params.cvs)throw new Error("offscreen canvas not found");this.cvs=this.params.cvs}else this.cvs=An.createCanvas(this.params);if(!this.cvs)throw new Error("canvas create error");const t=this.cvs.getContext("2d",{alpha:!0});if(!t)throw new Error("context error");this.params.cvs=this.cvs,this.params.ctx=this.ctx=t,this.setSize(this.params.width,this.params.height)}get isSliceComplete(){return!!this.params.sliceRendering&&this.renderSliceComplete}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.params.width=t,this.params.height=e,this.params.camera||(this.params.camera={}),this.params.camera.width=t,this.params.camera.height=e,this.params.aspect=t/e,this.params.camera.aspect=this.params.aspect,this.params.camera.left=-.5*t,this.params.camera.right=.5*t,this.params.camera.top=.5*e,this.params.camera.bottom=-.5*e,this.cvs&&An.resizeCanvas(this.cvs,t,e,this.params.dpr)}getSize(t=new Fe){return t.set(this.params.width,this.params.height)}bindEvents(){var t,e;null==(t=this.cvs)||t.addEventListener(Rp,this.contextLostHandler,!1),null==(e=this.cvs)||e.addEventListener(zp,this.contextRestoreHandler,!1)}unbindEvents(){var t,e;null==(t=this.cvs)||t.removeEventListener(Rp,this.contextLostHandler,!1),null==(e=this.cvs)||e.removeEventListener(zp,this.contextRestoreHandler,!1)}handleContextLost(t){t.preventDefault(),this._isContextLost=!0}handleContextRestore(){this._isContextLost=!1}clean(){this.ctx&&(this._currentRenderTarget?this._currentRenderTarget.ctx.clearRect(0,0,this.params.width,this.params.height):this.ctx.clearRect(0,0,this.params.width,this.params.height))}getRenderTarget(){return this._currentRenderTarget}setRenderTarget(t){this._currentRenderTarget=t}render(t,e,i){if(this._isContextLost||!this.ctx)return;this._currentRenderTarget?this.renderer.ctx=this._currentRenderTarget.ctx:this.renderer.ctx=this.ctx,this.currentRenderState=this.renderStates.get(t,this.renderStateStack.length);const n=void 0!==e&&this.currentRenderState.lastCameraVersion!==e.version;(n||t.dynamically||t.matrixWorldAutoUpdate)&&t.updateMatrixWorld(),(n||e&&void 0===e.parent&&(null==e?void 0:e.matrixWorldAutoUpdate))&&e.updateMatrixWorld(),e&&(this._frustum.copy(e.boundingBoxWorld),this.currentRenderState.lastCameraVersion=e.version),t.isScene&&t.onBeforeRender(this,t,e,i),this.currentRenderState.clear(),this.renderStateStack.push(this.currentRenderState),this.currentRenderList=this.renderLists.get(t,this.renderListStack.length),this.currentRenderList.clear(),this.renderListStack.push(this.currentRenderList),this.projectObject(t,e,0),this.currentRenderList.sort(),this.renderScene(this.currentRenderList,t,e,i),t.isScene&&t.onAfterRender(this,t,e),this.renderStateStack.pop(),this.renderStateStack.length>0?this.currentRenderState=this.renderStateStack[this.renderStateStack.length-1]:this.currentRenderState=void 0,this.renderListStack.pop(),this.renderListStack.length?this.currentRenderList=this.renderListStack[this.renderListStack.length-1]:this.currentRenderList=void 0}renderTexture(t,e){t&&t.image&&(this._currentRenderTarget?this.renderer.ctx=this._currentRenderTarget.ctx:this.renderer.ctx=this.ctx,this.autoClear&&this.clean(),this.renderer.ctx.drawImage(t.image,0,0))}projectObject(t,e,i=0){var n,s,r,a,o,h;if(t.visible)if(t.composeNode)t.boundingBoxWorld.isEmpty()?null==(n=this.currentRenderList)||n.push(t,i):this._frustum.intersectsBox(t.boundingBoxWorld)&&(null==(s=this.currentRenderList)||s.push(t,i));else{t.isGroup&&(i=t.renderOrder),t.isShape&&e?t.boundingBoxWorld.isEmpty()?null==(r=this.currentRenderList)||r.push(t,i):this._frustum.intersectsBox(t.boundingBoxWorld)&&(null==(a=this.currentRenderList)||a.push(t,i)):t.isShape&&(null==(o=this.currentRenderList)||o.push(t,i));for(let i=0,n=(null==(h=t.children)?void 0:h.length)||0;i<n;i++)this.projectObject(t.children[i],e)}}renderScene(t,e,i,n){this.autoClear&&this.clean();const s=t.queue;s.size()<=0||(e.isStatic&&this.params.sliceRendering?this.renderObjectsSlice(s,e,i,n):this.renderObjects(s,e,i,n),s.clear())}renderObjects(t,e,i,n){for(let s,r=0,a=t.size();r<a;r++)s=t.dequeue(),s&&this.renderObject(s,e,i,n)}renderObject(t,e,i,n){t.onBeforeRender(this,e,i,n),this.bindingStates.updateModelViewMatrix(t,i),this.bindingStates.setup(t,this.currentRenderState,i),this.renderer.render(t),this.params.wireframe&&this.renderer.renderWireFrame(t),t.onAfterRender(this,e,i)}renderObjectsMerged(t,e,i,n){si.now(),(()=>{for(let s,r=0,a=t.size();r<a;r++)s=t.dequeue(),s&&this.renderObjectMerged(s,e,i,n)})()}renderObjectMerged(t,e,i,n){t.onBeforeRender(this,e,i,n),this.bindingStates.updateModelViewMatrix(t,i),this.bindingStates.setup(t,this.currentRenderState,i),this.renderer.renderMerged(t),this.params.wireframe&&this.renderer.renderWireFrame(t),t.onAfterRender(this,e,i)}renderObjectsSlice(t,e,i,n){var s;this.autoClear&&this.clean();const r=t.getAll()||[];if(!(null==r?void 0:r.length))return;this._tic&&this._tic.clear(),this.renderSliceComplete=!1;const a=(null==(s=this._currentRenderTarget)?void 0:s.ctx)||this.ctx;if(!a)throw new Error("CvsRenderer.renderObjectsSlice: no ctx");const o=this;this._tic=new Ap(r,(t=>{this.renderSliceComplete=!1,this.renderer.ctx=a,this.renderObject(r[t],e,i,n),e.isStatic&&t===r.length-1&&this.params.debounceCache&&(this.renderSliceComplete=!0)}),this.params.sliceDuration,(function(){o.lastTicCompleted=si.now()}))}}const Rp="contextlost",zp="contextrestored";class Hp{constructor(t=!0){d(this,"autoStart"),d(this,"startTime",0),d(this,"oldTime",0),d(this,"elapsedTime",0),d(this,"running",!1),this.autoStart=t}start(){this.startTime=fi(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=fi();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}class Fp extends zi{constructor(t={}){super(),d(this,"name","RenderTarget"),d(this,"uuid",es()),d(this,"featureKey",this.name+"@"+this.uuid),d(this,"offscreen",!0),d(this,"width"),d(this,"height"),d(this,"dpr"),d(this,"texture"),d(this,"cvs"),d(this,"ctx"),void 0!==t.offscreen&&(this.offscreen=t.offscreen),this.width=t.width,this.height=t.height,this.dpr=t.dpr||1,this.offscreen?this.cvs=An.get(this.featureKey,this.width,this.height,this.dpr):this.cvs=An.createHtmlCanvas(this.width,this.height,this.dpr),this.ctx=An.getContext2D(this.cvs,{alpha:!0}),this.texture=new Rd,this.texture.image=this.cvs}destroy(){super.destroy()}setSize(t,e,i=Me.config.dpr){this.width===t&&this.height===e&&this.dpr===i||(this.width=t,this.height=e,An.resizeCanvas(this.cvs,t,e,i))}clean(){this.ctx&&this.ctx.clearRect(0,0,this.width,this.height)}clone(){return new(0,this.constructor)({width:this.width,height:this.height,dpr:this.dpr}).copy(this)}copy(t){return this.name=t.name,this}}const Wp=new Fe;class Up{constructor(t,e){d(this,"name","EffectComposer"),d(this,"renderer"),d(this,"renderTarget1"),d(this,"renderTarget2"),d(this,"writeBuffer"),d(this,"readBuffer"),d(this,"_width"),d(this,"_height"),d(this,"_pixelRatio"),d(this,"renderToScreen",!0),d(this,"passes",[]),d(this,"clock",new Hp),this.renderer=t,e?(this.renderTarget1=e,this._width=e.width,this._height=e.height):(t.getSize(Wp),this._width=Wp.x,this._height=Wp.y,this.renderTarget1=new Fp({width:this._width,height:this._height}),this.renderTarget1.name="EffectComposer.rt1"),this._pixelRatio=Me.config.dpr,this.renderTarget2=this.renderTarget1.clone(),this.renderTarget2.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}destroy(){this.renderTarget1.destroy(),this.renderTarget2.destroy()}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}clearPasses(){this.passes.length=0}isLastEnabledPass(t){for(let e=t+1,i=this.passes.length;e<i;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();for(let e=0,i=this.passes.length;e<i;e++){const i=this.passes[e];i.enabled&&(i.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),i.render(this.renderer,this.writeBuffer,this.readBuffer,t,!1),i.needsSwap&&this.swapBuffers())}this.renderer.setRenderTarget(e)}reset(t){void 0===t&&(this.renderer.getSize(Wp),this._pixelRatio=Me.config.dpr,this._width=Wp.x,this._height=Wp.y,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)),this.renderTarget1.destroy(),this.renderTarget2.destroy(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const i=this._width*this._pixelRatio,n=this._height*this._pixelRatio;this.renderTarget1.setSize(i,n),this.renderTarget2.setSize(i,n);for(let t=0,e=this.passes.length;t<e;t++)this.passes[t].setSize(i,n)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}}class Vp{constructor(){d(this,"isPass",!0),d(this,"enabled",!0),d(this,"needsSwap",!0),d(this,"clear",!1),d(this,"renderToScreen",!1)}destroy(){}setSize(t,e){}}class qp{constructor(){d(this,"renderTarget"),d(this,"texture"),d(this,"width"),d(this,"height"),d(this,"dpr"),d(this,"version",-1),this.width=Me.config.width,this.height=Me.config.height,this.dpr=Me.config.dpr,this.renderTarget=new Fp({width:this.width,height:this.height,dpr:this.dpr}),this.texture=this.renderTarget.texture,this.texture.image=this.renderTarget.cvs}destroy(){}render(t){t.renderTexture(this.texture)}}class jp extends Vp{constructor(t,e,i=!0,n=!1){super(),d(this,"name","RenderPass"),d(this,"scene"),d(this,"camera"),this.scene=t,this.camera=e,this.clear=i,this.needsSwap=n}render(t,e,i,n){const s=t.autoClear;t.autoClear=!1,t.setRenderTarget(this.renderToScreen?void 0:i),this.clear&&t.clean(),t.render(this.scene,this.camera,n),t.autoClear=s}}class Yp extends Vp{constructor(t,e,i=!0,n=!1){super(),d(this,"name","DebouncePass"),d(this,"scene"),d(this,"camera"),d(this,"fsQuad",new qp),d(this,"debounceQuad",new qp),d(this,"cacheQuad",new qp),d(this,"version",-1),d(this,"_ts",si.now()),d(this,"_initialized",!1),d(this,"debounceRenderHandler",ri.debounce(this.debounceRender.bind(this),100)),this.scene=t,this.camera=e,this.clear=i,this.needsSwap=n}destroy(){super.destroy()}setSize(t,e){this.fsQuad.renderTarget.setSize(t,e),this.debounceQuad.renderTarget.setSize(t,e),this.cacheQuad.renderTarget.setSize(t,e),this.fsQuad.width=t,this.fsQuad.height=e,this.debounceQuad.width=t,this.debounceQuad.height=e,this.cacheQuad.width=t,this.cacheQuad.height=e}get currentVersion(){var t;return this.scene.version+((null==(t=this.camera)?void 0:t.version)||0)}get isChanged(){return this.version!==this.currentVersion}get isDebounceChanged(){return this.debounceQuad.version!==this.currentVersion}isRenderTicComplete(t){return this._ts<=t.lastTicCompleted}render(t,e,i){const n=t.autoClear;t.autoClear=!1,this.isChanged?this.isChanged&&!this._initialized?(this.finalRender(this.fsQuad,t,e,i),this.debounceRender(t,e,i)):(this.renderCache(this.debounceQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,i),this.debounceRenderHandler(t,e,i)):(Me.config.debounceCache&&this.isDebounceChanged&&this.isRenderTicComplete(t)?(this.saveCache(this.fsQuad,this.debounceQuad),this.finalRender(this.fsQuad,t,e,i),this._initialized=!0):Me.config.debounceCache&&this._initialized?(this.renderCache(this.debounceQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,i)):(this.renderCache(this.fsQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,i)),this._ts=si.now()),this.version=this.currentVersion,t.autoClear=n}saveCache(t,e){var i;this.isDebounceChanged&&(e.renderTarget.ctx.clearRect(0,0,Me.config.width,Me.config.height),e.renderTarget.ctx.drawImage(t.renderTarget.cvs,0,0),null==(i=this.camera)||i.updateMatrixWorld(),e.texture.matrix.copy(t.texture.matrix),e.version=this.currentVersion)}renderCache(t,e){var i;null==(i=this.camera)||i.updateMatrixWorld(),$p.copy(t.texture.matrix).invert().premultiply(this.camera.viewMatrix).getComponents(Xp),Gp.set(Me.config.width,Me.config.height),e.renderTarget.ctx.clearRect(0,0,Me.config.width,Me.config.height),e.renderTarget.ctx.save(),e.renderTarget.ctx.transform(...Xp),e.renderTarget.ctx.drawImage(t.renderTarget.cvs,0,0,Gp.x,Gp.y),e.renderTarget.ctx.restore()}finalRender(t,e,i,n){e.setRenderTarget(this.renderToScreen?void 0:n),this.clear&&e.clean(),e.renderTexture(t.renderTarget.texture,this.camera)}debounceRender(t,e,i){t.setRenderTarget(this.renderToScreen?void 0:this.fsQuad.renderTarget),t.clean(),t.render(this.scene,this.camera),this.fsQuad.texture.matrix.copy(this.camera.viewMatrix)}}const Gp=new Fe,$p=new Hi,Xp=[1,0,0,1,0,0];class Zp extends Vp{constructor(){super(),d(this,"name","OutputPass"),d(this,"texture"),d(this,"fsQuad"),this.fsQuad=new qp,this.texture=this.fsQuad.texture,this.clear=!0}destroy(){super.destroy(),this.fsQuad.destroy()}render(t,e,i){const n=t.autoClear;t.autoClear=!1,this.fsQuad.texture.image=i.cvs,t.setRenderTarget(this.renderToScreen?void 0:e),this.clear&&t.clean(),this.fsQuad.render(t),i.clean(),t.autoClear=n}}class Jp{noise(t,e,i=0){const n=Math.floor(t),s=Math.floor(e),r=Math.floor(i),a=255&n,o=255&s,h=255&r,l=(t-=n)-1,u=(e-=s)-1,c=(i-=r)-1,d=Kp(t),p=Kp(e),f=Kp(i),m=Qp[a]+o,g=Qp[m]+h,y=Qp[m+1]+h,v=Qp[a+1]+o,x=Qp[v]+h,b=Qp[v+1]+h;return tf(f,tf(p,tf(d,ef(Qp[g],t,e,i),ef(Qp[x],l,e,i)),tf(d,ef(Qp[y],t,u,i),ef(Qp[b],l,u,i))),tf(p,tf(d,ef(Qp[g+1],t,e,c),ef(Qp[x+1],l,e,c)),tf(d,ef(Qp[y+1],t,u,c),ef(Qp[b+1],l,u,c))))}}const Qp=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];for(let t=0;t<256;t++)Qp[256+t]=Qp[t];function Kp(t){return t*t*t*(t*(6*t-15)+10)}function tf(t,e,i){return e+t*(i-e)}function ef(t,e,i,n){const s=15&t,r=s<8?e:i,a=s<4?i:12==s||14==s?e:n;return(1&s?-r:r)+(2&s?-a:a)}class nf extends Vp{constructor(t){super(),d(this,"name","PaperPass"),d(this,"fsQuad"),d(this,"ctx"),d(this,"camera"),d(this,"version",0),d(this,"_width",0),d(this,"_height",0),this.camera=t,this.fsQuad=new qp,this.ctx=An.getContext2D(this.fsQuad.texture.image,{alpha:!0}),this.needsSwap=!1,this._width=this.fsQuad.width,this._height=this.fsQuad.height,this.generatePerlin()}destroy(){super.destroy(),this.fsQuad.destroy()}setSize(t,e){this.fsQuad.renderTarget.setSize(t,e),this.fsQuad.width=t,this.fsQuad.height=e,this._width=t,this._height=e}generatePerlin(){!function(t,e,i){const n=new Jp,s=t.createImageData(e,i),r=s.data;for(let t=0;t<i;t++)for(let i=0;i<e;i++){const s=n.noise(i/2.5,t/2.5,0),a=Math.floor(128*(s+1)),o=4*(t*e+i);r[o]=a,r[o+1]=a,r[o+2]=a,r[o+3]=16}t.putImageData(s,0,0)}(this.ctx,this._width,this._height)}get currentVersion(){var t;return(null==(t=this.camera)?void 0:t.version)||0}render(t,e,i){const n=t.autoClear;t.autoClear=!1,this.currentVersion!==this.version&&(this.version=this.currentVersion),this._width===this.fsQuad.width&&this._height===this.fsQuad.height||(this.fsQuad.width=this._width,this.fsQuad.height=this._height,this.generatePerlin()),t.setRenderTarget(this.renderToScreen?void 0:i),t.renderTexture(this.fsQuad.texture),t.autoClear=n}}class sf extends fs{constructor(){super(...arguments),d(this,"isDynamic",!0),d(this,"dynamically",!0)}}const rf=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),af=(t,e=0,i)=>rf(t)?new(0,t.constructor)(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i),of=(t,e,i)=>t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t;class hf{constructor(t,e,i,n){d(this,"parameterPositions"),d(this,"resultBuffer"),d(this,"sampleValues"),d(this,"valueSize"),d(this,"settings",null),d(this,"DefaultSettings_",{}),d(this,"__cacheIndex"),d(this,"_cachedIndex",0),this.parameterPositions=t,this.sampleValues=e,this.valueSize=i,this.resultBuffer=n||new Float32Array(i)}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,n=e[i],s=e[i-1];t:{e:{let r;i:{n:if(!(t<n)){for(let r=i+2;;){if(void 0===n){if(t<s)break n;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===r)break;if(s=n,n=e[++i],t<n)break e}r=e.length;break i}if(t>=s)break t;{const a=e[1];t<a&&(i=2,s=a);for(let r=i-2;;){if(void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(i===r)break;if(n=s,s=e[--i-1],t>=s)break e}r=i,i=0}}for(;i<r;){const n=i+r>>>1;t<e[n]?r=n:i=n+1}if(n=e[i],s=e[i-1],void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,n)}return this.interpolate_(i,s,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n;for(let t=0;t!==n;++t)e[t]=i[s+t];return e}}class lf extends hf{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t){return this.copySampleValue_(t-1)}intervalChanged_(){}}class uf extends hf{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=(i-e)/(n-e),u=1-l;for(let t=0;t!==a;++t)s[t]=Number(r[h+t])*u+Number(r[o+t])*l;return s}intervalChanged_(){}}class cf extends hf{constructor(t,e,i,n){super(t,e,i,n),d(this,"_weightPrev",-0),d(this,"_offsetPrev",-0),d(this,"_weightNext",-0),d(this,"_offsetNext",-0),this.DefaultSettings_={endingStart:2400,endingEnd:2400}}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),f=p*p,m=f*p,g=-c*m+2*c*f-c*p,y=(1+c)*m+(-1.5-2*c)*f+(-.5+c)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let t=0;t!==a;++t)s[t]=g*Number(r[l+t])+y*Number(r[h+t])+v*Number(r[o+t])+x*Number(r[u+t]);return s}intervalChanged_(t,e,i){const n=this.parameterPositions;let s=t-2,r=t+1,a=n[s],o=n[r];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:s=t,a=2*e-i;break;case 2402:s=n.length-2,a=e+n[s]-n[s+1];break;default:s=t,a=i}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:r=t,o=2*i-e;break;case 2402:r=1,o=i+n[1]-n[0];break;default:r=t-1,o=e}const h=.5*(i-e),l=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(o-i),this._offsetPrev=s*l,this._offsetNext=r*l}}const df=2300,pf=2301,ff=2302;class mf{constructor(t,e,i,n){if(d(this,"name","KeyframeTrack"),d(this,"times"),d(this,"values"),d(this,"ValueTypeName",""),d(this,"DefaultInterpolation",pf),d(this,"createInterpolant"),d(this,"InterpolantFactoryMethodDiscrete",this._InterpolantFactoryMethodDiscrete),d(this,"InterpolantFactoryMethodLinear",this._InterpolantFactoryMethodLinear),d(this,"InterpolantFactoryMethodSmooth",this._InterpolantFactoryMethodSmooth),!e||!e.length)throw new Error("KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=of(e,Float32Array),this.values=of(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:of(t.times,Array),values:of(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}_InterpolantFactoryMethodDiscrete(t){return new lf(this.times,this.values,this.getValueSize(),t)}_InterpolantFactoryMethodLinear(t){return new uf(this.times,this.values,this.getValueSize(),t)}_InterpolantFactoryMethodSmooth(t){return new cf(this.times,this.values,this.getValueSize(),t)}getValueSize(){return Math.ceil(this.values.length/this.times.length)}setInterpolation(t){let e;switch(t){case df:e=this.InterpolantFactoryMethodDiscrete;break;case pf:e=this.InterpolantFactoryMethodLinear;break;case ff:e=this.InterpolantFactoryMethodSmooth}if(!e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return df;case this.InterpolantFactoryMethodLinear:return pf;case this.InterpolantFactoryMethodSmooth:return ff}}shift(t){if(0!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this}trim(t,e){const i=this.times,n=i.length;let s=0,r=n-1;for(;s!==n&&i[s]<t;)++s;for(;-1!==r&&i[r]>e;)--r;if(++r,0!==s||r!==n){s>=r&&(r=Math.max(r,1),s=r-1);const t=this.getValueSize();this.times=af(i,s,r),this.values=af(this.values,s*t,r*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(t=!1);const i=this.times,n=this.values,s=i.length;0===s&&(t=!1);let r=null;for(let e=0;e!==s;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){t=!1;break}if(null!==r&&r>n){t=!1;break}r=n}if(void 0!==n&&rf(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){t=!1;break}}return t}optimize(){const t=af(this.times),e=af(this.values),i=this.getValueSize(),n=this.getInterpolation()===ff,s=t.length-1;let r=1;for(let a=1;a<s;++a){let s=!1;const o=t[a];if(o!==t[a+1]&&(1!==a||o!==t[0]))if(n)s=!0;else{const t=a*i,n=t-i,r=t+i;for(let a=0;a!==i;++a){const i=e[t+a];if(i!==e[n+a]||i!==e[r+a]){s=!0;break}}}if(s){if(a!==r){t[r]=t[a];const n=a*i,s=r*i;for(let t=0;t!==i;++t)e[s+t]=e[n+t]}++r}}if(s>0){t[r]=t[s];for(let t=s*i,n=r*i,a=0;a!==i;++a)e[n+a]=e[t+a];++r}return r!==t.length?(this.times=af(t,0,r),this.values=af(e,0,r*i)):(this.times=t,this.values=e),this}clone(){const t=af(this.times,0),e=af(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}d(mf,"DefaultInterpolation",pf),mf.prototype.ValueBufferType=Float32Array;class gf extends mf{constructor(){super(...arguments),d(this,"ValueTypeName","vector2")}}class yf extends mf{constructor(){super(...arguments),d(this,"ValueTypeName","number")}}class vf extends mf{constructor(){super(...arguments),d(this,"ValueTypeName","color")}}class xf extends mf{constructor(){super(...arguments),d(this,"ValueTypeName","bool"),d(this,"DefaultInterpolation",df)}}xf.prototype.ValueBufferType=Array,xf.prototype.InterpolantFactoryMethodLinear=void 0,xf.prototype.InterpolantFactoryMethodSmooth=void 0;class bf extends mf{constructor(){super(...arguments),d(this,"ValueTypeName","string"),d(this,"DefaultInterpolation",df)}}xf.prototype.ValueBufferType=Array,bf.prototype.InterpolantFactoryMethodLinear=void 0,bf.prototype.InterpolantFactoryMethodSmooth=void 0;class wf{constructor(t,e=-1,i,n=Sf){d(this,"name","AnimationClip"),d(this,"duration"),d(this,"tracks"),d(this,"blendMode",Sf),d(this,"uuid",es()),this.name=t,this.duration=e,this.tracks=i,this.blendMode=n,this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,s=i.length;t!==s;++t)e.push(_f(i[t]).scale(n));const s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s}static toJSON(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(mf.toJSON(i[t]));return n}static findByName(t,e){var i;let n;if(t.isShape){const e=t;n=(null==(i=e.geo)?void 0:i.animations)||e.animations}else n=t;for(let t=0;t<n.length;t++)if(n[t].name===e)return n[t]}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){const i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new(0,this.constructor)(this.name,this.duration,t,this.blendMode)}toJSON(){return wf.toJSON(this)}}function _f(t){if(void 0===t.type)throw new Error("KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return yf;case"vector":case"vector2":return gf;case"color":return vf;case"bool":case"boolean":return xf;case"string":return bf}throw new Error("KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],i=[];((t,e,i,n)=>{let s=1,r=t[0];for(;void 0!==r&&void 0===r[n];)r=t[s++];if(void 0===r)return;let a=r[n];if(void 0!==a)if(Array.isArray(a))do{a=r[n],void 0!==a&&(e.push(r.time),i.push.apply(i,a)),r=t[s++]}while(void 0!==r);else if(void 0!==a.toArray)do{a=r[n],void 0!==a&&(e.push(r.time),a.toArray(i,i.length)),r=t[s++]}while(void 0!==r);else do{a=r[n],void 0!==a&&(e.push(r.time),i.push(a)),r=t[s++]}while(void 0!==r)})(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const Sf=2500;class Ef{constructor(t,e,i){d(this,"path",""),d(this,"parsedPath"),d(this,"_targetGroup"),d(this,"_bindings"),d(this,"rootNode"),this.parsedPath=i||Af.parseTrackName(e),this._targetGroup=t,this._bindings=t.subscribe_(e,this.parsedPath)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=i.length;n!==s;++n)i[n].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}class Af{constructor(t,e,i){d(this,"path"),d(this,"parsedPath"),d(this,"node"),d(this,"rootNode"),d(this,"getValue",this._getValue_unbound),d(this,"setValue",this._setValue_unbound),d(this,"targetObject"),d(this,"propertyName"),d(this,"resolvedProperty"),d(this,"propertyIndex",-1),d(this,"BindingType",{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3,ColorString:4}),d(this,"Versioning",{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2}),d(this,"GetterByBindingType",[this._getValue_direct,this._getValue_array,this._getValue_arrayElement,this._getValue_toArray,this._getValue_color]),d(this,"SetterByBindingTypeAndVersioning",[[this._setValue_direct,this._setValue_direct_setNeedsUpdate,this._setValue_direct_setMatrixWorldNeedsUpdate],[this._setValue_array,this._setValue_array_setNeedsUpdate,this._setValue_array_setMatrixWorldNeedsUpdate],[this._setValue_arrayElement,this._setValue_arrayElement_setNeedsUpdate,this._setValue_arrayElement_setMatrixWorldNeedsUpdate],[this._setValue_fromArray,this._setValue_fromArray_setNeedsUpdate,this._setValue_fromArray_setMatrixWorldNeedsUpdate],[this._setValue_color,this._setValue_color_setNeedsUpdate,this._setValue_color_setMatrixWorldNeedsUpdate]]),this.path=e,this.parsedPath=i||Af.parseTrackName(e),this.node=Af.findNode(t,this.parsedPath.nodeName),this.rootNode=t}static create(t,e,i){return t&&t.isAnimationObjectGroup?new Ef(t,e,i):new Af(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Tf,"")}static parseTrackName(t){const e=kf.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4]?parseInt(e[4]):void 0,propertyName:e[5],propertyIndex:e[6]?parseInt(e[6]):void 0},n=i.nodeName&&i.nodeName.lastIndexOf(".")||void 0;if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==Nf.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||void 0===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;return t.getObjectByProperty("name",e)||t.getObjectByProperty("uuid",e)||void 0}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){this.targetObject&&this.propertyName&&(t[e]=this.targetObject[this.propertyName])}_getValue_array(t,e){const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)t[e++]=i[n]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_getValue_color(t,e){const i=Re.getArray(this.resolvedProperty);for(let n=0,s=i.length;n<s;n++)t[e++]=i[n]}_setValue_direct(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e])}_setValue_direct_setNeedsUpdate(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0)}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_array(t,e){const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++]}_setValue_array_setNeedsUpdate(t,e){if(!this.targetObject)return;const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){if(!this.targetObject)return;const i=this.resolvedProperty;for(let n=0,s=i.length;n!==s;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0)}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0)}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_color(t,e){this.targetObject&&this.propertyName&&(this.resolvedProperty=this.targetObject[this.propertyName]=Of.fromArray(t,e).getStyle())}_setValue_color_setNeedsUpdate(t,e){this.targetObject&&(this._setValue_color(t,e),this.targetObject.needsUpdate=!0)}_setValue_color_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this._setValue_color(t,e),this.targetObject.matrixWorldNeedsUpdate=!0)}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,i=e.objectName,n=e.propertyName;let s=e.propertyIndex;if(t||(t=Af.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return;if(i){let n=e.objectIndex;if(void 0===t[i])return;if(t=t[i],void 0!==n){if(void 0===t[n])return;t=t[n]}}if(!t)return;const r=t[n];if(void 0===r)return void e.nodeName;let a=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;void 0!==s?(o=this.BindingType.ArrayElement,this.resolvedProperty=r,this.propertyIndex=s):void 0!==r.fromArray&&void 0!==r.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(o=this.BindingType.EntireArray,this.resolvedProperty=r):r&&Re.isColor(r)?(o=this.BindingType.ColorString,this.resolvedProperty=r,this.propertyName=n):this.propertyName=n,this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=void 0,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}const Mf="\\[\\]\\.:\\/",Tf=new RegExp("["+Mf+"]","g"),Cf="[^"+Mf+"]",If="[^"+Mf.replace("\\.","")+"]",Df=/((?:WC+[\/:])*)/.source.replace("WC",Cf),Lf=/(WCOD+)?/.source.replace("WCOD",If),Bf=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cf),Pf=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cf),kf=new RegExp("^"+Df+Lf+Bf+Pf+"$"),Nf=["material","materials","bones","map","mat","mtl","geo","l"],Of=new Re;class Rf{constructor(t,e,i){let n,s,r;switch(d(this,"binding"),d(this,"valueSize"),d(this,"buffer"),d(this,"_workIndex",0),d(this,"_mixBufferRegion"),d(this,"_mixBufferRegionAdditive"),d(this,"_setIdentity"),d(this,"_origIndex",3),d(this,"_addIndex",4),d(this,"_cacheIndex"),d(this,"cumulativeWeight",0),d(this,"cumulativeWeightAdditive",0),d(this,"useCount",0),d(this,"referenceCount",0),this.binding=t,this.valueSize=i,e){case"fill":case"stroke":case"textFill":case"string":case"bool":n=this._select,s=this._select,r=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,s=this._lerpAdditive,r=this._setAdditiveIdentityNumeric,this.buffer=new Float32Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=s,this._setIdentity=r,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const i=this.buffer,n=this.valueSize,s=t*n+n;let r=this.cumulativeWeight;if(0===r){for(let t=0;t!==n;++t)i[s+t]=i[t];r=e}else{r+=e;const t=e/r;this._mixBufferRegion(i,s,0,t,n)}this.cumulativeWeight=r}accumulateAdditive(t){const e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,i=this.buffer,n=t*e+e,s=this.cumulativeWeight,r=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const t=e*this._origIndex;this._mixBufferRegion(i,n,t,1-s,e)}r>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,s=e+e;t!==s;++t)if(i[t]!==i[t+e]){a.setValue(i,n);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,s=n;t!==s;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,n,s){if(n>=.5)for(let n=0;n!==s;++n)t[e+n]=t[i+n]}_lerp(t,e,i,n,s){const r=1-n;for(let a=0;a!==s;++a){const s=e+a;t[s]=t[s]*r+t[i+a]*n}}_lerpAdditive(t,e,i,n,s){for(let r=0;r!==s;++r){const s=e+r;t[s]=t[s]+t[i+r]*n}}}const zf=2400,Hf=2401;class Ff{constructor(t,e,i,n=e.blendMode){d(this,"blendMode"),d(this,"loop",2201),d(this,"time",0),d(this,"timeScale",1),d(this,"weight",1),d(this,"repetitions",1/0),d(this,"paused",!1),d(this,"enabled",!0),d(this,"clampWhenFinished",!1),d(this,"zeroSlopeAtStart",!0),d(this,"zeroSlopeAtEnd",!0),d(this,"_mixer"),d(this,"_clip"),d(this,"_localRoot"),d(this,"_interpolantSettings"),d(this,"_interpolants"),d(this,"_propertyBindings"),d(this,"_cacheIndex"),d(this,"_byClipCacheIndex"),d(this,"_timeScaleInterpolant"),d(this,"_weightInterpolant"),d(this,"_loopCount",-1),d(this,"_startTime"),d(this,"_effectiveTimeScale",1),d(this,"_effectiveWeight",1),this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const s=e.tracks,r=s.length,a=new Array(r),o={endingStart:zf,endingEnd:zf};for(let t=0;t!==r;++t){const e=s[t].createInterpolant();e&&(a[t]=e,e.settings=o)}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r)}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=void 0,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&void 0===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}stopFading(){const t=this._weightInterpolant;return void 0!==t&&(this._weightInterpolant=void 0,this._mixer._takeBackControlInterpolant(t)),this}stopWarping(){const t=this._timeScaleInterpolant;return void 0!==t&&(this._timeScaleInterpolant=void 0,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const s=this._startTime;if(void 0!==s){const n=(t-s)*i;n<0||0===i?e=0:(this._startTime=void 0,e=i*n)}e*=this._updateTimeScale(t);const r=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(r),e[i].accumulateAdditive(a);else for(let i=0,s=t.length;i!==s;++i)t[i].evaluate(r),e[i].accumulate(n,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(void 0!==i){const n=i.evaluate(t)[0];e*=Number(n),t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(void 0!==i){const n=i.evaluate(t)[0];e*=Number(n),t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,s=this._loopCount;const r=2202===i;if(0===t)return-1===s||!r||1&~s?n:e-n;if(2200===i){-1===s&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",data:{action:this,direction:t<0?-1:1}})}}else{if(-1===s&&(t>=0?(s=0,this._setEndings(!0,0===this.repetitions,r)):this._setEndings(0===this.repetitions,!0,r)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,s+=Math.abs(i);const a=this.repetitions-s;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",data:{action:this,direction:t>0?1:-1}});else{if(1===a){const e=t<0;this._setEndings(e,!e,r)}else this._setEndings(!1,!1,r);this._loopCount=s,this.time=n,this._mixer.dispatchEvent({type:"loop",data:{action:this,loopDelta:i}})}}else this.time=n;if(r&&!(1&~s))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=Hf,n.endingEnd=Hf):(n.endingStart=t?this.zeroSlopeAtStart?Hf:zf:2402,n.endingEnd=e?this.zeroSlopeAtEnd?Hf:zf:2402)}}const Wf=new Float32Array(1);class Uf extends zi{constructor(t){super(),d(this,"stats"),d(this,"time",0),d(this,"timeScale",1),d(this,"_root"),d(this,"_accuIndex",0),d(this,"_actions",[]),d(this,"_nActiveActions",0),d(this,"_actionsByClip",{}),d(this,"_bindings",[]),d(this,"_nActiveBindings",0),d(this,"_bindingsByRootAndName",{}),d(this,"_controlInterpolants",[]),d(this,"_nActiveControlInterpolants",0),this._root=t,this._initMemoryManager()}destroy(){super.destroy(),this.stopAllAction(),this._root=void 0}dispose(){this._root=void 0}bind(t){t&&(this._root=t)}_bindAction(t,e){if(!this._root)return;const i=t._localRoot||this._root,n=t._clip.tracks,s=n.length,r=t._propertyBindings,a=t._interpolants,o=i.uuid,h=this._bindingsByRootAndName;let l=h[o];void 0===l&&(l={},h[o]=l);for(let t=0;t!==s;++t){const s=n[t],h=s.name;let u=l[h];if(void 0===u){if(u=r[t],void 0!==u){void 0===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,o,h));continue}const n=e&&e._propertyBindings[t].binding.parsedPath,a=s.getValueSize();u=new Rf(Af.create(i,h,n),s.ValueTypeName,a),++u.referenceCount,this._addInactiveBinding(u,o,h),r[t]=u}else++u.referenceCount,r[t]=u;a[t].resultBuffer=u.buffer}}_activateAction(t){if(this._root&&!this._isActiveAction(t)){if(void 0===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return void 0!==e&&e<this._nActiveActions}_addInactiveAction(t,e,i){const n=this._actions,s=this._actionsByClip;let r=s[e];if(void 0===r)r={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,s[e]=r;else{const e=r.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=n.length,n.push(t),r.actionByRoot[i]=t}_removeInactiveAction(t){if(!this._root)return;const e=this._actions,i=e[e.length-1],n=t._cacheIndex||0;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=void 0;const s=t._clip.uuid,r=this._actionsByClip,a=r[s],o=a.knownActions,h=o[o.length-1],l=t._byClipCacheIndex||0;h._byClipCacheIndex=l,o[l]=h,o.pop(),t._byClipCacheIndex=void 0,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===o.length&&delete r[s],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){if(void 0===t._cacheIndex)return;const e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_takeBackAction(t){if(void 0===t._cacheIndex)return;const e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_addInactiveBinding(t,e,i){const n=this._bindingsByRootAndName,s=this._bindings;let r=n[e];void 0===r&&(r={},n[e]=r),r[i]=t,t._cacheIndex=s.length,s.push(t)}_removeInactiveBinding(t){var e;const i=this._bindings,n=t.binding,s=(null==(e=n.rootNode)?void 0:e.uuid)||"",r=n.path,a=this._bindingsByRootAndName,o=a[s],h=i[i.length-1],l=t._cacheIndex||0;h._cacheIndex=l,i[l]=h,i.pop(),delete o[r],0===Object.keys(o).length&&delete a[s]}_lendBinding(t){if(void 0===t._cacheIndex)return;const e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_takeBackBinding(t){if(void 0===t._cacheIndex)return;const e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,s=e[n];t._cacheIndex=n,e[n]=t,s._cacheIndex=i,e[i]=s}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return void 0===i&&(i=new uf(new Float32Array(2),new Float32Array(2),1,Wf),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){if(void 0===t.__cacheIndex)return;const e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,s=e[n];t.__cacheIndex=n,e[n]=t,s.__cacheIndex=i,e[i]=s}clipAction(t,e,i){if(!this._root)return;const n=e||this._root,s=n.uuid;let r;r="string"==typeof t?wf.findByName(n,t):t;const a=r?r.uuid:"",o=this._actionsByClip[a];let h;if(void 0===i&&(i=r?r.blendMode:Sf),void 0!==o){const t=o.actionByRoot[s];if(void 0!==t&&t.blendMode===i)return t;h=o.knownActions[0],void 0===r&&(r=h._clip)}if(void 0===r)return;const l=new Ff(this,r,e,i);return this._bindAction(l,h),this._addInactiveAction(l,a,s),l}existingAction(t,e){if(!this._root)return;const i=e||this._root,n=i.uuid;let s="string"==typeof t?wf.findByName(i,t):t;const r=s?s.uuid:"",a=this._actionsByClip[r];return void 0!==a&&a.actionByRoot[n]||void 0}removeAction(t){t&&this._deactivateAction(t)}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,s=Math.sign(t),r=this._accuIndex^=1;for(let a=0;a!==i;++a)e[a]._update(n,t,s,r);const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(r);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,i=t.uuid,n=this._actionsByClip,s=n[i];if(void 0!==s){const t=s.knownActions;for(let i=0,n=t.length;i!==n;++i){const n=t[i];this._deactivateAction(n);const s=n._cacheIndex||0,r=e[e.length-1];n._cacheIndex=void 0,n._byClipCacheIndex=void 0,r._cacheIndex=s,e[s]=r,e.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(t){const e=t.uuid,i=this._actionsByClip;for(const t in i){const n=i[t].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[e];if(void 0!==n)for(const t in n){const e=n[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const i=this.existingAction(t,e);void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class Vf extends yd{constructor(t,e={}){var i,n;let s;s=Tn.parse(t),ri.set(e,"use3DShape",qf);const r=fp.getShapesByParsed(s,e);if(!(null==r?void 0:r.length))throw new Error(`Svg: no shapes: ${t}`);super(null==(i=null==r?void 0:r[0])?void 0:i.geo,null==(n=null==r?void 0:r[0])?void 0:n.mtl),d(this,"name","Svg"),d(this,"composeNode",!0),(null==r?void 0:r.length)>1&&this.adds(r.slice(1))}}const qf=!1;class jf extends yd{constructor(t){const e=new Id(t),i=new md(t);(null==t?void 0:t.lineWidth)||(i.lineWidth=1),super(e,i),d(this,"name","Polygon")}}class Yf extends sf{constructor(t={}){var e,i;super(),d(this,"isLoadingScene",!0),d(this,"name","LoadingScene"),d(this,"params"),d(this,"loadingShape"),d(this,"lineShape"),d(this,"triangleShape"),d(this,"scales",[.95,1.15,.002]),d(this,"l",0),d(this,"scaleTrend",!1),d(this,"clock",new Hp),d(this,"mixer"),d(this,"_selectedClip"),d(this,"selectedAction"),this.params=t,this.loadingShape=new Vf(Gf,{fill:Le.darkGray,flipY:!0}),this.loadingShape.name="loading",this.loadingShape.dynamically=!0,this.add(this.loadingShape),this.loadingShape.setScale(.5,.5).updateMatrix(),this.loadingShape.updateMatrixWorld(),this.loadingShape.computeBoundingBox(),this.loadingShape.updateBoundingBox(),Zf.copy(this.loadingShape.boundingBoxWorld).getCenter($f),Zf.getSize(Xf),this.loadingShape.setPosition($f.negate()).updateMatrix(),this.l=Xf.x;const n=Math.max(Math.floor(this.l/30),3),s=[-this.l/2,-(8+n),-this.l/2,-8,this.l/2,-8,this.l/2,-(8+n)];this.lineShape=new jf({points:s,fill:Le.darkGray}),this.add(this.lineShape),this.lineShape.name="loadingLine";const r=[0,0,Xf.x/2,Xf.x,Xf.x,0];this.triangleShape=new jf({points:r,fill:Le.darkRed}),this.add(this.triangleShape),this.triangleShape.name="loadingTriangle",this.triangleShape.setPosition(new Fe(-.12*Xf.x,Xf.y/-.36)).setScale(.25,.15).updateMatrix(),this.computeBoundingBox(),this.mixer=new Uf(this);const a=new gf(`${this.loadingShape.name}.mtl.fill`,[0,1.2,2],[0,0,0,.7,.38,.38,.38,.6,0,0,0,.7]),o=new yf(`${this.triangleShape.name}.mtl.fillOpacity`,[0,1.5,3],[1,.1,1],yf.DefaultInterpolation),h=new gf(`${this.lineShape.name}.scaled`,[0,.3,1],[1,1,.1,1,1,1]);this._selectedClip=new wf("selected",3,[a,o,h]),this.selectedAction=null==(e=this.mixer)?void 0:e.clipAction(this._selectedClip,this.desScene),null==(i=this.selectedAction)||i.play()}destroy(){super.destroy()}onBeforeRender(){this.lineShape.updateMatrix()}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta())}}const Gf='\n<path d="M0 20.7L0 0L7.272 0L7.272 18L20.592 18L19.08 20.7L0 20.7\nM30.78 2.772L30.78 17.928L41.4 17.928L41.4 0L48.708 0L48.708 20.7L23.472 20.7L23.472 0L41.4 0L38.88 2.772L30.78 2.772\nM62.388 12.924L71.028 12.924L68.904 15.768L61.2 15.768L59.292 20.7L51.588 20.7L59.94 0L73.188 0L81.576 20.7L73.944 20.7L71.028 12.924L67.14 2.772L65.988 2.772L62.388 12.924\nM109.728 17.784L106.884 20.7L84.456 20.7L84.456 0L102.528 0L99.972 2.844L91.656 2.844L91.656 17.928L102.528 17.928L102.528 0L107.136 0L109.728 2.7L109.728 17.784\nM119.628 20.7L112.608 20.7L112.608 0L119.628 0L119.628 20.7\nM139.752 20.7L129.78 6.3L129.78 20.7L122.508 20.7L122.508 0L130.644 0L140.58 14.652L140.58 0L147.78 0L147.78 20.7L139.752 20.7\nM168.732 18L168.732 10.728L163.368 10.728L163.368 7.992L175.932 7.992L175.932 20.7L168.732 20.7L168.732 18.504L166.572 20.7L150.66 20.7L150.66 0L176.04 0L174.456 2.7L158.04 2.7L158.04 18L168.732 18\nZ">\n</path>\n',$f=new Fe,Xf=new Fe,Zf=new ai;class Jf extends zi{constructor(t={}){var e,i;super(),d(this,"name","View"),d(this,"params"),d(this,"visible",!0),d(this,"cvs"),d(this,"scene"),d(this,"scenes",[]),d(this,"camera"),d(this,"controller"),d(this,"tween"),d(this,"animateDuration"),d(this,"controlsChangedHandler",this.handleControlsChanged.bind(this)),this.params=t,this.animateDuration=this.params.animateDuration||300,this.cvs=t.cvs,this.camera=new Fs(t.camera||{}),this.params.inpEl?this.controller=new lc(this.params.inpEl,this.camera):this.controller=new lc(this.cvs,this.camera),void 0!==(null==(e=this.params.controls)?void 0:e.enableRotate)&&(this.controller.enableRotate=!!(null==(i=this.params.controls)?void 0:i.enableRotate))}destroy(){this.controller&&this.controller.destroy(),this.camera&&this.camera.destroy(),this.scene&&this.scene.destroy(),this.scenes.forEach((t=>t.destroy())),this.scenes.length=0,super.destroy()}resize(){var t;this.camera.resize(),null==(t=this.controller)||t.resize()}setEnablePan(t){this.controller&&(this.controller.enablePan=!!t)}bindEvents(){var t;null==(t=this.controller)||t.addEventListener("change",this.controlsChangedHandler)}unbindEvents(){var t;null==(t=this.controller)||t.removeEventListener("change",this.controlsChangedHandler)}handleControlsChanged(t){}bindScene(t){this.scenes.push(t),this.reset(),this.scene=t,t.isStatic}getCameraPosition(){return this.camera.boundingBoxWorld}setCameraPosition(t,e=!0){return em.copy(t),this.resetCameraByBoundingBox(em,e)}saveCameraPosition(t){em.copy(this.camera.boundingBoxWorld);const e=t?Qf+t:Qf;sessionStorage.setItem(e,JSON.stringify(em))}clearCameraPosition(t){const e=t?Qf+t:Qf;sessionStorage.setItem(e,"")}restoreCameraPosition(t){const e=t?Qf+t:Qf,i=sessionStorage.getItem(e);i&&(em.copy(JSON.parse(i)),this.resetCameraByBoundingBox(em,!0))}zoomIn(){em.copy(this.camera.boundingBoxWorld).getSize(Kf),em.expandByScalar(-.1*Math.max(Kf.x,Kf.y)),this.resetCameraByBoundingBox(em,!0)}zoomOut(){this.controller&&(em.copy(this.camera.boundingBoxWorld).getSize(Kf),em.expandByScalar(.1*Math.max(Kf.x,Kf.y)),this.resetCameraByBoundingBox(em,!0))}fullscreen(t=10,e=!1){this.scene&&(this.scene.boundingBox.isEmpty()&&this.scene.computeBoundingBox(),"function"==typeof this.scene.computeBoundingBox?em.copy(this.scene.computeBoundingBox()):em.copy(this.scene.boundingBox),em.expandByVector(Kf.set(t,t)),this.resetCameraByBoundingBox(em,e))}handleCameraChanged(t){}reset(){}resetCameraByBoundingBox(t,e=!1){return p(this,null,(function*(){if(!this.camera)return;if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(Kf),t.getSize(tm);const n=Math.max(tm.x/this.camera.width,tm.y/this.camera.height),s={x:Kf.x,y:Kf.y,z:0,s:n,r:0};yield this.animateCamera(i,s)}))}animateCamera(t,e){return p(this,null,(function*(){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise((i=>{this.tween=new _o.Tween(t).to(e,this.animateDuration).easing(_o.Easing.Exponential.Out).onUpdate((t=>{this.camera.position.set(t.x,t.y),this.camera.scaled.set(t.s,t.s),this.camera.rotation.set(t.r,t.r),this.camera.update()})).onComplete((()=>{this.controller&&(this.controller.enabled=!0),i()})).start()}))}))}computeBoundingBox(t,e=new ai){return t&&t.length?(e.makeEmpty(),t.forEach((t=>e.union(t.computeBoundingBox()))),e):e}expandScenesBoundingBox(t,e=new ai){t.forEach((t=>t.boundingBox.union(e)))}update(t){this.tween&&this.tween.update(t)}}const Qf="camera_position_",Kf=new Fe,tm=new Fe,em=new ai;class im extends fs{constructor(){super(...arguments),d(this,"isStatic",!0),d(this,"featureKey","StaticScene_"+this.id),d(this,"cameraVersion",0),d(this,"dynamically",!1),d(this,"needsUpdateChangedHandler",this.handleNeedsUpdateChanged.bind(this))}handleNeedsUpdateChanged(){this.needsUpdate=!0}}class nm extends pc{constructor(t){super(t),d(this,"name","GeoPolyline"),this._init(t),((null==t?void 0:t.stArrow)||(null==t?void 0:t.edArrow))&&(this.arrowLength=(null==t?void 0:t.arrowLength)||10,this.arrowDeg=(null==t?void 0:t.arrowDeg)||30)}buildPath(t,e,i){if(0===this.percent)return;let{points:n}=e||this;if(n&&n.length&&!(n.length<2)){for(let e=0,i=n.length;e<i;e+=2)e?t.lineTo(n[e],n[e+1]):t.moveTo(n[e],n[e+1]);this.addArrow(t)}}addArrow(t,e){const{points:i,stArrow:n,edArrow:s,arrowDeg:r,arrowLength:a}=this;if(!(null==i?void 0:i.length)||!n&&!s||!r)return this;if(e||(e=a),!e)return this;const o=i;if(!(null==o?void 0:o.length)||(null==o?void 0:o.length)<4)return this;if(n){if(sm.set(o[2],o[3]),am.set(o[0],o[1]),sm.equals(am))return this;rm.subVectors(sm,am),om.lerpVectors(am,sm,e/rm.length()),hm.copy(om).rotateAround(am,Ie(r)),lm.copy(om).rotateAround(am,-Ie(r)),t.moveTo(hm.x,hm.y),t.lineTo(am.x,am.y),t.lineTo(lm.x,lm.y)}if(s){const i=o.length;if(sm.set(o[i-4],o[i-3]),am.set(o[i-2],o[i-1]),sm.equals(am))return this;rm.subVectors(sm,am),om.lerpVectors(am,sm,e/rm.length()),hm.copy(om).rotateAround(am,Ie(r)),lm.copy(om).rotateAround(am,-Ie(r)),t.moveTo(hm.x,hm.y),t.lineTo(am.x,am.y),t.lineTo(lm.x,lm.y)}return this}}const sm=new Fe,rm=new Fe,am=new Fe,om=new Fe,hm=new Fe,lm=new Fe;class um extends yd{constructor(t={}){(null==t?void 0:t.width)||(t.width=.5*Me.config.width),(null==t?void 0:t.height)||(t.height=.5*Me.config.height),(null==t?void 0:t.lineWidth)||(t.lineWidth=1),(null==t?void 0:t.stroke)||(t.stroke=Le.darkRed),(null==t?void 0:t.arrowDeg)||(t.arrowDeg=30),(null==t?void 0:t.arrowLength)||(t.arrowLength=10),(null==t?void 0:t.lineDash)||(t.lineDash=[10,7]),t.points=[-t.width,0,t.width,0,0,t.height,0,-t.height];const e=.5*(t.arrowLength||10);super(new Id({points:[-e,0,0,e,e,0,0,-e]}),new md({fill:Le.darkRed})),d(this,"name","Axes"),d(this,"params"),d(this,"xShape"),d(this,"yShape"),d(this,"xRShape"),d(this,"yRShape"),this.params=t,this.xShape=new yd(new nm({points:[2*e,0,t.width,0],linewidth:t.lineWidth,edArrow:!0,arrowLength:t.arrowLength,arrowDeg:t.arrowDeg}),new md({stroke:Le.darkRed,lineWidth:1})),this.yShape=new yd(new nm({points:[0,2*e,0,t.height],linewidth:t.lineWidth,edArrow:!0,arrowLength:t.arrowLength,arrowDeg:t.arrowDeg}),new md({stroke:Le.darkGreen,lineWidth:1})),this.xRShape=new yd(new nm({points:[-2*e,0,-t.width,0],linewidth:t.lineWidth}),new md({stroke:Le.darkRed,lineWidth:1,lineDash:t.lineDash})),this.yRShape=new yd(new nm({points:[0,-2*e,0,-t.height],linewidth:t.lineWidth}),new md({stroke:Le.darkGreen,lineWidth:1,lineDash:t.lineDash})),this.add(this.xShape),this.add(this.yShape),this.add(this.xRShape),this.add(this.yRShape),this.computeBoundingBox()}computeBoundingBox(){var t;return(null==(t=this.params)?void 0:t.fixed)?this.boundingBox.makeEmpty():super.computeBoundingBox(),this.boundingBox}updateModelViewMatrix(t){var e;(null==(e=this.params)?void 0:e.fixed)?t?(this.modelViewMatrix.copy(t.viewMatrix),this.computeAxes(t)):this.modelViewMatrix.copy(this.matrixWorld):super.updateModelViewMatrix(t)}computeAxes(t){if(!t)return;t.updateBoundingBox();const e=t.scaled.x,i=this.params.lineWidth*e,n=[this.params.lineDash[0]*e,this.params.lineDash[1]*e],s=(this.params.arrowLength||10)*e,r=s/4;this.xShape.geo.arrowLength=s,this.xShape.geo.setPoints([s+r,0,t.boundingBoxWorld.max.x,0]),this.xShape.geo.lineWidth=i,this.yShape.geo.arrowLength=s,this.yShape.geo.setPoints([0,s+r,0,t.boundingBoxWorld.max.y]),this.yShape.geo.lineWidth=i,this.xRShape.geo.setPoints([-s-r,0,t.boundingBoxWorld.min.x,0]),this.xRShape.geo.lineWidth=i,this.xRShape.mtl.lineDash=n,this.yRShape.geo.setPoints([0,-s-r,0,t.boundingBoxWorld.min.y]),this.yRShape.geo.lineWidth=i,this.yRShape.mtl.lineDash=n,this.geo.setPoints([-s,0,-r,r,0,s,r,r,s,0,r,-r,0,-s,-r,-r])}}class cm extends im{constructor(t={},e){super(),d(this,"isMainScene",!0),d(this,"name","MainScene"),d(this,"params"),d(this,"adapter"),d(this,"featureKey","MainScene_"+this.id),d(this,"axesHelper"),d(this,"resourcesMap",{}),d(this,"legend",[]),d(this,"_viewBox",new ai),this.params=t,this.adapter=e,this.selectable=!0,this.initAxesHelper()}destroy(){var t;super.destroy(),this.resourcesMap={},this.legend=[],null==(t=this.axesHelper)||t.destroy()}initAxesHelper(){this.params.axesHelper&&(this.axesHelper&&this.axesHelper.destroy(),this.axesHelper=new um({fixed:!0,lineWidth:.5}),this.add(this.axesHelper))}setViewBox(t){t&&this._viewBox.copy(t)}computeBoundingBox(){return super.computeBoundingBox(),!this._viewBox.isEmpty()&&(this._viewBox.getCenter(dm),this.boundingBox.getCenter(pm),Math.round(Fe.getDistance(dm,pm)))?this._viewBox:this.boundingBox}getBoundingBox(){return this._viewBox.isEmpty()?this.boundingBox:this._viewBox}add(t){return super.add(t),t.userData.id?(this.resourcesMap[t.userData.id]||(this.resourcesMap[t.userData.id]=[]),this.resourcesMap[t.userData.id].push(t),this):this}remove(t){if(!t)return this;if(super.remove(t),this.resourcesMap[t.userData.id]){const e=this.resourcesMap[t.userData.id].indexOf(t);e>-1&&this.resourcesMap[t.userData.id].splice(e,1),this.resourcesMap[t.userData.id].length||delete this.resourcesMap[t.userData.id]}return this}getAssetIdsByType(t){const e=[];return this.traverse((i=>{i.userData.assetType===t&&i.userData.id&&e.push(i.userData.id)})),e}getByIds(t,e=[]){if(e.length=0,!t)return e;Array.isArray(t)||(t=[t]);for(let i=0,n=(null==t?void 0:t.length)||0;i<n;i++)Object.hasOwnProperty.call(this.resourcesMap,t[i])&&e.push(...this.resourcesMap[t[i]]);return e}setFillOrStrokeByIds(t,e,i="fill"){this.traverse((n=>{var s;if(!n.mtl||!t.includes(n.userData.id))return;const r=ri.cloneDeep(n.mtl);"fill"===i?r.fill=e:"stroke"===i&&(r.stroke=e,r.lineWidth=5),n.mtl=Td.getMtl(r),this.addLegend(i,e,null==(s=n.userData)?void 0:s.id)})),this.needsUpdate=!0}clearFillOrStroke(t,e){this.traverse((i=>{var n,s,r,a,o,h;if(!i.mtl)return;if(e&&!e.includes(i.userData.id))return;const l=ri.cloneDeep(i.mtl);void 0!==t&&"fill"!==t||!(null==l?void 0:l.fill)||(l.fill=(null==(s=null==(n=i.userData)?void 0:n.style)?void 0:s.fill)||void 0),void 0!==t&&"stroke"!==t||!(null==l?void 0:l.stroke)||(l.stroke=(null==(a=null==(r=i.userData)?void 0:r.style)?void 0:a.stroke)||void 0,l.lineWidth=(null==(h=null==(o=i.userData)?void 0:o.style)?void 0:h.lineWidth)||1),i.mtl=Td.getMtl(l)})),this.needsUpdate=!0,this.clearLegendBy(t)}increaseFontSize(t=1.1){this.traverse((e=>{var i;e.mtl&&e.isText&&(null==(i=e.mtl)?void 0:i.text)&&(e.scaled.multiplyScalar(t),e.updateMatrix(),e.needsUpdate=!0)}));const e=ri.uniq(ri.compact(ri.map(this.children,(t=>t.userData.aid))));this.recomputedAssetLabels(e),this.needsUpdate=!0}increaseStrokeWidth(t=1.1){this.traverse((e=>{var i;e.mtl&&(null==(i=e.mtl)?void 0:i.stroke)&&e.geo.lineWidth&&(e.geo.lineWidth*=t)})),this.needsUpdate=!0}addLegend(t,e,i){let n=this.legend.find((t=>t.color===e));n||(n={type:t,color:e,ids:[]},this.legend.push(n)),n.ids.push(i)}getLegend(){return this.legend}clearLegendBy(t){var e;t||(this.legend.length=0);for(let i=(null==(e=this.legend)?void 0:e.length)-1;i>=0;i--)this.legend[i].type===t&&this.legend.splice(i,i)}getAssetLabels(t,e){var i,n,s,r,a;const o=ri.filter(this.children,(t=>{var i;return(null==(i=t.userData)?void 0:i.aid)===e}));if(!(null==o?void 0:o.length))return;const h=[];for(let t,e=0,l=o.length;e<l;e++){t=o[e],(null==(i=t.mtl)?void 0:i.text)&&h.push(null==(n=t.mtl)?void 0:n.text);for(let e,i=0,n=(null==(s=null==t?void 0:t.children)?void 0:s.length)||0;i<n;i++)e=t.children[i],(null==(r=null==e?void 0:e.mtl)?void 0:r.text)&&h.push(null==(a=null==e?void 0:e.mtl)?void 0:a.text)}return h}setAssetLabels(t,e){if(!ri.find(this.children,(e=>{var i;return(null==(i=e.userData)?void 0:i.id)===t})))return;const i=ri.filter(this.children,(e=>{var i;return(null==(i=e.userData)?void 0:i.aid)===t}));if(!(null==i?void 0:i.length))return;const n=i[i.length-1];for(let t=0,s=((null==e?void 0:e.length)||0)-((i.length||0)-1);t<s;t++){const t=n.clone(!0,!0);this.add(t),t.updateMatrix(),i.push(t)}for(let t=1,n=(null==i?void 0:i.length)||0;t<n;t++){const n=i[t];n.mtl.text=(null==e?void 0:e.length)?e[t-1]:void 0,n.needsUpdate=!0}this.recomputedAssetLabels(t)}recomputedAssetLabels(t){if(t){Array.isArray(t)||(t=[t]);for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++){let i=ri.filter(this.children,(i=>{var n,s;return(null==(n=i.userData)?void 0:n.aid)===t[e]&&!!(null==(s=i.mtl)?void 0:s.text)}));if(!(null==i?void 0:i.length))return;for(let t,e=0,n=(null==i?void 0:i.length)||0;e<n;e++)t=i[e],t.computeBoundingBox(),t.updateBoundingBox(),fm.copy(t.boundingBoxWorld).getSize(pm),dm.copy(i[e?e-1:0].position),pm.multiplyScalar(1.2),e&&(t.position.set(dm.x,dm.y-pm.y),t.updateMatrix())}}}clearAssetLabels(t){const e=t?this.getAssetIdsByType(t):this.children.map((t=>t.userData.id&&t.userData.assetType));for(let t,i=0,n=(null==e?void 0:e.length)||0;i<n;i++)if(t=ri.filter(this.children,(t=>{var n;return(null==(n=t.userData)?void 0:n.aid)===e[i]})),(null==t?void 0:t.length)&&1!==t.length)for(let e=t.length-1;e>0;e--)t[e].destroy(),this.remove(t[e])}getAssetBoundingBox(t,e=new ai){if(e.makeEmpty(),!t)return e;Array.isArray(t)||(t=[t]);for(let i,n=0,s=(null==t?void 0:t.length)||0;n<s;n++){i=t[n];const s=this.getByIds(i);if(null==s?void 0:s.length)for(let t=0,i=s.length;t<i;t++)e.union(s[t].boundingBoxWorld)}return e}setAssetType(t,e){var i,n;const s=[t];t!==Ti.RM&&s.push(Ti.RM);const r=null==(i=this.adapter)?void 0:i.getAssetIdsByType(s);(null==r?void 0:r.length)&&(null==(n=this.adapter)||n.updateLayersVisibility(r,!0))}}const dm=new Fe,pm=new Fe,fm=new ai;class mm extends sf{constructor(t={}){super(),d(this,"name","AnimateScene"),d(this,"params"),d(this,"resourcesMap",{}),d(this,"dynamicFill",Le.red),d(this,"dynamicScale",new Fe(1,1)),d(this,"clock",new Hp),d(this,"mixer"),d(this,"_selectedClip"),d(this,"selectedAction"),this.params=t,this.initAxesHelper(),this.mixer=new Uf(this)}destroy(){super.destroy()}initAxesHelper(){this.params.axesHelper&&(this.axesHelper&&this.axesHelper.destroy(),this.axesHelper=new um({fixed:!0,lineWidth:.5}),this.add(this.axesHelper))}add(t){return super.add(t),t.userData.id?(this.resourcesMap[t.userData.id]||(this.resourcesMap[t.userData.id]=[]),this.resourcesMap[t.userData.id].push(t),this):this}remove(t){if(!t)return this;if(super.remove(t),this.resourcesMap[t.userData.id]){const e=this.resourcesMap[t.userData.id].indexOf(t);e>-1&&this.resourcesMap[t.userData.id].splice(e,1),this.resourcesMap[t.userData.id].length||delete this.resourcesMap[t.userData.id]}return this}getByIds(t,e=[]){if(e.length=0,!t)return e;Array.isArray(t)||(t=[t]);for(let i=0,n=(null==t?void 0:t.length)||0;i<n;i++)Object.hasOwnProperty.call(this.resourcesMap,t[i])&&e.push(...this.resourcesMap[t[i]]);return e}getAssetBoundingBox(t,e=new ai){if(e.makeEmpty(),!t)return e;Array.isArray(t)||(t=[t]);for(let i,n=0,s=(null==t?void 0:t.length)||0;n<s;n++){i=t[n];const s=this.getByIds(i);if(null==s?void 0:s.length)for(let t=0,i=s.length;t<i;t++)e.union(s[t].boundingBoxWorld)}return e}onBeforeRender(){}update(t){var e;null==(e=this.mixer)||e.update(this.clock.getDelta())}}class gm extends sf{constructor(t={}){var e,i;super(),d(this,"isEmptyScene",!0),d(this,"name","EmptyScene"),d(this,"params"),d(this,"loadingShape"),d(this,"lineShape"),d(this,"triangleShape"),d(this,"scales",[.95,1.15,.002]),d(this,"l",0),d(this,"scaleTrend",!1),d(this,"clock",new Hp),d(this,"mixer"),d(this,"_selectedClip"),d(this,"selectedAction"),this.params=t,this.loadingShape=new Vf(ym,{fill:Le.darkGray,flipY:!0}),this.loadingShape.name="loading",this.loadingShape.dynamically=!0,this.add(this.loadingShape),this.loadingShape.updateMatrixWorld(),this.loadingShape.computeBoundingBox(),this.loadingShape.updateBoundingBox(),bm.copy(this.loadingShape.boundingBoxWorld).getCenter(vm),bm.getSize(xm),this.loadingShape.setPosition(vm.negate()).updateMatrix(),this.l=xm.x;const n=Math.max(Math.floor(this.l/30),2),s=[-this.l/2,-(10+n),-this.l/2,-10,this.l/2,-10,this.l/2,-(10+n)];this.lineShape=new jf({points:s,fill:Le.darkGray}),this.add(this.lineShape),this.lineShape.name="loadingLine";const r=[0,0,xm.x/2,xm.x,xm.x,0];this.triangleShape=new jf({points:r,fill:Le.darkRed}),this.add(this.triangleShape),this.triangleShape.name="loadingTriangle",this.triangleShape.setPosition(new Fe(-.12*xm.x,xm.y/-.4)).setScale(.25,.15).updateMatrix(),this.computeBoundingBox(),this.mixer=new Uf(this);const a=new gf(`${this.loadingShape.name}.mtl.fill`,[0,1.2,2],[0,0,0,.7,.38,.38,.38,.7,0,0,0,.7]),o=new yf(`${this.triangleShape.name}.mtl.fillOpacity`,[0,1.5,3],[1,.8,1],yf.DefaultInterpolation),h=new gf(`${this.lineShape.name}.scaled`,[0,1.5,3],[1,1,.6,1,1,1]);this._selectedClip=new wf("selected",3,[a,o,h]),this.selectedAction=null==(e=this.mixer)?void 0:e.clipAction(this._selectedClip,this.desScene),null==(i=this.selectedAction)||i.play()}destroy(){super.destroy()}onBeforeRender(){this.lineShape.updateMatrix()}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta())}}const ym='\n<path d="M13.5 15.8L12.62 17.3L0.799999 17.3L0.799999 5.8L13.46 5.8L12.56 7.3L4.84 7.3L4.84 10.66L13.12 10.66L12.24 12.18L4.84 12.18L4.84 15.8L13.5 15.8Z\nM32.12 17.3L28.52 17.3L28.52 9.9L25.18 17.3L22.1 17.3L18.8 10L18.8 17.3L15.1 17.3L15.1 5.8L20.06 5.8L23.68 13.68L27.32 5.8L32.12 5.8L32.12 17.3Z\nM37.72 12.8L37.72 17.3L33.72 17.3L33.72 5.8L42.22 5.8L41.06 7.34L37.72 7.34L37.72 11.3L42.22 11.3L42.22 5.8L46.28 5.8L46.28 12.8L37.72 12.8Z\nM57 17.3L53 17.3L53 7.34L47.88 7.34L47.88 5.8L62.48 5.8L61.6 7.34L57 7.34L57 17.3Z\nM69.92 13.52L64.08 5.78L68.62 5.78L71.92 10.58L75.14 5.78L79.64 5.78L73.92 13.56L73.92 17.28L69.92 17.28L69.92 13.52Z" />\n',vm=new Fe,xm=new Fe,bm=new ai;class wm{constructor(t,e){d(this,"parent"),d(this,"view"),d(this,"scenes",[]),d(this,"oriScene"),d(this,"dstScene"),d(this,"_fnEnable",null==(i=Me.config)?void 0:i.fnEnable),this.parent=t,this.view=e}fnEnableChanged(t){this._fnEnable=!!t}activate(){}deactivate(){this.scenes=[],this.oriScene=void 0,this.dstScene=void 0}bindScene(...t){return this.scenes.length=0,this.scenes.push(...t),this.oriScene=this.scenes.find((t=>t.isStatic)),this.dstScene=this.scenes.find((t=>t.isDynamic)),this}getDynamicObjectsByIds(t){var e,i,n;const s=[];if(null==(e=this.dstScene)||e.getByIds(t,s),null==s?void 0:s.length)return s;const r=null==(i=this.oriScene)?void 0:i.getByIds(t);if(!(null==r?void 0:r.length))return s;for(let t=0,e=(null==r?void 0:r.length)||0;t<e;t++){const e=r[t].clone(!0,!0);null==(n=this.dstScene)||n.add(e),s.push(e)}return s}clearDynamicObjectsByIds(t){var e,i;if(!t)return;Array.isArray(t)||(t=[t]);const n=null==(e=this.dstScene)?void 0:e.getByIds(t);if(null==n?void 0:n.length)for(let t,e=0,s=(null==n?void 0:n.length)||0;e<s;e++)t=n[e],null==(i=this.dstScene)||i.remove(t),t.destroy()}getColorKeyframeTrack(t,e,i=.5,n=[0,1.2,2]){const s=new Re(e).setA(i).getNormalized(),r=[...s,.38*s[0],.38*s[1],.38*s[2],.5*s[3],...s];return new vf(t,n,r)}}class _m extends wm{constructor(t,e){super(t,e),d(this,"type",Do.HOVER),d(this,"rayCaster",new Zs),d(this,"_hoverIds",[]),d(this,"hoverAction"),d(this,"_hoverClip"),d(this,"dynamicStroke",Le.red);const i=this.getColorKeyframeTrack(".dynamicStroke",Le.darkRed,.8);this._hoverClip=new wf("selected",1,[i])}activate(){var t;super.activate(),this.hoverAction=null==(t=this.parent.mixer)?void 0:t.clipAction(this._hoverClip,this)}deactivate(){var t,e;super.deactivate(),null==(t=this.hoverAction)||t.stop(),null==(e=this.parent.mixer)||e.removeAction(this.hoverAction),this.hoverAction=void 0,this._hoverIds=[]}handlePointerOver(t){var e,i,n,s,r,a;const{id:o,target:h,isStatic:l,isDynamic:u,isDummy:c}=(null==t?void 0:t.data)||{};if(this._hoverIds.includes(o))return;const d=(null==(i=null==(e=this.view)?void 0:e.camera)?void 0:i.pixelWidth)||1,p=this.getDynamicObjectsByIds(o);c&&(ri.set(t,"data.rmId",null==(n=null==h?void 0:h.userData)?void 0:n.rmId),ri.set(t,"data.wsId",null==(s=null==h?void 0:h.userData)?void 0:s.wsId),ri.set(t,"data.label",null==(r=null==h?void 0:h.userData)?void 0:r.label)),Sm(p,d),this._hoverIds.push(o),null==(a=this.hoverAction)||a.play(),this.parent.editor.dispatchEvent({type:Ri.POINTER_OVER,data:null==t?void 0:t.data})}handleOut(t){this.clearHover(),this.parent.editor.dispatchEvent({type:Ri.POINTER_OUT,data:null==t?void 0:t.data})}clearHover(){var t;if(null==(t=this.hoverAction)||t.stop(),this.dstScene){for(let t=0,e=this._hoverIds.length;t<e;t++){const e=this.dstScene.getByIds(this._hoverIds[t]);e.length&&Em(e)}this._hoverIds=[]}}traverse(t){var e;if(this.dstScene)for(let i=0,n=(null==(e=this._hoverIds)?void 0:e.length)||0;i<n;i++){const e=this.dstScene.getByIds(this._hoverIds[i]);for(let i=0,n=(null==e?void 0:e.length)||0;i<n;i++)t(e[i])}}update(){var t,e;(null==(e=null==(t=this.dstScene)?void 0:t.children)?void 0:e.length)&&this.traverse((t=>{t.traverse((t=>{t.isShape&&(t.mtl.stroke=this.dynamicStroke)}))}))}}const Sm=(t,e=1)=>{if(t){Array.isArray(t)||(t=[t]);for(let i,n=0,s=t.length;n<s;n++)i=t[n],i.traverse((t=>{t.isShape&&(t.userData.actType|=Bo.HOVER,t.geo.lineWidth=5*e,t.mtl.stroke=Le.darkYellow,t.mtl.lineJoin="round")}))}},Em=(t,e=1)=>{if(t){Array.isArray(t)||(t=[t]);for(let e,i=0,n=t.length;i<n;i++)e=t[i],e.traverse((t=>{var e,i,n;t.isShape&&(t.userData.actType&=~Bo.HOVER,t.geo.lineWidth=null==(i=null==(e=t.userData)?void 0:e.style)?void 0:i.lineWidth,t.mtl.stroke=null==(n=t.userData.style)?void 0:n.stroke,t.mtl.lineJoin=void 0)}))}};class Am extends wm{constructor(t,e){super(t,e),d(this,"type",Do.SELECT),d(this,"intersects",[]),d(this,"rayCaster"),d(this,"_selectedIds",[]),d(this,"_selectedClip"),d(this,"selectedAction"),d(this,"dynamicSelectFill",Le.red),d(this,"dynamicSelectStroke",Le.red),this.rayCaster=new Zs;const i=this.getColorKeyframeTrack(".dynamicSelectFill",Le.red,.5),n=this.getColorKeyframeTrack(".dynamicSelectStroke",Le.darkRed,.8);this._selectedClip=new wf("selected",3,[i,n])}get _selectEnable(){var t,e;return!(!(null==(t=Me.config)?void 0:t.selectEnable)||!(null==(e=this.view)?void 0:e.camera))}get _multiSelectEnable(){return Me.config.multiSelectEnable}get _dragEnable(){var t,e;return(null==(t=Me.config)?void 0:t.multiSelectEnable)&&(null==(e=Me.config)?void 0:e.fnEnable)}activate(){var t;super.activate(),this.selectedAction=null==(t=this.parent.mixer)?void 0:t.clipAction(this._selectedClip,this)}deactivate(){var t,e;this.clearSelected(),super.deactivate(),null==(t=this.selectedAction)||t.stop(),null==(e=this.parent.mixer)||e.removeAction(this.selectedAction),this.selectedAction=void 0,this.intersects=[],this._selectedIds=[]}setDynamicFill(t){}handleTap(t){if(this.intersects.length=0,!this.oriScene)return;if(!this._selectEnable&&!this._multiSelectEnable)return;this.rayCaster.init(t.data,this.view.camera).intersectObjectBy(this.oriScene,this._validFilter.bind(this),!0,this.intersects);const e=ri.uniq(ri.compact(ri.map(this.intersects,(t=>{var e,i;return(null==(e=t.userData)?void 0:e.assetType)===Me.config.assetType?null==(i=t.userData)?void 0:i.id:""}))));this.selectByIds(e,!0),this.parent.editor.dispatchEvent({type:Ri.SELECTED,data:this._selectedIds})}handlePanStart(t){var e;if((null==t?void 0:t.type)===dc.PAN_START&&this._dragEnable){if(!this.dstScene)throw new Error("No dynamic scene found!");this.parent.editor.setEnablePan(!1),Mm.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),Cm.makeEmpty().expandByPoint(Mm)}}handlePanMove(t){var e;(null==t?void 0:t.type)===dc.PAN_MOVE&&this._dragEnable&&(Tm.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),Cm.makeEmpty().expandByPoint(Mm).expandByPoint(Tm))}handlePanEnd(t){var e,i;if(this.intersects.length=0,(null==t?void 0:t.type)!==dc.PAN_END)return;if(!this._dragEnable)return;Tm.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),Cm.makeEmpty().expandByPoint(Mm).expandByPoint(Tm),this.rayCaster.init({worldBox:Cm},null==(i=this.view)?void 0:i.camera).intersectObjectBy(this.oriScene,this._validFilter.bind(this),!0,this.intersects);const n=ri.uniq(ri.compact(ri.map(this.intersects,(t=>{var e,i,n;return(null==(e=t.userData)?void 0:e.assetType)===(null==(i=Me.config)?void 0:i.assetType)?null==(n=t.userData)?void 0:n.id:""}))));this.selectByIds(n,this._multiSelectEnable),this.parent.editor.dispatchEvent({type:Ri.SELECTED,data:this._selectedIds})}_validFilter(t){var e,i,n;return!(!t.visible||!t.selectable||(null==(e=t.userData)?void 0:e.assetType)!==(null==(i=Me.config)?void 0:i.assetType))&&!ri.uniq(ri.compact(ri.map(this.intersects,(t=>{var e;return null==(e=t.userData)?void 0:e.id})))).includes(null==(n=t.userData)?void 0:n.id)}traverse(t){if(!this.dstScene)return;const e=this.dstScene.getByIds(this._selectedIds);if(null==e?void 0:e.length)for(let i=0,n=(null==e?void 0:e.length)||0;i<n;i++)t(e[i])}update(){var t,e;if(!(null==(e=null==(t=this.dstScene)?void 0:t.children)?void 0:e.length))return;const i=this.getDynamicObjectsByIds(this._selectedIds);for(let t,e=0,n=(null==i?void 0:i.length)||0;e<n;e++)t=i[e],t.isShape&&(t.userData.actType||0)&Bo.SELECT&&t.traverse((t=>{t.mtl.fill=this.dynamicSelectFill,t.mtl.stroke=this.dynamicSelectStroke}))}hasSelected(t){return this._selectedIds.includes(t)}clearSelected(t){if(this.dstScene){if(!t||!(null==t?void 0:t.length))return this.clearDynamicObjectsByIds(this._selectedIds),void(this._selectedIds.length=0);Array.isArray(t)||(t=[t]),this.clearDynamicObjectsByIds(t);for(let e=0,i=t.length;e<i;e++){const i=this._selectedIds.indexOf(t[e]);i>-1&&this._selectedIds.splice(i,1)}}}selectByIds(t,e){var i,n;if(t&&this.oriScene&&this.dstScene){if(Array.isArray(t)||(t=[t]),null==(i=this.selectedAction)||i.stop(),this._selectEnable){const i=this.hasSelected(t[0]);if(i?this.clearSelected(t[0]):this.clearSelected(),i&&e)return}else this._multiSelectEnable&&(e||this.clearSelected());this.toggleSelectByIds(t,e),null==(n=this.selectedAction)||n.play()}}toggleSelectByIds(t,e){if(this.oriScene&&this.dstScene){Array.isArray(t)||(t=[t]);for(let i=0,n=t.length;i<n;i++){if(this.hasSelected(t[i])){e&&this.clearSelected(t[i]);continue}const n=this.getDynamicObjectsByIds(t[i]);if(null==n?void 0:n.length){for(let t=0,e=n.length;t<e;t++){n[t].moveToLast();const e=this.getDynamicObjectsByIds(n[t].userData.id);for(let t=0,i=(null==e?void 0:e.length)||0;t<i;t++){const i=e[t];i.moveToLast(),i.traverse((t=>{var e;(null==t?void 0:t.isShape)&&(t.userData.actType|=Bo.SELECT,t.geo.lineWidth=5*((null==(e=t.userData.style)?void 0:e.strokeWidth)||1))}))}}this._selectedIds.push(t[i])}}}}}const Mm=new Fe,Tm=new Fe,Cm=new ai;class Im extends yd{constructor(t={}){var e;const{x:i=0,y:n=0,w:s=10,h:r=10}=t,a=s/2,o=r/2;(null==(e=t.points)?void 0:e.length)||(t.points=[i-a,n-o,i-a,n+o,i+a,n+o,i+a,n-o,i-a,n-o]);const h=new Id(t),l=new md(t);(null==t?void 0:t.lineWidth)||(l.lineWidth=1),super(h,l),d(this,"name","Rect")}setPoints(t){return!t||t.length<2||this.geo.setPoints(t),this}}class Dm extends wm{constructor(t,e){super(t,e),d(this,"type",Do.SELECTOR_RECT),d(this,"_fnEnable",!1),d(this,"selector"),d(this,"rayCaster",new Zs),d(this,"intersects",[]),this.selector=new Im({name:Lm,fill:new Re(Le.darkBlue).setA(.1).getStyle(),stroke:Le.darkBlue,lineWidth:1,lineDash:[5,5]})}activate(){super.activate()}deactivate(){super.deactivate(),this.intersects=[]}bindScene(...t){var e,i;return super.bindScene(...t),(null==(e=this.dstScene)?void 0:e.getObjectByProperty("name",Lm))||null==(i=this.dstScene)||i.add(this.selector),this}fnEnableChanged(t){this._fnEnable=!!t}get _dragEnable(){var t;return(null==(t=Me.config)?void 0:t.multiSelectEnable)&&this._fnEnable}handlePanStart(t){var e;if(this._dragEnable&&(null==t?void 0:t.type)===dc.PAN_START){if(!this.dstScene)throw new Error("No dynamic scene found!");this.parent.editor.setEnablePan(!1),Bm.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),km.makeEmpty().expandByPoint(Bm),this.selector.setVisible(!0).setPoints([Bm.x,Bm.y])}}handlePanMove(t){var e;this._dragEnable&&(null==t?void 0:t.type)===dc.PAN_MOVE&&(Pm.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),km.makeEmpty().expandByPoint(Bm).expandByPoint(Pm),this.selector.setPoints(km.round().getNumbersArray()))}handlePanEnd(t){var e;this.parent.editor.setEnablePan(!0),this._dragEnable&&(null==t?void 0:t.type)===dc.PAN_END&&(Pm.copy(t.data.screenCoords).unproject(null==(e=this.view)?void 0:e.camera),km.makeEmpty().expandByPoint(Bm).expandByPoint(Pm),this.selector.setVisible(!1))}}const Lm="EDITOT_SELECTOR",Bm=new Fe,Pm=new Fe,km=new ai;class Nm extends wm{constructor(t,e){super(t,e),d(this,"type",Do.DRAG),d(this,"_fnEnable",!1),d(this,"dragMode",Po.MAKE_COPY),d(this,"rayCaster",new Zs),d(this,"intersects",[]),d(this,"_currentObject"),d(this,"_originalPosition",new Fe),d(this,"_dragOffset",new Fe),d(this,"_objectFilter"),d(this,"_getDragabledHandler")}activate(){super.activate()}deactivate(){super.deactivate(),this.intersects=[],this._currentObject=void 0}setDraggingObject(t){this.handlePanStart({type:dc.PAN_START,data:{target:t}})}handlePanStart(t){var e,i,n;if((null==t?void 0:t.type)!==dc.PAN_START)return;if(!this.dstScene)throw new Error("No dynamic scene found!");if(!(null==(e=null==t?void 0:t.data)?void 0:e.target))return;let s;s="function"==typeof this._getDragabledHandler?this._getDragabledHandler(null==(i=null==t?void 0:t.data)?void 0:i.target):null==(n=null==t?void 0:t.data)?void 0:n.target,s&&(this.parent.editor.setEnablePan(!1),this._currentObject=s,this.parent.handleDragStart(t))}handlePanMove(t){(null==t?void 0:t.type)===dc.PAN_MOVE&&this._currentObject&&(this._currentObject.position.copy(t.data.worldCoords),this._currentObject.updateMatrix(),this._currentObject.updateWorldMatrix(!0,!1))}handlePanEnd(t){var e;this.parent.editor.setEnablePan(!0),(null==t?void 0:t.type)===dc.PAN_END&&(ri.set(t,"data.target",this._currentObject),this.parent.handleDragEnd(t),this._currentObject=void 0,null==(e=this.view.camera)||e.update())}bindFilter(t){this._objectFilter=t}_defaultFilter(t){return t.visible&&t.selectable}_validFilter(t){return this._objectFilter?this._objectFilter(t):this._defaultFilter(t)}bindGetDragabledHandler(t){this._getDragabledHandler=t}}class Om extends pc{constructor(t){super(t),this._init(t)}buildPath(t,e,i){if(0===this.percent)return;let{x:n=0,y:s=0,radius:r,startAngle:a=0,endAngle:o=2*Math.PI}=e||this;t.arc(n,s,r,a,o)}}class Rm extends yd{constructor(t=new Om,e=new md,i){super(t,e,i),d(this,"name","Sprite"),d(this,"isSprite",!0)}updateModelViewMatrix(t){if(t){zm.makeScale(t.scaled.x,t.scaled.y).premultiply(this.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.viewMatrix,zm);for(let e=0,i=this.children.length;e<i;e++)this.children[e].updateModelViewMatrix(t)}}}const zm=new Hi;class Hm extends Rm{constructor(){super(...arguments),d(this,"isDummy",!0),d(this,"composeNode",!0),d(this,"selectable",!0),d(this,"visible",!0),d(this,"renderOrder",1/0),d(this,"txtShape")}setText(t){var e;(null==(e=this.txtShape)?void 0:e.mtl)&&(this.txtShape.mtl.text=t)}setLabel(t,e){this.userData.label=t}updateModelViewMatrix(t){var e,i;if(super.updateModelViewMatrix(t),!this.txtShape)return;const n=1.2*((null==(e=this.params)?void 0:e.radius)||10)*((null==(i=null==t?void 0:t.scaled)?void 0:i.x)||1);this.txtShape.mtl.fontSize=n,this.txtShape.position.set(0,-n/2),this.txtShape.updateMatrix()}}class Fm extends Hm{constructor(t,e={}){var i,n;e.radius||(e.radius=null==(n=null==(i=Me.config)?void 0:i.dummy)?void 0:n.radius);const s=new Om({x:0,y:0,radius:e.radius,thinLine:!0}),r=new md({fill:Le.blue,stroke:Le.darkBlue});super(s,r),d(this,"params"),d(this,"dragable",!0),d(this,"radius"),this.params=e,this.userData=c(u({},t),{assetType:Ci,style:{fill:r.fill,stroke:r.stroke,lineWidth:r.lineWidth}}),this.txtShape=new Dd({text:(t.label||"").substring(0,1),fontSize:1.2*e.radius,fill:Le.white,textBaseline:"ideographic",fontWeight:"300"}),this.add(this.txtShape)}}class Wm extends Hm{constructor(t,e={}){var i,n;e.radius||(e.radius=null==(n=null==(i=Me.config)?void 0:i.dummy)?void 0:n.radius);const s=e.radius,r=new Ld({x:-s,y:-s,w:2*s,h:2*s,r:s/2}),a=new md({fill:Le.blue,stroke:Le.darkBlue});super(r,a),d(this,"params"),d(this,"txtShape"),this.params=e,this.userData=c(u({},t),{assetType:Ci,style:{fill:a.fill,stroke:a.stroke,lineWidth:a.lineWidth}}),this.txtShape=new Dd({text:"1",fontSize:e.radius,fill:Le.white,textBaseline:"ideographic",fontWeight:"300"}),this.add(this.txtShape),this.needsUpdate=!0}}class Um extends wm{constructor(t,e){super(t,e),d(this,"type",Do.DUMMY),d(this,"_fnEnable",!1),d(this,"_dummies",[]),d(this,"_centroidCache",{}),d(this,"_rmMap",new Map),d(this,"_mergedMap",new Map),d(this,"action"),d(this,"_clip"),d(this,"dynamicDummyFill",Le.red),d(this,"dynamicDummyStroke",Le.darkRed),d(this,"rayCaster",new Zs),d(this,"intersects",[]),d(this,"_currentDummy"),d(this,"_unboundDummiesMap",{}),d(this,"_cameraHandler",this.handleCameraUpdate.bind(this)),d(this,"_getDragabledHandler",this.getDragabled.bind(this));const i=new vf(".dynamicDummyFill",[0,.6,1],[.95,.38,.38,.8,.95,.38,.38,.3,.95,.38,.38,.8]),n=new vf(".dynamicDummyStroke",[0,.6,1],[.95,.38,.38,.8,.95,.38,.38,.3,.95,.38,.38,.8]);this._clip=new wf("currentDummy",1,[i,n]),this.bindEvents()}destroy(){this.deactivate(),this.unbindEvents()}bindEvents(){var t,e;null==(e=null==(t=this.view)?void 0:t.camera)||e.addEventListener(Ws.UPDATE,this._cameraHandler)}unbindEvents(){var t,e;null==(e=null==(t=this.view)?void 0:t.camera)||e.removeEventListener(Ws.UPDATE,this._cameraHandler)}activate(){var t;super.activate(),this.action=null==(t=this.parent.mixer)?void 0:t.clipAction(this._clip,this);const e=this.parent.get(Do.DRAG);e&&(e.bindFilter(this._validFilter.bind(this)),e.bindGetDragabledHandler(this._getDragabledHandler))}deactivate(){var t,e;this.clearDummies(),super.deactivate(),null==(t=this.action)||t.stop(),null==(e=this.parent.mixer)||e.removeAction(this.action),this.action=void 0,this._dummies=[],this._centroidCache={},this._rmMap=new Map,this._mergedMap=new Map,this.intersects=[];const i=this.parent.get(Do.DRAG);i&&(i.bindFilter(),i.bindGetDragabledHandler())}fnEnableChanged(t){this._fnEnable=!!t}bindEditorDrag(t){let e=this.getDummyById(null==t?void 0:t.id);e||(e=(null==t?void 0:t.rmId)?this.addDummy(t):this.addDummyUnbound(t)),e&&(e.visible=!1)}getDraggingObject(t){return this.getDummyById(null==t?void 0:t.id)}getDragabled(t){var e;if(!t)return;if(Array.isArray(t)||(t=[t]),!t.length)return;const i=t[0];let n=this._unboundDummiesMap[null==(e=i.userData)?void 0:e.id];return!n&&i.dragable&&(i.mtl.fill=i.userData.style.fill=new Re(Le.blue).setA(.5).getStyle(),i.mtl.lineDash=[2,2],i.userData.status=ko.MODIFIED,n=this.addDummyUnbound(i.userData)),n&&(n.visible=!0),n}handleDragEnd(t){var e;if(!this.oriScene)throw new Error("No dynamic scene found!");const{target:i}=(null==t?void 0:t.data)||{};if(!(null==i?void 0:i.isDummy))return;const n=[],s=c(u({},null==t?void 0:t.data),{screenCoords:i.position});if(this.rayCaster.init(s,this.view.camera).intersectObjectBy(this.oriScene,this._assetFilter.bind(this),!0,n),!(null==n?void 0:n.length))return;i.userData.rmId=null==(e=n[0].userData)?void 0:e.id;const r=this.getDummiesVo(!0);this.parent.editor.dispatchEvent({type:Ri.DRAG_END,data:r})}_validFilter(t){var e,i;return!(!t.visible||!t.selectable||(null==(e=t.userData)?void 0:e.assetType)!==Ci)&&!ri.uniq(ri.compact(ri.map(this.intersects,(t=>{var e;return null==(e=t.userData)?void 0:e.id})))).includes(null==(i=t.userData)?void 0:i.id)}_assetFilter(t){var e;return t.visible&&t.selectable&&(null==(e=t.userData)?void 0:e.assetType)===Me.config.assetType}getDummiesVo(t=!0){var e,i,n,s,r,a,o,h,l,u;const c=[];for(let a=0,o=this._dummies.length;a<o;a++){const o=this._dummies[a];if((null==(e=o.userData)?void 0:e.assetType)!==Ci)continue;if(t&&o.userData.status!==ko.NEW)continue;const h={id:null==(i=o.userData)?void 0:i.id,label:null==(n=o.userData)?void 0:n.label,rmId:null==(s=o.userData)?void 0:s.rmId,wsId:null==(r=o.userData)?void 0:r.wsId};c.push(h)}for(let e=Object.keys(this._unboundDummiesMap),i=0,n=(null==e?void 0:e.length)||0;i<n;i++){const n=e[i];if(!n)continue;const s=this._unboundDummiesMap[n];if((null==(a=s.userData)?void 0:a.assetType)!==Ci)continue;if(t&&s.userData.status!==ko.NEW)continue;const r={id:null==(o=s.userData)?void 0:o.id,label:null==(h=s.userData)?void 0:h.label,rmId:null==(l=s.userData)?void 0:l.rmId,wsId:null==(u=s.userData)?void 0:u.wsId},d=c.findIndex((t=>t.id===r.id));d>-1&&c.splice(d,1),c.push(r)}return c}getAssetById(t){let e;for(let i=0,n=this.scenes.length;i<n&&(e=this.scenes[i].getByIds(t),!e);i++);return e}getAssetBoundingBoxById(t,e=new ai){e.makeEmpty();const i=this.getAssetById(t);if(!(null==i?void 0:i.length))return e;for(let t=0,n=(null==i?void 0:i.length)||0;t<n;t++)e.union(i[t].boundingBoxWorld);return e}getDummyLabels(t){var e,i;const n=this.getDummyById(t);return n instanceof Wm?((null==(e=null==n?void 0:n.userData)?void 0:e.label)||"").split(","):[null==(i=null==n?void 0:n.userData)?void 0:i.label]}getDummiesBoundingBox(t,e){if(qm.makeEmpty(),!(null==t?void 0:t.length))return qm.clone();for(let e,i=0,n=(null==t?void 0:t.length)||0;i<n;i++){e=t[i];const n=this.getDummyById(e);n&&qm.union(n.boundingBoxWorld)}return qm.clone()}addDummy(t){var e,i;if(!this.dstScene||!(null==t?void 0:t.rmId))return;const n=t.rmId;let s=this._dummies.find((e=>{var i;return(null==(i=e.userData)?void 0:i.id)===t.id}));return s||(s=new Fm(t,Me.config.dummy),s.name=t.id||n+"_"+(t.id||(null==(e=this.dstScene.children)?void 0:e.length)),s.userData.rmId=n,this.dstScene.add(s),this._dummies.push(s),this._rmMap.has(n)||this._rmMap.set(n,[]),null==(i=this._rmMap.get(n))||i.push(s)),s}addDummyMerged(t,e){var i,n;if(!this.dstScene||!(null==t?void 0:t.rmId))return;let s;return this._mergedMap.has(t.id)?s=this._mergedMap.get(t.id):(s=new Wm(t,Me.config.dummy),s.name=t.id||e+"_"+(t.id||(null==(i=this.dstScene.children)?void 0:i.length)),null==(n=this.dstScene)||n.add(s),this._mergedMap.set(e,s)),s}addDummyUnbound(t){var e;if(!(null==t?void 0:t.id))return;const i=new Fm(t,Me.config.dummy);return i.mtl.fill=i.userData.style.fill=Le.green,i.mtl.stroke=i.userData.style.stroke=Le.darkGreen,i.userData.status=ko.NEW,null==(e=this.dstScene)||e.add(i),this._unboundDummiesMap[t.id]=i,i}traverseDummies(t){var e;for(let i=0,n=(null==(e=this._dummies)?void 0:e.length)||0;i<n;i++)t(this._dummies[i]);for(let[e,i]of this._mergedMap.entries())t(i);Object.values(this._unboundDummiesMap).forEach((e=>{t(e)}))}clearDummies(t){var e,i,n,s;for(let i,n=Object.keys(this._unboundDummiesMap),s=(null==n?void 0:n.length)||0;s>=0;s--)i=this._unboundDummiesMap[n[s]],(null==t?void 0:t.length)&&!t.includes(null==i?void 0:i.userData.status)||(null==(e=this.dstScene)||e.remove(i),null==i||i.destroy(),delete this._unboundDummiesMap[n[s]]);for(let e,s=((null==(i=this._dummies)?void 0:i.length)||0)-1;s>=0;s--)e=this._dummies[s],(null==t?void 0:t.length)&&!t.includes(e.userData.status)||(null==(n=this.dstScene)||n.remove(e),null==e||e.destroy(),this._dummies.splice(s,1));for(let[e,i]of this._mergedMap.entries())(null==t?void 0:t.length)&&!t.includes(i.userData.status)||(null==(s=this.dstScene)||s.remove(i),null==i||i.destroy(),this._mergedMap.delete(e));(null==t?void 0:t.length)||(this._dummies.length=0,this._centroidCache={},this._rmMap.clear(),this._mergedMap.clear(),this._unboundDummiesMap={})}setDummies(t){var e;if(this.clearDummies(),null==t?void 0:t.length){for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.addDummy(t[e]);null==(e=this.view.camera)||e.update()}}getDummyById(t){var e;if(t){for(let i=0,n=(null==(e=this._dummies)?void 0:e.length)||0;i<n;i++)if(this._dummies[i].name===t)return this._dummies[i];for(let[e,i]of this._mergedMap.entries())if(i.name===t)return i;return this._unboundDummiesMap[t]}}focusAtDummy(t,e=1e3){return p(this,null,(function*(){var i,n,s,r,a,o,h;const l=this.getDummyById(t),u=null==(i=null==l?void 0:l.userData)?void 0:i.rmId;if(u){if(this.getAssetBoundingBoxById(u,qm),!qm.isEmpty()&&(qm.expandByScalar(e),null==(n=this.view)?void 0:n.camera))return void((null==(r=null==(s=this.view)?void 0:s.camera)?void 0:r.boundingBoxWorld.containsBox(qm))||(yield this.view.resetCameraByBoundingBox(qm,!0)));if((null==l?void 0:l.position)&&!(null==l?void 0:l.position.isEmpty()))return l.updateWorldMatrix(!0,!1),jm.copy(l.position).applyMatrix3(l.matrixWorld),qm.setFromCenterAndSize(jm,Ym.set(2*e,2*e)),void((null==(o=null==(a=this.view)?void 0:a.camera)?void 0:o.boundingBoxWorld.containsBox(qm))||(yield null==(h=this.view)?void 0:h.resetCameraByBoundingBox(qm,!0)))}}))}highlightDummies(t){return p(this,null,(function*(){var e;Array.isArray(t)||(t=[t]),this.traverseDummies((e=>{var i;t.includes(e.userData.id)||e instanceof Wm&&(null==(i=ri.intersection(t,e.userData.id.split(",")))?void 0:i.length)?e.userData.actType|=Bo.HILIGHT:e.userData.actType&=~Bo.HILIGHT})),null==(e=this.action)||e.play()}))}resetHighlightDummies(){var t;this.traverseDummies((t=>{t.userData.actType&=~Bo.HILIGHT,t.mtl.fill=t.userData.style.fill,t.mtl.stroke=t.userData.style.stroke})),null==(t=this.action)||t.stop()}update(){var t,e;(null==(e=null==(t=this.dstScene)?void 0:t.children)?void 0:e.length)&&this.dstScene.traverse((t=>{var e;((null==(e=null==t?void 0:t.userData)?void 0:e.actType)||0)&Bo.HILIGHT&&t.isDummy&&(t.mtl.fill=this.dynamicDummyFill,t.mtl.stroke=this.dynamicDummyStroke)}))}handleCameraUpdate(t){var e,i;if(null==(e=this.view)?void 0:e.camera){for(let t,e=0,n=(null==(i=this._dummies)?void 0:i.length)||0;e<n;e++)t=this._dummies[e],this.updateDummy(t);this.mergeDummies()}}updateDummy(t){var e,i;const n=t.userData.rmId,s=this.getAssetById(n);if((null==s?void 0:s.length)&&!this._centroidCache[n]){const t=[];for(let n,r=0,a=s.length;r<a;r++)n=s[r],null==(i=null==(e=n.geo)?void 0:e.path)||i.getVertices(t);Fe.getPoleOfInaccessibility(t,jm),this._centroidCache[n]=jm.clone()}}mergeDummies(){var t,e,i;if(!(null==(t=this.view)?void 0:t.camera))return;Vm.copy(this.view.camera.viewMatrix);const n=(null==(i=null==(e=Me.config)?void 0:e.dummy)?void 0:i.radius)||10;this.view.camera.pixelWidth;for(let[t,e]of this._rmMap){if(!(null==e?void 0:e.length))continue;this.getAssetBoundingBoxById(t,qm),qm.applyMatrix3(Vm).getSize(jm).round(),Ym.copy(this._centroidCache[t]).applyMatrix3(Vm);const i=qm.centralArrange(e.length,2*n,2*n,Ym);if(Array.isArray(i)){const n=this._mergedMap.get(t);n&&(n.visible=!1),e.forEach(((t,e)=>{t.visible=!0,t.boundingBox.getSize($m),t.setPosition(Gm.copy(i[e]).unproject(this.view.camera)).updateMatrix()}))}else{e.forEach((t=>t.visible=!1));let i=this._mergedMap.get(t);if(!i){let n=ri.cloneDeep(e[0].userData)||{};const s=ri.reduce(e,((t,e)=>{var i,n;return(null==(i=e.userData)?void 0:i.label)&&t.push(null==(n=e.userData)?void 0:n.label),t}),[]),r=ri.reduce(e,((t,e)=>{var i,n;return(null==(i=e.userData)?void 0:i.id)&&t.push(null==(n=e.userData)?void 0:n.id),t}),[]);n=ri.merge(n,{rmId:t,id:r.join(","),label:s.join(",")}),i=this.addDummyMerged(n,t)}if(!i)continue;i.setText(String(e.length)),i.visible=!0,Gm.copy(e[0].position),i.setPosition(Gm).updateMatrix()}}}}const Vm=new Hi,qm=new ai,jm=new Fe,Ym=new Fe,Gm=new Fe,$m=new Fe;class Xm extends yd{constructor(t){const e=new gd(t),i=new md(t);(null==t?void 0:t.lineWidth)||(i.lineWidth=1),super(e,i),d(this,"name","Line"),d(this,"isLine",!0)}}class Zm{static getPoint(t){const e=new Om(t),i=Td.getMtl(t);return new Rm(e,i)}static getRect(t){const e=new Ld(t),i=Td.getMtl(t);return new Rm(e,i)}static getMark(t){const e=new mc({cmds:[[1,0,0],[2,-5,-10],[3,-5,-10,-12.5,-25,0,-25],[3,0,-25,12.5,-25,5,-10],[2,0,0],[an]],closed:!0,flipY:!0,lineWidth:1,thinLine:!0}),i=Td.getMtl(t);return new Rm(e,i)}}class Jm extends wm{constructor(t,e){super(t,e),d(this,"type",Do.LINKER),d(this,"_linesIds",[]),d(this,"_startIds",[]),d(this,"_endIds",[]),d(this,"_lineDash",20)}activate(){super.activate()}deactivate(){this.clear(),super.deactivate(),this._linesIds=[],this._startIds=[],this._endIds=[]}update(){var t,e;for(let i=0,n=(null==(t=this._linesIds)?void 0:t.length)||0;i<n;i++){const t=null==(e=this.dstScene)?void 0:e.getByIds(this._linesIds[i]);if(null==t?void 0:t.length)for(let e,i=0,n=t.length;i<n;i++){if(e=t[i],!(null==e?void 0:e.mtl))continue;let n=e.mtl.lineDashOffset||0;n<=-2*this._lineDash&&(n=0),e.mtl.lineDashOffset=n-1}}}clear(){var t;(null==(t=this._linesIds)?void 0:t.length)&&(this.clearDynamicObjectsByIds(this._linesIds),this.clearDynamicObjectsByIds(this._startIds),this.clearDynamicObjectsByIds(this._endIds),this._linesIds=[],this._startIds=[],this._endIds=[])}linkAssetsByTree(t){var e,i;if(this.clear(),!(null==(e=null==t?void 0:t.children)?void 0:e.length))return;Mi(t);const n=this.getLinesByTree(t,void 0,!0);if(null==n?void 0:n.length)for(let t,e=0,s=n.length;e<s;e++)t=n[e],null==(i=this.dstScene)||i.add(t),this._linesIds.push(t.userData.id)}getLinesByTree(t,e=[],i=!1){var n,s;if(!(null==t?void 0:t.value))return e;const r=this.getDynamicObjectsByIds(t.value);if(Qm.makeEmpty().expandByObjects(r).getCenter(tg),i){const e=Zm.getMark({fill:Le.red,stroke:Le.darkGreen,lineWidth:1});e.userData.id=`${t.value}-start`,e.setPosition(tg).updateMatrix(),null==(n=this.dstScene)||n.add(e),this._startIds.push(e.userData.id)}return null==(s=t.children)||s.forEach((i=>{var n,s;const r=this.getDynamicObjectsByIds(i.value);Km.makeEmpty().expandByObjects(r).getCenter(eg);const a=new Xm({x1:tg.x,y1:tg.y,x2:eg.x,y2:eg.y,stroke:Le.darkRed,strokeWidth:10,lineCap:"round",lineJoin:"round",lineDash:[this._lineDash,this._lineDash],thinLine:!0});a.userData.id=`${t.value}-${i.value}`,a.userData.actType|=Bo.DYNAMIC_LINE,e.push(a);const o=Zm.getMark({fill:Le.green,stroke:Le.darkGreen,lineWidth:1});o.userData.id=`${t.value}-end`,o.setPosition(eg).updateMatrix(),null==(n=this.dstScene)||n.add(o),this._endIds.push(o.userData.id),(null==(s=i.children)?void 0:s.length)&&this.getLinesByTree(i,e,!1)})),e}}const Qm=new ai,Km=new ai,tg=new Fe,eg=new Fe;class ig extends wm{constructor(t,e){super(t,e),d(this,"type",Do.DISTRIBUTION),d(this,"fillIdsMap",{}),d(this,"strokeIdsMap",{})}activate(){super.activate()}deactivate(){this.clearByIds(),super.deactivate(),this.fillIdsMap={},this.strokeIdsMap={}}update(){}setFillByIds(t,e){var i,n;if(t&&e){Array.isArray(t)||(t=[t]);for(let n,s=0,r=(null==t?void 0:t.length)||0;s<r;s++){n=t[s],this.clearById(n,!1);const r=null==(i=this.oriScene)?void 0:i.getByIds(n);if(null==r?void 0:r.length)for(let t,i=0,n=(null==r?void 0:r.length)||0;i<n;i++)t=r[i],(null==t?void 0:t.mtl)&&(t.mtl=Td.getMtl(c(u({},t.userData.style),{fill:e})),t.geo.lineWidth=t.userData.style.lineWidth||1,t.needsUpdate=!0)}this.fillIdsMap[e]=t,(null==(n=this.view)?void 0:n.camera)&&(this.view.camera.needsUpdate=!0)}}setStrokeByIds(t,e){var i,n;if(t&&e){Array.isArray(t)||(t=[t]);for(let n,s=0,r=(null==t?void 0:t.length)||0;s<r;s++){n=t[s],this.clearById(n,!1);const r=null==(i=this.oriScene)?void 0:i.getByIds(n);if(null==r?void 0:r.length)for(let t,i=0,n=(null==r?void 0:r.length)||0;i<n;i++)t=r[i],(null==t?void 0:t.mtl)&&(t.mtl=Td.getMtl(c(u({},t.userData.style),{stroke:e,lineWidth:5*(t.userData.style.lineWidth||1)})),t.geo.lineWidth=5*(t.userData.style.lineWidth||1),t.needsUpdate=!0)}this.strokeIdsMap[e]=t,(null==(n=this.view)?void 0:n.camera)&&(this.view.camera.needsUpdate=!0)}}clearById(t,e=!0){var i,n,s,r,a,o,h;if(!t)return;const l=null==(i=this.oriScene)?void 0:i.getByIds(t);for(let t,e=0,i=(null==l?void 0:l.length)||0;e<i;e++)t=l[e],(null==t?void 0:t.mtl)&&(t.mtl=Td.getMtl(t.userData.style),t.geo.lineWidth=null==(n=t.userData.style)?void 0:n.lineWidth,t.needsUpdate=!0);for(let e,i=Object.keys(this.fillIdsMap),n=((null==i?void 0:i.length)||0)-1;n>=0;n--){e=i[n];const a=null==(s=this.fillIdsMap[e])?void 0:s.findIndex((e=>e===t));a>-1&&this.fillIdsMap[e].splice(a,1),(null==(r=this.fillIdsMap[e])?void 0:r.length)||delete this.fillIdsMap[e]}for(let e,i=Object.keys(this.strokeIdsMap),n=((null==i?void 0:i.length)||0)-1;n>=0;n--){e=i[n];const s=null==(a=this.strokeIdsMap[e])?void 0:a.findIndex((e=>e===t));s>-1&&this.strokeIdsMap[e].splice(s,1),(null==(o=this.strokeIdsMap[e])?void 0:o.length)||delete this.strokeIdsMap[e]}e&&(null==(h=this.view)?void 0:h.camera)&&(this.view.camera.needsUpdate=!0)}clearFillByIds(t,e=!0){var i;t&&!Array.isArray(t)&&(t=[t]),t&&t.length||(t=ri.uniq(ri.compact(ri.flatten(ri.values(this.fillIdsMap)))));for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.clearById(t[e],!1);e&&(null==(i=this.view)?void 0:i.camera)&&(this.view.camera.needsUpdate=!0)}clearStrokeByIds(t,e=!0){var i;t&&!Array.isArray(t)&&(t=[t]),t&&t.length||(t=ri.uniq(ri.compact(ri.flatten(ri.values(this.strokeIdsMap)))));for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.clearById(t[e],!1);e&&(null==(i=this.view)?void 0:i.camera)&&(this.view.camera.needsUpdate=!0)}clearByIds(t,e=!0){var i;t&&!Array.isArray(t)&&(t=[t]),t&&t.length||(t=ri.uniq(ri.compact(ri.flatten(ri.concat(ri.values(this.fillIdsMap),ri.values(this.strokeIdsMap))))));for(let e=0,i=(null==t?void 0:t.length)||0;e<i;e++)this.clearById(t[e],!1);e&&(null==(i=this.view)?void 0:i.camera)&&(this.view.camera.needsUpdate=!0)}getLegend(){const t=[];for(let e in this.fillIdsMap)t.push({type:"fill",color:e,ids:this.fillIdsMap[e]});for(let e in this.strokeIdsMap)t.push({type:"stroke",color:e,ids:this.strokeIdsMap[e]});return t}}class ng extends wm{constructor(t,e){super(t,e),d(this,"type",Do.TIPS),d(this,"engineVersion","v2.0.2"),d(this,"monitor"),this.monitor=new yd}activate(){super.activate()}deactivate(){super.deactivate()}handlePointerMove(t){var e,i,n;let s=(null==(e=null==t?void 0:t.e)?void 0:e.target)||(null==(n=null==(i=null==t?void 0:t.e)?void 0:i.srcEvent)?void 0:n.target);null==s||s.id}}class sg{constructor(t,e){d(this,"tools",new Map),d(this,"activedTools",new Map),d(this,"activedTool"),d(this,"scenes",[]),d(this,"dstScene"),d(this,"mixer"),d(this,"clock",new Hp),this.editor=t,this.view=e,this.mixer=new Uf}destroy(){var t;this.dispose(),this.tools.clear(),null==(t=this.mixer)||t.destroy()}dispose(){var t;this.tools.forEach((t=>{t.deactivate&&t.deactivate()})),this.deactiveAll(),this.scenes=[],null==(t=this.mixer)||t.dispose()}register(t){Array.isArray(t)||(t=[t]),this.deactiveAll();for(let e,i=0,n=(null==t?void 0:t.length)||0;i<n;i++){e=t[i];let n=this.tools.get(e);if(!n){switch(e){case Do.TIPS:n=new ng(this,this.view);break;case Do.HOVER:n=new _m(this,this.view);break;case Do.SELECT:n=new Am(this,this.view);break;case Do.SELECTOR_RECT:n=new Dm(this,this.view);break;case Do.DISTRIBUTION:n=new ig(this,this.view);break;case Do.DRAG:n=new Nm(this,this.view);break;case Do.DUMMY:n=new Um(this,this.view);break;case Do.LINKER:n=new Jm(this,this.view)}n&&this.tools.set(e,n)}n&&(null==n?void 0:n.bindScene)&&n.bindScene(...this.scenes)}return this}bindScene(...t){var e;return this.scenes.length=0,this.scenes.push(...t),this.dstScene=this.scenes.find((t=>t.isDynamic)),this.dstScene&&(null==(e=this.mixer)||e.bind(this.dstScene)),this.activedTools.forEach((t=>{t.bindScene&&t.bindScene(...this.scenes)})),this}setMode(t){this.deactiveAll();for(let e=1;e<=t;e<<=1)if(t&e){const t=e;this.tools.has(t)&&this.activateTool(t)}}clearMode(){this.deactiveAll()}activateTool(t){const e=this.tools.get(t);e&&(null==e||e.deactivate(),this.activedTools.set(e.type,e),e.bindScene&&e.bindScene(...this.scenes),e.activate())}get(t){return this.tools.get(t)}getActiveTool(t){return this.activedTools.get(t)}deactiveAll(t){const e=[];this.activedTools.forEach((i=>{(null==t?void 0:t.includes(i.type))||e.push(i.type)})),e.forEach((t=>{var e;null==(e=this.activedTools.get(t))||e.deactivate(),this.activedTools.delete(t)}))}handleTap(t){this.activedTools.forEach((e=>{e.handleTap&&e.handleTap(t)}))}handlePanStart(t){this.activedTools.forEach((e=>{e.handlePanStart&&e.handlePanStart(t)}))}handlePanMove(t){this.activedTools.forEach((e=>{e.handlePanMove&&e.handlePanMove(t)}))}handlePanEnd(t){this.activedTools.forEach((e=>{e.handlePanEnd&&e.handlePanEnd(t)}))}handlePointerOver(t){this.activedTools.forEach((e=>{e.handlePointerOver&&e.handlePointerOver(t)}))}handlePointerOut(t){this.activedTools.forEach((e=>{e.handlePointerOut&&e.handlePointerOut(t)}))}handlePointerMove(t){this.activedTools.forEach((e=>{e.handlePointerMove&&e.handlePointerMove(t)}))}handleDragStart(t){this.activedTools.forEach((e=>{e.handleDragStart&&e.handleDragStart(t)}))}handleDragEnd(t){this.activedTools.forEach((e=>{e.handleDragEnd&&e.handleDragEnd(t)}))}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta()),this.activedTools.forEach((t=>{t.update&&t.update()}))}clearDummies(t){var e;null==(e=this.tools.get(Do.DUMMY))||e.clearDummies(t)}setDummies(t){var e;null==(e=this.tools.get(Do.DUMMY))||e.setDummies(t)}focusAtDummy(t,e=1e3){var i;null==(i=this.tools.get(Do.DUMMY))||i.focusAtDummy(t,e)}highlightDummies(t){var e;null==(e=this.tools.get(Do.DUMMY))||e.highlightDummies(t)}resetHighlightDummies(){var t;null==(t=this.tools.get(Do.DUMMY))||t.resetHighlightDummies()}getDummyLabels(t){var e;return null==(e=this.tools.get(Do.DUMMY))?void 0:e.getDummyLabels(t)}getDummiesBoundingBox(t,e){var i;return null==(i=this.tools.get(Do.DUMMY))?void 0:i.getDummiesBoundingBox(t)}}class rg extends zi{constructor(t,e){var i,n;super(),d(this,"scenes",[]),d(this,"dstScene"),d(this,"handler"),d(this,"view"),d(this,"mode",Lo.DEFAULT),d(this,"toolManager"),d(this,"tapHandler",this.handleTap.bind(this)),d(this,"panStartHandler",this.handlePanStart.bind(this)),d(this,"panMoveHandler",this.handlePanMove.bind(this)),d(this,"panEndHandler",this.handlePanEnd.bind(this)),d(this,"pointerOverHandler",this.handlePointerOver.bind(this)),d(this,"pointerOutHandler",this.handlePointerOut.bind(this)),d(this,"pointerMoveHandler",this.handlePointerMove.bind(this)),this.view=e,(null==(i=this.view)?void 0:i.camera)&&(this.handler=new nc(t,this.view.camera).enableHover(null==(n=Me.config.controls)?void 0:n.enableHover)),this.toolManager=new sg(this,this.view).register([Do.TIPS,Do.HOVER,Do.SELECT,Do.SELECTOR_RECT,Do.DISTRIBUTION,Do.DRAG,Do.DUMMY,Do.LINKER]),this.toolManager.setMode(this.mode)}destroy(){var t;this.dispose(),this.unbindEvents(),null==(t=this.handler)||t.destroy()}dispose(){this.toolManager.dispose(),this.scenes=[]}bind(t,e){this.view=t,this.handler=e}bindScene(...t){var e;return this.scenes.length=0,this.scenes.push(...t),null==(e=this.handler)||e.bindScene(...t),this.dstScene=this.scenes.find((t=>t.isDynamic)),this.toolManager.bindScene(...t),this.bindEvents(),this}setMode(t){t&&(this.mode=t,this.toolManager.setMode(t),Me.config.editorMode=Lo.PICKER)}clearMode(){this.mode=Lo.DEFAULT,this.toolManager.clearMode(),Me.config.editorMode=Lo.DEFAULT}bindEvents(){var t,e,i,n,s,r,a;this.unbindEvents(),null==(t=this.handler)||t.addEventListener(hc.TAP,this.tapHandler),null==(e=this.handler)||e.addEventListener(hc.PAN_START,this.panStartHandler),null==(i=this.handler)||i.addEventListener(hc.PAN_MOVE,this.panMoveHandler),null==(n=this.handler)||n.addEventListener(hc.PAN_END,this.panEndHandler),null==(s=this.handler)||s.addEventListener(hc.POINTEROVER,this.pointerOverHandler),null==(r=this.handler)||r.addEventListener(hc.POINTEROUT,this.pointerOutHandler),null==(a=this.handler)||a.addEventListener(hc.POINTERMOVE,this.pointerMoveHandler)}unbindEvents(){var t,e,i,n,s,r,a;null==(t=this.handler)||t.removeEventListener(hc.TAP,this.tapHandler),null==(e=this.handler)||e.removeEventListener(hc.PAN_START,this.panStartHandler),null==(i=this.handler)||i.removeEventListener(hc.PAN_MOVE,this.panMoveHandler),null==(n=this.handler)||n.removeEventListener(hc.PAN_END,this.panEndHandler),null==(s=this.handler)||s.removeEventListener(hc.POINTEROVER,this.pointerOverHandler),null==(r=this.handler)||r.removeEventListener(hc.POINTEROUT,this.pointerOutHandler),null==(a=this.handler)||a.removeEventListener(hc.POINTERMOVE,this.pointerMoveHandler)}handleTap(t){this.toolManager.handleTap(t)}handlePanStart(t){this.toolManager.handlePanStart(t)}handlePanMove(t){this.toolManager.handlePanMove(t)}handlePanEnd(t){this.toolManager.handlePanEnd(t)}handlePointerOver(t){this.toolManager.handlePointerOver(t)}handlePointerOut(t){this.toolManager.handlePointerOut(t)}handlePointerMove(t){this.toolManager.handlePointerMove(t)}update(){this.toolManager.update()}setEnablePan(t=!1){this.view&&this.view.setEnablePan&&this.view.setEnablePan(t)}selectEnableChanged(t=!1){t?this.setMode(Lo.PICKER):this.clearMode()}multiSelectEnableChanged(t=!1){t?this.setMode(Lo.PICKER):this.clearMode()}fnEnableChanged(t=!1){var e;null==(e=this.toolManager.get(Do.SELECTOR_RECT))||e.fnEnableChanged(t)}clearSelected(t){var e;this.mode&Do.SELECT||this.setMode(Lo.PICKER),null==(e=this.toolManager.get(Do.SELECT))||e.clearSelected(t)}selectByIds(t,e){var i;this.mode&Do.SELECT||this.setMode(Lo.PICKER),null==(i=this.toolManager.get(Do.SELECT))||i.selectByIds(t,e)}setDynamicFill(t){var e;null==(e=this.toolManager.get(Do.SELECT))||e.setDynamicFill(t)}clearDummies(t){this.mode&Lo.DUMMY||this.setMode(Lo.DUMMY),this.toolManager.clearDummies(t)}setDummies(t){this.mode&Lo.DUMMY||this.setMode(Lo.DUMMY),this.toolManager.setDummies(t)}focusAtDummy(t,e=1e3){this.mode&Lo.DUMMY||this.setMode(Lo.DUMMY),this.toolManager.focusAtDummy(t,e)}highlightDummies(t){this.mode&Lo.DUMMY||this.setMode(Lo.DUMMY),this.toolManager.highlightDummies(t)}resetHighlightDummies(){this.mode&Lo.DUMMY||this.setMode(Lo.DUMMY),this.toolManager.resetHighlightDummies()}getAssetLabels(t,e){var i;if(this.mode===Lo.DUMMY)return null==(i=this.toolManager.get(Do.DUMMY))?void 0:i.getDummyLabels(e)}getAssetBoundingBox(t,e){var i;if(this.mode===Lo.DUMMY)return null==(i=this.toolManager.get(Do.DUMMY))?void 0:i.getDummiesBoundingBox(t,e)}bindEditorDrag(t){var e;if(this.mode===Lo.DUMMY)return null==(e=this.toolManager.get(Do.DUMMY))?void 0:e.bindEditorDrag(t)}setEditorDraggingObject(t){var e,i;if(this.mode===Lo.DUMMY){const n=null==(e=this.toolManager.get(Do.DUMMY))?void 0:e.getDraggingObject(t);null==(i=this.toolManager.get(Do.DRAG))||i.setDraggingObject(n)}}getDummies(t){var e;if(this.mode===Lo.DUMMY)return null==(e=this.toolManager.get(Do.DUMMY))?void 0:e.getDummiesVo(t)}setFillByIds(t,e){var i;this.mode&Do.DISTRIBUTION||this.setMode(Lo.DISTRIBUTION),null==(i=this.toolManager.get(Do.DISTRIBUTION))||i.setFillByIds(t,e)}setStrokeByIds(t,e){var i;this.mode&Do.DISTRIBUTION||this.setMode(Lo.DISTRIBUTION),null==(i=this.toolManager.get(Do.DISTRIBUTION))||i.setStrokeByIds(t,e)}clearFillByIds(t){var e;this.mode&Do.DISTRIBUTION||this.setMode(Lo.DISTRIBUTION),null==(e=this.toolManager.get(Do.DISTRIBUTION))||e.clearFillByIds(t)}clearStrokeByIds(t){var e;this.mode&Do.DISTRIBUTION||this.setMode(Lo.DISTRIBUTION),null==(e=this.toolManager.get(Do.DISTRIBUTION))||e.clearStrokeByIds(t)}clearByIds(t){var e;this.mode&Do.DISTRIBUTION||this.setMode(Lo.DISTRIBUTION),null==(e=this.toolManager.get(Do.DISTRIBUTION))||e.clearByIds(t)}getLegend(){var t;return this.mode&Do.DISTRIBUTION||this.setMode(Lo.DISTRIBUTION),null==(t=this.toolManager.get(Do.DISTRIBUTION))?void 0:t.getLegend()}linkAssetsByTree(t){var e;this.mode!==Lo.LINKER&&this.setMode(Lo.LINKER),null==(e=this.toolManager.get(Do.LINKER))||e.linkAssetsByTree(t)}}class ag extends zi{constructor(){super(),d(this,"name","App2@"+si.now()),d(this,"scenes",[]),d(this,"requestHeader",{}),d(this,"_tic"),d(this,"_url"),d(this,"_layers"),d(this,"_lastCameraVersion",-1/0),d(this,"_runningHandler",this.running.bind(this)),d(this,"_pointerOverHandler",(t=>this.dispatchEvent(t))),d(this,"_pointerOutHandler",(t=>this.dispatchEvent(t))),d(this,"_selectedHandler",(t=>this.dispatchEvent(t))),d(this,"_dragEndHandler",(t=>this.dispatchEvent(t))),this.adapter=new Mp}destroy(){var t,e,i,n,s;this.unbindEvents(),super.destroy(),null==(t=this.composer)||t.destroy(),null==(e=this.mainScene)||e.destroy(),null==(i=this.animateScene)||i.destroy(),null==(n=this.view)||n.destroy(),null==(s=this.renderer)||s.destroy()}init(t={}){var e,i;return this.params=t,this.renderer||(this.renderer=new Op(t)),this.view||(this.view=new Jf(t)),this.composer||(this.composer=new Up(this.renderer,new Fp(t))),this.editor||(this.editor=new rg(this.params.inpEl?this.params.inpEl:this.params.cvs,this.view)),null==(e=this.mainScene)||e.destroy(),this.mainScene=new cm(t,this.adapter),null==(i=this.animateScene)||i.destroy(),this.animateScene=new mm(t),this.trans2LoadingScene(),this.bindEvents(),this}bindEvents(){var t,e,i,n;this.unbindEvents(),null==(t=this.editor)||t.addEventListener(Ri.POINTER_OVER,this._pointerOverHandler),null==(e=this.editor)||e.addEventListener(Ri.POINTER_OUT,this._pointerOutHandler),null==(i=this.editor)||i.addEventListener(Ri.SELECTED,this._selectedHandler),null==(n=this.editor)||n.addEventListener(Ri.DRAG_END,this._dragEndHandler)}unbindEvents(){var t,e,i,n;null==(t=this.editor)||t.removeEventListener(Ri.POINTER_OVER,this._pointerOverHandler),null==(e=this.editor)||e.removeEventListener(Ri.POINTER_OUT,this._pointerOutHandler),null==(i=this.editor)||i.removeEventListener(Ri.SELECTED,this._selectedHandler),null==(n=this.editor)||n.removeEventListener(Ri.DRAG_END,this._dragEndHandler)}get isLoadingScene(){var t;return"LoadingScene"===(null==(t=this.scenes[0])?void 0:t.name)}setRequestHeader(t){return this.requestHeader=t,this}load(t,e,i=2){return p(this,null,(function*(){if(this._tic&&this._tic.clear(),this._url=t,this._layers=e,yield this.trans2LoadingScene(),!t)throw"url not found";const i=yield this.adapter.setRequestHeader(this.requestHeader).load(t,e);return this.adapter.bindScene(this.mainScene).initResources(i,e),yield this.trans2MainScene(),(i||{}).idsTree}))}hasScene(t){return this.scenes.findIndex((e=>e.uuid===t.uuid))>=0}pushScene(t){this.hasScene(t)||(this.view.bindScene(t),this.scenes.push(t))}clearScenes(){this.view.scenes.length=0,this.scenes.forEach((t=>this.removeScene(t))),this.scenes.length=0,this.loadingScene=void 0}removeScene(t){const e=this.scenes.findIndex((e=>e.uuid===t.uuid));e<0||(this.scenes[e].destroy(),this.scenes.splice(e,1))}removeLoadingScene(){this.loadingScene&&(this.removeScene(this.loadingScene),this.loadingScene=void 0)}trans2LoadingScene(){return p(this,null,(function*(){var t;this.clearScenes(),this.loadingScene||(this.loadingScene=new Yf(this.params)),this.pushScene(this.loadingScene),null==(t=this.editor)||t.dispose(),this.view.fullscreen(250);const e=new jp(this.loadingScene,this.view.camera);this.composer.clearPasses(),this.composer.addPass(e),this.mainScene=new cm(this.params,this.adapter)}))}trans2MainScene(){return p(this,null,(function*(){var t,e;this.clearScenes(),this.mainScene||(this.mainScene=new cm(this.params,this.adapter)),this.animateScene||(this.animateScene=new mm(this.params)),null==(t=this.editor)||t.setMode(Lo.DEFAULT),null==(e=this.editor)||e.bindScene(this.mainScene,this.animateScene),this.mainScene.setViewBox(this.adapter.getViewBox()),this.pushScene(this.mainScene),this.view.scene=this.mainScene,this.view.fullscreen(10,!0);const i=new Yp(this.mainScene,this.view.camera,!1,!1),n=new jp(this.animateScene,this.view.camera,!1,!1),s=new Zp;this.composer.clearPasses(),this.params.bgPass&&this.composer.addPass(new nf(this.view.camera)),this.composer.addPass(i),this.composer.addPass(n),this.composer.addPass(s)}))}trans2EmptyScene(){var t;this.clearScenes(),this.emptyScene=new gm(this.params),null==(t=this.editor)||t.dispose(),this.pushScene(this.emptyScene),this.view.scene=this.emptyScene,this.view.fullscreen(250,!0),this.editor&&this.editor.bindScene(this.emptyScene);const e=new jp(this.emptyScene,this.view.camera);this.composer.clearPasses(),this.composer.addPass(e)}debounceCacheChanged(t=!1){this.params.debounceCache=t}wireframeChanged(t=!1){this.params.wireframe=t}sliceDurationChanged(t){this.params.sliceDuration=t}selectEnableChanged(t=!1){return p(this,null,(function*(){var e;yield this.clearSelected(),this.params.selectEnable=t,null==(e=this.editor)||e.selectEnableChanged(t)}))}multiSelectEnableChanged(t=!1){return p(this,null,(function*(){var e;yield this.clearSelected(),this.params.multiSelectEnable=t,null==(e=this.editor)||e.multiSelectEnableChanged(t)}))}assetTypeChanged(t){return p(this,null,(function*(){t&&(this.params.assetType=t,this.setAssetType(t))}))}fnEnableChanged(t){return p(this,null,(function*(){var e;this.params.fnEnable=!!t,null==(e=this.editor)||e.fnEnableChanged(t)}))}zoomToSelectEnableChanged(t){return p(this,null,(function*(){this.params.zoomToSelectEnable=!!t}))}socialDistanceEnableChanged(t){return p(this,null,(function*(){this.params.socialDistanceEnable=!!t}))}enableHoverChanged(t){return p(this,null,(function*(){var e,i;ri.set(this.params,"controls.enableHover",!!t),null==(i=null==(e=this.editor)?void 0:e.handler)||i.enableHover(this.params.controls.enableHover)}))}resize(){var t;let e;this.params.containerId&&(e=Me.window.document.getElementById(this.params.containerId)),e||(e=Me.window.document.getElementsByTagName("body")[0]);const i=null==(t=null==e?void 0:e.parentElement)?void 0:t.getBoundingClientRect();i&&this.setSize(i.width,i.height)}setSize(t,e){var i,n,s;null==(i=this.renderer)||i.setSize(t,e),null==(n=this.view)||n.resize(),null==(s=this.composer)||s.setSize(t,e)}refresh(){this.view.camera.needsUpdate=!0}fullscreen(){this.view.fullscreen(1,!0)}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}zoomIn(){this.view.zoomIn()}zoomOut(){this.view.zoomOut()}fontZoomIn(t=1.1){var e;null==(e=this.mainScene)||e.increaseFontSize(t)}fontZoomOut(t=.9){var e;null==(e=this.mainScene)||e.increaseFontSize(t)}unproject(t){return p(this,null,(function*(){return og.copy(t).unproject(this.view.camera)}))}strokeMore(t=1.1){var e;null==(e=this.mainScene)||e.increaseStrokeWidth(t)}strokeLess(t=.9){var e;null==(e=this.mainScene)||e.increaseStrokeWidth(t)}updateLayersVisibility(t,e=!1){this.adapter.updateLayersVisibility(t,e)}getLayers(t=2){return p(this,null,(function*(){return this.adapter.getLayers(t)}))}focusAtIds(t,e=100){return p(this,null,(function*(){if(!this.mainScene)return;const i=this.adapter.getBoundingBoxByIds(t);return i&&!i.isEmpty()?(i.expandByVector(new Fe(1,1).multiplyScalar(e)),i.isEmpty()||(yield this.view.resetCameraByBoundingBox(i,!0)),i):void 0}))}clearSelected(t){return p(this,null,(function*(){var e;null==(e=this.editor)||e.clearSelected(t)}))}targetByIds(t){return p(this,null,(function*(){var e,i;this.clearSelected(),this.selectByIds(t);let n=null==(e=this.mainScene)?void 0:e.getAssetBoundingBox(t);n||(n=null==(i=this.editor)?void 0:i.getAssetBoundingBox(t)),n&&(n.isEmpty()||(n.getSize(og),n.expandByScalar(Math.round(.5*Math.max(og.x,og.y))),yield this.view.resetCameraByBoundingBox(n,!0)))}))}getAssetIdsByType(t){return p(this,null,(function*(){var e;return null==(e=this.adapter)?void 0:e.getAssetIdsByType(t)}))}setFillByIds(t,e){return p(this,null,(function*(){var i;null==(i=this.editor)||i.setFillByIds(t,e)}))}clearFillByIds(t){return p(this,null,(function*(){var e;null==(e=this.editor)||e.clearFillByIds(t)}))}setStrokeByIds(t,e){return p(this,null,(function*(){var i;null==(i=this.editor)||i.setStrokeByIds(t,e)}))}clearFill(){return p(this,null,(function*(){var t;null==(t=this.editor)||t.clearFillByIds()}))}clearStroke(){return p(this,null,(function*(){var t;null==(t=this.editor)||t.clearStrokeByIds()}))}getLegend(){return p(this,null,(function*(){var t;return null==(t=this.editor)?void 0:t.getLegend()}))}getAssetLabels(t,e){return p(this,null,(function*(){var i,n;return t===Ci?null==(i=this.editor)?void 0:i.getAssetLabels(t,e):null==(n=this.mainScene)?void 0:n.getAssetLabels(t,e)}))}setAssetLabels(t,e){return p(this,null,(function*(){var i;return null==(i=this.mainScene)?void 0:i.setAssetLabels(t,e)}))}clearAssetLabels(t){return p(this,null,(function*(){var e;return null==(e=this.mainScene)?void 0:e.clearAssetLabels(t)}))}selectByIds(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.selectByIds(t,!0)}))}getAssetBoundingBox(t,e){return p(this,null,(function*(){var i,n;let s=null==(i=this.mainScene)?void 0:i.getAssetBoundingBox(t);if(s||(s=null==(n=this.editor)?void 0:n.getAssetBoundingBox(t)),s)return e?s.applyMatrix3(this.view.camera.viewMatrix):s}))}setAssetType(t,e){var i;t&&(this.params.assetType=t,null==(i=this.mainScene)||i.setAssetType(t,e))}linkAssetsByTree(t){var e;null==(e=this.editor)||e.linkAssetsByTree(t)}clearDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.clearDummies(t)}))}setDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setDummies(t)}))}focusAtDummy(t,e=1e3){return p(this,null,(function*(){var i;return null==(i=this.editor)?void 0:i.focusAtDummy(t,e)}))}highlightDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.highlightDummies(t)}))}resetHighlightDummies(){return p(this,null,(function*(){var t;return null==(t=this.editor)?void 0:t.resetHighlightDummies()}))}setEditorMode(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setMode(t)}))}bindEditorDrag(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.bindEditorDrag(t)}))}setEditorDraggingObject(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setEditorDraggingObject(t)}))}getDummies(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.getDummies(t)}))}start(){requestAnimationFrame(this._runningHandler)}running(t){var e,i,n,s,r,a;null==(e=this.view)||e.update(t),null==(i=this.editor)||i.update(),(null==(n=this.scenes)?void 0:n.length)&&this.scenes.forEach((t=>"function"==typeof(null==t?void 0:t.update)?t.update():void 0)),null==(s=this.composer)||s.render(),this._lastCameraVersion=null==(a=null==(r=this.view)?void 0:r.camera)?void 0:a.version,requestAnimationFrame(this._runningHandler)}}const og=new Fe;class hg extends ju{constructor(t,e,i){super(t,e,i),d(this,"hammer"),d(this,"sendEventHandler",this.sendEvent.bind(this)),this.hammer=new Hammer.Manager(t,{domEvents:!0});const n=new Hammer.Pan({threshold:0,pointers:0}),s=new Hammer.Pinch({threshold:0}),r=new Hammer.Tap({event:"singletap",taps:1}),a=new Hammer.Press({});this.hammer.add([n,r,a,s]),s.recognizeWith(n),this.hammer.on(["panstart","panmove","panend"].join(" "),(t=>function(t,e){t.preventDefault();e({type:t.type,center:t.center,isFirst:t.isFirst,pointers:JSON.parse(JSON.stringify(t.pointers))})}(t,this.sendEventHandler))),this.hammer.on(["pinchstart","pinchmove","pinchend"].join(" "),(t=>function(t,e){t.preventDefault();e({type:t.type,center:t.center,isFirst:t.isFirst,pointers:JSON.parse(JSON.stringify(t.pointers)),isFinal:t.isFinal,scale:t.scale})}(t,this.sendEventHandler))),this.hammer.on("singletap",(t=>function(t,e){t.preventDefault();e({type:t.type,center:t.center})}(t,this.sendEventHandler))),this.hammer.on("press",(t=>function(t,e){t.preventDefault();e({type:t.type,center:t.center})}(t,this.sendEventHandler))),this.hammer.on("hammer.input",(t=>function(t,e){t.preventDefault(),e({type:t.type,isFirst:t.isFirst,isFinal:t.isFinal})}(t,this.sendEventHandler)))}destroy(){var t;null==(t=this.hammer)||t.stop(!0),this.hammer.destroy()}sendEvent(t){this.worker&&this.worker.postMessage({type:"event",id:this.id,data:t}),$u.instance().handleEvent({id:this.id,data:t})}}const lg=new Fe,ug=new Map;t.APP_ENUM=Ri,t.ASSET_TYPE_DUMMY=Ci,t.App2=ag,t.App2Offscreen=class extends ag{constructor(t={},e){var i;super(),d(this,"name","App2Offscreen@"+si.now()),d(this,"cvs"),d(this,"worker"),d(this,"container"),d(this,"offset",new Fe),d(this,"label"),d(this,"proxy"),d(this,"resizeHandler",ri.debounce(this.resize.bind(this),100)),d(this,"messageHandler",this.handleMessage.bind(this)),d(this,"focusHandler",(t=>this.cvs.focus())),this.params=t,this.params.dpr=1,this.worker=e,this.container=document.getElementById(null==(i=this.params)?void 0:i.containerId),this.container||(this.container=Me.window.document.getElementsByTagName("body")[0]);let n=this.container.getBoundingClientRect();this.offset.set(n.left,n.top),this.label=new eo(this.container,""),this.params.cvs?(this.cvs=this.params.cvs,delete this.params.cvs):this.cvs=An.createCanvas(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}bindEvents(){this.unbindEvents(),window.addEventListener("resize",this.resizeHandler),this.cvs.tabIndex=0,this.cvs.focus(),this.cvs.addEventListener("click",this.focusHandler)}unbindEvents(){window.removeEventListener("resize",this.resizeHandler),this.cvs.removeEventListener("click",this.focusHandler)}resize(){return p(this,null,(function*(){var t;let e;this.params.containerId&&(e=window.document.getElementById(this.params.containerId)),e||(e=window.document.getElementsByTagName("body")[0]);const i=null==(t=null==e?void 0:e.parentElement)?void 0:t.getBoundingClientRect();if(i&&this.cvs)return An.resizeCanvas(this.cvs,i.width,i.height,this.params.dpr),this.postAsync({type:Ri.SET_SIZE,w:i.width,h:i.height})}))}start(){"function"==typeof this.cvs.transferControlToOffscreen?(this.workerStart(this.cvs),this.worker.addEventListener("message",this.messageHandler)):this.init(this.params).start()}handleMessage(t){switch(t.data.type){case Ri.POINTER_OVER:case Ri.POINTER_OUT:case Ri.SELECTED:case Ri.DRAG_END:this.dispatchEvent(t.data);break;case Ri.SET_CURSOR:this.cvs.style.cursor=t.data.cursorStyle}}workerStart(t){this.cvs.focus();const e=this.cvs.transferControlToOffscreen();this.proxy=new hg(this.cvs,ic,this.worker);const i=ri.cloneDeep(this.params);delete i.cvs,this.worker.postMessage({type:"start",canvas:e,proxyId:this.proxy.id,conf:i},[e])}postAsync(t){return new Promise(((e,i)=>{const n=i=>{var r;(null==(r=null==i?void 0:i.data)?void 0:r.type)===(null==t?void 0:t.type)&&(this.worker.removeEventListener("message",n),this.worker.removeEventListener("error",s),e(i.data.data))},s=t=>{this.worker.removeEventListener("message",n),this.worker.removeEventListener("error",s),i(t.error)};this.worker.addEventListener("message",n),this.worker.addEventListener("error",s),this.worker.postMessage(t)}))}debounceCacheChanged(t=!1){this.worker.postMessage({type:Ri.DEBOUNCE_CACHE_CHANGED,v:t})}wireframeChanged(t=!1){this.worker.postMessage({type:Ri.WIREFRAME_CHANGED,v:t})}sliceDurationChanged(t=0){this.worker.postMessage({type:Ri.SLICE_DURATION_CHANGED,v:t})}selectEnableChanged(t=!1){return p(this,null,(function*(){this.worker.postMessage({type:Ri.SELECT_ENABLE_CHANGED,v:t})}))}multiSelectEnableChanged(t=!1){return p(this,null,(function*(){this.worker.postMessage({type:Ri.MULTI_SELECT_ENABLE_CHANGED,v:t})}))}assetTypeChanged(t){return p(this,null,(function*(){this.worker.postMessage({type:Ri.ASSET_TYPE_CHANGED,v:t})}))}fnEnableChanged(t){return p(this,null,(function*(){this.worker.postMessage({type:Ri.FN_ENABLE_CHANGED,v:t})}))}zoomToSelectEnableChanged(t){return p(this,null,(function*(){this.worker.postMessage({type:Ri.ZOOM_TO_SELECT_ENABLE_CHANGED,v:t})}))}socialDistanceEnableChanged(t){return p(this,null,(function*(){this.worker.postMessage({type:Ri.SOCIAL_DISTANCE_ENABLE_CHANGED,v:t})}))}enableHoverChanged(t){return p(this,null,(function*(){this.worker.postMessage({type:Ri.ENABLE_HOVER_CHANGED,v:t})}))}refresh(){this.postAsync({type:Ri.REFRESH})}fullscreen(){return p(this,null,(function*(){yield this.postAsync({type:Ri.FULLSCREEN})}))}saveCameraPosition(t){return p(this,null,(function*(){const e=yield this.postAsync({type:Ri.GET_CAMERA_POSITION}),i=t?Qf+t:Qf;sessionStorage.setItem(i,JSON.stringify(e))}))}restoreCameraPosition(t){return p(this,null,(function*(){const e=t?Qf+t:Qf,i=sessionStorage.getItem(e);if(!i)return this.fullscreen();const n=JSON.parse(i||"{}");yield this.postAsync({type:Ri.SET_CAMERA_POSITION,data:n})}))}clearCameraPosition(t){return p(this,null,(function*(){const e=t?Qf+t:Qf;sessionStorage.setItem(e,"")}))}zoomIn(){return p(this,null,(function*(){this.postAsync({type:Ri.ZOOM_IN})}))}zoomOut(){return p(this,null,(function*(){this.postAsync({type:Ri.ZOOM_OUT})}))}fontZoomIn(t=1.1){return p(this,null,(function*(){this.postAsync({type:Ri.FONT_ZOOM_IN,v:t})}))}fontZoomOut(t=.9){return p(this,null,(function*(){this.postAsync({type:Ri.FONT_ZOOM_OUT,v:t})}))}unproject(t){return p(this,null,(function*(){return this.postAsync({type:Ri.UNPROJECT,v:t})}))}load(t,e,i=2){return p(this,null,(function*(){return this.postAsync({type:Ri.LOAD,url:t,layers:e,lv:i})}))}strokeMore(t=1.1){return p(this,null,(function*(){this.postAsync({type:Ri.STROKE_MORE,v:t})}))}strokeLess(t=.9){return p(this,null,(function*(){this.postAsync({type:Ri.STROKE_LESS,v:t})}))}updateLayersVisibility(t,e=!1){return p(this,null,(function*(){this.postAsync({type:Ri.UPDATE_LAYERS_VISIBILITY,ids:t,visible:e})}))}getLayers(t=2){return p(this,null,(function*(){return this.postAsync({type:Ri.GET_LAYERS,lv:t})}))}focusAtIds(t,e=100){return p(this,null,(function*(){return this.postAsync({type:Ri.FOCUS_AT_IDS,ids:t,padding:e})}))}clearSelected(t){return p(this,null,(function*(){return this.postAsync({type:Ri.CLEAR_SELECTED,ids:t})}))}targetByIds(t){return p(this,null,(function*(){return this.postAsync({type:Ri.TARGET_BY_IDS,ids:t})}))}getAssetIdsByType(t){return p(this,null,(function*(){return this.postAsync({type:Ri.GET_ASSET_IDS_BY_TYPE,assetType:t})}))}setFillByIds(t,e){return p(this,null,(function*(){return this.postAsync({type:Ri.SET_FILL_BY_IDS,ids:t,c:e})}))}clearFillByIds(t){return p(this,null,(function*(){return this.postAsync({type:Ri.CLEAR_FILL_BY_IDS,ids:t})}))}setStrokeByIds(t,e){return p(this,null,(function*(){return this.postAsync({type:Ri.SET_STROKE_BY_IDS,ids:t,c:e})}))}clearFill(){return p(this,null,(function*(){return this.postAsync({type:Ri.CLEAR_FILL})}))}clearStroke(){return p(this,null,(function*(){return this.postAsync({type:Ri.CLEAR_STROKE})}))}getLegend(){return p(this,null,(function*(){return this.postAsync({type:Ri.GET_LEGEND})}))}getAssetLabelById(t,e){return p(this,null,(function*(){return this.postAsync({type:Ri.GET_ASSET_LABELS,assetType:t,id:e})}))}setAssetLabels(t,e){return p(this,null,(function*(){return this.postAsync({type:Ri.SET_ASSET_LABELS,id:t,labels:e})}))}clearAssetLabels(t){return p(this,null,(function*(){return this.postAsync({type:Ri.CLEAR_ASSET_LABELS,assetType:t})}))}selectByIds(t){return p(this,null,(function*(){return this.postAsync({type:Ri.SELECT_BY_IDS,ids:t})}))}getAssetBoundingBox(t,e=!1){return p(this,null,(function*(){return this.postAsync({type:Ri.GET_ASSET_BOUNDING_BOX,id:t,isViewCoords:e})}))}showAssetsLabel(t,e,i){return p(this,null,(function*(){var n,s;if(!e)return;const r=yield this.getAssetLabelById(t,e);if(r&&(i=r.join("<br/>")+(i?"<br/>"+i:"")),!i)return;null==(n=this.label)||n.setHtml(i);const a=yield this.getAssetBoundingBox(e,!0);a&&(lg.copy(a.min).add(this.offset).round(),null==(s=this.label)||s.show(lg))}))}hideAssetsLabel(){return p(this,null,(function*(){var t;return null==(t=this.label)?void 0:t.hide()}))}setAssetType(t,e){return p(this,null,(function*(){return this.postAsync({type:Ri.SET_ASSET_TYPE,assetType:t,showLayers:e})}))}linkAssetsByTree(t){return p(this,null,(function*(){return this.postAsync({type:Ri.LINK_ASSETS_BY_TREE,o:t})}))}clearDummies(t){return p(this,null,(function*(){return this.postAsync({type:Ri.CLEAR_DUMMIES,aeTypes:t})}))}setDummies(t){return p(this,null,(function*(){return this.postAsync({type:Ri.SET_DUMMIES,dummies:t})}))}focusAtDummy(t,e=1e3){return p(this,null,(function*(){return this.postAsync({type:Ri.FOCUS_AT_DUMMY,id:t,padding:e})}))}highlightDummies(t){return p(this,null,(function*(){return this.postAsync({type:Ri.HIGHLIGHT_DUMMIES,ids:t})}))}resetHighlightDummies(){return p(this,null,(function*(){return this.postAsync({type:Ri.RESET_HIGHLIGHT_DUMMIES})}))}setEditorMode(t){return p(this,null,(function*(){return this.postAsync({type:Ri.SET_EDITOR_MODE,mode:t})}))}bindEditorDrag(t){return p(this,null,(function*(){return this.postAsync({type:Ri.BIND_EDITOR_DRAG,vo:t})}))}setEditorDraggingObject(t){return p(this,null,(function*(){return this.postAsync({type:Ri.SET_EDITOR_DRAGGING_OBJECT,vo:t})}))}handleExternalEvent(t){return p(this,null,(function*(){var e;this.postAsync({type:"event",id:null==(e=this.proxy)?void 0:e.id,data:t})}))}drag(t,e){return p(this,null,(function*(){const i=this,n=function(t){i.bindEditorDrag(e),i.setEditorDraggingObject(e);const n={type:t.type,center:t.center,isFirst:t.isFirst,pointers:JSON.parse(JSON.stringify(t.pointers))};i.handleExternalEvent(n)};if(!ug.has(t)){const e=new Hammer.Manager(t,{domEvents:!0});e.add(new Hammer.Pan({threshold:0,pointers:0})),e.on(["panstart","panmove","panend"].join(" "),n),ug.set(t,e)}}))}drop(t){return p(this,null,(function*(){var e;ug.has(t)&&(null==(e=ug.get(t))||e.destroy(),ug.delete(t))}))}getDummies(t){return p(this,null,(function*(){return this.postAsync({type:Ri.GET_DUMMIES,hasBound:t})}))}},t.AppEnum=id,t.AssetTypeEnum=Ti,t.Box2=ai,t.Color=Re,t.ColorsEnum=Le,t.EnvironmentWorker=function(t){return new Worker("/environment.worker.js",{type:"module",name:null==t?void 0:t.name})},t.GLOB=Me,t.Label=eo,t.LayerTypeEnum=Ii,t.Monitor=yi,t.Renderer2Worker=function(t){return new Worker("/renderer2.worker.js",{type:"module",name:null==t?void 0:t.name})},t.Renderer3Worker=function(t){return new Worker("/renderer3.worker.js",{type:"module",name:null==t?void 0:t.name})},t.SvgApp=class extends zi{constructor(t={}){super(),d(this,"name","SvgApp"),d(this,"params"),d(this,"renderer"),d(this,"view"),d(this,"scene"),d(this,"loadingScene"),d(this,"emptyScene"),d(this,"mainScene"),d(this,"zoomToSelectEnable",!1),d(this,"zoomBox",new ai),d(this,"selectEnable",!1),d(this,"multiSelectEnable",!1),d(this,"fnEnable",!1),d(this,"requestHeader",{}),d(this,"runningHandler",this.running.bind(this)),d(this,"pointerOverHandler",this.handlePointerOver.bind(this)),d(this,"pointerLeaveHandler",this.handlePointerLeave.bind(this)),d(this,"multiSelectorSelectedHandler",this.handleMultiSelectorSelected.bind(this)),d(this,"dragEndHandler",this.handleDragEnd.bind(this)),this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.defaultFill||(this.params.defaultFill=Re.getMoreTransparent(Le.white,.3)),this.params.defaultStroke||(this.params.defaultStroke=Re.getMoreTransparent(Le.darkWhite,.8)),this.params.infoFill||(this.params.infoFill=Re.getMoreTransparent(Le.gray,.3)),this.params.infoStroke||(this.params.infoStroke=Re.getMoreTransparent(Le.darkGray,.8)),this.params.primaryFill||(this.params.primaryFill=Re.getMoreTransparent(Le.blue,.3)),this.params.primaryStroke||(this.params.primaryStroke=Re.getMoreTransparent(Le.darkBlue,.8)),this.params.successFill||(this.params.successFill=Re.getMoreTransparent(Le.green,.3)),this.params.successStroke||(this.params.successStroke=Re.getMoreTransparent(Le.darkGreen,.8)),this.params.warningFill||(this.params.warningFill=Re.getMoreTransparent(Le.yellow,.3)),this.params.warningStroke||(this.params.warningStroke=Re.getMoreTransparent(Le.darkYellow,.8)),this.params.dangerFill||(this.params.dangerFill=Re.getMoreTransparent(Le.red,.3)),this.params.dangerStroke||(this.params.dangerStroke=Re.getMoreTransparent(Le.darkRed,.8)),this.params.activeFill||(this.params.activeFill=Re.getMoreTransparent(Le.brown,.3)),this.params.activeStroke||(this.params.activeStroke=Re.getMoreTransparent(Le.darkBrown,.8)),this.renderer=new Zn(t),this.view=new So(t),this.editor=new td(this.view),this.trans2LoadingScene()}get isLoadingScene(){var t;return"SvgLoadingScene"===(null==(t=this.scene)?void 0:t.name)}destroy(){var t,e;this.unbindEvents(),this.unbindAssetsEvents(),super.destroy(),null==(t=this.view)||t.destroy(),null==(e=this.renderer)||e.destroy()}bindEvents(){this.unbindEvents()}unbindEvents(){}resize(){var t,e;null==(t=this.renderer)||t.resize(),null==(e=this.view)||e.resize()}isScene(t){var e;return(null==(e=this.scene)?void 0:e.uuid)===t.uuid}removeScene(t){this.scene=void 0,null==t||t.destroy()}trans2MainScene(){var t,e,i,n;null==(t=this.scene)||t.unmount(),this.scene=this.mainScene,this.scene.isMounted||this.scene.mount(),this.view.bindScene(this.scene),null==(e=this.editor)||e.setMode(Lo.DEFAULT),null==(i=this.editor)||i.bindScene(this.scene),null==(n=this.loadingScene)||n.destroy()}trans2LoadingScene(){var t,e,i;null==(t=this.editor)||t.dispose(),this.loadingScene=new Ls(this.params),null==(e=this.scene)||e.unmount(),this.scene=this.loadingScene,this.scene.isMounted||this.scene.mount();const n=(new ai).copy(this.loadingScene.viewBox).expandByVector(new Fe(1,1).multiplyScalar(150));this.view.setByBox(n,!1),null==(i=this.mainScene)||i.destroy()}trans2EmptyScene(){var t,e,i;null==(t=this.editor)||t.dispose(),this.emptyScene=new Io(this.params),null==(e=this.scene)||e.unmount(),this.scene=this.emptyScene,this.scene.isMounted||this.scene.mount();const n=(new ai).copy(this.emptyScene.viewBox).expandByVector(new Fe(1,1).multiplyScalar(150));this.view.setByBox(n,!1),null==(i=this.mainScene)||i.destroy()}start(){requestAnimationFrame(this.runningHandler)}running(t){this.scene&&(this.scene.update(),this.renderer.render(this.scene,this.view.camera),this.view.update(t),requestAnimationFrame(this.runningHandler))}setRequestHeader(t){return this.requestHeader=t,this}load(t,e,i=2,n){return p(this,null,(function*(){this.isLoadingScene||this.trans2LoadingScene(),yield Ai(this.params.syncDelay);const n=yield(new ws).setRequestHeader(this.requestHeader).loadAsync(t).catch((()=>{this.trans2EmptyScene()}));return this.loadByString(n,e,i)}))}loadByString(t,e,i=2){return p(this,null,(function*(){if(this.mainScene=new Ds(this.params),!this.mainScene.bind(t))return this.trans2EmptyScene(),[];this.view.setByBox(this.mainScene.viewBox);const n=this.mainScene.getLayers(i);return(null==e?void 0:e.length)||(e=ri.map(n,"label")),this.mainScene.showDefaultLayers(e,!0),this.trans2MainScene(),this.bindAssetsEvents(),n}))}recompute(t){var e;null==(e=this.scene)||e.recompute(t),this.fullscreen()}setSkeletons(t){var e;null==(e=this.scene)||e.setSkeletonLayers(t)}getLayers(t=2){var e;return null==(e=this.scene)?void 0:e.getLayers(t)}getLayerVisible(t){var e;return null==(e=this.scene)?void 0:e.getLayerVisible(t)}updateLayersVisibility(t,e=!1,i=!0){var n;null==(n=this.scene)||n.updateLayersVisibility(t,e,i)}selectByIds(t){var e;null==(e=this.scene)||e.selectByIds(t,this.multiSelectEnable)}clearSelectedByIds(t){var e;Array.isArray(t)?t.forEach((t=>{var e;return null==(e=this.scene)?void 0:e.clearSelectedById(t)})):null==(e=this.scene)||e.clearSelectedById(t)}clearSelected(){var t;null==(t=this.scene)||t.clearSelected()}getSelectedIds(){var t;return null==(t=this.scene)?void 0:t.getSelectedIds()}targetByIds(t,e=100){return p(this,null,(function*(){var i;this.scene&&(null==(i=this.scene)||i.selectByIds(t,!1),ed.copy(this.scene.getSelectedBoundingBox()).expandByVector(new Fe(1,1).multiplyScalar(e)),yield Ai(100),ed.isEmpty()||(yield this.view.setByBox(ed)))}))}linkAssetsByTree(t){var e;null==(e=this.scene)||e.linkAssetsByTree(t)}setViewAreaLimit(t){this.renderer.viewAreaLimit=t}setAssetType(t,e){var i;null==(i=this.scene)||i.setAssetType(t,e)}getAssetIdsByType(t){var e;return null==(e=this.scene)?void 0:e.getAssetIdsByType(t)}clearFill(){var t;null==(t=this.scene)||t.clearFillOrStroke("fill")}clearFillByIds(t){var e;null==(e=this.scene)||e.clearFillOrStrokeByIds(t,"fill")}setFillByIds(t,e){var i;null==(i=this.scene)||i.setFillOrStrokeByIds(t,e,"fill")}clearStroke(){var t;null==(t=this.scene)||t.clearFillOrStroke("stroke")}clearStrokeByIds(t){var e;null==(e=this.scene)||e.clearFillOrStrokeByIds(t,"stroke")}setStrokeByIds(t,e,i){var n;null==(n=this.scene)||n.setFillOrStrokeByIds(t,e,"stroke",i)}getLegend(){var t;return null==(t=this.scene)?void 0:t.getLegend()}setAssetLabels(t,e){var i;null==(i=this.scene)||i.setAssetLabels(t,e)}clearAssetLabels(){var t;null==(t=this.scene)||t.clearAssetLabels()}fullscreen(){this.view.fullscreen()}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}zoomIn(){this.view.zoomIn()}zoomOut(){this.view.zoomOut()}focusAt(t,e=1e3){var i;null==(i=this.view)||i.focusAt(t,e)}focusAtIds(t,e=100){return p(this,null,(function*(){if(!this.scene)return;const i=this.scene.getBoundingBoxByIds(t);i&&(i.expandByVector(new Fe(1,1).multiplyScalar(e)),yield Ai(100),i.isEmpty()||(yield this.view.setByBox(i)))}))}focusAtById(t,e=1e3){return p(this,null,(function*(){var i;return null==(i=this.view)?void 0:i.focusAtById(t,e)}))}focusAtDummy(t,e=1e3){return p(this,null,(function*(){var i;return null==(i=this.view)?void 0:i.focusAtDummy(t,e)}))}showAssetsLabel(t,e,i){var n,s,r,a;e?"dummy"===t?null==(r=null==(s=null==(n=this.view)?void 0:n.dummiesController)?void 0:s.dummies)||r.showDummyLabel(e):null==(a=this.view)||a.showAssetsLabel(t,e,i):this.hideAssetsLabel()}hideAssetsLabel(){var t,e,i,n;null==(i=null==(e=null==(t=this.view)?void 0:t.dummiesController)?void 0:e.dummies)||i.hideDummyLabel(),null==(n=this.view)||n.hideAssetsLabel()}highlightAssets(t,e){var i;null==(i=this.scene)||i.highlightAssets(t,e)}resetHighlightAssets(t){var e;null==(e=this.scene)||e.resetHighlightAssets(t)}fontZoomIn(){var t;null==(t=this.scene)||t.chef.fontZoom("asset-labels",1.1)}fontZoomOut(){var t;null==(t=this.scene)||t.chef.fontZoom("asset-labels",.9)}strokeMore(){var t;null==(t=this.scene)||t.chef.strokeWidthChanged(1.1)}strokeLess(){var t;null==(t=this.scene)||t.chef.strokeWidthChanged(.9)}zoomToSelectEnableChanged(t){this.view.zoomToSelectEnableChanged(t)}selectEnableChanged(t){this.selectEnable=!!t,this.view.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.view.multiSelectEnableChanged(t)}socialDistanceEnableChanged(t){var e;null==(e=this.scene)||e.socialDistanceEnableChanged(t)}fnEnableChanged(t){var e;this.fnEnable=!!t,this.view.fnEnableChanged(t),null==(e=this.editor)||e.fnEnableChanged(t)}getBoundingBoxById(t,e=!0){var i;if(!t)return;const n=null==(i=this.scene)?void 0:i.getBoundingBoxById(t);return n&&e&&n.applyMatrix3(this.view.camera.viewMatrix).round(),n}setDummies(t){var e;null==(e=this.view)||e.setDummies(t)}clearDummies(t){var e;null==(e=this.view)||e.clearDummies(t)}highlightDummies(t){var e,i;null==(i=null==(e=this.view)?void 0:e.dummiesController)||i.highlightDummies(t)}resetHighlightDummies(){var t,e;null==(e=null==(t=this.view)?void 0:t.dummiesController)||e.resetHighlightDummies()}bindAssetsEvents(){var t,e;this.view.addEventListener(To.POINTEROVER,this.pointerOverHandler),this.view.addEventListener(To.POINTERLEAVE,this.pointerLeaveHandler),this.view.addEventListener(To.SELECTED,this.multiSelectorSelectedHandler),null==(e=null==(t=this.view)?void 0:t.dummiesController)||e.addEventListener("panend",this.dragEndHandler)}unbindAssetsEvents(){var t,e;this.view.removeEventListener(To.POINTEROVER,this.pointerOverHandler),this.view.removeEventListener(To.POINTERLEAVE,this.pointerLeaveHandler),this.view.removeEventListener(To.SELECTED,this.multiSelectorSelectedHandler),null==(e=null==(t=this.view)?void 0:t.dummiesController)||e.removeEventListener("panend",this.dragEndHandler)}handleMultiSelectorSelected(t){this.dispatchEvent({type:"SELECTED",data:t.data})}handlePointerOver(t){this.dispatchEvent({type:"pointerover",data:t.data,e:t.e})}handlePointerLeave(t){this.dispatchEvent({type:"pointerleave",data:t.data,e:t.e})}handleInitializeStart(){}handleInitializeComplete(t){return p(this,null,(function*(){(null==t?void 0:t.data)&&this.launch()}))}handleDragEnd(t){this.dispatchEvent(t)}launch(){}drag(t,e){return p(this,null,(function*(){var i;null==(i=this.editor)||i.drag(t,e)}))}setEditorMode(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.setMode(t)}))}editorFillChanged(t){return p(this,null,(function*(){var e;this.params.editor.fill=t,null==(e=this.editor)||e.editorFillChanged(t)}))}editorStrokeChanged(t){return p(this,null,(function*(){var e;this.params.editor.stroke=t,null==(e=this.editor)||e.editorStrokeChanged(t)}))}editorStrokeWidthChanged(t){return p(this,null,(function*(){var e;this.params.editor.strokeWidth=t,null==(e=this.editor)||e.editorStrokeWidthChanged(t)}))}editorStrokeDasharrayChanged(t){return p(this,null,(function*(){var e;null==(e=this.editor)||e.editorStrokeDasharrayChanged(t)}))}editorStrokeArrowChanged(t){return p(this,null,(function*(){var e;null==(e=this.editor)||e.editorStrokeArrowChanged(t)}))}editorFontSizeChanged(t){return p(this,null,(function*(){var e;this.params.editor.fontSize=t,null==(e=this.editor)||e.editorFontSizeChanged(t)}))}editorTextContentChanged(t){return p(this,null,(function*(){var e;null==(e=this.editor)||e.editorTextContentChanged(t)}))}editorDeleteCurrentShape(){return p(this,null,(function*(){var t;null==(t=this.editor)||t.editorDeleteCurrentShape()}))}getEditorCurrentShapes(){return p(this,null,(function*(){var t;return null==(t=this.editor)?void 0:t.getEditorCurrentShapes()}))}editorInitShapes(t){return p(this,null,(function*(){var e;return null==(e=this.editor)?void 0:e.editorInitShapes(t)}))}},t.Vector2=Fe,t.assetTypeConflicts=Oi,t.defaultConfig=w,t.getAssetLabelByType=Ni,t.getAssetLayerByType=ki,t.getIdsByTree=Mi,t.getRandomString=function(t=8){let e=[];for(let i=0;i<t;i++)e.push(String.fromCharCode(97+Math.round(25*Math.random())));return e.join("")},t.polyfillHammerProxy=function(t){const e=document.getElementById(t.canvasId);if(!e)throw new Error(`Canvas element with id ${t.canvasId} not found`);const i=new hg(e,ic),n=$u.instance().getProxy(i.id);return n.ownerDocument=n,t.inpEl=n,t},t.randomDelay=Ai,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));//# sourceMappingURL=index.umd.js.map