@visactor/vrender-core 0.18.0-alpha.0 → 0.18.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/common/canvas-utils.js +2 -2
- package/cjs/common/canvas-utils.js.map +1 -1
- package/cjs/common/color-utils.d.ts +9 -0
- package/cjs/common/color-utils.js +231 -0
- package/cjs/common/color-utils.js.map +1 -0
- package/cjs/common/rect-utils.d.ts +7 -0
- package/cjs/common/rect-utils.js +27 -0
- package/cjs/common/rect-utils.js.map +1 -0
- package/cjs/common/render-area.js +3 -15
- package/cjs/common/render-area.js.map +1 -1
- package/cjs/common/render-curve.js +4 -16
- package/cjs/common/render-curve.js.map +1 -1
- package/cjs/common/render-utils.d.ts +10 -0
- package/cjs/common/render-utils.js +22 -0
- package/cjs/common/render-utils.js.map +1 -0
- package/cjs/common/segment/basis.js +2 -3
- package/cjs/common/segment/basis.js.map +1 -1
- package/cjs/common/segment/common.d.ts +4 -1
- package/cjs/common/segment/common.js +13 -3
- package/cjs/common/segment/common.js.map +1 -1
- package/cjs/common/segment/linear-closed.d.ts +2 -16
- package/cjs/common/segment/linear-closed.js +3 -34
- package/cjs/common/segment/linear-closed.js.map +1 -1
- package/cjs/common/segment/linear.d.ts +1 -1
- package/cjs/common/segment/linear.js +2 -3
- package/cjs/common/segment/linear.js.map +1 -1
- package/cjs/common/segment/monotone.d.ts +2 -2
- package/cjs/common/segment/monotone.js +10 -12
- package/cjs/common/segment/monotone.js.map +1 -1
- package/cjs/common/sort.js +2 -1
- package/cjs/common/split-path.js +2 -2
- package/cjs/common/split-path.js.map +1 -1
- package/cjs/core/application.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/stage.d.ts +2 -1
- package/cjs/core/stage.js +12 -5
- package/cjs/core/stage.js.map +1 -1
- package/cjs/env-check.js +17 -17
- package/cjs/env-check.js.map +1 -1
- package/cjs/event/event-system.js +3 -3
- package/cjs/event/event-system.js.map +1 -1
- package/cjs/graphic/arc.js +1 -1
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/arc3d.js +1 -1
- package/cjs/graphic/arc3d.js.map +1 -1
- package/cjs/graphic/area.js +1 -1
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/bounds.d.ts +2 -2
- package/cjs/graphic/bounds.js +1 -1
- package/cjs/graphic/bounds.js.map +1 -1
- package/cjs/graphic/circle.js +1 -1
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.js +5 -1
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/glyph.js +1 -1
- package/cjs/graphic/glyph.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-service.js +13 -11
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +1 -0
- package/cjs/graphic/graphic.js +8 -6
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +1 -1
- package/cjs/graphic/group.js +3 -3
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/image.d.ts +3 -1
- package/cjs/graphic/image.js +7 -1
- package/cjs/graphic/image.js.map +1 -1
- package/cjs/graphic/line.js +1 -1
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/node-tree.d.ts +1 -1
- package/cjs/graphic/node-tree.js +6 -2
- package/cjs/graphic/node-tree.js.map +1 -1
- package/cjs/graphic/path.js +1 -1
- package/cjs/graphic/path.js.map +1 -1
- package/cjs/graphic/polygon.js +1 -1
- package/cjs/graphic/polygon.js.map +1 -1
- package/cjs/graphic/pyramid3d.js +1 -1
- package/cjs/graphic/pyramid3d.js.map +1 -1
- package/cjs/graphic/rect.js +4 -7
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/richtext/frame.d.ts +2 -2
- package/cjs/graphic/richtext/frame.js +1 -12
- package/cjs/graphic/richtext/frame.js.map +1 -1
- package/cjs/graphic/richtext/line.js +1 -12
- package/cjs/graphic/richtext/line.js.map +1 -1
- package/cjs/graphic/richtext/paragraph.js +2 -2
- package/cjs/graphic/richtext/paragraph.js.map +1 -1
- package/cjs/graphic/richtext.d.ts +45 -2
- package/cjs/graphic/richtext.js +22 -7
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/symbol.js +1 -1
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.js +4 -4
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/theme.js +1 -1
- package/cjs/graphic/theme.js.map +1 -1
- package/cjs/interface/event.d.ts +2 -0
- package/cjs/interface/event.js.map +1 -1
- package/cjs/interface/graphic/richText.d.ts +2 -2
- package/cjs/interface/graphic/richText.js.map +1 -1
- package/cjs/interface/graphic/symbol.d.ts +1 -1
- package/cjs/interface/graphic/symbol.js.map +1 -1
- package/cjs/interface/graphic.d.ts +17 -3
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/node-tree.d.ts +1 -1
- package/cjs/interface/node-tree.js.map +1 -1
- package/cjs/interface/picker.d.ts +1 -0
- package/cjs/interface/picker.js.map +1 -1
- package/cjs/interface/render.d.ts +1 -0
- package/cjs/interface/render.js.map +1 -1
- package/cjs/interface/stage.d.ts +7 -1
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/modules.d.ts +3 -0
- package/cjs/modules.js +9 -10
- package/cjs/modules.js.map +1 -1
- package/cjs/picker/picker-service.js +8 -3
- package/cjs/picker/picker-service.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +14 -3
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +126 -65
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +28 -25
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +9 -7
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/arc-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/area-contribution-render.d.ts +1 -9
- package/cjs/render/contributions/render/contributions/area-contribution-render.js +3 -55
- package/cjs/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/area-texture-contribution-render.d.ts +9 -0
- package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js +26 -0
- package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js.map +1 -0
- package/cjs/render/contributions/render/contributions/base-contribution-render.d.ts +2 -20
- package/cjs/render/contributions/render/contributions/base-contribution-render.js +25 -125
- package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.d.ts +21 -0
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +128 -0
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -0
- package/cjs/render/contributions/render/contributions/circle-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/group-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.js +3 -2
- package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/index.d.ts +2 -0
- package/cjs/render/contributions/render/contributions/index.js +2 -1
- package/cjs/render/contributions/render/contributions/index.js.map +1 -1
- package/cjs/render/contributions/render/contributions/path-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/path-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/polygon-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/polygon-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/rect-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/text-contribution-render.js +23 -8
- package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.js +11 -5
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/image-render.js +4 -2
- package/cjs/render/contributions/render/image-render.js.map +1 -1
- package/cjs/render/contributions/render/incremental-draw-contribution.d.ts +0 -1
- package/cjs/render/contributions/render/incremental-draw-contribution.js +19 -15
- package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/index.d.ts +1 -0
- package/cjs/render/contributions/render/index.js +2 -1
- package/cjs/render/contributions/render/index.js.map +1 -1
- package/cjs/render/contributions/render/utils.d.ts +1 -1
- package/cjs/render/contributions/render/utils.js.map +1 -1
- package/cjs/resource-loader/loader.d.ts +5 -0
- package/cjs/resource-loader/loader.js +56 -15
- package/cjs/resource-loader/loader.js.map +1 -1
- package/es/common/canvas-utils.js +3 -1
- package/es/common/canvas-utils.js.map +1 -1
- package/es/common/color-utils.d.ts +9 -0
- package/es/common/color-utils.js +224 -0
- package/es/common/color-utils.js.map +1 -0
- package/es/common/rect-utils.d.ts +7 -0
- package/es/common/rect-utils.js +20 -0
- package/es/common/rect-utils.js.map +1 -0
- package/es/common/render-area.js +2 -12
- package/es/common/render-area.js.map +1 -1
- package/es/common/render-curve.js +2 -15
- package/es/common/render-curve.js.map +1 -1
- package/es/common/render-utils.d.ts +10 -0
- package/es/common/render-utils.js +14 -0
- package/es/common/render-utils.js.map +1 -0
- package/es/common/segment/basis.js +2 -8
- package/es/common/segment/basis.js.map +1 -1
- package/es/common/segment/common.d.ts +4 -1
- package/es/common/segment/common.js +11 -0
- package/es/common/segment/common.js.map +1 -1
- package/es/common/segment/linear-closed.d.ts +2 -16
- package/es/common/segment/linear-closed.js +4 -38
- package/es/common/segment/linear-closed.js.map +1 -1
- package/es/common/segment/linear.d.ts +1 -1
- package/es/common/segment/linear.js +2 -8
- package/es/common/segment/linear.js.map +1 -1
- package/es/common/segment/monotone.d.ts +2 -2
- package/es/common/segment/monotone.js +7 -13
- package/es/common/segment/monotone.js.map +1 -1
- package/es/common/sort.js +2 -1
- package/es/common/split-path.js +3 -1
- package/es/common/split-path.js.map +1 -1
- package/es/core/application.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/stage.d.ts +2 -1
- package/es/core/stage.js +12 -5
- package/es/core/stage.js.map +1 -1
- package/es/env-check.js +12 -13
- package/es/env-check.js.map +1 -1
- package/es/event/event-system.js +3 -3
- package/es/event/event-system.js.map +1 -1
- package/es/graphic/arc.js +1 -1
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/arc3d.js +1 -1
- package/es/graphic/arc3d.js.map +1 -1
- package/es/graphic/area.js +1 -1
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/bounds.d.ts +2 -2
- package/es/graphic/bounds.js +1 -1
- package/es/graphic/bounds.js.map +1 -1
- package/es/graphic/circle.js +1 -1
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.js +5 -1
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/glyph.js +1 -1
- package/es/graphic/glyph.js.map +1 -1
- package/es/graphic/graphic-service/graphic-service.js +13 -11
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +1 -0
- package/es/graphic/graphic.js +9 -7
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +1 -1
- package/es/graphic/group.js +3 -3
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/image.d.ts +3 -1
- package/es/graphic/image.js +7 -1
- package/es/graphic/image.js.map +1 -1
- package/es/graphic/line.js +1 -1
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/node-tree.d.ts +1 -1
- package/es/graphic/node-tree.js +6 -2
- package/es/graphic/node-tree.js.map +1 -1
- package/es/graphic/path.js +1 -1
- package/es/graphic/path.js.map +1 -1
- package/es/graphic/polygon.js +1 -1
- package/es/graphic/polygon.js.map +1 -1
- package/es/graphic/pyramid3d.js +1 -1
- package/es/graphic/pyramid3d.js.map +1 -1
- package/es/graphic/rect.js +4 -7
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/richtext/frame.d.ts +2 -2
- package/es/graphic/richtext/frame.js +1 -12
- package/es/graphic/richtext/frame.js.map +1 -1
- package/es/graphic/richtext/line.js +1 -12
- package/es/graphic/richtext/line.js.map +1 -1
- package/es/graphic/richtext/paragraph.js +2 -2
- package/es/graphic/richtext/paragraph.js.map +1 -1
- package/es/graphic/richtext.d.ts +45 -2
- package/es/graphic/richtext.js +23 -6
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/symbol.js +1 -1
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.js +4 -4
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/theme.js +1 -1
- package/es/graphic/theme.js.map +1 -1
- package/es/interface/event.d.ts +2 -0
- package/es/interface/event.js.map +1 -1
- package/es/interface/graphic/richText.d.ts +2 -2
- package/es/interface/graphic/richText.js.map +1 -1
- package/es/interface/graphic/symbol.d.ts +1 -1
- package/es/interface/graphic/symbol.js.map +1 -1
- package/es/interface/graphic.d.ts +17 -3
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/node-tree.d.ts +1 -1
- package/es/interface/node-tree.js.map +1 -1
- package/es/interface/picker.d.ts +1 -0
- package/es/interface/picker.js.map +1 -1
- package/es/interface/render.d.ts +1 -0
- package/es/interface/render.js.map +1 -1
- package/es/interface/stage.d.ts +7 -1
- package/es/interface/stage.js.map +1 -1
- package/es/modules.d.ts +3 -0
- package/es/modules.js +4 -6
- package/es/modules.js.map +1 -1
- package/es/picker/picker-service.js +8 -3
- package/es/picker/picker-service.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +14 -3
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +126 -69
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +28 -25
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/render/contributions/render/area-render.js +9 -7
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/area-contribution-render.d.ts +1 -9
- package/es/render/contributions/render/contributions/area-contribution-render.js +2 -51
- package/es/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/area-texture-contribution-render.d.ts +9 -0
- package/es/render/contributions/render/contributions/area-texture-contribution-render.js +18 -0
- package/es/render/contributions/render/contributions/area-texture-contribution-render.js.map +1 -0
- package/es/render/contributions/render/contributions/base-contribution-render.d.ts +2 -20
- package/es/render/contributions/render/contributions/base-contribution-render.js +23 -123
- package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/base-texture-contribution-render.d.ts +21 -0
- package/es/render/contributions/render/contributions/base-texture-contribution-render.js +124 -0
- package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -0
- package/es/render/contributions/render/contributions/circle-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/circle-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/group-contribution-render.js +2 -2
- package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js +3 -2
- package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/index.d.ts +2 -0
- package/es/render/contributions/render/contributions/index.js +4 -0
- package/es/render/contributions/render/contributions/index.js.map +1 -1
- package/es/render/contributions/render/contributions/path-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/path-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/polygon-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/polygon-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/symbol-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/symbol-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/text-contribution-render.js +28 -7
- package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.js +11 -5
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/image-render.js +6 -2
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/es/render/contributions/render/incremental-draw-contribution.d.ts +0 -1
- package/es/render/contributions/render/incremental-draw-contribution.js +19 -15
- package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/es/render/contributions/render/index.d.ts +1 -0
- package/es/render/contributions/render/index.js +2 -0
- package/es/render/contributions/render/index.js.map +1 -1
- package/es/render/contributions/render/utils.d.ts +1 -1
- package/es/render/contributions/render/utils.js.map +1 -1
- package/es/resource-loader/loader.d.ts +5 -0
- package/es/resource-loader/loader.js +56 -14
- package/es/resource-loader/loader.js.map +1 -1
- package/package.json +6 -4
- package/dist/index.js +0 -27707
- package/dist/index.min.js +0 -1
package/dist/index.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vutils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VRenderCore={},t.VUtils)}(this,(function(t,e){"use strict";class i{static GenAutoIncrementId(){return i.auto_increment_id++}}i.auto_increment_id=0;class n{constructor(t){this.id=i.GenAutoIncrementId(),this.registry=t}}const r="named",s="inject",a="multi_inject",o="inversify:tagged",h="inversify:paramtypes";class l{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===r?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var c=function(t){var e,i;return function(t){const e=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,n=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,a={__proto__:[]}instanceof Array,o=!s&&!a,h={create:s?function(){return W(Object.create(null))}:a?function(){return W({__proto__:null})}:function(){return W({})},has:o?function(t,i){return e.call(t,i)}:function(t,e){return e in t},get:o?function(t,i){return e.call(t,i)?t[i]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,u=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?D():Map;c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?U():Set;const d=new(c||"function"!=typeof WeakMap?N():WeakMap);function p(t,e,i,n){if(!C(i))throw new TypeError;return B(t,e,i,n)}function g(t,e,i){if(!C(e))throw new TypeError;return w(i)||(i=R(i)),b(t,e,i)}function f(t,e,i){if(!C(e))throw new TypeError;return w(i)||(i=R(i)),v(t,e,i)}function m(t,e,i){if(!C(e))throw new TypeError;return w(i)||(i=R(i)),x(t,e,i)}function y(t,e,i){let n=d.get(t);if(w(n)){if(!i)return;n=new u,d.set(t,n)}let r=n.get(e);if(w(r)){if(!i)return;r=new u,n.set(e,r)}return r}function b(t,e,i){if(v(t,e,i))return!0;const n=I(e);return!S(n)&&b(t,n,i)}function v(t,e,i){const n=y(e,i,!1);return!w(n)&&M(n.has(t))}function x(t,e,i){if(v(t,e,i))return A(t,e,i);const n=I(e);return S(n)?void 0:x(t,n,i)}function A(t,e,i){const n=y(e,i,!1);if(!w(n))return n.get(t)}function B(t,e,i,n){y(i,n,!0).set(t,e)}function T(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function w(t){return void 0===t}function S(t){return null===t}function _(t){return"symbol"==typeof t}function C(t){return"object"==typeof t?null!==t:"function"==typeof t}function P(t,e){switch(T(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const i=3===e?"string":5===e?"number":"default",r=L(t,n);if(void 0!==r){const e=r.call(t,i);if(C(e))throw new TypeError;return e}return E(t,"default"===i?"number":i)}function E(t,e){if("string"===e){const e=t.toString;if(O(e)){const i=e.call(t);if(!C(i))return i}const i=t.valueOf;if(O(i)){const e=i.call(t);if(!C(e))return e}}else{const e=t.valueOf;if(O(e)){const i=e.call(t);if(!C(i))return i}const i=t.toString;if(O(i)){const e=i.call(t);if(!C(e))return e}}throw new TypeError}function M(t){return!!t}function k(t){return""+t}function R(t){const e=P(t,3);return _(e)?e:k(e)}function O(t){return"function"==typeof t}function L(t,e){const i=t[e];if(null!=i){if(!O(i))throw new TypeError;return i}}function I(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)return e;const i=t.prototype,n=i&&Object.getPrototypeOf(i);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}function D(){const t={},e=[],i=function(){function t(t,e,i){this._index=0,this._keys=t,this._values=e,this._selector=i}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){const t=this._index;if(t>=0&&t<this._keys.length){const i=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:i,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){const e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){const i=this._find(t,!0);return this._values[i]=e,this},e.prototype.delete=function(e){const i=this._find(e,!1);if(i>=0){const n=this._keys.length;for(let t=i+1;t<n;t++)this._keys[t-1]=this._keys[t],this._values[t-1]=this._values[t];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new i(this._keys,this._values,n)},e.prototype.values=function(){return new i(this._keys,this._values,s)},e.prototype.entries=function(){return new i(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[r]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function s(t,e){return e}function a(t,e){return[t,e]}}function U(){return function(){function t(){this._map=new u}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()},t}()}function N(){const t=16,i=h.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){const e=s(t,!1);return void 0!==e&&h.has(e,this._key)},t.prototype.get=function(t){const e=s(t,!1);return void 0!==e?h.get(e,this._key):void 0},t.prototype.set=function(t,e){return s(t,!0)[this._key]=e,this},t.prototype.delete=function(t){const e=s(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){let t;do{t="@@WeakMap@@"+l()}while(h.has(i,t));return i[t]=!0,t}function s(t,i){if(!e.call(t,n)){if(!i)return;Object.defineProperty(t,n,{value:h.create()})}return t[n]}function a(t,e){for(let i=0;i<e;++i)t[i]=255*Math.random()|0;return t}function o(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function l(){const e=o(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;let i="";for(let n=0;n<t;++n){const t=e[n];4!==n&&6!==n&&8!==n||(i+="-"),t<16&&(i+="0"),i+=t.toString(16).toLowerCase()}return i}}function W(t){return t.__=void 0,delete t.__,t}t("defineMetadata",p),t("hasMetadata",g),t("hasOwnMetadata",f),t("getMetadata",m)}((e=t,function(t,n){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n}),i&&i(t,n)})),t}({});function u(t,e,i,n){!function(t,e,i,n){const r=[n];let s={};c.hasOwnMetadata(t,e)&&(s=c.getMetadata(t,e));let a=s[i];void 0===a&&(a=[]),a.push(...r),s[i]=a,c.defineMetadata(t,s,e)}(o,t,i.toString(),n)}function d(t){return(e,i,n)=>{u(e,0,n,t)}}function p(t){return e=>(i,n,r)=>d(new l(t,e))(i,n,r)}const g=p(s),f=p(a);function m(){return function(t){return c.defineMetadata(h,null,t),t}}function y(t){return d(new l(r,t))}const b="Singleton",v="Transient",x="ConstantValue",A="DynamicValue",B="Factory",T="Function",w="Instance",S="Invalid";class _{constructor(t,e){this.id=i.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=S,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new _(this.serviceIdentifier,this.scope);return t.activated=t.scope===b&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class C{getConstructorMetadata(t){return{compilerGeneratedMetadata:c.getMetadata(h,t),userGeneratedMetadata:c.getMetadata(o,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const P=(E=r,t=>{const e=e=>{if(null==e)return!1;if(e.key===E&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===E&&i[e].value===t)return!0;return!1};return e.metaData=new l(E,t),e});var E;class M{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=b,this}inTransientScope(){return this._binding.scope=v,this}whenTargetNamed(t){return this._binding.constraint=P(t),this}}class k{constructor(t){this._binding=t}to(t){return this._binding.type=w,this._binding.implementationType=t,new M(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=A,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new M(this._binding)}toConstantValue(t){return this._binding.type=x,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=b,new M(this._binding)}toFactory(t){return this._binding.type=B,this._binding.factory=t,this._binding.scope=b,new M(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}class R{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||v,this.options=e,this.id=i.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new C}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,r,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new _(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new k(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),r=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:r(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),r=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const o={inject:n[s],multiInject:n[a]},h=o.inject||o.multiInject,l={serviceIdentifier:h,constructorArgsMetadata:e},c={injectIdentifier:h,metadata:e,bindings:this._bindingDictionary.get(h).filter((t=>t.constraint(l)))};r.push(c)}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case x:case T:e=t.cache;break;case w:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){if(e.length){return new t(...this._resolveRequests(e))}return new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===b&&(t.cache=e,t.activated=!0)}}function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function L(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":O(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}function I(t,e){return function(i,n){e(i,n,t)}}function D(t,e){if("object"===("undefined"==typeof Reflect?"undefined":O(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function U(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const N=Symbol("ContributionProvider");class W{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function G(t,e){t(N).toDynamicValue((({container:t})=>new W(e,t))).inSingletonScope().whenTargetNamed(e)}function F(t,e){t(N).toDynamicValue((({container:t})=>new W(e,t))).whenTargetNamed(e)}class z{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>t.name!==i&&(!e||t.fn===e))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class j extends z{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const H=Symbol.for("EnvContribution"),V=Symbol.for("VGlobal"),Y="browser";t.DefaultGlobal=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv(Y),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv(Y),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv(Y),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv(Y),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv(Y),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv(Y),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv(Y),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv(Y),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv(Y),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv(Y),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv(Y),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=i.GenAutoIncrementId(),this.hooks={onSetEnv:new j(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv(Y),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv(Y),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const n=this.bindContribution(e);if(n&&n.then)return n.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv(Y),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv(Y),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv(Y),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv(Y),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv(Y),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv(Y),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv(Y),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv(Y),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv(Y),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv(Y),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv(Y),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv(Y),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=L([m(),I(0,g(N)),I(0,y(H)),D("design:paramtypes",[Object])],t.DefaultGlobal);const X=e.tau-1e-8;class K{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,i,n,r,s,a){if(Math.abs(s-r)>X)return this.bounds.add(t-n,i-n),void this.bounds.add(t+n,i+n);let o,h,l,c,u=1/0,d=-1/0,p=1/0,g=-1/0;function f(t){l=n*Math.cos(t),c=n*Math.sin(t),l<u&&(u=l),l>d&&(d=l),c<p&&(p=c),c>g&&(g=c)}if(f(r),f(s),s!==r)if((r%=e.tau)<0&&(r+=e.tau),(s%=e.tau)<0&&(s+=e.tau),s<r&&(a=!a,o=r,r=s,s=o),a)for(s-=e.tau,o=r-r%e.halfPi,h=0;h<4&&o>s;++h,o-=e.halfPi)f(o);else for(o=r-r%e.halfPi+e.halfPi,h=0;h<4&&o<s;++h,o+=e.halfPi)f(o);this.bounds.add(t+u,i+p),this.bounds.add(t+d,i+g)}arcTo(t,e,i,n,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(...t){}}class q{constructor(){this.curves=[],this.bounds=new e.AABBBounds}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const $=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Z={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},J={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Q,et,it,nt,rt,st;function at(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const r=[];for(let t=0,s=e.length;t<s;t++)if(Q=e[t],et=Q.slice(1),it=Q[0],i=[it],n=et.match($),null!==n){for(let t=0,e=n.length;t<e;t++)nt=n[t],rt=parseFloat(nt),Number.isNaN(rt)||i.push(rt);if(st=Z[it],i.length-1>st){let t;for(let e=1,n=i.length;e<n;e+=st){t=[it];for(let n=e,r=e+st;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var ot,ht,lt,ct,ut,dt,pt,gt;function ft(t,i,n,r,s,a,o,h,l){const c=e.degreeToRadian(o),u=Math.sin(c),d=Math.cos(c),p=d*(h-t)*.5+u*(l-i)*.5,g=d*(l-i)*.5-u*(h-t)*.5;let f=p*p/((n=Math.abs(n))*n)+g*g/((r=Math.abs(r))*r);f>1&&(f=Math.sqrt(f),n*=f,r*=f);const m=d/n,y=u/n,b=-u/r,v=d/r,x=m*h+y*l,A=b*h+v*l,B=m*t+y*i,T=b*t+v*i;let w=1/((B-x)*(B-x)+(T-A)*(T-A))-.25;w<0&&(w=0);let S=Math.sqrt(w);a===s&&(S=-S);const _=.5*(x+B)-S*(T-A),C=.5*(A+T)+S*(B-x),P=Math.atan2(A-C,x-_);let E=Math.atan2(T-C,B-_)-P;E<0&&1===a?E+=e.tau:E>0&&0===a&&(E-=e.tau);const M=Math.ceil(Math.abs(E/(e.halfPi+.001))),k=[];for(let t=0;t<M;++t){const e=P+t*E/M,i=P+(t+1)*E/M;k[t]=[_,C,e,i,n,r,u,d]}return k}function mt(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=h*s,c=-o*a,u=o*s,d=h*a,p=Math.cos(n),g=Math.sin(n),f=Math.cos(r),m=Math.sin(r),y=.5*(r-n),b=Math.sin(.5*y),v=8/3*b*b/Math.sin(y),x=e+p-v*g,A=i+g+v*p,B=e+f,T=i+m,w=B+v*m,S=T-v*f;return[l*x+c*A,u*x+d*A,l*w+c*S,u*w+d*S,l*B+c*T,u*B+d*T]}function yt(t,e,i,n){const r=ft(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<r.length;++e){const i=mt(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(ot=t.UpdateTag||(t.UpdateTag={}))[ot.NONE=0]="NONE",ot[ot.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",ot[ot.UPDATE_SHAPE=2]="UPDATE_SHAPE",ot[ot.CLEAR_SHAPE=253]="CLEAR_SHAPE",ot[ot.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",ot[ot.INIT=179]="INIT",ot[ot.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",ot[ot.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",ot[ot.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",ot[ot.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",ot[ot.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",ot[ot.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",ot[ot.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",ot[ot.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(ht=t.IContainPointMode||(t.IContainPointMode={}))[ht.GLOBAL=1]="GLOBAL",ht[ht.LOCAL=16]="LOCAL",ht[ht.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",ht[ht.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(lt=t.AttributeUpdateType||(t.AttributeUpdateType={}))[lt.INIT=0]="INIT",lt[lt.DEFAULT=1]="DEFAULT",lt[lt.STATE=2]="STATE",lt[lt.ANIMATE_BIND=10]="ANIMATE_BIND",lt[lt.ANIMATE_PLAY=11]="ANIMATE_PLAY",lt[lt.ANIMATE_START=12]="ANIMATE_START",lt[lt.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",lt[lt.ANIMATE_END=14]="ANIMATE_END",lt[lt.TRANSLATE=20]="TRANSLATE",lt[lt.TRANSLATE_TO=21]="TRANSLATE_TO",lt[lt.SCALE=22]="SCALE",lt[lt.SCALE_TO=23]="SCALE_TO",lt[lt.ROTATE=24]="ROTATE",lt[lt.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(ct=t.AnimateStatus||(t.AnimateStatus={}))[ct.INITIAL=0]="INITIAL",ct[ct.RUNNING=1]="RUNNING",ct[ct.PAUSED=2]="PAUSED",ct[ct.END=3]="END",t.AnimateMode=void 0,(ut=t.AnimateMode||(t.AnimateMode={}))[ut.NORMAL=0]="NORMAL",ut[ut.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(dt=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",dt.from="from",dt.to="to",dt.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,(pt=t.CurveTypeEnum||(t.CurveTypeEnum={}))[pt.CubicBezierCurve=0]="CubicBezierCurve",pt[pt.QuadraticBezierCurve=1]="QuadraticBezierCurve",pt[pt.ArcCurve=2]="ArcCurve",pt[pt.LineCurve=3]="LineCurve",pt[pt.EllipseCurve=4]="EllipseCurve",pt[pt.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(gt=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[gt.beforeFillStroke=0]="beforeFillStroke",gt[gt.afterFillStroke=1]="afterFillStroke";const bt=(t,e,i,n,r,s,a)=>{const o=Math.abs(i-e),h=4*Math.tan(o/4)/3,l=i<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(i),p=Math.sin(i),g=c*s+n,f=u*a+r,m=d*s+n,y=p*a+r,b=s*h*l,v=a*h*l;t.push(g-b*u,f+v*c,m+b*p,y-v*d,m,y)},vt=[(t,e,i,n,r,s,a)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,i,n,r,s,a)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,a),(t,e,i,n,r,s,a)=>e.bezierCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*r+i,t[6]*s+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,r,s)=>e.ellipse(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,i,n,r,s,a)=>e.lineTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.moveTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,a),(t,e,i,n,r,s,a)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,a)];function xt(t,e,i=0,n=0,r=1,s=1,a){for(let o=0;o<t.length;o++){const h=t[o];vt[h[0]](h,e,i,n,r,s,a)}}class At{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Bt(t,i){let n=0;const r=t.length;for(let s=0;s<r;s++){const a=t[s],o=i[s],h=t[(s+1)%r],l=i[(s+1)%r];n+=e.PointService.distanceNN(a,o,h,l)}return n/2}function Tt(t,e,i,n,r){return Bt([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function wt(t,e,i,n,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*i*r*r*s+n*r*r*r}function St(t,i,n,r,s){const a=wt(t.x,i.x,n.x,r.x,s),o=wt(t.y,i.y,n.y,r.y,s);return new e.Point(a,o)}function _t(t,i){const{p0:n,p1:r,p2:s,p3:a}=t,o=St(n,r,s,a,i),h=e.PointService.pointAtPP(n,r,i),l=e.PointService.pointAtPP(r,s,i),c=e.PointService.pointAtPP(s,a,i),u=e.PointService.pointAtPP(h,l,i),d=e.PointService.pointAtPP(l,c,i);return[new Ct(n,h,u,o),new Ct(o,d,c,a)]}class Ct extends At{constructor(e,i,n,r){super(),this.type=t.CurveTypeEnum.CubicBezierCurve,this.p0=e,this.p1=i,this.p2=n,this.p3=r}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return St(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Tt(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(i){return i===t.Direction.ROW?e.abs(this.p0.x-this.p3.x):i===t.Direction.COLUMN?e.abs(this.p0.y-this.p3.y):0}getAngleAt(t){const i=e.max(t-.01,0),n=e.min(t+.01,1),r=this.getPointAt(i),s=this.getPointAt(n);return e.atan2(s.y-r.y,s.x-r.x)}}function Pt(t,i){const{p0:n,p1:r}=t,s=e.PointService.pointAtPP(n,r,i);return[new Et(n,s),new Et(s,r)]}class Et extends At{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return e.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=e.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?e.PointService.distancePP(this.p0,this.p1):60}calcProjLength(i){return i===t.Direction.ROW?e.abs(this.p0.x-this.p1.x):i===t.Direction.COLUMN?e.abs(this.p0.y-this.p1.y):0}}class Mt{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,i,n,r,s,a,o,h){const l=new Ct(new e.Point(this._lastX,this._lastY),new e.Point(t,i),new e.Point(n,r),new e.Point(s,a));l.originP1=this._lastOriginP,l.originP2=h,l.defined=o,this.curves.push(l),this._lastX=s,this._lastY=a,this._lastOriginP=h}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,i,n,r,s){const a=new Et(new e.Point(this._lastX,this._lastY),new e.Point(t,i));return a.originP1=r,a.originP2=s,a.defined=n,a}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(i){var n,r;if(i===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],r=null!==(n=i.p3)&&void 0!==n?n:i.p1;return e.abs(t.p0.y-r.y)}if(i===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],n=null!==(r=i.p3)&&void 0!==r?r:i.p1;return e.abs(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class kt extends Mt{bezierCurveTo(t,e,i,n,r,s,a,o){return super.bezierCurveTo(e,t,n,i,s,r,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Rt(t,e,i=1){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}class Ot{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Lt(i,n={}){const{direction:r,startPoint:s}=n;if(i.length<2-Number(!!s))return null;const a=new Mt("linear",null!=r?r:e.abs(i[i.length-1].x-i[0].x)>e.abs(i[i.length-1].y-i[0].y)?t.Direction.ROW:t.Direction.COLUMN);return It(new Ot(a,s),i),a}function It(t,e){return Rt(t,e,1)}function Dt(t,e,i,n,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class Ut{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){if(2===this._point)Dt(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:Dt(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Nt(t,e){return Rt(t,e,2)}function Wt(i,n={}){const{direction:r,startPoint:s}=n;if(i.length<2-Number(!!s))return null;if(i.length<3-Number(!!s))return Lt(i,n);const a=new Mt("basis",null!=r?r:e.abs(i[i.length-1].x-i[0].x)>e.abs(i[i.length-1].y-i[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Nt(new Ut(a,s),i),a}function Gt(t){return t<0?-1:1}function Ft(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),a=(i-t._y1)/(r||Number(n<0&&-0)),o=(s*r+a*n)/(n+r);return(Gt(s)+Gt(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function zt(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function jt(t,e,i,n,r){const s=t._x0,a=t._y0,o=t._x1,h=t._y1,l=(o-s)/3;t.context.bezierCurveTo(s+l,a+l*e,o-l,h-l*i,o,h,n,t.lastPoint1)}class Ht{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:jt(this,this._t0,zt(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,jt(this,zt(this,e=Ft(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:jt(this,this._t0,e=Ft(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class Vt extends Ht{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Yt(t,e){return Rt(t,e,2)}function Xt(i,n={}){const{direction:r,startPoint:s}=n;if(i.length<2-Number(!!s))return null;if(i.length<3-Number(!!s))return Lt(i,n);const a=new Mt("monotoneX",null!=r?r:e.abs(i[i.length-1].x-i[0].x)>e.abs(i[i.length-1].y-i[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Yt(new Ht(a,s),i),a}function Kt(t,e){return Rt(t,e,2)}function qt(i,n={}){const{direction:r,startPoint:s}=n;if(i.length<2-Number(!!s))return null;if(i.length<3-Number(!!s))return Lt(i,n);const a=new kt("monotoneY",null!=r?r:e.abs(i[i.length-1].x-i[0].x)>e.abs(i[i.length-1].y-i[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Kt(new Vt(a,s),i),a}let $t=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function Zt(i,n,r={}){const{direction:s,startPoint:a}=r;if(i.length<2-Number(!!a))return null;const o=new Mt("step",null!=s?s:e.abs(i[i.length-1].x-i[0].x)>e.abs(i[i.length-1].y-i[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Jt(new $t(o,n,a),i),o}function Jt(t,e){return Rt(t,e,1)}class Qt{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){this.context.closePath()}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function te(i,n={}){const{direction:r,startPoint:s}=n;if(i.length<2-Number(!!s))return null;const a=new Mt("linear",null!=r?r:e.abs(i[i.length-1].x-i[0].x)>e.abs(i[i.length-1].y-i[0].y)?t.Direction.ROW:t.Direction.COLUMN);return ee(new Qt(a,s),i),a}function ee(t,e){return Rt(t,e,1)}function ie(t,e,i){switch(e){case"linear":default:return Lt(t,i);case"basis":return Wt(t,i);case"monotoneX":return Xt(t,i);case"monotoneY":return qt(t,i);case"step":return Zt(t,.5,i);case"stepBefore":return Zt(t,0,i);case"stepAfter":return Zt(t,1,i);case"linearClosed":return te(t,i)}}class ne extends q{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new K(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([J.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([J.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([J.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.commandList.push([J.C,t,e,i,n,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,s),this}arcTo(t,e,i,n,r){return this.commandList.push([J.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,a,o){return this.commandList.push([J.E,t,e,i,n,r,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,a,o),this}rect(t,e,i,n){return this.commandList.push([J.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,r,s){return this.commandList.push([J.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([J.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}toString(){if(!this.toStringCbList){const t=[];t[J.M]=t=>`M${t[1]} ${t[2]}`,t[J.L]=t=>`L${t[1]} ${t[2]}`,t[J.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[J.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[J.A]=t=>{const e=[];bt(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[J.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,r){this.clear();const s=at(t);return this._runCommandStrList(s,e,i,n,r),this._updateBounds(),this}fromLine(e){const{points:i,curveType:n,clipRangeByDimension:r}=e.attribute;if(!i)return;const s=ie(i,n);"x"===r?this.direction=t.Direction.ROW:"y"===r?this.direction=t.Direction.COLUMN:"auto"===r&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}transform(t,e,i,n){const r=this.commandList;if(!this.transformCbList){const t=[];t[J.M]=this.moveToTransform,t[J.L]=this.lineToTransform,t[J.Q]=this.quadraticCurveToTransform,t[J.C]=this.bezierCurveToTransform,t[J.AT]=this.arcToTransform,t[J.E]=this.ellipseTransform,t[J.R]=this.rectTransform,t[J.A]=this.arcTransform,t[J.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,n=1,r=1){let s,a,o,h,l,c=null,u=0,d=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(s=t[f],1===n&&1===r||(s=se(s,n,r)),s[0]){case"l":u+=s[1],d+=s[2],this.lineTo(u+e,d+i);break;case"L":u=s[1],d=s[2],this.lineTo(u+e,d+i);break;case"h":u+=s[1],this.lineTo(u+e,d+i);break;case"H":u=s[1],this.lineTo(u+e,d+i);break;case"v":d+=s[1],this.lineTo(u+e,d+i);break;case"V":d=s[1],this.lineTo(u+e,d+i);break;case"m":u+=s[1],d+=s[2],this.moveTo(u+e,d+i);break;case"M":u=s[1],d=s[2],this.moveTo(u+e,d+i);break;case"c":a=u+s[5],o=d+s[6],p=u+s[3],g=d+s[4],this.bezierCurveTo(u+s[1]+e,d+s[2]+i,p+e,g+i,a+e,o+i),u=a,d=o;break;case"C":u=s[5],d=s[6],p=s[3],g=s[4],this.bezierCurveTo(s[1]+e,s[2]+i,p+e,g+i,u+e,d+i);break;case"s":a=u+s[3],o=d+s[4],p=2*u-p,g=2*d-g,this.bezierCurveTo(p+e,g+i,u+s[1]+e,d+s[2]+i,a+e,o+i),p=u+s[1],g=d+s[2],u=a,d=o;break;case"S":a=s[3],o=s[4],p=2*u-p,g=2*d-g,this.bezierCurveTo(p+e,g+i,s[1]+e,s[2]+i,a+e,o+i),u=a,d=o,p=s[1],g=s[2];break;case"q":a=u+s[3],o=d+s[4],p=u+s[1],g=d+s[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"Q":a=s[3],o=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,a+e,o+i),u=a,d=o,p=s[1],g=s[2];break;case"t":a=u+s[1],o=d+s[2],null===c[0].match(/[QqTt]/)?(p=u,g=d):"t"===c[0]?(p=2*u-h,g=2*d-l):"q"===c[0]&&(p=2*u-p,g=2*d-g),h=p,l=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o,p=u+s[1],g=d+s[2];break;case"T":a=s[1],o=s[2],p=2*u-p,g=2*d-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"a":yt(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+e,s[7]+d+i]),u+=s[6],d+=s[7];break;case"A":yt(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+i]),u=s[6],d=s[7];break;case"z":case"Z":this.closePath()}c=s}}_runCommandList(t,e=0,i=0,n=1,r=1){if(0!==e||0!==i||1!==n||1!==r)for(let s=0,a=t.length;s<a;++s){const a=t[s].slice();switch(a[0]){case J.L:this.lineToTransform(a,e,i,n,r);break;case J.M:this.moveToTransform(a,e,i,n,r);break;case J.C:this.bezierCurveToTransform(a,e,i,n,r);break;case J.Q:this.quadraticCurveToTransform(a,e,i,n,r);break;case J.A:this.arcToTransform(a,e,i,n,r);break;case J.E:this.ellipseTransform(a,e,i,n,r);break;case J.R:this.rectTransform(a,e,i,n,r);break;case J.AT:this.arcToTransform(a,e,i,n,r);break;case J.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),xt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1];return e.abs(t.p0.y-i.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1];return e.abs(t.p0.x-i.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const r=e.getLength(this.direction);if(i+r>=t)break;i+=r}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const re=["l",0,0,0,0,0,0,0];function se(t,e,i){const n=re[0]=t[0];if("a"===n||"A"===n)re[1]=e*t[1],re[2]=i*t[2],re[3]=t[3],re[4]=t[4],re[5]=t[5],re[6]=e*t[6],re[7]=i*t[7];else if("h"===n||"H"===n)re[1]=e*t[1];else if("v"===n||"V"===n)re[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)re[n]=(n%2==1?e:i)*t[n];return re}const ae={alignSelf:"auto"},oe={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new e.Matrix},he={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},le={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ce=Object.assign({outerBorder:Object.assign(Object.assign({},le),{distance:0}),innerBorder:Object.assign(Object.assign({},le),{distance:0})},le),ue={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",disableAutoClipedPoptip:void 0},de={pickStrokeBuffer:0},pe=Object.assign(Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",blur:0,cursor:null,html:null},he),ce),ae),de),ge={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},fe={_debug_bounds:!1},me=Object.assign(Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden"},fe),pe),oe);const ye=Object.assign(Object.assign({},me),{startAngle:0,endAngle:e.pi2,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),be=Object.assign(Object.assign(Object.assign({},me),ge),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),ve=Object.assign(Object.assign({},me),{radius:1,startAngle:0,endAngle:e.pi2}),xe=Object.assign(Object.assign({},me),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start"}),Ae=Object.assign(Object.assign({},me),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Be=Object.assign(Object.assign(Object.assign({},me),ge),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),Te=Object.assign(Object.assign({},me),{path:new ne,customPath:()=>{e.Logger.getInstance().warn("空函数")}}),we=Object.assign(Object.assign({},me),{points:[],cornerRadius:0,closePath:!0}),Se=Object.assign(Object.assign({},me),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),_e=Object.assign(Object.assign({},me),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),Ce=Object.assign(Object.assign({},me),{symbolType:"circle",size:10,keepDirIn3d:!0}),Pe=Object.assign(Object.assign(Object.assign({},me),ue),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Ee=Object.assign(Object.assign({},me),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Me=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},me),{fill:!0,cornerRadius:0}),ke=Object.assign(Object.assign({},Me),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});class Re{}const Oe=new Re,Le={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},Ie=!0,De=!1,Ue=/\w|\(|\)|-/,Ne=/[.?!,;:/,。?!、;:]/,We=/\S/;function Ge(t,e,i,n,r){if(!e||e<=0)return 0;const s=Oe.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),l=t.slice(0,a+1),c=Math.floor(s.measureText(l,i).width);for(;h>e||c<=e;){if(h>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),l=t.slice(0,a+1),c=Math.floor(s.measureText(l,i).width)}return r&&(a=Fe(t,a)),a}function Fe(t,e){let i=e;for(;Ue.test(t[i-1])&&Ue.test(t[i])||Ne.test(t[i]);)if(i--,i<=0)return e;return i}function ze(t,e){const i=Oe.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}let je=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){if(!this.context)return this.estimate(t,e).width;this.context.setTextStyleWithoutAlignBaseline(e);return this.context.measureText(t).width}estimate(t,{fontSize:e=Pe.fontSize}){let i=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:n++;return{width:~~(.8*i*e+n*e),height:e}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:ue.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:ue.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let a=0,o=0;for(;o<t.length&&a+t[o].width<i;o++)a+=t[o].width,s.push(t[o]);if(t[o]&&t[o].text.length>1){const r=this._clipText(t[o].text,e,i-a,0,t[o].text.length-1,"end",!1);if(n&&r.str!==t[o].text){let i="",n=0;for(let e=0;e<o;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[o].text;let s=Fe(i,n+r.str.length);s-=n,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push(Object.assign(Object.assign({},t[o]),{text:r.str,width:r.width})),a+=r.width}return{verticalList:s,width:a}}clipText(t,e,i,n){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>i)return{str:"",width:0};const s=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&s.str!==t){const i=Fe(t,s.str.length);i!==s.str.length&&(s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,n,r,s,a){let o;if("start"===s)o=this._clipTextStart(t,e,i,n,r),a&&(o.result=a+o.str);else if("middle"===s){const n=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:n.width,result:n.left+a+n.right}}else o=this._clipTextEnd(t,e,i,n,r),a&&(o.result=o.str+a);return o}_clipTextEnd(t,e,i,n,r){const s=Math.floor((n+r)/2),a=t.substring(0,s+1),o=this.measureTextWidth(a,e);let h;if(o>i){if(a.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipTextEnd(t,e,i,n,s)}if(o<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return h=this.measureTextWidth(n,e),h>=i?{str:a,width:o}:this._clipTextEnd(t,e,i,s,r)}return{str:a,width:o}}_clipTextStart(t,e,i,n,r){const s=Math.ceil((n+r)/2),a=t.substring(s-1,t.length-1),o=this.measureTextWidth(a,e);let h;if(o>i){if(a.length<=1)return{str:"",width:0};const n=t.substring(s,t.length-1);return h=this.measureTextWidth(n,e),h<=i?{str:n,width:h}:this._clipTextStart(t,e,i,s,t.length-1)}if(o<i){if(s<=0)return{str:t,width:this.measureTextWidth(t,e)};const r=t.substring(s-2,t.length-1);return h=this.measureTextWidth(r,e),h>=i?{str:a,width:o}:this._clipTextStart(t,e,i,n,s)}return{str:a,width:o}}_clipTextMiddle(t,e,i,n,r,s,a,o){const h=t.substring(0,o),l=this.measureTextWidth(h,e);if(l+a>i)return{left:n,right:r,width:s+a};const c=t.substring(t.length-o,t.length),u=this.measureTextWidth(c,e);return l+u>i?{left:h,right:r,width:l+a}:this._clipTextMiddle(t,e,i,h,c,l,u,o+1)}clipTextWithSuffixVertical(t,e,i,n,r,s){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const a=this.clipTextVertical(t,e,i,r);if(a.verticalList.length===t.length&&a.verticalList[a.verticalList.length-1].width===t[t.length-1].width)return a;const o=this.measureTextWidth(n,e);if(o>i)return a;let h;if(i-=o,"start"===s){const s=this.revertVerticalList(t);h=this.clipTextVertical(s,e,i,r);const a=this.revertVerticalList(h.verticalList);a.unshift({text:n,direction:1,width:o}),h.verticalList=a}else if("middle"===s){const s=this.clipTextVertical(t,e,i/2,r),a=this.revertVerticalList(t),l=this.clipTextVertical(a,e,i/2,r);s.verticalList.push({text:n,direction:1,width:o}),this.revertVerticalList(l.verticalList).forEach((t=>s.verticalList.push(t))),h={verticalList:s.verticalList,width:s.width+l.width}}else h=this.clipTextVertical(t,e,i,r),h.verticalList.push({text:n,direction:1,width:o});return h.width+=o,h}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,n,r,s){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const a=this.measureTextWidth(t,e);if(a<=i)return{str:t,width:a};const o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;const h=this._clipText(t,e,i,0,t.length-1,s,n);if(r&&h.str!==t){const i=Fe(t,h.str.length);i!==h.str.length&&(h.str=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}return h.str=h.result,h.width+=o,h}};je=L([m()],je);const He=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=class extends je{},t.DefaultTextMeasureContribution=L([m()],t.DefaultTextMeasureContribution);const Ve=new R,Ye=Symbol.for("CanvasFactory"),Xe=Symbol.for("Context2dFactory");function Ke(t){return Ve.getNamed(Ye,Oe.global.env)(t)}const qe=1e-4,$e=Math.sqrt(3),Ze=1/3;function Je(t){return t>-di&&t<di}function Qe(t){return t>di||t<-di}const ti=[0,0],ei=[0,0],ii=[0,0];function ni(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function ri(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function si(t,e,i,n,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*n+3*s*i)}function ai(t){return(t%=e.pi2)<0&&(t+=e.pi2),t}function oi(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const a=(s-e)/(n-e);let o=n<e?1:-1;1!==a&&0!==a||(o=n<e?.5:-.5);const h=a*(i-t)+t;return h===r?1/0:h>r?o:0}function hi(t,e,i,n,r,s,a,o,h){if(0===a)return!1;const l=a;if(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||o>t+l&&o>i+l&&o>r+l||o<t-l&&o<i-l&&o<r-l)return!1;const c=function(t,e,i,n,r,s,a,o,h){let l=0,c=.005,u=1/0;ti[0]=a,ti[1]=o;for(let a=0;a<1;a+=.05){ei[0]=ri(t,i,r,a),ei[1]=ri(e,n,s,a);const o=ni(ti,ei);o<u&&(l=a,u=o)}u=1/0;for(let a=0;a<32&&!(c<qe);a++){const a=l-c,o=l+c;ei[0]=ri(t,i,r,a),ei[1]=ri(e,n,s,a);const h=ni(ei,ti);if(a>=0&&h<u)l=a,u=h;else{ii[0]=ri(t,i,r,o),ii[1]=ri(e,n,s,o);const a=ni(ii,ti);o<=1&&a<u?(l=o,u=a):c*=.5}}return h&&(h[0]=ri(t,i,r,l),h[1]=ri(e,n,s,l)),Math.sqrt(u)}(t,e,i,n,r,s,o,h,null);return c<=l/2}function li(t,e,i,n,r,s,a,o,h,l,c){if(0===h)return!1;const u=h;if(c>e+u&&c>n+u&&c>s+u&&c>o+u||c<e-u&&c<n-u&&c<s-u&&c<o-u||l>t+u&&l>i+u&&l>r+u&&l>a+u||l<t-u&&l<i-u&&l<r-u&&l<a-u)return!1;const d=function(t,e,i,n,r,s,a,o,h,l,c){let u,d,p,g,f=0,m=.005,y=1/0;ti[0]=h,ti[1]=l;for(let h=0;h<1;h+=.05)ei[0]=si(t,i,r,a,h),ei[1]=si(e,n,s,o,h),p=ni(ti,ei),p<y&&(f=h,y=p);y=1/0;for(let h=0;h<32&&!(m<qe);h++)u=f-m,d=f+m,ei[0]=si(t,i,r,a,u),ei[1]=si(e,n,s,o,u),p=ni(ei,ti),u>=0&&p<y?(f=u,y=p):(ii[0]=si(t,i,r,a,d),ii[1]=si(e,n,s,o,d),g=ni(ii,ti),d<=1&&g<y?(f=d,y=g):m*=.5);return c&&(c[0]=si(t,i,r,a,f),c[1]=si(e,n,s,o,f)),Math.sqrt(y)}(t,e,i,n,r,s,a,o,l,c,null);return d<=u/2}function ci(t,i,n,r,s,a,o,h,l){if(0===o)return!1;const c=o;h-=t,l-=i;const u=Math.sqrt(h*h+l*l);if(u-c>n||u+c<n)return!1;if(Math.abs(r-s)%e.pi2<1e-4)return!0;if(a){const t=r;r=ai(s),s=ai(t)}else r=ai(r),s=ai(s);r>s&&(s+=e.pi2);let d=Math.atan2(l,h);return d<0&&(d+=e.pi2),d>=r&&d<=s||d+e.pi2>=r&&d+e.pi2<=s}function ui(t,e,i,n,r,s,a){if(0===r)return!1;const o=r,h=r/2;let l=0,c=t;if(a>e+h&&a>n+h||a<e-h&&a<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=o/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=l*s-a+c;return u*u/(l*l+1)<=o/2*o/2}const di=1e-4;function pi(t,e,i,n,r){const s=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let h=0;if(Je(a)){if(Qe(s)){const t=-o/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*a*o;if(Je(t))r[0]=-s/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*a),n=(-s-e)/(2*a);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const gi=[-1,-1,-1],fi=[-1,-1];function mi(){const t=fi[0];fi[0]=fi[1],fi[1]=t}function yi(t,e,i,n,r,s,a,o,h,l){if(l>e&&l>n&&l>s&&l>o||l<e&&l<n&&l<s&&l<o)return 0;const c=function(t,e,i,n,r,s){const a=n+3*(e-i)-t,o=3*(i-2*e+t),h=3*(e-t),l=t-r,c=o*o-3*a*h,u=o*h-9*a*l,d=h*h-3*o*l;let p=0;if(Je(c)&&Je(u))if(Je(o))s[0]=0;else{const t=-h/o;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(Je(t)){const t=u/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-u+e),n=c*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,Ze):Math.pow(i,Ze),n=n<0?-Math.pow(-n,Ze):Math.pow(n,Ze);const r=(-o-(i+n))/(3*a);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*o-3*a*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-o-2*i*n)/(3*a),h=(-o+i*(n+$e*Math.sin(e)))/(3*a),l=(-o+i*(n-$e*Math.sin(e)))/(3*a);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),l>=0&&l<=1&&(s[p++]=l)}}return p}(e,n,s,o,l,gi);if(0===c)return 0;let u=0,d=-1,p=0,g=0;for(let l=0;l<c;l++){const c=gi[l],f=0===c||1===c?.5:1;si(t,i,r,a,c)<h||(d<0&&(d=pi(e,n,s,o,fi),fi[1]<fi[0]&&d>1&&mi(),p=si(e,n,s,o,fi[0]),d>1&&(g=si(e,n,s,o,fi[1]))),2===d?c<fi[0]?u+=p<e?f:-f:c<fi[1]?u+=g<p?f:-f:u+=o<g?f:-f:c<fi[0]?u+=p<e?f:-f:u+=o<p?f:-f)}return u}function bi(t,e,i,n,r,s,a,o){if(o>e&&o>n&&o>s||o<e&&o<n&&o<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,a=2*(e-t),o=t-n;let h=0;if(Je(s)){if(Qe(a)){const t=-o/a;t>=0&&t<=1&&(r[h++]=t)}}else{const t=a*a-4*s*o;if(Je(t)){const t=-a/(2*s);t>=0&&t<=1&&(r[h++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*s),n=(-a-e)/(2*s);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,o,gi);if(0===h)return 0;const l=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(l>=0&&l<=1){let o=0;const c=ri(e,n,s,l);for(let n=0;n<h;n++){const h=0===gi[n]||1===gi[n]?.5:1;ri(t,i,r,gi[n])<a||(gi[n]<l?o+=c<e?h:-h:o+=s<c?h:-h)}return o}const c=0===gi[0]||1===gi[0]?.5:1;return ri(t,i,r,gi[0])<a?0:s<e?c:-c}function vi(t,i,n,r,s,a,o,h){if((h-=i)>n||h<-n)return 0;const l=Math.sqrt(n*n-h*h);gi[0]=-l,gi[1]=l;const c=Math.abs(r-s);if(c<1e-4)return 0;if(c>=e.pi2-1e-4){r=0,s=e.pi2;const i=a?1:-1;return o>=gi[0]+t&&o<=gi[1]+t?i:0}if(r>s){const t=r;r=s,s=t}r<0&&(r+=e.pi2,s+=e.pi2);let u=0;for(let i=0;i<2;i++){const n=gi[i];if(n+t>o){let t=Math.atan2(h,n),i=a?1:-1;t<0&&(t=e.pi2+t),(t>=r&&t<=s||t+e.pi2>=r&&t+e.pi2<=s)&&(t>e.pi/2&&t<1.5*e.pi&&(i=-i),u+=i)}}return u}function xi(t){return Math.round(t/e.pi*1e8)/1e8%2*e.pi}function Ai(t,i){let n=xi(t[0]);n<0&&(n+=e.pi2);const r=n-t[0];let s=t[1];s+=r,!i&&s-n>=e.pi2?s=n+e.pi2:i&&n-s>=e.pi2?s=n-e.pi2:!i&&n>s?s=n+(e.pi2-xi(n-s)):i&&n<s&&(s=n-(e.pi2-xi(s-n))),t[0]=n,t[1]=s}const Bi=[0,0];function Ti(t,e,i,n,r){const s=t,a=t.length;let o,h,l=0,c=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=s[t],g=0===t;a[0]===J.M&&t>1&&(i||(l+=oi(c,u,d,p,n,r))),g&&(c=a[1],u=a[2],d=c,p=u);const f=a[0],m=a[1],y=a[2],b=a[3],v=a[4],x=a[5],A=a[6];let B=v,T=x;Bi[0]=B,Bi[1]=T,Ai(Bi,Boolean(a[6])),B=Bi[0],T=Bi[1];const w=B,S=T-B,_=!!(1-(a[6]?0:1)),C=(n-m)*b/b+m;switch(f){case J.M:d=m,p=y,c=d,u=p;break;case J.L:if(i){if(ui(c,u,m,y,e,n,r))return!0}else l+=oi(c,u,m,y,n,r)||0;c=m,u=y;break;case J.C:if(i){if(li(c,u,m,y,b,v,x,A,e,n,r))return!0}else l+=yi(c,u,m,y,b,v,x,A,n,r)||0;c=x,u=A;break;case J.Q:if(i){if(hi(c,u,m,y,b,v,e,n,r))return!0}else l+=bi(c,u,m,y,b,v,n,r)||0;c=b,u=v;break;case J.A:if(o=Math.cos(w)*b+m,h=Math.sin(w)*b+y,g?(d=o,p=h):l+=oi(c,u,o,h,n,r),i){if(ci(m,y,b,w,w+S,_,e,C,r))return!0}else l+=vi(m,y,b,w,w+S,_,C,r);c=Math.cos(w+S)*b+m,u=Math.sin(w+S)*b+y;break;case J.R:if(d=c=m,p=u=y,o=d+b,h=p+v,i){if(ui(d,p,o,p,e,n,r)||ui(o,p,o,h,e,n,r)||ui(o,h,d,h,e,n,r)||ui(d,h,d,p,e,n,r))return!0}else l+=oi(o,p,o,h,n,r),l+=oi(d,h,d,p,n,r);break;case J.Z:if(i){if(ui(c,u,d,p,e,n,r))return!0}else l+=oi(c,u,d,p,n,r);c=d,u=p}}var g,f;return i||(g=u,f=p,Math.abs(g-f)<di)||(l+=oi(c,u,d,p,n,r)||0),0!==l}class wi{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=Ke(Object.assign({nativeCanvas:Oe.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Ke(Object.assign({nativeCanvas:Oe.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Si=new wi,_i=Symbol.for("VWindow"),Ci=Symbol.for("WindowHandlerContribution");var Pi;t.DefaultWindow=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new j(["x","y","width","height"])},this._uid=i.GenAutoIncrementId(),this.global=Oe.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;if(!t.env||this.actived)return;Ve.getNamed(Ci,t.env).configure(this,t),this.actived=!0}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t,e){this._handler.clearViewBox(t,e)}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},t.DefaultWindow=L([m(),D("design:paramtypes",[])],t.DefaultWindow),t.DefaultGraphicUtil=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=Oe.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=Si.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){var n;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=i;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:ue.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,i,n){return this.configure(this.global,this.global.env),new e.TextMeasure(Object.assign({defaultFontParams:{fontFamily:ue.fontFamily,fontSize:ue.fontSize},getCanvasForMeasure:n||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+e.TextMeasure.ALPHABET_CHAR_SET+e.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()},null!=i?i:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const n=Ve.get(_i),r=t.AABBBounds,s=r.width(),a=r.height();n.create({width:s,height:a,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const o=-r.x1,h=-r.y1,l=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(n,[t],{x:o,y:h,width:s,height:a,stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=l;const c=n.getNativeHandler();return c.nativeCanvas?c.nativeCanvas:null}},t.DefaultGraphicUtil=L([m(),I(0,g(N)),I(0,y(He)),D("design:paramtypes",[Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Pi||(Pi={}));const Ei=new e.Matrix;t.DefaultTransformUtil=class{constructor(){this.matrix=new e.Matrix}init(t){return this.mode=Pi.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=Pi.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(Ei.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:r}=i;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Ei.a,Ei.b,Ei.c,Ei.d,Ei.e,Ei.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(Ei.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:n}=e;this.outTargetMatrix.translate(i,n),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-n)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Ei.a,Ei.b,Ei.c,Ei.d,Ei.e,Ei.f),this}scale(t,e,i){return this.mode===Pi.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===Pi.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return Ei.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Ei.a,Ei.b,Ei.c,Ei.d,Ei.e,Ei.f),this}translate(t,e){return this.mode===Pi.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===Pi.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=L([m(),D("design:paramtypes",[])],t.DefaultTransformUtil);const Mi={arc:ye,area:be,circle:ve,line:Be,path:Te,symbol:Ce,text:Pe,rect:Se,rect3d:_e,polygon:we,richtext:Ee,richtextIcon:ke,image:Me,group:xe,glyph:Ae},ki=Object.keys(Mi);function Ri(){return{arc:Object.assign({},Mi.arc),area:Object.assign({},Mi.area),circle:Object.assign({},Mi.circle),line:Object.assign({},Mi.line),path:Object.assign({},Mi.path),symbol:Object.assign({},Mi.symbol),text:Object.assign({},Mi.text),rect:Object.assign({},Mi.rect),rect3d:Object.assign({},Mi.rect3d),polygon:Object.assign({},Mi.polygon),richtext:Object.assign({},Mi.richtext),richtextIcon:Object.assign({},Mi.richtextIcon),image:Object.assign({},Mi.image),group:Object.assign({},Mi.group),glyph:Object.assign({},Mi.glyph)}}function Oi(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Li=Ri();class Ii{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},ki.forEach((t=>{this._defaultTheme[t]=Object.create(Li[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,i,n=!1){if(this.dirty){const r=this.getParentWithTheme(t);if(r){const t=r.theme;(t.dirty||n)&&t.applyTheme(r,i,!0)}this.userTheme?this.doCombine(r&&r.theme.combinedTheme):(r?this.combinedTheme=r.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,e.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;ki.forEach((n=>{const r=Object.create(Li[n]);t&&t[n]&&Oi(r,t[n]),i[n]&&Oi(r,i[n]),e[n]&&Oi(r,e[n]),this.combinedTheme[n]=r})),e.common&&ki.forEach((t=>{Oi(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Di=new Ii;function Ui(t,e){return t.glyphHost?Ui(t.glyphHost):e?(t.isContainer,e):Ni(t)||Di.getTheme()}function Ni(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):Di.getTheme()}return null}class Wi extends e.EventEmitter{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=i.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return U(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,i){if(!this._ignoreWarn&&this._nodeList&&e.Logger.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),i>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===i)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let e=this._firstChild;for(let t=0;t<i;t++){if(!e)return null;t>0&&(e=e._next)}if(!e)return null;t._next=e._next,t._prev=e,e._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(){if(!this._idMap)return;let t=this._firstChild;for(;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n))&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,i,n){const r=e.isBoolean(n,!0)&&n||e.isObject(n)&&n.capture,s=e.isObject(n)&&n.once,a=e.isFunction(i)?void 0:i;return t=r?`${t}capture`:t,i=e.isFunction(i)?i:i.handleEvent,s?super.once(t,i,a):super.on(t,i,a),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,i,n){const r=e.isBoolean(n,!0)&&n||e.isObject(n)&&n.capture,s=e.isFunction(i)?void 0:i;t=r?`${t}capture`:t,i=e.isFunction(i)?i:i.handleEvent;const a=e.isObject(n)&&n.once;return super.off(t,i,s,a),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,i,n){return e.isObject(n)?(n.once=!0,this.addEventListener(t,i,n)):this.addEventListener(t,i,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Gi{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Gi.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation(),this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Fi extends Gi{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,a,o,h,l,c,u,d,p,g){throw new Error("Method not implemented.")}}class zi extends Fi{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new zi(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}class ji extends Fi{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new ji(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}ji.DOM_DELTA_PIXEL=0,ji.DOM_DELTA_LINE=1,ji.DOM_DELTA_PAGE=2;class Hi extends Gi{constructor(t,e){super(),this.type=t,this.detail=e}}const Vi="object"==typeof performance&&performance.now?performance:Date;function Yi(t){return"mouse"===t||"pen"===t}class Xi{constructor(t,i){this.dispatch=new e.EventEmitter,this.cursorTarget=null,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,i)=>{if(!(t instanceof zi))return void e.Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t,t.type,i);if(this.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType)this.dispatchEvent(n,"touchstart");else if(Yi(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),this.freeEvent(n)},this.onPointerMove=(t,i)=>{var n,r;if(!(t instanceof zi))return void e.Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=this.createPointerEvent(t,t.type,i),a=Yi(s.pointerType),o=this.trackingData(t.pointerId),h=this.findMountedTarget(o.overTargets);if(o.overTargets&&h&&h!==this.rootTarget&&h!==s.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,h||void 0);if(this.dispatchEvent(i,"pointerout"),a&&this.dispatchEvent(i,"mouseout"),!s.composedPath().includes(h)){const e=this.createPointerEvent(t,"pointerleave",h||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!s.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),a&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(h!==s.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(s,e);this.dispatchEvent(i,"pointerover"),a&&this.dispatchEvent(i,"mouseover");let n=null==h?void 0:h.parent;for(;n&&n!==this.rootTarget.parent&&n!==s.target;)n=n.parent;if(!n||n===this.rootTarget.parent){const t=this.clonePointerEvent(s,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==h&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),a&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(i)}const l="dispatchEvent";this[l](s,"pointermove"),"touch"===s.pointerType&&this[l](s,"touchmove"),a&&(this[l](s,"mousemove"),this.cursorTarget=s.target,this.cursor=(null===(r=null===(n=s.target)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.cursor)||this.rootTarget.getCursor()),o.overTargets=s.composedPath(),this.freeEvent(s)},this.onPointerOver=(t,i)=>{var n,r;if(!(t instanceof zi))return void e.Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=this.trackingData(t.pointerId),a=this.createPointerEvent(t,t.type,i),o=Yi(a.pointerType);this.dispatchEvent(a,"pointerover"),o&&this.dispatchEvent(a,"mouseover"),"mouse"===a.pointerType&&(this.cursorTarget=a.target,this.cursor=(null===(r=null===(n=a.target)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.cursor)||this.rootTarget.getCursor());const h=this.clonePointerEvent(a,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==this.rootTarget.parent;)h.currentTarget=h.target,this.notifyTarget(h),o&&this.notifyTarget(h,"mouseenter"),h.target=h.target.parent;s.overTargets=a.composedPath(),this.freeEvent(a),this.freeEvent(h)},this.onPointerOut=(t,i)=>{if(!(t instanceof zi))return void e.Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId);if(n.overTargets){const e=Yi(t.pointerType),i=this.findMountedTarget(n.overTargets),r=this.createPointerEvent(t,"pointerout",i||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",i||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;n.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,i)=>{var n;if(!(t instanceof zi))return void e.Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=Vi.now(),s=this.createPointerEvent(t,t.type,i);if(this.dispatchEvent(s,"pointerup"),"touch"===s.pointerType)this.dispatchEvent(s,"touchend");else if(Yi(s.pointerType)){const t=2===s.button;this.dispatchEvent(s,t?"rightup":"mouseup")}const a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.pressTargetsByButton[t.button]);let h=o;if(o&&!s.composedPath().includes(o)){let e=o;for(;e&&!s.composedPath().includes(e);){if(s.currentTarget=e,this.notifyTarget(s,"pointerupoutside"),"touch"===s.pointerType)this.notifyTarget(s,"touchendoutside");else if(Yi(s.pointerType)){const t=2===s.button;this.notifyTarget(s,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete a.pressTargetsByButton[t.button],h=e}if(h){const e=this.clonePointerEvent(s,"click");e.target=h,e.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:r});const i=a.clicksByButton[t.button];i.target===e.target&&r-i.timeStamp<(null!==(n=this._config.clickInterval)&&void 0!==n?n:200)?++i.clickCount:i.clickCount=1,i.target=e.target,i.timeStamp=r,e.detail=i.clickCount,Yi(e.pointerType)?(this.dispatchEvent(e,"click"),2===i.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===i.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(s)},this.onPointerUpOutside=(t,i)=>{if(!(t instanceof zi))return void e.Logger.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),r=this.findMountedTarget(n.pressTargetsByButton[t.button]),s=this.createPointerEvent(t,t.type,i);if(r){let e=r;for(;e;)s.currentTarget=e,this.notifyTarget(s,"pointerupoutside"),"touch"===s.pointerType?this.notifyTarget(s,"touchendoutside"):Yi(s.pointerType)&&this.notifyTarget(s,2===s.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete n.pressTargetsByButton[t.button]}this.freeEvent(s)},this.onWheel=(t,i)=>{if(!(t instanceof ji))return void e.Logger.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const n=this.createWheelEvent(t,i);this.dispatchEvent(n),this.freeEvent(n)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},i),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var i,n,r,s,a,o,h;if(!this.rootTarget)return;const l=this.mappingTable[t.type];let c;const u=`${t.canvasX}-${t.canvasY}`;if((null===(i=this._prePointTargetCache)||void 0===i?void 0:i[u])&&(null===(r=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[u])||void 0===r?void 0:r.stage)&&(null===(a=null===(s=this._prePointTargetCache)||void 0===s?void 0:s[u])||void 0===a?void 0:a.stage.renderCount)===(null===(o=this._prePointTargetCache)||void 0===o?void 0:o.stageRenderCount)?c=this._prePointTargetCache[u]:(c=this.pickTarget(t.canvasX,t.canvasY,t),t.pickParams||(this._prePointTargetCache={[u]:c,stageRenderCount:null!==(h=null==c?void 0:c.stage.renderCount)&&void 0!==h?h:-1})),l)for(let e=0,i=l.length;e<i;e++)l[e].fn(t,c);else e.Logger.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const n=this.allocateEvent(zi);return this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=i||this.pickTarget(n.global.x,n.global.y,n),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(ji);return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=e||this.pickTarget(i.global.x,i.global.y,i),i}clonePointerEvent(t,e){const i=this.allocateEvent(zi);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof zi&&e instanceof zi&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof Fi&&e instanceof Fi&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((i=>{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Vi.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}pickTarget(t,e,i){let n;const r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),n}}const Ki={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof Gi))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Hi(t,e))}},qi={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class $i{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized){(t.cancelable||!("cancelable"in t))&&t.preventDefault()}for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetElement(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:s,autoPreventDefault:a=!1,clickInterval:o}=t;this.manager=new Xi(n,{clickInterval:o}),this.globalObj=r,this.supportsPointerEvents=r.supportsPointerEvents,this.supportsTouchEvents=r.supportsTouchEvents,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=a,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new zi,this.rootWheelEvent=new ji,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.setTargetElement(null)}setCursor(t,i){if(!i&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:n,domElement:r}=this;if(this.currentCursor===t)return;this.currentCursor=t;const s=this.cursorStyles[t];s?"string"==typeof s&&n?r.style.cursor=s:"function"==typeof s?s(t):"object"==typeof s&&n&&Object.assign(r.style,s):n&&e.isString(t)&&!e.has(this.cursorStyles,t)&&(r.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){const e=this.viewport,{x:i,y:n}=t;return{x:i-e.x,y:n-e.y}}mapToCanvasPoint(t){var e;const i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;const{clientX:n,clientY:r}=t,s=this.domElement.getBoundingClientRect();return{x:n-s.left,y:r-s.top}}normalizeToPointerData(t){const i=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let n=0,r=t.changedTouches.length;n<r;n++){const r=t.changedTouches[n];e.isUndefined(r.button)&&(r.button=0),e.isUndefined(r.buttons)&&(r.buttons=1),e.isUndefined(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),e.isUndefined(r.width)&&(r.width=r.radiusX||1),e.isUndefined(r.height)&&(r.height=r.radiusY||1),e.isUndefined(r.tiltX)&&(r.tiltX=0),e.isUndefined(r.tiltY)&&(r.tiltY=0),e.isUndefined(r.pointerType)&&(r.pointerType="touch"),e.isUndefined(r.pointerId)&&(r.pointerId=r.identifier||0),e.isUndefined(r.pressure)&&(r.pressure=r.force||.5),e.isUndefined(r.twist)&&(r.twist=0),e.isUndefined(r.tangentialPressure)&&(r.tangentialPressure=0),e.isUndefined(r.layerX)&&(r.layerX=r.offsetX=r.clientX),e.isUndefined(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,i.push(r)}else if(this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent))i.push(t);else{const n=t;e.isUndefined(n.isPrimary)&&(n.isPrimary=!0),e.isUndefined(n.width)&&(n.width=1),e.isUndefined(n.height)&&(n.height=1),e.isUndefined(n.tiltX)&&(n.tiltX=0),e.isUndefined(n.tiltY)&&(n.tiltY=0),e.isUndefined(n.pointerType)&&(n.pointerType="mouse"),e.isUndefined(n.pointerId)&&(n.pointerId=1),e.isUndefined(n.pressure)&&(n.pressure=.5),e.isUndefined(n.twist)&&(n.twist=0),e.isUndefined(n.tangentialPressure)&&(n.tangentialPressure=0),n.isNormalized=!0,i.push(n)}return i}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.x=i,e.global.y=n,e.offset.x=i,e.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.x=i,t.global.y=n,t.offset.x=i,t.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=qi[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Vi.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetElement(t){let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);return e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}class Zi{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Zi.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class Ji{static Avaliable(){return!0}avaliable(){return Ji.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Qi{static Avaliable(){return!!Oe.global.getRequestAnimationFrame()}avaliable(){return Qi.Avaliable()}tick(t,e){Oe.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var tn;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(tn||(tn={}));class en{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===tn.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=tn.INITIAL,Oe.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),Oe.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:Qi},{mode:"timeout",cons:Ji},{mode:"manual",cons:Zi}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new Qi;break;case"timeout":t=new Ji;break;case"manual":t=new Zi;break;default:e.Logger.getInstance().warn("非法的计时器模式"),t=new Qi}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==tn.INITIAL&&(this.status=tn.PAUSE,!0)}resume(){return this.status!==tn.INITIAL&&(this.status=tn.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(t=!1){if(this.status===tn.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===tn.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=tn.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=tn.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class nn{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(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}static bounceIn(t){return 1-nn.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*nn.bounceIn(2*t):.5*nn.bounceOut(2*t-1)+.5}static getElasticIn(t,i){return function(n){if(0===n||1===n)return n;const r=i/e.pi2*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-r)*e.pi2/i)}}static getElasticOut(t,i){return function(n){if(0===n||1===n)return n;const r=i/e.pi2*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-r)*e.pi2/i)+1}}static getElasticInOut(t,i){return function(n){const r=i/e.pi2*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-r)*e.pi2/i)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-r)*e.pi2/i)*.5+1}}}nn.quadIn=nn.getPowIn(2),nn.quadOut=nn.getPowOut(2),nn.quadInOut=nn.getPowInOut(2),nn.cubicIn=nn.getPowIn(3),nn.cubicOut=nn.getPowOut(3),nn.cubicInOut=nn.getPowInOut(3),nn.quartIn=nn.getPowIn(4),nn.quartOut=nn.getPowOut(4),nn.quartInOut=nn.getPowInOut(4),nn.quintIn=nn.getPowIn(5),nn.quintOut=nn.getPowOut(5),nn.quintInOut=nn.getPowInOut(5),nn.backIn=nn.getBackIn(1.7),nn.backOut=nn.getBackOut(1.7),nn.backInOut=nn.getBackInOut(1.7),nn.elasticIn=nn.getElasticIn(1,.3),nn.elasticOut=nn.getElasticOut(1,.3),nn.elasticInOut=nn.getElasticInOut(1,.3*1.5);class rn{constructor(){this.id=i.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(e){if(this.paused)return;let i=this.animateHead;for(this.animateCount=0;i;)i.status===t.AnimateStatus.END?this.removeAnimate(i):i.status===t.AnimateStatus.RUNNING||i.status===t.AnimateStatus.INITIAL?(this.animateCount++,i.advance(e)):i.status===t.AnimateStatus.PAUSED&&this.animateCount++,i=i.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const sn=new rn;class an{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class on extends an{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class hn{constructor(e=i.GenAutoIncrementId(),n=sn){this.id=e,this.timeline=n,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new ln(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let i=-1/0;return t.forEach((t=>{i=e.max(t.getDuration(),i)})),this._startTime=i,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){hn.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e,i=hn.mode){e&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}runCb(t){const e=new on((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const a=hn.interpolateMap.get(t)||hn.interpolateMap.get("");return!!a&&a(t,e,i,n,r,s)}pause(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}resume(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new ln(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((t=>t())));this.setPosition(this.rawPosition+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===n)return s;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=t.AnimateStatus.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}hn.mode=t.AnimateMode.NORMAL,hn.interpolateMap=new Map;class ln{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new cn(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(e){let i=e.duration;(null==i||i<0)&&(i=0);const n=e.easing,r="string"==typeof n?nn[n]:n,s=this._addStep(i,null,r);return s.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),s,!1),this._appendCustomAnimate(e,s),this}to(e,i,n,r){(null==i||i<0)&&(i=0);const s="string"==typeof n?nn[n]:n,a=this._addStep(i,null,s);return a.type=t.AnimateStepType.to,this._appendProps(e,a,!!r&&r.tempProps),a.propKeys||(a.propKeys=Object.keys(a.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(a.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new cn(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let s,a,o=!1;const h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0)return o=!0,o;if(s=Math.floor(t/i),a=t-s*i,o=t>=n*i+i,o&&(a=i,s=n,t=a*s+i),t===r)return o;const l=!this.reversed!=!(this.bounce&&s%2);return l&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+h,this.updatePosition(o,l),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let a=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,i){let n=i.prev;for(;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){const e=n.customAnimate.getEndProps()[t];if(void 0!==e)return e}n=n.prev}return e.Logger.getInstance().warn("未知错误,step中找不到属性"),i.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class cn{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const un={duration:200,easing:"cubicOut"},dn={duration:1e3,easing:"quadInOut"};var pn;t.Edge=void 0,(pn=t.Edge||(t.Edge={}))[pn.Top=1]="Top",pn[pn.Right=2]="Right",pn[pn.Bottom=4]="Bottom",pn[pn.Left=8]="Left",pn[pn.ALL=15]="ALL";const gn=[!1,!1,!1,!1],fn=t=>{var i;let n=!0;if(e.isBoolean(t,!0)){for(let e=0;e<4;e++)gn[e]=t,n&&(n=!(null!==(i=gn[e])&&void 0!==i&&!i));n=t}else if(Array.isArray(t))for(let e=0;e<4;e++)gn[e]=!!t[e],n&&(n=!!gn[e]);else gn[0]=!1,gn[1]=!1,gn[2]=!1,gn[3]=!1;return{isFullStroke:n,stroke:gn}},mn=[0,0,0,0],yn=t=>t?e.isArray(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(mn[0]=t[0],mn[2]=t[0],mn[1]=t[1],mn[3]=t[1],mn):t:t:0,bn=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],vn=[1,2,3,0,1,2,3,0];function xn(t,i,n,r){for(;t>=e.pi2;)t-=e.pi2;for(;t<0;)t+=e.pi2;for(;t>i;)i+=e.pi2;bn[0].x=n,bn[1].y=n,bn[2].x=-n,bn[3].y=-n;const s=Math.ceil(t/e.halfPi)%4,a=Math.ceil(i/e.halfPi)%4;if(r.add(e.cos(t)*n,e.sin(t)*n),r.add(e.cos(i)*n,e.sin(i)*n),s!==a||i-t>e.pi){let t=!1;for(let e=0;e<vn.length;e++)if(t||s!==vn[e]){if(t&&a===vn[e])break;if(t){const t=bn[vn[e]];r.add(t.x,t.y)}}else{t=!0;const e=bn[s];r.add(e.x,e.y)}}}function An(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function Bn(t,i,n){const{x:r,y:s}=e.pointAt(t.x,t.y,i.x,i.y,n),{x:a,y:o}=e.pointAt(t.x1,t.y1,i.x1,i.y1,n),h=new e.Point(r,s,a,o);return h.defined=i.defined,h}function Tn(t,i,n){if(!t||!i)return[];Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);let r=[];if(t.length>i.length){r=i.map((t=>{const i=new e.Point(t.x,t.y,t.x1,t.y1);return i.defined=t.defined,i}));for(let e=0;e<i.length;e++)r[e]=Bn(t[e],i[e],n)}else{r=i.map((t=>{const i=new e.Point(t.x,t.y,t.x1,t.y1);return i.defined=t.defined,i}));for(let e=0;e<t.length;e++)r[e]=Bn(t[e],i[e],n)}return r}const wn=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],Sn=t=>wn.includes(t);function _n(t,i){if(e.isArray(t)){let e;for(let n=0;n<t.length&&void 0===e;n++)e=t[n][i];return e}return t[i]}class Cn{constructor(){this.durations=[],this.timeout=Cn.TimeOut,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}Cn.TimeOut=1e3/60;const Pn=new Cn,En=(t,i)=>{if(e.isString(t)&&"%"===t[t.length-1]){return i*(Number.parseFloat(t.substring(0,t.length-1))/100)}return t};var Mn;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(Mn||(Mn={}));class kn extends an{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0:r.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function Rn(t,e,i,n,r,s){const a=(e-t)*r+t,o=(i-e)*r+e,h=(n-i)*r+i,l=(o-a)*r+a,c=(h-o)*r+o,u=(c-l)*r+l;s[0]=t,s[1]=a,s[2]=l,s[3]=u,s[4]=u,s[5]=c,s[6]=h,s[7]=n}function On(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],a=i<n?t:e,o=Math.min(i,n),h=Math.abs(n-i)/6,l=(o-2)/6,c=Math.ceil(h/l),u=[a[0],a[1]];let d=h;for(let t=2;t<o;t+=6){let e=a[t-2],i=a[t-1],n=a[t],o=a[t+1],h=a[t+2],l=a[t+3];const p=a[t+4],g=a[t+5];if(d<=0){u.push(n,o,h,l,p,g);continue}const f=Math.min(d,c)+1;for(let t=1;t<=f;t++){const a=t/f;Rn(e,n,h,p,a,r),Rn(i,o,l,g,a,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],o=s[5],h=r[6],l=s[6]}d-=f-1}return a===t?[u,e]:[t,u]}function Ln(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],a=[];for(let t=0;t<e.length;t+=2)a[t]=r,a[t+1]=s;return a}function In(t){const e=[],i=t.length;for(let n=0;n<i;n+=2)e[n]=t[i-n-2],e[n+1]=t[i-n-1];return e}function Dn(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,a=r-2;s<r;a=s,s+=2){const r=t[a],o=t[a+1],h=t[s],l=t[s+1],c=r*l-h*o;e+=c,i+=(r+h)*c,n+=(o+l)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function Un(t,e,i,n){const r=(t.length-2)/6;let s=1/0,a=0;const o=t.length,h=o-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<o;s+=2){const a=0===s?r:(r+s-2)%h+2,o=t[a]-i[0],l=t[a+1]-i[1],u=e[s]-n[0]-o,d=e[s+1]-n[1]-l;c+=u*u+d*d}c<s&&(s=c,a=l)}return a}function Nn(t,e,i,n){const r=[];let s;for(let a=0;a<t.length;a++){let o=t[a];const h=e[a],l=Dn(o),c=Dn(h);null==s&&(s=l[2]<0!=c[2]<0);const u=[],d=[];let p=0,g=1/0;const f=[],m=o.length;s&&(o=In(o));const y=6*Un(o,h,l,c),b=m-2;for(let t=0;t<b;t+=2){const e=(y+t)%b+2;u[t+2]=o[e]-l[0],u[t+3]=o[e+1]-l[1]}if(u[0]=o[y]-l[0],u[1]=o[y+1]-l[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<o.length;e+=2){const r=u[e],s=u[e+1],a=h[e]-c[0],o=h[e+1]-c[1],l=a*i-o*t,d=a*t+o*i;f[e]=l,f[e+1]=d;const p=l-r,g=d-s;n+=p*p+g*g}if(n<g){g=n,p=e;for(let t=0;t<f.length;t++)d[t]=f[t]}}}else for(let t=0;t<m;t+=2)d[t]=h[t]-c[0],d[t+1]=h[t+1]-c[1];r.push({from:u,to:d,fromCp:l,toCp:c,rotation:-p})}return r}function Wn(t,e){let i,n;const r=[],s=[];for(let a=0;a<Math.max(t.length,e.length);a++){const o=t[a],h=e[a];let l,c;o?h?([l,c]=On(o,h),i=l,n=c):(c=Ln(n,o),l=o):(l=Ln(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const Gn=(t,i,n,r,s)=>{e.isNumberClose(i,r)&&e.isNumberClose(n,s)||t.push(i,n,r,s,r,s)};function Fn(t){const i=t.commandList,n=[];let r,s=0,a=0,o=0,h=0;const l=(t,e)=>{r&&r.length>2&&n.push(r),r=[t,e]};let c,u,d,p;for(let t=0,n=i.length;t<n;t++){const n=i[t],g=0===t;switch(g&&(o=s=n[1],h=a=n[2],[J.L,J.C,J.Q].includes(n[0])&&(r=[o,h])),n[0]){case J.M:s=o=n[1],a=h=n[2],l(o,h);break;case J.L:c=n[1],u=n[2],Gn(r,s,a,c,u),s=c,a=u;break;case J.C:r.push(n[1],n[2],n[3],n[4],s=n[5],a=n[6]);break;case J.Q:c=n[1],u=n[2],d=n[3],p=n[4],r.push(s+2/3*(c-s),a+2/3*(u-a),d+2/3*(c-d),p+2/3*(u-p),d,p),s=d,a=p;break;case J.A:{const t=n[1],e=n[2],i=n[3],d=i,p=n[4],f=n[5],m=!!n[6];c=Math.cos(p)*i+t,u=Math.sin(p)*i+e,g?(o=c,h=u,l(o,h)):Gn(r,s,a,c,u),s=Math.cos(f)*i+t,a=Math.sin(f)*i+e;const y=(m?-1:1)*Math.PI/2;for(let n=p;m?n>f:n<f;n+=y){const s=m?Math.max(n+y,f):Math.min(n+y,f);bt(r,n,s,t,e,i,d)}break}case J.E:{const t=n[1],i=n[2],d=n[3],p=n[4],f=n[5],m=n[6],y=n[7]+m,b=!!n[8],v=!e.isNumberClose(f,0),x=Math.cos(f),A=Math.sin(f);let B=Math.cos(m)*d,T=Math.sin(m)*p;v?(c=B*x-T*A+t,u=B*A+T*x+i):(c=B+t,u=T+i),g?(o=c,h=u,l(o,h)):Gn(r,s,a,c,u),B=Math.cos(y)*d,T=Math.sin(y)*p,v?(s=B*x-T*A+t,a=B*A+T*x+i):(s=B+t,a=T+i);const w=(b?-1:1)*Math.PI/2;for(let e=m;b?e>y:e<y;e+=w){const n=b?Math.max(e+w,y):Math.min(e+w,y);if(bt(r,e,n,t,i,d,p),v){const e=r.length;for(let n=e-6;n<=e-1;n+=2)B=r[n],T=r[n+1],r[n]=(B-t)*x-(T-i)*A+t,r[n+1]=(B-t)*A+(T-i)*x+i}}break}case J.R:o=s=n[1],h=a=n[2],c=o+n[3],u=h+n[4],l(c,h),Gn(r,c,h,c,u),Gn(r,c,u,o,u),Gn(r,o,u,o,h),Gn(r,o,h,c,h);break;case J.AT:{const t=n[1],i=n[2],l=n[3],c=n[4],u=n[5],d=e.PointService.distancePP({x:s,y:a},{x:t,y:i}),p=e.PointService.distancePP({x:l,y:c},{x:t,y:i}),g=((s-t)*(l-t)+(a-i)*(c-i))/(d*p),f=u/Math.sin(g/2),m=(s+l-2*t)/2,y=(a+c-2*i)/2,b=e.PointService.distancePP({x:m,y:y},{x:0,y:0}),v=t+f*m/b,x=l+f*y/b,A=Math.sqrt(f*f-u*u);o=t+A*(s-t)/d,h=i+A*(a-i)/d,Gn(r,s,a,o,h),s=t+A*(l-t)/p,a=i+A*(c-i)/p;const B=e.getAngleByPoint({x:v,y:x},{x:o,y:h}),T=e.getAngleByPoint({x:v,y:x},{x:s,y:a});bt(r,B,T,v,x,u,u);break}case J.Z:r&&Gn(r,s,a,o,h),s=o,a=h}}return r&&r.length>2&&n.push(r),n}function zn(t,e){for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t+=2){const i=n[t],r=n[t+1],s={x:i,y:r};e.transformPoint({x:i,y:r},s),n[t]=s.x,n[t+1]=s.y}}}function jn(t){const e=new ne;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}function Hn(t,e,i){const n=t/e;let r,s;t>=e?(s=Math.ceil(Math.sqrt(i*n)),r=Math.floor(i/s),0===r&&(r=1,s=i)):(r=Math.ceil(Math.sqrt(i/n)),s=Math.floor(i/r),0===s&&(s=1,r=i));const a=[];for(let t=0;t<r;t++)a.push(s);const o=i-r*s;if(o>0)for(let t=0;t<o;t+=s)t+s<o?a.push(s):a.push(o-t);return a}const Vn=(t,e)=>{const i=t.getComputedAttribute("width"),n=t.getComputedAttribute("height"),r=Hn(i,n,e),s=[],a=n/r.length;for(let t=0,e=r.length;t<e;t++){const e=r[t],n=i/e;for(let i=0;i<e;i++)s.push({x:0+i*n,y:0+t*a,width:n,height:a})}return s},Yn=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),a=t.getComputedAttribute("outerRadius"),o=Math.abs(n-r),h=Math.abs(a-s),l=Hn(o*(s+a)/2,h,e),c=[],u=h/l.length,d=a>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[t],i=o/e;for(let r=0;r<e;r++)c.push({innerRadius:a-u*t*d,outerRadius:a-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Xn=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),a=Hn(s*r,r,e),o=[],h=s/a[0],l=r/a.length,c=n>=i?1:-1;for(let t=0,e=a.length;t<e;t++)for(let e=0,n=a[t];e<n;e++)o.push({innerRadius:l*t,outerRadius:l*(t+1),startAngle:i+h*e*c,endAngle:i+h*(e+1)*c});return o},Kn=(t,i)=>{const n=t.filter((t=>!1!==t.defined&&e.isNumber(t.x)&&e.isNumber(t.y)));if(0===n.length)return[];if(1===n.length)return new Array(i).fill(0).map((t=>n[0]));const r=[];if(i<=n.length){const t=n.length/i;let e=0,s=0;for(;e<i;)r.push(n[Math.floor(s)]),s+=t,e++;return r}const s=i-n.length,a=1/(s/(n.length-1)+1);let o=0;for(let e=0,i=t.length;e<i;e++)if(r.push(t[e]),e<i-1){let i=a;const n=t[e].x,h=t[e].y,l=t[e+1].x,c=t[e+1].y;for(;i<1&&o<s;)r.push({x:n+(l-n)*i,y:h+(c-h)*i}),i+=a,o+=1}return r},qn=(t,i)=>{var n,r;const s=t.attribute;let a=s.points;const o=s.segments;a||(a=o.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]));const h=a.filter((t=>!1!==t.defined&&e.isNumber(t.x)&&e.isNumber(t.y)));if(!h.length)return[];const l=[];h.forEach((t=>{l.push({x:t.x,y:t.y})}));for(let t=h.length-1;t>=0;t--){const e=h[t];l.push({x:null!==(n=e.x1)&&void 0!==n?n:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y})}const c=[];return tr(a,i,c),c},$n=(t,e)=>{const i=t.attribute,n=i.points;if(n)return Kn(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]);return Kn(t,e)}return[]};const Zn=t=>t.map((t=>({x:t.x,y:t.y}))),Jn=(t,i,n)=>{const r=t.length,s=[];for(let h=0;h<r;h++){const l=t[h],c=h===r-1?t[0]:t[h+1],u=e.getIntersectPoint([i.x,i.y],[n.x,n.y],[l.x,l.y],[c.x,c.y]);u&&"boolean"!=typeof u&&s.push({dot:(a=[u[0]-i.x,u[1]-i.x],o=[n.x-i.x,n.y-i.x],a[0]*o[1]-a[1]*o[0]),point:{x:u[0],y:u[1]},edgeIndex:h})}var a,o;if(s.length<2)return[Zn(t),Zn(t)];s.sort(((t,e)=>t.dot-e.dot));let h=s[0],l=s[s.length-1];h.edgeIndex>l.edgeIndex&&([h,l]=[l,h]);const c=h.point,u=l.point,d=[{x:c.x,y:c.y}];for(let e=h.edgeIndex+1;e<=l.edgeIndex;e++)d.push({x:t[e].x,y:t[e].y});d.push({x:u.x,y:u.y});const p=[{x:u.x,y:u.y}];for(let e=l.edgeIndex+1,i=h.edgeIndex+r;e<=i;e++){const i=t[e%r];p.push({x:i.x,y:i.y})}return p.push({x:c.x,y:c.y}),[d,p]},Qn=t=>{const i=new e.Bounds;t.forEach((t=>{i.add(t.x,t.y)}));const n=i.width(),r=i.height();if(n>=r){const e=i.x1+n/2;return Jn(t,{x:e,y:i.y1},{x:e,y:i.y2})}const s=i.y1+r/2;return Jn(t,{x:i.x1,y:s},{x:i.x2,y:s})},tr=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Qn(t);tr(r[0],n,i),tr(r[1],e-n,i)}},er=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Zn(i)}];const n=[];return tr(i,e,n),n},ir=(t,e)=>{const i=Fn(t.getParsedPathShape());if(!i.length||e<0)return[];const n=i.length;if(i.length>=e){const t=[],r=Math.floor(i.length/e);for(let s=0;s<e;s++){const a=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:jn(a)})}return t}const r=[],s=Math.floor(e/n);let a=e;for(let t=0;t<n;t++){const e=[];for(let n=2,r=i[t].length;n<r;n+=2)e.push({x:i[0][n],y:i[0][n+1]});tr(e,t===n-1?a:s,r),a-=s}return r};var nr;t.ColorType=void 0,(nr=t.ColorType||(t.ColorType={}))[nr.Color255=0]="Color255",nr[nr.Color1=1]="Color1";class rr{static Get(i,n=t.ColorType.Color1,r=[0,0,0,1]){if(n===t.ColorType.Color1){const t=rr.store1[i];if(t)return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r;const n=e.Color.parseColorString(i);if(n){const t=[n.r/255,n.g/255,n.b/255,n.opacity];rr.store1[i]=t,rr.store255[i]=[n.r,n.g,n.b,n.opacity],r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3]}return r}const s=rr.store255[i];if(s)return r[0]=s[0],r[1]=s[1],r[2]=s[2],r[3]=s[3],r;const a=e.Color.parseColorString(i);return a&&(rr.store1[i]=[a.r/255,a.g/255,a.b/255,a.opacity],rr.store255[i]=[a.r,a.g,a.b,a.opacity],r[0]=a.r,r[1]=a.g,r[2]=a.b,r[3]=a.opacity),r}static Set(e,i,n){if(i===t.ColorType.Color1){if(rr.store1[e])return;rr.store1[e]=n,rr.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(rr.store255[e])return;rr.store255[e]=n,rr.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function sr(t,e=!1){return Array.isArray(t)?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function ar(e,i,n,r,s){if(!e||!i)return e&&sr(e)||i&&sr(i)||!1;let a,o,h=!1,l=!1;if(Array.isArray(e)?a=e:"string"==typeof e?a=rr.Get(e,t.ColorType.Color255):h=!0,Array.isArray(i)?o=i:"string"==typeof i?o=rr.Get(i,t.ColorType.Color255):l=!0,h!==l){const t=h?e:i,a=h?i:e,o=Object.assign(Object.assign({},t),{stops:t.stops.map((t=>Object.assign(Object.assign({},t),{color:sr(a)})))});return h?ar(t,o,n,r,s):ar(o,t,n,r,s)}if(h){if(e.gradient===i.gradient){const t=e,r=i,s=t.stops,a=r.stops;if(s.length!==a.length)return!1;if("linear"===t.gradient)return or(t,r,n);if("radial"===t.gradient)return hr(t,r,n);if("conical"===t.gradient)return lr(t,r,n)}return!1}s&&s(a,o);return sr(cr(a,o,n),r)}function or(t,e,i){const n=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:pr(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function hr(t,e,i){const n=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:pr(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function lr(t,e,i){const n=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:pr(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function cr(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}rr.store255={},rr.store1={};const ur=[0,0,0,0],dr=[0,0,0,0];function pr(e,i,n){return rr.Get(e,t.ColorType.Color255,ur),rr.Get(i,t.ColorType.Color255,dr),`rgba(${Math.round(ur[0]+(dr[0]-ur[0])*n)},${Math.round(ur[1]+(dr[1]-ur[1])*n)},${Math.round(ur[2]+(dr[2]-ur[2])*n)},${ur[3]+(dr[3]-ur[3])*n})`}Object.keys(e.DEFAULT_COLORS).forEach((t=>{e.DEFAULT_COLORS[t]}));const gr=(t,e,i)=>{t.forEach((t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){const n=ar(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},fr=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const a=t[s],o=a.from,h=a.to,l=a.rotation*i,c=a.fromCp,u=a.toCp,d=Math.sin(l),p=Math.cos(l);r[0]=c[0]+(u[0]-c[0])*i,r[1]=c[1]+(u[1]-c[1])*i;for(let t=0;t<o.length;t+=2){const e=o[t],s=o[t+1],a=e*(1-i)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=a*p-l*d+r[0],n[t+1]=a*d+l*p+r[1]}let g=n[0],f=n[1];e.moveTo(g,f);for(let t=2;t<o.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],a=n[t+3],o=n[t+4],h=n[t+5];g===i&&f===r&&s===o&&a===h?e.lineTo(o,h):e.bezierCurveTo(i,r,s,a,o,h),g=o,f=h}}},mr=(t,e,i)=>{const n=t?Fn(t):[],r=Fn(e);i&&n&&(i.fromTransform&&zn(n,i.fromTransform.clone().getInverse()),zn(n,i.toTransfrom));const[s,a]=Wn(n,r);return t?Nn(s,a,10,Math.PI):a.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},yr=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],br=(i,n)=>{if(!i||!n)return null;const r=[];let s=!1;return Object.keys(i).forEach((a=>{if(!yr.includes(a))return;const o=n[a];e.isNil(o)||e.isNil(i[a])||o===i[a]||("fill"===a||"stroke"===a?r.push({from:"string"==typeof i[a]?rr.Get(i[a],t.ColorType.Color255):i[a],to:"string"==typeof o?rr.Get(o,t.ColorType.Color255):o,key:a}):r.push({from:i[a],to:o,key:a}),s=!0)})),s?r:null};class vr extends an{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;fr(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&gr(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const xr=(t,e,i,n)=>{var r,s,a;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let o=null==t?void 0:t.globalTransMatrix;n&&o&&(o=n.clone().multiply(o.a,o.b,o.c,o.d,o.e,o.f));const h=mr(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:o,toTransfrom:e.globalTransMatrix}),l=br(null==t?void 0:t.attribute,e.attribute),c=e.animate(i);return(null==i?void 0:i.delay)&&c.wait(i.delay),c.play(new vr({morphingData:h,otherAttrs:l},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:dn.duration,null!==(a=null==i?void 0:i.easing)&&void 0!==a?a:dn.easing)),c};class Ar extends an{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{var n;fr(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(n=this.otherAttrs)||void 0===n?void 0:n[i])&&this.otherAttrs[i].length&&gr(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const Br=t=>{const e={};return Object.keys(t).forEach((i=>{Sn(i)||(e[i]=t[i])})),e},Tr=(t,e,i)=>{const n=Br(t.attribute),r=t.attachShadow();if(e.length)r.setTheme({[e[0].type]:n}),e.forEach((t=>{r.appendChild(t)}));else{const s=t.AABBBounds,a=s.width(),o=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=Oe.graphicService.creator.rect({x:0,y:0,width:a,height:o});r.appendChild(i),e.push(i)}))}},wr=(t,e,i)=>{const n=[],r=i?null:Br(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new ne).fromCustomPath2D(s)};n.push(Oe.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&Tr(t,n,e),n},Sr=(t,e,i)=>{const n=[],r=i?null:Br(t.attribute);if("rect"===t.type){Vn(t,e).forEach((t=>{n.push(Oe.graphicService.creator.rect(i?t:Object.assign({},r,t)))}))}else if("arc"===t.type){Yn(t,e).forEach((t=>{n.push(Oe.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("circle"===t.type){Xn(t,e).forEach((t=>{n.push(Oe.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("line"===t.type){const s=$n(t,e),a={size:10,symbolType:"circle"};s.forEach((t=>{n.push(Oe.graphicService.creator.symbol(i?Object.assign({},t,a):Object.assign({},r,t,a)))}))}else if("polygon"===t.type){er(t,e).forEach((t=>{n.push(Oe.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("area"===t.type){qn(t,e).forEach((t=>{n.push(Oe.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("path"===t.type){ir(t,e).forEach((t=>{"path"in t?n.push(Oe.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(Oe.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}return i&&Tr(t,n,e),n};class _r{static GetImage(t,e){var i;let n=_r.cache.get(t);n?"fail"===n.loadState?Oe.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},_r.cache.set(t,n),n.dataPromise=Oe.global.loadImage(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){var i;let n=_r.cache.get(t);n?"fail"===n.loadState?Oe.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&Oe.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},_r.cache.set(t,n),n.dataPromise=Oe.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=_r.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},_r.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Oe.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Oe.global.loadBlob(t):"json"===e&&(i.dataPromise=Oe.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}}_r.cache=new Map;const Cr=new e.Matrix,Pr=new e.AABBBounds,Er=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Mr=["x","y"],kr=["scaleX","scaleY"],Rr=["angle"],Or=new e.Point,Lr={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class Ir extends Wi{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(Ir.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(i={}){super(),this._AABBBounds=new e.AABBBounds,this._updateTag=t.UpdateTag.INIT,this.attribute=i,this.valid=this.isValid(),i.background&&this.loadImage(i.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,n;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Or.x=r+(null!==(i=t.scrollX)&&void 0!==i?i:0),Or.y=s+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else Or.x=r,Or.y=s;return Or}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Oe.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),Oe.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this.AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new e.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(i,n,r,s){if(!s)return!1;if(r===t.IContainPointMode.GLOBAL){const t=new e.Point(i,n);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),i=t.x,n=t.y}return s.containsPoint(this,{x:i,y:n})}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,i,n,r){var s;const a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:i},this.attribute,t,r);a?this._setAttributes(a,n,r):e.isNil(null===(s=this.normalAttrs)||void 0===s?void 0:s[t])?(this.attribute[t]=i,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r)):this.normalAttrs[t]=i,"background"===t&&this.loadImage(i,!0)}needUpdateTags(t,e=Er){for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t,e=Er){for(let i=0;i<e.length;i++){if(t===e[i])return!0}return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background&&this.loadImage(e.background,!0),this._updateTag=t.UpdateTag.INIT,this.onAttributeUpdate(i)}translate(e,i){var n,r;if(0===e&&0===i)return this;const s={type:t.AttributeUpdateType.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Mr,s);a&&(e=a.x,i=a.y,delete a.x,delete a.y,this._setAttributes(a));const o=this.attribute,h=o.postMatrix;return h?Oe.transformUtil.fromMatrix(h,h).translate(e,i):(o.x=(null!==(n=o.x)&&void 0!==n?n:oe.x)+e,o.y=(null!==(r=o.y)&&void 0!==r?r:oe.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Mr,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}scale(i,n,r){var s,a;if(1===i&&1===n)return this;const o={type:t.AttributeUpdateType.SCALE},h=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:i,scaleY:n,scaleCenter:r},this.attribute,kr,o);h&&(i=h.scaleX,n=h.scaleY,delete h.scaleX,delete h.scaleY,this._setAttributes(h));const l=this.attribute;if(r){let{postMatrix:t}=this.attribute;t||(t=new e.Matrix,l.postMatrix=t),Oe.transformUtil.fromMatrix(t,t).scale(i,n,r)}else l.scaleX=(null!==(s=l.scaleX)&&void 0!==s?s:oe.scaleX)*i,l.scaleY=(null!==(a=l.scaleY)&&void 0!==a?a:oe.scaleY)*n;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,kr,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}rotate(i,n){var r;if(0===i)return this;const s={type:t.AttributeUpdateType.ROTATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:i,rotateCenter:n},this.attribute,Rr,s);a&&(delete a.angle,this._setAttributes(a,!1,s));const o=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new e.Matrix,o.postMatrix=t),Oe.transformUtil.fromMatrix(t,t).rotate(i,n)}else o.angle=(null!==(r=o.angle)&&void 0!==r?r:oe.angle)+i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}rotateTo(e){const i=this.attribute;if(i.angle===e)return this;const n={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,Rr,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new hn(null==t?void 0:t.id).bind(this);if(t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Oe.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!e.isNil(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(e,i,n,r){var s,a,o,h;if(n){const n=Object.keys(e),l=this.getNoWorkAnimateAttr(),c={};let u;r?n.forEach((t=>{l[t]?(u||(u={}),u[t]=e[t]):c[t]=void 0===e[t]?this.getDefaultAttribute(t):e[t]})):n.forEach((t=>{l[t]?(u||(u={}),u[t]=e[t]):c[t]=e[t]}));const d=this.animate();d.stateNames=i,d.to(c,null!==(a=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==a?a:un.duration,null!==(h=null===(o=this.stateAnimateConfig)||void 0===o?void 0:o.easing)&&void 0!==h?h:un.easing),u&&this.setAttributes(u,!1,{type:t.AttributeUpdateType.STATE})}else this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}getNormalAttribute(t){let i=this.attribute[t];return this.animates&&this.animates.forEach((n=>{if(n.stateNames){const r=n.getEndProps();e.has(r,t)&&(i=r[t])}})),i}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else{if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={};t.forEach((e=>{var i;const r=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];r&&Object.assign(n,r)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:n}=this.attribute;return Pr.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Pr),this.setAttributes({scaleX:t,scaleY:i,angle:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,r=n();i[0]=r.x1+(r.x2-r.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,r=n();i[1]=r.y1+(r.y2-r.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=oe.x,y:i=oe.y,scaleX:n=oe.scaleX,scaleY:r=oe.scaleY,angle:s=oe.angle,scaleCenter:a,anchor:o,postMatrix:h}=this.attribute;let l=[0,0];const c={};if(o&&(l=this.getAnchor(o,c)),!a||1===n&&1===r)e.normalTransform(this._transMatrix,this._transMatrix.reset(),t,i,n,r,s,o&&l);else{const e=this._transMatrix;e.reset(),e.translate(l[0],l[1]),e.rotate(s),e.translate(-l[0],-l[1]),e.translate(t,i),l=this.getAnchor(a,c),Oe.transformUtil.fromMatrix(e,e).scale(n,r,{x:l[0],y:l[1]})}const u=this.getOffsetXY(oe);if(this._transMatrix.e+=u.x,this._transMatrix.f+=u.y,h){const t=Cr.setValue(h.a,h.b,h.c,h.d,h.e,h.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Oe.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const a={};if(n.customAnimate)n.customAnimate.update(s,r,a);else{const t=n.props,o=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,a,n,r,s,t,void 0,o,h)}this.setAttributes(a,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,a,o,h,l){l||(l=Object.keys(a),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):l.forEach((s=>{var l;if(!e.validAttr(s))return;const c=a[s],u=null!==(l=o&&o[s])&&void 0!==l?l:t.getLastPropByName(s,n);if(null==c||null==u)return void(i[s]=c);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,i),d||(d=e.customInterpolate(s,r,u,c,this,i),d||this.defaultInterpolate(c,u,s,i,h,r)||this._interpolate(s,r,u,c,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const a=r.fillColorArray,o=ar(e,null!=a?a:t,s,!1,((t,e)=>{r.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){r||(r={});const a=r.strokeColorArray,o=ar(e,null!=a?a:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return o&&(n[i]=o),!0}if("shadowColor"===i){r||(r={});const a=r.shadowColorArray,o=ar(e,null!=a?a:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return o&&(n[i]=o),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return Ui(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Oe.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return e.isString(t,!0)?this.pathProxy=(new ne).fromString(t):this.pathProxy=new ne,this.pathProxy}loadImage(t,i=!1){if(!t||i&&function(t){if(t.fill||t.stroke)return!0;return!1}(t))return;const n=t;this.resources||(this.resources=new Map);const r={data:"init",state:null};this.resources.set(n,r),"string"==typeof t?(r.state="loading",t.startsWith("<svg")?(_r.GetSvg(t,this),this.backgroundImg=this.backgroundImg||i):(e.isValidUrl(t)||t.includes("/")||e.isBase64(t))&&(_r.GetImage(t,this),this.backgroundImg=this.backgroundImg||i)):(r.state="success",r.data=t,this.backgroundImg=this.backgroundImg||i)}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",Oe.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new Hi(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}Ir.mixin(Ki);class Dr{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function Ur(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function Nr(t,e,i,n=">"){const r=function(t,e,i=">"){let n,r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,n);if(!r)return;let s=r.data;const a=r.index,o=s.search(/\s/);let h=s,l=!0;-1!==o&&(h=s.substr(0,o).replace(/\s\s*$/,""),s=s.substr(o+1));const c=h;if(i){const t=h.indexOf(":");-1!==t&&(h=h.substr(t+1),l=h!==r.data.substr(t+1))}return{tagName:h,tagExp:s,closeIndex:a,attrExpPresent:l,rawTagName:c}}const Wr=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Gr{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const r=function(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let t=0;t<s;t++)r.push(n[t]);i.push(r),n=e.exec(t)}return i}(t,Wr),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],i=r[t][4],s=e;e&&(n[s]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Dr("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){const e=Ur(t,">",s,"Closing Tag is not closed."),a=r.lastIndexOf(".");r=r.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",s=e}else if("?"===t[s+1]){s=Nr(t,s,!1,"?>").closeIndex+1}else if("!--"===t.substr(s+1,3)){s=Ur(t,"--\x3e",s+4,"Comment is not closed.")}else{const a=Nr(t,s,!1);let o=a.tagName,h=a.tagExp;const l=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(r+=r?"."+o:o),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),r=r.substr(0,r.length-1),h=o):h=h.substr(0,h.length-1);const t=new Dr(o);o!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,o)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Dr(o);this.tagsNodeStack.push(i),o!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,o)),this.addChild(i,t,r),i=t}n="",s=c}else n+=t[s]}return e.child}}function Fr(t,e){return zr(t)}function zr(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],r=jr(n);if(void 0!==r&&n[r]){const t=zr(n[r]);Vr(t),n[":@"]&&Hr(t,n[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}return i}function jr(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Hr(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let r=0;r<n;r++){const n=i[r];t[n]=e[n]}}}function Vr(t){return 0===Object.keys(t).length}class Yr{constructor(t){this.options=Object.assign({},Yr.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Fr(new Gr(this.options).parseXml(t),this.options)}}function Xr(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function Kr(t){return t.startsWith("<")}function qr(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Yr.defaultOptions={};let $r=0;function Zr(){return $r++}var Jr;function Qr(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)is(e[s])?n?r+=e[s]:(n=1,r=e[s]):(n&&(i.push({text:r,direction:t.TextDirection.VERTICAL}),r="",n=0),i.push({text:e[s],direction:t.TextDirection.HORIZONTAL}));return r&&i.push({text:r,direction:t.TextDirection.VERTICAL}),i}t.TextDirection=void 0,(Jr=t.TextDirection||(t.TextDirection={}))[Jr.HORIZONTAL=0]="HORIZONTAL",Jr[Jr.VERTICAL=1]="VERTICAL";const ts=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>ts.set(t,!0)));const es=new Map;function is(t){if(ts.has(t))return!0;if(es.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function ns(t,e){const i=t.attribute;if(i){i.split(";").forEach((t=>{if(!t)return;const i=t.split(":");if(2===i.length){const t=parseFloat(i[1]);e[i[0].trim()]=isFinite(t)?t:i[1].trim()}else{let t="";for(let e=1;e<i.length;e++)e>1&&(t+=":"),t+=i[e].trim();e[i[0].trim()]=t}}))}}[""].forEach((t=>es.set(t,!0)));const rs=Zr(),ss=Zr(),as=Zr(),os=Zr(),hs=Zr(),ls=Zr(),cs=Zr(),us=Zr(),ds=Zr(),ps=Zr(),gs=Zr(),fs=Zr(),ms=Zr(),ys=Zr(),bs=Zr(),vs=Zr(),xs=Symbol.for("GraphicService"),As=Symbol.for("GraphicCreator"),Bs={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},Ts=Object.keys(Bs),ws={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},Ss=Object.keys(ws);var _s;t.GroupUpdateAABBBoundsMode=void 0,(_s=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[_s.LESS_GROUP=0]="LESS_GROUP",_s[_s.MORE_GROUP=1]="MORE_GROUP";class Cs extends Ir{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=ls,this._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new Ii),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Ii)}hideAll(){this.setAttribute("visible",!1),this.forEachChildren((t=>{t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}showAll(){this.setAttribute("visible",!0),this.forEachChildren((t=>{t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}containsPoint(i,n,r){if(r===t.IContainPointMode.GLOBAL){const t=new e.Point(i,n);return this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),this.AABBBounds.contains(t.x,t.y)}return this.AABBBounds.contains(i,n)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Oe.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Oe.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=oe.x,y:e=oe.y,dx:i=oe.dx,dy:n=oe.dy,scaleX:r=oe.scaleX,scaleY:s=oe.scaleY,angle:a=oe.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==r||1!==s||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}doUpdateAABBBounds(){const t=this.attribute,e=Ui(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=Oe.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=yn(n);return r&&i.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),Oe.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Oe.graphicService.onClearIncremental(this,this.stage)}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){const i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){const i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){const i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){const e=super.removeChild(t);return t.stage=null,Oe.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{Oe.graphicService.onRemove(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),Oe.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=Oe.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Cs(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Cs.NOWORK_ANIMATE_ATTR}}function Ps(t){return new Cs(t)}Cs.NOWORK_ANIMATE_ATTR=Lr;class Es extends Cs{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=n.layerHandler,this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=n.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new Ii,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{Oe.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;const n=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:n.x,y:n.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){var i,n,r;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{Oe.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i,n,r;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const Ms=Symbol.for("TransformUtil"),ks=Symbol.for("GraphicUtil"),Rs=Symbol.for("LayerService"),Os=Symbol.for("StaticLayerHandlerContribution"),Ls=Symbol.for("DynamicLayerHandlerContribution"),Is=Symbol.for("VirtualLayerHandlerContribution");var Ds;t.DefaultLayerService=Ds=class{static GenerateLayerId(){return`${Ds.idprefix}_${Ds.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=Oe.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?Ve.get(Os):"dynamic"===t?Ve.get(Ls):Ve.get(Is),e}createLayer(t,e={main:!1}){var i;this.tryInit();let n=this.getRecommendedLayerType(e.layerMode);n=e.main||e.canvasId?"static":n;const r=this.getLayerHandler(n),s=new Es(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:n,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:Ds.GenerateLayerId(),layerHandler:r})),a=this.layerMap.get(t)||[];return a.push(s),this.layerMap.set(t,a),this.staticLayerCountInEnv--,s}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}},t.DefaultLayerService.idprefix="visactor_layer",t.DefaultLayerService.prefix_count=0,t.DefaultLayerService=Ds=L([m(),D("design:paramtypes",[])],t.DefaultLayerService);var Us=new n((e=>{e(V).to(t.DefaultGlobal).inSingletonScope(),e(_i).to(t.DefaultWindow),e(ks).to(t.DefaultGraphicUtil).inSingletonScope(),e(Ms).to(t.DefaultTransformUtil).inSingletonScope(),e(Rs).to(t.DefaultLayerService).inSingletonScope()}));function Ns(t,e){return!(!t&&!e)}function Ws(t,i){let n;return n=e.isArray(t)?t.some((t=>t||void 0===t)):!!t,n&&i>0}function Gs(t,e,i){return i&&t*e>0}function Fs(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}function zs(t,e){return t*e>0}function js(t,e,i,n){return t*e>0&&0!==i&&0!==n}function Hs(t,e,i,n,r,s,a,o){if(!t.pathProxy)return!1;const h=Ui(t,null==s?void 0:s.theme)[t.type],{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:g=h.strokeOpacity,visible:f=h.visible}=t.attribute,m=Gs(u,d,l),y=zs(u,g),b=Ns(l),v=Ws(c,p);if(!f)return!0;if(!b&&!v)return!0;if(!(m||y||a||o))return!0;e.beginPath();return xt(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),v&&(o?o(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),b&&(a?a(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fill())),!0}function Vs(t,i,n,r,s,a,o,h){const l=n-t,c=r-i,u=o-s,d=h-a;let p=d*l-u*c;return p*p<e.epsilon?[]:(p=(u*(i-a)-d*(t-s))/p,[t+p*l,i+p*c])}function Ys(t,e,i,n,r,s,a){const o=t-i,h=e-n,l=(a?s:-s)/Math.sqrt(o*o+h*h),c=l*h,u=-l*o,d=t+c,p=e+u,g=i+c,f=n+u,m=(d+g)/2,y=(p+f)/2,b=g-d,v=f-p,x=b*b+v*v,A=r-s,B=d*f-g*p,T=(v<0?-1:1)*Math.sqrt(Math.max(0,A*A*x-B*B));let w=(B*v-b*T)/x,S=(-B*b-v*T)/x;const _=(B*v+b*T)/x,C=(-B*b+v*T)/x,P=w-m,E=S-y,M=_-m,k=C-y;return P*P+E*E>M*M+k*k&&(w=_,S=C),{cx:w,cy:S,x01:-c,y01:-u,x11:w*(r/A-1),y11:S*(r/A-1)}}function Xs(t,i,n,r,s,a,o){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=e.abs(l-h),u=l>h;let d=!1;if(s<a){const t=s;s=a,a=t}if(s<=e.epsilon)i.moveTo(n,r);else if(c>=e.pi2-e.epsilon)i.moveTo(n+s*e.cos(h),r+s*e.sin(h)),i.arc(n,r,s,h,l,!u),a>e.epsilon&&(i.moveTo(n+a*e.cos(l),r+a*e.sin(l)),i.arc(n,r,a,l,h,u));else{const p=t.getParsedCornerRadius(),{outerDeltaAngle:g,innerDeltaAngle:f,outerStartAngle:m,outerEndAngle:y,innerEndAngle:b,innerStartAngle:v}=t.getParsePadAngle(h,l),x=p,A=p,B=p,T=p,w=Math.max(A,x),S=Math.max(B,T);let _=w,C=S;const P=s*e.cos(m),E=s*e.sin(m),M=a*e.cos(b),k=a*e.sin(b);let R,O,L,I;if((S>e.epsilon||w>e.epsilon)&&(R=s*e.cos(y),O=s*e.sin(y),L=a*e.cos(v),I=a*e.sin(v),c<e.pi)){const t=Vs(P,E,L,I,R,O,M,k);if(t){const i=P-t[0],n=E-t[1],r=R-t[0],o=O-t[1],h=1/e.sin(e.acos((i*r+n*o)/(e.sqrt(i*i+n*n)*e.sqrt(r*r+o*o)))/2),l=e.sqrt(t[0]*t[0]+t[1]*t[1]);C=e.min(S,(a-l)/(h-1)),_=e.min(w,(s-l)/(h+1))}}if(g<.001)o&&(o[3]||o[1])&&i.moveTo(n+P,r+E),d=!0;else if(_>e.epsilon){const t=e.min(x,_),a=e.min(A,_),h=Ys(L,I,P,E,s,t,Number(u)),l=Ys(R,O,M,k,s,a,Number(u));_<w&&t===a?!o||o[0]?(i.moveTo(n+h.cx+h.x01,r+h.cy+h.y01),i.arc(n+h.cx,r+h.cy,_,e.atan2(h.y01,h.x01),e.atan2(l.y01,l.x01),!u)):i.moveTo(n+h.cx+_*e.cos(e.atan2(l.y01,l.x01)),r+h.cy+_*e.sin(e.atan2(l.y01,l.x01))):!o||o[0]?(i.moveTo(n+h.cx+h.x01,r+h.cy+h.y01),t>0&&i.arc(n+h.cx,r+h.cy,t,e.atan2(h.y01,h.x01),e.atan2(h.y11,h.x11),!u),i.arc(n,r,s,e.atan2(h.cy+h.y11,h.cx+h.x11),e.atan2(l.cy+l.y11,l.cx+l.x11),!u),a>0&&i.arc(n+l.cx,r+l.cy,a,e.atan2(l.y11,l.x11),e.atan2(l.y01,l.x01),!u)):a>0?i.moveTo(n+l.cx+a*e.cos(e.atan2(l.y01,l.x01)),r+l.cy+a*e.sin(e.atan2(l.y01,l.x01))):i.moveTo(n+R,r+s*e.sin(y))}else!o||o[0]?(i.moveTo(n+P,r+E),i.arc(n,r,s,m,y,!u)):i.moveTo(n+s*e.cos(y),r+s*e.sin(y));if(!(a>e.epsilon)||f<.001)!o||o[1]?i.lineTo(n+M,r+k):i.moveTo(n+M,r+k),d=!0;else if(C>e.epsilon){const t=e.min(T,C),s=e.min(B,C),h=Ys(M,k,R,O,a,-s,Number(u)),l=Ys(P,E,L,I,a,-t,Number(u));if(!o||o[1]?i.lineTo(n+h.cx+h.x01,r+h.cy+h.y01):i.moveTo(n+h.cx+h.x01,r+h.cy+h.y01),C<S&&t===s){const t=e.atan2(l.y01,l.x01);!o||o[2]?i.arc(n+h.cx,r+h.cy,C,e.atan2(h.y01,h.x01),t,!u):i.moveTo(n+h.cx+e.cos(t),r+h.cy+e.sin(t))}else!o||o[2]?(s>0&&i.arc(n+h.cx,r+h.cy,s,e.atan2(h.y01,h.x01),e.atan2(h.y11,h.x11),!u),i.arc(n,r,a,e.atan2(h.cy+h.y11,h.cx+h.x11),e.atan2(l.cy+l.y11,l.cx+l.x11),u),t>0&&i.arc(n+l.cx,r+l.cy,t,e.atan2(l.y11,l.x11),e.atan2(l.y01,l.x01),!u)):t>0?i.moveTo(n+l.cx+t*e.cos(e.atan2(l.y01,l.x01)),r+l.cy+t*e.sin(e.atan2(l.y01,l.x01))):i.moveTo(n+L,r+I)}else!o||o[1]?i.lineTo(n+M,r+k):i.moveTo(n+M,r+k),!o||o[2]?i.arc(n,r,a,b,v,u):i.moveTo(n+a*e.cos(v),r+a*e.sin(v))}return o?o[3]&&i.lineTo(n+s*e.cos(h),r+s*e.sin(h)):i.closePath(),d}class Ks{static GetCanvas(){try{return Ks.canvas||(Ks.canvas=Oe.global.createCanvas({})),Ks.canvas}catch(t){return null}}static GetCtx(){if(!Ks.ctx){const t=Ks.GetCanvas();Ks.ctx=t.getContext("2d")}return Ks.ctx}}class qs extends e.LRU{static getInstance(){return qs._instance||(qs._instance=new qs),qs._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Ks.GetCanvas(),n=Ks.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,n,r=[],s=100){let a=`${t}${e}${i}${n}`;r.forEach((t=>a+=t.join())),a+=s;let o=this.dataMap.get(a);if(!o){o={data:new qs(r,s),timestamp:[]},this.addLimitedTimestamp(o,Date.now(),{}),this.dataMap.set(a,o)}return this.clearCache(this.dataMap,this.cacheParams),o.data}}class $s{static GetSize(t){for(let e=0;e<$s.ImageSize.length;e++)if($s.ImageSize[e]>=t)return $s.ImageSize[e];return t}static Get(t,e,i,n,r,s,a){const o=$s.GenKey(t,e,i,n,r),h=$s.cache[o];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=a)return h[t].pattern;return null}static Set(t,e,i,n,r,s,a,o){const h=$s.GenKey(t,e,i,n,r);$s.cache[h]?$s.cache[h].push({width:a,height:o,pattern:s}):$s.cache[h]=[{width:a,height:o,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function Zs(t,i,n,r){const{stops:s,startAngle:a,endAngle:o}=r;for(;n<0;)n+=e.pi2;for(;n>e.pi2;)n-=e.pi2;if(n<a)return s[0].color;if(n>o)return s[0].color;let h,l,c=(n-a)/(o-a);for(let t=0;t<s.length;t++)if(s[t].offset>=c){h=s[t-1],l=s[t];break}return c=(c-h.offset)/(l.offset-h.offset),ar(h.color,l.color,c,!1)}$s.cache={},$s.ImageSize=[20,40,80,160,320,640,1280,2560];const Js=Symbol.for("ArcRenderContribution"),Qs=Symbol.for("AreaRenderContribution"),ta=Symbol.for("CircleRenderContribution"),ea=Symbol.for("GroupRenderContribution"),ia=Symbol.for("ImageRenderContribution"),na=Symbol.for("PathRenderContribution"),ra=Symbol.for("PolygonRenderContribution"),sa=Symbol.for("RectRenderContribution"),aa=Symbol.for("SymbolRenderContribution"),oa=Symbol.for("TextRenderContribution"),ha=Symbol.for("CommonRenderContribution"),la=Symbol.for("InteractiveSubRenderContribution"),ca=["radius","startAngle","endAngle",...Er];class ua extends Ir{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=os}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}doUpdateAABBBounds(t){const e=Ui(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=Oe.graphicService.updateCircleAABBBounds(i,Ui(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=yn(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Ui(this).circle[t]}needUpdateTags(t){return super.needUpdateTags(t,ca)}needUpdateTag(t){return super.needUpdateTag(t,ca)}toCustomPath(){var t,e,i;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new ne;return o.arc(0,0,r,s,a),o}clone(){return new ua(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ua.NOWORK_ANIMATE_ATTR}}function da(t){return new ua(t)}function pa(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+a*i+"px "+(o||"sans-serif")}function ga(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function fa(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}ua.NOWORK_ANIMATE_ATTR=Lr;class ma{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,n,r,s,a,o,h){const l=[],c=[e,i],u=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a,o,h);l.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?u[0]=c[0]/-2:"right"!==n&&"end"!==n||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,l,n,r,s)}GetLayoutByLines(t,e,i,n,r="",s,a,o="end"){t=t.map((t=>t.toString()));const h=[],l=[0,0];if("number"==typeof a&&a!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),a),h.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s,o).str,width:e});l[0]=a}else{let e,i;a=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),a=Math.max(a,e),h.push({str:i,width:e});l[0]=a}l[1]=h.length*n,l[0]=h.reduce(((t,e)=>Math.max(t,e.width)),0);const c={xOffset:0,yOffset:0,width:l[0],height:l[1]};return this.LayoutBBox(c,e,i),this.layoutWithBBox(c,h,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],a=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-a)/2:"bottom"===n&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const ya=["text","maxLineWidth","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...Er];class ba extends Ir{get font(){const t=Ui(this).text;return this._font||(this._font=pa(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=Ui(this).text;if(!this.isSimplify())return;const{maxLineWidth:n=i.maxLineWidth}=e;return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=Ui(this).text,e=this.attribute;if(!this.isSimplify())return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),null!=this.clipedText&&this.clipedText!==e.text.toString())}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=vs,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return e.isArray(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}doUpdateAABBBounds(){const t=Ui(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateWrapAABBBounds(t){var i,n,r,s;const a=Ui(this).text,{fontFamily:o=a.fontFamily,textAlign:h=a.textAlign,textBaseline:l=a.textBaseline,fontSize:c=a.fontSize,ellipsis:u=a.ellipsis,maxLineWidth:d,stroke:p=a.stroke,lineWidth:g=a.lineWidth,wordBreak:f=a.wordBreak,fontWeight:m=a.fontWeight,ignoreBuf:y=a.ignoreBuf,suffixPosition:b=a.suffixPosition,heightLimit:v=0,lineClamp:x}=this.attribute,A=null!==(i=En(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==i?i:this.attribute.fontSize||a.fontSize,B=y?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const T=Oe.graphicUtil.textMeasure,w=new ma(o,{fontSize:c,fontWeight:m,fontFamily:o},T),S=e.isArray(t)?t.map((t=>t.toString())):[t.toString()],_=[],C=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/A),1)),x&&(P=Math.min(P,x)),"number"==typeof d&&d!==1/0){if(d>0)for(let t=0;t<S.length;t++){const e=S[t];let i=!0;if(t===P-1){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,d,u,!1,b);_.push({str:t.str,width:t.width});break}const n=w.textMeasure.clipText(e,w.textOptions,d,"break-word"===f);if(""!==e&&""===n.str){if(u){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,d,u,!1,b);n.str=null!==(r=t.str)&&void 0!==r?r:"",n.width=null!==(s=t.width)&&void 0!==s?s:0}else n.str="",n.width=0;i=!1}if(_.push({str:n.str,width:n.width}),n.str.length===e.length);else if(i){const i=e.substring(n.str.length);S.splice(t+1,0,i)}}let t=0;_.forEach((e=>{t=Math.max(t,e.width)})),C[0]=t}else{let t,e,i=0;for(let n=0,r=S.length;n<r;n++){if(n===P-1){const t=w.textMeasure.clipTextWithSuffix(S[n],w.textOptions,d,u,!1,b);_.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=S[n],t=w.textMeasure.measureTextWidth(e,w.textOptions,"break-word"===f),i=Math.max(i,t),_.push({str:e,width:t})}C[0]=i}C[1]=_.length*(A+B);const E={xOffset:0,yOffset:0,width:C[0],height:C[1]};w.LayoutBBox(E,h,l);const M=w.layoutWithBBox(E,_,h,l,A);return this.cache.layoutData=M,this.clearUpdateShapeTag(),this._AABBBounds.set(E.xOffset,E.yOffset,E.xOffset+E.width,E.yOffset+E.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=Ui(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=Ui(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e,i;const n=Ui(this).text,{wrap:r=n.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds([t]);const s=Oe.graphicUtil.textMeasure;let a,o;const h=this.attribute,{maxLineWidth:l=n.maxLineWidth,ellipsis:c=n.ellipsis,textAlign:u=n.textAlign,textBaseline:d=n.textBaseline,fontFamily:p=n.fontFamily,fontSize:g=n.fontSize,fontWeight:f=n.fontWeight,stroke:m=n.stroke,lineWidth:y=n.lineWidth,ignoreBuf:b=n.ignoreBuf,whiteSpace:v=n.whiteSpace,suffixPosition:x=n.suffixPosition}=h;if("normal"===v)return this.updateWrapAABBBounds(t);const A=b?0:Math.max(2,.075*g),B=h.fontSize||n.fontSize,T=null!==(e=En(h.lineHeight,B))&&void 0!==e?e:B+A;if(!this.shouldUpdateShape()&&this.cache){a=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=ga(u,a),e=fa(d,T,g);return this._AABBBounds.set(t,e,t+a,e+T),m&&this._AABBBounds.expand(y/2),this._AABBBounds}if(Number.isFinite(l)){if(c){const e=!0===c?n.ellipsis:c,i=s.clipTextWithSuffix(t.toString(),{fontSize:g,fontWeight:f,fontFamily:p},l,e,!1,x);o=i.str,a=i.width}else{const e=s.clipText(t.toString(),{fontSize:g,fontWeight:f,fontFamily:p},l,!1);o=e.str,a=e.width}this.cache.clipedText=o,this.cache.clipedWidth=a}else a=s.measureTextWidth(t.toString(),{fontSize:g,fontWeight:f,fontFamily:p}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=a;this.clearUpdateShapeTag();const w=ga(u,a);let S=T;Oe.global&&Oe.global.isSafari()&&(S+=.2*g);const _=fa(d,S,g,A);return this._AABBBounds.set(w,_,w+a,_+S),m&&this._AABBBounds.expand(y/2),this._AABBBounds}getBaselineMapAlign(){return ba.baselineMapAlign}getAlignMapBaseline(){return ba.alignMapBaseline}updateVerticalSinglelineAABBBounds(e){var i,n,r;const s=Ui(this).text,a=Oe.graphicUtil.textMeasure;let o;const h=this.attribute,{ignoreBuf:l=s.ignoreBuf}=h,c=l?0:2,{maxLineWidth:u=s.maxLineWidth,ellipsis:d=s.ellipsis,fontSize:p=s.fontSize,fontWeight:g=s.fontWeight,fontFamily:f=s.fontFamily,stroke:m=s.stroke,lineWidth:y=s.lineWidth,verticalMode:b=s.verticalMode,suffixPosition:v=s.suffixPosition}=h,x=null!==(i=En(h.lineHeight,h.fontSize||s.fontSize))&&void 0!==i?i:(h.fontSize||s.fontSize)+c;let{textAlign:A=s.textAlign,textBaseline:B=s.textBaseline}=h;if(!b){const t=A;A=null!==(n=ba.baselineMapAlign[B])&&void 0!==n?n:"left",B=null!==(r=ba.alignMapBaseline[t])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){o=this.cache.clipedWidth;const t=ga(A,o),e=fa(B,x,p);return this._AABBBounds.set(e,t,e+x,t+o),m&&this._AABBBounds.expand(y/2),this._AABBBounds}let T=[Qr(e.toString())];if(Number.isFinite(u)){if(d){const t=!0===d?s.ellipsis:d,e=a.clipTextWithSuffixVertical(T[0],{fontSize:p,fontWeight:g,fontFamily:f},u,t,!1,v);T=[e.verticalList],o=e.width}else{const t=a.clipTextVertical(T[0],{fontSize:p,fontWeight:g,fontFamily:f},u,!1);T=[t.verticalList],o=t.width}this.cache.verticalList=T,this.cache.clipedWidth=o}else o=0,T[0].forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?p:a.measureTextWidth(e.text,{fontSize:p,fontWeight:g,fontFamily:f});o+=i,e.width=i})),this.cache.verticalList=T,this.cache.clipedWidth=o;this.clearUpdateShapeTag();const w=ga(A,o),S=fa(B,x,p);return this._AABBBounds.set(S,w,S+x,w+o),m&&this._AABBBounds.expand(y/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const n=Ui(this).text,{wrap:r=n.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds(t);const s=this.attribute,{fontFamily:a=n.fontFamily,textAlign:o=n.textAlign,textBaseline:h=n.textBaseline,fontSize:l=n.fontSize,fontWeight:c=n.fontWeight,ellipsis:u=n.ellipsis,maxLineWidth:d,stroke:p=n.stroke,lineWidth:g=n.lineWidth,whiteSpace:f=n.whiteSpace,suffixPosition:m=n.suffixPosition}=s,y=null!==(e=En(s.lineHeight,s.fontSize||n.fontSize))&&void 0!==e?e:s.fontSize||n.fontSize;if("normal"===f)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const b=Oe.graphicUtil.textMeasure,v=new ma(a,{fontSize:l,fontWeight:c,fontFamily:a},b).GetLayoutByLines(t,o,h,y,!0===u?n.ellipsis:u||void 0,!1,d,m),{bbox:x}=v;return this.cache.layoutData=v,this.clearUpdateShapeTag(),this._AABBBounds.set(x.xOffset,x.yOffset,x.xOffset+x.width,x.yOffset+x.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}updateVerticalMultilineAABBBounds(i){var n,r,s;const a=Ui(this).text,o=Oe.graphicUtil.textMeasure;let h;const l=this.attribute,{ignoreBuf:c=a.ignoreBuf}=l,u=c?0:2,{maxLineWidth:d=a.maxLineWidth,ellipsis:p=a.ellipsis,fontFamily:g=a.fontFamily,fontSize:f=a.fontSize,fontWeight:m=a.fontWeight,stroke:y=a.stroke,lineWidth:b=a.lineWidth,verticalMode:v=a.verticalMode,suffixPosition:x=a.suffixPosition}=l,A=null!==(n=En(l.lineHeight,l.fontSize||a.fontSize))&&void 0!==n?n:(l.fontSize||a.fontSize)+u;let{textAlign:B=a.textAlign,textBaseline:T=a.textBaseline}=l;if(!v){const t=B;B=null!==(r=ba.baselineMapAlign[T])&&void 0!==r?r:"left",T=null!==(s=ba.alignMapBaseline[t])&&void 0!==s?s:"top"}if(h=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const i=t.reduce(((t,e)=>t+e.width),0);h=e.max(i,h)}));const t=ga(B,h),i=this.cache.verticalList.length*A,n=fa(T,i,f);return this._AABBBounds.set(n,t,n+i,t+h),y&&this._AABBBounds.expand(b/2),this._AABBBounds}const w=i.map((t=>Qr(t.toString())));w.forEach(((e,i)=>{if(Number.isFinite(d))if(p){const t=!0===p?a.ellipsis:p,n=o.clipTextWithSuffixVertical(e,{fontSize:f,fontWeight:m,fontFamily:g},d,t,!1,x);w[i]=n.verticalList,h=n.width}else{const t=o.clipTextVertical(e,{fontSize:f,fontWeight:m,fontFamily:g},d,!1);w[i]=t.verticalList,h=t.width}else h=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?f:o.measureTextWidth(e.text,{fontSize:f,fontWeight:m,fontFamily:g});h+=i,e.width=i}))})),this.cache.verticalList=w,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const i=t.reduce(((t,e)=>t+e.width),0);h=e.max(i,h)}));const S=ga(B,h),_=this.cache.verticalList.length*A,C=fa(T,_,f);return this._AABBBounds.set(C,S,C+_,S+h),y&&this._AABBBounds.expand(b/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Ui(this).text[t]}needUpdateTags(t,e=ya){return super.needUpdateTags(t,e)}needUpdateTag(t,e=ya){return super.needUpdateTag(t,e)}clone(){return new ba(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ba.NOWORK_ANIMATE_ATTR}}function va(t){return new ba(t)}ba.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Lr),ba.baselineMapAlign={top:"left",bottom:"right",middle:"center"},ba.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const xa=["heightLimit","lineClamp"];class Aa extends ba{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return e.isArray(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n,r;const s=Ui(this).text,{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:h=s.textBaseline,fontSize:l=s.fontSize,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:d=s.stroke,lineWidth:p=s.lineWidth,wordBreak:g=s.wordBreak,fontWeight:f=s.fontWeight,ignoreBuf:m=s.ignoreBuf,heightLimit:y=0,suffixPosition:b=s.suffixPosition,lineClamp:v}=this.attribute,x=null!==(e=En(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize,A=m?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const B=Oe.graphicUtil.textMeasure,T=new ma(a,{fontSize:l,fontWeight:f,fontFamily:a},B),w=t.map((t=>t.toString())),S=[],_=[0,0];let C=1/0;if(y>0&&(C=Math.max(Math.floor(y/x),1)),v&&(C=Math.min(C,v)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<w.length;t++){const e=w[t];let i=!0;if(t===C-1){const t=T.textMeasure.clipTextWithSuffix(e,T.textOptions,u,c,!1,b);S.push({str:t.str,width:t.width});break}const s=T.textMeasure.clipText(e,T.textOptions,u,"break-word"===g);if(""!==e&&""===s.str){if(c){const t=T.textMeasure.clipTextWithSuffix(e,T.textOptions,u,c,!1,b);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;i=!1}if(S.push({str:s.str,width:s.width}),s.str.length===e.length);else if(i){const i=e.substring(s.str.length);w.splice(t+1,0,i)}}let t=0;S.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,i=0;for(let n=0,r=w.length;n<r;n++){if(n===C-1){const t=T.textMeasure.clipTextWithSuffix(w[n],T.textOptions,u,c,!1,b);S.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=w[n],t=T.textMeasure.measureTextWidth(e,T.textOptions,"break-word"===g),i=Math.max(i,t),S.push({str:e,width:t})}_[0]=i}_[1]=S.length*(x+A);const P={xOffset:0,yOffset:0,width:_[0],height:_[1]};T.LayoutBBox(P,o,h);const E=T.layoutWithBBox(P,S,o,h,x);return this.cache.layoutData=E,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<xa.length;e++){const i=xa[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<xa.length;e++){if(t===xa[e])return!0}return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Aa.NOWORK_ANIMATE_ATTR}}function Ba(t){return new Aa(t)}class Ta{bounds(t,i){if(e.isNumber(t)){const e=t/2;i.x1=-e,i.x2=e,i.y1=-e,i.y2=e}else i.x1=-t[0]/2,i.x2=t[0]/2,i.y1=-t[1]/2,i.y2=t[1]/2}}function wa(t,i,n,r,s){return s?t.arc(n,r,i,0,e.tau,!1,s):t.arc(n,r,i,0,e.tau),!1}var Sa=new class extends Ta{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,r){return wa(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return wa(t,e/2+r,i,n,s)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var _a=new class extends Ta{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,e/6,i,n,r,s)}};function Ca(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var Pa=new class extends Ta{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return Ca(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return Ca(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Ca(t,e/2+r,i,n,s)}};function Ea(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var Ma=new class extends Ta{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Ea(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ea(t,e/2+r,i,n)}};class ka extends Ta{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}var Ra=new ka;var Oa=new class extends ka{constructor(){super(...arguments),this.type="triangle"}};const La=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Ia=Math.sin(e.tau/10)*La,Da=-Math.cos(e.tau/10)*La;function Ua(t,i,n,r){const s=Ia*i,a=Da*i;t.moveTo(n,-i+r),t.lineTo(s+n,a+r);for(let o=1;o<5;++o){const h=e.tau*o/5,l=Math.cos(h),c=Math.sin(h);t.lineTo(c*i+n,-l*i+r),t.lineTo(l*s-c*a+n,c*s+l*a+r)}return t.closePath(),!0}var Na=new class extends Ta{constructor(){super(...arguments),this.type="star",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return Ua(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ua(t,e/2+r,i,n)}};const Wa=e.sqrt(3);function Ga(t,e,i,n){const r=e,s=r/Wa,a=s/5,o=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var Fa=new class extends Ta{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return Ga(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ga(t,e/2+r,i,n)}};function za(t,e,i,n){const r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var ja=new class extends Ta{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return za(t,e/2,i,n)}drawOffset(t,e,i,n,r){return za(t,e/2+r,i,n)}};function Ha(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Va=new class extends Ta{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Ha(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ha(t,e/2+r,i,n)}};const Ya=-.5,Xa=e.sqrt(3)/2,Ka=1/e.sqrt(12);function qa(t,e,i,n){const r=e/2,s=e*Ka,a=r,o=e*Ka+e,h=-a,l=o;return t.moveTo(r+i,s+n),t.lineTo(a+i,o+n),t.lineTo(h+i,l+n),t.lineTo(Ya*r-Xa*s+i,Xa*r+Ya*s+n),t.lineTo(Ya*a-Xa*o+i,Xa*a+Ya*o+n),t.lineTo(Ya*h-Xa*l+i,Xa*h+Ya*l+n),t.lineTo(Ya*r+Xa*s+i,Ya*s-Xa*r+n),t.lineTo(Ya*a+Xa*o+i,Ya*o-Xa*a+n),t.lineTo(Ya*h+Xa*l+i,Ya*l-Xa*h+n),t.closePath(),!1}var $a=new class extends Ta{constructor(){super(...arguments),this.type="wye",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return qa(t,e/2,i,n)}drawOffset(t,e,i,n,r){return qa(t,e/2+r,i,n)}};var Za=new class extends Ta{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}};var Ja=new class extends Ta{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}};var Qa=new class extends Ta{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}};const to=e.sqrt(3);function eo(t,e,i,n){const r=e*to;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var io=new class extends ka{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return eo(t,e/2/to,i,n)}drawOffset(t,e,i,n,r){return eo(t,e/2/to+r,i,n)}};function no(t,e,i,n){const r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var ro=new class extends Ta{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return no(t,e/4,i,n)}drawOffset(t,e,i,n,r){return no(t,e/4+r,i,n)}};function so(t,e,i,n){const r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var ao=new class extends Ta{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return so(t,e/4,i,n)}drawOffset(t,e,i,n,r){return so(t,e/4+r,i,n)}};function oo(t,e,i,n){const r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var ho=new class extends Ta{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return oo(t,e/4,i,n)}drawOffset(t,e,i,n,r){return oo(t,e/4+r,i,n)}};function lo(t,e,i,n){const r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var co=new class extends Ta{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return lo(t,e/4,i,n)}drawOffset(t,e,i,n,r){return lo(t,e/4+r,i,n)}};function uo(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var po=new class extends Ta{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return uo(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return uo(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e}, ${i-r} L ${e},${i+r}`}};function go(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var fo=new class extends Ta{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return go(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return go(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} L ${e+r},${i}`}};function mo(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var yo=new class extends Ta{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,r){return mo(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return mo(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}};function bo(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function vo(t,e,i,n){const r=e,s=e/2;return t.rect(i-r/2,n-s/2,r,s),!1}var xo=new class extends Ta{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,i,n,r){return e.isNumber(i)?vo(t,i,n,r):bo(t,i,n,r)}drawOffset(t,i,n,r,s){return e.isNumber(i)?vo(t,i+2*s,n,r):bo(t,[i[0]+2*s,i[1]+2*s],n,r)}};const Ao=new e.AABBBounds;class Bo{constructor(t,i,n=!1){this.pathStr="",this.type=t,e.isArray(i)?this.svgCache=i:this.path=i,this.isSvg=n}drawOffset(t,e,i,n,r,s,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),xt(r.path.commandList,t,i,n,e,e),a&&a(r.path,r.attribute)})),!1):(xt(this.path.commandList,t,i,n,e+r,e+r),!1)}draw(t,e,i,n,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),xt(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(xt(this.path.commandList,t,i,n,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{Ao.x1=i.bounds.x1*t,Ao.y1=i.bounds.y1*t,Ao.x2=i.bounds.x2*t,Ao.y2=i.bounds.y2*t,e.union(Ao)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const To=[Sa,_a,Pa,Ma,io,Oa,Na,Fa,ja,Va,$a,Za,Ja,Ra,Qa,ro,ao,ho,co,xo,po,fo,yo],wo={};To.forEach((t=>{wo[t.type]=t}));const So={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},_o=new e.AABBBounds,Co=["symbolType","size",...Er];let Po=class t extends Ir{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=bs}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return e.isArray(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const i=Ui(this).symbol;let{symbolType:n=i.symbolType}=this.attribute,r=wo[n];if(r)return this._parsedPath=r,r;if(r=t.userSymbolMap[n],r)return this._parsedPath=r,r;n=So[n]||n;if(!0===Xr(n)){const i=new Yr,{svg:r}=i.parse(n);if(!r)return null;const s=e.isArray(r.path)?r.path:[r.path];_o.clear();const a=[];s.forEach((t=>{const e=(new ne).fromString(t.d),i={};Ss.forEach((e=>{t[e]&&(i[ws[e]]=t[e])})),a.push({path:e,attribute:i}),_o.union(e.bounds)}));const o=_o.width(),h=_o.height(),l=1/e.max(o,h);return a.forEach((t=>t.path.transform(0,0,l,l))),this._parsedPath=new Bo(n,a,!0),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}const s=(new ne).fromString(n),a=s.bounds.width(),o=s.bounds.height(),h=1/e.max(a,o);return s.transform(0,0,h,h),this._parsedPath=new Bo(n,s),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=Ui(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=Oe.graphicService.updateSymbolAABBBounds(i,Ui(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=yn(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Ui(this).symbol[t]}needUpdateTags(t){return super.needUpdateTags(t,Co)}needUpdateTag(t){return super.needUpdateTag(t,Co)}toCustomPath(){const t=this.getParsedPath(),i=this.attribute.size,n=e.isArray(i)?i:[i,i];return t.path?(new ne).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new ne).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Eo(t){return new Po(t)}Po.userSymbolMap={},Po.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Lr);const Mo=["segments","points","curveType",...Er];let ko=class t extends Ir{constructor(t={}){super(t),this.type="line",this.numberType=us}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&!(t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Tn(i,n,e))}doUpdateAABBBounds(){const t=Ui(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updateLineAABBBounds(e,Ui(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Ui(this).line[t]}needUpdateTags(t){return super.needUpdateTags(t,Mo)}needUpdateTag(t){return super.needUpdateTag(t,Mo)}toCustomPath(){const t=this.attribute,e=new ne,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Ro(t){return new ko(t)}ko.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Lr);const Oo=["width","x1","y1","height","cornerRadius",...Er];class Lo extends Ir{constructor(t){super(t),this.type="rect",this.numberType=fs}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}doUpdateAABBBounds(){const t=Ui(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updateRectAABBBounds(e,Ui(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Ui(this).rect[t]}needUpdateTags(t){return super.needUpdateTags(t,Oo)}needUpdateTag(t){return super.needUpdateTag(t,Oo)}toCustomPath(){const t=this.attribute;let i=e.isNil(t.width)?t.x1-t.x:t.width,n=e.isNil(t.height)?t.y1-t.y:t.height,r=0,s=0;i<0&&(r=i,i=-i),n<0&&(s=n,n=-n);const a=new ne;return a.moveTo(r,s),a.rect(r,s,i,n),a}clone(){return new Lo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Lo.NOWORK_ANIMATE_ATTR}}function Io(t){return new Lo(t)}Lo.NOWORK_ANIMATE_ATTR=Lr;const Do=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class Uo extends Lo{constructor(t){super(t),this.type="rect3d",this.numberType=ms}findFace(){const t={polygons:[],vertices:[],edges:[]},i=Ui(this).rect3d,{x1:n,y1:r,x:s,y:a,length:o=e.min(i.width,i.height)}=this.attribute;let{width:h,height:l}=this.attribute;h=null!=h?h:n-s,l=null!=l?l:r-a;for(let e=0;e<Do.length;e++){const i=Do[e];t.vertices.push([i[0]*h,i[1]*l,i[2]*o])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return Uo.NOWORK_ANIMATE_ATTR}}function No(t){return new Uo(t)}Uo.NOWORK_ANIMATE_ATTR=Lr;class Wo extends Ir{constructor(t){super(t),this.type="glyph",this.numberType=hs,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}doUpdateAABBBounds(){this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const t=Oe.graphicService.updateGlyphAABBBounds(this.attribute,Ui(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(n,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((i,n)=>{i.updateNormalAttrs(r[n]),i.applyStateAttrs(r[n],t,e)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}clearStates(t){this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new Wo(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return Wo.NOWORK_ANIMATE_ATTR}}function Go(t){return new Wo(t)}Wo.NOWORK_ANIMATE_ATTR=Lr;class Fo{constructor(t,e,i,n,r,s,a,o,h,l,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=h,this.layoutDirection=l,this.directionKey=Le[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;switch(this.globalAlign){case"left":o=0;break;case"center":o=-r/2;break;case"right":o=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,o,s+a,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,o,s+a,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}}}}return l}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],a=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+s>this[this.directionKey.top]+r||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class zo{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const n=En(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof n?n>this.fontSize?n:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:s,descent:a,width:o}=ze(t,i);let h=0,l=0,c=0;this.height>s&&(h=(this.height-s)/2,l=Math.ceil(h),c=Math.floor(h)),"top"===this.textBaseline?(this.ascent=h,this.descent=s-h):"bottom"===this.textBaseline?(this.ascent=s-h,this.descent=h):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+l,this.descent=a+c),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){const{width:t}=ze(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)s="...",o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ge(s,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+="...","right"===r){const{width:e}=ze(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.stroke&&(!function(t,e){const i=e&&e.stroke||De;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=e&&"number"==typeof e.lineHeight?e.lineHeight:1,t.strokeStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,a,e)),function(t,e){const i=e&&e.fill||Ie;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Ge(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:n}=ze(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const jo=["width","height","image",...Er];class Ho extends Ir{constructor(t){super(t),this.type="image",this.numberType=cs,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}doUpdateAABBBounds(){const t=Ui(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updateImageAABBBounds(e,Ui(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Me[t]}needUpdateTags(t){return super.needUpdateTags(t,jo)}needUpdateTag(t){return super.needUpdateTag(t,jo)}clone(){return new Ho(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ho.NOWORK_ANIMATE_ATTR}}function Vo(t){return new Ho(t)}Ho.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Lr);class Yo extends Ho{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=yn(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,i,n)=>{if(e.isArray(n)&&-1!==n.indexOf("margin")||"margin"===n)if(i.margin){const t=yn(i.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=Me.width,height:e=Me.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,r=(i-t)/2,s=(n-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class Xo{constructor(t,e,i,n,r,s,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof Yo?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Le[this.direction],this.actualWidth=0;let h=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof zo){const e=We.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],h=Math.max(t[this.directionKey.height],h)})),this.height=h,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,n=this.height;let r=this.left,s=0;if(this.actualWidth<t&&!e)switch(this.textAlign){case"right":r=t-this.actualWidth;break;case"center":r=(t-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof Yo?(t["_"+i.x]=r,r+=t[i.width]+s,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=r,r+=t[i.width]+s)}))}draw(t,e,i,n,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof Yo)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const{width:n}=ze("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add";break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}}this.paragraphs.map(((e,s)=>{if(e instanceof Yo)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof Yo)break;const{width:n}=ze("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add",i.ellipsisWidth=r;break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}let e=0;return this.paragraphs.map(((t,i)=>{e+=t instanceof Yo?t.width:t.getWidthWithEllips(this.direction)})),e}}class Ko{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Le[this.direction]}store(t){if(t instanceof Yo){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new Xo(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof Yo?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t)))}cut(t){const e=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(e/t[this.directionKey.width]*t.length)||0,n=Ge(t.text,e,t.character,i,"break-word"===this.frame.wordBreak);if(0!==n){const[e,i]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new zo(i,t.newLine,t.character),new zo(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const qo=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...Er];class $o extends Ir{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=ys}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Ee.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:Ee.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:Ee.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:Ee.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:Ee.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:Ee.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:Ee.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:Ee.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=Ui(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updateRichTextAABBBounds(e,Ui(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Ee[t]}needUpdateTags(t){return super.needUpdateTags(t,qo)}needUpdateTag(t){return super.needUpdateTag(t,qo)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e=[],maxWidth:i,maxHeight:n,width:r,height:s,ellipsis:a,wordBreak:o,verticalDirection:h,textAlign:l,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,p=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const i=e[t],n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)p.push(n);else{const t=new Yo(i);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else if(e[t].text.includes("\n")){const i=e[t].text.split("\n");for(let n=0;n<i.length;n++)p.push(new zo(i[n],0!==n,e[t]))}else p.push(new zo(e[t].text,!1,e[t]));const g="number"==typeof i&&Number.isFinite(i)&&i>0,f="number"==typeof n&&Number.isFinite(n)&&n>0,m="number"==typeof r&&Number.isFinite(r)&&r>0&&(!g||r<=i),y="number"==typeof s&&Number.isFinite(s)&&s>0&&(!f||s<=n),b=new Fo(0,0,(m?r:g?i:0)||0,(y?s:f?n:0)||0,a,o,h,l,c,u||"horizontal",!m&&g,!y&&f,d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),v=new Ko(b);for(let t=0;t<p.length;t++)v.deal(p[t]);v.send();if(!("horizontal"===b.layoutDirection?m:y)){const t=b.getActualSizeWidthEllipsis();let e="horizontal"===b.layoutDirection?t.width:t.height;("horizontal"===b.layoutDirection?g:f)&&(e=Math.min(e,"horizontal"===b.layoutDirection?i:n)),b.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=b}clone(){return new $o(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e);this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,i,n,r,s;const a=this.pickIcon(t.global);a&&a===this._currentHoverIcon||(a?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=a,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(a.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):!a&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(i=this.stage)||void 0===i||i.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,a;e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+i,r.globalY=(null!==(a=r.attribute.y)&&void 0!==a?a:0)+n)})),r}getNoWorkAnimateAttr(){return $o.NOWORK_ANIMATE_ATTR}}function Zo(t){return new $o(t)}$o.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Lr);const Jo=["path","customPath",...Er];class Qo extends Ir{constructor(t){super(t),this.type="path",this.numberType=ds}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=Ui(this).path;if(!this.valid)return t.path;const i=this.attribute;return i.path instanceof ne?i.path:(e.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof ne?this.cache:t.path)}doUpdateAABBBounds(){const t=Ui(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updatePathAABBBounds(e,Ui(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;e.isString(t.path,!0)?this.cache=(new ne).fromString(t.path):t.customPath&&(this.cache=new ne,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Ui(this).path[t]}needUpdateTags(t){return super.needUpdateTags(t,Jo)}needUpdateTag(t){return super.needUpdateTag(t,Jo)}toCustomPath(){return(new ne).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Qo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Qo.NOWORK_ANIMATE_ATTR}}function th(t){return new Qo(t)}Qo.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Lr);const eh=["segments","points","curveType",...Er];class ih extends Ir{constructor(t){super(t),this.type="area",this.numberType=as}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=Ui(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updateAreaAABBBounds(e,Ui(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Tn(i,n,e))}getDefaultAttribute(t){return Ui(this).area[t]}needUpdateTags(t){return super.needUpdateTags(t,eh)}needUpdateTag(t){return super.needUpdateTag(t,eh)}toCustomPath(){const t=new ne,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new ih(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ih.NOWORK_ANIMATE_ATTR}}function nh(t){return new ih(t)}ih.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Lr);const rh=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...Er];class sh extends Ir{constructor(t){super(t),this.type="arc",this.numberType=rs}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=Ui(this).arc,{cornerRadius:i=t.cornerRadius,outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(0===i||"0%"===i)return 0;const s=Math.abs(n-r);return Math.min(e.isNumber(i,!0)?i:s*parseFloat(i)/100,s/2)}getParsedAngle(){const t=Ui(this).arc;let{startAngle:i=t.startAngle,endAngle:n=t.endAngle}=this.attribute;const{cap:r=t.cap}=this.attribute,s=n-i>=0?1:-1,a=n-i;if(i=e.clampAngleByRadian(i),n=i+a,r&&e.abs(a)<e.pi2-e.epsilon){let a=1,o=1;r.length&&(a=Number(r[0]),o=Number(r[1]));const{outerRadius:h=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute,c=Math.abs(h-l)/2,u=c/h;if(c>e.epsilon&&h>e.epsilon)return{startAngle:i-s*u*a,endAngle:n+s*u*o,sc:s*u*a,ec:s*u*o}}return{startAngle:i,endAngle:n}}getParsePadAngle(t,i){const n=Ui(this).arc,{outerRadius:r=n.outerRadius,innerRadius:s=n.innerRadius,padAngle:a=n.padAngle}=this.attribute,{padRadius:o=e.sqrt(r*r+s*s)}=this.attribute,h=e.abs(i-t);let l=t,c=i,u=t,d=i;const p=a/2;let g=h,f=h;if(p>e.epsilon&&o>e.epsilon){const n=i>t?1:-1;let a=e.asin(Number(o)/s*e.sin(p)),h=e.asin(Number(o)/r*e.sin(p));return(g-=2*a)>e.epsilon?(a*=n,u+=a,d-=a):(g=0,u=d=(t+i)/2),(f-=2*h)>e.epsilon?(h*=n,l+=h,c-=h):(f=0,l=c=(t+i)/2),{outerStartAngle:l,outerEndAngle:c,innerStartAngle:u,innerEndAngle:d,innerDeltaAngle:g,outerDeltaAngle:f}}return{outerStartAngle:l,outerEndAngle:c,innerStartAngle:u,innerEndAngle:d,innerDeltaAngle:g,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=Ui(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=Oe.graphicService.updateArcAABBBounds(i,Ui(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=yn(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return super.needUpdateTags(t,rh)}needUpdateTag(t){return super.needUpdateTag(t,rh)}getDefaultAttribute(t){return Ui(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:i,endAngle:n}=this.getParsedAngle();let r=t.innerRadius,s=t.outerRadius;const a=e.abs(n-i),o=n>i;if(s<r){const t=s;s=r,r=t}const h=new ne;if(s<=e.epsilon)h.moveTo(0,0);else if(a>=e.pi2-e.epsilon)h.moveTo(0+s*e.cos(i),0+s*e.sin(i)),h.arc(0,0,s,i,n,!o),r>e.epsilon&&(h.moveTo(0+r*e.cos(n),0+r*e.sin(n)),h.arc(0,0,r,n,i,o));else{const t=s*e.cos(i),a=s*e.sin(i),l=r*e.cos(n),c=r*e.sin(n);h.moveTo(0+t,0+a),h.arc(0,0,s,i,n,!o),h.lineTo(0+l,0+c),h.arc(0,0,r,n,i,o),h.closePath()}return h}clone(){return new sh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sh.NOWORK_ANIMATE_ATTR}}function ah(t){return new sh(t)}sh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Lr);class oh extends sh{constructor(t){super(t),this.type="arc3d",this.numberType=ss}doUpdateAABBBounds(){const t=Ui(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updateArc3dAABBBounds(e,Ui(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return oh.NOWORK_ANIMATE_ATTR}}function hh(t){return new oh(t)}oh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Lr);const lh=["points","cornerRadius",...Er];class ch extends Ir{constructor(t){super(t),this.type="polygon",this.numberType=ps}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=Ui(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updatePolygonAABBBounds(e,Ui(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=Tn(i,n,e))}getDefaultAttribute(t){return Ui(this).polygon[t]}needUpdateTags(t){return super.needUpdateTags(t,lh)}needUpdateTag(t){return super.needUpdateTag(t,lh)}toCustomPath(){const t=this.attribute.points,e=new ne;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new ch(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ch.NOWORK_ANIMATE_ATTR}}function uh(t){return new ch(t)}ch.NOWORK_ANIMATE_ATTR=Lr;class dh extends ch{constructor(t){super(t),this.type="pyramid3d",this.numberType=gs}doUpdateAABBBounds(){const t=Ui(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=Oe.graphicService.updatePyramid3dAABBBounds(e,Ui(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=yn(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}findFace(){const{points:t}=this.attribute,i=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],r=e.x-n.x;return 0===r?0:(e.y-n.y)/r})),n=t.map((t=>({p:t,d:0})));let r=!1,s=0;for(let t=0;t<i.length-1;t++){for(let a=t+1;a<i.length;a++){if(i[t]===i[a]){r=!0;const i=e.PointService.distancePP(n[t].p,n[t+1].p);n[t].d=i,n[t+1].d=i,s=e.max(s,i);const o=e.PointService.distancePP(n[a].p,n[a+1].p);n[a].d=o,n[a+1].d=o,s=e.max(s,o)}if(r)break}if(r)break}for(let e=t.length-1;e>=0;e--){const i=t[e];n.unshift({p:i,d:0})}for(let e=0;e<t.length;e++){const i=(s-n[e+t.length].d)/2;n[e].d+=i,n[e+t.length].d+=i}const a={polygons:[],vertices:[],edges:[]};return n.forEach((t=>{a.vertices.push([t.p.x,t.p.y,t.d])})),a.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),a.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),a.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),a.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),a.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),a.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),a.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],a}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return dh.NOWORK_ANIMATE_ATTR}}function ph(t){return new dh(t)}dh.NOWORK_ANIMATE_ATTR=Lr;class gh extends Cs{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function fh(t){return new gh(t)}class mh{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:a=t.lineWidth}=r;i.expand(n+(s+a)/2)}return i}}class yh extends mh{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:a=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:o=t.lineWidth}=r;qr(i,n+(s+o)/2,!0,a)}return i}}const bh=Symbol.for("MatrixAllocate"),vh=Symbol.for("Mat4Allocate");function xh(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class Ah{constructor(){this.pools=[]}allocate(t,i,n,r,s,a){if(!this.pools.length)return new e.Matrix(t,i,n,r,s,a);const o=this.pools.pop();return o.a=t,o.b=i,o.c=n,o.d=r,o.e=s,o.f=a,o}allocateByObj(t){if(!this.pools.length)return new e.Matrix(t.a,t.b,t.c,t.d,t.e,t.f);const i=this.pools.pop();return i.a=t.a,i.b=t.b,i.c=t.c,i.d=t.d,i.e=t.e,i.f=t.f,i}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}class Bh{constructor(){this.pools=[]}static identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return Bh.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Th=new Ah,wh=new Bh;function Sh(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],a=e[5],o=e[6],h=e[7],l=e[8],c=e[9],u=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+l*n,t[5]=a*r+c*n,t[6]=o*r+u*n,t[7]=h*r+d*n,t[8]=l*r-s*n,t[9]=c*r-a*n,t[10]=u*r-o*n,t[11]=d*r-h*n,t}function _h(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],l=e[8],c=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-l*n,t[1]=a*r-c*n,t[2]=o*r-u*n,t[3]=h*r-d*n,t[8]=s*n+l*r,t[9]=a*n+c*r,t[10]=o*n+u*r,t[11]=h*n+d*r,t}function Ch(t,e,i){const n=i[0],r=i[1],s=i[2];let a,o,h,l,c,u,d,p,g,f,m,y;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],h=e[2],l=e[3],c=e[4],u=e[5],d=e[6],p=e[7],g=e[8],f=e[9],m=e[10],y=e[11],t[0]=a,t[1]=o,t[2]=h,t[3]=l,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=y,t[12]=a*n+c*r+g*s+e[12],t[13]=o*n+u*r+f*s+e[13],t[14]=h*n+d*r+m*s+e[14],t[15]=l*n+p*r+y*s+e[15]),t}function Ph(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Eh(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],g=e[11],f=e[12],m=e[13],y=e[14],b=e[15];let v=i[0],x=i[1],A=i[2],B=i[3];return t[0]=v*n+x*o+A*u+B*f,t[1]=v*r+x*h+A*d+B*m,t[2]=v*s+x*l+A*p+B*y,t[3]=v*a+x*c+A*g+B*b,v=i[4],x=i[5],A=i[6],B=i[7],t[4]=v*n+x*o+A*u+B*f,t[5]=v*r+x*h+A*d+B*m,t[6]=v*s+x*l+A*p+B*y,t[7]=v*a+x*c+A*g+B*b,v=i[8],x=i[9],A=i[10],B=i[11],t[8]=v*n+x*o+A*u+B*f,t[9]=v*r+x*h+A*d+B*m,t[10]=v*s+x*l+A*p+B*y,t[11]=v*a+x*c+A*g+B*b,v=i[12],x=i[13],A=i[14],B=i[15],t[12]=v*n+x*o+A*u+B*f,t[13]=v*r+x*h+A*d+B*m,t[14]=v*s+x*l+A*p+B*y,t[15]=v*a+x*c+A*g+B*b,t}function Mh(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:a=i.z,dx:o=i.dx,dy:h=i.dy,dz:l=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=m[1];b[2]=null!==(n=m[2])&&void 0!==n?n:0}if(function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t),Ch(t,t,[r+o,s+h,a+l]),Ch(t,t,[b[0],b[1],b[2]]),Sh(t,t,g),_h(t,t,p),Ch(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const n=i[0],r=i[1],s=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),f){const i=wh.allocate(),n=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}Ch(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],l=e[4],c=e[5],u=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+l*n,t[1]=a*r+c*n,t[2]=o*r+u*n,t[3]=h*r+d*n,t[4]=l*r-s*n,t[5]=c*r-a*n,t[6]=u*r-o*n,t[7]=d*r-h*n}(i,i,f),Ch(i,i,[-n[0],-n[1],0]),Eh(t,t,i)}}function kh(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new j(["graphic"]),onSetStage:new j(["graphic","stage"]),onRemove:new j(["graphic"]),onRelease:new j(["graphic"]),onAddIncremental:new j(["graphic","group","stage"]),onClearIncremental:new j(["graphic","group","stage"]),beforeUpdateAABBBounds:new j(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new j(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new e.AABBBounds,this.tempAABBBounds2=new e.AABBBounds,this._rectBoundsContribitions=[new mh],this._symbolBoundsContribitions=[new yh],this._circleBoundsContribitions=[new mh],this._arcBoundsContribitions=[new mh],this._pathBoundsContribitions=[new mh]}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new K(t);return xt(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){let{width:e,height:n}=t;const{x1:r,y1:s,x:a,y:o}=t;e=null!=e?e:r-a,n=null!=n?n:s-o,i.set(0,0,e||0,n||0)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((a=>{a.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}updateGroupAABBBounds(t,e,i,n){const{width:r,height:s,path:a,clip:o=e.clip}=t;a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,r,s),o||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateGlyphAABBBounds(t,e,i,n){return this._validCheck(t,e,i,n)?(n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i):i}updateRichTextAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:a=e.maxWidth,maxHeight:o=e.maxHeight,textAlign:h=e.textAlign,textBaseline:l=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:h}=t.getActualSize();let l=r||e||0,c=s||h||0;c="number"==typeof o&&c>o?o:c||0,l="number"==typeof a&&l>a?a:l||0,i.set(0,0,l,c)}let c=0;switch(l){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-i.height()}let u=0;switch(h){case"left":u=0;break;case"center":u=-i.width()/2;break;case"right":u=-i.width()}i.translate(u,c);const d=this.tempAABBBounds1,p=this.tempAABBBounds2;return d.setValue(i.x1,i.y1,i.x2,i.y2),p.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,i,n,r){if(!this._validCheck(t,i,n,r))return n;if(!r)return n;const{text:s=i.text}=r.attribute;Array.isArray(s)?r.updateMultilineAABBBounds(s):r.updateSingallineAABBBounds(s);const a=this.tempAABBBounds1,o=this.tempAABBBounds2;a.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2);const{scaleX:h=i.scaleX,scaleY:l=i.scaleY,shadowBlur:c=i.shadowBlur,strokeBoundsBuffer:u=i.strokeBoundsBuffer}=t;if(c){qr(a,c/Math.abs(h+l),!0,u),n.union(a)}return this.combindShadowAABBBounds(n,r),e.transformBoundsWithMatrix(n,n,r.transMatrix),n}updatePathAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((a=>{a.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updatePathAABBBoundsImprecise(t,e,i,n){if(!n)return i;const r=n.getParsedPathShape();return i.union(r.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)}));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateArc3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;const{outerRadius:s=e.outerRadius,height:a=0}=t,o=s+a;i.setValue(-o,-o,o,o);const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updatePolygonAABBBoundsImprecise(t,e,i,n){const{points:r=e.points}=t;return r.forEach((t=>{i.add(t.x,t.y)})),i}updateLineAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),s}updateCircleAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}updateCircleAABBBoundsImprecise(t,e,i,n){const{radius:r=e.radius}=t;return i.set(-r,-r,r,r),i}updateCircleAABBBoundsAccurate(t,i,n,r){const{startAngle:s=i.startAngle,endAngle:a=i.endAngle,radius:o=i.radius}=t;return a-s>e.pi2-e.epsilon?n.set(-o,-o,o,o):xn(s,a,o,n),n}updateArcAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,r),i}updateArcAABBBoundsImprecise(t,e,i,n){const{innerRadius:r=e.innerRadius}=t;let{outerRadius:s=e.outerRadius}=t;return s<r&&(s=r),i.set(-s,-s,s,s),i}updateArcAABBBoundsAccurate(t,i,n,r){let{outerRadius:s=i.outerRadius,innerRadius:a=i.innerRadius}=t;if(s<a){const t=s;s=a,a=t}let{endAngle:o=i.endAngle,startAngle:h=i.startAngle}=t;if(h>o){const t=h;h=o,o=t}return s<=e.epsilon?n.set(0,0,0,0):Math.abs(o-h)>e.pi2-e.epsilon?n.set(-s,-s,s,s):(xn(h,o,s,n),xn(h,o,a,n)),n}updateSymbolAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,r),i}updateSymbolAABBBoundsImprecise(t,i,n,r){const{size:s=i.size}=t;if(e.isArray(s))n.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,i,n){if(!n)return i;const{size:r=e.size}=t;return n.getParsedPath().bounds(r,i),i}updateImageAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,i,n,r,s){const{scaleX:a=n.scaleX,scaleY:o=n.scaleY,stroke:h=n.stroke,shadowBlur:l=n.shadowBlur,lineWidth:c=n.lineWidth,pickStrokeBuffer:u=n.pickStrokeBuffer,strokeBoundsBuffer:d=n.strokeBoundsBuffer}=t,p=this.tempAABBBounds1,g=this.tempAABBBounds2;if(h&&c){qr(p,(c+u)/Math.abs(a+o),r,d),i.union(p),p.setValue(g.x1,g.y1,g.x2,g.y2)}if(l){const{shadowOffsetX:e=n.shadowOffsetX,shadowOffsetY:r=n.shadowOffsetY}=t;qr(p,l/Math.abs(a+o)*2,!1,d+1),p.translate(e,r),i.union(p)}this.combindShadowAABBBounds(i,s);let f=!0;const m=s.transMatrix;s&&s.isContainer&&(f=!(1===m.a&&0===m.b&&0===m.c&&1===m.d&&0===m.e&&0===m.f)),f&&e.transformBoundsWithMatrix(i,i,m)}_validCheck(t,e,i,n){if(!n)return!0;if(!n.valid)return i.clear(),!1;const{visible:r=e.visible}=t;return!!r||(i.clear(),!1)}},t.DefaultGraphicService=L([m(),I(0,g(As)),D("design:paramtypes",[Object])],t.DefaultGraphicService);const Rh=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Oh,Lh;const Ih={x:0,y:0,z:0,lastModelMatrix:null};class Dh{init(e){e&&(this._renderContribitions=e.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.afterFillStroke)))}beforeRenderStep(t,e,i,n,r,s,a,o,h,l,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d)}))}afterRenderStep(t,e,i,n,r,s,a,o,h,l,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d)}))}valid(t,e,i,n){const{fill:r=e.fill,background:s,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:l=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=Gs(o,h,r),p=zs(o,c),g=Ns(r,s),f=Ws(a,l);return!(!t.valid||!u)&&(!(!g&&!f)&&(!!(d||p||i||n||s)&&{fVisible:d,sVisible:p,doFill:g,doStroke:f}))}transform(t,e,i,n=!1){const{x:r=e.x,y:s=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:h=e.scaleY,angle:l=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;Ih.x=r,Ih.y=s,Ih.z=a,Ih.lastModelMatrix=u;const p=d&&(n||kh(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===h&&0===l&&!c;if(p){const n=wh.allocate(),r=wh.allocate();Mh(r,t,e),Eh(n,u||n,r),Ih.x=0,Ih.y=0,Ih.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),wh.free(r)}if(g&&!u){const n=t.getOffsetXY(e);Ih.x+=n.x,Ih.y+=n.y,Ih.z=a,i.setTransformForCurrent()}else if(p)Ih.x=0,Ih.y=0,Ih.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);Ih.x+=n.x,Ih.y+=n.y,this.transformWithoutTranslate(i,Ih.x,Ih.y,Ih.z,o,h,l)}else i.transformFromMatrix(t.transMatrix,!0),Ih.x=0,Ih.y=0,Ih.z=0;return Ih}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,a=n.project(0,0,i),o=n.project(r,0,i),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(l.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*l.y),p=-(l.y*(h.x-o.x)-c.y*h.x+u.y*o.x+(c.y-u.y)*a.x)*d,g=(c.y*h.y+l.y*(o.y-h.y)-u.y*o.y+(u.y-c.y)*a.y)*d,f=(l.x*(h.x-o.x)-c.x*h.x+u.x*o.x+(c.x-u.x)*a.x)*d,m=-(c.x*h.y+l.x*(o.y-h.y)-u.x*o.y+(u.x-c.x)*a.y)*d,y=(l.x*(u.y*o.x-c.y*h.x)+l.y*(c.x*h.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,b=(l.x*(u.y*o.y-c.y*h.y)+l.y*(c.x*h.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;n.setTransform(p,g,f,m,y,b,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(r,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,r){const{context:s}=n;if(!s)return;s.highPerformanceSave();const a=this.transform(t,e,s,i),{x:o,y:h,z:l,lastModelMatrix:c}=a;this.z=l,Hs(t,s,o,h,0,r)||(this.drawShape(t,s,o,h,n,r),this.z=0,s.modelMatrix!==c&&wh.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}}function Uh(t,e,i){let n=e;const{a:r,b:s,c:a,d:o}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),l=Math.sign(o)*Math.sqrt(a*a+o*o);return h+l===0?0:(n=n/Math.abs(h+l)*2*i,n)}function Nh(t,i,n,r,s){if(!i||!0===i)return"black";let a,o;if(e.isArray(i))for(let t=0;t<i.length&&(o=i[t],!o);t++);else o=i;return"string"==typeof o?o:("linear"===o.gradient?a=function(t,e,i,n=0,r=0){var s,a,o,h;const l=i.AABBBounds;if(!l)return;let c=l.x2-l.x1,u=l.y2-l.y1,d=l.x1-n,p=l.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,p/=e}const g=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,p+(null!==(a=e.y0)&&void 0!==a?a:0)*u,d+(null!==(o=e.x1)&&void 0!==o?o:1)*c,p+(null!==(h=e.y1)&&void 0!==h?h:0)*u);return e.stops.forEach((t=>{g.addColorStop(t.offset,t.color)})),g}(t,o,n,r,s):"conical"===o.gradient?a=function(t,e,i,n=0,r=0){var s,a;const o=i.AABBBounds;if(!o)return;let h=o.x2-o.x1,l=o.y2-o.y1,c=o.x1-n,u=o.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;h/=t,l/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*h,u+(null!==(a=e.y)&&void 0!==a?a:0)*l,e.startAngle,e.endAngle);let p;return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(h+c,l+u,p)}(t,o,n,r,s):"radial"===o.gradient&&(a=function(t,e,i,n=0,r=0){var s,a,o,h,l,c;const u=i.AABBBounds;if(!u)return;let d=u.x2-u.x1,p=u.y2-u.y1,g=u.x1-n,f=u.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;g/=t,f/=e,d/=t,p/=e}const m=t.createRadialGradient(g+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,f+(null!==(a=e.y0)&&void 0!==a?a:.5)*p,Math.max(d,p)*(null!==(o=e.r0)&&void 0!==o?o:0),g+(null!==(h=e.x1)&&void 0!==h?h:.5)*d,f+(null!==(l=e.y1)&&void 0!==l?l:.5)*p,Math.max(d,p)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{m.addColorStop(t.offset,t.color)})),m}(t,o,n,r,s)),a||"orange")}class Wh{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){const{background:p,backgroundMode:g=h.backgroundMode}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Ui(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),this.doDrawImage(e,r.data,s,g),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const r=t.createPattern(e,n);t.fillStyle=r,t.translate(i.x1,i.y1),t.fillRect(0,0,i.width(),i.height()),t.translate(-i.x1,-i.y1)}}}const Gh=new Wh;t.DefaultBaseInteractiveRenderContribution=class{constructor(e){this.subRenderContribitions=e,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,a,o,h,l,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=L([m(),I(0,g(N)),I(0,y(la)),D("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution);class Fh{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,a=n.dpr,o=Si.allocate({width:t,height:t,dpr:a}),h=o.getContext("2d");if(!h)return null;h.inuse=!0,h.clearMatrix(),h.setTransformForCurrent(!0),h.clearRect(0,0,t,t),r(s,h);const l=n.createPattern(o.nativeCanvas,"repeat");return l.setTransform&&l.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Si.free(o),l}createCirclePattern(t,i,n,r){return this.createCommonPattern(t,i,n,r,((t,i)=>{i.fillStyle=n,i.arc(t,t,t,0,e.pi2),i.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:g=h.textureColor,textureSize:f=h.textureSize,texturePadding:m=h.texturePadding}=t.attribute;if(!p)return;let y=this.textureMap.get(p);if(!y)switch(p){case"circle":y=this.createCirclePattern(f,m,g,e);break;case"diamond":y=this.createDiamondPattern(f,m,g,e);break;case"rect":y=this.createRectPattern(f,m,g,e);break;case"vertical-line":y=this.createVerticalLinePattern(f,m,g,e);break;case"horizontal-line":y=this.createHorizontalLinePattern(f,m,g,e);break;case"bias-lr":y=this.createBiasLRLinePattern(f,m,g,e);break;case"bias-rl":y=this.createBiasRLLinePattern(f,m,g,e);break;case"grid":y=this.createGridPattern(f,m,g,e)}y&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=y,e.fill(),e.highPerformanceRestore())}}const zh=new Fh;class jh{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,g=d&&!1!==d.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{innerRadius:m=h.innerRadius,outerRadius:y=h.outerRadius,startAngle:b=h.startAngle,endAngle:v=h.endAngle,opacity:x=h.opacity,x:A=h.x,y:B=h.y,scaleX:T=h.scaleX,scaleY:w=h.scaleY}=t.attribute,S=!(!d||!d.stroke),_=!(!p||!p.stroke);if(g){const{distance:r=h.outerBorder.distance}=d,s=Uh(e,r,e.dpr),a=r/y;if(t.setAttributes({outerRadius:y+s,innerRadius:m-s,startAngle:b-a,endAngle:v+a}),e.beginPath(),Xs(t,e,i,n,y+s,m-s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(S){const r=h.outerBorder.opacity;h.outerBorder.opacity=x,e.setStrokeStyle(t,d,(A-i)/T,(B-n)/w,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(f){const{distance:r=h.innerBorder.distance}=p,s=Uh(e,r,e.dpr),a=r/y;if(t.setAttributes({outerRadius:y-s,innerRadius:m+s,startAngle:b+a,endAngle:v-a}),e.beginPath(),Xs(t,e,i,n,y-s,m+s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(_){const r=h.innerBorder.opacity;h.innerBorder.opacity=x,e.setStrokeStyle(t,p,(A-i)/T,(B-n)/w,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:y,innerRadius:m,startAngle:b,endAngle:v})}}const Hh=new jh,Vh=zh,Yh=Gh;class Xh{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,g=d&&!1!==d.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{radius:m=h.radius,startAngle:y=h.startAngle,endAngle:b=h.endAngle,opacity:v=h.opacity,x:x=h.x,y:A=h.y,scaleX:B=h.scaleX,scaleY:T=h.scaleY}=t.attribute,w=!(!d||!d.stroke),S=!(!p||!p.stroke);if(g){const{distance:r=h.outerBorder.distance}=d,s=Uh(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,m+s,y,b),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,d,h.outerBorder);else if(w){const r=h.outerBorder.opacity;h.outerBorder.opacity=v,e.setStrokeStyle(t,d,(x-i)/B,(A-n)/T,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(f){const{distance:r=h.innerBorder.distance}=p,s=Uh(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,m-s,y,b),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,p,h.innerBorder);else if(S){const r=h.innerBorder.opacity;h.innerBorder.opacity=v,e.setStrokeStyle(t,p,(x-i)/B,(A-n)/T,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}}const Kh=new Xh,qh=zh,$h=Gh;class Zh extends Wh{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{background:d,backgroundMode:p=h.backgroundMode}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;this.doDrawImage(e,i.data,n,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}}const Jh=new Zh,Qh=e.pi/2;function tl(t,i,n,r,s,a){let o;if(r<0&&(i+=r,r=-r),s<0&&(n+=s,s=-s),e.isNumber(a,!0))o=[a=e.abs(a),a,a,a];else if(Array.isArray(a)){const t=a;let i,n;switch(t.length){case 0:o=[0,0,0,0];break;case 1:i=e.abs(t[0]),o=[i,i,i,i];break;case 2:case 3:i=e.abs(t[0]),n=e.abs(t[1]),o=[i,n,i,n];break;default:o=t,o[0]=e.abs(o[0]),o[1]=e.abs(o[1]),o[2]=e.abs(o[2]),o[3]=e.abs(o[3])}}else o=[0,0,0,0];if(r<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(i,n,r,s);const[h,l,c,u]=[[i,n],[i+r,n],[i+r,n+s],[i,n+s]],d=Math.min(r/2,s/2),p=[Math.min(d,o[0]),Math.min(d,o[1]),Math.min(d,o[2]),Math.min(d,o[3])],g=[h[0]+p[0],h[1]],f=[h[0],h[1]+p[0]],m=[l[0]-p[1],l[1]],y=[l[0],l[1]+p[1]],b=[c[0]-p[2],c[1]],v=[c[0],c[1]-p[2]],x=[u[0]+p[3],u[1]],A=[u[0],u[1]-p[3]];if(t.moveTo(g[0],g[1]),t.lineTo(m[0],m[1]),!e.arrayEqual(m,y)){const e=m[0],i=m[1]+p[1];t.arc(e,i,p[1],-Qh,0,!1)}if(t.lineTo(v[0],v[1]),!e.arrayEqual(b,v)){const e=v[0]-p[2],i=v[1];t.arc(e,i,p[2],0,Qh,!1)}if(t.lineTo(x[0],x[1]),!e.arrayEqual(x,A)){const i=x[0],n=x[1]-p[3];t.arc(i,n,p[3],Qh,e.pi,!1)}if(t.lineTo(f[0],f[1]),!e.arrayEqual(g,f)){const i=g[0],n=g[1]+p[0];t.arc(i,n,p[0],e.pi,e.pi+Qh,!1)}return t.closePath(),t}class el extends Wh{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,i,n,r,s,a,o,h,l,c,u,d){const{background:p,backgroundMode:g=l.backgroundMode}=t.attribute;if(p)if(t.backgroundImg){const e=t.resources.get(p);if("success"!==e.state||!e.data)return;if(i.save(),t.parent&&!t.transMatrix.onlyTranslate()){const e=Ui(t.parent).group,{scrollX:n=e.scrollX,scrollY:r=e.scrollY}=t.parent.attribute;i.setTransformFromMatrix(t.parent.globalTransMatrix,!0),i.translate(n,r)}const n=t.AABBBounds;this.doDrawImage(i,e.data,n,g),i.restore(),t.transMatrix.onlyTranslate()||i.setTransformForCurrent()}else if(e.isObject(p)){const{stroke:n,fill:r,lineWidth:s=1,cornerRadius:a=0,expandX:o=0,expandY:h=0}=p;if(!n&&!r)return;i.beginPath();const{x:l,y:c,width:u,height:d}=function(t){const i=yn(t.attribute.boundsPadding),n=t.AABBBounds;let r=n.x1,s=n.y1,a=n.width(),o=n.height();e.isNumber(i)?(r+=i,s+=i,a-=2*i,o-=2*i):(r+=i[3],s+=i[0],a-=i[1]+i[3],o-=i[0]+i[2]);return{x:r,y:s,width:a,height:o}}(t);a?tl(i,l-o,c-h,u+2*o,d+2*h,a):i.rect(l-o,c-h,u+2*o,d+2*h),i.globalAlpha=1,r&&(i.fillStyle=r,i.fill()),n&&s>0&&(i.lineWidth=s,i.strokeStyle=n,i.stroke())}else{i.beginPath();const e=t.AABBBounds;i.rect(n,r,e.width(),e.height()),i.fillStyle=p,i.globalAlpha=1,i.fill()}}}const il=new el;class nl{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,i,n,r,s,a,o,h,l,c,u,d){const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{cornerRadius:y=l.cornerRadius,opacity:b=l.opacity,x:v=l.x,y:x=l.y,scaleX:A=l.scaleX,scaleY:B=l.scaleY,x1:T,y1:w}=t.attribute;let{width:S,height:_}=t.attribute;S=(null!=S?S:T-n)||0,_=(null!=_?_:w-r)||0;const C=!(!p||!p.stroke),P=!(!g||!g.stroke);if(f){const{distance:s=l.outerBorder.distance}=p,a=Uh(i,s,i.dpr),o=n-a,h=r-a,c=2*a;if(0===y||e.isArray(y)&&y.every((t=>0===t))?(i.beginPath(),i.rect(o,h,S+c,_+c)):(i.beginPath(),tl(i,o,h,S+c,_+c,y)),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,l),d)d(i,p,l.outerBorder);else if(C){const e=l.outerBorder.opacity;l.outerBorder.opacity=b,i.setStrokeStyle(t,p,(v-n)/A,(x-r)/B,l.outerBorder),l.outerBorder.opacity=e,i.stroke()}}if(m){const{distance:s=l.innerBorder.distance}=g,a=Uh(i,s,i.dpr),o=n+a,h=r+a,c=2*a;if(0===y||e.isArray(y)&&y.every((t=>0===t))?(i.beginPath(),i.rect(o,h,S-c,_-c)):(i.beginPath(),tl(i,o,h,S-c,_-c,y)),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,l),d)d(i,g,l.innerBorder);else if(P){const e=l.innerBorder.opacity;l.innerBorder.opacity=b,i.setStrokeStyle(t,g,(v-n)/A,(x-r)/B,l.innerBorder),l.innerBorder.opacity=e,i.stroke()}}}}t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=L([m()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{width:d=h.width,height:p=h.height,stroke:g=h.stroke}=t.attribute;if(Array.isArray(g)&&g.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),e.beginPath(),e.moveTo(i,n),g[0]?e.lineTo(i+d,n):e.moveTo(i+d,n),g[1]?e.lineTo(i+d,n+p):e.moveTo(i+d,n+p),g[2]?e.lineTo(i,n+p):e.moveTo(i,n+p),g[3]){const t=g[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=L([m()],t.SplitRectAfterRenderContribution);const rl=new nl,sl=zh,al=Gh;class ol{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{size:y=h.size,opacity:b=h.opacity,x:v=h.x,y:x=h.y,scaleX:A=h.scaleX,scaleY:B=h.scaleY}=t.attribute,T=!(!p||!p.stroke),w=!(!g||!g.stroke);if(f){const{distance:r=h.outerBorder.distance}=p,s=Uh(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,y,i,n,s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,p,h.outerBorder);else if(T){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,p,(v-i)/A,(x-n)/B,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(m){const{distance:r=h.innerBorder.distance}=g,s=Uh(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,y,i,n,-s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,g,h.innerBorder);else if(w){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,g,(v-i)/A,(x-n)/B,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}}const hl=new ol,ll=zh,cl=Gh;function ul(i,n,r,s,a){var o;const{offsetX:h=0,offsetY:l=0,offsetZ:c=0,mode:u="none",drawConnect:d=!1,zeroX:p=0,zeroY:g=0}=a||{};if(d&&"none"===u)return;if(!n)return;let f=!0;const{curves:m}=n;if(r>=1){if(d){let t,e=!0;m.forEach(((n,r)=>{var s;let a=n.p0;if(n.originP1!==n.originP2){if(t&&t.originP1===t.originP2&&(a=t.p0),n.defined)e||(i.lineTo(a.x+h,a.y+l,c),e=!e);else{const{originP1:t,originP2:r}=n;let o;if(t&&!1!==t.defined?o=a:t&&!1!==r.defined&&(o=null!==(s=n.p3)&&void 0!==s?s:n.p1),e){e=!e;const t=o?o.x:n.p0.x,r=o?o.y:n.p0.y;i.moveTo(t+h,r+l,c)}else o&&(e=!e,i.lineTo(o.x+h,o.y+l,c))}t=n}else t=n}))}else m.forEach((t=>{t.defined?(f&&i.moveTo(t.p0.x+h,t.p0.y+l,c),gl(i,t,1,a),f=!1):f=!0}));return}if(r<=0)return;let y;"x"===s?y=t.Direction.ROW:"y"===s?y=t.Direction.COLUMN:"auto"===s&&(y=n.direction);const b=r*n.tryUpdateLength(y);let v=0,x=!0,A=null;for(let t=0,n=m.length;t<n;t++){const n=m[t],r=n.getLength(y),s=(b-v)/r;if(v+=r,s<0)break;if(d){let t=n.p0;if(n.originP1===n.originP2){A=n;continue}if(A&&A.originP1===A.originP2&&(t=A.p0),n.defined)x||(i.lineTo(t.x+h,t.y+l,c),x=!x);else{const{originP1:e,originP2:r}=n;let s;if(e&&!1!==e.defined?s=t:e&&!1!==r.defined&&(s=null!==(o=n.p3)&&void 0!==o?o:n.p1),x){x=!x;const t=s?s.x:n.p0.x,e=s?s.y:n.p0.y;i.moveTo(t+h,e+l,c)}else s&&(x=!x,i.lineTo(s.x+h,s.y+l,c))}A=n}else{if(!n.defined){f=!0;continue}f&&i.moveTo(n.p0.x+h,n.p0.y+l,c),gl(i,n,e.min(s,1),a),f=!1}}}function dl(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+r,a.y+s),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}function pl(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:a}=i,o=[];for(let t=0;t<a.length;t++)a[t].defined;o.push(a),o.forEach(((i,n)=>{var a,o,h,l;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+r,c.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(null!==(a=n.x1)&&void 0!==a?a:n.x,null!==(o=n.y1)&&void 0!==o?o:n.y)}t.lineTo(null!==(h=c.x1)&&void 0!==h?h:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}function gl(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,a):t.lineTo(r+e.p1.x,s+e.p1.y,a);else if(e.p2&&e.p3){const[n]=_t(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,a)}}function fl(i,n,r,s){var a;const{drawConnect:o=!1,mode:h="none"}=s||{};if(o&&"none"===h)return;const{top:l,bottom:c}=n;if(l.curves.length!==c.curves.length)return;if(r>=1){const t=[],e=[];let n=!0;if(o){let n,r,a=!0;const o=l.curves.length;l.curves.forEach(((h,l)=>{const u=c.curves[o-l-1];let d=h,p=u;if(h.originP1===h.originP2)return n=h,void(r=u);if(n&&n.originP1===n.originP2&&(d=n,p=r),h.defined)a||(t.push(d),e.push(p),ml(i,t,e,s),t.length=0,e.length=0,a=!a);else{const{originP1:n,originP2:r}=h;let o,l;n&&!1!==n.defined?(o=d,l=p):n&&!1!==r.defined&&(o=h,l=u),a?(a=!a,t.push(o||h),e.push(l||u)):o&&(a=!a,t.push(o||h),e.push(l||u),ml(i,t,e,s),t.length=0,e.length=0)}n=h})),ml(i,t,e,s)}else{for(let r=0,a=l.curves.length;r<a;r++){const o=l.curves[r];n!==o.defined?(n?(yl(i,t,e,s),t.length=0,e.length=0):(t.push(o),e.push(c.curves[a-r-1])),n=!n):n&&(t.push(o),e.push(c.curves[a-r-1]))}yl(i,t,e,s)}return}if(r<=0)return;let{direction:u}=s||{};const{curves:d}=l,p=null!==(a=d[d.length-1].p3)&&void 0!==a?a:d[d.length-1].p1,g=e.abs(p.x-d[0].p0.x),f=e.abs(p.y-d[0].p0.y);u=null!=u?u:g>f?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(g)||(u=t.Direction.COLUMN),Number.isFinite(f)||(u=t.Direction.ROW);const m=r*(u===t.Direction.ROW?g:f);let y=0,b=!0;const v=[],x=[];let A,B,T=!0;for(let t=0,e=l.curves.length;t<e;t++){const n=l.curves[t],r=n.getLength(u),a=(m-y)/r;if(a<0)break;if(y+=r,o){const r=c.curves[e-t-1];let a=n,o=r;if(n.originP1===n.originP2){A=n,B=r;continue}if(A&&A.originP1===A.originP2&&(a=A,o=B),n.defined)T||(v.push(a),x.push(o),ml(i,v,x,s),v.length=0,x.length=0,T=!T);else{const{originP1:t,originP2:e}=n;let h,l;t&&!1!==t.defined?(h=a,l=o):t&&!1!==e.defined&&(h=n,l=r),T?(T=!T,v.push(h||n),x.push(l||r)):h&&(T=!T,v.push(h||n),x.push(l||r),ml(i,v,x,s),v.length=0,x.length=0)}A=n}else{let r=null,o=null;b!==n.defined?(b?(yl(i,v,x,s),v.length=0,x.length=0):(r=n,o=c.curves[e-t-1]),b=!b):b&&(r=n,o=c.curves[e-t-1]),r&&o&&(a<1&&(r=r.p2&&r.p3?_t(r,a)[0]:Pt(r,a)[0],o=o.p2&&o.p3?_t(o,1-a)[1]:Pt(o,1-a)[1]),r.defined=b,o.defined=b,v.push(r),x.push(o)),r=null,o=null}}o?ml(i,v,x,s):yl(i,v,x,s)}function ml(t,e,i,n){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:a=0,mode:o}=n||{};let h=e[0];t.moveTo(h.p0.x+r,h.p0.y+s,a),h=e[e.length-1];let l=h.p3||h.p1;t.lineTo(l.x+r,l.y+s,a),h=i[i.length-1],t.lineTo(h.p0.x+r,h.p0.y+s,a),h=i[0],l=h.p3||h.p1,t.lineTo(l.x+r,l.y+s,a),t.closePath()}function yl(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+r,e.p0.y+s,a),bl(t,e,1,n),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(o&&t.lineTo(h.p0.x+r,h.p0.y+s,a),bl(t,h,1,n),o=!1):o=!0}t.closePath()}function bl(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,a):t.lineTo(r+e.p1.x,s+e.p1.y,a);else if(e.p2&&e.p3){const[n]=_t(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,a)}}t.DefaultCanvasArcRender=class extends Dh{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=rs,this.builtinContributions=[Hh,Yh,Vh],this.init(t)}drawArcTailCapPath(t,i,n,r,s,a,o,h){const l=h-o,c=t.getParsedAngle(),u=c.startAngle;let d=c.endAngle;d=h;const p=e.abs(d-u),g=d>u;let f=!1;if(s<a){const t=s;s=a,a=t}const m=t.getParsedCornerRadius(),{outerDeltaAngle:y,innerDeltaAngle:b,outerStartAngle:v,outerEndAngle:x,innerEndAngle:A,innerStartAngle:B}=t.getParsePadAngle(u,d),T=m,w=m,S=m,_=m,C=Math.max(w,T),P=Math.max(S,_);let E=C,M=P;const k=s*e.cos(v),R=s*e.sin(v),O=a*e.cos(A),L=a*e.sin(A);let I,D,U,N;if((P>e.epsilon||C>e.epsilon)&&(I=s*e.cos(x),D=s*e.sin(x),U=a*e.cos(B),N=a*e.sin(B),p<e.pi)){const t=Vs(k,R,U,N,I,D,O,L);if(t){const i=k-t[0],n=R-t[1],r=I-t[0],o=D-t[1],h=1/e.sin(e.acos((i*r+n*o)/(e.sqrt(i*i+n*n)*e.sqrt(r*r+o*o)))/2),l=e.sqrt(t[0]*t[0]+t[1]*t[1]);M=e.min(P,(a-l)/(h-1)),E=e.min(C,(s-l)/(h+1))}}if(E>e.epsilon){const t=e.min(T,E),a=e.min(w,E),o=Ys(U,N,k,R,s,t,Number(g)),h=Ys(I,D,O,L,s,a,Number(g));if(E<C&&t===a)i.moveTo(n+o.cx+o.x01,r+o.cy+o.y01),i.arc(n+o.cx,r+o.cy,E,e.atan2(o.y01,o.x01),e.atan2(h.y01,h.x01),!g);else{const t=d-l-.03,o=e.atan2(h.y11,h.x11);i.arc(n,r,s,t,o,!g),a>0&&i.arc(n+h.cx,r+h.cy,a,e.atan2(h.y11,h.x11),e.atan2(h.y01,h.x01),!g)}}else i.moveTo(n+k,r+R);if(!(a>e.epsilon)||b<.001)i.lineTo(n+O,r+L),f=!0;else if(M>e.epsilon){const t=e.min(_,M),s=e.min(S,M),o=Ys(O,L,I,D,a,-s,Number(g)),h=Ys(k,R,U,N,a,-t,Number(g));if(i.lineTo(n+o.cx+o.x01,r+o.cy+o.y01),M<P&&t===s){const t=e.atan2(h.y01,h.x01);i.arc(n+o.cx,r+o.cy,M,e.atan2(o.y01,o.x01),t,!g)}else{s>0&&i.arc(n+o.cx,r+o.cy,s,e.atan2(o.y01,o.x01),e.atan2(o.y11,o.x11),!g);const t=e.atan2(o.cy+o.y11,o.cx+o.x11),h=d-l-.03;i.arc(n,r,a,t,h,g)}}else i.lineTo(n+a*e.cos(B),r+a*e.sin(B));return f}drawShape(t,i,n,r,s,a,o,h){const l=Ui(t,null==a?void 0:a.theme).arc,{fill:c=l.fill,stroke:u=l.stroke,x:d=l.x,y:p=l.y}=t.attribute,g=this.valid(t,l,o,h);if(!g)return;const{fVisible:f,sVisible:m,doFill:y,doStroke:b}=g,{outerRadius:v=l.outerRadius,innerRadius:x=l.innerRadius,cap:A=l.cap,forceShowCap:B=l.forceShowCap}=t.attribute;let T=0;const w=(e.isBoolean(A)&&A||A[0])&&"conical"===c.gradient;if(w){const{sc:i,startAngle:n,endAngle:r}=t.getParsedAngle();e.abs(r-n)<e.pi2-e.epsilon&&(T=i||0,c.startAngle-=T,c.endAngle-=T)}let S=!1;const{isFullStroke:_,stroke:C}=fn(u);if((y||_)&&(i.beginPath(),Xs(t,i,n,r,v,x),S=!0,i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,i,n,r,y,b,f,m,l,s,o,h),y&&(o?o(i,t.attribute,l):f&&(i.setCommonStyle(t,t.attribute,d-n,p-r,l),i.fill())),b&&_&&(h?h(i,t.attribute,l):m&&(i.setStrokeStyle(t,t.attribute,d-n,p-r,l),i.stroke()))),!_&&b&&(i.beginPath(),Xs(t,i,n,r,v,x,C),S||this.beforeRenderStep(t,i,n,r,y,b,f,m,l,s,o,h),h?h(i,t.attribute,l):m&&(i.setStrokeStyle(t,t.attribute,n,r,l),i.stroke())),(e.isBoolean(A)&&A||A[1])&&B){const{startAngle:a,endAngle:c}=t.getParsedAngle();if(e.abs(c-a)>=e.pi2-e.epsilon){i.beginPath();const e=Math.abs(v-x)/2/v,{endAngle:a=l.endAngle,fill:c=l.fill}=t.attribute,u=a;if(this.drawArcTailCapPath(t,i,n,r,v,x,u,u+e),S||this.beforeRenderStep(t,i,n,r,y,b,f,m,l,s,o,h),y){const e=c;if("conical"===e.gradient){const s=Zs(0,0,a,e);o||Gs&&(i.setCommonStyle(t,t.attribute,n,r,l),i.fillStyle=s,i.fill())}}b&&(h||m&&(i.setStrokeStyle(t,t.attribute,n,r,l),i.stroke()))}}this.afterRenderStep(t,i,n,r,y,b,f,m,l,s,o,h),w&&(c.startAngle+=T,c.endAngle+=T)}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}},t.DefaultCanvasArcRender=L([m(),I(0,g(N)),I(0,y(Js)),D("design:paramtypes",[Object])],t.DefaultCanvasArcRender),t.DefaultCanvasCircleRender=class extends Dh{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=os,this.builtinContributions=[Kh,$h,qh],this.init(t)}drawShape(t,e,i,n,r,s,a,o){const h=Ui(t,null==s?void 0:s.theme).circle,{radius:l=h.radius,startAngle:c=h.startAngle,endAngle:u=h.endAngle,x:d=h.x,y:p=h.y}=t.attribute,g=this.valid(t,h,a,o);if(!g)return;const{fVisible:f,sVisible:m,doFill:y,doStroke:b}=g;e.beginPath(),e.arc(i,n,l,c,u),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,y,b,f,m,h,r,a,o),y&&(a?a(e,t.attribute,h):f&&(e.setCommonStyle(t,t.attribute,d-i,p-n,h),e.fill())),b&&(o?o(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,y,b,f,m,h,r,a,o)}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}},t.DefaultCanvasCircleRender=L([m(),I(0,g(N)),I(0,y(ta)),D("design:paramtypes",[Object])],t.DefaultCanvasCircleRender),t.DefaultCanvasLineRender=class extends Dh{constructor(){super(...arguments),this.numberType=us}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}drawSegmentItem(t,i,n,r,s,a,o,h,l,c,u,d,p,g,f){var m,y,b,v,x;if(!i)return;t.beginPath();const A=null!==(m=this.z)&&void 0!==m?m:0;ul(t.camera?t:t.nativeContext,i,l,c,{offsetX:u,offsetY:d,offsetZ:A}),p.cache&&!e.isArray(p.cache)&&p.cache.curves.every((t=>t.defined))&&p.attribute.curveType&&p.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(p,o,h);const{x:B=0,x:T=0}=o;!1!==n&&(g?g(t,o,h):s&&(t.setCommonStyle(p,o,B-u,T-d,h),t.fill())),!1!==r&&(f?f(t,o,h):a&&(t.setStrokeStyle(p,o,B-u,T-d,h),t.stroke()));let{connectedType:w,connectedX:S,connectedY:_,connectedStyle:C}=o;if(e.isArray(h)?(w=null!==(y=null!=w?w:h[0].connectedType)&&void 0!==y?y:h[1].connectedType,S=null!==(b=null!=S?S:h[0].connectedX)&&void 0!==b?b:h[1].connectedX,_=null!==(v=null!=_?_:h[0].connectedY)&&void 0!==v?v:h[1].connectedY,C=null!==(x=null!=C?C:h[0].connectedStyle)&&void 0!==x?x:h[1].connectedStyle):(w=null!=w?w:h.connectedType,S=null!=S?S:h.connectedX,_=null!=_?_:h.connectedY,C=null!=C?C:h.connectedStyle),"connect"!==w&&"zero"!==w&&(w="none"),"none"!==w){t.beginPath(),ul(t.camera?t:t.nativeContext,i,l,c,{offsetX:u,offsetY:d,offsetZ:A,drawConnect:!0,mode:w,zeroX:S,zeroY:_});const m=[];e.isArray(h)?h.forEach((t=>m.push(t))):m.push(h),m.push(o),!1!==n&&(g?g(t,o,h):s&&(t.setCommonStyle(p,C,B-u,T-d,m),t.fill())),!1!==r&&(f?f(t,o,h):a&&(t.setStrokeStyle(p,C,B-u,T-d,m),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,n,r,s,a,o,h,l,c,u,d){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const{x:y=0,x:b=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,h):r&&(e.setCommonStyle(t,t.attribute,y-a,b-o,h),e.fill())),!1!==n&&(d?d(e,t.attribute,h):s&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,h),e.stroke()))}drawShape(t,i,n,r,s,a,o,h){const l=Ui(t,null==a?void 0:a.theme).line,{fill:c=l.fill,stroke:u=l.stroke,fillOpacity:d=l.fillOpacity,strokeOpacity:p=l.strokeOpacity,segments:g,points:f,closePath:m}=t.attribute;if(!this.valid(t,l,o,h))return;let{curveType:y=l.curveType}=t.attribute;m&&"linear"===y&&(y="linearClosed");const{clipRange:b=l.clipRange,clipRangeByDimension:v=l.clipRangeByDimension}=t.attribute;if(1===b&&!g&&!f.some((t=>!1===t.defined))&&"linear"===y)return this.drawLinearLineHighPerformance(t,i,!!c,!!u,d,p,n,r,l,s,a,o,h);if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const r=ie(t.points,y,{startPoint:e});return n=r,r})).filter((t=>!!t)),"linearClosed"===y){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=ie(n,y)}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===b){let e=!1;t.cache.forEach(((a,g)=>{e||(e=this.drawSegmentItem(i,a,!!c,!!u,d,p,s[g],[l,t.attribute],b,v,n,r,t,o,h))}))}else{const a=t.cache.reduce(((t,e)=>t+e.getLength()),0),g=b*a;let f=0,m=!1;t.cache.forEach(((a,y)=>{if(m)return;const b=a.getLength(),x=(g-f)/b;f+=b,x>0&&(m=this.drawSegmentItem(i,a,!!c,!!u,d,p,s[y],[l,t.attribute],e.min(x,1),v,n,r,t,o,h))}))}}else this.drawSegmentItem(i,t.cache,!!c,!!u,d,p,t.attribute,l,b,v,n,r,t,o,h)}},t.DefaultCanvasLineRender=L([m()],t.DefaultCanvasLineRender);const vl=new class extends Fh{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){var p,g,f,m;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:y=t.attribute}=d||{},{texture:b=(null!==(p=t.attribute.texture)&&void 0!==p?p:_n(h,"texture")),textureColor:v=(null!==(g=t.attribute.textureColor)&&void 0!==g?g:_n(h,"textureColor")),textureSize:x=(null!==(f=t.attribute.textureSize)&&void 0!==f?f:_n(h,"textureSize")),texturePadding:A=(null!==(m=t.attribute.texturePadding)&&void 0!==m?m:_n(h,"texturePadding"))}=y;if(!b)return;let B=this.textureMap.get(b);if(!B)switch(b){case"circle":B=this.createCirclePattern(x,A,v,e);break;case"diamond":B=this.createDiamondPattern(x,A,v,e);break;case"rect":B=this.createRectPattern(x,A,v,e);break;case"vertical-line":B=this.createVerticalLinePattern(x,A,v,e);break;case"horizontal-line":B=this.createHorizontalLinePattern(x,A,v,e);break;case"bias-lr":B=this.createBiasLRLinePattern(x,A,v,e);break;case"bias-rl":B=this.createBiasRLLinePattern(x,A,v,e);break;case"grid":B=this.createGridPattern(x,A,v,e)}B&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=B,e.fill(),e.highPerformanceRestore())}},xl=Gh;function Al(t,e,i){switch(e){case"linear":default:return Lt(t,i);case"basis":return Wt(t,i);case"monotoneX":return Xt(t,i);case"monotoneY":return qt(t,i);case"step":return Zt(t,.5,i);case"stepBefore":return Zt(t,0,i);case"stepAfter":return Zt(t,1,i);case"linearClosed":return te(t,i)}}t.DefaultCanvasAreaRender=class extends Dh{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=as,this.builtinContributions=[vl,xl],this.init(t)}drawLinearAreaHighPerformance(t,i,n,r,s,a,o,h,l,c,u,d,p){var g,f,m,y,b;i.beginPath();const v=null!==(g=this.z)&&void 0!==g?g:0,{points:x}=t.attribute,A=x[0];i.moveTo(A.x+o,A.y+h,v);for(let t=1;t<x.length;t++){const e=x[t];i.lineTo(e.x+o,e.y+h,v)}for(let t=x.length-1;t>=0;t--){const e=x[t];i.lineTo((null!==(f=e.x1)&&void 0!==f?f:e.x)+o,(null!==(m=e.y1)&&void 0!==m?m:e.y)+h,v)}i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,i,o,h,!!s,!1,n,!1,l,c,d,null,{attribute:t.attribute});const{x:B=0,x:T=0}=t.attribute;if(!1!==n&&(d?d(i,t.attribute,l):s&&(i.setCommonStyle(t,t.attribute,B-o,T-h,l),i.fill())),r){const{stroke:r=l&&l.stroke}=t.attribute;if(e.isArray(r)&&(r[0]||r[2])&&!1===r[1])if(i.beginPath(),r[0]){i.moveTo(A.x+o,A.y+h,v);for(let t=1;t<x.length;t++){const e=x[t];i.lineTo(e.x+o,e.y+h,v)}}else if(r[2]){const t=x[x.length-1];i.moveTo(t.x+o,t.y+h,v);for(let t=x.length-2;t>=0;t--){const e=x[t];i.lineTo((null!==(y=e.x1)&&void 0!==y?y:e.x)+o,(null!==(b=e.y1)&&void 0!==b?b:e.y)+h,v)}}i.setStrokeStyle(t,t.attribute,B-o,T-h,l),i.stroke(),this.afterRenderStep(t,i,o,h,!!s,!1,n,!1,l,c,d,null,{attribute:t.attribute})}}drawShape(t,i,n,r,s,a,o,h){var l,c,u,d,p,g;const f=Ui(t,null==a?void 0:a.theme).area,{fill:m=f.fill,stroke:y=f.stroke,fillOpacity:b=f.fillOpacity,z:v=f.z,strokeOpacity:x=f.strokeOpacity}=t.attribute,A=this.valid(t,f,o,h);if(!A)return;const{doFill:B,doStroke:T}=A,{clipRange:w=f.clipRange,closePath:S,points:_,segments:C}=t.attribute;let{curveType:P=f.curveType}=t.attribute;if(S&&"linear"===P&&(P="linearClosed"),1===w&&!C&&!_.some((t=>!1===t.defined))&&"linear"===P)return this.drawLinearAreaHighPerformance(t,i,!!m,T,b,x,n,r,f,s,a,o,h);if(t.shouldUpdateShape()){if(C&&C.length){let e,i;const n=C.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===n?e={x:i.endX,y:i.endY}:n>1&&(e.x=i.endX,e.y=i.endY);const r=Al(t.points,P,{startPoint:e});return i=r,r})).filter((t=>!!t));let r;const s=[];for(let t=C.length-1;t>=0;t--){const e=C[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(c=e[t].y1)&&void 0!==c?c:e[t].y});if(0!==t){const e=C[t-1].points,n=e[e.length-1];n&&i.push({x:null!==(u=n.x1)&&void 0!==u?u:n.x,y:null!==(d=n.y1)&&void 0!==d?d:n.y})}i.length>1&&(r=Al(i,"stepBefore"===P?"stepAfter":"stepAfter"===P?"stepBefore":P),s.unshift(r))}t.cacheArea=s.map(((t,e)=>({top:n[e],bottom:t})))}else{if(!_||!_.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=_,i=[];for(let t=_.length-1;t>=0;t--)i.push({x:null!==(p=_[t].x1)&&void 0!==p?p:_[t].x,y:null!==(g=_[t].y1)&&void 0!==g?g:_[t].y});const n=Al(e,P),r=Al(i,"stepBefore"===P?"stepAfter":"stepAfter"===P?"stepBefore":P);t.cacheArea={top:n,bottom:r}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const a=t.attribute.segments.filter((t=>t.points.length));if(1===a[0].points.length&&a.shift(),1===w){let e=!1;t.cacheArea.forEach(((l,c)=>{e||(e=this.drawSegmentItem(i,l,B,b,T,x,a[c],[f,t.attribute],w,n,r,v,t,s,o,h))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),c=w*l;let u=0,d=!1;t.cacheArea.forEach(((l,p)=>{if(d)return;const g=l.top.getLength(),m=(c-u)/g;u+=g,m>0&&(d=this.drawSegmentItem(i,l,B,b,T,x,a[p],[f,t.attribute],e.min(m,1),n,r,v,t,s,o,h))}))}}else this.drawSegmentItem(i,t.cacheArea,B,b,T,x,t.attribute,f,w,n,r,v,t,s,o,h)}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,g,f){let m=!1;return m=m||this._drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,!1,g,f),m=m||this._drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,!0,g,f),m}_drawSegmentItem(i,n,r,s,a,o,h,l,c,u,d,p,g,f,m,y,b){var v,x,A,B;let{connectedType:T,connectedX:w,connectedY:S,connectedStyle:_}=h;const C=[];if(m&&(e.isArray(l)?(T=null!==(v=null!=T?T:l[0].connectedType)&&void 0!==v?v:l[1].connectedType,w=null!==(x=null!=w?w:l[0].connectedX)&&void 0!==x?x:l[1].connectedX,S=null!==(A=null!=S?S:l[0].connectedY)&&void 0!==A?A:l[1].connectedY,_=null!==(B=null!=_?_:l[0].connectedStyle)&&void 0!==B?B:l[1].connectedStyle):(T=null!=T?T:l.connectedType,w=null!=w?w:l.connectedX,S=null!=S?S:l.connectedY,_=null!=_?_:l.connectedStyle),"connect"!==T&&"zero"!==T&&(T="none"),e.isArray(l)?l.forEach((t=>C.push(t))):C.push(l),C.push(h)),m&&"none"===T)return!1;if(!n)return;i.beginPath();const{points:P,segments:E}=g.attribute;let M,k,R=t.Direction.ROW;if(E){const t=E[E.length-1];k=E[0].points[0],M=t.points[t.points.length-1]}else k=P[0],M=P[P.length-1];R=e.abs(M.x-k.x)>e.abs(M.y-k.y)?t.Direction.ROW:t.Direction.COLUMN,fl(i.camera?i:i.nativeContext,n,c,{offsetX:u,offsetY:d,offsetZ:p,direction:R,drawConnect:m,mode:T,zeroX:w,zeroY:S}),this.beforeRenderStep(g,i,u,d,!!s,!1,r,!1,l,f,y,null,{attribute:h}),i.setShadowBlendStyle&&i.setShadowBlendStyle(g,h,l);const{x:O=0,x:L=0}=h;if(!1!==r&&(y?y(i,h,l):s&&(i.setCommonStyle(g,m?_:h,O-u,L-d,m?C:l),i.fill())),this.afterRenderStep(g,i,u,d,!!s,!1,r,!1,l,f,y,null,{attribute:h}),!1!==a)if(b)b(i,h,l);else{const{stroke:r=l&&l[1]&&l[1].stroke}=h;e.isArray(r)&&(r[0]||r[2])&&!1===r[1]&&(i.beginPath(),ul(i.camera?i:i.nativeContext,r[0]?n.top:n.bottom,c,R===t.Direction.ROW?"x":"y",{offsetX:u,offsetY:d,offsetZ:p,drawConnect:m,mode:T,zeroX:w,zeroY:S})),i.setStrokeStyle(g,m?_:h,O-u,L-d,m?C:l),i.stroke()}return!1}},t.DefaultCanvasAreaRender=L([m(),I(0,g(N)),I(0,y(Qs)),D("design:paramtypes",[Object])],t.DefaultCanvasAreaRender);const Bl=zh,Tl=Gh;t.DefaultCanvasPathRender=class extends Dh{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=ds,this.builtinContributions=[Tl,Bl],this.init(t)}drawShape(t,e,i,n,r,s,a,o){var h,l,c;const u=null!==(h=this.tempTheme)&&void 0!==h?h:Ui(t,null==s?void 0:s.theme).path,{x:d=u.x,y:p=u.y}=t.attribute,g=null!==(l=this.z)&&void 0!==l?l:0,f=this.valid(t,u,a,o);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f;if(e.beginPath(),t.pathShape)xt(t.pathShape.commandList,e,i,n,1,1,g);else{xt((null!==(c=t.attribute.path)&&void 0!==c?c:u.path).commandList,e,i,n,1,1,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,b,v,m,y,u,r,a,o),v&&(o?o(e,t.attribute,u):y&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,u),e.stroke())),b&&(a?a(e,t.attribute,u):m&&(e.setCommonStyle(t,t.attribute,d-i,p-n,u),e.fill())),this.afterRenderStep(t,e,i,n,b,v,m,y,u,r,a,o)}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasPathRender=L([m(),I(0,g(N)),I(0,y(na)),D("design:paramtypes",[Object])],t.DefaultCanvasPathRender),t.DefaultCanvasRectRender=class extends Dh{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=fs,this.builtinContributions=[rl,al,sl],this.init(t)}drawShape(t,i,n,r,s,a,o,h){var l;const c=null!==(l=this.tempTheme)&&void 0!==l?l:Ui(t,null==a?void 0:a.theme).rect,{fill:u=c.fill,background:d,stroke:p=c.stroke,cornerRadius:g=c.cornerRadius,opacity:f=c.opacity,fillOpacity:m=c.fillOpacity,lineWidth:y=c.lineWidth,strokeOpacity:b=c.strokeOpacity,visible:v=c.visible,x1:x,y1:A,x:B=c.x,y:T=c.y}=t.attribute;let{width:w,height:S}=t.attribute;w=(null!=w?w:x-B)||0,S=(null!=S?S:A-T)||0;const _=Fs(f,m,w,S,u),C=js(f,b,w,S),P=Ns(u,d),E=Ws(p,y);if(!t.valid||!v)return;if(!P&&!E)return;if(!(_||C||o||h||d))return;0===g||e.isArray(g)&&g.every((t=>0===t))?(i.beginPath(),i.rect(n,r,w,S)):(i.beginPath(),tl(i,n,r,w,S,g));const M={doFill:P,doStroke:E};i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,i,n,r,P,E,_,C,c,s,o,h,M),M.doFill&&(o?o(i,t.attribute,c):_&&(i.setCommonStyle(t,t.attribute,B-n,T-r,c),i.fill())),M.doStroke&&(h?h(i,t.attribute,c):C&&(i.setStrokeStyle(t,t.attribute,B-n,T-r,c),i.stroke())),this.afterRenderStep(t,i,n,r,P,E,_,C,c,s,o,h)}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasRectRender=L([m(),I(0,g(N)),I(0,y(sa)),D("design:paramtypes",[Object])],t.DefaultCanvasRectRender),t.DefaultCanvasSymbolRender=class extends Dh{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=bs,this.builtinContributions=[hl,cl,ll],this.init(t)}drawShape(t,i,n,r,s,a,o,h){var l;const c=Ui(t,null==a?void 0:a.theme).symbol,{size:u=c.size,x:d=c.x,y:p=c.y,scaleX:g=c.scaleX,scaleY:f=c.scaleY}=t.attribute,m=this.valid(t,c,o,h);if(!m)return;const{fVisible:y,sVisible:b,doFill:v,doStroke:x}=m,A=t.getParsedPath();if(!A)return;const{keepDirIn3d:B=c.keepDirIn3d}=t.attribute,T=null!==(l=this.z)&&void 0!==l?l:0;if(i.beginPath(),B&&i.camera&&i.project){const s=i.project(n,r,T),a=i.camera;i.camera=null,!1===A.draw(i,e.isArray(u)?[u[0]*g,u[1]*f]:u*g,s.x,s.y,void 0,((e,s)=>{var a,l,u;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(a=s.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(l=s.fill)&&void 0!==l?l:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(u=s.stroke)&&void 0!==u?u:t.attribute.stroke,s=e}s.fill&&(o?o(i,t.attribute,c):(i.setCommonStyle(t,s,d-n,p-r,c),i.fill())),s.stroke&&(h?h(i,t.attribute,c):(i.setStrokeStyle(t,s,(d-n)/g,(p-r)/f,c),i.stroke()))}))&&i.closePath(),i.camera=a}else!1===A.draw(i,u,n,r,T,((e,s)=>{var a,l,u;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(a=s.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(l=s.opacity)&&void 0!==l?l:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(u=s.stroke)&&void 0!==u?u:t.attribute.stroke,s=e}s.fill&&(o?o(i,t.attribute,c):(i.setCommonStyle(t,s,d-n,p-r,c),i.fill())),s.stroke&&(h?h(i,t.attribute,c):(i.setStrokeStyle(t,s,(d-n)/g,(p-r)/f,c),i.stroke()))}))&&i.closePath();i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,i,n,r,v,x,y,b,c,s,o,h),v&&!A.isSvg&&(o?o(i,t.attribute,c):y&&(i.setCommonStyle(t,t.attribute,d-n,p-r,c),i.fill())),x&&!A.isSvg&&(h?h(i,t.attribute,c):b&&(i.setStrokeStyle(t,t.attribute,(d-n)/g,(p-r)/f,c),i.stroke())),this.afterRenderStep(t,i,n,r,v,x,y,b,c,s,o,h)}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}},t.DefaultCanvasSymbolRender=L([m(),I(0,g(N)),I(0,y(aa)),D("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender);const wl=new class extends Wh{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{background:d,backgroundMode:p=h.backgroundMode}=t.attribute;if(!d)return;const g=t.AABBBounds;if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),this.doDrawImage(e,i.data,g,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fillRect(g.x1,g.y1,g.width(),g.height()),e.highPerformanceRestore()}};function Sl(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function _l(t,e){return Math.sqrt(t*t+e*e)}function Cl(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.DefaultCanvasTextRender=class extends Dh{constructor(t){super(),this.textRenderContribitions=t,this.numberType=vs,this.builtinContributions=[wl],this.init(t)}drawShape(t,i,n,r,s,a,o,h){var l,c,u;const d=Ui(t,null==a?void 0:a.theme).text,{text:p,underline:g=d.underline,lineThrough:f=d.lineThrough,keepDirIn3d:m=d.keepDirIn3d,direction:y=d.direction,whiteSpace:b=d.whiteSpace,fontSize:v=d.fontSize,verticalMode:x=d.verticalMode,x:A=d.x,y:B=d.y}=t.attribute;let{textAlign:T=d.textAlign,textBaseline:w=d.textBaseline}=t.attribute;if(!x&&"vertical"===y){const e=T;T=null!==(l=t.getBaselineMapAlign()[w])&&void 0!==l?l:"left",w=null!==(c=t.getAlignMapBaseline()[e])&&void 0!==c?c:"top"}const S=null!==(u=En(t.attribute.lineHeight,v))&&void 0!==u?u:v,_=this.valid(t,d,o,h);if(!_)return;const{fVisible:C,sVisible:P,doFill:E,doStroke:M}=_,k=!m,R=this.z||0;i.beginPath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,i,n,r,E,M,C,P,d,s,o,h),k&&this.transformUseContext2d(t,d,R,i);const O=(e,s,a,l)=>{let c=n+s;const u=r+a;if(l){i.highPerformanceSave(),c+=v;const t=Th.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,u),i.transformFromMatrix(t,!0),Th.free(t)}M&&(h?h(i,t.attribute,d):P&&(i.setStrokeStyle(t,t.attribute,A-n,B-r,d),i.strokeText(e,c,u,R))),E&&(o?o(i,t.attribute,d):C&&(i.setCommonStyle(t,t.attribute,A-n,B-r,d),i.fillText(e,c,u,R),this.drawUnderLine(g,f,t,c,u,R,d,i))),l&&(i.highPerformanceRestore(),i.setTransformForCurrent())};if(t.isMultiLine)if(i.setTextStyleWithoutAlignBaseline(t.attribute,d,R),"horizontal"===y){const{multilineLayout:e}=t;if(!e)return void i.highPerformanceRestore();const{xOffset:s,yOffset:a}=e.bbox;M&&(h?h(i,t.attribute,d):P&&(i.setStrokeStyle(t,t.attribute,A-n,B-r,d),e.lines.forEach((t=>{i.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+a+r,R)})))),E&&(o?o(i,t.attribute,d):C&&(i.setCommonStyle(t,t.attribute,A-n,B-r,d),e.lines.forEach((e=>{i.fillText(e.str,(e.leftOffset||0)+s+n,(e.topOffset||0)+a+r,R),this.drawMultiUnderLine(g,f,t,(e.leftOffset||0)+n,(e.topOffset||0)+a+r,R,e.width,d,i)}))))}else{t.tryUpdateAABBBounds();const n=t.cache,{verticalList:r}=n;i.textAlign="left",i.textBaseline="top";const s=S*r.length;let a=0;r.forEach((t=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0);a=e.max(i,a)}));let o=0,h=0;"bottom"===w?h=-s:"middle"===w&&(h=-s/2),"center"===T?o-=a/2:"right"===T&&(o-=a),r.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),n=a-i;let r=o;"center"===T?r+=n/2:"right"===T&&(r+=n),t.forEach((t=>{const{text:i,width:n,direction:a}=t;O(i,s-(e+1)*S+h,r,a),r+=n}))}))}else if("horizontal"===y){i.setTextStyle(t.attribute,d,R);const e=t.clipedText;let n=0;S!==v&&("top"===w?n=(S-v)/2:"middle"===w||"bottom"===w&&(n=-(S-v)/2)),O(e,0,n,0)}else{t.tryUpdateAABBBounds();const e=t.cache;if(e){i.setTextStyleWithoutAlignBaseline(t.attribute,d,R);const{verticalList:n}=e;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let a=0;"bottom"===w?a=-S:"middle"===w&&(a=-S/2),"center"===T?r-=s/2:"right"===T&&(r-=s),i.textAlign="left",i.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;O(e,a,r,n),r+=i}))}}k&&this.restoreTransformUseContext2d(t,d,R,i),this.afterRenderStep(t,i,n,r,E,M,C,P,d,s,o,h)}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,a=!s;this._draw(t,r,a,i,n)}drawUnderLine(t,e,i,n,r,s,a,o){if(e+t<=0)return;const{textAlign:h=a.textAlign,textBaseline:l=a.textBaseline,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:p=a.fillOpacity}=i.attribute,g=i.clipedWidth,f=ga(h,g),m=fa(l,c,c),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};if(t){y.lineWidth=t,o.setStrokeStyle(i,y,n,r,a),o.beginPath();const e=r+m+c;o.moveTo(n+f,e,s),o.lineTo(n+f+g,e,s),o.stroke()}if(e){y.lineWidth=e,o.setStrokeStyle(i,y,n,r,a),o.beginPath();const t=r+m+c/2;o.moveTo(n+f,t,s),o.lineTo(n+f+g,t,s),o.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,a,o,h){if(e+t<=0)return;const{textAlign:l=o.textAlign,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:p=o.fillOpacity}=i.attribute,g=ga(l,a),f=fa("alphabetic",c,c),m={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};let y=-3;if(t){m.lineWidth=t,h.setStrokeStyle(i,m,n,r,o),h.beginPath();const e=r+f+c+y;h.moveTo(n+g,e,s),h.lineTo(n+g+a,e,s),h.stroke()}if(y=-1,e){m.lineWidth=e,h.setStrokeStyle(i,m,n,r,o),h.beginPath();const t=r+f+c/2+y;h.moveTo(n+g,t,s),h.lineTo(n+g+a,t,s),h.stroke()}}},t.DefaultCanvasTextRender=L([m(),I(0,g(N)),I(0,y(oa)),D("design:paramtypes",[Object])],t.DefaultCanvasTextRender),t.AbstractGraphicRender=class{},t.AbstractGraphicRender=L([m()],t.AbstractGraphicRender);const Pl=zh,El=Gh;t.DefaultCanvasPolygonRender=class extends Dh{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=ps,this.builtinContributions=[El,Pl],this.init(t)}drawShape(t,i,n,r,s,a,o,h){const l=Ui(t,null==a?void 0:a.theme).polygon,{points:c=l.points,cornerRadius:u=l.cornerRadius,x:d=l.x,y:p=l.y,closePath:g=l.closePath}=t.attribute,f=this.valid(t,l,o,h);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f;i.beginPath(),u<=0||e.isArray(u)&&u.every((t=>0===t))?Sl(i.camera?i:i.nativeContext,c,n,r):function(t,e,i,n,r,s=!0){var a;if(e.length<3)return void Sl(t,e,i,n);let o=0,h=e.length-1;s||(o+=1,h-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=o;s<=h;s++){const o=e[0===s?h:(s-1)%e.length],l=e[s%e.length],c=e[(s+1)%e.length],u=l.x-o.x,d=l.y-o.y,p=l.x-c.x,g=l.y-c.y,f=(Math.atan2(d,u)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let y=Array.isArray(r)?null!==(a=r[s%e.length])&&void 0!==a?a:0:r,b=y/m;const v=_l(u,d),x=_l(p,g),A=Math.min(v,x);b>A&&(b=A,y=A*m);const B=Cl(l,b,v,u,d),T=Cl(l,b,x,p,g),w=2*l.x-B.x-T.x,S=2*l.y-B.y-T.y,_=_l(w,S),C=Cl(l,_l(b,y),_,w,S);let P=Math.atan2(B.y-C.y,B.x-C.x);const E=Math.atan2(T.y-C.y,T.x-C.x);let M=E-P;M<0&&(P=E,M=-M),M>Math.PI&&(M-=Math.PI),0===s?t.moveTo(B.x+i,B.y+n):t.lineTo(B.x+i,B.y+n),M&&t.arcTo(l.x+i,l.y+n,T.x+i,T.y+n,y),t.lineTo(T.x+i,T.y+n)}s||t.lineTo(e[h+1].x+i,e[h+1].y+n)}(i.camera?i:i.nativeContext,c,n,r,u,g),g&&i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,i,n,r,b,v,m,y,l,s,o,h),b&&(o?o(i,t.attribute,l):m&&(i.setCommonStyle(t,t.attribute,d-n,p-r,l),i.fill())),v&&(h?h(i,t.attribute,l):y&&(i.setStrokeStyle(t,t.attribute,d-n,p-r,l),i.stroke())),this.afterRenderStep(t,i,n,r,b,v,m,y,l,s,o,h)}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPolygonRender=L([m(),I(0,g(N)),I(0,y(ra)),D("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);const Ml=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class extends Dh{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=cs,this.builtinContributions=[il],this.init(t)}drawShape(t,i,n,r,s,a,o){const h=Ui(t).image,{width:l=h.width,height:c=h.height,repeatX:u=h.repeatX,repeatY:d=h.repeatY,cornerRadius:p=h.cornerRadius,image:g}=t.attribute,f=this.valid(t,h,o);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f;if(i.setShadowBlendStyle&&i.setShadowBlendStyle(t,h),this.beforeRenderStep(t,i,n,r,b,!1,m,!1,h,s,o),b)if(o)o(i,t.attribute,h);else if(m){if(!g||!t.resources)return;const s=t.resources.get(g);if("success"!==s.state)return;let a=!1;0===p||e.isArray(p)&&p.every((t=>0===t))||(i.beginPath(),tl(i,n,r,l,c,p),i.save(),i.clip(),a=!0),i.setCommonStyle(t,t.attribute,n,r,h);let o=0;if("repeat"===u&&(o|=1),"repeat"===d&&(o|=2),o){const t=i.createPattern(s.data,Ml[o]);i.fillStyle=t,i.translate(n,r,!0),i.fillRect(0,0,l,c),i.translate(-n,-r,!0)}else i.drawImage(s.data,n,r,l,c);a&&i.restore()}this.afterRenderStep(t,i,n,r,b,!1,m,!1,h,s,o)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;if("success"!==t.resources.get(n).state)return;const{context:r}=e.drawParams;if(!r)return;const s=Ui(t).image;this._draw(t,s,!1,i)}},t.DefaultCanvasImageRender=L([m(),I(0,g(N)),I(0,y(ia)),D("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const kl=Symbol.for("IncrementalDrawContribution"),Rl=Symbol.for("ArcRender"),Ol=Symbol.for("Arc3dRender"),Ll=Symbol.for("AreaRender"),Il=Symbol.for("CircleRender"),Dl=Symbol.for("GraphicRender"),Ul=Symbol.for("GroupRender"),Nl=Symbol.for("LineRender"),Wl=Symbol.for("PathRender"),Gl=Symbol.for("PolygonRender"),Fl=Symbol.for("RectRender"),zl=Symbol.for("Rect3DRender"),jl=Symbol.for("SymbolRender"),Hl=Symbol.for("TextRender"),Vl=Symbol.for("RichTextRender"),Yl=Symbol.for("Pyramid3dRender"),Xl=Symbol.for("GlyphRender"),Kl=Symbol.for("ImageRender"),ql=Symbol.for("RenderSelector"),$l=Symbol.for("DrawContribution"),Zl=Symbol.for("RenderService"),Jl=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}},t.DefaultRenderService=L([m(),I(0,g($l)),D("design:paramtypes",[Object])],t.DefaultRenderService);var Ql=new n((e=>{e(Zl).to(t.DefaultRenderService).inSingletonScope()}));const tc=Symbol.for("GraphicPicker"),ec=Symbol.for("PickerService"),ic=Symbol.for("BoundsPicker"),nc=Symbol.for("GlobalPickerService"),rc=Symbol.for("PickItemInterceptor");t.ShadowRootPickItemInterceptorContribution=class{constructor(){this.order=1}afterPickItem(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}beforePickItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}_pickItem(t,i,n,r,s){if(!t.shadowRoot)return null;const{parentMatrix:a}=s||{};if(!a)return null;const o=i.pickContext;o.highPerformanceSave();const h=t.shadowRoot,l=Th.allocateByObj(a),c=new e.Point(l.a*n.x+l.c*n.y+l.e,l.b*n.x+l.d*n.y+l.f),u=i.pickGroup(h,c,l,r);return o.highPerformanceRestore(),u}},t.ShadowRootPickItemInterceptorContribution=L([m()],t.ShadowRootPickItemInterceptorContribution),t.InteractivePickItemInterceptorContribution=class{constructor(){this.order=1}beforePickItem(t,i,n,r,s){const a=t.baseGraphic;if(a&&a.parent){const t=new e.Point(n.x,n.y),s=i.pickContext;s.highPerformanceSave();const o=a.parent.globalTransMatrix;o.transformPoint(t,t);const h=a.isContainer?i.pickGroup(a,t.clone(),o,r):i.pickItem(a,t.clone(),o,r);return s.highPerformanceRestore(),h}return null}},t.InteractivePickItemInterceptorContribution=L([m()],t.InteractivePickItemInterceptorContribution),t.Canvas3DPickItemInterceptor=class{constructor(){this.order=1}beforePickItem(t,i,n,r,s){if(!t.in3dMode||r.in3dInterceptor)return null;const a=i.pickContext,o=t.stage;if(!a||!o)return null;if(r.in3dInterceptor=!0,a.save(),this.initCanvasCtx(a),a.camera=o.camera,t.isContainer){let o,h=!1,l=!1;if(t.forEachChildren((t=>(h=t.numberType===ss,!h))),t.forEachChildren((t=>(l=!!t.findFace,!l))),h){const a=t.getChildren(),h=[...a];h.sort(((t,i)=>{var n,r,s,a;let o=(null!==(r=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==r?r:0)/2,h=(null!==(a=null!==(s=i.attribute.startAngle)&&void 0!==s?s:0+i.attribute.endAngle)&&void 0!==a?a:0)/2;for(;o<0;)o+=e.pi2;for(;h<0;)h+=e.pi2;return h-o})),h.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),h.forEach((e=>{t.appendChild(e)})),r.hack_pieFace="outside",o=i.pickGroup(t,n,s.parentMatrix,r),o.graphic||(r.hack_pieFace="inside",o=i.pickGroup(t,n,s.parentMatrix,r)),o.graphic||(r.hack_pieFace="top",o=i.pickGroup(t,n,s.parentMatrix,r)),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),a.forEach((e=>{t.appendChild(e)}))}else if(l){const e=t.getChildren(),h=e.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return a.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));h.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),h.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),h.forEach((e=>{t.add(e.g)})),o=i.pickGroup(t,n,s.parentMatrix,r),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else o=i.pickGroup(t,n,s.parentMatrix,r);return a.camera=null,r.in3dInterceptor=!1,a.restore(),o}return a.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}},t.Canvas3DPickItemInterceptor=L([m()],t.Canvas3DPickItemInterceptor);var sc=new n(((e,i,n)=>{n(ec)||(e(nc).toSelf(),e(ec).toService(nc)),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(rc).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(rc).toService(t.ShadowRootPickItemInterceptorContribution),e(t.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(),e(rc).toService(t.InteractivePickItemInterceptorContribution),G(e,rc)})),ac=new n((e=>{e(xs).to(t.DefaultGraphicService).inSingletonScope(),e(As).toConstantValue(Rh)}));const oc=Symbol.for("AutoEnablePlugins"),hc=Symbol.for("PluginService");let lc=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&Ve.isBound(oc)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};lc=L([m(),I(0,g(N)),I(0,y(oc)),D("design:paramtypes",[Object])],lc);var cc=new n((t=>{t(hc).to(lc),F(t,oc)})),uc=new n((t=>{G(t,H)})),dc=new n((e=>{e(He).to(t.DefaultTextMeasureContribution).inSingletonScope(),G(e,He)}));let pc=class{constructor(){this.type="static",this.offscreen=!1,this.global=Oe.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Ke({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var n;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};pc=L([m(),D("design:paramtypes",[])],pc);let gc=class{constructor(){this.offscreen=!1,this.type="virtual",this.global=Oe.global}setDpr(t){}init(t,e,i){if(this.layer=t,this.window=e,i.main)throw new Error("virtual layer不能作为main layer");this.main=!1,this.canvas=null,this.context=null}resize(t,e){}resizeView(t,e){}render(t,e,i){this.mainHandler.render(t,e,Object.assign(Object.assign({},i),{clear:!1}))}merge(t){}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return null}release(){}};gc=L([m(),D("design:paramtypes",[])],gc);let fc=class{constructor(){this.offscreen=!0,this.type="dynamic",this.global=Oe.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;const n=Ke({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"}))}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,i){const n=t.getContext(),r=t.dpr,{x:s=0,y:a=0,width:o=this.layer.viewWidth,height:h=this.layer.viewHeight}=i;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,a,o,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,a,o,h),n.nativeContext.restore()}merge(t){}};fc=L([m(),D("design:paramtypes",[])],fc);var mc=new n((t=>{t(pc).toSelf(),t(fc).toSelf(),t(gc).toSelf(),t(Os).toService(pc),t(Ls).toService(fc),t(Is).toService(gc)}));function yc(t,e,i,n=!1,r=!1){const s={},a=[];let o=!1;if(r)o=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return o=!0,!0;return!1}),n)}if(o){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],a.push(i))}),n),a.sort(((t,e)=>n?e-t:t-e));let o=!1;for(let t=0;t<a.length&&!o;t++){const e=a[t],h=s[e];r&&h.sort(((t,e)=>{var i,r;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<h.length;t++)if(i(h[t],t)){o=!0;break}}}else t.forEachChildren(i,n)}function bc(t,e,i,n=!1){return U(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function vc(t,e,i,n=!1){const r={},s=[];let a=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(undefined!==n)return a=!0,!0;return!1}),n);let o=null,h=!1;if(a){t.forEachChildren((t=>{const{zIndex:e=i}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),n),s.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<s.length&&!a;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(h){a=!0,o=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(o=t,!0):(t._uid===e&&(h=!0),!1)),n);return o}const xc=Symbol.for("DrawItemInterceptor"),Ac=new e.AABBBounds;class Bc{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){Ac.copy(n.dirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e)}return n.renderGroup(t.shadowRoot,i,t.parent.globalTransMatrix),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(Ac),!0}}class Tc{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=i;s.highPerformanceSave(),t.parent&&s.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&s.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const a=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(s,t),s.strokeRect(a.x1,a.y1,a.width(),a.height()),s.highPerformanceRestore(),!0}}let wc=class{constructor(){this.order=1,this.interceptors=[new Bc,new _c,new Sc,new Tc]}afterDrawItem(t,e,i,n,r){for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].afterDrawItem&&this.interceptors[s].afterDrawItem(t,e,i,n,r))return!0;return!1}beforeDrawItem(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].beforeDrawItem&&this.interceptors[s].beforeDrawItem(t,e,i,n,r))return!0;return!1}};wc=L([m(),D("design:paramtypes",[])],wc);class Sc{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}beforeSetInteractive(t,e,i,n,r){let s=t.interactiveGraphic;if(t.attribute.globalZIndex){s||(s=t.clone(),t.interactiveGraphic=s,s.baseGraphic=t),s.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");if(e){this.getShadowRoot(e).add(s)}return!0}if(s){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");if(e){this.getShadowRoot(e).removeChild(s)}t.interactiveGraphic=null,s.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,n,r){const s=t.baseGraphic;if(s){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(s.parent.globalTransMatrix,!0),s.isContainer?n.renderGroup(s,i,s.parent.globalTransMatrix):n.renderItem(s,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Rh.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class _c{constructor(){this.order=1}beforeDrawItem(t,i,n,r,s){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;const{context:a,stage:o}=i.drawParams;a.canvas,a.save(),this.initCanvasCtx(a),a.camera=o.camera;const h=a.currentMatrix;h.a/=a.dpr,h.b/=a.dpr,h.c/=a.dpr,h.d/=a.dpr,h.e/=a.dpr,h.f/=a.dpr;const l=wh.allocate();Ph(l,h);const c=a.modelMatrix;if(c){if(l){const t=wh.allocate();a.modelMatrix=Eh(t,c,l)}}else a.modelMatrix=l;if(a.setTransform(1,0,0,1,0,0,!0),t.isContainer){let i=!1,s=!1;if(t.forEachChildren((t=>(i=t.numberType===ss,!i))),t.forEachChildren((t=>(s=!!t.findFace,!s))),i){const i=t.getChildren(),s=[...i];s.sort(((t,i)=>{var n,r,s,a;let o=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(r=t.attribute.endAngle)&&void 0!==r?r:0))/2,h=((null!==(s=i.attribute.startAngle)&&void 0!==s?s:0)+(null!==(a=i.attribute.endAngle)&&void 0!==a?a:0))/2;for(;o<0;)o+=e.pi2;for(;h<0;)h+=e.pi2;return h-o})),s.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),s.forEach((e=>{t.appendChild(e)}));const a=t.parent.globalTransMatrix;n.hack_pieFace="outside",r.renderGroup(t,n,a),n.hack_pieFace="inside",r.renderGroup(t,n,a),n.hack_pieFace="top",r.renderGroup(t,n,a),t.removeAllChild(),i.forEach((t=>{t._next=null,t._prev=null})),i.forEach((e=>{t.appendChild(e)}))}else if(s){const e=t.getChildren(),i=e.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return a.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));i.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),i.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),i.forEach((e=>{t.add(e.g)})),r.renderGroup(t,n,t.parent.globalTransMatrix,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else r.renderGroup(t,n,t.parent.globalTransMatrix)}else r.renderItem(t,n);return a.camera=null,a.restore(),a.modelMatrix!==c&&wh.free(a.modelMatrix),a.modelMatrix=c,n.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}const Cc=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new e.AABBBounds)}allocate(t,i,n,r){if(!this.pools.length)return(new e.AABBBounds).setValue(t,i,n,r);const s=this.pools.pop();return s.x1=t,s.y1=i,s.x2=n,s.y2=r,s}allocateByObj(t){if(!this.pools.length)return new e.AABBBounds(t);const i=this.pools.pop();return i.x1=t.x1,i.y1=t.y1,i.x2=t.x2,i.y2=t.y2,i}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};let Pc=class{constructor(t,i){this.contributions=t,this.drawItemInterceptorContributions=i,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new e.Bounds,this.backupDirtyBounds=new e.Bounds,this.global=Oe.global,this.layerService=Oe.layerService,this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,i){this.prepareForDraw(t,i),i.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(i.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:n,stage:r,x:s=0,y:a=0,width:o,height:h}=i;if(!n)return;const l=this.dirtyBounds.setValue(0,0,o,h);if(r.dirtyBounds&&!r.dirtyBounds.empty()){const t=e.getRectIntersect(l,r.dirtyBounds,!1);l.x1=Math.floor(t.x1),l.y1=Math.floor(t.y1),l.x2=Math.ceil(t.x2),l.y2=Math.ceil(t.y2)}const c=n.dpr%1;(c||.5!==c)&&(l.x1=Math.floor(l.x1*n.dpr)/n.dpr,l.y1=Math.floor(l.y1*n.dpr)/n.dpr,l.x2=Math.ceil(l.x2*n.dpr)/n.dpr,l.y2=Math.ceil(l.y2*n.dpr)/n.dpr),this.backupDirtyBounds.copy(l),n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0);const u=l.width()*n.dpr<n.canvas.width||l.height()*n.dpr<n.canvas.height;n.save(),n.translate(s,a,!0),u&&(n.beginPath(),n.rect(l.x1,l.y1,l.width(),l.height()),n.clip()),r.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,n,i),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:me.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:me.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,i,Th.allocate(1,0,0,1,0,0)):this.renderItem(t,i)})),n.restore(),n.restore(),n.draw(),n.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=vc(e,i,me.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,i,n,r){if(i.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==i.startAtId||i.startAtId===t._uid))return i.break=!0,void this._increaseRender(t,i);if(this.useDirtyBounds&&!e.isRectIntersect(t.AABBBounds,this.dirtyBounds,!1))return;let s,a=n;if(this.useDirtyBounds){s=Cc.allocateByObj(this.dirtyBounds);const e=t.transMatrix;a=Th.allocateByObj(n).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(a.getInverse())}this.renderItem(t,i,{drawingCb:()=>{var e;r?t.forEachChildren((t=>{i.break||(t.isContainer?this.renderGroup(t,i,a):this.renderItem(t,i))})):yc(t,me.zIndex,(t=>{i.break||(t.isContainer?this.renderGroup(t,i,a):this.renderItem(t,i))}),!1,!!(null===(e=i.context)||void 0===e?void 0:e.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(s),Cc.free(s),Th.free(a))}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const a=s.layer.getNativeHandler().getContext(),o=s.drawContribution||Ve.get(kl);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:s.layer,context:a,startAtId:t._uid,break:!1})),s.drawContribution=o;const h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=r.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(h._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:h._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,i,n){if(this.InterceptorContributions.length)for(let e=0;e<this.InterceptorContributions.length;e++){const r=this.InterceptorContributions[e];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,i,this,n))return}const r=this.getRenderContribution(t);if(!r)return;let s,a=!1;if(t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;if(a=!(!e&&!i),a){s=this.dirtyBounds.clone();const n=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(n),this.dirtyBounds.translate(-e,-i)}}if(this.useDirtyBounds&&!t.isContainer&&!e.isRectIntersect(t.AABBBounds,this.dirtyBounds,!1))return void(a&&this.dirtyBounds.copy(s));const o=null!=i.startAtId&&t._uid!==i.startAtId;if(t._uid===i.startAtId&&(i.startAtId=null),n&&(n.skipDraw=o),o?t.isContainer&&r.draw(t,this.currentRenderService,i,n):r.draw(t,this.currentRenderService,i,n),a&&this.dirtyBounds.copy(s),this.InterceptorContributions.length)for(let e=0;e<this.InterceptorContributions.length;e++){const n=this.InterceptorContributions[e];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,i,this))return}}selectRenderByType(t){return e.Logger.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){var n;const{clear:r}=i;if(r){const s=e.getCanvas(),{width:a=s.width,height:o=s.height}=i,h=0,l=0;e.clearRect(h,l,a,o);const c=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(c&&c.backgroundImg&&c.resources){const t=c.resources.get(r);t&&"success"===t.state&&t.data&&e.drawImage(t.data,h,l,a,o)}else e.fillStyle=Nh(e,r,{AABBBounds:{x1:h,y1:l,x2:h+a,y2:l+o}},0,0),e.fillRect(h,l,a,o)}}afterDraw(t,e){}};Pc=L([m(),I(0,f(Dl)),I(1,g(N)),I(1,y(xc)),D("design:paramtypes",[Array,Object])],Pc);let Ec=class{constructor(t){this.groupRenderContribitions=t,this.numberType=ls}drawShape(i,n,r,s,a,o,h,l){const c=Ui(i,null==o?void 0:o.theme).group,{fill:u=c.fill,background:d,stroke:p=c.stroke,opacity:g=c.opacity,width:f=c.width,height:m=c.height,clip:y=c.clip,fillOpacity:b=c.fillOpacity,strokeOpacity:v=c.strokeOpacity,cornerRadius:x=c.cornerRadius,path:A=c.path,lineWidth:B=c.lineWidth,visible:T=c.visible}=i.attribute,w=Fs(g,b,f,m,u),S=js(g,v,f,m),_=Ns(u,d),C=Ws(p,B);if(!i.valid||!T)return;if(!y){if(!_&&!C)return;if(!(w||S||h||l||d))return}if(A&&A.length&&a.drawContribution){const t=n.disableFill,e=n.disableStroke,i=n.disableBeginPath;n.disableFill=!0,n.disableStroke=!0,n.disableBeginPath=!0,A.forEach((t=>{a.drawContribution.getRenderContribution(t).draw(t,a.renderService,a,o)})),n.disableFill=t,n.disableStroke=e,n.disableBeginPath=i}else 0===x||e.isArray(x)&&x.every((t=>0===t))?(n.beginPath(),n.rect(r,s,f,m)):(n.beginPath(),tl(n,r,s,f,m,x));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Jh));const P={doFill:_,doStroke:C};this._groupRenderContribitions.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke&&e.drawShape(i,n,r,s,_,C,w,S,c,a,h,l,P)})),y&&n.clip(),n.setShadowBlendStyle&&n.setShadowBlendStyle(i,i.attribute,c),P.doFill&&(h?h(n,i.attribute,c):w&&(n.setCommonStyle(i,i.attribute,r,s,c),n.fill())),P.doStroke&&(l?l(n,i.attribute,c):S&&(n.setStrokeStyle(i,i.attribute,r,s,c),n.stroke())),this._groupRenderContribitions.forEach((e=>{e.time===t.BaseRenderContributionTime.afterFillStroke&&e.drawShape(i,n,r,s,_,C,w,S,c,a,h,l)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const a=Ui(t,null==n?void 0:n.theme).group,o=r.modelMatrix;if(r.camera){const e=wh.allocate(),i=wh.allocate();Mh(i,t,a),Eh(e,o||e,i),r.modelMatrix=e,wh.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:h=a.scrollX,scrollY:l=a.scrollY}=t.attribute;let c;(h||l)&&r.translate(h,l),n&&n.drawingCb&&(c=n.drawingCb()),r.modelMatrix!==o&&wh.free(r.modelMatrix),r.modelMatrix=o,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};Ec=L([m(),I(0,g(N)),I(0,y(ea)),D("design:paramtypes",[Object])],Ec);let Mc=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=us}drawShape(t,e,i,n,r,s,a,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=Ui(t).line,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:g=l.strokeOpacity,lineWidth:f=l.lineWidth,visible:m=l.visible}=t.attribute,y=Gs(d,p,c),b=zs(d,g),v=Ns(c),x=Ws(u,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(y||b||a||o))return;const{context:A}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,A,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a,o)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),dl(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setStrokeStyle(t,r,a,o,s),e.stroke())}};Mc=L([m()],Mc);let kc=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=as}drawShape(t,e,i,n,r,s,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:o}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const l=Ui(t).area,{fill:c=l.fill,fillOpacity:u=l.fillOpacity,opacity:d=l.opacity,visible:p=l.visible}=t.attribute,g=Gs(d,u,c),f=Ns(c);if(!t.valid||!p)return;if(!f)return;if(!g&&!a)return;for(let r=s;r<s+o;r++)this.drawIncreaseSegment(t,e,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),pl(e.camera?e:e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setCommonStyle(t,r,a,o,s),e.fill())}};var Rc;kc=L([m()],kc),function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Rc||(Rc={}));let Oc=class extends Pc{constructor(t,e,i,n){super(t,n),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=n,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=Rc.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new j([])}}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return U(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:n,x:r=0,y:s=0}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r,s,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:me.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:me.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{n.restore(),n.restore(),n.draw(),n.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return U(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return U(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>U(this,void 0,void 0,(function*(){if(2!==t.count)yield bc(t,me.zIndex,((i,n)=>{if(this.status===Rc.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,e)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const n=t.getChildAt(0);if(n.incremental&&n.attribute.segments)for(n.incrementalAt||(n.incrementalAt=0);n.incrementalAt<n.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:n.incrementalAt,length:n.incremental},this.renderItem(n,e),n.incrementalAt+=n.incremental,yield this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return U(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return U(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return U(this,void 0,void 0,(function*(){this.rendering&&(this.status=Rc.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=Rc.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return U(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>U(this,void 0,void 0,(function*(){yield bc(t,me.zIndex,(t=>U(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};Oc=L([m(),I(0,f(Dl)),I(1,g(Mc)),I(2,g(kc)),I(3,g(N)),I(3,y(xc)),D("design:paramtypes",[Array,Object,Object,Object])],Oc);var Lc=new n((e=>{e(Wh).toSelf().inSingletonScope(),e(Fh).toSelf().inSingletonScope(),e($l).to(Pc),e(kl).to(Oc),e(Ul).to(Ec).inSingletonScope(),e(Dl).toService(Ul),G(e,ea),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),G(e,la),G(e,Dl),e(wc).toSelf().inSingletonScope(),e(xc).toService(wc),G(e,xc)}));let Ic=!1;function Dc(){Ic||(Ic=!0,Ve.load(Us),Ve.load(ac),Ve.load(Ql),Ve.load(sc),Ve.load(cc),function(t){t.load(uc),t.load(dc),t.load(mc)}(Ve),function(t){t.load(Lc)}(Ve))}Dc();const Uc=Ve.get(V);Oe.global=Uc;const Nc=Ve.get(ks);Oe.graphicUtil=Nc;const Wc=Ve.get(Ms);Oe.transformUtil=Wc;const Gc=Ve.get(xs);Oe.graphicService=Gc;const Fc=Ve.get(Rs);Oe.layerService=Fc;class zc{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=i.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Oe.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),Oe.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){Oe.graphicService.hooks.onAttributeUpdate.taps=Oe.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),Oe.graphicService.hooks.onSetStage.taps=Oe.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class jc{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=i.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=r/100,o=s/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class Hc{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=i.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Oe.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,n)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),Oe.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){Oe.graphicService.hooks.onAddIncremental.taps=Oe.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),Oe.graphicService.hooks.onClearIncremental.taps=Oe.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,Oe.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,Object.assign({x:t.x,y:t.y,width:i.viewWidth,height:i.viewHeight,stage:t,layer:i,clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}class Vc{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=i.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)})),Oe.graphicService.hooks.onRelease.tap(this.key,(t=>{this.removeDom(t)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key))}drawHTML(t){"browser"===Oe.global.env&&t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:me.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:me.zIndex)})).forEach((t=>{this.renderGroupHTML(t)}))}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeDom(t){t.bindDom&&t.bindDom.size&&(t.bindDom.forEach((t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)})),t.bindDom.clear())}renderGraphicHTML(t){const{html:e}=t.attribute;if(!e)return void(t.bindDom&&t.bindDom.size&&(t.bindDom.forEach((t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)})),t.bindDom.clear()));const i=t.stage;if(!i)return;const{dom:n,container:r,width:s,height:a,style:o,anchorType:h="boundsLeftTop"}=e;t.bindDom||(t.bindDom=new Map);const l=t.bindDom.get(n);if(l&&(!r||r===l.container))return;let c,u;t.bindDom.forEach((({wrapGroup:t})=>{Oe.global.removeDom(t)})),c="string"==typeof n?(new DOMParser).parseFromString(n,"text/html").firstChild:n;const d=r||(!0===i.params.enableHtmlAttribute?null:i.params.enableHtmlAttribute);u=d?"string"==typeof d?Oe.global.getElementById(d):d:t.stage.window.getContainer();const p=Oe.global.createDom({tagName:"div",width:s,height:a,style:o,parent:u});p&&(p.appendChild(c),t.bindDom.set(n,{dom:c,container:r,wrapGroup:p})),p.style.pointerEvents="none",p.style.position||(p.style.position="absolute",u.style.position="relative");let g=0,f=0;if("position"===h){const e=t.transMatrix;g=e.e,f=e.f}else{const e=t.AABBBounds;g=e.x1,f=e.y1}const m=Oe.global.getElementTopLeft(u,!1),y=i.window.getTopLeft(!1),b=g+y.left-m.left,v=f+y.top-m.top;p.style.left=`${b}px`,p.style.top=`${v}px`}}const Yc=new e.AABBBounds;class Xc{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=i.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),Oe.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(Yc.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(Yc,t.parent&&t.parent.globalTransMatrix)))})),Oe.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!r||e.dirty(n.globalAABBBounds))})),Oe.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){Oe.graphicService.hooks.beforeUpdateAABBBounds.taps=Oe.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),Oe.graphicService.hooks.afterUpdateAABBBounds.taps=Oe.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),Oe.graphicService.hooks.onRemove.taps=Oe.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const Kc=new e.AABBBounds;class qc{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=i.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new e.AABBBounds}tryLayout(t){if(this.layouting)return;this.layouting=!0;const e=t.parent;if(!e||!t.needUpdateLayout())return;const i=Ui(e).group,{display:n=i.display}=e.attribute;if("flex"!==n)return;const{flexDirection:r=i.flexDirection,flexWrap:s=i.flexWrap,justifyContent:a=i.justifyContent,alignItems:o=i.alignItems,alignContent:h=i.alignContent,clip:l=i.clip}=e.attribute;let c=0,u=0,d=0;if(e.forEachChildren((t=>{const e=t.AABBBounds;"column"===r||"column-reverse"===r?(u+=e.height(),c=Math.max(c,e.width())):(c+=e.width(),u=Math.max(u,e.height())),d+=e.x1,d+=e.y1,d+=e.x2,d+=e.y2})),!isFinite(d))return;const p=e.attribute.width||c,g=e.attribute.height||u;e.attribute.width||(e.attribute.width=0),e.attribute.height||(e.attribute.height=0),this.tempBounds.copy(e._AABBBounds);const f={main:{len:p,field:"x"},cross:{len:g,field:"y"},dir:1},m=f.main,y=f.cross;"row-reverse"===r?f.dir=-1:"column"===r?(m.len=g,y.len=p,m.field="y",y.field="x"):"column-reverse"===r&&(m.len=g,y.len=p,m.field="y",y.field="x",f.dir=-1);let b=0,v=0;const x=[];e.forEachChildren((t=>{const e=t.AABBBounds,i="x"===m.field?e.width():e.height(),n="x"===y.field?e.width():e.height();x.push({mainLen:i,crossLen:n}),b+=i,v=Math.max(v,n)}));const A=[];if(b>m.len&&"wrap"===s){let t=0,e=0;x.forEach((({mainLen:i,crossLen:n},r)=>{t+i>m.len?0===t?(A.push({idx:r,mainLen:t+i,crossLen:n}),t=0,e=0):(A.push({idx:r-1,mainLen:t,crossLen:n}),t=i,e=n):(t+=i,e=Math.max(e,n))})),A.push({idx:x.length-1,mainLen:t,crossLen:e})}else A.push({idx:x.length-1,mainLen:b,crossLen:v});const B=e.getChildren();let T=0;if(A.forEach((t=>{this.layoutMain(e,B,a,m,x,T,t),T=t.idx+1})),v=A.reduce(((t,e)=>t+e.crossLen),0),1===A.length)if("flex-end"===o){const t=y.len;this.layoutCross(B,o,y,t,x,A[0],0)}else if("center"===o){const t=y.len/2;this.layoutCross(B,o,y,t,x,A[0],0)}else B.forEach((t=>{t.attribute[y.field]=$c(t,y.field)}));else if("flex-start"===h){T=0;let t=0;A.forEach(((e,i)=>{this.layoutCross(B,"flex-start",y,t,x,A[i],T),T=e.idx+1,t+=e.crossLen}))}else if("center"===h){T=0;let t=Math.max(0,(y.len-v)/2);A.forEach(((e,i)=>{this.layoutCross(B,"center",y,t+e.crossLen/2,x,A[i],T),T=e.idx+1,t+=e.crossLen}))}else if("space-around"===h){T=0;const t=Math.max(0,(y.len-v)/A.length/2);let e=t;A.forEach(((i,n)=>{this.layoutCross(B,"flex-start",y,e,x,A[n],T),T=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===h){T=0;const t=Math.max(0,(y.len-v)/(2*A.length-2));let e=0;A.forEach(((i,n)=>{this.layoutCross(B,"flex-start",y,e,x,A[n],T),T=i.idx+1,e+=i.crossLen+2*t}))}B.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),e.addUpdateLayoutTag(),l||this.tempBounds.equals(e.AABBBounds)||(this.tryLayout(e),this.layouting=!1)}layoutMain(t,e,i,n,r,s,a){if("flex-start"===i){let t=0;for(let i=s;i<=a.idx;i++)e[i].attribute[n.field]=t+$c(e[i],n.field),t+=r[i].mainLen}else if("flex-end"===i){let t=n.len;for(let i=s;i<=a.idx;i++)t-=r[i].mainLen,e[i].attribute[n.field]=t+$c(e[i],n.field)}else if("space-around"===i)if(a.mainLen>=n.len){let t=0;for(let i=s;i<=a.idx;i++)e[i].attribute[n.field]=t+$c(e[i],n.field),t+=r[i].mainLen}else{const t=a.idx-s+1,i=(n.len-a.mainLen)/t/2;let o=i;for(let t=s;t<=a.idx;t++)e[t].attribute[n.field]=o+$c(e[t],n.field),o+=r[t].mainLen+2*i}else if("space-between"===i)if(a.mainLen>=n.len){let t=0;for(let i=s;i<=a.idx;i++)e[i].attribute[n.field]=t+$c(e[i],n.field),t+=r[i].mainLen}else{const t=a.idx-s+1,i=(n.len-a.mainLen)/(2*t-2);let o=0;for(let t=s;t<=a.idx;t++)e[t].attribute[n.field]=o+$c(e[t],n.field),o+=r[t].mainLen+2*i}else if("center"===i){let t=(n.len-a.mainLen)/2;for(let i=s;i<=a.idx;i++)e[i].attribute[n.field]=t+$c(e[i],n.field),t+=r[i].mainLen}}layoutCross(t,e,i,n,r,s,a){if("flex-end"===e)for(let e=a;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen+$c(t[e],i.field);else if("center"===e)for(let e=a;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen/2+$c(t[e],i.field);else for(let e=a;e<=s.idx;e++)t[e].attribute[i.field]=n+$c(t[e],i.field)}activate(t){this.pluginService=t,Oe.graphicService.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t),this.layouting=!1})),Oe.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&t.isContainer&&Kc.copy(n)})),Oe.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&t.isContainer&&(Kc.equals(i)||(this.tryLayout(t),this.layouting=!1))})),Oe.graphicService.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t),this.layouting=!1}))}deactivate(t){Oe.graphicService.hooks.onAttributeUpdate.taps=Oe.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),Oe.graphicService.hooks.onSetStage.taps=Oe.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}function $c(t,i){if(!t.attribute.boundsPadding)return 0;if("number"==typeof(n=t.attribute.boundsPadding)&&Number.isFinite(n))return t.attribute.boundsPadding;if(e.isArray(t.attribute.boundsPadding)&&1===t.attribute.boundsPadding.length)return t.attribute.boundsPadding[0];var n;const r=yn(t.attribute.boundsPadding);return"x"===i?r[3]:"y"===i?r[0]:0}const Zc=new en;Zc.addTimeline(sn);Zc.setFPS(60);class Jc{constructor(i,n,r=.8){this.dir=i,this.color=n,this.colorRgb=rr.Get(n,t.ColorType.Color1),this.ambient=r;const s=e.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);this.formatedDir=[i[0]/s,i[1]/s,i[2]/s]}computeColor(i,n){const r=this.formatedDir,s=e.min(e.max((i[0]*r[0]+i[1]*r[1]+i[2]*r[2])*(1-this.ambient/2),0)+this.ambient,1);let a;a=e.isString(n)?rr.Get(n,t.ColorType.Color1):n;const o=this.colorRgb;return`rgb(${o[0]*a[0]*s}, ${o[1]*a[1]*s}, ${o[2]*a[2]*s})`}}function Qc(t,i,n,r){let s,a,o,h,l,c,u,d,p,g;const f=i[0],m=i[1],y=i[2],b=r[0],v=r[1],x=r[2],A=n[0],B=n[1],T=n[2];return Math.abs(f-A)<e.epsilon&&Math.abs(m-B)<e.epsilon&&Math.abs(y-T)<e.epsilon?Bh.identity(t):(u=f-A,d=m-B,p=y-T,g=1/Math.hypot(u,d,p),u*=g,d*=g,p*=g,s=v*p-x*d,a=x*u-b*p,o=b*d-v*u,g=Math.hypot(s,a,o),g?(g=1/g,s*=g,a*=g,o*=g):(s=0,a=0,o=0),h=d*o-p*a,l=p*s-u*o,c=u*a-d*s,g=Math.hypot(h,l,c),g?(g=1/g,h*=g,l*=g,c*=g):(h=0,l=0,c=0),t[0]=s,t[1]=h,t[2]=u,t[3]=0,t[4]=a,t[5]=l,t[6]=d,t[7]=0,t[8]=o,t[9]=c,t[10]=p,t[11]=0,t[12]=-(s*f+a*m+o*y),t[13]=-(h*f+l*m+c*y),t[14]=-(u*f+d*m+p*y),t[15]=1,t)}function tu(t,e,i,n,r,s,a){const o=1/(e-i),h=1/(n-r),l=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*o,t[13]=(r+n)*h,t[14]=(a+s)*l,t[15]=1,t}function eu(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],g=e[11],f=e[12],m=e[13],y=e[14],b=e[15];let v=i[0],x=i[1],A=i[2],B=i[3];return t[0]=v*n+x*o+A*u+B*f,t[1]=v*r+x*h+A*d+B*m,t[2]=v*s+x*l+A*p+B*y,t[3]=v*a+x*c+A*g+B*b,v=i[4],x=i[5],A=i[6],B=i[7],t[4]=v*n+x*o+A*u+B*f,t[5]=v*r+x*h+A*d+B*m,t[6]=v*s+x*l+A*p+B*y,t[7]=v*a+x*c+A*g+B*b,v=i[8],x=i[9],A=i[10],B=i[11],t[8]=v*n+x*o+A*u+B*f,t[9]=v*r+x*h+A*d+B*m,t[10]=v*s+x*l+A*p+B*y,t[11]=v*a+x*c+A*g+B*b,v=i[12],x=i[13],A=i[14],B=i[15],t[12]=v*n+x*o+A*u+B*f,t[13]=v*r+x*h+A*d+B*m,t[14]=v*s+x*l+A*p+B*y,t[15]=v*a+x*c+A*g+B*b,t}function iu(t,e,i){const n=e[0],r=e[1],s=e[2];let a=i[3]*n+i[7]*r+i[11]*s+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/a,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/a,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/a,t}class nu{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=wh.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=wh.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return Qc(this._viewMatrixCached,t,e,i),this._vp||(this._vp=wh.allocate()),this._vp=eu(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=wh.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=wh.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return tu(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=wh.allocate()),this._vp=eu(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return iu(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;iu(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}let ru;function su(){if(null==ru){try{ru=!!window}catch(t){ru=!1}if(ru)try{ru=!tt}catch(t){ru=!0}}}function au(){return su(),ru}const ou="white";class hu extends Cs{set viewBox(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}get viewBox(){return this._viewBox}get x(){return this._viewBox.x1}set x(t){this._viewBox.translate(t-this._viewBox.x1,0)}get y(){return this._viewBox.y1}set y(t){this._viewBox.translate(0,t-this._viewBox.y1)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this._viewBox.width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this._viewBox.height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:ou}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(t={}){var i;super({}),this._onVisibleChange=t=>{this._skipRender<0||(t?(this.dirtyBounds&&this.dirtyBounds.setValue(0,0,this._viewBox.width(),this._viewBox.height()),this._skipRender>1&&this.renderNextFrame(),this._skipRender=0):this._skipRender=1)},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new Ii,this.hooks={beforeRender:new j(["stage"]),afterRender:new j(["stage"])},this.global=Oe.global,!this.global.env&&au()&&this.global.setEnv("browser"),this.window=Ve.get(_i),this.renderService=Ve.get(Zl),this.pluginService=Ve.get(hc),this.layerService=Ve.get(Rs),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this._viewBox=new e.AABBBounds,t.viewBox?this._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):this._viewBox.setValue(0,0,this.width,this.height),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._subView=!(this._viewBox.width()===this.width&&this._viewBox.height()===this.height),this._background=null!==(i=t.background)&&void 0!==i?i:ou,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||Zc,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new rn,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&e.isString(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new $i(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,viewport:{viewBox:this._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(t=!1){t&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:s,fieldRatio:a=1,fieldDepth:o}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:a,fieldDepth:o})}set3dOptions(t){var e,i,n,r,s,a;this.option3d=t;const o=this.get3dOptions(t),{light:h,center:l,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:g}=o,{dir:f=[1,1,-1],color:m="white",ambient:y}=h,b=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),v=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[b,v,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(a=l.dz)&&void 0!==a?a:0)];let A=0,B=0,T=0;c||(A=Math.sin(u)+b,B=Math.sin(d)+v,T=Math.cos(u)*Math.cos(d)*1),this.light=new Jc(f,m,y);const w={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:g,viewParams:{pos:[A,B,T],center:x,up:[0,1,0]}};this.camera?this.camera.params=w:this.camera=new nu(w),t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new jc))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new zc))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new Hc))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new e.Bounds;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new Xc,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new qc))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new Vc))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}tryUpdateAABBBounds(){const t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear()),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e<t.length;e++){let n=t[e];"virtual"===n.layerMode&&(n=n.getNativeHandler().mainHandler.layer),i.includes(n)||i.push(n)}i.forEach((t=>{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())},Object.assign({renderStyle:this.renderStyle},e))}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e,i=!0){this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render()}setViewBox(t,e,i,n,r){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),s&&this.render()}setDpr(t,e=!0){this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,i){this.pickerService||(this.pickerService=Ve.get(ec));const n=this.pickerService.pick(this.children,new e.Point(t,i),{bounds:this.AABBBounds});return!(!(null==n?void 0:n.graphic)&&!(null==n?void 0:n.group))&&n}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.eventSystem&&this.eventSystem.release(),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release()}setStage(t){}dirty(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t,e){this.forEachChildren(((i,n)=>{i.drawTo(t,Object.assign(Object.assign({},e),{renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:0===n,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())}))}))}renderToNewWindow(t=!0,e){const i=Ve.get(_i);if(t)i.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""});else{const t=e?e.width():Math.min(this.viewWidth,this.window.width-this.x),n=e?e.height():Math.min(this.viewHeight,this.window.height-this.y);i.create({width:t,height:n,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""})}const n=e?-e.x1:0,r=e?-e.y1:0;return this.renderTo(i,{x:n,y:r,width:e?e.x2:i.width,height:e?e.y2:i.height}),i}toCanvas(t=!0,e){const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}}var lu;!function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(lu||(lu={}));const cu=new e.Matrix(1,0,0,1,0,0),uu={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,i){this.matrix=new e.Matrix(1,0,0,1,0,0),this.stack=[],this.dpr=i,this.applyedMatrix=new e.Matrix(1,0,0,1,0,0),this.path=new ne}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Th.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(Th.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Th.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,a=!0){this.matrix.multiply(t,e,i,n,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},uu),function(t,e,i){return Ti(t,0,!1,e,i)}(this.path.commandList,uu.x,uu.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},uu);const i=Uh(this,this.lineWidth,this.dpr);return function(t,e,i,n){return Ti(t,e,!0,i,n)}(this.path.commandList,i,uu.x,uu.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(cu,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Th.free(t))),this.stack.length=0}},t.EmptyContext2d=L([m(),D("design:paramtypes",[Object,Number])],t.EmptyContext2d);const du={WIDTH:500,HEIGHT:500,DPR:1};t.BaseCanvas=class{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:n=du.WIDTH,height:r=du.HEIGHT,dpr:s=du.DPR,x:a,y:o,id:h,canvasControled:l=!0}=t;this._x=null!=a?a:0,this._y=null!=o?o:0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==t.visiable,this.controled=l,this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:h,h&&(i.id=h),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},t.BaseCanvas.env="browser",t.BaseCanvas=L([m(),D("design:paramtypes",[Object])],t.BaseCanvas),t.BaseEnvContribution=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new e.AABBBounds}removeDom(t){return!1}createDom(t){return null}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}},t.BaseEnvContribution=L([m()],t.BaseEnvContribution),t.BaseWindowHandlerContribution=class{constructor(){this._uid=i.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}},t.BaseWindowHandlerContribution=L([m(),D("design:paramtypes",[])],t.BaseWindowHandlerContribution),t.DefaultPickService=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=Oe.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,i,n){let r={graphic:null,group:null};n.pickerService=this;let s=0,a=0;if(n&&n.bounds){if(!n.bounds.contains(i.x,i.y))return r;s=n.bounds.x1,a=n.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),n.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new e.Matrix(1,0,0,1,s,a);let h;for(let e=t.length-1;e>=0&&(r=t[e].isContainer?this.pickGroup(t[e],i,o,n):this.pickItem(t[e],i,o,n),!r.graphic);e--)h||(h=r.group);if(r.graphic||(r.group=h),this.pickContext&&(this.pickContext.inuse=!1),r.graphic){let t=r.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(r.params={shadowTarget:r.graphic},r.graphic=t.shadowHost)}return r}containsPoint(t,e,i){var n;return!!(null===(n=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===n?void 0:n.graphic)}pickGroup(t,i,n,r){let s={group:null,graphic:null};if(!1===t.attribute.visibleAll)return s;const a=r.pickContext,o=a.modelMatrix;if(a.camera){const e=t.transMatrix,i=wh.allocate();if(Ph(i,e),o){if(i){const t=wh.allocate();a.modelMatrix=Eh(t,o,i),wh.free(i)}}else Ph(i,t.globalTransMatrix),a.modelMatrix=i}if(this.InterceptorContributions.length)for(let e=0;e<this.InterceptorContributions.length;e++){const s=this.InterceptorContributions[e];if(s.beforePickItem){const e=s.beforePickItem(t,this,i,r,{parentMatrix:n});if(e)return a.modelMatrix!==o&&wh.free(a.modelMatrix),a.modelMatrix=o,e}}const h=t.transMatrix,l=Th.allocateByObj(n),c=new e.Point(i.x,i.y);l.transformPoint(c,c);const u=t.AABBBounds.containsPoint(c);if(!u&&!t.stage.camera)return s;const d=this.pickItem(t,c.clone(),n,r);d&&d.graphic&&(s.graphic=d.graphic,s.params=d.params);const p=!1!==t.attribute.pickable&&u;return l.multiply(h.a,h.b,h.c,h.d,h.e,h.f),!1===t.attribute.childrenPickable||d&&d.graphic||yc(t,me.zIndex,(a=>{if(a.isContainer){const n=new e.Point(i.x,i.y),o=Ui(t).group,{scrollX:h=o.scrollX,scrollY:c=o.scrollY}=t.attribute;n.x-=h,n.y-=c,s=this.pickGroup(a,n,l,r)}else{const o=new e.Point(i.x,i.y);l.transformPoint(o,o);const h=Ui(t).group,{scrollX:c=h.scrollX,scrollY:u=h.scrollY}=t.attribute;o.x-=c,o.y-=u;const d=this.pickItem(a,o,n,r);d&&d.graphic&&(s.graphic=d.graphic,s.params=d.params)}return!!s.graphic||!!s.group}),!0,!!a.camera),a.modelMatrix!==o&&wh.free(a.modelMatrix),a.modelMatrix=o,s.graphic||s.group||!p||t.stage.camera||(s.group=t),Th.free(l),s}selectPicker(t){const e=this.pickerMap.get(t.numberType);return e||null}},t.DefaultPickService=L([m(),I(0,g(N)),I(0,y(rc)),D("design:paramtypes",[Object])],t.DefaultPickService),t.DefaultGlobalPickerService=class{constructor(){this.global=Oe.global,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,i,n){let r={graphic:null,group:null};const s=new e.Matrix(1,0,0,1,0,0);let a;for(let e=0;e<t.length;e++){if(t[e].isContainer)r=this.pickGroup(t[e],i,s,n);else{const a=this.pickItem(t[e],i,s,n);a&&(r.graphic=a.graphic,r.params=a.params)}if(r.graphic)break;a||(a=r.group)}if(r.graphic||(r.group=a),r.graphic){let t=r.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(r.params={shadowTarget:r.graphic},r.graphic=t.shadowHost)}return r}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,i,n,r){let s={group:null,graphic:null};if(!1===t.attribute.visibleAll)return s;const a=t.transMatrix,o=new e.Point(i.x,i.y);n.transformPoint(o,o);const h=t.AABBBounds.containsPoint(o);if(!h)return s;const l=!1!==t.attribute.pickable&&h;return n.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((t=>{if(t.isContainer)s=this.pickGroup(t,i,n,r);else{const a=new e.Point(i.x,i.y);n.transformPoint(a,a);const o=this.pickItem(t,a,n,r);o&&(s.graphic=o.graphic,s.params=o.params)}return!!s.graphic||!!s.group})),s.graphic||s.group||!l||(s.group=t),s}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}},t.DefaultGlobalPickerService=L([m(),D("design:paramtypes",[])],t.DefaultGlobalPickerService);class pu{constructor(){this.pools=[]}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}class gu extends pu{allocate(t){if(!this.pools.length)return Oe.graphicService.creator.rect(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return Oe.graphicService.creator.rect(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const fu=new gu;class mu extends pu{allocate(t){if(!this.pools.length)return Oe.graphicService.creator.arc(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return Oe.graphicService.creator.arc(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const yu=new mu;class bu extends pu{allocate(t){if(!this.pools.length)return Oe.graphicService.creator.area(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return Oe.graphicService.creator.area(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const vu=new bu;class xu extends pu{allocate(t){if(!this.pools.length)return Oe.graphicService.creator.circle(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return Oe.graphicService.creator.circle(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Au=new xu;class Bu extends pu{allocate(t){if(!this.pools.length)return Oe.graphicService.creator.line(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return Oe.graphicService.creator.line(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Tu=new Bu;class wu extends pu{allocate(t){if(!this.pools.length)return Oe.graphicService.creator.path(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return Oe.graphicService.creator.path(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Su=new wu;class _u extends pu{allocate(t){if(!this.pools.length)return Oe.graphicService.creator.symbol(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return Oe.graphicService.creator.symbol(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Cu=new _u;class Pu extends pu{allocate(t){if(!this.pools.length)return Oe.graphicService.creator.text(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return Oe.graphicService.creator.text(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Eu=new Pu;class Mu{constructor(){this.map={text:Eu,symbol:Cu}}gc(t){t.isContainer?t.forEachChildren((t=>this.gc(t))):this.gcItem(t)}gcItem(t){const e=this.map[t.type];e&&e.free(t)}}const ku=new Mu;let Ru=!1;const Ou=new n((e=>{Ru||(Ru=!0,e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(Rl).to(t.DefaultCanvasArcRender).inSingletonScope(),e(Dl).toService(Rl),e(Js).toService(t.DefaultBaseInteractiveRenderContribution),G(e,Js))}));let Lu=!1;const Iu=new n((e=>{Lu||(Lu=!0,e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(Fl).to(t.DefaultCanvasRectRender).inSingletonScope(),e(Dl).toService(Fl),e(t.SplitRectAfterRenderContribution).toSelf(),e(t.SplitRectBeforeRenderContribution).toSelf(),e(sa).toService(t.SplitRectAfterRenderContribution),e(sa).toService(t.SplitRectBeforeRenderContribution),e(sa).toService(t.DefaultBaseInteractiveRenderContribution),G(e,sa))}));let Du=!1;const Uu=new n((e=>{Du||(Du=!0,e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Mc).toSelf().inSingletonScope(),e(Nl).to(t.DefaultCanvasLineRender).inSingletonScope(),e(Dl).toService(Nl))}));let Nu=!1;const Wu=new n((e=>{Nu||(Nu=!0,e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(Ll).to(t.DefaultCanvasAreaRender).inSingletonScope(),e(Dl).toService(Ll),e(Qs).toService(t.DefaultBaseInteractiveRenderContribution),G(e,Qs),e(kc).toSelf().inSingletonScope())}));let Gu=!1;const Fu=new n((e=>{Gu||(Gu=!0,e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(jl).to(t.DefaultCanvasSymbolRender).inSingletonScope(),e(Dl).toService(jl),e(aa).toService(t.DefaultBaseInteractiveRenderContribution),G(e,aa))}));let zu=!1;const ju=new n((e=>{zu||(zu=!0,e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(Il).to(t.DefaultCanvasCircleRender).inSingletonScope(),e(Dl).toService(Il),e(ta).toService(t.DefaultBaseInteractiveRenderContribution),G(e,ta))}));let Hu=!1;const Vu=new n((e=>{Hu||(Hu=!0,e(Hl).to(t.DefaultCanvasTextRender).inSingletonScope(),e(Dl).toService(Hl),e(oa).toService(t.DefaultBaseInteractiveRenderContribution),G(e,oa))}));let Yu=!1;const Xu=new n((e=>{Yu||(Yu=!0,e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(Wl).to(t.DefaultCanvasPathRender).inSingletonScope(),e(Dl).toService(Wl),e(na).toService(t.DefaultBaseInteractiveRenderContribution),G(e,na))}));let Ku=!1;const qu=new n((e=>{Ku||(Ku=!0,e(Gl).to(t.DefaultCanvasPolygonRender).inSingletonScope(),e(Dl).toService(Gl),e(ra).toService(t.DefaultBaseInteractiveRenderContribution),G(e,ra))}));let $u=class{constructor(){this.numberType=hs}drawShape(t,e,i,n,r,s,a,o){r.drawContribution&&t.getSubGraphic().forEach((t=>{const h=r.drawContribution.getRenderContribution(t);h&&h.drawShape&&h.drawShape(t,e,i,n,r,s,a,o)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=Ui(t),a=t.getSubGraphic();a.length&&a.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};$u=L([m()],$u);let Zu=!1;const Ju=new n((t=>{Zu||(Zu=!0,t(Xl).to($u).inSingletonScope(),t(Dl).toService(Xl))}));let Qu=class extends Dh{constructor(){super(),this.numberType=ys,this.builtinContributions=[wl],this.init()}drawShape(t,e,i,n,r){const s=Ui(t).richtext,{strokeOpacity:a=s.strokeOpacity,opacity:o=s.opacity,fillOpacity:h=s.fillOpacity,visible:l=s.visible}=t.attribute;if(!t.valid||!l)return;const c=Gs(o,h,!0),u=Gs(o,a,!0);if(!c)return;e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,u,c,u,s,r);t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,u,c,u,s,r)}drawIcon(t,e,i,n,r){var s;const a=Ui(t).richtextIcon,{width:o=a.width,height:h=a.height,opacity:l=a.opacity,image:c,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:y=o,backgroundHeight:b=h}=t.attribute;if(m&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-o)/2,r=(b-h)/2;0===f?(e.beginPath(),e.rect(i-t,n-r,y,b)):(e.beginPath(),tl(e,i-t,n-r,y,b,f)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const v=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));v&&"success"===v.state&&(e.globalAlpha=l,e.drawImage(v.data,i,n,o,h))}draw(t,e,i){const n=Ui(t).richtext;this._draw(t,n,!1,i)}};Qu=L([m(),D("design:paramtypes",[])],Qu);let td=!1;const ed=new n((t=>{td||(td=!0,t(Vl).to(Qu).inSingletonScope(),t(Dl).toService(Vl))}));let id=!1;const nd=new n((e=>{id||(id=!0,e(Kl).to(t.DefaultCanvasImageRender).inSingletonScope(),e(Dl).toService(Kl),e(ia).toService(t.DefaultBaseInteractiveRenderContribution),G(e,ia))}));let rd=class extends Dh{constructor(){super(...arguments),this.type="rect3d",this.numberType=ms}drawShape(t,e,i,n,r,s,a,o){var h;const l=Ui(t,null==s?void 0:s.theme).rect3d,{fill:c=l.fill,stroke:u=l.stroke,x1:d,y1:p,x:g,y:f,opacity:m=l.opacity,fillOpacity:y=l.fillOpacity,lineWidth:b=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:x=l.visible}=t.attribute;let{width:A,height:B}=t.attribute;A=(null!=A?A:d-g)||0,B=(null!=B?B:p-f)||0;const T=null!==(h=this.z)&&void 0!==h?h:0,w=Fs(m,y,A,B,c),S=js(m,v,A,B),_=Ns(c),C=Ws(u,b);if(!t.valid||!x)return;if(!_&&!C)return;if(!(w||S||a||o))return;const{light:P,camera:E}=r.stage||{},M=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,T,M,r,e,P,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,T,M,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const a=s[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},h=s[n[1]],l={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(o.x,o.y,o.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,a,o,h){const l=rr.Get(s,t.ColorType.Color255),c=r.vertices,u=c.map((t=>a.view(t[0],t[1],t[2])[2])),d=[];r.polygons.forEach(((t,e)=>{d.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=u[i[0]],s=u[i[1]],a=u[i[2]],o=u[i[3]];t.ave_z=r+s+a+o})),d.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),d.forEach((t=>{const{polygon:r,normal:u}=t.polygon,d=c[r[0]],p=c[r[1]],g=c[r[2]],f=c[r[3]],m={x:e+d[0],y:i+d[1],z:n+d[2]},y={x:e+p[0],y:i+p[1],z:n+p[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]},v={x:e+f[0],y:i+f[1],z:n+f[2]};a.beginPath(),a.moveTo(m.x,m.y,m.z),a.lineTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(v.x,v.y,v.z),a.closePath(),h?h(a,null,null):(a.fillStyle=o?o.computeColor(u,l):s,a.fill())}))}draw(t,e,i){const n=Ui(t).rect;this._draw(t,n,!1,i)}};rd=L([m()],rd);let sd=!1;const ad=new n((t=>{sd||(sd=!0,t(zl).to(rd).inSingletonScope(),t(Dl).toService(zl))}));let od=class extends Dh{constructor(){super(...arguments),this.numberType=ss}drawShape(i,n,r,s,a,o,h,l){var c;const u=Ui(i,null==o?void 0:o.theme).arc,{fill:d=u.fill}=i.attribute,p=this.valid(i,u,h,l);if(!p)return;const{fVisible:g,sVisible:f,doFill:m,doStroke:y}=p,b=null!==(c=this.z)&&void 0!==c?c:0,{outerRadius:v=u.outerRadius,innerRadius:x=u.innerRadius,height:A=10}=i.attribute,B=rr.Get(d,t.ColorType.Color255),{light:T}=a.stage||{},w=a.hack_pieFace,S={top:b,bottom:b+A},_={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===w||"top"===w?(n.beginPath(),function(t,i,n,r,s,a,o){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=e.abs(l-h),u=l>h;let d=!1;if(a<o){const t=a;a=o,o=t}if(a<=e.epsilon)i.moveTo(n,r,s);else if(c>=e.pi2-e.epsilon)i.moveTo(n+a*e.cos(h),r+a*e.sin(h),s),i.arc(n,r,a,h,l,!u,s),o>e.epsilon&&(i.moveTo(n+o*e.cos(l),r+o*e.sin(l),s),i.arc(n,r,o,l,h,u,s));else{const{outerDeltaAngle:c,innerDeltaAngle:p,outerStartAngle:g,outerEndAngle:f,innerEndAngle:m,innerStartAngle:y}=t.getParsePadAngle(h,l),b=a*e.cos(g),v=a*e.sin(g),x=o*e.cos(m),A=o*e.sin(m);c<.001?d=!0:(i.moveTo(n+b,r+v,s),i.arc(n,r,a,g,f,!u,s)),!(o>e.epsilon)||p<.001?(i.lineTo(n+x,r+A,s),d=!0):(i.lineTo(n+x,r+A,s),i.arc(n,r,o,m,y,u,s))}i.closePath()}(i,n,r,s,S[w],v,x),n.setShadowBlendStyle&&n.setShadowBlendStyle(i,i.attribute,u),m&&(h?h(n,i.attribute,u):g&&(n.setCommonStyle(i,i.attribute,r,s,u),n.fillStyle=T?T.computeColor(_[w],B):d,n.fill())),y&&(l?l(n,i.attribute,u):f&&(n.setStrokeStyle(i,i.attribute,r,s,u),n.stroke()))):"outside"!==w&&"inside"!==w||("inside"===w&&(n.save(),n.beginPath(),n.arc(r,s,x,0,e.pi2,!0,S.top),n.clip()),n.beginPath(),function(t,i,n,r,s,a,o,h){const{startAngle:l,endAngle:c}=t.getParsedAngle(),u=e.abs(c-l),d=c>l;let p=!1;if(o<=e.epsilon)i.moveTo(n,r,s);else if(u>=e.pi2-e.epsilon)i.moveTo(n+o*e.cos(l),r+o*e.sin(l),s),i.arc(n,r,o,l,c,!d,s),i.lineTo(n+o*e.cos(c),r+o*e.sin(c),a),i.arc(n,r,o,c,l,d,a);else{const{innerouterDeltaAngle:t,innerouterStartAngle:u,innerouterEndAngle:g}=h(l,c),f=o*e.cos(u),m=o*e.sin(u),y=o*e.cos(g),b=o*e.sin(g);t<.001?p=!0:(i.moveTo(n+f,r+m,s),i.arc(n,r,o,u,g,!d,s),i.lineTo(n+y,r+b,a),i.arc(n,r,o,g,u,d,a))}i.closePath()}(i,n,r,s,S.top,S.bottom,"outside"===w?v:x,((t,e)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:a,innerEndAngle:o,innerStartAngle:h}=i.getParsePadAngle(t,e);return"outside"===w?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:o,innerouterStartAngle:h}})),n.setShadowBlendStyle&&n.setShadowBlendStyle(i,i.attribute,u),m&&(h?h(n,i.attribute,u):g&&(n.setCommonStyle(i,i.attribute,r,s,u),n.fillStyle=T?T.computeColor(_[w],B):d,n.fill())),y&&(l?l(n,i.attribute,u):f&&(n.setStrokeStyle(i,i.attribute,r,s,u),n.stroke())),"inside"===w&&n.restore())}draw(t,e,i,n){const r=Ui(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}};od=L([m()],od);let hd=!1;const ld=new n((t=>{hd||(hd=!0,t(Ol).to(od).inSingletonScope(),t(Dl).toService(Ol))}));let cd=class extends Dh{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=gs}drawShape(t,e,i,n,r,s,a,o){var h;const l=Ui(t,null==s?void 0:s.theme).polygon,{fill:c=l.fill,stroke:u=l.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(h=this.z)&&void 0!==h?h:0;if(!this.valid(t,l,a,o))return;const{light:g,camera:f}=r.stage||{},m=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,p,m,d,r,e,g,f,t,l,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,p,m,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const a=s[n[0]],o=s[n[1]],h={x:t+a[0],y:e+a[1],z:i+a[2]},l={x:t+o[0],y:e+o[1],z:i+o[2]};r.beginPath(),r.moveTo(h.x,h.y,h.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,a,o,h,l,c,u,d){const p=rr.Get(a,t.ColorType.Color255),g=r.vertices,f=g.map((t=>o.view(t[0],t[1],t[2])[2])),m=[];r.polygons.forEach(((t,e)=>{if(!s[e])return;m.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=f[i[0]],a=f[i[1]],o=f[i[2]],h=f[i[3]];t.ave_z=r+a+o+h})),m.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),m.forEach((t=>{const{polygon:r,normal:s}=t.polygon,l=g[r[0]],f=g[r[1]],m=g[r[2]],y=g[r[3]],b={x:e+l[0],y:i+l[1],z:n+l[2]},v={x:e+f[0],y:i+f[1],z:n+f[2]},x={x:e+m[0],y:i+m[1],z:n+m[2]},A={x:e+y[0],y:i+y[1],z:n+y[2]};o.beginPath(),o.moveTo(b.x,b.y,b.z),o.lineTo(v.x,v.y,v.z),o.lineTo(x.x,x.y,x.z),o.lineTo(A.x,A.y,A.z),o.closePath(),d?d(o,c.attribute,u):(o.fillStyle=h?h.computeColor(s,p):a,o.fill())}))}draw(t,e,i){const n=Ui(t).polygon;this._draw(t,n,!1,i)}};cd=L([m()],cd);let ud=!1;const dd=new n((t=>{ud||(ud=!0,t(Yl).to(cd).inSingletonScope(),t(Dl).toService(Yl))}));t.ACustomAnimate=an,t.ARC3D_NUMBER_TYPE=ss,t.ARC_NUMBER_TYPE=rs,t.AREA_NUMBER_TYPE=as,t.Animate=hn,t.AnimateGroup=class extends an{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?nn[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends an{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?nn[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Application=Re,t.Arc=sh,t.Arc3d=oh,t.Arc3dRender=Ol,t.ArcRender=Rl,t.ArcRenderContribution=Js,t.Area=ih,t.AreaRender=Ll,t.AreaRenderContribution=Qs,t.AttributeAnimate=class extends an{constructor(t,e,i){super({},t,e,i)}getEndProps(){return this.to}onBind(){Object.keys(this.to).forEach((t=>{this.from[t]=this.target.getComputedAttribute(t)}))}onEnd(){}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this.to,this.from)}},t.AutoEnablePlugins=oc,t.BaseRender=Dh,t.Basis=Ut,t.BeforeRenderConstribution=Jl,t.BoundsContext=K,t.BoundsPicker=ic,t.CIRCLE_NUMBER_TYPE=os,t.CanvasFactory=Ye,t.CanvasTextLayout=ma,t.CbAnimate=on,t.Circle=ua,t.CircleRender=Il,t.CircleRenderContribution=ta,t.ClipAngleAnimate=class extends kn{constructor(t,e,i,n,r){var s,a,o,h,l,c,u,d,p,g,f,m;const y=null!==(a=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==a?a:{},b=null!==(o=y.width)&&void 0!==o?o:0,v=null!==(h=y.height)&&void 0!==h?h:0,x=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",A=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,B=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let T=0,w=0;"anticlockwise"===B?(w="in"===x?A+2*Math.PI:A,w=A+2*Math.PI):(T=A,w="out"===x?A+2*Math.PI:A);const S=Oe.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:b/2,y:null!==(f=null===(g=null==r?void 0:r.center)||void 0===g?void 0:g.y)&&void 0!==f?f:v/2,outerRadius:null!==(m=null==r?void 0:r.radius)&&void 0!==m?m:(b+v)/2,innerRadius:0,startAngle:T,endAngle:w,fill:!0});let _,C;"anticlockwise"===B?(_={startAngle:A+2*Math.PI},C={startAngle:A}):(_={endAngle:A},C={endAngle:A+2*Math.PI}),super("in"===x?_:C,"in"===x?C:_,i,n,{group:null==r?void 0:r.group,clipGraphic:S})}},t.ClipDirectionAnimate=class extends kn{constructor(t,e,i,n,r){var s,a,o,h,l,c,u,d,p;const g=null!==(a=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==a?a:{},f=null!==(h=null!==(o=null==r?void 0:r.width)&&void 0!==o?o:g.width)&&void 0!==h?h:0,m=null!==(c=null!==(l=null==r?void 0:r.height)&&void 0!==l?l:g.height)&&void 0!==c?c:0,y=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",b=null!==(d=null==r?void 0:r.direction)&&void 0!==d?d:"x",v=null!==(p=null==r?void 0:r.orient)&&void 0!==p?p:"positive",x=Oe.graphicService.creator.rect({x:0,y:0,width:"in"===y&&"x"===b?0:f,height:"in"===y&&"y"===b?0:m,fill:!0});let A={},B={};"y"===b?"negative"===v?(A={y:m,height:0},B={y:0,height:m}):(A={height:0},B={height:m}):"negative"===v?(A={x:f,width:0},B={x:0,width:f}):(A={width:0},B={width:f}),super("in"===y?A:B,"in"===y?B:A,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=kn,t.ClipRadiusAnimate=class extends kn{constructor(t,e,i,n,r){var s,a,o,h,l,c,u,d,p,g,f;const m=null!==(a=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==a?a:{},y=null!==(o=m.width)&&void 0!==o?o:0,b=null!==(h=m.height)&&void 0!==h?h:0,v=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,A=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((y/2)**2+(b/2)**2),B=Oe.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:y/2,y:null!==(f=null===(g=null==r?void 0:r.center)||void 0===g?void 0:g.y)&&void 0!==f?f:b/2,outerRadius:"out"===v?A:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),T={outerRadius:x},w={outerRadius:A};super("in"===v?T:w,"in"===v?w:T,i,n,{group:null==r?void 0:r.group,clipGraphic:B})}},t.ColorInterpolate=qs,t.ColorStore=rr,t.CommonRenderContribution=ha,t.Container=R,t.ContainerModule=n,t.Context2dFactory=Xe,t.ContributionProvider=N,t.CurveContext=class{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,i){return new Et(new e.Point(this._lastX,this._lastY),new e.Point(t,i))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,i,n,r,s,a){const o=new Ct(new e.Point(this._lastX,this._lastY),new e.Point(t,i),new e.Point(n,r),new e.Point(s,a));this.path.curves.push(o),this._lastX=s,this._lastY=a}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}},t.CustomEvent=Hi,t.CustomPath2D=ne,t.CustomSymbolClass=Bo,t.DefaultArcAllocate=mu,t.DefaultArcAttribute=ye,t.DefaultArcRenderContribution=jh,t.DefaultAreaAllocate=bu,t.DefaultAreaAttribute=be,t.DefaultAttribute=me,t.DefaultBaseBackgroundRenderContribution=Wh,t.DefaultBaseTextureRenderContribution=Fh,t.DefaultCanvasAllocate=wi,t.DefaultCircleAllocate=xu,t.DefaultCircleAttribute=ve,t.DefaultCircleRenderContribution=Xh,t.DefaultConnectAttribute=ge,t.DefaultDebugAttribute=fe,t.DefaultFillStyle=he,t.DefaultGlyphAttribute=Ae,t.DefaultGraphicAllocate=pu,t.DefaultGraphicMemoryManager=Mu,t.DefaultGroupAttribute=xe,t.DefaultGroupBackgroundRenderContribution=Zh,t.DefaultImageAttribute=Me,t.DefaultImageBackgroundRenderContribution=el,t.DefaultLayout=ae,t.DefaultLineAllocate=Bu,t.DefaultLineAttribute=Be,t.DefaultMat4Allocate=Bh,t.DefaultMatrixAllocate=Ah,t.DefaultMorphingAnimateConfig=dn,t.DefaultPathAllocate=wu,t.DefaultPathAttribute=Te,t.DefaultPickStyle=de,t.DefaultPolygonAttribute=we,t.DefaultRect3dAttribute=_e,t.DefaultRectAllocate=gu,t.DefaultRectAttribute=Se,t.DefaultRectRenderContribution=nl,t.DefaultRichTextAttribute=Ee,t.DefaultRichTextIconAttribute=ke,t.DefaultStateAnimateConfig=un,t.DefaultStrokeStyle=ce,t.DefaultStyle=pe,t.DefaultSymbolAllocate=_u,t.DefaultSymbolAttribute=Ce,t.DefaultSymbolRenderContribution=ol,t.DefaultTextAllocate=Pu,t.DefaultTextAttribute=Pe,t.DefaultTextStyle=ue,t.DefaultTicker=en,t.DefaultTimeline=rn,t.DefaultTransform=oe,t.DrawContribution=$l,t.DynamicLayerHandlerContribution=Ls,t.EnvContribution=H,t.EventManager=Xi,t.EventSystem=$i,t.EventTarget=Ki,t.FadeInPlus=class extends an{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=Mn.LEFT_TO_RIGHT,fill:a=!0,stroke:o=!0}=r||{};this.direction=s,this.fill=a,this.stroke=o,this.fillGradient={gradient:"linear",stops:[]},this.strokeGradient={gradient:"linear",stops:[]}}getEndProps(){return{fill:this.toFill,stroke:this.toStroke}}onBind(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}onEnd(){}onUpdate(t,e,i){if(this.toFill&&this.toStroke)switch(this.direction){case Mn.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case Mn.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case Mn.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case Mn.STROKE:this.strokePath(t,e,i);break;default:this.leftToRight(t,e,i)}}leftToRight(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,6*e),color:"transparent"}],i.stroke=this.strokeGradient}}strokePath(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=300,n=e*t;i.lineDash=[n,t-n]}}rightToLeft(t,e,i){}topToBottom(t,e,i){}bottomToTop(t,e,i){}},t.FederatedEvent=Gi,t.FederatedMouseEvent=Fi,t.FederatedPointerEvent=zi,t.FederatedWheelEvent=ji,t.GLYPH_NUMBER_TYPE=hs,t.GRAPHIC_UPDATE_TAG_KEY=Er,t.GROUP_NUMBER_TYPE=ls,t.Generator=i,t.GlobalPickerService=nc,t.Glyph=Wo,t.GlyphRender=Xl,t.Graphic=Ir,t.GraphicAnimate=class extends an{constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=null==r?void 0:r.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=As,t.GraphicPicker=tc,t.GraphicRender=Dl,t.GraphicService=xs,t.GraphicUtil=ks,t.Group=Cs,t.GroupFadeIn=class extends an{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}},t.GroupFadeOut=class extends an{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupRender=Ul,t.GroupRenderContribution=ea,t.IMAGE_NUMBER_TYPE=cs,t.Image=Ho,t.ImageRender=Kl,t.ImageRenderContribution=ia,t.IncreaseCount=class extends an{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,i,n,r,s,a,o,h;this.fromNumber=e.isNumber(null===(t=this.from)||void 0===t?void 0:t.text)?null===(i=this.from)||void 0===i?void 0:i.text:Number.parseFloat(null===(n=this.from)||void 0===n?void 0:n.text),this.toNumber=e.isNumber(null===(r=this.to)||void 0===r?void 0:r.text)?null===(s=this.to)||void 0===s?void 0:s.text:Number.parseFloat(null===(a=this.to)||void 0===a?void 0:a.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(h=null===(o=this.params)||void 0===o?void 0:o.fixed)&&void 0!==h?h:Math.max(e.getDecimalPlaces(this.fromNumber),e.getDecimalPlaces(this.toNumber)))}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}},t.IncrementalDrawContribution=kl,t.InputText=class extends an{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,i,n,r;if(this.fromText=null!==(i=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==i?i:"",this.toText=null!==(r=null===(n=this.to)||void 0===n?void 0:n.text)&&void 0!==r?r:"",!this.toText||e.isArray(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=Oe.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){var n;if(!1===this.valid)return;const r=this.fromText.length,s=this.toText.length,a=Math.ceil(r+(s-r)*e);i.text=this.toText.substr(0,a);const o=null===(n=this.target.shadowRoot)||void 0===n?void 0:n.at(0),h=this.target.clipedWidth+2;o.setAttribute("x",h)}},t.InteractiveSubRenderContribution=la,t.LINE_NUMBER_TYPE=us,t.Layer=Es,t.LayerService=Rs,t.Line=ko,t.LineRender=Nl,t.Linear=Ot,t.LinearClosed=Qt,t.ManualTickHandler=Zi,t.ManualTicker=class extends en{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Zi;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}tickAt(t){this.tickerHandler.tick(t-this.lastFrameTime,(t=>{this.handleTick(t,{once:!0})}))}ifCanStop(){return!1}},t.Mat4Allocate=vh,t.MatrixAllocate=bh,t.Meteor=class extends an{get lastPos(){return this.posList[this.posList.length-1]}constructor(t,e,i,n){super(null,null,e,i,n),this.size=t,this.posList=[]}onBind(){const e=this.target.attachShadow();this.root=e;for(let i=0;i<this.size;i++){const n=this.target.clone(),r=Math.min((this.size-i)/this.size*3,1),s=Math.min(.2+.7/this.size);n.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:s},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(n)}}onUpdate(t,i,n){if(t)return this.target.detachShadow(),void(this.posList.length=0);const r=this.target.getComputedAttribute("x"),s=this.target.getComputedAttribute("y"),a=new e.Point(r,s);this.posList.length?(this.target.shadowRoot.forEachChildren(((t,e)=>{const i=this.posList[Math.max(this.posList.length-e-1,0)];t.setAttributes({x:i.x-r,y:i.y-s},!1)})),this.posList.push(a)):this.posList.push(a)}},t.MonotoneX=Ht,t.MonotoneY=Vt,t.MorphingPath=vr,t.MotionPath=class extends an{constructor(t,e,i,n,r){var s;super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=null!==(s=r.initAngle)&&void 0!==s?s:0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=Ar,t.NOWORK_ANIMATE_ATTR=Lr,t.Node=Wi,t.PATH_NUMBER_TYPE=ds,t.POLYGON_NUMBER_TYPE=ps,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=gs,t.Path=Qo,t.PathRender=Wl,t.PathRenderContribution=na,t.PickItemInterceptor=rc,t.PickerService=ec,t.PluginService=hc,t.Polygon=ch,t.PolygonRender=Gl,t.PolygonRenderContribution=ra,t.Pyramid3d=dh,t.Pyramid3dRender=Yl,t.RAFTickHandler=Qi,t.RECT3D_NUMBER_TYPE=ms,t.RECT_NUMBER_TYPE=fs,t.RICHTEXT_NUMBER_TYPE=ys,t.RafBasedSTO=Cn,t.Rect=Lo,t.Rect3DRender=zl,t.Rect3d=Uo,t.RectRender=Fl,t.RectRenderContribution=sa,t.ReflectSegContext=kt,t.RenderSelector=ql,t.RenderService=Zl,t.ResourceLoader=_r,t.RichText=$o,t.RichTextRender=Vl,t.RotateBySphereAnimate=class extends an{onStart(){const{center:t,r:i}="function"==typeof this.params?this.params():this.params,n=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),s=this.target.getComputedAttribute("z"),a=Math.acos((r-t.y)/i);let o=Math.acos((n-t.x)/i/Math.sin(a));s-t.z<0&&(o=e.pi2-o),this.theta=o,this.phi=a}onBind(){}onEnd(){}onUpdate(t,i,n){if(null==this.phi||null==this.theta)return;const{center:r,r:s,cb:a}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*i,h=this.theta+o,l=this.phi,c=s*Math.sin(l)*Math.cos(h)+r.x,u=s*Math.cos(l)+r.y,d=s*Math.sin(l)*Math.sin(h)+r.z;for(n.x=c,n.y=u,n.z=d,n.alpha=h+e.pi/2;n.alpha>e.pi2;)n.alpha-=e.pi2;n.alpha=e.pi2-n.alpha,n.zIndex=-1e4*n.z,a&&a(n)}},t.SVG_ATTRIBUTE_MAP=Bs,t.SVG_ATTRIBUTE_MAP_KEYS=Ts,t.SVG_PARSE_ATTRIBUTE_MAP=ws,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=Ss,t.SYMBOL_NUMBER_TYPE=bs,t.SegContext=Mt,t.ShadowRoot=gh,t.Stage=hu,t.StaticLayerHandlerContribution=Os,t.Step=$t,t.StreamLight=class extends an{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}onStartLineOrArea(t){var e;const i=this.target.attachShadow(),n=Oe.graphicService.creator[t](Object.assign({},null===(e=this.params)||void 0===e?void 0:e.attribute));this[t]=n,n.pathProxy=new ne,i.add(n)}onStartRect(){var t;const e=this.target.attachShadow(),i=this.target.AABBBounds.height(),n=Oe.graphicService.creator.rect(Object.assign(Object.assign({height:i,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(t=this.params)||void 0===t?void 0:t.attribute),{x:0,y:0,width:0}));this.rect=n,e.add(n)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){return this.rect?this.onUpdateRect(t,e,i):this.line||this.area?this.onUpdateLineOrArea(t,e,i):void 0}onUpdateRect(e,i,n){var r,s,a,o,h,l;const c=null!==(r=this.target.attribute.width)&&void 0!==r?r:250,u=null!==(a=null===(s=this.params)||void 0===s?void 0:s.streamLength)&&void 0!==a?a:c,d=null!==(l=null===(h=null===(o=this.params)||void 0===o?void 0:o.attribute)||void 0===h?void 0:h.width)&&void 0!==l?l:60,p=-d,g=p+(u-p)*i,f=Math.max(g,0),m=Math.min(Math.min(g+d,d),u-g),y=m+f>c?Math.max(c-f,0):m;this.rect.setAttributes({x:f,width:y},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}onUpdateLineOrArea(t,e,i){const n=this.line||this.area;if(!n)return;const r=n.pathProxy,s=this.target;s.cache||s.cacheArea?this._onUpdateLineOrAreaWithCache(r,s,t,e,i):this._onUpdateLineWithoutCache(r,s,t,e,i);const a=s.attribute;n.setAttributes(Object.assign({stroke:a.stroke},n.attribute)),n.addUpdateBoundTag()}_onUpdateLineOrAreaWithCache(t,e,i,n,r){if(t.clear(),"line"===e.type){let i=e.cache;Array.isArray(i)||(i=[i]);const r=i.reduce(((t,e)=>t+e.getLength()),0),s=[];return i.forEach((t=>{t.curves.forEach((t=>s.push(t)))})),this._updateCurves(t,s,r,n)}if("area"===e.type){const i=e.cacheArea,r=i.top.curves.reduce(((t,e)=>t+e.getLength()),0);return this._updateCurves(t,i.top.curves,r,n)}}_updateCurves(t,e,i,n){var r,s;const a=i*n,o=Math.min(null!==(s=a+(null===(r=this.params)||void 0===r?void 0:r.streamLength))&&void 0!==s?s:10,i);let h=0,l=!1;for(let i=0;i<e.length;i++){const n=e[i],r=n.getLength(),s=1-(h+r-a)/r;let c,u=1-(h+r-o)/r;if(h<a&&h+r>a)if(l=!0,n.p2&&n.p3){const[e,i]=_t(n,s);t.moveTo(i.p0.x,i.p0.y),c=i}else{const e=n.getPointAt(s);t.moveTo(e.x,e.y)}if(h<o&&h+r>o){if(n.p2&&n.p3){c&&(u=(o-a)/c.getLength());const[e]=_t(c||n,u);t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else{const e=n.getPointAt(u);t.lineTo(e.x,e.y)}break}if(l)if(n.p2&&n.p3){const e=c||n;t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else t.lineTo(n.p1.x,n.p1.y);h+=r}}_onUpdateLineWithoutCache(t,i,n,r,s){var a,o;const{points:h,curveType:l}=i.attribute;if(!h||h.length<2||"linear"!==l)return;let c=0;for(let t=1;t<h.length;t++)c+=e.PointService.distancePP(h[t],h[t-1]);const u=c*r,d=Math.min(null!==(o=u+(null===(a=this.params)||void 0===a?void 0:a.streamLength))&&void 0!==o?o:10,c),p=[];let g=0;for(let t=1;t<h.length;t++){const i=e.PointService.distancePP(h[t],h[t-1]);if(g<u&&g+i>u&&p.push(e.PointService.pointAtPP(h[t-1],h[t],1-(g+i-u)/i)),g<d&&g+i>d){p.push(e.PointService.pointAtPP(h[t-1],h[t],1-(g+i-d)/i));break}p.length&&p.push(h[t]),g+=i}if(p.length&&!(p.length<2)){t.clear(),t.moveTo(p[0].x,p[0].y);for(let e=1;e<p.length;e++)t.lineTo(p[e].x,p[e].y)}}},t.SubAnimate=ln,t.Symbol=Po,t.SymbolRender=jl,t.SymbolRenderContribution=aa,t.TEXT_NUMBER_TYPE=vs,t.TagPointsUpdate=class extends an{constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType="appear"===(null==r?void 0:r.newPointAnimateType)?"appear":"grow"}onBind(){var t,i;const n=null===(t=this.from)||void 0===t?void 0:t.points,r=null===(i=this.to)||void 0===i?void 0:i.points;this.fromPoints=n?Array.isArray(n)?n:[n]:[],this.toPoints=r?Array.isArray(r)?r:[r]:[];const s=new Map;this.fromPoints.forEach((t=>{t.context&&s.set(t.context,t)}));let a,o,h=1/0,l=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(s.has(this.toPoints[t].context)){h=t,a=s.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(s.has(this.toPoints[t].context)){l=t,o=s.get(this.toPoints[t].context);break}let c=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const i=s.get(t.context);return i?(c=i,[i,t]):"appear"===this.newPointAnimateType?[t,t]:e<h&&a?[a,t]:e>l&&o?[o,t]:[c,t]})),this.points=this.interpolatePoints.map((t=>{const i=t[0],n=t[1],r=new e.Point(i.x,i.y,i.x1,i.y1);return r.defined=n.defined,r.context=n.context,r}))}onUpdate(t,e,i){this.points=this.points.map(((t,i)=>{const n=Bn(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=ba,t.TextMeasureContribution=He,t.TextRender=Hl,t.TextRenderContribution=oa,t.Theme=Ii,t.TimeOutTickHandler=Ji,t.TransformUtil=Ms,t.VGlobal=V,t.VWindow=_i,t.VirtualLayerHandlerContribution=Is,t.WILDCARD="*",t.WindowHandlerContribution=Ci,t.WrapText=Aa,t.XMLParser=Yr,t.addArcToBezierPath=bt,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=Wn,t.alignSubpath=On,t.application=Oe,t.applyTransformOnBezierCurves=zn,t.arc3dModule=ld,t.arcModule=Ou,t.areaModule=Wu,t.bezier=mt,t.bezierCurversToPath=jn,t.binarySplitPolygon=Qn,t.bindContributionProvider=G,t.bindContributionProviderNoSingletonScope=F,t.boundStroke=qr,t.builtInSymbolStrMap=So,t.builtinSymbols=To,t.builtinSymbolsMap=wo,t.calcLineCache=ie,t.calculateLineHeight=En,t.canvasAllocate=Si,t.centroidOfSubpath=Dn,t.circleBounds=xn,t.circleModule=ju,t.clock=Vi,t.cloneGraphic=wr,t.colorEqual=function(t,i){const n=e.Color.parseColorString(t),r=e.Color.parseColorString(i);return!(!n||!r)&&(n.r===r.r&&n.g===r.g&&n.b===r.b&&n.opacity===r.opacity)},t.colorStringInterpolationToStr=pr,t.container=Ve,t.cornerTangents=Ys,t.createArc=ah,t.createArc3d=hh,t.createArea=nh,t.createCircle=da,t.createColor=Nh,t.createConicalGradient=function(t,e,i,n,r,s,a,o,h){const l=Math.floor(180*r/Math.PI),c=Ks.GetCanvas(),u=Ks.GetCtx();if(!u)return null;const d=$s.GetSize(o),p=$s.GetSize(h);let g=$s.Get(e,i,n,s,a,d,p);if(g)return g;const f=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),m=l+1,y=r/Math.max(1,m-1),b=qs.getInstance().GetOrCreate(i,n,d,p,e,m),v=2*Math.PI*f/360;c.width=d,c.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,p),u.translate(i,n),u.rotate(s);for(let t=0,e=m-1;t<e&&!(s+t*y>a);t++){const e=b.getColor(t);u.beginPath(),u.rotate(y),u.moveTo(0,0),u.lineTo(f,-2*v),u.lineTo(f,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,p);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),g=t.createPattern(c,"no-repeat"),g&&$s.Set(e,i,n,s,a,g,d,p),g},t.createGlyph=Go,t.createGroup=Ps,t.createImage=Vo,t.createLine=Ro,t.createMat4=xh,t.createPath=th,t.createPolygon=uh,t.createPyramid3d=ph,t.createRect=Io,t.createRect3d=No,t.createRectPath=tl,t.createRichText=Zo,t.createShadowRoot=fh,t.createStage=function(t){return new hu(t)},t.createSymbol=Eo,t.createText=va,t.createWrapText=Ba,t.cubicCalc=wt,t.cubicLength=Tt,t.cubicPointAt=St,t.cubicSubdivide=Rn,t.defaultArcAllocate=yu,t.defaultArcBackgroundRenderContribution=Yh,t.defaultArcRenderContribution=Hh,t.defaultArcTextureRenderContribution=Vh,t.defaultAreaAllocate=vu,t.defaultBaseBackgroundRenderContribution=Gh,t.defaultBaseTextureRenderContribution=zh,t.defaultCircleAllocate=Au,t.defaultCircleBackgroundRenderContribution=$h,t.defaultCircleRenderContribution=Kh,t.defaultCircleTextureRenderContribution=qh,t.defaultGraphicMemoryManager=ku,t.defaultGroupBackgroundRenderContribution=Jh,t.defaultImageBackgroundRenderContribution=il,t.defaultLineAllocate=Tu,t.defaultPathAllocate=Su,t.defaultRectAllocate=fu,t.defaultRectBackgroundRenderContribution=al,t.defaultRectRenderContribution=rl,t.defaultRectTextureRenderContribution=sl,t.defaultSymbolAllocate=Cu,t.defaultSymbolBackgroundRenderContribution=cl,t.defaultSymbolRenderContribution=hl,t.defaultSymbolTextureRenderContribution=ll,t.defaultTextAllocate=Eu,t.defaultTicker=Zc,t.defaultTimeline=sn,t.drawArc=yt,t.drawArcPath=Xs,t.drawAreaSegments=fl,t.drawIncrementalAreaSegments=pl,t.drawIncrementalSegments=dl,t.drawPathProxy=Hs,t.drawSegments=ul,t.enumCommandMap=J,t.fillVisible=Gs,t.findBestMorphingRotation=Nn,t.findNextGraphic=vc,t.foreach=yc,t.foreachAsync=bc,t.genBasisSegments=Wt,t.genBasisTypeSegments=Nt,t.genLinearClosedSegments=te,t.genLinearClosedTypeSegments=ee,t.genLinearSegments=Lt,t.genLinearTypeSegments=It,t.genMonotoneXSegments=Xt,t.genMonotoneYSegments=qt,t.genMonotpneXTypeSegments=Yt,t.genMonotpneYTypeSegments=Kt,t.genNumberType=Zr,t.genStepSegments=Zt,t.genStepTypeSegments=Jt,t.getAttributeFromDefaultAttrList=_n,t.getConicGradientAt=Zs,t.getContextFont=pa,t.getCurrentEnv=function(){return au()?"browser":"node"},t.getExtraModelMatrix=function(t,e,i){const{alpha:n,beta:r}=i.attribute;if(!n&&!r)return null;const{anchor3d:s=i.attribute.anchor}=i.attribute,a=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.AABBBounds;a[0]=e.x1+(e.x2-e.x1)*t}else a[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=i.AABBBounds;a[1]=e.x1+(e.x2-e.x1)*t}else a[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;a[0]+=ga(t,i.clipedWidth)}a[0]+=t,a[1]+=e;const o=wh.allocate();return Ch(o,o,[a[0],a[1],0]),r&&Sh(o,o,r),n&&_h(o,o,n),Ch(o,o,[-a[0],-a[1],0]),o},t.getModelMatrix=Mh,t.getRichTextBounds=function(t){return Lh||(Lh=Rh.CreateGraphic("richtext",{})),Lh.setAttributes(t),Lh.AABBBounds},t.getScaledStroke=Uh,t.getTextBounds=function(t){return Oh||(Oh=Rh.CreateGraphic("text",{})),Oh.setAttributes(t),Oh.AABBBounds},t.getTheme=Ui,t.getThemeFromGroup=Ni,t.globalTheme=Di,t.glyphModule=Ju,t.graphicCreator=Rh,t.graphicService=Gc,t.graphicUtil=Nc,t.imageModule=nd,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.inject=g,t.injectable=m,t.interpolateColor=ar,t.interpolateGradientConicalColor=lr,t.interpolateGradientLinearColor=or,t.interpolateGradientRadialColor=hr,t.interpolatePureColorArray=cr,t.intersect=Vs,t.isBrowserEnv=au,t.isNodeEnv=function(){return su(),!ru},t.isSvg=Xr,t.isTransformKey=Sn,t.isXML=Kr,t.layerService=Fc,t.lineModule=Uu,t.lookAt=Qc,t.mat3Tomat4=Ph,t.mat4Allocate=wh,t.matrixAllocate=Th,t.morphPath=xr,t.multiInject=f,t.multiToOneMorph=(e,i,n)=>{var r,s,a;const o=e.filter((t=>t.toCustomPath&&t.valid));o.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const h=("clone"===(null==n?void 0:n.splitPath)?wr:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:Sr)(i,o.length,!0),l=i.attribute;i.setAttribute("visible",!1);const c=o.map(((t,e)=>mr(t.toCustomPath(),h[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:h[e].globalTransMatrix}))),u=o.map(((t,e)=>br(t.attribute,l)));if(null==n?void 0:n.individualDelay){const r=n.onEnd;let s=o.length;const a=()=>{s--,0===s&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),r&&r())};h.forEach(((t,i)=>{var r,s,h;const l=(null!==(r=n.delay)&&void 0!==r?r:0)+n.individualDelay(i,o.length,e[i],t),d=t.animate(Object.assign({},n,{onEnd:a}));d.wait(l),d.play(new vr({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:dn.duration,null!==(h=n.easing)&&void 0!==h?h:dn.easing))}))}else{const e=null==n?void 0:n.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const o=i.animate(r);(null==n?void 0:n.delay)&&o.wait(n.delay),o.play(new Ar({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:dn.duration,null!==(a=null==n?void 0:n.easing)&&void 0!==a?a:dn.easing))}},t.multiply=eu,t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],g=e[11],f=e[12],m=e[13],y=e[14],b=e[15];let v=i.a,x=i.b,A=0,B=0;return t[0]=v*n+x*o+A*u+B*f,t[1]=v*r+x*h+A*d+B*m,t[2]=v*s+x*l+A*p+B*y,t[3]=v*a+x*c+A*g+B*b,v=i.c,x=i.d,A=0,B=0,t[4]=v*n+x*o+A*u+B*f,t[5]=v*r+x*h+A*d+B*m,t[6]=v*s+x*l+A*p+B*y,t[7]=v*a+x*c+A*g+B*b,v=0,x=0,A=1,B=0,t[8]=v*n+x*o+A*u+B*f,t[9]=v*r+x*h+A*d+B*m,t[10]=v*s+x*l+A*p+B*y,t[11]=v*a+x*c+A*g+B*b,v=i.e,x=i.f,A=0,B=1,t[12]=v*n+x*o+A*u+B*f,t[13]=v*r+x*h+A*d+B*m,t[14]=v*s+x*l+A*p+B*y,t[15]=v*a+x*c+A*g+B*b,t},t.multiplyMat4Mat4=Eh,t.named=y,t.newThemeObj=Ri,t.oneToMultiMorph=(t,e,i)=>{var n;const r=e.filter((t=>t&&t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const s=("clone"===(null==i?void 0:i.splitPath)?wr:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:Sr)(t,r.length,!1),a=null==i?void 0:i.onEnd;let o=r.length;const h=()=>{o--,0===o&&a&&a()};r.forEach(((e,n)=>{var a;const o=s[n],l=(null!==(a=null==i?void 0:i.delay)&&void 0!==a?a:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(n,r.length,o,e):0);xr(o,e,Object.assign({},i,{onEnd:h,delay:l}),t.globalTransMatrix)}))},t.ortho=tu,t.parsePadding=yn,t.parseStroke=fn,t.parseSvgPath=at,t.pathModule=Xu,t.pathToBezierCurves=Fn,t.point=Dt,t.pointEqual=An,t.pointInterpolation=Bn,t.pointInterpolationHighPerformance=function(t,i,n,r){const{x:s,y:a}=e.pointAt(t.x,t.y,i.x,i.y,n),{x:o,y:h}=e.pointAt(t.x1,t.y1,i.x1,i.y1,n);return r.x=s,r.y=a,r.x1=o,r.y1=h,r.defined=i.defined,r},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every(((t,i)=>An(t,e[i]))):!Number.isNaN(t.x+t.y)&&An(t,e))},t.pointsInterpolation=Tn,t.polygonModule=qu,t.preLoadAllModule=Dc,t.pyramid3dModule=dd,t.rafBasedSto=Pn,t.rect3dModule=ad,t.rectFillVisible=Fs,t.rectModule=Iu,t.rectStrokeVisible=js,t.recursiveCallBinarySplit=tr,t.registerArc3dGraphic=function(){Rh.RegisterGraphicCreator("arc3d",hh)},t.registerArcGraphic=function(){Rh.RegisterGraphicCreator("arc",ah)},t.registerAreaGraphic=function(){Rh.RegisterGraphicCreator("area",nh)},t.registerCircleGraphic=function(){Rh.RegisterGraphicCreator("circle",da)},t.registerGlyphGraphic=function(){Rh.RegisterGraphicCreator("glyph",Go)},t.registerGroupGraphic=function(){Rh.RegisterGraphicCreator("group",Ps)},t.registerImageGraphic=function(){Rh.RegisterGraphicCreator("image",Vo)},t.registerLineGraphic=function(){Rh.RegisterGraphicCreator("line",Ro)},t.registerPathGraphic=function(){Rh.RegisterGraphicCreator("path",th)},t.registerPolygonGraphic=function(){Rh.RegisterGraphicCreator("polygon",uh)},t.registerPyramid3dGraphic=function(){Rh.RegisterGraphicCreator("pyramid3d",ph)},t.registerRect3dGraphic=function(){Rh.RegisterGraphicCreator("rect3d",No)},t.registerRectGraphic=function(){Rh.RegisterGraphicCreator("rect",Io)},t.registerRichtextGraphic=function(){Rh.RegisterGraphicCreator("richtext",Zo)},t.registerShadowRootGraphic=function(){Rh.RegisterGraphicCreator("shadowRoot",fh)},t.registerSymbolGraphic=function(){Rh.RegisterGraphicCreator("symbol",Eo)},t.registerTextGraphic=function(){Rh.RegisterGraphicCreator("text",va)},t.registerWrapTextGraphic=function(){Rh.RegisterGraphicCreator("wrapText",Ba)},t.renderCommandList=xt,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.richtextModule=ed,t.rotateX=Sh,t.rotateY=_h,t.runFill=Ns,t.runStroke=Ws,t.segments=ft,t.shouldUseMat4=kh,t.snapLength=Bt,t.splitArc=Yn,t.splitArea=qn,t.splitCircle=Xn,t.splitGraphic=Sr,t.splitLine=$n,t.splitPath=ir,t.splitPolygon=er,t.splitRect=Vn,t.splitToGrids=Hn,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=zs,t.symbolModule=Fu,t.textDrawOffsetX=ga,t.textDrawOffsetY=function(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0},t.textLayoutOffsetY=fa,t.textModule=Vu,t.transformKeys=wn,t.transformMat4=iu,t.transformUtil=Wc,t.translate=Ch,t.verticalLayout=Qr,t.vglobal=Uc,t.waitForAllSubLayers=function(t){return U(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{Oe.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)}))},t.wrapCanvas=Ke,t.wrapContext=function(t,e){return Ve.getNamed(Xe,Oe.global.env)(t,e)},t.xul=function(t){const i=e.isArray(t)?t[0]:t,n=[];if(!i)return n;if(!0===Kr(i)){const t=(new Yr).parse(i);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?n.push(function(t){const e={text:""};ns(t,e);const i=t["#text"];i&&(e.text=i);return e}(t.tc[e])):n.push(function(t){const e={image:"",width:0,height:0};ns(t,e);const i=e.image;i&&(e.image=i.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">"));return e}(t.tc[e]))}))}return n}}));
|